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 );
86 // get next free object identifier
87 int getNextId() { return mapIdToIOR.Extent() + 1; }
89 TInt2StringMap mapIdToIOR; // persistent-to-transient map
90 TInt2IntMap mapIdToId; // to translate object from persistent to transient form
93 // ===========================================================
94 // SMESH module's engine
95 // ==========================================================
96 class SMESH_I_EXPORT SMESH_Gen_i:
97 public virtual POA_SMESH::SMESH_Gen,
98 public virtual Engines_Component_i
101 // Get last created instance of the class
102 static SMESH_Gen_i* GetSMESHGen() { return mySMESHGen;}
104 static CORBA::ORB_var GetORB() { return myOrb;}
105 // Get SMESH module's POA object
106 static PortableServer::POA_var GetPOA() { return myPoa;}
107 // Get Naming Service object
108 static SALOME_NamingService* GetNS();
109 // Get SALOME_LifeCycleCORBA object
110 static SALOME_LifeCycleCORBA* GetLCC();
111 // Retrieve and get GEOM engine reference
112 static GEOM::GEOM_Gen_var GetGeomEngine();
113 // Get object of the CORBA reference
114 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
115 // Get CORBA object corresponding to the SALOMEDS::SObject
116 static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
117 // Get the SALOMEDS::SObject corresponding to a CORBA object
118 static SALOMEDS::SObject_ptr ObjectToSObject(CORBA::Object_ptr theObject);
119 // Get the SALOMEDS::Study from naming service
120 static SALOMEDS::Study_var getStudyServant();
121 // Get GEOM Object corresponding to TopoDS_Shape
122 GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
123 // Get TopoDS_Shape corresponding to GEOM_Object
124 TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject);
126 // Default constructor
128 // Standard constructor
129 SMESH_Gen_i( CORBA::ORB_ptr orb,
130 PortableServer::POA_ptr poa,
131 PortableServer::ObjectId* contId,
132 const char* instanceName,
133 const char* interfaceName );
135 virtual ~SMESH_Gen_i();
137 // *****************************************
139 // *****************************************
140 // Set a new Mesh object name
141 void SetName(const char* theIOR,
142 const char* theName);
144 //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
145 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
148 void SetEmbeddedMode( CORBA::Boolean theMode );
149 // Check embedded mode
150 CORBA::Boolean IsEmbeddedMode();
152 // Set enable publishing in the study
153 void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
155 // Check enable publishing
156 CORBA::Boolean IsEnablePublish();
161 // Create hypothesis/algorothm of given type
162 SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
163 const char* theLibName)
164 throw ( SALOME::SALOME_Exception );
166 // Return hypothesis of given type holding parameter values of the existing mesh
167 SMESH::SMESH_Hypothesis_ptr GetHypothesisParameterValues (const char* theHypType,
168 const char* theLibName,
169 SMESH::SMESH_Mesh_ptr theMesh,
170 GEOM::GEOM_Object_ptr theGeom,
171 CORBA::Boolean byMesh)
172 throw ( SALOME::SALOME_Exception );
175 * Returns True if a hypothesis is assigned to a sole sub-mesh in a current Study
177 CORBA::Boolean GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr theHyp,
178 SMESH::SMESH_Mesh_out theMesh,
179 GEOM::GEOM_Object_out theShape);
184 * Sets number of segments per diagonal of boundary box of geometry by which
185 * default segment length of appropriate 1D hypotheses is defined
187 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments ) throw ( SALOME::SALOME_Exception );
189 * \brief Sets default number of segments per edge
191 void SetDefaultNbSegments(CORBA::Long theNbSegments) throw ( SALOME::SALOME_Exception );
196 virtual void SetOption(const char*, const char*);
198 Return an option value
200 virtual char* GetOption(const char*);
203 * To load full mesh data from study at hyp modification or not
205 bool ToForgetMeshDataOnHypModif() const { return myToForgetMeshDataOnHypModif; }
208 // Create empty mesh on a shape
209 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
210 throw ( SALOME::SALOME_Exception );
213 SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
214 throw ( SALOME::SALOME_Exception );
216 // Create a mesh and import data from an UNV file
217 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
218 throw ( SALOME::SALOME_Exception );
220 // Create mesh(es) and import data from MED file
221 SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
222 SMESH::DriverMED_ReadStatus& theStatus )
223 throw ( SALOME::SALOME_Exception );
225 // Create mesh(es) and import data from MED file
226 SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
227 SMESH::DriverMED_ReadStatus& theStatus )
228 throw ( SALOME::SALOME_Exception );
230 // Create a mesh and import data from a STL file
231 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
232 throw ( SALOME::SALOME_Exception );
234 // Create mesh(es) and import data from CGNS file
235 SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
236 SMESH::DriverMED_ReadStatus& theStatus )
237 throw ( SALOME::SALOME_Exception );
239 // Create a mesh and import data from a GMF file
240 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
241 CORBA::Boolean theMakeRequiredGroups,
242 SMESH::ComputeError_out theError)
243 throw ( SALOME::SALOME_Exception );
245 // Copy a part of mesh
246 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
247 const char* meshName,
248 CORBA::Boolean toCopyGroups,
249 CORBA::Boolean toKeepIDs);
251 // Compute mesh on a shape
252 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
253 GEOM::GEOM_Object_ptr theShapeObject )
254 throw ( SALOME::SALOME_Exception );
256 // Cancel Compute mesh on a shape
257 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
258 GEOM::GEOM_Object_ptr theShapeObject );
261 * \brief Return errors of mesh computation
263 SMESH::compute_error_array* GetComputeErrors(SMESH::SMESH_Mesh_ptr theMesh,
264 GEOM::GEOM_Object_ptr theShapeObject )
265 throw ( SALOME::SALOME_Exception );
268 * Evaluate mesh on a shape and
269 * returns statistic of mesh elements
270 * Result array of number enityties
272 SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
273 GEOM::GEOM_Object_ptr theShapeObject)
274 throw ( SALOME::SALOME_Exception );
276 // Returns true if mesh contains enough data to be computed
277 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
278 GEOM::GEOM_Object_ptr theShapeObject )
279 throw ( SALOME::SALOME_Exception );
282 * Calculate Mesh as preview till indicated dimension on shape
283 * First, verify list of hypothesis associated with the subShape.
284 * Return mesh preview structure
286 SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
287 GEOM::GEOM_Object_ptr theSubObject,
288 SMESH::Dimension theDimension,
289 SMESH::long_array& theShapesId )
290 throw ( SALOME::SALOME_Exception );
292 // Returns errors of hypotheses definition
293 SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh,
294 GEOM::GEOM_Object_ptr theSubObject )
295 throw ( SALOME::SALOME_Exception );
297 // Return mesh elements preventing computation of a subshape
298 SMESH::MeshPreviewStruct* GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
299 CORBA::Short theSubShapeID )
300 throw ( SALOME::SALOME_Exception );
302 // Create groups of elements preventing computation of a sub-shape
303 SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
304 CORBA::Short theSubShapeID,
305 const char* theGroupName)
306 throw ( SALOME::SALOME_Exception );
308 // Get sub-shapes unique ID's list
309 SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
310 const SMESH::object_array& theListOfSubShape )
311 throw ( SALOME::SALOME_Exception );
313 // Return geometrical object the given element is built on. Publish it in study.
314 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
315 CORBA::Long theElementID,
316 const char* theGeomName)
317 throw ( SALOME::SALOME_Exception );
319 // Return geometrical object the given element is built on. Don't publish it in study.
320 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
321 CORBA::Long theElementID)
322 throw ( SALOME::SALOME_Exception );
324 // Concatenate the given meshes into one mesh
325 SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray,
326 CORBA::Boolean uniteIdenticalGroups,
327 CORBA::Boolean mergeNodesAndElements,
328 CORBA::Double mergeTolerance,
329 CORBA::Boolean commonGroups)
330 throw ( SALOME::SALOME_Exception );
332 // Concatenate the given meshes into one mesh
333 SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::ListOfIDSources& meshesArray,
334 CORBA::Boolean uniteIdenticalGroups,
335 CORBA::Boolean mergeNodesAndElements,
336 CORBA::Double mergeTolerance)
337 throw ( SALOME::SALOME_Exception );
339 // Concatenate the given meshes into one mesh
340 // Create the groups of all elements from initial meshes
341 SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::ListOfIDSources& meshesArray,
342 CORBA::Boolean uniteIdenticalGroups,
343 CORBA::Boolean mergeNodesAndElements,
344 CORBA::Double mergeTolerance)
345 throw ( SALOME::SALOME_Exception );
347 // Get version of MED format being used.
348 char* GetMEDFileVersion();
350 // Get MED version of the file by its name
351 char* GetMEDVersion(const char* theFileName);
353 // Check compatibility of file with MED format being used, read only.
354 CORBA::Boolean CheckCompatibility(const char* theFileName);
356 // Check compatibility of file with MED format being used, for append on write.
357 CORBA::Boolean CheckWriteCompatibility(const char* theFileName);
359 // Get names of meshes defined in file with the specified name
360 SMESH::string_array* GetMeshNames(const char* theFileName);
362 // ****************************************************
363 // Interface inherited methods (from SALOMEDS::Driver)
364 // ****************************************************
367 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
371 bool Load( SALOMEDS::SComponent_ptr theComponent,
372 const SALOMEDS::TMPFile& theStream,
375 // Save SMESH data in ASCII format
376 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
379 // Load SMESH data in ASCII format
380 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
381 const SALOMEDS::TMPFile& theStream,
385 // Create filter manager
386 SMESH::FilterManager_ptr CreateFilterManager();
388 // Return a pattern mesher
389 SMESH::SMESH_Pattern_ptr GetPattern();
391 // Create measurement instance
392 SMESH::Measurements_ptr CreateMeasurements();
394 // Clears study-connected data when it is closed
395 void Close( SALOMEDS::SComponent_ptr theComponent );
397 // Get component data type
398 char* ComponentDataType();
400 // Transform data from transient form to persistent
401 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
402 const char* IORString,
403 CORBA::Boolean isMultiFile,
404 CORBA::Boolean isASCII );
405 // Transform data from persistent form to transient
406 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
407 const char* aLocalPersistentID,
408 CORBA::Boolean isMultiFile,
409 CORBA::Boolean isASCII );
411 // Returns true if object can be published in the study
412 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
413 // Publish object in the study
414 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
415 CORBA::Object_ptr theObject,
416 const char* theName )
417 throw ( SALOME::SALOME_Exception );
419 // Copy-paste methods - returns true if object can be copied to the clipboard
420 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr theObject ) { return false; }
421 // Copy-paste methods - copy object to the clipboard
422 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID ) { return NULL; }
423 // Copy-paste methods - returns true if object can be pasted from the clipboard
424 CORBA::Boolean CanPaste( const char* theComponentName, CORBA::Long theObjectID ) { return false; }
425 // Copy-paste methods - paste object from the clipboard
426 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& theStream,
427 CORBA::Long theObjectID,
428 SALOMEDS::SObject_ptr theObject ) {
429 SALOMEDS::SObject_var aResultSO;
430 return aResultSO._retn();
434 // Version information
437 virtual char* getVersion();
443 virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
444 CORBA::Boolean isMultiFile,
445 CORBA::Boolean& isValidScript);
447 void AddToPythonScript (const TCollection_AsciiString& theString);
449 void RemoveLastFromPythonScript();
453 TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
454 Resource_DataMapOfAsciiStringAsciiString& theNames,
457 bool isHistoricalDump,
459 TCollection_AsciiString& theSavedTrace);
461 TCollection_AsciiString GetNewPythonLines();
463 void CleanPythonTrace();
465 // *****************************************
467 // *****************************************
470 GEOM_Client* GetShapeReader();
473 static long GetHypothesisRootTag();
474 static long GetAlgorithmsRootTag();
475 static long GetRefOnShapeTag();
476 static long GetRefOnAppliedHypothesisTag();
477 static long GetRefOnAppliedAlgorithmsTag();
478 static long GetSubMeshOnVertexTag();
479 static long GetSubMeshOnEdgeTag();
480 static long GetSubMeshOnFaceTag();
481 static long GetSubMeshOnSolidTag();
482 static long GetSubMeshOnCompoundTag();
483 static long GetSubMeshOnWireTag();
484 static long GetSubMeshOnShellTag();
485 static long GetNodeGroupsTag();
486 static long GetEdgeGroupsTag();
487 static long GetFaceGroupsTag();
488 static long GetVolumeGroupsTag();
489 static long Get0DElementsGroupsTag();
490 static long GetBallElementsGroupsTag();
492 // publishing methods
493 SALOMEDS::SComponent_ptr PublishComponent();
494 SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
495 const char* theName = 0);
496 SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
497 const char* theName = 0);
498 SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
499 SMESH::SMESH_subMesh_ptr theSubMesh,
500 GEOM::GEOM_Object_ptr theShapeObject,
501 const char* theName = 0);
502 SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
503 SMESH::SMESH_GroupBase_ptr theGroup,
504 GEOM::GEOM_Object_ptr theShapeObject,
505 const char* theName = 0);
506 void UpdateIcons(SMESH::SMESH_Mesh_ptr theMesh);
507 bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
508 GEOM::GEOM_Object_ptr theShapeObject,
509 SMESH::SMESH_Hypothesis_ptr theHyp);
510 bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
511 GEOM::GEOM_Object_ptr theShapeObject,
512 SMESH::SMESH_Hypothesis_ptr theHyp);
513 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
514 GEOM::GEOM_Object_ptr theShape);
515 static void SetName(SALOMEDS::SObject_ptr theSObject,
517 const char* theDefaultName = 0);
519 static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
520 const char* thePixMap);
523 StudyContext* GetStudyContext();
525 // Register an object in a StudyContext; return object id
526 int RegisterObject(CORBA::Object_ptr theObject);
528 // Return id of registered object
529 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
531 // Return an object that previously had an oldID
532 template<class TInterface>
533 typename TInterface::_var_type GetObjectByOldId( const int oldID )
535 if ( myStudyContext ) {
536 std::string ior = myStudyContext->getIORbyOldId( oldID );
538 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
540 return TInterface::_nil();
544 * \brief Find SObject for an algo
546 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
548 void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters);
549 char* GetParameters(CORBA::Object_ptr theObject);
550 //char* ParseParameters(const char* theParameters);
551 const std::vector< int >& GetLastParamIndices() const { return myLastParamIndex; }
552 const std::vector< std::string >& GetLastParameters() const { return myLastParameters; }
553 const std::string & GetLastObjEntry() const { return myLastObj; }
554 std::vector< std::string > GetAllParameters(const std::string& theObjectEntry) const;
556 // Move objects to the specified position
557 void Move( const SMESH::sobject_list& what,
558 SALOMEDS::SObject_ptr where,
561 CORBA::Boolean IsApplicable ( const char* theAlgoType,
562 const char* theLibName,
563 GEOM::GEOM_Object_ptr theShapeObject,
564 CORBA::Boolean toCheckAll);
566 SMESH::long_array* GetInsideSphere( SMESH::SMESH_IDSource_ptr meshPart,
567 SMESH::ElementType theElemType,
573 SMESH::long_array* GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart,
574 SMESH::ElementType theElemType,
580 CORBA::Double theZ2);
582 SMESH::long_array* GetInsideCylinder( SMESH::SMESH_IDSource_ptr meshPart,
583 SMESH::ElementType theElemType,
591 CORBA::Double theR );
593 SMESH::long_array* GetInside( SMESH::SMESH_IDSource_ptr meshPart,
594 SMESH::ElementType theElemType,
595 GEOM::GEOM_Object_ptr theGeom,
596 CORBA::Double theTolerance );
599 // Get hypothesis creator
600 GenericHypothesisCreator_i* getHypothesisCreator( const char* theHypName,
601 const char* theLibName,
602 std::string& thePlatformLibName)
603 throw ( SALOME::SALOME_Exception );
604 // Create hypothesis of given type
605 SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
606 const char* theLibName);
607 // Create empty mesh on shape
608 SMESH::SMESH_Mesh_ptr createMesh()
609 throw ( SALOME::SALOME_Exception );
611 static void loadGeomData( SALOMEDS::SComponent_ptr theCompRoot );
613 SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
614 SMESH::DriverMED_ReadStatus& theStatus,
615 const char* theCommandNameForPython,
616 const char* theFileNameForPython);
618 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
619 SMESH::ElementType theElemType,
620 TopoDS_Shape& aShape,
621 double* theTolerance = NULL);
624 static GEOM::GEOM_Gen_var myGeomGen;
625 static CORBA::ORB_var myOrb; // ORB reference
626 static PortableServer::POA_var myPoa; // POA reference
627 static SALOME_NamingService* myNS; // Naming Service
628 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
629 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
630 ::SMESH_Gen myGen; // SMESH_Gen local implementation
632 // hypotheses managing
633 std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
635 StudyContext* myStudyContext; // study context
637 GEOM_Client* myShapeReader; // Shape reader
638 CORBA::Boolean myIsEmbeddedMode; // Current mode
639 CORBA::Boolean myIsEnablePublish; // Enable publishing
641 // Default color of groups
642 std::string myDefaultGroupColor;
644 // To load full mesh data from study at hyp modification or not
645 bool myToForgetMeshDataOnHypModif;
647 // Dump Python: trace of API methods calls
648 Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
649 bool myIsHistoricalPythonDump;
650 std::vector< int > myLastParamIndex;
651 std::vector< std::string > myLastParameters;
652 std::string myLastObj;
660 DownCast(CORBA::Object_ptr theArg)
662 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
666 * \brief Function used in SMESH_CATCH to convert a caught exception to
667 * SALOME::SALOME_Exception
669 inline void throwCorbaException(const char* excText)
671 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );