1 // Copyright (C) 2007-2016 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)
39 #include "SMESH_Gen.hxx"
40 #include "SMESH_Mesh_i.hxx"
41 #include "SMESH_Hypothesis_i.hxx"
43 #include <SALOME_Component_i.hxx>
44 #include <SALOME_NamingService.hxx>
45 #include <Utils_CorbaException.hxx>
47 #include <GEOM_Client.hxx>
49 #include <TCollection_AsciiString.hxx>
50 #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
51 #include <TColStd_HSequenceOfAsciiString.hxx>
52 #include <NCollection_DataMap.hxx>
58 class SALOME_LifeCycleCORBA;
60 // ===========================================================
61 // Study context - stores study-connected objects references
62 // ==========================================================
63 class SMESH_I_EXPORT StudyContext
65 typedef NCollection_DataMap< int, std::string > TInt2StringMap;
66 typedef NCollection_DataMap< int, int > TInt2IntMap;
71 // register object in the internal map and return its id
72 int addObject( std::string theIOR )
74 int nextId = getNextId();
75 mapIdToIOR.Bind( nextId, theIOR );
78 // find the object id in the internal map by the IOR
79 int findId( std::string theIOR )
81 TInt2StringMap::iterator imap;
82 for ( imap = mapIdToIOR.begin(); imap != mapIdToIOR.end(); ++imap ) {
83 if ( *imap == theIOR )
84 return imap.Iterator().Key();
88 // get object's IOR by id
89 std::string getIORbyId( const int theId )
91 if ( mapIdToIOR.IsBound( theId ) )
92 return mapIdToIOR( theId );
95 // get object's IOR by old id
96 std::string getIORbyOldId( const int theOldId )
98 if ( mapIdToId.IsBound( theOldId ) )
99 return getIORbyId( mapIdToId( theOldId ));
100 return std::string();
102 // maps old object id to the new one (used when restoring data)
103 void mapOldToNew( const int oldId, const int newId ) {
104 mapIdToId.Bind( oldId, newId );
106 // get old id by a new one
107 int getOldId( const int newId ) {
108 TInt2IntMap::iterator imap;
109 for ( imap = mapIdToId.begin(); imap != mapIdToId.end(); ++imap ) {
110 if ( *imap == newId )
111 return imap.Iterator().Key();
117 // get next free object identifier
120 return mapIdToIOR.Extent() + 1;
123 TInt2StringMap mapIdToIOR; // persistent-to-transient map
124 TInt2IntMap mapIdToId; // to translate object from persistent to transient form
127 // ===========================================================
128 // SMESH module's engine
129 // ==========================================================
130 class SMESH_I_EXPORT SMESH_Gen_i:
131 public virtual POA_SMESH::SMESH_Gen,
132 public virtual Engines_Component_i
135 // Get last created instance of the class
136 static SMESH_Gen_i* GetSMESHGen() { return mySMESHGen;}
138 static CORBA::ORB_var GetORB() { return myOrb;}
139 // Get SMESH module's POA object
140 static PortableServer::POA_var GetPOA() { return myPoa;}
141 // Get Naming Service object
142 static SALOME_NamingService* GetNS();
143 // Get SALOME_LifeCycleCORBA object
144 static SALOME_LifeCycleCORBA* GetLCC();
145 // Retrieve and get GEOM engine reference
146 static GEOM::GEOM_Gen_var GetGeomEngine();
147 // Get object of the CORBA reference
148 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
149 // Get CORBA object corresponding to the SALOMEDS::SObject
150 static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
151 // Get the SALOMEDS::SObject corresponding to a CORBA object
152 static SALOMEDS::SObject_ptr ObjectToSObject(SALOMEDS::Study_ptr theStudy,
153 CORBA::Object_ptr theObject);
154 // Get GEOM Object corresponding to TopoDS_Shape
155 GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
156 // Get TopoDS_Shape corresponding to GEOM_Object
157 TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject);
159 // Default constructor
161 // Standard constructor
162 SMESH_Gen_i( CORBA::ORB_ptr orb,
163 PortableServer::POA_ptr poa,
164 PortableServer::ObjectId* contId,
165 const char* instanceName,
166 const char* interfaceName );
168 virtual ~SMESH_Gen_i();
170 // *****************************************
172 // *****************************************
173 // Set a new Mesh object name
174 void SetName(const char* theIOR,
175 const char* theName);
177 //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
178 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
181 void SetEmbeddedMode( CORBA::Boolean theMode );
183 CORBA::Boolean IsEmbeddedMode();
186 void SetCurrentStudy( SALOMEDS::Study_ptr theStudy );
188 SALOMEDS::Study_ptr GetCurrentStudy();
190 // Create hypothesis/algorothm of given type
191 SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
192 const char* theLibName)
193 throw ( SALOME::SALOME_Exception );
195 // Return hypothesis of given type holding parameter values of the existing mesh
196 SMESH::SMESH_Hypothesis_ptr GetHypothesisParameterValues (const char* theHypType,
197 const char* theLibName,
198 SMESH::SMESH_Mesh_ptr theMesh,
199 GEOM::GEOM_Object_ptr theGeom,
200 CORBA::Boolean byMesh)
201 throw ( SALOME::SALOME_Exception );
204 * Returns True if a hypothesis is assigned to a sole sub-mesh in a current Study
206 CORBA::Boolean GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr theHyp,
207 SMESH::SMESH_Mesh_out theMesh,
208 GEOM::GEOM_Object_out theShape);
213 * Sets number of segments per diagonal of boundary box of geometry by which
214 * default segment length of appropriate 1D hypotheses is defined
216 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments ) throw ( SALOME::SALOME_Exception );
218 * \brief Sets default number of segments per edge
220 void SetDefaultNbSegments(CORBA::Long theNbSegments) throw ( SALOME::SALOME_Exception );
225 virtual void SetOption(const char*, const char*);
227 Return an option value
229 virtual char* GetOption(const char*);
232 * To load full mesh data from study at hyp modification or not
234 bool ToForgetMeshDataOnHypModif() const { return myToForgetMeshDataOnHypModif; }
237 // Create empty mesh on a shape
238 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
239 throw ( SALOME::SALOME_Exception );
242 SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
243 throw ( SALOME::SALOME_Exception );
245 // Create a mesh and import data from an UNV file
246 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
247 throw ( SALOME::SALOME_Exception );
249 // Create mesh(es) and import data from MED file
250 SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
251 SMESH::DriverMED_ReadStatus& theStatus )
252 throw ( SALOME::SALOME_Exception );
254 // Create mesh(es) and import data from MED file
255 SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
256 SMESH::DriverMED_ReadStatus& theStatus )
257 throw ( SALOME::SALOME_Exception );
259 // Create a mesh and import data from a STL file
260 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
261 throw ( SALOME::SALOME_Exception );
263 // Create mesh(es) and import data from CGNS file
264 SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
265 SMESH::DriverMED_ReadStatus& theStatus )
266 throw ( SALOME::SALOME_Exception );
268 // Create a mesh and import data from a GMF file
269 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
270 CORBA::Boolean theMakeRequiredGroups,
271 SMESH::ComputeError_out theError)
272 throw ( SALOME::SALOME_Exception );
274 // Copy a part of mesh
275 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
276 const char* meshName,
277 CORBA::Boolean toCopyGroups,
278 CORBA::Boolean toKeepIDs);
280 // Compute mesh on a shape
281 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
282 GEOM::GEOM_Object_ptr theShapeObject )
283 throw ( SALOME::SALOME_Exception );
285 // Cancel Compute mesh on a shape
286 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
287 GEOM::GEOM_Object_ptr theShapeObject );
290 * \brief Return errors of mesh computation
292 SMESH::compute_error_array* GetComputeErrors(SMESH::SMESH_Mesh_ptr theMesh,
293 GEOM::GEOM_Object_ptr theShapeObject )
294 throw ( SALOME::SALOME_Exception );
297 * Evaluate mesh on a shape and
298 * returns statistic of mesh elements
299 * Result array of number enityties
301 SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
302 GEOM::GEOM_Object_ptr theShapeObject)
303 throw ( SALOME::SALOME_Exception );
305 // Returns true if mesh contains enough data to be computed
306 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
307 GEOM::GEOM_Object_ptr theShapeObject )
308 throw ( SALOME::SALOME_Exception );
311 * Calculate Mesh as preview till indicated dimension on shape
312 * First, verify list of hypothesis associated with the subShape.
313 * Return mesh preview structure
315 SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
316 GEOM::GEOM_Object_ptr theSubObject,
317 SMESH::Dimension theDimension,
318 SMESH::long_array& theShapesId )
319 throw ( SALOME::SALOME_Exception );
321 // Returns errors of hypotheses definition
322 SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh,
323 GEOM::GEOM_Object_ptr theSubObject )
324 throw ( SALOME::SALOME_Exception );
326 // Return mesh elements preventing computation of a subshape
327 SMESH::MeshPreviewStruct* GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
328 CORBA::Short theSubShapeID )
329 throw ( SALOME::SALOME_Exception );
331 // Create groups of elements preventing computation of a sub-shape
332 SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
333 CORBA::Short theSubShapeID,
334 const char* theGroupName)
335 throw ( SALOME::SALOME_Exception );
337 // Get sub-shapes unique ID's list
338 SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
339 const SMESH::object_array& theListOfSubShape )
340 throw ( SALOME::SALOME_Exception );
342 // Return geometrical object the given element is built on. Publish it in study.
343 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
344 CORBA::Long theElementID,
345 const char* theGeomName)
346 throw ( SALOME::SALOME_Exception );
348 // Return geometrical object the given element is built on. Don't publish it in study.
349 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
350 CORBA::Long theElementID)
351 throw ( SALOME::SALOME_Exception );
353 // Concatenate the given meshes into one mesh
354 SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray,
355 CORBA::Boolean uniteIdenticalGroups,
356 CORBA::Boolean mergeNodesAndElements,
357 CORBA::Double mergeTolerance,
358 CORBA::Boolean commonGroups)
359 throw ( SALOME::SALOME_Exception );
361 // Concatenate the given meshes into one mesh
362 SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::ListOfIDSources& meshesArray,
363 CORBA::Boolean uniteIdenticalGroups,
364 CORBA::Boolean mergeNodesAndElements,
365 CORBA::Double mergeTolerance)
366 throw ( SALOME::SALOME_Exception );
368 // Concatenate the given meshes into one mesh
369 // Create the groups of all elements from initial meshes
370 SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::ListOfIDSources& meshesArray,
371 CORBA::Boolean uniteIdenticalGroups,
372 CORBA::Boolean mergeNodesAndElements,
373 CORBA::Double mergeTolerance)
374 throw ( SALOME::SALOME_Exception );
376 // Get MED version of the file by its name
377 CORBA::Boolean GetMEDVersion(const char* theFileName,
378 SMESH::MED_VERSION& theVersion);
380 // Get names of meshes defined in file with the specified name
381 SMESH::string_array* GetMeshNames(const char* theFileName);
383 // ****************************************************
384 // Interface inherited methods (from SALOMEDS::Driver)
385 // ****************************************************
388 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
392 bool Load( SALOMEDS::SComponent_ptr theComponent,
393 const SALOMEDS::TMPFile& theStream,
396 // Save SMESH data in ASCII format
397 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
400 // Load SMESH data in ASCII format
401 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
402 const SALOMEDS::TMPFile& theStream,
406 // Create filter manager
407 SMESH::FilterManager_ptr CreateFilterManager();
409 // Return a pattern mesher
410 SMESH::SMESH_Pattern_ptr GetPattern();
412 // Create measurement instance
413 SMESH::Measurements_ptr CreateMeasurements();
415 // Clears study-connected data when it is closed
416 void Close( SALOMEDS::SComponent_ptr theComponent );
418 // Get component data type
419 char* ComponentDataType();
421 // Transform data from transient form to persistent
422 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
423 const char* IORString,
424 CORBA::Boolean isMultiFile,
425 CORBA::Boolean isASCII );
426 // Transform data from persistent form to transient
427 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
428 const char* aLocalPersistentID,
429 CORBA::Boolean isMultiFile,
430 CORBA::Boolean isASCII );
432 // Returns true if object can be published in the study
433 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
434 // Publish object in the study
435 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::Study_ptr theStudy,
436 SALOMEDS::SObject_ptr theSObject,
437 CORBA::Object_ptr theObject,
438 const char* theName )
439 throw ( SALOME::SALOME_Exception );
441 // Copy-paste methods - returns true if object can be copied to the clipboard
442 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr theObject ) { return false; }
443 // Copy-paste methods - copy object to the clipboard
444 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID ) { return NULL; }
445 // Copy-paste methods - returns true if object can be pasted from the clipboard
446 CORBA::Boolean CanPaste( const char* theComponentName, CORBA::Long theObjectID ) { return false; }
447 // Copy-paste methods - paste object from the clipboard
448 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& theStream,
449 CORBA::Long theObjectID,
450 SALOMEDS::SObject_ptr theObject ) {
451 SALOMEDS::SObject_var aResultSO;
452 return aResultSO._retn();
456 // Version information
459 virtual char* getVersion();
465 virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
466 CORBA::Boolean isPublished,
467 CORBA::Boolean isMultiFile,
468 CORBA::Boolean& isValidScript);
470 void AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString);
472 void RemoveLastFromPythonScript (int theStudyID);
474 void SavePython (SALOMEDS::Study_ptr theStudy);
476 TCollection_AsciiString DumpPython_impl (SALOMEDS::Study_ptr theStudy,
477 Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
478 Resource_DataMapOfAsciiStringAsciiString& theNames,
481 bool isHistoricalDump,
483 TCollection_AsciiString& theSavedTrace);
485 TCollection_AsciiString GetNewPythonLines (int theStudyID);
487 void CleanPythonTrace (int theStudyID);
489 // *****************************************
491 // *****************************************
494 GEOM_Client* GetShapeReader();
497 static long GetHypothesisRootTag();
498 static long GetAlgorithmsRootTag();
499 static long GetRefOnShapeTag();
500 static long GetRefOnAppliedHypothesisTag();
501 static long GetRefOnAppliedAlgorithmsTag();
502 static long GetSubMeshOnVertexTag();
503 static long GetSubMeshOnEdgeTag();
504 static long GetSubMeshOnFaceTag();
505 static long GetSubMeshOnSolidTag();
506 static long GetSubMeshOnCompoundTag();
507 static long GetSubMeshOnWireTag();
508 static long GetSubMeshOnShellTag();
509 static long GetNodeGroupsTag();
510 static long GetEdgeGroupsTag();
511 static long GetFaceGroupsTag();
512 static long GetVolumeGroupsTag();
513 static long Get0DElementsGroupsTag();
514 static long GetBallElementsGroupsTag();
516 // publishing methods
517 SALOMEDS::SComponent_ptr PublishComponent(SALOMEDS::Study_ptr theStudy);
518 SALOMEDS::SObject_ptr PublishMesh (SALOMEDS::Study_ptr theStudy,
519 SMESH::SMESH_Mesh_ptr theMesh,
520 const char* theName = 0);
521 SALOMEDS::SObject_ptr PublishHypothesis (SALOMEDS::Study_ptr theStudy,
522 SMESH::SMESH_Hypothesis_ptr theHyp,
523 const char* theName = 0);
524 SALOMEDS::SObject_ptr PublishSubMesh (SALOMEDS::Study_ptr theStudy,
525 SMESH::SMESH_Mesh_ptr theMesh,
526 SMESH::SMESH_subMesh_ptr theSubMesh,
527 GEOM::GEOM_Object_ptr theShapeObject,
528 const char* theName = 0);
529 SALOMEDS::SObject_ptr PublishGroup (SALOMEDS::Study_ptr theStudy,
530 SMESH::SMESH_Mesh_ptr theMesh,
531 SMESH::SMESH_GroupBase_ptr theGroup,
532 GEOM::GEOM_Object_ptr theShapeObject,
533 const char* theName = 0);
534 bool AddHypothesisToShape(SALOMEDS::Study_ptr theStudy,
535 SMESH::SMESH_Mesh_ptr theMesh,
536 GEOM::GEOM_Object_ptr theShapeObject,
537 SMESH::SMESH_Hypothesis_ptr theHyp);
538 bool RemoveHypothesisFromShape(SALOMEDS::Study_ptr theStudy,
539 SMESH::SMESH_Mesh_ptr theMesh,
540 GEOM::GEOM_Object_ptr theShapeObject,
541 SMESH::SMESH_Hypothesis_ptr theHyp);
542 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SALOMEDS::Study_ptr theStudy,
543 SMESH::SMESH_Mesh_ptr theMesh,
544 GEOM::GEOM_Object_ptr theShape);
545 static void SetName(SALOMEDS::SObject_ptr theSObject,
547 const char* theDefaultName = 0);
549 static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
550 const char* thePixMap);
553 StudyContext* GetCurrentStudyContext();
555 // Register an object in a StudyContext; return object id
556 int RegisterObject(CORBA::Object_ptr theObject);
558 // Return id of registered object
559 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
561 // Return an object that previously had an oldID
562 template<class TInterface>
563 typename TInterface::_var_type GetObjectByOldId( const int oldID )
565 if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) {
566 std::string ior = myStudyContext->getIORbyOldId( oldID );
568 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
570 return TInterface::_nil();
573 // Get current study ID
574 int GetCurrentStudyID();
577 * \brief Find SObject for an algo
579 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
581 void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters);
582 char* GetParameters(CORBA::Object_ptr theObject);
583 //char* ParseParameters(const char* theParameters);
584 const std::vector< int >& GetLastParamIndices() const { return myLastParamIndex; }
585 const std::vector< std::string >& GetLastParameters() const { return myLastParameters; }
586 const std::string & GetLastObjEntry() const { return myLastObj; }
587 std::vector< std::string > GetAllParameters(const std::string& theObjectEntry) const;
589 // Move objects to the specified position
590 void Move( const SMESH::sobject_list& what,
591 SALOMEDS::SObject_ptr where,
594 CORBA::Boolean IsApplicable ( const char* theAlgoType,
595 const char* theLibName,
596 GEOM::GEOM_Object_ptr theShapeObject,
597 CORBA::Boolean toCheckAll);
599 SMESH::long_array* GetInsideSphere( SMESH::SMESH_IDSource_ptr meshPart,
600 SMESH::ElementType theElemType,
606 SMESH::long_array* GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart,
607 SMESH::ElementType theElemType,
613 CORBA::Double theZ2);
615 SMESH::long_array* GetInsideCylinder( SMESH::SMESH_IDSource_ptr meshPart,
616 SMESH::ElementType theElemType,
624 CORBA::Double theR );
626 SMESH::long_array* GetInside( SMESH::SMESH_IDSource_ptr meshPart,
627 SMESH::ElementType theElemType,
628 GEOM::GEOM_Object_ptr theGeom,
629 CORBA::Double theTolerance );
632 // Get hypothesis creator
633 GenericHypothesisCreator_i* getHypothesisCreator( const char* theHypName,
634 const char* theLibName,
635 std::string& thePlatformLibName)
636 throw ( SALOME::SALOME_Exception );
637 // Create hypothesis of given type
638 SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
639 const char* theLibName);
640 // Create empty mesh on shape
641 SMESH::SMESH_Mesh_ptr createMesh()
642 throw ( SALOME::SALOME_Exception );
644 static void loadGeomData( SALOMEDS::SComponent_ptr theCompRoot );
646 SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
647 SMESH::DriverMED_ReadStatus& theStatus,
648 const char* theCommandNameForPython,
649 const char* theFileNameForPython);
651 void setCurrentStudy( SALOMEDS::Study_ptr theStudy,
652 bool theStudyIsBeingClosed=false);
654 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
655 SMESH::ElementType theElemType,
656 TopoDS_Shape& aShape,
657 double* theTolerance = NULL);
660 static GEOM::GEOM_Gen_var myGeomGen;
661 static CORBA::ORB_var myOrb; // ORB reference
662 static PortableServer::POA_var myPoa; // POA reference
663 static SALOME_NamingService* myNS; // Naming Service
664 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
665 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
666 ::SMESH_Gen myGen; // SMESH_Gen local implementation
668 // hypotheses managing
669 std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
671 std::map<int, StudyContext*> myStudyContextMap; // Map of study context objects
673 GEOM_Client* myShapeReader; // Shape reader
674 SALOMEDS::Study_var myCurrentStudy; // Current study
675 CORBA::Boolean myIsEmbeddedMode; // Current mode
677 // Default color of groups
678 std::string myDefaultGroupColor;
680 // To load full mesh data from study at hyp modification or not
681 bool myToForgetMeshDataOnHypModif;
683 // Dump Python: trace of API methods calls
684 std::map < int, Handle(TColStd_HSequenceOfAsciiString) > myPythonScripts;
685 bool myIsHistoricalPythonDump;
686 std::vector< int > myLastParamIndex;
687 std::vector< std::string > myLastParameters;
688 std::string myLastObj;
696 DownCast(CORBA::Object_ptr theArg)
698 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
702 * \brief Function used in SMESH_CATCH to convert a caught exception to
703 * SALOME::SALOME_Exception
705 inline void throwCorbaException(const char* excText)
707 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );