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 - store 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;
70 // register object in the internal map and return its id
71 int addObject( const std::string& theIOR );
72 // find the object id in the internal map by the IOR
73 int findId( const std::string& theIOR );
74 // get object's IOR by id
75 std::string getIORbyId( const int theId );
76 // get object's IOR by old id
77 std::string getIORbyOldId( const int theOldId );
78 // maps old object id to the new one (used when restoring data)
79 void mapOldToNew( const int oldId, const int newId );
80 // get old id by a new one
81 int getOldId( const int newId );
84 // get next free object identifier
85 int getNextId() { return mapIdToIOR.Extent() + 1; }
87 TInt2StringMap mapIdToIOR; // persistent-to-transient map
88 TInt2IntMap mapIdToId; // to translate object from persistent to transient form
91 // ===========================================================
92 // SMESH module's engine
93 // ==========================================================
94 class SMESH_I_EXPORT SMESH_Gen_i:
95 public virtual POA_SMESH::SMESH_Gen,
96 public virtual Engines_Component_i
99 // Get last created instance of the class
100 static SMESH_Gen_i* GetSMESHGen() { return mySMESHGen;}
102 static CORBA::ORB_var GetORB() { return myOrb;}
103 // Get SMESH module's POA object
104 static PortableServer::POA_var GetPOA() { return myPoa;}
105 // Get Naming Service object
106 static SALOME_NamingService* GetNS();
107 // Get SALOME_LifeCycleCORBA object
108 static SALOME_LifeCycleCORBA* GetLCC();
109 // Retrieve and get GEOM engine reference
110 static GEOM::GEOM_Gen_var GetGeomEngine();
111 // Get object of the CORBA reference
112 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
113 // Get CORBA object corresponding to the SALOMEDS::SObject
114 static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
115 // Get the SALOMEDS::SObject corresponding to a CORBA object
116 static SALOMEDS::SObject_ptr ObjectToSObject(CORBA::Object_ptr theObject);
117 // Get the SALOMEDS::Study from naming service
118 static SALOMEDS::Study_var getStudyServant();
119 // Get GEOM Object corresponding to TopoDS_Shape
120 GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
121 // Get TopoDS_Shape corresponding to GEOM_Object
122 TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject);
124 // Default constructor
126 // Standard constructor
127 SMESH_Gen_i( CORBA::ORB_ptr orb,
128 PortableServer::POA_ptr poa,
129 PortableServer::ObjectId* contId,
130 const char* instanceName,
131 const char* interfaceName );
133 virtual ~SMESH_Gen_i();
135 // *****************************************
137 // *****************************************
138 // Set a new Mesh object name
139 void SetName(const char* theIOR,
140 const char* theName);
142 //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
143 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
146 void SetEmbeddedMode( CORBA::Boolean theMode );
147 // Check embedded mode
148 CORBA::Boolean IsEmbeddedMode();
150 // Set enable publishing in the study
151 void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
153 // Check enable publishing
154 CORBA::Boolean IsEnablePublish();
159 // Create hypothesis/algorothm of given type
160 SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
161 const char* theLibName)
162 throw ( SALOME::SALOME_Exception );
164 // Return hypothesis of given type holding parameter values of the existing mesh
165 SMESH::SMESH_Hypothesis_ptr GetHypothesisParameterValues (const char* theHypType,
166 const char* theLibName,
167 SMESH::SMESH_Mesh_ptr theMesh,
168 GEOM::GEOM_Object_ptr theGeom,
169 CORBA::Boolean byMesh)
170 throw ( SALOME::SALOME_Exception );
173 * Returns True if a hypothesis is assigned to a sole sub-mesh in a current Study
175 CORBA::Boolean GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr theHyp,
176 SMESH::SMESH_Mesh_out theMesh,
177 GEOM::GEOM_Object_out theShape);
182 * Sets number of segments per diagonal of boundary box of geometry by which
183 * default segment length of appropriate 1D hypotheses is defined
185 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments ) throw ( SALOME::SALOME_Exception );
187 * \brief Sets default number of segments per edge
189 void SetDefaultNbSegments(CORBA::Long theNbSegments) throw ( SALOME::SALOME_Exception );
194 virtual void SetOption(const char*, const char*);
196 Return an option value
198 virtual char* GetOption(const char*);
201 * To load full mesh data from study at hyp modification or not
203 bool ToForgetMeshDataOnHypModif() const { return myToForgetMeshDataOnHypModif; }
206 // Create empty mesh on a shape
207 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
208 throw ( SALOME::SALOME_Exception );
211 SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
212 throw ( SALOME::SALOME_Exception );
214 // Create a mesh and import data from an UNV file
215 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
216 throw ( SALOME::SALOME_Exception );
218 // Create mesh(es) and import data from MED file
219 SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
220 SMESH::DriverMED_ReadStatus& theStatus )
221 throw ( SALOME::SALOME_Exception );
223 // Create mesh(es) and import data from MED file
224 SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
225 SMESH::DriverMED_ReadStatus& theStatus )
226 throw ( SALOME::SALOME_Exception );
228 // Create a mesh and import data from a STL file
229 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
230 throw ( SALOME::SALOME_Exception );
232 // Create mesh(es) and import data from CGNS file
233 SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
234 SMESH::DriverMED_ReadStatus& theStatus )
235 throw ( SALOME::SALOME_Exception );
237 // Create a mesh and import data from a GMF file
238 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
239 CORBA::Boolean theMakeRequiredGroups,
240 SMESH::ComputeError_out theError)
241 throw ( SALOME::SALOME_Exception );
243 // Copy a part of mesh
244 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
245 const char* meshName,
246 CORBA::Boolean toCopyGroups,
247 CORBA::Boolean toKeepIDs);
249 // Compute mesh on a shape
250 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
251 GEOM::GEOM_Object_ptr theShapeObject )
252 throw ( SALOME::SALOME_Exception );
254 // Cancel Compute mesh on a shape
255 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
256 GEOM::GEOM_Object_ptr theShapeObject );
259 * \brief Return errors of mesh computation
261 SMESH::compute_error_array* GetComputeErrors(SMESH::SMESH_Mesh_ptr theMesh,
262 GEOM::GEOM_Object_ptr theShapeObject )
263 throw ( SALOME::SALOME_Exception );
266 * Evaluate mesh on a shape and
267 * returns statistic of mesh elements
268 * Result array of number enityties
270 SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
271 GEOM::GEOM_Object_ptr theShapeObject)
272 throw ( SALOME::SALOME_Exception );
274 // Returns true if mesh contains enough data to be computed
275 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
276 GEOM::GEOM_Object_ptr theShapeObject )
277 throw ( SALOME::SALOME_Exception );
280 * Calculate Mesh as preview till indicated dimension on shape
281 * First, verify list of hypothesis associated with the subShape.
282 * Return mesh preview structure
284 SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
285 GEOM::GEOM_Object_ptr theSubObject,
286 SMESH::Dimension theDimension,
287 SMESH::long_array& theShapesId )
288 throw ( SALOME::SALOME_Exception );
290 // Returns errors of hypotheses definition
291 SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh,
292 GEOM::GEOM_Object_ptr theSubObject )
293 throw ( SALOME::SALOME_Exception );
295 // Return mesh elements preventing computation of a subshape
296 SMESH::MeshPreviewStruct* GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
297 CORBA::Short theSubShapeID )
298 throw ( SALOME::SALOME_Exception );
300 // Create groups of elements preventing computation of a sub-shape
301 SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
302 CORBA::Short theSubShapeID,
303 const char* theGroupName)
304 throw ( SALOME::SALOME_Exception );
306 // Get sub-shapes unique ID's list
307 SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
308 const SMESH::object_array& theListOfSubShape )
309 throw ( SALOME::SALOME_Exception );
311 // Return geometrical object the given element is built on. Publish it in study.
312 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
313 CORBA::Long theElementID,
314 const char* theGeomName)
315 throw ( SALOME::SALOME_Exception );
317 // Return geometrical object the given element is built on. Don't publish it in study.
318 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
319 CORBA::Long theElementID)
320 throw ( SALOME::SALOME_Exception );
322 // Concatenate the given meshes into one mesh
323 SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray,
324 CORBA::Boolean uniteIdenticalGroups,
325 CORBA::Boolean mergeNodesAndElements,
326 CORBA::Double mergeTolerance,
327 CORBA::Boolean commonGroups)
328 throw ( SALOME::SALOME_Exception );
330 // Concatenate the given meshes into one mesh
331 SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::ListOfIDSources& meshesArray,
332 CORBA::Boolean uniteIdenticalGroups,
333 CORBA::Boolean mergeNodesAndElements,
334 CORBA::Double mergeTolerance)
335 throw ( SALOME::SALOME_Exception );
337 // Concatenate the given meshes into one mesh
338 // Create the groups of all elements from initial meshes
339 SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::ListOfIDSources& meshesArray,
340 CORBA::Boolean uniteIdenticalGroups,
341 CORBA::Boolean mergeNodesAndElements,
342 CORBA::Double mergeTolerance)
343 throw ( SALOME::SALOME_Exception );
345 // Get version of MED format being used.
346 char* GetMEDFileVersion();
348 // Get MED version of the file by its name
349 char* GetMEDVersion(const char* theFileName);
351 // Check compatibility of file with MED format being used, read only.
352 CORBA::Boolean CheckCompatibility(const char* theFileName);
354 // Check compatibility of file with MED format being used, for append on write.
355 CORBA::Boolean CheckWriteCompatibility(const char* theFileName);
357 // Get names of meshes defined in file with the specified name
358 SMESH::string_array* GetMeshNames(const char* theFileName);
360 // ****************************************************
361 // Interface inherited methods (from SALOMEDS::Driver)
362 // ****************************************************
365 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
369 bool Load( SALOMEDS::SComponent_ptr theComponent,
370 const SALOMEDS::TMPFile& theStream,
373 // Save SMESH data in ASCII format
374 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
377 // Load SMESH data in ASCII format
378 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
379 const SALOMEDS::TMPFile& theStream,
383 // Create filter manager
384 SMESH::FilterManager_ptr CreateFilterManager();
386 // Return a pattern mesher
387 SMESH::SMESH_Pattern_ptr GetPattern();
389 // Create measurement instance
390 SMESH::Measurements_ptr CreateMeasurements();
392 // Clears study-connected data when it is closed
393 void Close( SALOMEDS::SComponent_ptr theComponent );
395 // Get component data type
396 char* ComponentDataType();
398 // Transform data from transient form to persistent
399 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
400 const char* IORString,
401 CORBA::Boolean isMultiFile,
402 CORBA::Boolean isASCII );
403 // Transform data from persistent form to transient
404 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
405 const char* aLocalPersistentID,
406 CORBA::Boolean isMultiFile,
407 CORBA::Boolean isASCII );
409 // Returns true if object can be published in the study
410 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
411 // Publish object in the study
412 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
413 CORBA::Object_ptr theObject,
414 const char* theName )
415 throw ( SALOME::SALOME_Exception );
417 // Copy-paste methods - returns true if object can be copied to the clipboard
418 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr theObject ) { return false; }
419 // Copy-paste methods - copy object to the clipboard
420 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID ) { return NULL; }
421 // Copy-paste methods - returns true if object can be pasted from the clipboard
422 CORBA::Boolean CanPaste( const char* theComponentName, CORBA::Long theObjectID ) { return false; }
423 // Copy-paste methods - paste object from the clipboard
424 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& theStream,
425 CORBA::Long theObjectID,
426 SALOMEDS::SObject_ptr theObject ) {
427 SALOMEDS::SObject_var aResultSO;
428 return aResultSO._retn();
432 // Version information
435 virtual char* getVersion();
441 virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
442 CORBA::Boolean isMultiFile,
443 CORBA::Boolean& isValidScript);
445 void AddToPythonScript (const TCollection_AsciiString& theString);
447 void RemoveLastFromPythonScript();
451 TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
452 Resource_DataMapOfAsciiStringAsciiString& theNames,
455 bool isHistoricalDump,
457 TCollection_AsciiString& theSavedTrace);
459 TCollection_AsciiString GetNewPythonLines();
461 void CleanPythonTrace();
463 // *****************************************
465 // *****************************************
468 GEOM_Client* GetShapeReader();
471 static long GetHypothesisRootTag();
472 static long GetAlgorithmsRootTag();
473 static long GetRefOnShapeTag();
474 static long GetRefOnAppliedHypothesisTag();
475 static long GetRefOnAppliedAlgorithmsTag();
476 static long GetSubMeshOnVertexTag();
477 static long GetSubMeshOnEdgeTag();
478 static long GetSubMeshOnFaceTag();
479 static long GetSubMeshOnSolidTag();
480 static long GetSubMeshOnCompoundTag();
481 static long GetSubMeshOnWireTag();
482 static long GetSubMeshOnShellTag();
483 static long GetNodeGroupsTag();
484 static long GetEdgeGroupsTag();
485 static long GetFaceGroupsTag();
486 static long GetVolumeGroupsTag();
487 static long Get0DElementsGroupsTag();
488 static long GetBallElementsGroupsTag();
490 // publishing methods
491 SALOMEDS::SComponent_ptr PublishComponent();
492 SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
493 const char* theName = 0);
494 SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
495 const char* theName = 0);
496 SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
497 SMESH::SMESH_subMesh_ptr theSubMesh,
498 GEOM::GEOM_Object_ptr theShapeObject,
499 const char* theName = 0);
500 SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
501 SMESH::SMESH_GroupBase_ptr theGroup,
502 GEOM::GEOM_Object_ptr theShapeObject,
503 const char* theName = 0);
504 void UpdateIcons(SMESH::SMESH_Mesh_ptr theMesh);
505 bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
506 GEOM::GEOM_Object_ptr theShapeObject,
507 SMESH::SMESH_Hypothesis_ptr theHyp);
508 bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
509 GEOM::GEOM_Object_ptr theShapeObject,
510 SMESH::SMESH_Hypothesis_ptr theHyp);
511 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
512 GEOM::GEOM_Object_ptr theShape);
513 static void SetName(SALOMEDS::SObject_ptr theSObject,
515 const char* theDefaultName = 0);
517 static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
518 const char* thePixMap);
521 StudyContext* GetStudyContext();
523 // Register an object in a StudyContext; return object id
524 int RegisterObject(CORBA::Object_ptr theObject);
526 // Return id of registered object
527 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
529 // Return an object that previously had an oldID
530 template<class TInterface>
531 typename TInterface::_var_type GetObjectByOldId( const int oldID )
533 if ( myStudyContext ) {
534 std::string ior = myStudyContext->getIORbyOldId( oldID );
536 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
538 return TInterface::_nil();
542 * \brief Find SObject for an algo
544 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
546 void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters);
547 char* GetParameters(CORBA::Object_ptr theObject);
548 //char* ParseParameters(const char* theParameters);
549 const std::vector< int >& GetLastParamIndices() const { return myLastParamIndex; }
550 const std::vector< std::string >& GetLastParameters() const { return myLastParameters; }
551 const std::string & GetLastObjEntry() const { return myLastObj; }
552 std::vector< std::string > GetAllParameters(const std::string& theObjectEntry) const;
554 // Move objects to the specified position
555 void Move( const SMESH::sobject_list& what,
556 SALOMEDS::SObject_ptr where,
559 CORBA::Boolean IsApplicable ( const char* theAlgoType,
560 const char* theLibName,
561 GEOM::GEOM_Object_ptr theShapeObject,
562 CORBA::Boolean toCheckAll);
564 SMESH::long_array* GetInsideSphere( SMESH::SMESH_IDSource_ptr meshPart,
565 SMESH::ElementType theElemType,
571 SMESH::long_array* GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart,
572 SMESH::ElementType theElemType,
578 CORBA::Double theZ2);
580 SMESH::long_array* GetInsideCylinder( SMESH::SMESH_IDSource_ptr meshPart,
581 SMESH::ElementType theElemType,
589 CORBA::Double theR );
591 SMESH::long_array* GetInside( SMESH::SMESH_IDSource_ptr meshPart,
592 SMESH::ElementType theElemType,
593 GEOM::GEOM_Object_ptr theGeom,
594 CORBA::Double theTolerance );
597 // Get hypothesis creator
598 GenericHypothesisCreator_i* getHypothesisCreator( const char* theHypName,
599 const char* theLibName,
600 std::string& thePlatformLibName)
601 throw ( SALOME::SALOME_Exception );
602 // Create hypothesis of given type
603 SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
604 const char* theLibName);
605 // Create empty mesh on shape
606 SMESH::SMESH_Mesh_ptr createMesh()
607 throw ( SALOME::SALOME_Exception );
609 static void loadGeomData( SALOMEDS::SComponent_ptr theCompRoot );
611 SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
612 SMESH::DriverMED_ReadStatus& theStatus,
613 const char* theCommandNameForPython,
614 const char* theFileNameForPython);
616 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
617 SMESH::ElementType theElemType,
618 TopoDS_Shape& aShape,
619 double* theTolerance = NULL);
622 static GEOM::GEOM_Gen_var myGeomGen;
623 static CORBA::ORB_var myOrb; // ORB reference
624 static PortableServer::POA_var myPoa; // POA reference
625 static SALOME_NamingService* myNS; // Naming Service
626 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
627 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
628 ::SMESH_Gen myGen; // SMESH_Gen local implementation
630 // hypotheses managing
631 std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
633 StudyContext* myStudyContext; // study context
635 GEOM_Client* myShapeReader; // Shape reader
636 CORBA::Boolean myIsEmbeddedMode; // Current mode
637 CORBA::Boolean myIsEnablePublish; // Enable publishing
639 // Default color of groups
640 std::string myDefaultGroupColor;
642 // To load full mesh data from study at hyp modification or not
643 bool myToForgetMeshDataOnHypModif;
645 // Dump Python: trace of API methods calls
646 Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
647 bool myIsHistoricalPythonDump;
648 std::vector< int > myLastParamIndex;
649 std::vector< std::string > myLastParameters;
650 std::string myLastObj;
658 DownCast(CORBA::Object_ptr theArg)
660 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
664 * \brief Function used in SMESH_CATCH to convert a caught exception to
665 * SALOME::SALOME_Exception
667 inline void throwCorbaException(const char* excText)
669 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );