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
121 while( mapIdToIOR.IsBound( id ) )
126 TInt2StringMap mapIdToIOR; // persistent-to-transient map
127 TInt2IntMap mapIdToId; // to translate object from persistent to transient form
130 // ===========================================================
131 // SMESH module's engine
132 // ==========================================================
133 class SMESH_I_EXPORT SMESH_Gen_i:
134 public virtual POA_SMESH::SMESH_Gen,
135 public virtual Engines_Component_i
138 // Get last created instance of the class
139 static SMESH_Gen_i* GetSMESHGen() { return mySMESHGen;}
141 static CORBA::ORB_var GetORB() { return myOrb;}
142 // Get SMESH module's POA object
143 static PortableServer::POA_var GetPOA() { return myPoa;}
144 // Get Naming Service object
145 static SALOME_NamingService* GetNS();
146 // Get SALOME_LifeCycleCORBA object
147 static SALOME_LifeCycleCORBA* GetLCC();
148 // Retrieve and get GEOM engine reference
149 static GEOM::GEOM_Gen_var GetGeomEngine();
150 // Get object of the CORBA reference
151 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
152 // Get CORBA object corresponding to the SALOMEDS::SObject
153 static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
154 // Get the SALOMEDS::SObject corresponding to a CORBA object
155 static SALOMEDS::SObject_ptr ObjectToSObject(CORBA::Object_ptr theObject);
156 // Get the SALOMEDS::Study from naming service
157 static SALOMEDS::Study_ptr getStudyServant();
158 // Get GEOM Object corresponding to TopoDS_Shape
159 GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
160 // Get TopoDS_Shape corresponding to GEOM_Object
161 TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject);
163 // Default constructor
165 // Standard constructor
166 SMESH_Gen_i( CORBA::ORB_ptr orb,
167 PortableServer::POA_ptr poa,
168 PortableServer::ObjectId* contId,
169 const char* instanceName,
170 const char* interfaceName );
172 virtual ~SMESH_Gen_i();
174 // *****************************************
176 // *****************************************
177 // Set a new Mesh object name
178 void SetName(const char* theIOR,
179 const char* theName);
181 //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
182 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
185 void SetEmbeddedMode( CORBA::Boolean theMode );
186 // Check embedded mode
187 CORBA::Boolean IsEmbeddedMode();
189 // Set enable publishing in the study
190 void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
192 // Check enable publishing
193 CORBA::Boolean IsEnablePublish();
198 // Create hypothesis/algorothm of given type
199 SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
200 const char* theLibName)
201 throw ( SALOME::SALOME_Exception );
203 // Return hypothesis of given type holding parameter values of the existing mesh
204 SMESH::SMESH_Hypothesis_ptr GetHypothesisParameterValues (const char* theHypType,
205 const char* theLibName,
206 SMESH::SMESH_Mesh_ptr theMesh,
207 GEOM::GEOM_Object_ptr theGeom,
208 CORBA::Boolean byMesh)
209 throw ( SALOME::SALOME_Exception );
212 * Returns True if a hypothesis is assigned to a sole sub-mesh in a current Study
214 CORBA::Boolean GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr theHyp,
215 SMESH::SMESH_Mesh_out theMesh,
216 GEOM::GEOM_Object_out theShape);
221 * Sets number of segments per diagonal of boundary box of geometry by which
222 * default segment length of appropriate 1D hypotheses is defined
224 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments ) throw ( SALOME::SALOME_Exception );
226 * \brief Sets default number of segments per edge
228 void SetDefaultNbSegments(CORBA::Long theNbSegments) throw ( SALOME::SALOME_Exception );
233 virtual void SetOption(const char*, const char*);
235 Return an option value
237 virtual char* GetOption(const char*);
240 * To load full mesh data from study at hyp modification or not
242 bool ToForgetMeshDataOnHypModif() const { return myToForgetMeshDataOnHypModif; }
245 // Create empty mesh on a shape
246 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
247 throw ( SALOME::SALOME_Exception );
250 SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
251 throw ( SALOME::SALOME_Exception );
253 // Create a mesh and import data from an UNV file
254 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
255 throw ( SALOME::SALOME_Exception );
257 // Create mesh(es) and import data from MED file
258 SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
259 SMESH::DriverMED_ReadStatus& theStatus )
260 throw ( SALOME::SALOME_Exception );
262 // Create mesh(es) and import data from MED file
263 SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
264 SMESH::DriverMED_ReadStatus& theStatus )
265 throw ( SALOME::SALOME_Exception );
267 // Create a mesh and import data from a STL file
268 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
269 throw ( SALOME::SALOME_Exception );
271 // Create mesh(es) and import data from CGNS file
272 SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
273 SMESH::DriverMED_ReadStatus& theStatus )
274 throw ( SALOME::SALOME_Exception );
276 // Create a mesh and import data from a GMF file
277 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
278 CORBA::Boolean theMakeRequiredGroups,
279 SMESH::ComputeError_out theError)
280 throw ( SALOME::SALOME_Exception );
282 // Copy a part of mesh
283 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
284 const char* meshName,
285 CORBA::Boolean toCopyGroups,
286 CORBA::Boolean toKeepIDs);
288 // Compute mesh on a shape
289 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
290 GEOM::GEOM_Object_ptr theShapeObject )
291 throw ( SALOME::SALOME_Exception );
293 // Cancel Compute mesh on a shape
294 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
295 GEOM::GEOM_Object_ptr theShapeObject );
298 * \brief Return errors of mesh computation
300 SMESH::compute_error_array* GetComputeErrors(SMESH::SMESH_Mesh_ptr theMesh,
301 GEOM::GEOM_Object_ptr theShapeObject )
302 throw ( SALOME::SALOME_Exception );
305 * Evaluate mesh on a shape and
306 * returns statistic of mesh elements
307 * Result array of number enityties
309 SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
310 GEOM::GEOM_Object_ptr theShapeObject)
311 throw ( SALOME::SALOME_Exception );
313 // Returns true if mesh contains enough data to be computed
314 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
315 GEOM::GEOM_Object_ptr theShapeObject )
316 throw ( SALOME::SALOME_Exception );
319 * Calculate Mesh as preview till indicated dimension on shape
320 * First, verify list of hypothesis associated with the subShape.
321 * Return mesh preview structure
323 SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
324 GEOM::GEOM_Object_ptr theSubObject,
325 SMESH::Dimension theDimension,
326 SMESH::long_array& theShapesId )
327 throw ( SALOME::SALOME_Exception );
329 // Returns errors of hypotheses definition
330 SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh,
331 GEOM::GEOM_Object_ptr theSubObject )
332 throw ( SALOME::SALOME_Exception );
334 // Return mesh elements preventing computation of a subshape
335 SMESH::MeshPreviewStruct* GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
336 CORBA::Short theSubShapeID )
337 throw ( SALOME::SALOME_Exception );
339 // Create groups of elements preventing computation of a sub-shape
340 SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
341 CORBA::Short theSubShapeID,
342 const char* theGroupName)
343 throw ( SALOME::SALOME_Exception );
345 // Get sub-shapes unique ID's list
346 SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
347 const SMESH::object_array& theListOfSubShape )
348 throw ( SALOME::SALOME_Exception );
350 // Return geometrical object the given element is built on. Publish it in study.
351 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
352 CORBA::Long theElementID,
353 const char* theGeomName)
354 throw ( SALOME::SALOME_Exception );
356 // Return geometrical object the given element is built on. Don't publish it in study.
357 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
358 CORBA::Long theElementID)
359 throw ( SALOME::SALOME_Exception );
361 // Concatenate the given meshes into one mesh
362 SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray,
363 CORBA::Boolean uniteIdenticalGroups,
364 CORBA::Boolean mergeNodesAndElements,
365 CORBA::Double mergeTolerance,
366 CORBA::Boolean commonGroups)
367 throw ( SALOME::SALOME_Exception );
369 // Concatenate the given meshes into one mesh
370 SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::ListOfIDSources& meshesArray,
371 CORBA::Boolean uniteIdenticalGroups,
372 CORBA::Boolean mergeNodesAndElements,
373 CORBA::Double mergeTolerance)
374 throw ( SALOME::SALOME_Exception );
376 // Concatenate the given meshes into one mesh
377 // Create the groups of all elements from initial meshes
378 SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::ListOfIDSources& meshesArray,
379 CORBA::Boolean uniteIdenticalGroups,
380 CORBA::Boolean mergeNodesAndElements,
381 CORBA::Double mergeTolerance)
382 throw ( SALOME::SALOME_Exception );
384 // Get version of MED format being used.
385 char* GetMEDFileVersion();
387 // Get MED version of the file by its name
388 char* GetMEDVersion(const char* theFileName);
390 // Check compatibility of file with MED format being used.
391 CORBA::Boolean CheckCompatibility(const char* theFileName);
393 // Get names of meshes defined in file with the specified name
394 SMESH::string_array* GetMeshNames(const char* theFileName);
396 // ****************************************************
397 // Interface inherited methods (from SALOMEDS::Driver)
398 // ****************************************************
401 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
405 bool Load( SALOMEDS::SComponent_ptr theComponent,
406 const SALOMEDS::TMPFile& theStream,
409 // Save SMESH data in ASCII format
410 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
413 // Load SMESH data in ASCII format
414 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
415 const SALOMEDS::TMPFile& theStream,
419 // Create filter manager
420 SMESH::FilterManager_ptr CreateFilterManager();
422 // Return a pattern mesher
423 SMESH::SMESH_Pattern_ptr GetPattern();
425 // Create measurement instance
426 SMESH::Measurements_ptr CreateMeasurements();
428 // Clears study-connected data when it is closed
429 void Close( SALOMEDS::SComponent_ptr theComponent );
431 // Get component data type
432 char* ComponentDataType();
434 // Transform data from transient form to persistent
435 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
436 const char* IORString,
437 CORBA::Boolean isMultiFile,
438 CORBA::Boolean isASCII );
439 // Transform data from persistent form to transient
440 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
441 const char* aLocalPersistentID,
442 CORBA::Boolean isMultiFile,
443 CORBA::Boolean isASCII );
445 // Returns true if object can be published in the study
446 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
447 // Publish object in the study
448 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
449 CORBA::Object_ptr theObject,
450 const char* theName )
451 throw ( SALOME::SALOME_Exception );
453 // Copy-paste methods - returns true if object can be copied to the clipboard
454 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr theObject ) { return false; }
455 // Copy-paste methods - copy object to the clipboard
456 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID ) { return NULL; }
457 // Copy-paste methods - returns true if object can be pasted from the clipboard
458 CORBA::Boolean CanPaste( const char* theComponentName, CORBA::Long theObjectID ) { return false; }
459 // Copy-paste methods - paste object from the clipboard
460 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& theStream,
461 CORBA::Long theObjectID,
462 SALOMEDS::SObject_ptr theObject ) {
463 SALOMEDS::SObject_var aResultSO;
464 return aResultSO._retn();
468 // Version information
471 virtual char* getVersion();
477 virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
478 CORBA::Boolean isMultiFile,
479 CORBA::Boolean& isValidScript);
481 void AddToPythonScript (const TCollection_AsciiString& theString);
483 void RemoveLastFromPythonScript();
487 TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
488 Resource_DataMapOfAsciiStringAsciiString& theNames,
491 bool isHistoricalDump,
493 TCollection_AsciiString& theSavedTrace);
495 TCollection_AsciiString GetNewPythonLines();
497 void CleanPythonTrace();
499 // *****************************************
501 // *****************************************
504 GEOM_Client* GetShapeReader();
507 static long GetHypothesisRootTag();
508 static long GetAlgorithmsRootTag();
509 static long GetRefOnShapeTag();
510 static long GetRefOnAppliedHypothesisTag();
511 static long GetRefOnAppliedAlgorithmsTag();
512 static long GetSubMeshOnVertexTag();
513 static long GetSubMeshOnEdgeTag();
514 static long GetSubMeshOnFaceTag();
515 static long GetSubMeshOnSolidTag();
516 static long GetSubMeshOnCompoundTag();
517 static long GetSubMeshOnWireTag();
518 static long GetSubMeshOnShellTag();
519 static long GetNodeGroupsTag();
520 static long GetEdgeGroupsTag();
521 static long GetFaceGroupsTag();
522 static long GetVolumeGroupsTag();
523 static long Get0DElementsGroupsTag();
524 static long GetBallElementsGroupsTag();
526 // publishing methods
527 SALOMEDS::SComponent_ptr PublishComponent();
528 SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
529 const char* theName = 0);
530 SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
531 const char* theName = 0);
532 SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
533 SMESH::SMESH_subMesh_ptr theSubMesh,
534 GEOM::GEOM_Object_ptr theShapeObject,
535 const char* theName = 0);
536 SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
537 SMESH::SMESH_GroupBase_ptr theGroup,
538 GEOM::GEOM_Object_ptr theShapeObject,
539 const char* theName = 0);
540 bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
541 GEOM::GEOM_Object_ptr theShapeObject,
542 SMESH::SMESH_Hypothesis_ptr theHyp);
543 bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
544 GEOM::GEOM_Object_ptr theShapeObject,
545 SMESH::SMESH_Hypothesis_ptr theHyp);
546 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
547 GEOM::GEOM_Object_ptr theShape);
548 static void SetName(SALOMEDS::SObject_ptr theSObject,
550 const char* theDefaultName = 0);
552 static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
553 const char* thePixMap);
556 StudyContext* GetStudyContext();
558 // Register an object in a StudyContext; return object id
559 int RegisterObject(CORBA::Object_ptr theObject);
561 // Return id of registered object
562 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
564 // Return an object that previously had an oldID
565 template<class TInterface>
566 typename TInterface::_var_type GetObjectByOldId( const int oldID )
568 if ( myStudyContext ) {
569 std::string ior = myStudyContext->getIORbyOldId( oldID );
571 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
573 return TInterface::_nil();
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 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
652 SMESH::ElementType theElemType,
653 TopoDS_Shape& aShape,
654 double* theTolerance = NULL);
657 static GEOM::GEOM_Gen_var myGeomGen;
658 static CORBA::ORB_var myOrb; // ORB reference
659 static PortableServer::POA_var myPoa; // POA reference
660 static SALOME_NamingService* myNS; // Naming Service
661 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
662 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
663 ::SMESH_Gen myGen; // SMESH_Gen local implementation
665 // hypotheses managing
666 std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
668 StudyContext* myStudyContext; // study context
670 GEOM_Client* myShapeReader; // Shape reader
671 CORBA::Boolean myIsEmbeddedMode; // Current mode
672 CORBA::Boolean myIsEnablePublish; // Enable publishing
674 // Default color of groups
675 std::string myDefaultGroupColor;
677 // To load full mesh data from study at hyp modification or not
678 bool myToForgetMeshDataOnHypModif;
680 // Dump Python: trace of API methods calls
681 Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
682 bool myIsHistoricalPythonDump;
683 std::vector< int > myLastParamIndex;
684 std::vector< std::string > myLastParameters;
685 std::string myLastObj;
693 DownCast(CORBA::Object_ptr theArg)
695 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
699 * \brief Function used in SMESH_CATCH to convert a caught exception to
700 * SALOME::SALOME_Exception
702 inline void throwCorbaException(const char* excText)
704 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );