1 // Copyright (C) 2007-2019 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( bool isShaper );
113 static GEOM::GEOM_Gen_var GetGeomEngine( GEOM::GEOM_Object_ptr );
114 // Get object of the CORBA reference
115 static PortableServer::ServantBase_var GetServant( CORBA::Object_ptr theObject );
116 // Get CORBA object corresponding to the SALOMEDS::SObject
117 static CORBA::Object_var SObjectToObject( SALOMEDS::SObject_ptr theSObject );
118 // Get the SALOMEDS::SObject corresponding to a CORBA object
119 static SALOMEDS::SObject_ptr ObjectToSObject(CORBA::Object_ptr theObject);
120 // Get the SALOMEDS::Study from naming service
121 static SALOMEDS::Study_var getStudyServant();
122 // Get GEOM Object corresponding to TopoDS_Shape
123 GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape );
124 // Get TopoDS_Shape corresponding to GEOM_Object
125 TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject);
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 );
136 virtual ~SMESH_Gen_i();
138 // *****************************************
140 // *****************************************
141 // Set a new Mesh object name
142 void SetName(const char* theIOR,
143 const char* theName);
145 //GEOM::GEOM_Gen_ptr SetGeomEngine( const char* containerLoc );
146 void SetGeomEngine( GEOM::GEOM_Gen_ptr geomcompo );
149 void SetEmbeddedMode( CORBA::Boolean theMode );
150 // Check embedded mode
151 CORBA::Boolean IsEmbeddedMode();
153 // Set enable publishing in the study
154 void SetEnablePublish( CORBA::Boolean theIsEnablePublish );
156 // Check enable publishing
157 CORBA::Boolean IsEnablePublish();
162 // Do provide info on objects
163 bool hasObjectInfo();
165 // Return an information for a given object
166 char* getObjectInfo(const char* entry);
168 // Create hypothesis/algorithm of given type
169 SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType,
170 const char* theLibName)
171 throw ( SALOME::SALOME_Exception );
173 SMESH::SMESH_Hypothesis_ptr CreateHypothesisByAverageLength( const char* theHypType,
174 const char* theLibName,
175 CORBA::Double theAverageLength,
176 CORBA::Boolean theQuadDominated)
177 throw ( SALOME::SALOME_Exception );
179 // Return hypothesis of given type holding parameter values of the existing mesh
180 SMESH::SMESH_Hypothesis_ptr
181 GetHypothesisParameterValues (const char* theHypType,
182 const char* theLibName,
183 SMESH::SMESH_Mesh_ptr theMesh,
184 GEOM::GEOM_Object_ptr theGeom,
185 const SMESH::HypInitParams& theWay)
186 throw ( SALOME::SALOME_Exception );
189 * Returns True if a hypothesis is assigned to a sole sub-mesh in a current Study
191 CORBA::Boolean GetSoleSubMeshUsingHyp( SMESH::SMESH_Hypothesis_ptr theHyp,
192 SMESH::SMESH_Mesh_out theMesh,
193 GEOM::GEOM_Object_out theShape);
198 * Sets number of segments per diagonal of boundary box of geometry by which
199 * default segment length of appropriate 1D hypotheses is defined
201 void SetBoundaryBoxSegmentation( CORBA::Long theNbSegments ) throw ( SALOME::SALOME_Exception );
203 * \brief Sets default number of segments per edge
205 void SetDefaultNbSegments(CORBA::Long theNbSegments) throw ( SALOME::SALOME_Exception );
210 virtual void SetOption(const char*, const char*);
212 Return an option value
214 virtual char* GetOption(const char*);
217 * To load full mesh data from study at hyp modification or not
219 bool ToForgetMeshDataOnHypModif() const { return myToForgetMeshDataOnHypModif; }
222 // Create empty mesh on a shape
223 SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
224 throw ( SALOME::SALOME_Exception );
227 SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
228 throw ( SALOME::SALOME_Exception );
230 // Create a mesh and import data from an UNV file
231 SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
232 throw ( SALOME::SALOME_Exception );
234 // Create mesh(es) and import data from MED file
235 SMESH::mesh_array* CreateMeshesFromMED( const char* theFileName,
236 SMESH::DriverMED_ReadStatus& theStatus )
237 throw ( SALOME::SALOME_Exception );
239 // Create mesh(es) and import data from MED file
240 SMESH::mesh_array* CreateMeshesFromSAUV( const char* theFileName,
241 SMESH::DriverMED_ReadStatus& theStatus )
242 throw ( SALOME::SALOME_Exception );
244 // Create a mesh and import data from a STL file
245 SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
246 throw ( SALOME::SALOME_Exception );
248 // Create mesh(es) and import data from CGNS file
249 SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
250 SMESH::DriverMED_ReadStatus& theStatus )
251 throw ( SALOME::SALOME_Exception );
253 // Create a mesh and import data from a GMF file
254 SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
255 CORBA::Boolean theMakeRequiredGroups,
256 SMESH::ComputeError_out theError)
257 throw ( SALOME::SALOME_Exception );
259 // Copy a part of mesh
260 SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
261 const char* meshName,
262 CORBA::Boolean toCopyGroups,
263 CORBA::Boolean toKeepIDs)
264 throw ( SALOME::SALOME_Exception );
266 // Create a mesh by copying definitions of another mesh to a given geometry
267 CORBA::Boolean CopyMeshWithGeom( SMESH::SMESH_Mesh_ptr sourceMesh,
268 GEOM::GEOM_Object_ptr newGeometry,
269 const char* meshName,
270 CORBA::Boolean toCopyGroups,
271 CORBA::Boolean toReuseHypotheses,
272 CORBA::Boolean toCopyElements,
273 SMESH::SMESH_Mesh_out newMesh,
274 SMESH::ListOfGroups_out newGroups,
275 SMESH::submesh_array_out newSubmeshes,
276 SMESH::ListOfHypothesis_out newHypotheses,
277 SMESH::string_array_out invalidEntries)
278 throw ( SALOME::SALOME_Exception );
280 // Compute mesh on a shape
281 CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
282 GEOM::GEOM_Object_ptr theShapeObject )
283 throw ( SALOME::SALOME_Exception );
285 // Cancel Compute mesh on a shape
286 void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
287 GEOM::GEOM_Object_ptr theShapeObject );
290 * \brief Return errors of mesh computation
292 SMESH::compute_error_array* GetComputeErrors(SMESH::SMESH_Mesh_ptr theMesh,
293 GEOM::GEOM_Object_ptr theShapeObject )
294 throw ( SALOME::SALOME_Exception );
297 * Evaluate mesh on a shape and
298 * returns statistic of mesh elements
299 * Result array of number enityties
301 SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
302 GEOM::GEOM_Object_ptr theShapeObject)
303 throw ( SALOME::SALOME_Exception );
305 // Returns true if mesh contains enough data to be computed
306 CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh,
307 GEOM::GEOM_Object_ptr theShapeObject )
308 throw ( SALOME::SALOME_Exception );
311 * Calculate Mesh as preview till indicated dimension on shape
312 * First, verify list of hypothesis associated with the subShape.
313 * Return mesh preview structure
315 SMESH::MeshPreviewStruct* Precompute( SMESH::SMESH_Mesh_ptr theMesh,
316 GEOM::GEOM_Object_ptr theSubObject,
317 SMESH::Dimension theDimension,
318 SMESH::long_array& theShapesId )
319 throw ( SALOME::SALOME_Exception );
321 // Returns errors of hypotheses definition
322 SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh,
323 GEOM::GEOM_Object_ptr theSubObject )
324 throw ( SALOME::SALOME_Exception );
326 // Return mesh elements preventing computation of a subshape
327 SMESH::MeshPreviewStruct* GetBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
328 CORBA::Short theSubShapeID )
329 throw ( SALOME::SALOME_Exception );
331 // Create groups of elements preventing computation of a sub-shape
332 SMESH::ListOfGroups* MakeGroupsOfBadInputElements( SMESH::SMESH_Mesh_ptr theMesh,
333 CORBA::Short theSubShapeID,
334 const char* theGroupName)
335 throw ( SALOME::SALOME_Exception );
337 // Get sub-shapes unique ID's list
338 SMESH::long_array* GetSubShapesId( GEOM::GEOM_Object_ptr theMainShapeObject,
339 const SMESH::object_array& theListOfSubShape )
340 throw ( SALOME::SALOME_Exception );
342 // Return geometrical object the given element is built on. Publish it in study.
343 GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
344 CORBA::Long theElementID,
345 const char* theGeomName)
346 throw ( SALOME::SALOME_Exception );
348 // Return geometrical object the given element is built on. Don't publish it in study.
349 GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
350 CORBA::Long theElementID)
351 throw ( SALOME::SALOME_Exception );
353 // Concatenate the given meshes into one mesh
354 SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray,
355 CORBA::Boolean uniteIdenticalGroups,
356 CORBA::Boolean mergeNodesAndElements,
357 CORBA::Double mergeTolerance,
358 CORBA::Boolean commonGroups,
359 SMESH::SMESH_Mesh_ptr meshToAppendTo)
360 throw ( SALOME::SALOME_Exception );
362 // Concatenate the given meshes into one mesh
363 SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::ListOfIDSources& meshesArray,
364 CORBA::Boolean uniteIdenticalGroups,
365 CORBA::Boolean mergeNodesAndElements,
366 CORBA::Double mergeTolerance,
367 SMESH::SMESH_Mesh_ptr meshToAppendTo)
368 throw ( SALOME::SALOME_Exception );
370 // Concatenate the given meshes into one mesh
371 // Create the groups of all elements from initial meshes
372 SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::ListOfIDSources& meshesArray,
373 CORBA::Boolean uniteIdenticalGroups,
374 CORBA::Boolean mergeNodesAndElements,
375 CORBA::Double mergeTolerance,
376 SMESH::SMESH_Mesh_ptr meshToAppendTo)
377 throw ( SALOME::SALOME_Exception );
379 // Get version of MED format being used.
380 char* GetMEDFileVersion();
382 // Get MED version of the file by its name
383 char* GetMEDVersion(const char* theFileName);
385 // Check compatibility of file with MED format being used, read only.
386 CORBA::Boolean CheckCompatibility(const char* theFileName);
388 // Check compatibility of file with MED format being used, for append on write.
389 CORBA::Boolean CheckWriteCompatibility(const char* theFileName);
391 // Get names of meshes defined in file with the specified name
392 SMESH::string_array* GetMeshNames(const char* theFileName);
394 // ****************************************************
395 // Interface inherited methods (from SALOMEDS::Driver)
396 // ****************************************************
399 SALOMEDS::TMPFile* Save( SALOMEDS::SComponent_ptr theComponent,
403 bool Load( SALOMEDS::SComponent_ptr theComponent,
404 const SALOMEDS::TMPFile& theStream,
407 // Save SMESH data in ASCII format
408 SALOMEDS::TMPFile* SaveASCII( SALOMEDS::SComponent_ptr theComponent,
411 // Load SMESH data in ASCII format
412 bool LoadASCII( SALOMEDS::SComponent_ptr theComponent,
413 const SALOMEDS::TMPFile& theStream,
417 // Create filter manager
418 SMESH::FilterManager_ptr CreateFilterManager();
420 // Return a pattern mesher
421 SMESH::SMESH_Pattern_ptr GetPattern();
423 // Create measurement instance
424 SMESH::Measurements_ptr CreateMeasurements();
426 // Clears study-connected data when it is closed
427 void Close( SALOMEDS::SComponent_ptr theComponent );
429 // Get component data type
430 char* ComponentDataType();
432 // Transform data from transient form to persistent
433 char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject,
434 const char* IORString,
435 CORBA::Boolean isMultiFile,
436 CORBA::Boolean isASCII );
437 // Transform data from persistent form to transient
438 char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr theSObject,
439 const char* aLocalPersistentID,
440 CORBA::Boolean isMultiFile,
441 CORBA::Boolean isASCII );
443 // Returns true if object can be published in the study
444 bool CanPublishInStudy( CORBA::Object_ptr theIOR );
445 // Publish object in the study
446 SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr theSObject,
447 CORBA::Object_ptr theObject,
448 const char* theName )
449 throw ( SALOME::SALOME_Exception );
451 // Copy-paste methods - returns true if object can be copied to the clipboard
452 CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr theObject ) { return false; }
453 // Copy-paste methods - copy object to the clipboard
454 SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID ) { return NULL; }
455 // Copy-paste methods - returns true if object can be pasted from the clipboard
456 CORBA::Boolean CanPaste( const char* theComponentName, CORBA::Long theObjectID ) { return false; }
457 // Copy-paste methods - paste object from the clipboard
458 SALOMEDS::SObject_ptr PasteInto( const SALOMEDS::TMPFile& theStream,
459 CORBA::Long theObjectID,
460 SALOMEDS::SObject_ptr theObject ) {
461 SALOMEDS::SObject_var aResultSO;
462 return aResultSO._retn();
466 // Version information
469 virtual char* getVersion();
475 virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
476 CORBA::Boolean isMultiFile,
477 CORBA::Boolean& isValidScript);
479 void AddToPythonScript (const TCollection_AsciiString& theString);
481 void RemoveLastFromPythonScript();
485 TCollection_AsciiString DumpPython_impl (Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
486 Resource_DataMapOfAsciiStringAsciiString& theNames,
489 bool isHistoricalDump,
491 TCollection_AsciiString& theSavedTrace);
493 TCollection_AsciiString GetNewPythonLines();
495 void CleanPythonTrace();
497 // *****************************************
499 // *****************************************
502 GEOM_Client* GetShapeReader();
505 static long GetHypothesisRootTag();
506 static long GetAlgorithmsRootTag();
507 static long GetRefOnShapeTag();
508 static long GetRefOnAppliedHypothesisTag();
509 static long GetRefOnAppliedAlgorithmsTag();
510 static long GetSubMeshOnVertexTag();
511 static long GetSubMeshOnEdgeTag();
512 static long GetSubMeshOnFaceTag();
513 static long GetSubMeshOnSolidTag();
514 static long GetSubMeshOnCompoundTag();
515 static long GetSubMeshOnWireTag();
516 static long GetSubMeshOnShellTag();
517 static long GetNodeGroupsTag();
518 static long GetEdgeGroupsTag();
519 static long GetFaceGroupsTag();
520 static long GetVolumeGroupsTag();
521 static long Get0DElementsGroupsTag();
522 static long GetBallElementsGroupsTag();
524 // publishing methods
525 SALOMEDS::SComponent_ptr PublishComponent();
526 SALOMEDS::SObject_ptr PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
527 const char* theName = 0);
528 SALOMEDS::SObject_ptr PublishHypothesis (SMESH::SMESH_Hypothesis_ptr theHyp,
529 const char* theName = 0);
530 SALOMEDS::SObject_ptr PublishSubMesh (SMESH::SMESH_Mesh_ptr theMesh,
531 SMESH::SMESH_subMesh_ptr theSubMesh,
532 GEOM::GEOM_Object_ptr theShapeObject,
533 const char* theName = 0);
534 SALOMEDS::SObject_ptr PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
535 SMESH::SMESH_GroupBase_ptr theGroup,
536 GEOM::GEOM_Object_ptr theShapeObject,
537 const char* theName = 0);
538 void UpdateIcons(SMESH::SMESH_Mesh_ptr theMesh);
539 void HighLightInvalid(CORBA::Object_ptr theObject, bool isInvalid);
540 bool IsInvalid(SALOMEDS::SObject_ptr theObject);
541 bool AddHypothesisToShape(SMESH::SMESH_Mesh_ptr theMesh,
542 GEOM::GEOM_Object_ptr theShapeObject,
543 SMESH::SMESH_Hypothesis_ptr theHyp);
544 bool RemoveHypothesisFromShape(SMESH::SMESH_Mesh_ptr theMesh,
545 GEOM::GEOM_Object_ptr theShapeObject,
546 SMESH::SMESH_Hypothesis_ptr theHyp);
547 SALOMEDS::SObject_ptr GetMeshOrSubmeshByShape (SMESH::SMESH_Mesh_ptr theMesh,
548 GEOM::GEOM_Object_ptr theShape);
549 static void SetName(SALOMEDS::SObject_ptr theSObject,
551 const char* theDefaultName = 0);
553 static void SetPixMap(SALOMEDS::SObject_ptr theSObject,
554 const char* thePixMap);
557 StudyContext* GetStudyContext();
559 // Register an object in a StudyContext; return object id
560 int RegisterObject(CORBA::Object_ptr theObject);
562 // Return id of registered object
563 CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
565 // Return an object that previously had an oldID
566 template<class TInterface>
567 typename TInterface::_var_type GetObjectByOldId( const int oldID )
569 if ( myStudyContext ) {
570 std::string ior = myStudyContext->getIORbyOldId( oldID );
572 return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() ));
574 return TInterface::_nil();
578 * \brief Find SObject for an algo
580 SALOMEDS::SObject_ptr GetAlgoSO(const ::SMESH_Algo* algo);
582 void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters);
583 char* GetParameters(CORBA::Object_ptr theObject);
584 //char* ParseParameters(const char* theParameters);
585 const std::vector< int >& GetLastParamIndices() const { return myLastParamIndex; }
586 const std::vector< std::string >& GetLastParameters() const { return myLastParameters; }
587 const std::string & GetLastObjEntry() const { return myLastObj; }
588 std::vector< std::string > GetAllParameters(const std::string& theObjectEntry) const;
590 // Move objects to the specified position
591 void Move( const SMESH::sobject_list& what,
592 SALOMEDS::SObject_ptr where,
595 CORBA::Boolean IsApplicable ( const char* theAlgoType,
596 const char* theLibName,
597 GEOM::GEOM_Object_ptr theShapeObject,
598 CORBA::Boolean toCheckAll);
600 SMESH::long_array* GetInsideSphere( SMESH::SMESH_IDSource_ptr meshPart,
601 SMESH::ElementType theElemType,
607 SMESH::long_array* GetInsideBox( SMESH::SMESH_IDSource_ptr meshPart,
608 SMESH::ElementType theElemType,
614 CORBA::Double theZ2);
616 SMESH::long_array* GetInsideCylinder( SMESH::SMESH_IDSource_ptr meshPart,
617 SMESH::ElementType theElemType,
625 CORBA::Double theR );
627 SMESH::long_array* GetInside( SMESH::SMESH_IDSource_ptr meshPart,
628 SMESH::ElementType theElemType,
629 GEOM::GEOM_Object_ptr theGeom,
630 CORBA::Double theTolerance );
633 // Get hypothesis creator
634 GenericHypothesisCreator_i* getHypothesisCreator( const char* theHypName,
635 const char* theLibName,
636 std::string& thePlatformLibName)
637 throw ( SALOME::SALOME_Exception );
638 // Create hypothesis of given type
639 SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName,
640 const char* theLibName);
641 // Create empty mesh on shape
642 SMESH::SMESH_Mesh_ptr createMesh()
643 throw ( SALOME::SALOME_Exception );
646 bool isGeomModifIcon( SMESH::SMESH_Mesh_ptr mesh );
648 // Create a sub-mesh on a geometry that is not a sub-shape of the main shape
649 // for the case where a valid sub-shape not found by CopyMeshWithGeom()
650 SMESH::SMESH_subMesh_ptr createInvalidSubMesh( SMESH::SMESH_Mesh_ptr mesh,
651 GEOM::GEOM_Object_ptr strangerGeom,
654 void highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid );
656 SMESH::mesh_array* CreateMeshesFromMEDorSAUV( const char* theFileName,
657 SMESH::DriverMED_ReadStatus& theStatus,
658 const char* theCommandNameForPython,
659 const char* theFileNameForPython);
661 std::vector<long> _GetInside(SMESH::SMESH_IDSource_ptr meshPart,
662 SMESH::ElementType theElemType,
663 TopoDS_Shape& aShape,
664 double* theTolerance = NULL);
667 static GEOM::GEOM_Gen_var myGeomGen;
668 static CORBA::ORB_var myOrb; // ORB reference
669 static PortableServer::POA_var myPoa; // POA reference
670 static SALOME_NamingService* myNS; // Naming Service
671 static SALOME_LifeCycleCORBA* myLCC; // Life Cycle CORBA
672 static SMESH_Gen_i* mySMESHGen; // Point to last created instance of the class
673 ::SMESH_Gen myGen; // SMESH_Gen local implementation
675 // hypotheses managing
676 std::map<std::string, GenericHypothesisCreator_i*> myHypCreatorMap;
678 StudyContext* myStudyContext; // study context
680 GEOM_Client* myShapeReader; // Shape reader
681 CORBA::Boolean myIsEmbeddedMode; // Current mode
682 CORBA::Boolean myIsEnablePublish; // Enable publishing
684 // Default color of groups
685 std::string myDefaultGroupColor;
687 // To load full mesh data from study at hyp modification or not
688 bool myToForgetMeshDataOnHypModif;
690 // Dump Python: trace of API methods calls
691 Handle(TColStd_HSequenceOfAsciiString) myPythonScript;
692 bool myIsHistoricalPythonDump;
693 std::vector< int > myLastParamIndex;
694 std::vector< std::string > myLastParameters;
695 std::string myLastObj;
703 DownCast(CORBA::Object_ptr theArg)
705 return dynamic_cast<T>(SMESH_Gen_i::GetServant(theArg).in());
709 * \brief Function used in SMESH_CATCH to convert a caught exception to
710 * SALOME::SALOME_Exception
712 inline void throwCorbaException(const char* excText)
714 THROW_SALOME_CORBA_EXCEPTION( excText, SALOME::INTERNAL_ERROR );