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.
352 CORBA::Boolean CheckCompatibility(const char* theFileName);
354 // Get names of meshes defined in file with the specified name
355 SMESH::string_array* GetMeshNames(const char* theFileName);
357 // ****************************************************
358 // Interface inherited methods (from SALOMEDS::Driver)
359 // ****************************************************
362 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
366 bool Load( SALOMEDS::SComponent_ptr theComponent,
367 const SALOMEDS::TMPFile& theStream,
370 // Save SMESH data in ASCII format
371 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
374 // Load SMESH data in ASCII format
375 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
376 const SALOMEDS::TMPFile& theStream,
380 // Create filter manager
381 SMESH::FilterManager_ptr CreateFilterManager();
383 // Return a pattern mesher
384 SMESH::SMESH_Pattern_ptr GetPattern();
386 // Create measurement instance
387 SMESH::Measurements_ptr CreateMeasurements();
389 // Clears study-connected data when it is closed
390 void Close( SALOMEDS::SComponent_ptr theComponent );
392 // Get component data type
393 char* ComponentDataType();
395 // Transform data from transient form to persistent
396 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
397 const char* IORString,
398 CORBA::Boolean isMultiFile,
399 CORBA::Boolean isASCII );
400 // Transform data from persistent form to transient
401 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
402 const char* aLocalPersistentID,
403 CORBA::Boolean isMultiFile,
404 CORBA::Boolean isASCII );
406 // Returns true if object can be published in the study
407 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
408 // Publish object in the study
409 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
410 CORBA::Object_ptr theObject,
411 const char* theName )
412 throw ( SALOME::SALOME_Exception );
414 // Copy-paste methods - returns true if object can be copied to the clipboard
415 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr theObject ) { return false; }
416 // Copy-paste methods - copy object to the clipboard
417 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID ) { return NULL; }
418 // Copy-paste methods - returns true if object can be pasted from the clipboard
419 CORBA::Boolean CanPaste( const char* theComponentName, CORBA::Long theObjectID ) { return false; }
420 // Copy-paste methods - paste object from the clipboard
421 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& theStream,
422 CORBA::Long theObjectID,
423 SALOMEDS::SObject_ptr theObject ) {
424 SALOMEDS::SObject_var aResultSO;
425 return aResultSO._retn();
429 // Version information
432 virtual char* getVersion();
438 virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
439 CORBA::Boolean isMultiFile,
440 CORBA::Boolean& isValidScript);
442 void AddToPythonScript (const TCollection_AsciiString& theString);
444 void RemoveLastFromPythonScript();
448 TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
449 Resource_DataMapOfAsciiStringAsciiString& theNames,
452 bool isHistoricalDump,
454 TCollection_AsciiString& theSavedTrace);
456 TCollection_AsciiString GetNewPythonLines();
458 void CleanPythonTrace();
460 // *****************************************
462 // *****************************************
465 GEOM_Client* GetShapeReader();
468 static long GetHypothesisRootTag();
469 static long GetAlgorithmsRootTag();
470 static long GetRefOnShapeTag();
471 static long GetRefOnAppliedHypothesisTag();
472 static long GetRefOnAppliedAlgorithmsTag();
473 static long GetSubMeshOnVertexTag();
474 static long GetSubMeshOnEdgeTag();
475 static long GetSubMeshOnFaceTag();
476 static long GetSubMeshOnSolidTag();
477 static long GetSubMeshOnCompoundTag();
478 static long GetSubMeshOnWireTag();
479 static long GetSubMeshOnShellTag();
480 static long GetNodeGroupsTag();
481 static long GetEdgeGroupsTag();
482 static long GetFaceGroupsTag();
483 static long GetVolumeGroupsTag();
484 static long Get0DElementsGroupsTag();
485 static long GetBallElementsGroupsTag();
487 // publishing methods
488 SALOMEDS::SComponent_ptr PublishComponent();
489 SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
490 const char* theName = 0);
491 SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
492 const char* theName = 0);
493 SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
494 SMESH::SMESH_subMesh_ptr theSubMesh,
495 GEOM::GEOM_Object_ptr theShapeObject,
496 const char* theName = 0);
497 SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
498 SMESH::SMESH_GroupBase_ptr theGroup,
499 GEOM::GEOM_Object_ptr theShapeObject,
500 const char* theName = 0);
501 void UpdateIcons(SMESH::SMESH_Mesh_ptr theMesh);
502 bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
503 GEOM::GEOM_Object_ptr theShapeObject,
504 SMESH::SMESH_Hypothesis_ptr theHyp);
505 bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
506 GEOM::GEOM_Object_ptr theShapeObject,
507 SMESH::SMESH_Hypothesis_ptr theHyp);
508 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
509 GEOM::GEOM_Object_ptr theShape);
510 static void SetName(SALOMEDS::SObject_ptr theSObject,
512 const char* theDefaultName = 0);
514 static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
515 const char* thePixMap);
518 StudyContext* GetStudyContext();
520 // Register an object in a StudyContext; return object id
521 int RegisterObject(CORBA::Object_ptr theObject);
523 // Return id of registered object
524 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
526 // Return an object that previously had an oldID
527 template<class TInterface>
528 typename TInterface::_var_type GetObjectByOldId( const int oldID )
530 if ( myStudyContext ) {
531 std::string ior = myStudyContext->getIORbyOldId( oldID );
533 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
535 return TInterface::_nil();
539 * \brief Find SObject for an algo
541 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
543 void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters);
544 char* GetParameters(CORBA::Object_ptr theObject);
545 //char* ParseParameters(const char* theParameters);
546 const std::vector< int >& GetLastParamIndices() const { return myLastParamIndex; }
547 const std::vector< std::string >& GetLastParameters() const { return myLastParameters; }
548 const std::string & GetLastObjEntry() const { return myLastObj; }
549 std::vector< std::string > GetAllParameters(const std::string& theObjectEntry) const;
551 // Move objects to the specified position
552 void Move( const SMESH::sobject_list& what,
553 SALOMEDS::SObject_ptr where,
556 CORBA::Boolean IsApplicable ( const char* theAlgoType,
557 const char* theLibName,
558 GEOM::GEOM_Object_ptr theShapeObject,
559 CORBA::Boolean toCheckAll);
561 SMESH::long_array* GetInsideSphere( SMESH::SMESH_IDSource_ptr meshPart,
562 SMESH::ElementType theElemType,
568 SMESH::long_array* GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart,
569 SMESH::ElementType theElemType,
575 CORBA::Double theZ2);
577 SMESH::long_array* GetInsideCylinder( SMESH::SMESH_IDSource_ptr meshPart,
578 SMESH::ElementType theElemType,
586 CORBA::Double theR );
588 SMESH::long_array* GetInside( SMESH::SMESH_IDSource_ptr meshPart,
589 SMESH::ElementType theElemType,
590 GEOM::GEOM_Object_ptr theGeom,
591 CORBA::Double theTolerance );
594 // Get hypothesis creator
595 GenericHypothesisCreator_i* getHypothesisCreator( const char* theHypName,
596 const char* theLibName,
597 std::string& thePlatformLibName)
598 throw ( SALOME::SALOME_Exception );
599 // Create hypothesis of given type
600 SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
601 const char* theLibName);
602 // Create empty mesh on shape
603 SMESH::SMESH_Mesh_ptr createMesh()
604 throw ( SALOME::SALOME_Exception );
606 static void loadGeomData( SALOMEDS::SComponent_ptr theCompRoot );
608 SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
609 SMESH::DriverMED_ReadStatus& theStatus,
610 const char* theCommandNameForPython,
611 const char* theFileNameForPython);
613 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
614 SMESH::ElementType theElemType,
615 TopoDS_Shape& aShape,
616 double* theTolerance = NULL);
619 static GEOM::GEOM_Gen_var myGeomGen;
620 static CORBA::ORB_var myOrb; // ORB reference
621 static PortableServer::POA_var myPoa; // POA reference
622 static SALOME_NamingService* myNS; // Naming Service
623 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
624 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
625 ::SMESH_Gen myGen; // SMESH_Gen local implementation
627 // hypotheses managing
628 std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
630 StudyContext* myStudyContext; // study context
632 GEOM_Client* myShapeReader; // Shape reader
633 CORBA::Boolean myIsEmbeddedMode; // Current mode
634 CORBA::Boolean myIsEnablePublish; // Enable publishing
636 // Default color of groups
637 std::string myDefaultGroupColor;
639 // To load full mesh data from study at hyp modification or not
640 bool myToForgetMeshDataOnHypModif;
642 // Dump Python: trace of API methods calls
643 Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
644 bool myIsHistoricalPythonDump;
645 std::vector< int > myLastParamIndex;
646 std::vector< std::string > myLastParameters;
647 std::string myLastObj;
655 DownCast(CORBA::Object_ptr theArg)
657 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
661 * \brief Function used in SMESH_CATCH to convert a caught exception to
662 * SALOME::SALOME_Exception
664 inline void throwCorbaException(const char* excText)
666 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );