// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
static CORBA::ORB_var anORB;
-// Tags definition
-static long Tag_HypothesisRoot = 1;
-static long Tag_AlgorithmsRoot = 2;
-
-static long Tag_RefOnShape = 1;
-static long Tag_RefOnAppliedHypothesis = 2;
-static long Tag_RefOnAppliedAlgorithms = 3;
-
-static long Tag_SubMeshOnVertex = 4;
-static long Tag_SubMeshOnEdge = 5;
-static long Tag_SubMeshOnFace = 6;
-static long Tag_SubMeshOnSolid = 7;
-static long Tag_SubMeshOnCompound = 8;
-
namespace
{
//---------------------------------------------------------------
{
return GetDomainRoot(theSComponentMesh,
theStudyBuilder,
- Tag_HypothesisRoot,
+ SMESH::Tag_HypothesisRoot,
QObject::tr("SMESH_MEN_HYPOTHESIS"),
"ICON_SMESH_TREE_HYPO");
}
-
+
//---------------------------------------------------------------
inline
{
return GetDomainRoot(theSComponentMesh,
theStudyBuilder,
- Tag_AlgorithmsRoot,
+ SMESH::Tag_AlgorithmsRoot,
QObject::tr("SMESH_MEN_ALGORITHMS"),
"ICON_SMESH_TREE_ALGO");
}
{
SALOMEDS::SObject_var aDomain = GetDomainRoot(theSComponentMesh,
theStudyBuilder,
- Tag_AlgorithmsRoot,
+ SMESH::Tag_AlgorithmsRoot,
theDomainName,
theDomainPixmap);
// Add New Hypothesis
anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
anIOR->SetValue(theIOR.c_str());
-
+
return aSObject;
}
return AddToDomain(theIOR,
theSComponentMesh,
theStudyBuilder,
- Tag_HypothesisRoot,
+ SMESH::Tag_HypothesisRoot,
QObject::tr("SMESH_MEN_HYPOTHESIS"),
"ICON_SMESH_TREE_HYPO");
}
return AddToDomain(theIOR,
theSComponentMesh,
theStudyBuilder,
- Tag_AlgorithmsRoot,
+ SMESH::Tag_AlgorithmsRoot,
QObject::tr("SMESH_MEN_ALGORITHMS"),
"ICON_SMESH_TREE_ALGO");
}
//---------------------------------------------------------------
void
- SetDomain(const char* theMeshOrSubMeshEntry,
+ SetDomain(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder,
SALOMEDS::SObject_var anAppliedDomainSO;
if(!aMeshOrSubMeshSO->FindSubObject(theRefOnAppliedDomainTag,anAppliedDomainSO)){
anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag);
- SALOMEDS::GenericAttribute_var anAttr =
+ SALOMEDS::GenericAttribute_var anAttr =
theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
aName->SetValue(theAppliedDomainMEN.latin1());
//---------------------------------------------------------------
void
- SetHypothesis(const char* theMeshOrSubMeshEntry,
+ SetHypothesis(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder)
theDomainEntry,
theStudy,
theStudyBuilder,
- Tag_RefOnAppliedHypothesis,
+ SMESH::Tag_RefOnAppliedHypothesis,
QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
"ICON_SMESH_TREE_HYPO");
}
//---------------------------------------------------------------
void
- SetAlgorithms(const char* theMeshOrSubMeshEntry,
+ SetAlgorithms(const char* theMeshOrSubMeshEntry,
const char* theDomainEntry,
const SALOMEDS::Study_var& theStudy,
const SALOMEDS::StudyBuilder_var& theStudyBuilder)
theDomainEntry,
theStudy,
theStudyBuilder,
- Tag_RefOnAppliedAlgorithms,
+ SMESH::Tag_RefOnAppliedAlgorithms,
QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
"ICON_SMESH_TREE_ALGO");
}
myStudy = aStudyMgr->GetStudyByID(myStudyID);
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
- aSMESHGen->SetCurrentStudy( myStudy.in() );
+ aSMESHGen->SetCurrentStudy( myStudy.in() );
myStudyBuilder = myStudy->NewBuilder();
SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
if(aSComponent->_is_nil()){
bool aLocked = myStudy->GetProperties()->IsLocked();
- if (aLocked)
+ if (aLocked)
myStudy->GetProperties()->SetLocked(false);
aSComponent = myStudyBuilder->NewComponent("SMESH");
aName = SALOMEDS::AttributeName::_narrow(anAttr);
SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
- if(!aSMESHGUI){
+ if (!aSMESHGUI){
CAM_Module* aModule = anApp->module("Mesh");
- if(!aModule)
+ if(!aModule)
aModule = anApp->loadModule("Mesh");
- aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
+ aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
} //SRN: BugID IPAL9186: end of a fix
aName->SetValue(aSMESHGUI->moduleName());
anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap");
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
- if(aLocked)
+ if (aLocked)
myStudy->GetProperties()->SetLocked(true);
}
//===============================================================
-const char*
-SMESH_Swig::AddNewMesh(const char* theIOR)
+const char* SMESH_Swig::AddNewMesh(const char* theIOR)
{
MESSAGE("AddNewMesh");
// VSR: added temporarily - to be removed - objects are published automatically by engine
SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR);
- if(aSObject->_is_nil()){
+ if (aSObject->_is_nil()){
//Find or Create Hypothesis root
GetHypothesisRoot(mySComponentMesh,myStudyBuilder);
GetAlgorithmsRoot(mySComponentMesh,myStudyBuilder);
-
+
// Add New Mesh
aSObject = myStudyBuilder->NewObject(mySComponentMesh);
SALOMEDS::GenericAttribute_var anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap");
//===============================================================
-const char*
-SMESH_Swig::AddNewHypothesis(const char* theIOR)
+const char* SMESH_Swig::AddNewHypothesis(const char* theIOR)
{
-
MESSAGE("AddNewHypothesis");
-
+
SALOMEDS::SObject_var aSObject = ::AddHypothesis(theIOR,
mySComponentMesh,
myStudyBuilder);
//===============================================================
-const char*
-SMESH_Swig::AddNewAlgorithms(const char* theIOR)
+const char* SMESH_Swig::AddNewAlgorithms(const char* theIOR)
{
MESSAGE("AddNewAlgorithms");
-
+
SALOMEDS::SObject_var aSObject = ::AddAlgorithms(theIOR,
mySComponentMesh,
myStudyBuilder);
//===============================================================
-void
-SMESH_Swig::SetShape(const char* theShapeEntry,
- const char* theMeshEntry)
+void SMESH_Swig::SetShape(const char* theShapeEntry,
+ const char* theMeshEntry)
{
SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID( theMeshEntry );
SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID( theShapeEntry );
-
+
if(!aMeshSO->_is_nil() && !aGeomShapeSO->_is_nil()){
- SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO,Tag_RefOnShape);
+ SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO, SMESH::Tag_RefOnShape);
myStudyBuilder->Addreference(aSObject,aGeomShapeSO);
}
}
//===============================================================
-void
-SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry)
+void SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
+ const char* theDomainEntry)
{
::SetHypothesis(theMeshOrSubMeshEntry,
theDomainEntry,
//===============================================================
-void
-SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry)
+void SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
+ const char* theDomainEntry)
{
::SetAlgorithms(theMeshOrSubMeshEntry,
theDomainEntry,
myStudyBuilder->RemoveObject(aDomainSO);
}
-const char*
-SMESH_Swig::AddSubMesh(const char* theMeshEntry,
- const char* theSubMeshIOR,
- int theShapeType)
+const char* SMESH_Swig::AddSubMesh(const char* theMeshEntry,
+ const char* theSubMeshIOR,
+ int theShapeType)
{
SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry);
if(!aMeshSO->_is_nil()){
QString aSubMeshName;
switch(theShapeType){
case TopAbs_SOLID:
- aShapeTag = Tag_SubMeshOnSolid;
+ aShapeTag = SMESH::Tag_SubMeshOnSolid;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnSolid");
break;
case TopAbs_FACE:
- aShapeTag = Tag_SubMeshOnFace;
+ aShapeTag = SMESH::Tag_SubMeshOnFace;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnFace");
break;
case TopAbs_EDGE:
- aShapeTag = Tag_SubMeshOnEdge;
+ aShapeTag = SMESH::Tag_SubMeshOnEdge;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnEdge");
break;
case TopAbs_VERTEX:
- aShapeTag = Tag_SubMeshOnVertex;
+ aShapeTag = SMESH::Tag_SubMeshOnVertex;
aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnVertex");
break;
default:
- aShapeTag = Tag_SubMeshOnCompound;
- aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnCompound");
+ aShapeTag = SMESH::Tag_SubMeshOnCompound;
+ aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnCompound");
}
-
+
SALOMEDS::SObject_var aSubMeshesRoot;
SALOMEDS::GenericAttribute_var anAttr;
if(!aMeshSO->FindSubObject(aShapeTag,aSubMeshesRoot)){
return "";
}
-const char*
-SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry,
- const char* theGeomShapeEntry,
- const char* theSubMeshIOR,
- int ShapeType)
+const char* SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry,
+ const char* theGeomShapeEntry,
+ const char* theSubMeshIOR,
+ int ShapeType)
{
SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID(theGeomShapeEntry);
if(!aGeomShapeSO->_is_nil()){
aDisp->Display(_entry,1);
}
};
-
+
ProcessVoidEvent(new TEvent(Mesh_Entry));
-
}
-void
-SMESH_Swig::SetName(const char* theEntry,
- const char* theName)
+void SMESH_Swig::SetName(const char* theEntry,
+ const char* theName)
{
SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(theEntry);
SALOMEDS::GenericAttribute_var anAttr;
*/
//================================================================================
-void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
- const bool theIsComputed)
+void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
+ const bool theIsComputed,
+ const bool isEmpty)
{
class TEvent: public SALOME_Event
{
SALOMEDS::Study_var myStudy;
std::string myMeshEntry;
- bool myIsComputed;
+ bool myIsComputed, myIsEmpty;
public:
TEvent(const SALOMEDS::Study_var& theStudy,
const std::string& theMeshEntry,
- const bool theIsComputed):
+ const bool theIsComputed,
+ const bool isEmpty):
myStudy(theStudy),
myMeshEntry(theMeshEntry),
- myIsComputed(theIsComputed)
+ myIsComputed(theIsComputed),
+ myIsEmpty(isEmpty)
{}
virtual
SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str());
if(!aMeshSO->_is_nil())
if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
- SMESH::ModifiedMesh(aMesh,myIsComputed);
+ SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
}
};
ProcessVoidEvent(new TEvent(myStudy,
theMeshEntry,
- theIsComputed));
+ theIsComputed,
+ isEmpty));
}