1 // Copyright (C) 2007-2020 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 : public POA_SMESH::SMESH_Gen, public 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( bool isShaper );
111 static GEOM::GEOM_Gen_var GetGeomEngine( GEOM::GEOM_Object_ptr );
112 // Get object of the CORBA reference
113 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
114 // Get CORBA object corresponding to the SALOMEDS::SObject
115 static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
116 // Get the SALOMEDS::SObject corresponding to a CORBA object
117 static SALOMEDS::SObject_ptr ObjectToSObject( CORBA::Object_ptr theObject );
118 // Get the SALOMEDS::Study from naming service
119 static SALOMEDS::Study_var getStudyServant();
120 // Get GEOM Object corresponding to TopoDS_Shape
121 static GEOM::GEOM_Object_ptr ShapeToGeomObject( const TopoDS_Shape& theShape );
122 // Get TopoDS_Shape corresponding to GEOM_Object
123 static TopoDS_Shape GeomObjectToShape( GEOM::GEOM_Object_ptr theGeomObject );
124 // Get GEOM Object by its study entry
125 static GEOM::GEOM_Object_ptr GetGeomObjectByEntry( const std::string& entry );
127 // Default constructor
129 // Standard constructor
130 SMESH_Gen_i( CORBA::ORB_ptr orb,
131 PortableServer::POA_ptr poa,
132 PortableServer::ObjectId* contId,
133 const char* instanceName,
134 const char* interfaceName,
135 bool checkNS = true);
137 virtual ~SMESH_Gen_i();
139 // *****************************************
141 // *****************************************
142 // Set a new Mesh object name
143 void SetName(const char* theIOR,
144 const char* theName);
146 //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
147 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
150 void SetEmbeddedMode( CORBA::Boolean theMode );
151 // Check embedded mode
152 CORBA::Boolean IsEmbeddedMode();
154 // Set enable publishing in the study
155 void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
157 // Check enable publishing
158 CORBA::Boolean IsEnablePublish();
163 // Do provide info on objects
164 bool hasObjectInfo();
166 // Return an information for a given object
167 char* getObjectInfo(const char* entry);
169 // Create hypothesis/algorithm of given type
170 SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
171 const char* theLibName);
173 SMESH::SMESH_Hypothesis_ptr CreateHypothesisByAverageLength( const char* theHypType,
174 const char* theLibName,
175 CORBA::Double theAverageLength,
176 CORBA::Boolean theQuadDominated);
178 // Return hypothesis of given type holding parameter values of the existing mesh
179 SMESH::SMESH_Hypothesis_ptr
180 GetHypothesisParameterValues (const char* theHypType,
181 const char* theLibName,
182 SMESH::SMESH_Mesh_ptr theMesh,
183 GEOM::GEOM_Object_ptr theGeom,
184 const SMESH::HypInitParams& theWay);
187 * Returns True if a hypothesis is assigned to a sole sub-mesh in a current Study
189 CORBA::Boolean GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr theHyp,
190 SMESH::SMESH_Mesh_out theMesh,
191 GEOM::GEOM_Object_out theShape);
196 * Sets number of segments per diagonal of boundary box of geometry by which
197 * default segment length of appropriate 1D hypotheses is defined
199 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments );
201 * \brief Sets default number of segments per edge
203 void SetDefaultNbSegments(CORBA::Long theNbSegments);
208 virtual void SetOption(const char*, const char*);
210 Return an option value
212 virtual char* GetOption(const char*);
215 * To load full mesh data from study at hyp modification or not
217 bool ToForgetMeshDataOnHypModif() const { return myToForgetMeshDataOnHypModif; }
220 // Create empty mesh on a shape
221 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject );
224 SMESH::SMESH_Mesh_ptr CreateEmptyMesh();
226 // Create a mesh and import data from an UNV file
227 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName );
229 // Create mesh(es) and import data from MED file
230 SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
231 SMESH::DriverMED_ReadStatus& theStatus );
233 // Create mesh(es) and import data from MED file
234 SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
235 SMESH::DriverMED_ReadStatus& theStatus );
237 // Create a mesh and import data from a STL file
238 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName );
240 // Create mesh(es) and import data from CGNS file
241 SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
242 SMESH::DriverMED_ReadStatus& theStatus );
244 // Create a mesh and import data from a GMF file
245 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
246 CORBA::Boolean theMakeRequiredGroups,
247 SMESH::ComputeError_out theError);
249 // Copy a part of mesh
250 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
251 const char* meshName,
252 CORBA::Boolean toCopyGroups,
253 CORBA::Boolean toKeepIDs);
255 // Create a mesh by copying definitions of another mesh to a given geometry
256 CORBA::Boolean CopyMeshWithGeom( SMESH::SMESH_Mesh_ptr sourceMesh,
257 GEOM::GEOM_Object_ptr newGeometry,
258 const char* meshName,
259 CORBA::Boolean toCopyGroups,
260 CORBA::Boolean toReuseHypotheses,
261 CORBA::Boolean toCopyElements,
262 SMESH::SMESH_Mesh_out newMesh,
263 SMESH::ListOfGroups_out newGroups,
264 SMESH::submesh_array_out newSubmeshes,
265 SMESH::ListOfHypothesis_out newHypotheses,
266 SMESH::string_array_out invalidEntries);
268 // Compute mesh on a shape
269 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
270 GEOM::GEOM_Object_ptr theShapeObject );
272 // Cancel Compute mesh on a shape
273 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
274 GEOM::GEOM_Object_ptr theShapeObject );
277 * \brief Return errors of mesh computation
279 SMESH::compute_error_array* GetComputeErrors(SMESH::SMESH_Mesh_ptr theMesh,
280 GEOM::GEOM_Object_ptr theShapeObject );
283 * Evaluate mesh on a shape and
284 * returns statistic of mesh elements
285 * Result array of number enityties
287 SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
288 GEOM::GEOM_Object_ptr theShapeObject);
290 // Returns true if mesh contains enough data to be computed
291 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
292 GEOM::GEOM_Object_ptr theShapeObject );
295 * Calculate Mesh as preview till indicated dimension on shape
296 * First, verify list of hypothesis associated with the subShape.
297 * Return mesh preview structure
299 SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
300 GEOM::GEOM_Object_ptr theSubObject,
301 SMESH::Dimension theDimension,
302 SMESH::long_array& theShapesId );
304 // Returns errors of hypotheses definition
305 SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh,
306 GEOM::GEOM_Object_ptr theSubObject );
308 // Return mesh elements preventing computation of a subshape
309 SMESH::MeshPreviewStruct* GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
310 CORBA::Short theSubShapeID );
312 // Create groups of elements preventing computation of a sub-shape
313 SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
314 CORBA::Short theSubShapeID,
315 const char* theGroupName);
317 // Get sub-shapes unique ID's list
318 SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
319 const SMESH::object_array& theListOfSubShape );
321 // Return geometrical object the given element is built on. Publish it in study.
322 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
323 CORBA::Long theElementID,
324 const char* theGeomName);
326 // Return geometrical object the given element is built on. Don't publish it in study.
327 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
328 CORBA::Long theElementID);
330 // Concatenate the given meshes into one mesh
331 SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray,
332 CORBA::Boolean uniteIdenticalGroups,
333 CORBA::Boolean mergeNodesAndElements,
334 CORBA::Double mergeTolerance,
335 CORBA::Boolean commonGroups,
336 SMESH::SMESH_Mesh_ptr meshToAppendTo);
338 // Concatenate the given meshes into one mesh
339 SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::ListOfIDSources& meshesArray,
340 CORBA::Boolean uniteIdenticalGroups,
341 CORBA::Boolean mergeNodesAndElements,
342 CORBA::Double mergeTolerance,
343 SMESH::SMESH_Mesh_ptr meshToAppendTo);
345 // Concatenate the given meshes into one mesh
346 // Create the groups of all elements from initial meshes
347 SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::ListOfIDSources& meshesArray,
348 CORBA::Boolean uniteIdenticalGroups,
349 CORBA::Boolean mergeNodesAndElements,
350 CORBA::Double mergeTolerance,
351 SMESH::SMESH_Mesh_ptr meshToAppendTo);
353 // Get version of MED format being used.
354 char* GetMEDFileVersion();
356 // Get MED version of the file by its name
357 char* GetMEDVersion(const char* theFileName);
359 // Check compatibility of file with MED format being used, read only.
360 CORBA::Boolean CheckCompatibility(const char* theFileName);
362 // Check compatibility of file with MED format being used, for append on write.
363 CORBA::Boolean CheckWriteCompatibility(const char* theFileName);
365 // Get names of meshes defined in file with the specified name
366 SMESH::string_array* GetMeshNames(const char* theFileName);
368 // ****************************************************
369 // Interface inherited methods (from SALOMEDS::Driver)
370 // ****************************************************
373 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
377 bool Load( SALOMEDS::SComponent_ptr theComponent,
378 const SALOMEDS::TMPFile& theStream,
381 // Save SMESH data in ASCII format
382 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
385 // Load SMESH data in ASCII format
386 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
387 const SALOMEDS::TMPFile& theStream,
391 // Create filter manager
392 SMESH::FilterManager_ptr CreateFilterManager();
394 // Return a pattern mesher
395 SMESH::SMESH_Pattern_ptr GetPattern();
397 // Create measurement instance
398 SMESH::Measurements_ptr CreateMeasurements();
400 // Clears study-connected data when it is closed
401 void Close( SALOMEDS::SComponent_ptr theComponent );
403 // Get component data type
404 char* ComponentDataType();
406 // Transform data from transient form to persistent
407 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
408 const char* IORString,
409 CORBA::Boolean isMultiFile,
410 CORBA::Boolean isASCII );
411 // Transform data from persistent form to transient
412 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
413 const char* aLocalPersistentID,
414 CORBA::Boolean isMultiFile,
415 CORBA::Boolean isASCII );
417 // Returns true if object can be published in the study
418 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
419 // Publish object in the study
420 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
421 CORBA::Object_ptr theObject,
422 const char* theName );
424 // Copy-paste methods - returns true if object can be copied to the clipboard
425 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr /*theObject*/ ) { return false; }
426 // Copy-paste methods - copy object to the clipboard
427 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr /*theObject*/, CORBA::Long& /*theObjectID*/ ) { return NULL; }
428 // Copy-paste methods - returns true if object can be pasted from the clipboard
429 CORBA::Boolean CanPaste( const char* /*theComponentName*/, CORBA::Long /*theObjectID*/ ) { return false; }
430 // Copy-paste methods - paste object from the clipboard
431 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& /*theStream*/,
432 CORBA::Long /*theObjectID*/,
433 SALOMEDS::SObject_ptr /*theObject*/ ) {
434 SALOMEDS::SObject_var aResultSO;
435 return aResultSO._retn();
439 // Version information
442 virtual char* getVersion();
448 virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
449 CORBA::Boolean isMultiFile,
450 CORBA::Boolean& isValidScript);
452 void AddToPythonScript (const TCollection_AsciiString& theString);
454 void RemoveLastFromPythonScript();
458 TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
459 Resource_DataMapOfAsciiStringAsciiString& theNames,
462 bool isHistoricalDump,
464 TCollection_AsciiString& theSavedTrace);
466 TCollection_AsciiString GetNewPythonLines();
468 void CleanPythonTrace();
470 static int CountInPyDump(const TCollection_AsciiString& text);
472 // *****************************************
474 // *****************************************
477 GEOM_Client* GetShapeReader();
480 static long GetHypothesisRootTag();
481 static long GetAlgorithmsRootTag();
482 static long GetRefOnShapeTag();
483 static long GetRefOnAppliedHypothesisTag();
484 static long GetRefOnAppliedAlgorithmsTag();
485 static long GetSubMeshOnVertexTag();
486 static long GetSubMeshOnEdgeTag();
487 static long GetSubMeshOnFaceTag();
488 static long GetSubMeshOnSolidTag();
489 static long GetSubMeshOnCompoundTag();
490 static long GetSubMeshOnWireTag();
491 static long GetSubMeshOnShellTag();
492 static long GetNodeGroupsTag();
493 static long GetEdgeGroupsTag();
494 static long GetFaceGroupsTag();
495 static long GetVolumeGroupsTag();
496 static long Get0DElementsGroupsTag();
497 static long GetBallElementsGroupsTag();
499 // publishing methods
500 SALOMEDS::SComponent_ptr PublishComponent();
501 SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
502 const char* theName = 0);
503 SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
504 const char* theName = 0);
505 SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
506 SMESH::SMESH_subMesh_ptr theSubMesh,
507 GEOM::GEOM_Object_ptr theShapeObject,
508 const char* theName = 0);
509 SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
510 SMESH::SMESH_GroupBase_ptr theGroup,
511 GEOM::GEOM_Object_ptr theShapeObject,
512 const char* theName = 0);
513 void UpdateIcons(SMESH::SMESH_Mesh_ptr theMesh);
514 void HighLightInvalid(CORBA::Object_ptr theObject, bool isInvalid);
515 bool IsInvalid(SALOMEDS::SObject_ptr theObject);
516 bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
517 GEOM::GEOM_Object_ptr theShapeObject,
518 SMESH::SMESH_Hypothesis_ptr theHyp);
519 bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
520 GEOM::GEOM_Object_ptr theShapeObject,
521 SMESH::SMESH_Hypothesis_ptr theHyp);
522 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
523 GEOM::GEOM_Object_ptr theShape);
524 static void SetName(SALOMEDS::SObject_ptr theSObject,
526 const char* theDefaultName = 0);
528 static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
529 const char* thePixMap);
532 StudyContext* GetStudyContext();
534 // Register an object in a StudyContext; return object id
535 int RegisterObject(CORBA::Object_ptr theObject);
537 // Return id of registered object
538 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
540 // Return an object that previously had an oldID
541 template<class TInterface>
542 typename TInterface::_var_type GetObjectByOldId( const int oldID )
544 if ( myStudyContext ) {
545 std::string ior = myStudyContext->getIORbyOldId( oldID );
547 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
549 return TInterface::_nil();
553 * \brief Find SObject for an algo
555 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
557 void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters);
558 char* GetParameters(CORBA::Object_ptr theObject);
559 //char* ParseParameters(const char* theParameters);
560 const std::vector< int >& GetLastParamIndices() const { return myLastParamIndex; }
561 const std::vector< std::string >& GetLastParameters() const { return myLastParameters; }
562 const std::string & GetLastObjEntry() const { return myLastObj; }
563 std::vector< std::string > GetAllParameters(const std::string& theObjectEntry) const;
565 // Move objects to the specified position
566 void Move( const SMESH::sobject_list& what,
567 SALOMEDS::SObject_ptr where,
570 CORBA::Boolean IsApplicable ( const char* theAlgoType,
571 const char* theLibName,
572 GEOM::GEOM_Object_ptr theShapeObject,
573 CORBA::Boolean toCheckAll);
575 SMESH::long_array* GetInsideSphere( SMESH::SMESH_IDSource_ptr meshPart,
576 SMESH::ElementType theElemType,
582 SMESH::long_array* GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart,
583 SMESH::ElementType theElemType,
589 CORBA::Double theZ2);
591 SMESH::long_array* GetInsideCylinder( SMESH::SMESH_IDSource_ptr meshPart,
592 SMESH::ElementType theElemType,
600 CORBA::Double theR );
602 SMESH::long_array* GetInside( SMESH::SMESH_IDSource_ptr meshPart,
603 SMESH::ElementType theElemType,
604 GEOM::GEOM_Object_ptr theGeom,
605 CORBA::Double theTolerance );
608 // Get hypothesis creator
609 GenericHypothesisCreator_i* getHypothesisCreator( const char* theHypName,
610 const char* theLibName,
611 std::string& thePlatformLibName);
612 // Create hypothesis of given type
613 SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
614 const char* theLibName);
615 // Create empty mesh on shape
616 SMESH::SMESH_Mesh_ptr createMesh();
619 bool isGeomModifIcon( SMESH::SMESH_Mesh_ptr mesh );
621 // Create a sub-mesh on a geometry that is not a sub-shape of the main shape
622 // for the case where a valid sub-shape not found by CopyMeshWithGeom()
623 SMESH::SMESH_subMesh_ptr createInvalidSubMesh( SMESH::SMESH_Mesh_ptr mesh,
624 GEOM::GEOM_Object_ptr strangerGeom,
627 void highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid );
629 SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
630 SMESH::DriverMED_ReadStatus& theStatus,
631 const char* theCommandNameForPython,
632 const char* theFileNameForPython);
634 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
635 SMESH::ElementType ElemType,
636 const TopoDS_Shape& Shape,
637 double* Tolerance = NULL);
640 static GEOM::GEOM_Gen_var myGeomGen;
641 static CORBA::ORB_var myOrb; // ORB reference
642 static PortableServer::POA_var myPoa; // POA reference
643 static SALOME_NamingService* myNS; // Naming Service
644 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
645 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
646 ::SMESH_Gen myGen; // SMESH_Gen local implementation
648 // hypotheses managing
649 std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
651 StudyContext* myStudyContext; // study context
653 GEOM_Client* myShapeReader; // Shape reader
654 CORBA::Boolean myIsEmbeddedMode; // Current mode
655 CORBA::Boolean myIsEnablePublish; // Enable publishing
657 // Default color of groups
658 std::string myDefaultGroupColor;
660 // To load full mesh data from study at hyp modification or not
661 bool myToForgetMeshDataOnHypModif;
663 // Dump Python: trace of API methods calls
664 Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
665 bool myIsHistoricalPythonDump;
666 std::vector< int > myLastParamIndex;
667 std::vector< std::string > myLastParameters;
668 std::string myLastObj;
676 DownCast(CORBA::Object_ptr theArg)
678 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
682 * \brief Function used in SMESH_CATCH to convert a caught exception to
683 * SALOME::SALOME_Exception
685 inline void throwCorbaException(const char* excText)
687 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );