26 #ifndef _SMESH_GEN_I_HXX_
27 #define _SMESH_GEN_I_HXX_
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(SMESH_Gen)
33 #include CORBA_SERVER_HEADER(SMESH_Mesh)
34 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
35 #include CORBA_CLIENT_HEADER(GEOM_Gen)
36 #include CORBA_CLIENT_HEADER(SALOMEDS)
37 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
38 #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
44 #include <SALOME_Component_i.hxx>
45 #include <SALOME_NamingService.hxx>
46 #include <Utils_CorbaException.hxx>
48 #include <GEOM_Client.hxx>
49 #include <smIdType.hxx>
51 #include <TCollection_AsciiString.hxx>
52 #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
53 #include <TColStd_HSequenceOfAsciiString.hxx>
54 #include <NCollection_DataMap.hxx>
60 class SALOME_LifeCycleCORBA;
73 int addObject(
const std::string& theIOR );
75 int findId(
const std::string& theIOR );
77 std::string getIORbyId(
const int theId );
79 std::string getIORbyOldId(
const int theOldId );
81 void mapOldToNew(
const int oldId,
const int newId );
83 int getOldId(
const int newId );
104 static CORBA::ORB_var
GetORB() {
return myOrb;}
106 static PortableServer::POA_var
GetPOA() {
return myPoa;}
108 static void SetNS(SALOME_NamingService_Abstract *ns);
110 static SALOME_NamingService_Abstract* GetNS();
112 static SALOME_LifeCycleCORBA* GetLCC();
114 static GEOM::GEOM_Gen_var GetGeomEngine( GEOM::GEOM_Object_ptr );
117 SALOMEDS::Study_var
getStudyServant()
const {
return this->getStudyServantVirtual(); }
120 SALOMEDS::SObject_ptr publish(CORBA::Object_ptr theIOR,
121 SALOMEDS::SObject_ptr theFatherObject,
122 const int theTag = 0,
123 const char* thePixMap = 0,
124 const bool theSelectable =
true);
126 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
128 static CORBA::Object_var
SObjectToObject( SALOMEDS::SObject_ptr theSObject );
130 SALOMEDS::SObject_ptr ObjectToSObject( CORBA::Object_ptr theObject );
132 static GEOM::GEOM_Object_ptr ShapeToGeomObject(
const TopoDS_Shape& theShape );
134 static TopoDS_Shape GeomObjectToShape( GEOM::GEOM_Object_ptr theGeomObject );
136 static GEOM::GEOM_Object_ptr GetGeomObjectByEntry(
const std::string& entry );
142 PortableServer::POA_ptr poa,
143 PortableServer::ObjectId* contId,
144 const char* instanceName,
145 const char* interfaceName,
146 bool checkNS =
true);
154 void SetName(
const char* theIOR,
155 const char* theName);
158 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
161 void SetEmbeddedMode( CORBA::Boolean theMode );
163 CORBA::Boolean IsEmbeddedMode();
166 void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
169 CORBA::Boolean IsEnablePublish();
175 bool hasObjectInfo();
178 char* getObjectInfo(
const char* entry);
182 const char* theLibName);
184 SMESH::SMESH_Hypothesis_ptr CreateHypothesisByAverageLength(
const char* theHypType,
185 const char* theLibName,
186 CORBA::Double theAverageLength,
187 CORBA::Boolean theQuadDominated);
190 SMESH::SMESH_Hypothesis_ptr
191 GetHypothesisParameterValues (
const char* theHypType,
192 const char* theLibName,
193 SMESH::SMESH_Mesh_ptr theMesh,
194 GEOM::GEOM_Object_ptr theGeom,
200 CORBA::Boolean GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr theHyp,
201 SMESH::SMESH_Mesh_out theMesh,
202 GEOM::GEOM_Object_out theShape);
210 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments );
214 void SetDefaultNbSegments(CORBA::Long theNbSegments);
219 virtual void SetOption(
const char*,
const char*);
223 virtual char* GetOption(
const char*);
232 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject );
235 SMESH::SMESH_ParallelMesh_ptr CreateParallelMesh( GEOM::GEOM_Object_ptr theShapeObject );
238 SMESH::SMESH_Mesh_ptr CreateEmptyMesh();
241 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV(
const char* theFileName );
248 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL(
const char* theFileName );
255 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF(
const char* theFileName,
256 CORBA::Boolean theMakeRequiredGroups,
257 SMESH::ComputeError_out theError);
260 SMESH::SMESH_Mesh_ptr CreateDualMesh(SMESH::SMESH_IDSource_ptr meshPart,
261 const char* meshName,
262 CORBA::Boolean adapt_to_shape);
265 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
266 const char* meshName,
267 CORBA::Boolean toCopyGroups,
268 CORBA::Boolean toKeepIDs);
271 CORBA::Boolean CopyMeshWithGeom( SMESH::SMESH_Mesh_ptr sourceMesh,
272 GEOM::GEOM_Object_ptr newGeometry,
273 const char* meshName,
274 CORBA::Boolean toCopyGroups,
275 CORBA::Boolean toReuseHypotheses,
276 CORBA::Boolean toCopyElements,
277 SMESH::SMESH_Mesh_out newMesh,
278 SMESH::ListOfGroups_out newGroups,
279 SMESH::submesh_array_out newSubmeshes,
280 SMESH::ListOfHypothesis_out newHypotheses,
281 SMESH::string_array_out invalidEntries);
284 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
285 GEOM::GEOM_Object_ptr theShapeObject );
288 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
289 GEOM::GEOM_Object_ptr theShapeObject );
295 GEOM::GEOM_Object_ptr theShapeObject );
303 GEOM::GEOM_Object_ptr theShapeObject);
306 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
307 GEOM::GEOM_Object_ptr theShapeObject );
315 GEOM::GEOM_Object_ptr theSubObject,
321 GEOM::GEOM_Object_ptr theSubObject );
325 CORBA::Short theSubShapeID );
329 CORBA::Short theSubShapeID,
330 const char* theGroupName);
337 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
338 SMESH::smIdType theElementID,
339 const char* theGeomName);
342 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
343 SMESH::smIdType theElementID);
347 CORBA::Boolean uniteIdenticalGroups,
348 CORBA::Boolean mergeNodesAndElements,
349 CORBA::Double mergeTolerance,
350 CORBA::Boolean commonGroups,
351 SMESH::SMESH_Mesh_ptr meshToAppendTo);
355 CORBA::Boolean uniteIdenticalGroups,
356 CORBA::Boolean mergeNodesAndElements,
357 CORBA::Double mergeTolerance,
358 SMESH::SMESH_Mesh_ptr meshToAppendTo);
363 CORBA::Boolean uniteIdenticalGroups,
364 CORBA::Boolean mergeNodesAndElements,
365 CORBA::Double mergeTolerance,
366 SMESH::SMESH_Mesh_ptr meshToAppendTo);
369 char* GetMEDFileVersion();
378 CORBA::Boolean CheckWriteCompatibility(
const char* theFileName);
388 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
392 bool Load( SALOMEDS::SComponent_ptr theComponent,
393 const SALOMEDS::TMPFile& theStream,
397 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
401 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
402 const SALOMEDS::TMPFile& theStream,
407 SMESH::FilterManager_ptr CreateFilterManager();
413 SMESH::Measurements_ptr CreateMeasurements();
416 void Close( SALOMEDS::SComponent_ptr theComponent );
419 char* ComponentDataType();
422 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
423 const char* IORString,
424 CORBA::Boolean isMultiFile,
425 CORBA::Boolean isASCII );
427 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
428 const char* aLocalPersistentID,
429 CORBA::Boolean isMultiFile,
430 CORBA::Boolean isASCII );
433 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
435 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
436 CORBA::Object_ptr theObject,
437 const char* theName );
440 CORBA::Boolean
CanCopy( SALOMEDS::SObject_ptr ) {
return false; }
442 SALOMEDS::TMPFile*
CopyFrom( SALOMEDS::SObject_ptr , CORBA::Long& ) {
return NULL; }
444 CORBA::Boolean
CanPaste(
const char* , CORBA::Long ) {
return false; }
446 SALOMEDS::SObject_ptr
PasteInto(
const SALOMEDS::TMPFile& ,
448 SALOMEDS::SObject_ptr ) {
449 SALOMEDS::SObject_var aResultSO;
450 return aResultSO._retn();
457 virtual char* getVersion();
463 virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
464 CORBA::Boolean isMultiFile,
465 CORBA::Boolean& isValidScript);
467 void AddToPythonScript (
const TCollection_AsciiString& theString);
469 void RemoveLastFromPythonScript();
473 TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
474 Resource_DataMapOfAsciiStringAsciiString& theNames,
477 bool isHistoricalDump,
479 TCollection_AsciiString& theSavedTrace);
481 TCollection_AsciiString GetNewPythonLines();
483 void CleanPythonTrace();
485 int CountInPyDump(
const TCollection_AsciiString& text);
487 SMESH::MG_ADAPT_ptr CreateMG_ADAPT();
488 SMESHHOMARD::HOMARD_Gen_ptr CreateHOMARD_ADAPT();
489 SMESH::MG_ADAPT_ptr CreateAdaptationHypothesis();
491 SALOME::GenericObj_ptr Adaptation(
const char* adaptationType);
498 GEOM_Client* GetShapeReader();
501 static long GetHypothesisRootTag();
502 static long GetAlgorithmsRootTag();
503 static long GetRefOnShapeTag();
504 static long GetRefOnAppliedHypothesisTag();
505 static long GetRefOnAppliedAlgorithmsTag();
506 static long GetSubMeshOnVertexTag();
507 static long GetSubMeshOnEdgeTag();
508 static long GetSubMeshOnFaceTag();
509 static long GetSubMeshOnSolidTag();
510 static long GetSubMeshOnCompoundTag();
511 static long GetSubMeshOnWireTag();
512 static long GetSubMeshOnShellTag();
513 static long GetNodeGroupsTag();
514 static long GetEdgeGroupsTag();
515 static long GetFaceGroupsTag();
516 static long GetVolumeGroupsTag();
517 static long Get0DElementsGroupsTag();
518 static long GetBallElementsGroupsTag();
521 SALOMEDS::SComponent_ptr PublishComponent();
522 SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
523 const char* theName = 0);
524 SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
525 const char* theName = 0);
526 SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
527 SMESH::SMESH_subMesh_ptr theSubMesh,
528 GEOM::GEOM_Object_ptr theShapeObject,
529 const char* theName = 0);
530 SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
531 SMESH::SMESH_GroupBase_ptr theGroup,
532 GEOM::GEOM_Object_ptr theShapeObject,
533 const char* theName = 0);
534 void UpdateIcons(SMESH::SMESH_Mesh_ptr theMesh);
535 void HighLightInvalid(CORBA::Object_ptr theObject,
bool isInvalid);
536 bool IsInvalid(SALOMEDS::SObject_ptr theObject);
537 bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
538 GEOM::GEOM_Object_ptr theShapeObject,
539 SMESH::SMESH_Hypothesis_ptr theHyp);
540 bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
541 GEOM::GEOM_Object_ptr theShapeObject,
542 SMESH::SMESH_Hypothesis_ptr theHyp);
543 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
544 GEOM::GEOM_Object_ptr theShape);
545 void SetName(SALOMEDS::SObject_ptr theSObject,
547 const char* theDefaultName = 0);
549 void SetPixMap(SALOMEDS::SObject_ptr theSObject,
const char *thePixMap);
550 void addReference (SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theToObject,
int theTag = 0);
556 int RegisterObject(CORBA::Object_ptr theObject);
559 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
562 template<
class TInterface>
565 if ( myStudyContext ) {
566 std::string ior = myStudyContext->getIORbyOldId( oldID );
568 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
570 return TInterface::_nil();
576 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
578 void UpdateParameters(CORBA::Object_ptr theObject,
const char* theParameters);
579 char* GetParameters(CORBA::Object_ptr theObject);
584 std::vector< std::string > GetAllParameters(
const std::string& theObjectEntry)
const;
588 SALOMEDS::SObject_ptr where,
592 const char* theLibName,
593 GEOM::GEOM_Object_ptr theShapeObject,
594 CORBA::Boolean toCheckAll);
610 CORBA::Double theZ2);
621 CORBA::Double theR );
625 GEOM::GEOM_Object_ptr theGeom,
626 CORBA::Double theTolerance );
631 const char* theLibName,
632 std::string& thePlatformLibName);
634 SMESH::SMESH_Hypothesis_ptr createHypothesis(
const char* theHypName,
635 const char* theLibName);
637 SMESH::SMESH_Mesh_ptr createMesh();
638 SMESH::SMESH_ParallelMesh_ptr createParallelMesh();
641 bool isGeomModifIcon( SMESH::SMESH_Mesh_ptr mesh );
645 SMESH::SMESH_subMesh_ptr createInvalidSubMesh( SMESH::SMESH_Mesh_ptr mesh,
646 GEOM::GEOM_Object_ptr strangerGeom,
649 void highLightInvalid( SALOMEDS::SObject_ptr theSObject,
bool isInvalid );
651 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
653 const TopoDS_Shape& Shape,
654 double* Tolerance = NULL);
658 static SALOME_NamingService_Abstract*
myNS;
661 static PortableServer::POA_var
myPoa;
662 static SALOME_LifeCycleCORBA*
myLCC;
682 Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
705 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );
#define SMESH_I_EXPORT
Definition: SMESH.hxx:39
Definition: SMESH_Hypothesis_i.hxx:144
Definition: SMESH_Gen_i.hxx:99
::SMESH_Gen myGen
Definition: SMESH_Gen_i.hxx:664
std::string myLastObj
Definition: SMESH_Gen_i.hxx:686
virtual SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const =0
CORBA::Boolean myIsEnablePublish
Definition: SMESH_Gen_i.hxx:673
static PortableServer::POA_var myPoa
Definition: SMESH_Gen_i.hxx:661
static PortableServer::POA_var GetPOA()
Definition: SMESH_Gen_i.hxx:106
const std::vector< std::string > & GetLastParameters() const
Definition: SMESH_Gen_i.hxx:582
CORBA::Boolean CanPaste(const char *, CORBA::Long)
Definition: SMESH_Gen_i.hxx:444
SALOMEDS::Study_var getStudyServant() const
Definition: SMESH_Gen_i.hxx:117
Handle(TColStd_HSequenceOfAsciiString) myPythonScript
StudyContext * myStudyContext
Definition: SMESH_Gen_i.hxx:669
bool ToForgetMeshDataOnHypModif() const
To load full mesh data from study at hyp modification or not.
Definition: SMESH_Gen_i.hxx:228
static CORBA::ORB_var GetORB()
Definition: SMESH_Gen_i.hxx:104
virtual GEOM::GEOM_Gen_var GetGeomEngine(bool isShaper)=0
static SMESH_Gen_i * GetSMESHGen()
Definition: SMESH_Gen_i.hxx:102
const std::string & GetLastObjEntry() const
Definition: SMESH_Gen_i.hxx:583
CORBA::Boolean myIsEmbeddedMode
Definition: SMESH_Gen_i.hxx:672
CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr)
Definition: SMESH_Gen_i.hxx:440
std::map< std::string, GenericHypothesisCreator_i * > myHypCreatorMap
Definition: SMESH_Gen_i.hxx:667
static SMESH_Gen_i * mySMESHGen
Definition: SMESH_Gen_i.hxx:663
bool myToForgetMeshDataOnHypModif
Definition: SMESH_Gen_i.hxx:679
std::vector< int > myLastParamIndex
Definition: SMESH_Gen_i.hxx:684
static SALOME_NamingService_Abstract * myNS
Definition: SMESH_Gen_i.hxx:658
TInterface::_var_type GetObjectByOldId(const int oldID)
Definition: SMESH_Gen_i.hxx:563
static CORBA::ORB_var myOrb
Definition: SMESH_Gen_i.hxx:660
static GEOM::GEOM_Gen_var myGeomGen
Definition: SMESH_Gen_i.hxx:657
GEOM_Client * myShapeReader
Definition: SMESH_Gen_i.hxx:671
static SALOME_LifeCycleCORBA * myLCC
Definition: SMESH_Gen_i.hxx:662
std::vector< std::string > myLastParameters
Definition: SMESH_Gen_i.hxx:685
const std::vector< int > & GetLastParamIndices() const
Definition: SMESH_Gen_i.hxx:581
static PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject)
GetServant [ static ].
Definition: SMESH_Gen_i.cxx:188
std::string myDefaultGroupColor
Definition: SMESH_Gen_i.hxx:676
virtual SALOMEDS::Study_var getStudyServantVirtual() const =0
SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile &, CORBA::Long, SALOMEDS::SObject_ptr)
Definition: SMESH_Gen_i.hxx:446
bool myIsHistoricalPythonDump
Definition: SMESH_Gen_i.hxx:683
SALOMEDS::TMPFile * CopyFrom(SALOMEDS::SObject_ptr, CORBA::Long &)
Definition: SMESH_Gen_i.hxx:442
Definition: SMESH_Gen.hxx:68
Definition: SMESH_Mesh_i.hxx:57
Definition: SMESH_Gen_i.hxx:66
NCollection_DataMap< int, int > TInt2IntMap
Definition: SMESH_Gen_i.hxx:68
TInt2StringMap mapIdToIOR
Definition: SMESH_Gen_i.hxx:91
int getNextId()
Definition: SMESH_Gen_i.hxx:89
NCollection_DataMap< int, std::string > TInt2StringMap
Definition: SMESH_Gen_i.hxx:67
StudyContext()
Definition: SMESH_Gen_i.hxx:71
TInt2IntMap mapIdToId
Definition: SMESH_Gen_i.hxx:92
bool CheckCompatibility(const std::string &fileName, bool isForAppend)
: Check read or write(append) Compatibility of a med file
Definition: MED_Factory.cxx:114
bool GetMEDVersion(const std::string &fileName, int &major, int &minor, int &release)
Definition: MED_Factory.cxx:150
Definition: SMESH_ControlsDef.hxx:64
T DownCast(CORBA::Object_ptr theArg)
Definition: SMESH_Gen_i.hxx:694
sequence< AlgoStateError > algo_error_array
Definition: SMESH_Gen.idl:96
bool IsApplicable(const QString &aHypType, GEOM::GEOM_Object_ptr theGeomObject, const bool toCheckAll)
Definition: SMESHGUI_HypothesesUtils.cxx:617
sequence< GEOM::GEOM_Object > object_array
Definition: SMESH_Gen.idl:46
SMESH::SMESH_Pattern_var GetPattern()
Definition: SMESHGUI_PatternUtils.cxx:34
sequence< SMESH_IDSource > ListOfIDSources
Definition: SMESH_Mesh.idl:40
sequence< ComputeError > compute_error_array
Definition: SMESH_Gen.idl:125
sequence< smIdType > smIdType_array
Definition: SMESH_Mesh.idl:45
Dimension
Definition: SMESH_Hypothesis.idl:35
void throwCorbaException(const char *excText)
Function used in SMESH_CATCH to convert a caught exception to SALOME::SALOME_Exception.
Definition: SMESH_Gen_i.hxx:703
ElementType
Enumeration for element type, like in SMDS.
Definition: SMESH_Mesh.idl:128
sequence< string > string_array
Definition: SMESH_Mesh.idl:46
sequence< SMESH_GroupBase > ListOfGroups
Definition: SMESH_Mesh.idl:38
sequence< SMESH_Mesh > mesh_array
Definition: SMESH_Gen.idl:47
CORBA::Object_var SObjectToObject(_PTR(SObject) theSObject)
Definition: SMESHGUI_Utils.cxx:180
sequence< SALOMEDS::SObject > sobject_list
Definition: SMESH_Gen.idl:45
SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const QString &aHypType, const QString &aHypName, const bool)
Definition: SMESHGUI_HypothesesUtils.cxx:588
void SetName(_PTR(SObject) theSObject, const QString &theName)
Definition: SMESHGUI_Utils.cxx:134
DriverMED_ReadStatus
Enumeration for mesh read status (used by SMESH_Gen::CreateMeshesFrom*() methods)
Definition: SMESH_Mesh.idl:231
sequence< long > long_array
Definition: SMESH_Mesh.idl:44
Way to initialize hypothesis.
Definition: SMESH_Gen.idl:131
Structure containing mesh edit preview data.
Definition: SMESH_Mesh.idl:279