X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.hxx;h=1087dc02368690e409fe8c594afce12cfdda37bb;hb=5958bdcce798556f2ef6866cb0066b0351f9b053;hp=89cf79ca77690e5fc39133f8387eebee1f3a491e;hpb=9357f5c87098aff2b95b754d69f66c76d2df9c24;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 89cf79ca7..1087dc023 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -1,30 +1,28 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - -// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses // File : SMESH_Gen_i.hxx // Author : Paul RASCLE, EDF // Module : SMESH -// + #ifndef _SMESH_GEN_I_HXX_ #define _SMESH_GEN_I_HXX_ @@ -65,8 +63,8 @@ public: // constructor StudyContext() {} // destructor - ~StudyContext() - { + ~StudyContext() + { mapIdToIOR.clear(); mapIdToId.clear(); } @@ -114,7 +112,7 @@ public: } return 0; } - + private: // get next free object identifier int getNextId() @@ -134,7 +132,7 @@ private: // ========================================================== class SMESH_I_EXPORT SMESH_Gen_i: public virtual POA_SMESH::SMESH_Gen, - public virtual Engines_Component_i + public virtual Engines_Component_i { public: // Get last created instance of the class @@ -160,14 +158,14 @@ public: GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape ); // Get TopoDS_Shape correspoding to GEOM_Object TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject); - + // Default constructor SMESH_Gen_i(); // Standard constructor SMESH_Gen_i( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, - PortableServer::ObjectId* contId, - const char* instanceName, + PortableServer::ObjectId* contId, + const char* instanceName, const char* interfaceName ); // Destructor virtual ~SMESH_Gen_i(); @@ -196,7 +194,7 @@ public: SMESH::SMESH_Hypothesis_ptr CreateHypothesis (const char* theHypType, const char* theLibName) throw ( SALOME::SALOME_Exception ); - + // Return hypothesis of given type holding parameter values of the existing mesh SMESH::SMESH_Hypothesis_ptr GetHypothesisParameterValues (const char* theHypType, const char* theLibName, @@ -204,7 +202,7 @@ public: GEOM::GEOM_Object_ptr theGeom, CORBA::Boolean byMesh) throw ( SALOME::SALOME_Exception ); - + /*! * Sets number of segments per diagonal of boundary box of geometry by which * default segment length of appropriate 1D hypotheses is defined @@ -223,7 +221,7 @@ public: SMESH::SMESH_Mesh_ptr CreateEmptyMesh() throw ( SALOME::SALOME_Exception ); - // Create mesh(es) and import data from UNV file + // Create mesh(es) and import data from UNV fileter SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName ) throw ( SALOME::SALOME_Exception ); @@ -236,10 +234,21 @@ public: SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName ) throw ( SALOME::SALOME_Exception ); + // Copy a part of mesh + SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, + const char* meshName, + CORBA::Boolean toCopyGroups, + CORBA::Boolean toKeepIDs); + // Compute mesh on a shape CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShapeObject ) throw ( SALOME::SALOME_Exception ); + + // Cancel Compute mesh on a shape + void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh, + GEOM::GEOM_Object_ptr theShapeObject ); + /*! * \brief Return errors of mesh computation */ @@ -260,7 +269,7 @@ public: CORBA::Boolean IsReadyToCompute( SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShapeObject ) throw ( SALOME::SALOME_Exception ); - + /*! * Calculate Mesh as preview till indicated dimension on shape * First, verify list of hypothesis associated with the subShape. @@ -273,7 +282,7 @@ public: throw ( SALOME::SALOME_Exception ); // Returns errors of hypotheses definintion - SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh, + SMESH::algo_error_array* GetAlgoState( SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theSubObject ) throw ( SALOME::SALOME_Exception ); @@ -299,25 +308,25 @@ public: throw ( SALOME::SALOME_Exception ); // Concatenate the given meshes into one mesh - SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::mesh_array& theMeshesArray, - CORBA::Boolean theUniteIdenticalGroups, - CORBA::Boolean theMergeNodesAndElements, + SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::mesh_array& theMeshesArray, + CORBA::Boolean theUniteIdenticalGroups, + CORBA::Boolean theMergeNodesAndElements, CORBA::Double theMergeTolerance, CORBA::Boolean theCommonGroups) throw ( SALOME::SALOME_Exception ); // Concatenate the given meshes into one mesh - SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::mesh_array& theMeshesArray, - CORBA::Boolean theUniteIdenticalGroups, - CORBA::Boolean theMergeNodesAndElements, + SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::mesh_array& theMeshesArray, + CORBA::Boolean theUniteIdenticalGroups, + CORBA::Boolean theMergeNodesAndElements, CORBA::Double theMergeTolerance) throw ( SALOME::SALOME_Exception ); // Concatenate the given meshes into one mesh // Create the groups of all elements from initial meshes - SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray, - CORBA::Boolean theUniteIdenticalGroups, - CORBA::Boolean theMergeNodesAndElements, + SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray, + CORBA::Boolean theUniteIdenticalGroups, + CORBA::Boolean theMergeNodesAndElements, CORBA::Double theMergeTolerance) throw ( SALOME::SALOME_Exception ); @@ -357,12 +366,15 @@ public: // Return a pattern mesher SMESH::SMESH_Pattern_ptr GetPattern(); + // Create measurement instance + SMESH::Measurements_ptr CreateMeasurements(); + // Clears study-connected data when it is closed void Close( SALOMEDS::SComponent_ptr theComponent ); - + // Get component data type char* ComponentDataType(); - + // Transform data from transient form to persistent char* IORToLocalPersistentID( SALOMEDS::SObject_ptr theSObject, const char* IORString, @@ -380,7 +392,7 @@ public: SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject, CORBA::Object_ptr theObject, - const char* theName ) + const char* theName ) throw ( SALOME::SALOME_Exception ); // Copy-paste methods - returns true if object can be copied to the clipboard @@ -401,8 +413,9 @@ public: // Dump python // ============ - virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, + virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, + CORBA::Boolean isPublished, + CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript); void AddToPythonScript (int theStudyID, const TCollection_AsciiString& theString); @@ -411,10 +424,11 @@ public: void SavePython (SALOMEDS::Study_ptr theStudy); - TCollection_AsciiString DumpPython_impl (SALOMEDS::Study_ptr theStudy, + TCollection_AsciiString DumpPython_impl (SALOMEDS::Study_ptr theStudy, Resource_DataMapOfAsciiStringAsciiString& theObjectNames, Resource_DataMapOfAsciiStringAsciiString& theNames, - bool isPublished, + bool isPublished, + bool isMultiFile, bool& aValidScript, const TCollection_AsciiString& theSavedTrace); @@ -430,7 +444,7 @@ public: // Get shape reader GEOM_Client* GetShapeReader(); - // Tags definition + // Tags definition static long GetHypothesisRootTag(); static long GetAlgorithmsRootTag(); static long GetRefOnShapeTag(); @@ -447,6 +461,7 @@ public: static long GetEdgeGroupsTag(); static long GetFaceGroupsTag(); static long GetVolumeGroupsTag(); + static long Get0DElementsGroupsTag(); // publishing methods SALOMEDS::SComponent_ptr PublishComponent(SALOMEDS::Study_ptr theStudy); @@ -494,7 +509,7 @@ public: CORBA::Long GetObjectId(CORBA::Object_ptr theObject); // Return an object that previously had an oldID - template + template typename TInterface::_var_type GetObjectByOldId( const int oldID ) { if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) { @@ -516,20 +531,20 @@ public: void UpdateParameters(CORBA::Object_ptr theObject, const char* theParameters); char* GetParameters(CORBA::Object_ptr theObject); char* ParseParameters(const char* theParameters); - - + + private: // Create hypothesis of given type SMESH::SMESH_Hypothesis_ptr createHypothesis( const char* theHypName, const char* theLibName) throw ( SALOME::SALOME_Exception ); - + // Create empty mesh on shape SMESH::SMESH_Mesh_ptr createMesh() throw ( SALOME::SALOME_Exception ); static void loadGeomData( SALOMEDS::SComponent_ptr theCompRoot ); - + private: static GEOM::GEOM_Gen_var myGeomGen; static CORBA::ORB_var myOrb; // ORB reference