-// 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_
// constructor
StudyContext() {}
// destructor
- ~StudyContext()
- {
+ ~StudyContext()
+ {
mapIdToIOR.clear();
mapIdToId.clear();
}
}
return 0;
}
-
+
private:
// get next free object identifier
int getNextId()
// ==========================================================
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
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();
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,
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
SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
throw ( SALOME::SALOME_Exception );
+ // Create mesh(es) and import data from CGNS file
+ SMESH::mesh_array* CreateMeshesFromCGNS( const char* theFileName,
+ SMESH::DriverMED_ReadStatus& theStatus )
+ 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
*/
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.
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 );
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 );
// 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,
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
// 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);
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);
// Get shape reader
GEOM_Client* GetShapeReader();
- // Tags definition
+ // Tags definition
static long GetHypothesisRootTag();
static long GetAlgorithmsRootTag();
static long GetRefOnShapeTag();
static long GetEdgeGroupsTag();
static long GetFaceGroupsTag();
static long GetVolumeGroupsTag();
+ static long Get0DElementsGroupsTag();
// publishing methods
SALOMEDS::SComponent_ptr PublishComponent(SALOMEDS::Study_ptr theStudy);
CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
// Return an object that previously had an oldID
- template<class TInterface>
+ template<class TInterface>
typename TInterface::_var_type GetObjectByOldId( const int oldID )
{
if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) {
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