smesh/idl/SMESH_Mesh.idl
2004-04-02 13:33:18 +00:00

373 lines
9.6 KiB
Plaintext

// Copyright (C) 2003 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 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
//
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
//
//
//
// File : SMESH_Mesh.idl
// Author : Paul RASCLE, EDF
// $Header$
#ifndef _SMESH_MESH_IDL_
#define _SMESH_MESH_IDL_
#include "SALOME_Exception.idl"
//#include "SMESH_Hypothesis.idl"
#include "SALOME_GenericObj.idl"
//#include "GEOM_Shape.idl"
//#include "MED.idl"
module GEOM
{
interface GEOM_Shape;
};
module SALOME_MED
{
interface MESH;
interface FAMILY;
};
module SMESH
{
interface SMESH_Hypothesis;
typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
typedef sequence<double> double_array ;
typedef sequence<long> long_array ;
typedef sequence<string> string_array ;
enum log_command
{
ADD_NODE,
ADD_EDGE,
ADD_TRIANGLE,
ADD_QUADRANGLE,
ADD_TETRAHEDRON,
ADD_PYRAMID,
ADD_PRISM,
ADD_HEXAHEDRON,
REMOVE_NODE,
REMOVE_ELEMENT
};
struct log_block
{
long commandType;
long number;
double_array coords;
long_array indexes;
};
/*!
* Enumeration for element type, like in SMDS
*/
enum ElementType
{
ALL,
NODE,
EDGE,
FACE,
VOLUME
};
/*!
* Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
*/
enum Hypothesis_Status // in the order of severity
{
HYP_OK,
HYP_MISSING, // algo misses a hypothesis
HYP_CONCURENT, // several applicable hypotheses
HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
// for Add/RemoveHypothesis operations
HYP_INCOMPATIBLE, // hypothesis does not fit algo
HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis
HYP_ALREADY_EXIST,// such hypothesis already exist
HYP_BAD_DIM // bad dimension
};
/*!
* Enumeration for DriverMED read status (used by ImportMEDFile() method)
*/
enum DriverMED_ReadStatus // in the order of severity
{
DRS_OK,
DRS_EMPTY, // a MED file contains no mesh with the given name
DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
// so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_FAIL // general failure (exception etc.)
};
typedef sequence<log_block> log_array;
interface SMESH_Group;
interface SMESH_subMesh;
interface SMESH_MeshEditor;
interface SMESH_Mesh : SALOME::GenericObj
{
/*!
* Associate a Shape to a Mesh created with NewEmpty
*/
// boolean SetMesh(in GEOM::GEOM_Shape aShape)
// raises (SALOME::SALOME_Exception);
/*!
* Get the subMesh object associated to a subShape. The subMesh object
* gives access to nodes and elements IDs.
* SubMesh will be used instead of SubShape in a next idl version to
* adress a specific subMesh...
*/
SMESH_subMesh GetSubMesh(in GEOM::GEOM_Shape aSubShape, in string name)
raises (SALOME::SALOME_Exception);
/*!
* Create a subMesh without reference to a subShape
*/
// SMESH_subMesh NewEmpty()
// raises (SALOME::SALOME_Exception);
/*!
* Remove a submesh
*/
void RemoveSubMesh(in SMESH_subMesh aSubMesh)
raises (SALOME::SALOME_Exception);
/*!
* Create a group
*/
SMESH_Group CreateGroup( in ElementType elem_type,
in string name )
raises (SALOME::SALOME_Exception);
/*!
* Remove a group
*/
void RemoveGroup(in SMESH_Group aGroup)
raises (SALOME::SALOME_Exception);
/*!
* Add hypothesis to the mesh, under a particular subShape
* (or the main shape itself)
* The Add method is only used to prepare the build of the mesh and store
* the algorithms and associated parameters.
* Actual job of mesh the shape is done by MESH_Gen.
* @params
* - aSubShape : subShape obtained by a shape explode in GEOM
* (or main shape)
* - anHyp : hypothesis object
* @return
* - OK if the hypothesis is compatible with the subShape
* (and all previous hypothesis on the subShape)
* - NOK if the hypothesis is not compatible with the subShape
* (or one previous hypothesis on the subShape)
* raises exception if hypothesis has not been created
*/
Hypothesis_Status AddHypothesis(in GEOM::GEOM_Shape aSubShape,
in SMESH_Hypothesis anHyp)
raises (SALOME::SALOME_Exception);
// boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
// raises (SALOME::SALOME_Exception);
/*!
* Remove an hypothesis previouly added with AddHypothesis.
*/
Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Shape aSubShape,
in SMESH_Hypothesis anHyp)
raises (SALOME::SALOME_Exception);
// boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
// in SMESH_Hypothesis anHyp)
// raises (SALOME::SALOME_Exception);
/*!
* Get the list of hypothesis added on a subShape
*/
ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Shape aSubShape)
raises (SALOME::SALOME_Exception);
// ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
// raises (SALOME::SALOME_Exception);
/*!
* Get the log of nodes and elements added or removed since previous
* clear of the log.
* @params
* - clearAfterGet : log is emptied after Get (safe if concurrents access)
*/
// string_array GetLog(in boolean clearAfterGet)
// raises (SALOME::SALOME_Exception);
log_array GetLog(in boolean clearAfterGet)
raises (SALOME::SALOME_Exception);
/*!
* Clear the log of nodes and elements added or removed since previous
* clear. Must be used immediately after GetLog if clearAfterGet is false.
*/
void ClearLog()
raises (SALOME::SALOME_Exception);
/*!
* Get the internal Id
*/
long GetId();
/*!
* Get the study Id
*/
long GetStudyId();
SMESH_MeshEditor GetMeshEditor()
raises (SALOME::SALOME_Exception);
/*!
* Export Mesh with DAT and MED Formats
*/
void ExportDAT( in string file )
raises (SALOME::SALOME_Exception);
void ExportMED( in string file, in boolean auto_groups )
raises (SALOME::SALOME_Exception);
void ExportUNV( in string file )
raises (SALOME::SALOME_Exception);
/*!
* Get MED Mesh
*/
SALOME_MED::MESH GetMEDMesh()
raises (SALOME::SALOME_Exception);
long NbNodes()
raises (SALOME::SALOME_Exception);
long NbEdges()
raises (SALOME::SALOME_Exception);
long NbFaces()
raises (SALOME::SALOME_Exception);
long NbTriangles()
raises (SALOME::SALOME_Exception);
long NbQuadrangles()
raises (SALOME::SALOME_Exception);
long NbVolumes()
raises (SALOME::SALOME_Exception);
long NbTetras()
raises (SALOME::SALOME_Exception);
long NbHexas()
raises (SALOME::SALOME_Exception);
long NbPyramids()
raises (SALOME::SALOME_Exception);
long NbPrisms()
raises (SALOME::SALOME_Exception);
long NbSubMesh()
raises (SALOME::SALOME_Exception);
string Dump();
};
interface SMESH_subMesh : SALOME::GenericObj
{
/*!
*
*/
long GetNumberOfElements()
raises (SALOME::SALOME_Exception);
/*!
*
*/
long GetNumberOfNodes()
raises (SALOME::SALOME_Exception);
/*!
*
*/
long_array GetElementsId()
raises (SALOME::SALOME_Exception);
/*!
*
*/
long_array GetElementsByType( in ElementType theType )
raises (SALOME::SALOME_Exception);
/*!
*
*/
long_array GetNodesId()
raises (SALOME::SALOME_Exception);
/*!
* Get SMESH_Mesh which stores nodes coordinates & elements definition
*/
SMESH_Mesh GetFather()
raises (SALOME::SALOME_Exception);
/*!
* Get the internal Id
*/
long GetId();
/*!
* Get MED subMesh
*/
SALOME_MED::FAMILY GetFamily()
raises (SALOME::SALOME_Exception);
};
/*
* This interface makes modifications on the Mesh - removing elements and nodes
*/
interface SMESH_MeshEditor {
boolean RemoveElements(in long_array IDsOfElements)
raises (SALOME::SALOME_Exception);
boolean RemoveNodes(in long_array IDsOfNodes)
raises (SALOME::SALOME_Exception);
boolean AddNode(in double x, in double y, in double z)
raises (SALOME::SALOME_Exception);
boolean AddEdge(in long_array IDsOfNodes)
raises (SALOME::SALOME_Exception);
boolean AddFace(in long_array IDsOfNodes)
raises (SALOME::SALOME_Exception);
boolean AddVolume(in long_array IDsOfNodes)
raises (SALOME::SALOME_Exception);
};
};
#endif