1 // Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESH_Gen_i.hxx
23 // Author : Paul RASCLE, EDF
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)
40 #include "SMESH_Gen.hxx"
41 #include "SMESH_Mesh_i.hxx"
42 #include "SMESH_Hypothesis_i.hxx"
44 #include <SALOME_Component_i.hxx>
45 #include <SALOME_NamingService.hxx>
46 #include <Utils_CorbaException.hxx>
48 #include <GEOM_Client.hxx>
50 #include <TCollection_AsciiString.hxx>
51 #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
52 #include <TColStd_HSequenceOfAsciiString.hxx>
53 #include <NCollection_DataMap.hxx>
59 class SALOME_LifeCycleCORBA;
61 // ===========================================================
62 // Study context - store study-connected objects references
63 // ==========================================================
64 class SMESH_I_EXPORT StudyContext
66 typedef NCollection_DataMap< int, std::string > TInt2StringMap;
67 typedef NCollection_DataMap< int, int > TInt2IntMap;
71 // register object in the internal map and return its id
72 int addObject( const std::string& theIOR );
73 // find the object id in the internal map by the IOR
74 int findId( const std::string& theIOR );
75 // get object's IOR by id
76 std::string getIORbyId( const int theId );
77 // get object's IOR by old id
78 std::string getIORbyOldId( const int theOldId );
79 // maps old object id to the new one (used when restoring data)
80 void mapOldToNew( const int oldId, const int newId );
81 // get old id by a new one
82 int getOldId( const int newId );
87 // get next free object identifier
88 int getNextId() { return mapIdToIOR.Extent() + 1; }
90 TInt2StringMap mapIdToIOR; // persistent-to-transient map
91 TInt2IntMap mapIdToId; // to translate object from persistent to transient form
94 // ===========================================================
95 // SMESH module's engine
96 // ==========================================================
97 class SMESH_I_EXPORT SMESH_Gen_i : public POA_SMESH::SMESH_Gen, public Engines_Component_i
100 // Get last created instance of the class
101 static SMESH_Gen_i* GetSMESHGen() { return mySMESHGen;}
103 static CORBA::ORB_var GetORB() { return myOrb;}
104 // Get SMESH module's POA object
105 static PortableServer::POA_var GetPOA() { return myPoa;}
106 // Get Naming Service object
107 static SALOME_NamingService_Abstract* GetNS();
108 // Get SALOME_LifeCycleCORBA object
109 static SALOME_LifeCycleCORBA* GetLCC();
110 // Retrieve and get GEOM engine reference
111 static GEOM::GEOM_Gen_var GetGeomEngine( GEOM::GEOM_Object_ptr );
112 // Retrieve Study depending on Session / Standalone mode
113 virtual GEOM::GEOM_Gen_var GetGeomEngine( bool isShaper ) = 0;
114 SALOMEDS::Study_var getStudyServant() const { return this->getStudyServantVirtual(); }
115 virtual SALOMEDS::Study_var getStudyServantVirtual() const = 0 ;
116 virtual SALOME_ModuleCatalog::ModuleCatalog_var getModuleCatalog() const = 0;
117 SALOMEDS::SObject_ptr publish(CORBA::Object_ptr theIOR,
118 SALOMEDS::SObject_ptr theFatherObject,
119 const int theTag = 0,
120 const char* thePixMap = 0,
121 const bool theSelectable = true);
122 // Get object of the CORBA reference
123 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
124 // Get CORBA object corresponding to the SALOMEDS::SObject
125 static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
126 // Get the SALOMEDS::SObject corresponding to a CORBA object
127 SALOMEDS::SObject_ptr ObjectToSObject( CORBA::Object_ptr theObject );
128 // Get GEOM Object corresponding to TopoDS_Shape
129 static GEOM::GEOM_Object_ptr ShapeToGeomObject( const TopoDS_Shape& theShape );
130 // Get TopoDS_Shape corresponding to GEOM_Object
131 static TopoDS_Shape GeomObjectToShape( GEOM::GEOM_Object_ptr theGeomObject );
132 // Get GEOM Object by its study entry
133 static GEOM::GEOM_Object_ptr GetGeomObjectByEntry( const std::string& entry );
135 // Default constructor
137 // Standard constructor
138 SMESH_Gen_i( CORBA::ORB_ptr orb,
139 PortableServer::POA_ptr poa,
140 PortableServer::ObjectId* contId,
141 const char* instanceName,
142 const char* interfaceName,
143 bool checkNS = true);
145 virtual ~SMESH_Gen_i();
147 // *****************************************
149 // *****************************************
150 // Set a new Mesh object name
151 void SetName(const char* theIOR,
152 const char* theName);
154 //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
155 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
158 void SetEmbeddedMode( CORBA::Boolean theMode );
159 // Check embedded mode
160 CORBA::Boolean IsEmbeddedMode();
162 // Set enable publishing in the study
163 void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
165 // Check enable publishing
166 CORBA::Boolean IsEnablePublish();
171 // Do provide info on objects
172 bool hasObjectInfo();
174 // Return an information for a given object
175 char* getObjectInfo(const char* entry);
177 // Create hypothesis/algorithm of given type
178 SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
179 const char* theLibName);
181 SMESH::SMESH_Hypothesis_ptr CreateHypothesisByAverageLength( const char* theHypType,
182 const char* theLibName,
183 CORBA::Double theAverageLength,
184 CORBA::Boolean theQuadDominated);
186 // Return hypothesis of given type holding parameter values of the existing mesh
187 SMESH::SMESH_Hypothesis_ptr
188 GetHypothesisParameterValues (const char* theHypType,
189 const char* theLibName,
190 SMESH::SMESH_Mesh_ptr theMesh,
191 GEOM::GEOM_Object_ptr theGeom,
192 const SMESH::HypInitParams& theWay);
195 * Returns True if a hypothesis is assigned to a sole sub-mesh in a current Study
197 CORBA::Boolean GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr theHyp,
198 SMESH::SMESH_Mesh_out theMesh,
199 GEOM::GEOM_Object_out theShape);
204 * Sets number of segments per diagonal of boundary box of geometry by which
205 * default segment length of appropriate 1D hypotheses is defined
207 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments );
209 * \brief Sets default number of segments per edge
211 void SetDefaultNbSegments(CORBA::Long theNbSegments);
216 virtual void SetOption(const char*, const char*);
218 Return an option value
220 virtual char* GetOption(const char*);
223 * To load full mesh data from study at hyp modification or not
225 bool ToForgetMeshDataOnHypModif() const { return myToForgetMeshDataOnHypModif; }
228 // Create empty mesh on a shape
229 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject );
232 SMESH::SMESH_Mesh_ptr CreateEmptyMesh();
234 // Create a mesh and import data from an UNV file
235 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName );
237 // Create mesh(es) and import data from MED file
238 SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
239 SMESH::DriverMED_ReadStatus& theStatus );
241 // Create mesh(es) and import data from MED file
242 SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
243 SMESH::DriverMED_ReadStatus& theStatus );
245 // Create a mesh and import data from a STL file
246 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName );
248 // Create mesh(es) and import data from CGNS file
249 SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
250 SMESH::DriverMED_ReadStatus& theStatus );
252 // Create a mesh and import data from a GMF file
253 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
254 CORBA::Boolean theMakeRequiredGroups,
255 SMESH::ComputeError_out theError);
257 // Copy a part of mesh
258 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
259 const char* meshName,
260 CORBA::Boolean toCopyGroups,
261 CORBA::Boolean toKeepIDs);
263 // Create a mesh by copying definitions of another mesh to a given geometry
264 CORBA::Boolean CopyMeshWithGeom( SMESH::SMESH_Mesh_ptr sourceMesh,
265 GEOM::GEOM_Object_ptr newGeometry,
266 const char* meshName,
267 CORBA::Boolean toCopyGroups,
268 CORBA::Boolean toReuseHypotheses,
269 CORBA::Boolean toCopyElements,
270 SMESH::SMESH_Mesh_out newMesh,
271 SMESH::ListOfGroups_out newGroups,
272 SMESH::submesh_array_out newSubmeshes,
273 SMESH::ListOfHypothesis_out newHypotheses,
274 SMESH::string_array_out invalidEntries);
276 // Compute mesh on a shape
277 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
278 GEOM::GEOM_Object_ptr theShapeObject );
280 // Cancel Compute mesh on a shape
281 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
282 GEOM::GEOM_Object_ptr theShapeObject );
285 * \brief Return errors of mesh computation
287 SMESH::compute_error_array* GetComputeErrors(SMESH::SMESH_Mesh_ptr theMesh,
288 GEOM::GEOM_Object_ptr theShapeObject );
291 * Evaluate mesh on a shape and
292 * returns statistic of mesh elements
293 * Result array of number enityties
295 SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
296 GEOM::GEOM_Object_ptr theShapeObject);
298 // Returns true if mesh contains enough data to be computed
299 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
300 GEOM::GEOM_Object_ptr theShapeObject );
303 * Calculate Mesh as preview till indicated dimension on shape
304 * First, verify list of hypothesis associated with the subShape.
305 * Return mesh preview structure
307 SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
308 GEOM::GEOM_Object_ptr theSubObject,
309 SMESH::Dimension theDimension,
310 SMESH::long_array& theShapesId );
312 // Returns errors of hypotheses definition
313 SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh,
314 GEOM::GEOM_Object_ptr theSubObject );
316 // Return mesh elements preventing computation of a subshape
317 SMESH::MeshPreviewStruct* GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
318 CORBA::Short theSubShapeID );
320 // Create groups of elements preventing computation of a sub-shape
321 SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
322 CORBA::Short theSubShapeID,
323 const char* theGroupName);
325 // Get sub-shapes unique ID's list
326 SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
327 const SMESH::object_array& theListOfSubShape );
329 // Return geometrical object the given element is built on. Publish it in study.
330 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
331 CORBA::Long theElementID,
332 const char* theGeomName);
334 // Return geometrical object the given element is built on. Don't publish it in study.
335 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
336 CORBA::Long theElementID);
338 // Concatenate the given meshes into one mesh
339 SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray,
340 CORBA::Boolean uniteIdenticalGroups,
341 CORBA::Boolean mergeNodesAndElements,
342 CORBA::Double mergeTolerance,
343 CORBA::Boolean commonGroups,
344 SMESH::SMESH_Mesh_ptr meshToAppendTo);
346 // Concatenate the given meshes into one mesh
347 SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::ListOfIDSources& meshesArray,
348 CORBA::Boolean uniteIdenticalGroups,
349 CORBA::Boolean mergeNodesAndElements,
350 CORBA::Double mergeTolerance,
351 SMESH::SMESH_Mesh_ptr meshToAppendTo);
353 // Concatenate the given meshes into one mesh
354 // Create the groups of all elements from initial meshes
355 SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::ListOfIDSources& meshesArray,
356 CORBA::Boolean uniteIdenticalGroups,
357 CORBA::Boolean mergeNodesAndElements,
358 CORBA::Double mergeTolerance,
359 SMESH::SMESH_Mesh_ptr meshToAppendTo);
361 // Get version of MED format being used.
362 char* GetMEDFileVersion();
364 // Get MED version of the file by its name
365 char* GetMEDVersion(const char* theFileName);
367 // Check compatibility of file with MED format being used, read only.
368 CORBA::Boolean CheckCompatibility(const char* theFileName);
370 // Check compatibility of file with MED format being used, for append on write.
371 CORBA::Boolean CheckWriteCompatibility(const char* theFileName);
373 // Get names of meshes defined in file with the specified name
374 SMESH::string_array* GetMeshNames(const char* theFileName);
376 // ****************************************************
377 // Interface inherited methods (from SALOMEDS::Driver)
378 // ****************************************************
381 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
385 bool Load( SALOMEDS::SComponent_ptr theComponent,
386 const SALOMEDS::TMPFile& theStream,
389 // Save SMESH data in ASCII format
390 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
393 // Load SMESH data in ASCII format
394 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
395 const SALOMEDS::TMPFile& theStream,
399 // Create filter manager
400 SMESH::FilterManager_ptr CreateFilterManager();
402 // Return a pattern mesher
403 SMESH::SMESH_Pattern_ptr GetPattern();
405 // Create measurement instance
406 SMESH::Measurements_ptr CreateMeasurements();
408 // Clears study-connected data when it is closed
409 void Close( SALOMEDS::SComponent_ptr theComponent );
411 // Get component data type
412 char* ComponentDataType();
414 // Transform data from transient form to persistent
415 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
416 const char* IORString,
417 CORBA::Boolean isMultiFile,
418 CORBA::Boolean isASCII );
419 // Transform data from persistent form to transient
420 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
421 const char* aLocalPersistentID,
422 CORBA::Boolean isMultiFile,
423 CORBA::Boolean isASCII );
425 // Returns true if object can be published in the study
426 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
427 // Publish object in the study
428 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
429 CORBA::Object_ptr theObject,
430 const char* theName );
432 // Copy-paste methods - returns true if object can be copied to the clipboard
433 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr /*theObject*/ ) { return false; }
434 // Copy-paste methods - copy object to the clipboard
435 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr /*theObject*/, CORBA::Long& /*theObjectID*/ ) { return NULL; }
436 // Copy-paste methods - returns true if object can be pasted from the clipboard
437 CORBA::Boolean CanPaste( const char* /*theComponentName*/, CORBA::Long /*theObjectID*/ ) { return false; }
438 // Copy-paste methods - paste object from the clipboard
439 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& /*theStream*/,
440 CORBA::Long /*theObjectID*/,
441 SALOMEDS::SObject_ptr /*theObject*/ ) {
442 SALOMEDS::SObject_var aResultSO;
443 return aResultSO._retn();
447 // Version information
450 virtual char* getVersion();
456 virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
457 CORBA::Boolean isMultiFile,
458 CORBA::Boolean& isValidScript);
460 void AddToPythonScript (const TCollection_AsciiString& theString);
462 void RemoveLastFromPythonScript();
466 TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
467 Resource_DataMapOfAsciiStringAsciiString& theNames,
470 bool isHistoricalDump,
472 TCollection_AsciiString& theSavedTrace);
474 TCollection_AsciiString GetNewPythonLines();
476 void CleanPythonTrace();
478 int CountInPyDump(const TCollection_AsciiString& text);
480 // *****************************************
482 // *****************************************
485 GEOM_Client* GetShapeReader();
488 static long GetHypothesisRootTag();
489 static long GetAlgorithmsRootTag();
490 static long GetRefOnShapeTag();
491 static long GetRefOnAppliedHypothesisTag();
492 static long GetRefOnAppliedAlgorithmsTag();
493 static long GetSubMeshOnVertexTag();
494 static long GetSubMeshOnEdgeTag();
495 static long GetSubMeshOnFaceTag();
496 static long GetSubMeshOnSolidTag();
497 static long GetSubMeshOnCompoundTag();
498 static long GetSubMeshOnWireTag();
499 static long GetSubMeshOnShellTag();
500 static long GetNodeGroupsTag();
501 static long GetEdgeGroupsTag();
502 static long GetFaceGroupsTag();
503 static long GetVolumeGroupsTag();
504 static long Get0DElementsGroupsTag();
505 static long GetBallElementsGroupsTag();
507 // publishing methods
508 SALOMEDS::SComponent_ptr PublishComponent();
509 SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
510 const char* theName = 0);
511 SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
512 const char* theName = 0);
513 SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
514 SMESH::SMESH_subMesh_ptr theSubMesh,
515 GEOM::GEOM_Object_ptr theShapeObject,
516 const char* theName = 0);
517 SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
518 SMESH::SMESH_GroupBase_ptr theGroup,
519 GEOM::GEOM_Object_ptr theShapeObject,
520 const char* theName = 0);
521 void UpdateIcons(SMESH::SMESH_Mesh_ptr theMesh);
522 void HighLightInvalid(CORBA::Object_ptr theObject, bool isInvalid);
523 bool IsInvalid(SALOMEDS::SObject_ptr theObject);
524 bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
525 GEOM::GEOM_Object_ptr theShapeObject,
526 SMESH::SMESH_Hypothesis_ptr theHyp);
527 bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
528 GEOM::GEOM_Object_ptr theShapeObject,
529 SMESH::SMESH_Hypothesis_ptr theHyp);
530 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
531 GEOM::GEOM_Object_ptr theShape);
532 void SetName(SALOMEDS::SObject_ptr theSObject,
534 const char* theDefaultName = 0);
536 void SetPixMap(SALOMEDS::SObject_ptr theSObject, const char *thePixMap);
537 void addReference (SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theToObject, int theTag = 0);
540 StudyContext* GetStudyContext();
542 // Register an object in a StudyContext; return object id
543 int RegisterObject(CORBA::Object_ptr theObject);
545 // Return id of registered object
546 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
548 // Return an object that previously had an oldID
549 template<class TInterface>
550 typename TInterface::_var_type GetObjectByOldId( const int oldID )
552 if ( myStudyContext ) {
553 std::string ior = myStudyContext->getIORbyOldId( oldID );
555 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
557 return TInterface::_nil();
561 * \brief Find SObject for an algo
563 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
565 void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters);
566 char* GetParameters(CORBA::Object_ptr theObject);
567 //char* ParseParameters(const char* theParameters);
568 const std::vector< int >& GetLastParamIndices() const { return myLastParamIndex; }
569 const std::vector< std::string >& GetLastParameters() const { return myLastParameters; }
570 const std::string & GetLastObjEntry() const { return myLastObj; }
571 std::vector< std::string > GetAllParameters(const std::string& theObjectEntry) const;
573 // Move objects to the specified position
574 void Move( const SMESH::sobject_list& what,
575 SALOMEDS::SObject_ptr where,
578 CORBA::Boolean IsApplicable ( const char* theAlgoType,
579 const char* theLibName,
580 GEOM::GEOM_Object_ptr theShapeObject,
581 CORBA::Boolean toCheckAll);
583 SMESH::long_array* GetInsideSphere( SMESH::SMESH_IDSource_ptr meshPart,
584 SMESH::ElementType theElemType,
590 SMESH::long_array* GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart,
591 SMESH::ElementType theElemType,
597 CORBA::Double theZ2);
599 SMESH::long_array* GetInsideCylinder( SMESH::SMESH_IDSource_ptr meshPart,
600 SMESH::ElementType theElemType,
608 CORBA::Double theR );
610 SMESH::long_array* GetInside( SMESH::SMESH_IDSource_ptr meshPart,
611 SMESH::ElementType theElemType,
612 GEOM::GEOM_Object_ptr theGeom,
613 CORBA::Double theTolerance );
616 // Get hypothesis creator
617 GenericHypothesisCreator_i* getHypothesisCreator( const char* theHypName,
618 const char* theLibName,
619 std::string& thePlatformLibName);
620 // Create hypothesis of given type
621 SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
622 const char* theLibName);
623 // Create empty mesh on shape
624 SMESH::SMESH_Mesh_ptr createMesh();
627 bool isGeomModifIcon( SMESH::SMESH_Mesh_ptr mesh );
629 // Create a sub-mesh on a geometry that is not a sub-shape of the main shape
630 // for the case where a valid sub-shape not found by CopyMeshWithGeom()
631 SMESH::SMESH_subMesh_ptr createInvalidSubMesh( SMESH::SMESH_Mesh_ptr mesh,
632 GEOM::GEOM_Object_ptr strangerGeom,
635 void highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid );
637 SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
638 SMESH::DriverMED_ReadStatus& theStatus,
639 const char* theCommandNameForPython,
640 const char* theFileNameForPython);
642 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
643 SMESH::ElementType ElemType,
644 const TopoDS_Shape& Shape,
645 double* Tolerance = NULL);
648 static GEOM::GEOM_Gen_var myGeomGen;
649 static SALOME_NamingService_Abstract* myNS; // Naming Service
651 static CORBA::ORB_var myOrb; // ORB reference
652 static PortableServer::POA_var myPoa; // POA reference
653 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
654 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
655 ::SMESH_Gen myGen; // SMESH_Gen local implementation
657 // hypotheses managing
658 std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
660 StudyContext* myStudyContext; // study context
662 GEOM_Client* myShapeReader; // Shape reader
663 CORBA::Boolean myIsEmbeddedMode; // Current mode
664 CORBA::Boolean myIsEnablePublish; // Enable publishing
666 // Default color of groups
667 std::string myDefaultGroupColor;
669 // To load full mesh data from study at hyp modification or not
670 bool myToForgetMeshDataOnHypModif;
672 // Dump Python: trace of API methods calls
673 Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
674 bool myIsHistoricalPythonDump;
675 std::vector< int > myLastParamIndex;
676 std::vector< std::string > myLastParameters;
677 std::string myLastObj;
685 DownCast(CORBA::Object_ptr theArg)
687 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
691 * \brief Function used in SMESH_CATCH to convert a caught exception to
692 * SALOME::SALOME_Exception
694 inline void throwCorbaException(const char* excText)
696 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );