Merge branch 'V9_7_BR' into gni/evolution

This commit is contained in:
GERALD NICOLAS 2021-04-26 16:23:22 +02:00
commit db83efeef8
228 changed files with 3786 additions and 3371 deletions

View File

@ -79,6 +79,12 @@ IF(SALOME_SMESH_DYNLOAD_LOCAL)
ADD_DEFINITIONS(-DDYNLOAD_LOCAL) ADD_DEFINITIONS(-DDYNLOAD_LOCAL)
ENDIF(SALOME_SMESH_DYNLOAD_LOCAL) ENDIF(SALOME_SMESH_DYNLOAD_LOCAL)
IF(SALOME_USE_64BIT_IDS)
SET(SMESH_ID_TYPE "long long")
ELSE()
SET(SMESH_ID_TYPE "long")
ENDIF()
IF(SMESH_USE_MESHGEMS_HYPOSET) IF(SMESH_USE_MESHGEMS_HYPOSET)
SET(SMESH_USE_MESHGEMS_HYPOSET_VAR "true") SET(SMESH_USE_MESHGEMS_HYPOSET_VAR "true")
ELSE(SMESH_USE_MESHGEMS_HYPOSET) ELSE(SMESH_USE_MESHGEMS_HYPOSET)

View File

@ -127,6 +127,7 @@ SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@")
SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@") SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@") SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@") SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
SET(SALOME_USE_64BIT_IDS @SALOME_USE_64BIT_IDS@)
# Include GEOM targets if they were not already loaded: # Include GEOM targets if they were not already loaded:
IF(NOT (TARGET GEOMbasic)) IF(NOT (TARGET GEOMbasic))

View File

@ -26,6 +26,8 @@ INCLUDE_DIRECTORIES(
${PROJECT_BINARY_DIR}/idl ${PROJECT_BINARY_DIR}/idl
) )
SALOME_CONFIGURE_FILE(SMESH_smIdType.idl.in SMESH_smIdType.idl)
SET(SalomeIDLSMESH_IDLSOURCES SET(SalomeIDLSMESH_IDLSOURCES
SMESH_Gen.idl SMESH_Gen.idl
SMESH_Mesh.idl SMESH_Mesh.idl
@ -36,12 +38,14 @@ SET(SalomeIDLSMESH_IDLSOURCES
SMESH_Pattern.idl SMESH_Pattern.idl
SMESH_MeshEditor.idl SMESH_MeshEditor.idl
SMESH_Measurements.idl SMESH_Measurements.idl
${CMAKE_CURRENT_BINARY_DIR}/SMESH_smIdType.idl
MG_ADAPT.idl MG_ADAPT.idl
) )
SET(_idl_include_dirs SET(_idl_include_dirs
${KERNEL_ROOT_DIR}/idl/salome ${KERNEL_ROOT_DIR}/idl/salome
${GEOM_ROOT_DIR}/idl/salome ${GEOM_ROOT_DIR}/idl/salome
${PROJECT_BINARY_DIR}/idl
) )
SET(_idl_link_flags SET(_idl_link_flags

View File

@ -161,32 +161,32 @@ module StdMeshers
/*! /*!
* Builds and returns point distribution according to passed density function * Builds and returns point distribution according to passed density function
*/ */
SMESH::double_array BuildDistributionExpr( in string func, in long nbSeg, in long conv ) SMESH::double_array BuildDistributionExpr( in string func, in long nbSeg, in long conv )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
SMESH::double_array BuildDistributionTab( in SMESH::double_array func, in long nbSeg, in long conv ) SMESH::double_array BuildDistributionTab( in SMESH::double_array func, in long nbSeg, in long conv )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Sets <number of segments> parameter value * Sets <number of segments> parameter value
*/ */
void SetNumberOfSegments(in long segmentsNumber) void SetNumberOfSegments(in SMESH::smIdType segmentsNumber)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Returns <number of segments> parameter value * Returns <number of segments> parameter value
*/ */
long GetNumberOfSegments(); long GetNumberOfSegments();
/*! /*!
* Sets <distribution type> parameter value * Sets <distribution type> parameter value
*/ */
void SetDistrType(in long typ) void SetDistrType(in long typ)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Returns <distribution type> parameter value * Returns <distribution type> parameter value
*/ */
long GetDistrType(); long GetDistrType();
/*! /*!
* Sets <scale factor> parameter value * Sets <scale factor> parameter value
@ -227,13 +227,13 @@ module StdMeshers
/*! /*!
* Sets <conversion mode> parameter value for functional distributions * Sets <conversion mode> parameter value for functional distributions
*/ */
void SetConversionMode(in long conv ) void SetConversionMode(in long conv )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Returns <conversion mode> parameter value for functional distributions * Returns <conversion mode> parameter value for functional distributions
*/ */
long ConversionMode() long ConversionMode()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
}; };
@ -323,13 +323,13 @@ module StdMeshers
/*! /*!
* Sets <mode> parameter value * Sets <mode> parameter value
*/ */
void SetMode(in long mode) void SetMode(in long mode)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Returns <mode> parameter value * Returns <mode> parameter value
*/ */
long GetMode(); long GetMode();
}; };
/*! /*!
@ -395,7 +395,7 @@ module StdMeshers
*/ */
void SetPoints(in SMESH::double_array listParams) void SetPoints(in SMESH::double_array listParams)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void SetNbSegments(in SMESH::long_array listNbSeg) void SetNbSegments(in SMESH::smIdType_array listNbSeg)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -406,7 +406,7 @@ module StdMeshers
/*! /*!
* Returns list of numbers of segments * Returns list of numbers of segments
*/ */
SMESH::long_array GetNbSegments(); SMESH::smIdType_array GetNbSegments();
}; };
@ -519,13 +519,13 @@ module StdMeshers
/*! /*!
* Sets <number of segments> parameter value * Sets <number of segments> parameter value
*/ */
void SetNumberOfLayers(in long numberOfLayers) void SetNumberOfLayers(in long numberOfLayers)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Returns <number of layers> parameter value * Returns <number of layers> parameter value
*/ */
long GetNumberOfLayers(); long GetNumberOfLayers();
}; };
@ -665,7 +665,7 @@ module StdMeshers
* Result may be nil if association not set. * Result may be nil if association not set.
* Valid indices are 1 and 2 * Valid indices are 1 and 2
*/ */
GEOM::GEOM_Object GetSourceVertex(in long i) GEOM::GEOM_Object GetSourceVertex(in long i)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -673,7 +673,7 @@ module StdMeshers
* Result may be nil if association not set. * Result may be nil if association not set.
* Valid indices are 1 and 2 * Valid indices are 1 and 2
*/ */
GEOM::GEOM_Object GetTargetVertex(in long i) GEOM::GEOM_Object GetTargetVertex(in long i)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
}; };
@ -722,7 +722,7 @@ module StdMeshers
* Result may be nil if association not set. * Result may be nil if association not set.
* Valid indices are 1 and 2 * Valid indices are 1 and 2
*/ */
GEOM::GEOM_Object GetSourceVertex(in long i) GEOM::GEOM_Object GetSourceVertex(in long i)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -730,7 +730,7 @@ module StdMeshers
* Result may be nil if association not set. * Result may be nil if association not set.
* Valid indices are 1 and 2 * Valid indices are 1 and 2
*/ */
GEOM::GEOM_Object GetTargetVertex(in long i) GEOM::GEOM_Object GetTargetVertex(in long i)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
}; };
@ -771,12 +771,12 @@ module StdMeshers
/*! /*!
* Set base vertex for triangles * Set base vertex for triangles
*/ */
void SetTriaVertex( in long vertID ); void SetTriaVertex( in long vertID );
/*! /*!
* Returns base vertex for triangles * Returns base vertex for triangles
*/ */
long GetTriaVertex(); long GetTriaVertex();
/*! /*!
* Set entry of the main object * Set entry of the main object

View File

@ -30,6 +30,7 @@
#include "SALOME_GenericObj.idl" #include "SALOME_GenericObj.idl"
#include "GEOM_Gen.idl" #include "GEOM_Gen.idl"
#include "SMESH_Mesh.idl" #include "SMESH_Mesh.idl"
#include "SMESH_smIdType.idl"
module SMESH module SMESH
{ {
@ -119,8 +120,8 @@ module SMESH
*/ */
interface NumericalFunctor: Functor interface NumericalFunctor: Functor
{ {
double GetValue ( in long theElementId ); double GetValue ( in smIdType theElementId );
boolean IsApplicable( in long theElementId ); boolean IsApplicable( in smIdType theElementId );
Histogram GetHistogram ( in short nbIntervals, in boolean isLogarithmic ); Histogram GetHistogram ( in short nbIntervals, in boolean isLogarithmic );
Histogram GetLocalHistogram( in short nbIntervals, in boolean isLogarithmic, Histogram GetLocalHistogram( in short nbIntervals, in boolean isLogarithmic,
@ -374,7 +375,7 @@ module SMESH
*/ */
interface RangeOfIds: Predicate interface RangeOfIds: Predicate
{ {
void SetRange( in long_array theIds ); void SetRange( in smIdType_array theIds );
boolean SetRangeStr( in string theRange ); boolean SetRangeStr( in string theRange );
string GetRangeStr(); string GetRangeStr();
@ -474,7 +475,7 @@ module SMESH
void SetElementType( in ElementType type ); void SetElementType( in ElementType type );
void SetPoint ( in double x, in double y, in double z ); void SetPoint ( in double x, in double y, in double z );
void SetVertex ( in GEOM::GEOM_Object vertex ); void SetVertex ( in GEOM::GEOM_Object vertex );
void SetNode ( in long nodeID ); void SetNode ( in smIdType nodeID );
string GetThreshold ( out ThresholdType type ); string GetThreshold ( out ThresholdType type );
void SetThreshold ( in string threshold, in ThresholdType type ) void SetThreshold ( in string threshold, in ThresholdType type )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
@ -522,16 +523,16 @@ module SMESH
typedef sequence<Criterion> Criteria; typedef sequence<Criterion> Criteria;
void SetPredicate( in Predicate thePredicate ); void SetPredicate( in Predicate thePredicate );
void SetMesh( in SMESH_Mesh theMesh ); void SetMesh( in SMESH_Mesh theMesh );
long_array GetElementsId( in SMESH_Mesh theMesh ); smIdType_array GetElementsId( in SMESH_Mesh theMesh );
long_array GetElementsIdFromParts( in ListOfIDSources theParts ); smIdType_array GetElementsIdFromParts( in ListOfIDSources theParts );
ElementType GetElementType(); ElementType GetElementType();
Predicate GetPredicate(); Predicate GetPredicate();
boolean GetCriteria( out Criteria theCriteria ); boolean GetCriteria( out Criteria theCriteria );
boolean SetCriteria( in Criteria theCriteria ); boolean SetCriteria( in Criteria theCriteria );
}; };

View File

@ -33,6 +33,7 @@
#include "SMESH_Mesh.idl" #include "SMESH_Mesh.idl"
#include "SMESH_Hypothesis.idl" #include "SMESH_Hypothesis.idl"
#include "SMESH_smIdType.idl"
module SMESH module SMESH
{ {
@ -387,8 +388,8 @@ module SMESH
/*! /*!
* Evaluates size of prospective mesh on a shape * Evaluates size of prospective mesh on a shape
*/ */
long_array Evaluate(in SMESH_Mesh theMesh, smIdType_array Evaluate(in SMESH_Mesh theMesh,
in GEOM::GEOM_Object theSubObject) in GEOM::GEOM_Object theSubObject)
raises ( SALOME::SALOME_Exception ); raises ( SALOME::SALOME_Exception );
/*! /*!
@ -446,17 +447,17 @@ module SMESH
* The returned geometrical object, if not nil, is either found in the * The returned geometrical object, if not nil, is either found in the
* study or is published by this method with the given name * study or is published by this method with the given name
*/ */
GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh, GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh,
in long theElementID, in smIdType theElementID,
in string theGeomName) in string theGeomName)
raises ( SALOME::SALOME_Exception ); raises ( SALOME::SALOME_Exception );
/*! /*!
* Return geometrical object the given element is built on. * Return geometrical object the given element is built on.
* The returned geometrical object not published in study by this method. * The returned geometrical object not published in study by this method.
*/ */
GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh, GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh,
in long theElementID) in smIdType theElementID)
raises ( SALOME::SALOME_Exception ); raises ( SALOME::SALOME_Exception );
/*! /*!

View File

@ -32,6 +32,7 @@
#include "SALOMEDS_Attributes.idl" #include "SALOMEDS_Attributes.idl"
#include "SMESH_Mesh.idl" #include "SMESH_Mesh.idl"
#include "SMESH_smIdType.idl"
module SMESH module SMESH
{ {
@ -61,7 +62,7 @@ module SMESH
/*! /*!
* Returns the number of elements in the group * Returns the number of elements in the group
*/ */
long Size(); smIdType Size();
/*! /*!
* Returns true if the group does not contain any elements * Returns true if the group does not contain any elements
@ -71,29 +72,29 @@ module SMESH
/*! /*!
* returns true if the group contains an element with ID == <elem_id> * returns true if the group contains an element with ID == <elem_id>
*/ */
boolean Contains( in long elem_id ); boolean Contains( in smIdType elem_id );
/*! /*!
* Returns ID of an element at position <elem_index> counted from 1 * Returns ID of an element at position <elem_index> counted from 1
*/ */
long GetID( in long elem_index ); smIdType GetID( in smIdType elem_index );
/*! /*!
* Returns a sequence of all element IDs in the group * Returns a sequence of all element IDs in the group
*/ */
long_array GetListOfID(); smIdType_array GetListOfID();
/*! /*!
* Get the number of nodes of cells included to the group * Get the number of nodes of cells included to the group
* For a nodal group returns the same value as Size() function * For a nodal group returns the same value as Size() function
*/ */
long GetNumberOfNodes(); smIdType GetNumberOfNodes();
/*! /*!
* Get IDs of nodes of cells included to the group * Get IDs of nodes of cells included to the group
* For a nodal group returns result of GetListOfID() function * For a nodal group returns result of GetListOfID() function
*/ */
long_array GetNodeIDs(); smIdType_array GetNodeIDs();
/*! /*!
* Return true if GetNumberOfNodes() won't take a long time for computation * Return true if GetNumberOfNodes() won't take a long time for computation
@ -142,24 +143,24 @@ module SMESH
/*! /*!
* Adds elements or nodes with specified identifiers to the group * Adds elements or nodes with specified identifiers to the group
*/ */
long Add( in long_array elem_ids ); smIdType Add( in smIdType_array elem_ids );
/*! /*!
* Adds elements or nodes that match specified predicate to the group * Adds elements or nodes that match specified predicate to the group
*/ */
long AddByPredicate( in Predicate thePredicate ); smIdType AddByPredicate( in Predicate thePredicate );
/*! /*!
* Add all elements or nodes from the specified source to the group * Add all elements or nodes from the specified source to the group
*/ */
long AddFrom( in SMESH_IDSource theSource ); smIdType AddFrom( in SMESH_IDSource theSource );
/*! /*!
* Removes elements or nodes with specified identifiers from the group * Removes elements or nodes with specified identifiers from the group
*/ */
long Remove( in long_array elem_ids ); smIdType Remove( in smIdType_array elem_ids );
/*! /*!
* Removes elements or nodes that match specified predicate from the group * Removes elements or nodes that match specified predicate from the group
*/ */
long RemoveByPredicate( in Predicate thePredicate ); smIdType RemoveByPredicate( in Predicate thePredicate );
}; };

View File

@ -57,7 +57,7 @@ module SMESH
/*! /*!
* Get the internal Id * Get the internal Id
*/ */
long GetId(); short GetId();
/*! /*!
* Set the variable parameter * Set the variable parameter

View File

@ -28,6 +28,7 @@
#include "SALOME_GenericObj.idl" #include "SALOME_GenericObj.idl"
#include "SMESH_Mesh.idl" #include "SMESH_Mesh.idl"
#include "SMESH_smIdType.idl"
module SMESH module SMESH
{ {
@ -37,8 +38,8 @@ module SMESH
struct Measure { struct Measure {
double minX, minY, minZ; double minX, minY, minZ;
double maxX, maxY, maxZ; double maxX, maxY, maxZ;
long node1, node2; smIdType node1, node2;
long elem1, elem2; smIdType elem1, elem2;
double value; double value;
}; };

View File

@ -29,6 +29,7 @@
#include "SALOME_Exception.idl" #include "SALOME_Exception.idl"
#include "SALOME_GenericObj.idl" #include "SALOME_GenericObj.idl"
#include "GEOM_Gen.idl" #include "GEOM_Gen.idl"
#include "SMESH_smIdType.idl"
module SMESH module SMESH
{ {
@ -41,6 +42,7 @@ module SMESH
typedef sequence<double > double_array ; typedef sequence<double > double_array ;
typedef sequence<long > long_array ; typedef sequence<long > long_array ;
typedef sequence<smIdType > smIdType_array ;
typedef sequence<string > string_array ; typedef sequence<string > string_array ;
typedef sequence<long_array> array_of_long_array ; typedef sequence<long_array> array_of_long_array ;
@ -228,12 +230,12 @@ module SMESH
enum DriverMED_ReadStatus // in the order of severity enum DriverMED_ReadStatus // in the order of severity
{ {
DRS_OK, DRS_OK,
DRS_EMPTY, // a file contains no mesh with the given name DRS_EMPTY, // a file contains no mesh with the given name
DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers, DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
// so the numbers from the file are ignored // so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
DRS_FAIL // general failure (exception etc.) DRS_FAIL // general failure (exception etc.)
}; };
/*! /*!
@ -267,7 +269,7 @@ module SMESH
*/ */
struct ElementSubType { ElementType SMDS_ElementType; struct ElementSubType { ElementType SMDS_ElementType;
boolean isPoly; boolean isPoly;
long nbNodesInElement; }; short nbNodesInElement; };
typedef sequence<ElementSubType> types_array; typedef sequence<ElementSubType> types_array;
@ -285,19 +287,19 @@ module SMESH
/*! /*!
* Returns a sequence of all element IDs * Returns a sequence of all element IDs
*/ */
long_array GetIDs(); smIdType_array GetIDs();
/*! /*!
* Returns number of mesh elements of each \a EntityType * Returns number of mesh elements of each \a EntityType
* @return array of number of elements per \a EntityType * @return array of number of elements per \a EntityType
*/ */
long_array GetMeshInfo(); smIdType_array GetMeshInfo();
/*! /*!
* Returns number of mesh elements of each \a ElementType * Returns number of mesh elements of each \a ElementType
* @return array of number of elements per \a ElementType * @return array of number of elements per \a ElementType
*/ */
long_array GetNbElementsByType(); smIdType_array GetNbElementsByType();
/*! /*!
* Returns types of elements it contains. * Returns types of elements it contains.
@ -747,121 +749,121 @@ module SMESH
/*! /*!
* Get information about mesh contents * Get information about mesh contents
*/ */
long NbNodes() smIdType NbNodes()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbElements() smIdType NbElements()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long Nb0DElements() smIdType Nb0DElements()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbBalls() smIdType NbBalls()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbEdges() smIdType NbEdges()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbEdgesOfOrder(in ElementOrder order) smIdType NbEdgesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbFaces() smIdType NbFaces()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbFacesOfOrder(in ElementOrder order) smIdType NbFacesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbTriangles() smIdType NbTriangles()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbTrianglesOfOrder(in ElementOrder order) smIdType NbTrianglesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbBiQuadTriangles() smIdType NbBiQuadTriangles()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbQuadrangles() smIdType NbQuadrangles()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbQuadranglesOfOrder(in ElementOrder order) smIdType NbQuadranglesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbBiQuadQuadrangles() smIdType NbBiQuadQuadrangles()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbPolygons() smIdType NbPolygons()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbPolygonsOfOrder(in ElementOrder order) smIdType NbPolygonsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbVolumes() smIdType NbVolumes()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbVolumesOfOrder(in ElementOrder order) smIdType NbVolumesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbTetras() smIdType NbTetras()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbTetrasOfOrder(in ElementOrder order) smIdType NbTetrasOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbHexas() smIdType NbHexas()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbHexasOfOrder(in ElementOrder order) smIdType NbHexasOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbTriQuadraticHexas() smIdType NbTriQuadraticHexas()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbPyramids() smIdType NbPyramids()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbPyramidsOfOrder(in ElementOrder order) smIdType NbPyramidsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbPrisms() smIdType NbPrisms()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbPrismsOfOrder(in ElementOrder order) smIdType NbPrismsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbHexagonalPrisms() smIdType NbHexagonalPrisms()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbPolyhedrons() smIdType NbPolyhedrons()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long NbSubMesh() smIdType NbSubMesh()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long_array GetElementsId() smIdType_array GetElementsId()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long_array GetElementsByType( in ElementType theType ) smIdType_array GetElementsByType( in ElementType theType )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long_array GetNodesId() smIdType_array GetNodesId()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Returns type of mesh element * Returns type of mesh element
*/ */
ElementType GetElementType( in long id, in boolean iselem ) ElementType GetElementType( in smIdType id, in boolean iselem )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
EntityType GetElementGeomType( in long id ) EntityType GetElementGeomType( in smIdType id )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
GeometryType GetElementShape( in long id ) GeometryType GetElementShape( in smIdType id )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long_array GetSubMeshElementsId(in long ShapeID) smIdType_array GetSubMeshElementsId(in long ShapeID)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
long_array GetSubMeshNodesId(in long ShapeID, in boolean all ) smIdType_array GetSubMeshNodesId(in long ShapeID, in boolean all )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
ElementType GetSubMeshElementType(in long ShapeID) ElementType GetSubMeshElementType(in long ShapeID)
@ -902,81 +904,81 @@ module SMESH
* Get XYZ coordinates of node as list of double * Get XYZ coordinates of node as list of double
* If there is not node for given ID - returns empty list * If there is not node for given ID - returns empty list
*/ */
double_array GetNodeXYZ(in long id); double_array GetNodeXYZ(in smIdType id);
/*! /*!
* For given node returns list of IDs of inverse elements * For given node returns list of IDs of inverse elements
* If there is not node for given ID - returns empty list * If there is not node for given ID - returns empty list
*/ */
long_array GetNodeInverseElements(in long id, in ElementType elemType); smIdType_array GetNodeInverseElements(in smIdType id, in ElementType elemType);
/*! /*!
* \brief Return position of a node on shape * \brief Return position of a node on shape
*/ */
NodePosition GetNodePosition(in long NodeID); NodePosition GetNodePosition(in smIdType NodeID);
/*! /*!
* \brief Return position of an element on shape * \brief Return position of an element on shape
*/ */
ElementPosition GetElementPosition(in long ElemID); ElementPosition GetElementPosition(in smIdType ElemID);
/*! /*!
* If given element is node returns IDs of shape from position * If given element is node returns IDs of shape from position
* If there is not node for given ID - returns -1 * If there is not node for given ID - returns -1
*/ */
long GetShapeID(in long id); long GetShapeID(in smIdType id);
/*! /*!
* For given element returns ID of result shape after * For given element returns ID of result shape after
* ::FindShape() from SMESH_MeshEditor * ::FindShape() from SMESH_MeshEditor
* If there is not element for given ID - returns -1 * If there is not element for given ID - returns -1
*/ */
long GetShapeIDForElem(in long id); long GetShapeIDForElem(in smIdType id);
/*! /*!
* Returns number of nodes for given element * Returns number of nodes for given element
* If there is not element for given ID - returns -1 * If there is not element for given ID - returns -1
*/ */
long GetElemNbNodes(in long id); short GetElemNbNodes(in smIdType id);
/*! /*!
* Returns IDs of nodes of given element * Returns IDs of nodes of given element
*/ */
long_array GetElemNodes(in long id); smIdType_array GetElemNodes(in smIdType id);
/*! /*!
* Returns ID of node by given index for given element * Returns ID of node by given index for given element
* If there is not element for given ID - returns -1 * If there is not element for given ID - returns -1
* If there is not node for given index - returns -2 * If there is not node for given index - returns -2
*/ */
long GetElemNode(in long id, in long index); smIdType GetElemNode(in smIdType id, in short index);
/*! /*!
* Returns true if given node is medium node * Returns true if given node is medium node
* in given quadratic element * in given quadratic element
*/ */
boolean IsMediumNode(in long ide, in long idn); boolean IsMediumNode(in smIdType ide, in smIdType idn);
/*! /*!
* Returns true if given node is medium node * Returns true if given node is medium node
* in one of quadratic elements * in one of quadratic elements
*/ */
boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type); boolean IsMediumNodeOfAnyElem(in smIdType idn, in ElementType elem_type);
/*! /*!
* Returns number of edges for given element * Returns number of edges for given element
*/ */
long ElemNbEdges(in long id); long ElemNbEdges(in smIdType id);
/*! /*!
* Returns number of faces for given element * Returns number of faces for given element
*/ */
long ElemNbFaces(in long id); long ElemNbFaces(in smIdType id);
/*! /*!
* Returns nodes of given face (counted from zero) for given volumic element. * Returns nodes of given face (counted from zero) for given volumic element.
*/ */
long_array GetElemFaceNodes(in long elemId, in short faceIndex); smIdType_array GetElemFaceNodes(in smIdType elemId, in short faceIndex);
/*! /*!
* Returns three components of normal of given mesh face (or an empty array in KO case) * Returns three components of normal of given mesh face (or an empty array in KO case)
@ -986,34 +988,34 @@ module SMESH
/*! /*!
* Returns an element based on all given nodes. * Returns an element based on all given nodes.
*/ */
long FindElementByNodes(in long_array nodes); smIdType FindElementByNodes(in smIdType_array nodes);
/*! /*!
* Return elements including all given nodes. * Return elements including all given nodes.
*/ */
long_array GetElementsByNodes(in long_array nodes, in ElementType elem_type); smIdType_array GetElementsByNodes(in smIdType_array nodes, in ElementType elem_type);
/*! /*!
* Returns true if given element is polygon * Returns true if given element is polygon
*/ */
boolean IsPoly(in long id); boolean IsPoly(in smIdType id);
/*! /*!
* Returns true if given element is quadratic * Returns true if given element is quadratic
*/ */
boolean IsQuadratic(in long id); boolean IsQuadratic(in smIdType id);
/*! /*!
* Returns diameter of a ball discrete element or zero in case of an invalid \a id * Returns diameter of a ball discrete element or zero in case of an invalid \a id
*/ */
double GetBallDiameter(in long id); double GetBallDiameter(in smIdType id);
/*! /*!
* Returns XYZ coordinates of bary center for given element * Returns XYZ coordinates of bary center for given element
* as list of double * as list of double
* If there is not element for given ID - returns empty list * If there is not element for given ID - returns empty list
*/ */
double_array BaryCenter(in long id); double_array BaryCenter(in smIdType id);
/*! Gets information about imported MED file */ /*! Gets information about imported MED file */
MedFileInfo GetMEDFileInfo(); MedFileInfo GetMEDFileInfo();
@ -1040,37 +1042,37 @@ module SMESH
/*! /*!
* *
*/ */
long GetNumberOfElements() smIdType GetNumberOfElements()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* *
*/ */
long GetNumberOfNodes( in boolean all ) smIdType GetNumberOfNodes( in boolean all )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* *
*/ */
long_array GetElementsId() smIdType_array GetElementsId()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* *
*/ */
long_array GetElementsByType( in ElementType theType ) smIdType_array GetElementsByType( in ElementType theType )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Returns type of mesh element (same as SMESH_Mesh::GetElementType() ) * Returns type of mesh element (same as SMESH_Mesh::GetElementType() )
*/ */
ElementType GetElementType( in long id, in boolean iselem ) ElementType GetElementType( in smIdType id, in boolean iselem )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* *
*/ */
long_array GetNodesId() smIdType_array GetNodesId()
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!

View File

@ -26,6 +26,7 @@
#include "SMESH_Mesh.idl" #include "SMESH_Mesh.idl"
#include "SMESH_Gen.idl" #include "SMESH_Gen.idl"
#include "SMESH_smIdType.idl"
module SMESH module SMESH
{ {
@ -36,7 +37,7 @@ module SMESH
struct FreeBorder struct FreeBorder
{ {
SMESH::long_array nodeIDs; // all nodes defining a free border SMESH::smIdType_array nodeIDs; // all nodes defining a free border
// 1st and last node is same in a closed border // 1st and last node is same in a closed border
}; };
struct FreeBorderPart struct FreeBorderPart
@ -66,13 +67,13 @@ module SMESH
// else ==> point is at xyz* // else ==> point is at xyz*
// point 1 // point 1
long node1ID1; smIdType node1ID1;
long node1ID2; smIdType node1ID2;
PointStruct xyz1; PointStruct xyz1;
// point 2 // point 2
long node2ID1; smIdType node2ID1;
long node2ID2; smIdType node2ID2;
PointStruct xyz2; PointStruct xyz2;
// vector on the plane; to use a default plane set vector = (0,0,0) // vector on the plane; to use a default plane set vector = (0,0,0)
@ -83,9 +84,9 @@ module SMESH
// face edge defined by two nodes + optional medium node // face edge defined by two nodes + optional medium node
struct FaceEdge struct FaceEdge
{ {
long node1; smIdType node1;
long node2; smIdType node2;
long medium; smIdType medium;
}; };
typedef sequence<FaceEdge> ListOfEdges; typedef sequence<FaceEdge> ListOfEdges;
@ -112,14 +113,14 @@ module SMESH
* created, this method returns list of their IDs, if new nodes * created, this method returns list of their IDs, if new nodes
* not created - returns empty list * not created - returns empty list
*/ */
long_array GetLastCreatedNodes() raises (SALOME::SALOME_Exception); smIdType_array GetLastCreatedNodes() raises (SALOME::SALOME_Exception);
/*! /*!
* If during last operation of MeshEditor some elements were * If during last operation of MeshEditor some elements were
* created, this method returns list of their IDs, if new elements * created, this method returns list of their IDs, if new elements
* not created - returns empty list * not created - returns empty list
*/ */
long_array GetLastCreatedElems() raises (SALOME::SALOME_Exception); smIdType_array GetLastCreatedElems() raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Clears sequences of last created elements and nodes * \brief Clears sequences of last created elements and nodes
@ -136,27 +137,27 @@ module SMESH
* \param IDsOfElements list of mesh elements identifiers * \param IDsOfElements list of mesh elements identifiers
* \return new ID source object * \return new ID source object
*/ */
SMESH_IDSource MakeIDSource(in long_array IDsOfElements, in ElementType type); SMESH_IDSource MakeIDSource(in smIdType_array IDsOfElements, in ElementType type);
/*! /*!
* \brief Remove mesh elements specified by their identifiers. * \brief Remove mesh elements specified by their identifiers.
* \param IDsOfElements list of mesh elements identifiers * \param IDsOfElements list of mesh elements identifiers
* \return \c true if elements are correctly removed or \c false otherwise * \return \c true if elements are correctly removed or \c false otherwise
*/ */
boolean RemoveElements(in long_array IDsOfElements) raises (SALOME::SALOME_Exception); boolean RemoveElements(in smIdType_array IDsOfElements) raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Remove mesh nodes specified by their identifiers. * \brief Remove mesh nodes specified by their identifiers.
* \param IDsOfNodes list of mesh nodes identifiers * \param IDsOfNodes list of mesh nodes identifiers
* \return \c true if nodes are correctly removed or \c false otherwise * \return \c true if nodes are correctly removed or \c false otherwise
*/ */
boolean RemoveNodes(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception); boolean RemoveNodes(in smIdType_array IDsOfNodes) raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Remove all orphan nodes. * \brief Remove all orphan nodes.
* \return number of removed nodes * \return number of removed nodes
*/ */
long RemoveOrphanNodes() raises (SALOME::SALOME_Exception); smIdType RemoveOrphanNodes() raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Add a new node. * \brief Add a new node.
@ -165,21 +166,21 @@ module SMESH
* \param z Z coordinate of new node * \param z Z coordinate of new node
* \return integer identifier of new node * \return integer identifier of new node
*/ */
long AddNode(in double x, in double y, in double z) raises (SALOME::SALOME_Exception); smIdType AddNode(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
/*! /*!
* Create a 0D element on the given node. * Create a 0D element on the given node.
* \param IdOfNode Node IDs for creation of element. * \param IdOfNode Node IDs for creation of element.
* \param DuplicateElements to add one more 0D element to a node or not * \param DuplicateElements to add one more 0D element to a node or not
*/ */
long Add0DElement(in long IDOfNode, smIdType Add0DElement(in smIdType IDOfNode,
in boolean DuplicateElements) raises (SALOME::SALOME_Exception); in boolean DuplicateElements) raises (SALOME::SALOME_Exception);
/*! /*!
* Create a ball element on the given node. * Create a ball element on the given node.
* \param IdOfNode Node IDs for creation of element. * \param IdOfNode Node IDs for creation of element.
*/ */
long AddBall(in long IDOfNode, in double diameter) raises (SALOME::SALOME_Exception); smIdType AddBall(in smIdType IDOfNode, in double diameter) raises (SALOME::SALOME_Exception);
/*! /*!
* Create an edge, either linear and quadratic (this is determed * Create an edge, either linear and quadratic (this is determed
@ -189,7 +190,7 @@ module SMESH
* of MED. This description is located by the following link: * of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/ */
long AddEdge(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception); smIdType AddEdge(in smIdType_array IDsOfNodes) raises (SALOME::SALOME_Exception);
/*! /*!
* Create face, either linear and quadratic (this is determed * Create face, either linear and quadratic (this is determed
@ -199,16 +200,16 @@ module SMESH
* of MED. This description is located by the following link: * of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/ */
long AddFace(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception); smIdType AddFace(in smIdType_array IDsOfNodes) raises (SALOME::SALOME_Exception);
long AddPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception); smIdType AddPolygonalFace(in smIdType_array IdsOfNodes) raises (SALOME::SALOME_Exception);
/*! /*!
* Create a quadratic polygonal face * Create a quadratic polygonal face
* \param IdsOfNodes - nodes of the polygon; corner nodes follow first * \param IdsOfNodes - nodes of the polygon; corner nodes follow first
* \return long - ID of a new polygon * \return smIdType- ID of a new polygon
*/ */
long AddQuadPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception); smIdType AddQuadPolygonalFace(in smIdType_array IdsOfNodes) raises (SALOME::SALOME_Exception);
/*! /*!
* Create volume, either linear and quadratic (this is determed * Create volume, either linear and quadratic (this is determed
@ -218,7 +219,7 @@ module SMESH
* of MED. This description is located by the following link: * of MED. This description is located by the following link:
* http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
*/ */
long AddVolume(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception); smIdType AddVolume(in smIdType_array IDsOfNodes) raises (SALOME::SALOME_Exception);
/*! /*!
* Create volume of many faces, giving nodes for each face. * Create volume of many faces, giving nodes for each face.
@ -226,15 +227,15 @@ module SMESH
* \param Quantities List of integer values, Quantities[i] * \param Quantities List of integer values, Quantities[i]
* gives quantity of nodes in face number i. * gives quantity of nodes in face number i.
*/ */
long AddPolyhedralVolume (in long_array IdsOfNodes, smIdType AddPolyhedralVolume (in smIdType_array IdsOfNodes,
in long_array Quantities) raises (SALOME::SALOME_Exception); in long_array Quantities) raises (SALOME::SALOME_Exception);
/*! /*!
* Create volume of many faces, giving IDs of existing faces. * Create volume of many faces, giving IDs of existing faces.
* \param IdsOfFaces List of face IDs for volume creation. * \param IdsOfFaces List of face IDs for volume creation.
* \note The created volume will refer only to nodes * \note The created volume will refer only to nodes
* of the given faces, not to the faces itself. * of the given faces, not to the faces itself.
*/ */
long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces) raises (SALOME::SALOME_Exception); smIdType AddPolyhedralVolumeByFaces (in smIdType_array IdsOfFaces) raises (SALOME::SALOME_Exception);
/*! /*!
* Create 0D elements on all nodes of the given object. * Create 0D elements on all nodes of the given object.
@ -255,7 +256,7 @@ module SMESH
* \param NodeID - node ID * \param NodeID - node ID
* \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0] * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
*/ */
void SetNodeOnVertex(in long NodeID, in long VertexID) void SetNodeOnVertex(in smIdType NodeID, in long VertexID)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Store node position on an edge * \brief Store node position on an edge
@ -263,7 +264,7 @@ module SMESH
* \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0] * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
* \param paramOnEdge - parameter on edge where the node is located * \param paramOnEdge - parameter on edge where the node is located
*/ */
void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge) void SetNodeOnEdge(in smIdType NodeID, in long EdgeID, in double paramOnEdge)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Store node position on a face * \brief Store node position on a face
@ -272,34 +273,34 @@ module SMESH
* \param u - U parameter on face where the node is located * \param u - U parameter on face where the node is located
* \param v - V parameter on face where the node is located * \param v - V parameter on face where the node is located
*/ */
void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v) void SetNodeOnFace(in smIdType NodeID, in long FaceID, in double u, in double v)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Bind a node to a solid * \brief Bind a node to a solid
* \param NodeID - node ID * \param NodeID - node ID
* \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0] * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
*/ */
void SetNodeInVolume(in long NodeID, in long SolidID) void SetNodeInVolume(in smIdType NodeID, in long SolidID)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Bind an element to a shape * \brief Bind an element to a shape
* \param ElementID - element ID * \param ElementID - element ID
* \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0] * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
*/ */
void SetMeshElementOnShape(in long ElementID, in long ShapeID) void SetMeshElementOnShape(in smIdType ElementID, in long ShapeID)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
boolean MoveNode(in long NodeID, in double x, in double y, in double z) boolean MoveNode(in smIdType NodeID, in double x, in double y, in double z)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
boolean InverseDiag(in long NodeID1, in long NodeID2) boolean InverseDiag(in smIdType NodeID1, in smIdType NodeID2)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
boolean DeleteDiag(in long NodeID1, in long NodeID2) boolean DeleteDiag(in smIdType NodeID1, in smIdType NodeID2)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
boolean Reorient(in long_array IDsOfElements) boolean Reorient(in smIdType_array IDsOfElements)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
boolean ReorientObject(in SMESH_IDSource theObject) boolean ReorientObject(in SMESH_IDSource theObject)
@ -337,7 +338,7 @@ module SMESH
* is still performed; theMaxAngle is measured in radians. * is still performed; theMaxAngle is measured in radians.
* \return \c true in case of success, FALSE otherwise. * \return \c true in case of success, FALSE otherwise.
*/ */
boolean TriToQuad (in long_array IDsOfElements, boolean TriToQuad (in smIdType_array IDsOfElements,
in NumericalFunctor Criterion, in NumericalFunctor Criterion,
in double MaxAngle) raises (SALOME::SALOME_Exception); in double MaxAngle) raises (SALOME::SALOME_Exception);
/*! /*!
@ -355,7 +356,7 @@ module SMESH
* \param theCriterion Is used to choose a diagonal for splitting. * \param theCriterion Is used to choose a diagonal for splitting.
* \return TRUE in case of success, FALSE otherwise. * \return TRUE in case of success, FALSE otherwise.
*/ */
boolean QuadToTri (in long_array IDsOfElements, boolean QuadToTri (in smIdType_array IDsOfElements,
in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception); in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Split quadrangles into triangles. * \brief Split quadrangles into triangles.
@ -376,8 +377,8 @@ module SMESH
* \param the13Diag Is used to choose a diagonal for splitting. * \param the13Diag Is used to choose a diagonal for splitting.
* \return TRUE in case of success, FALSE otherwise. * \return TRUE in case of success, FALSE otherwise.
*/ */
boolean SplitQuad (in long_array IDsOfElements, boolean SplitQuad (in smIdType_array IDsOfElements,
in boolean Diag13) raises (SALOME::SALOME_Exception); in boolean Diag13) raises (SALOME::SALOME_Exception);
/*! /*!
* \brief Split quadrangles into triangles. * \brief Split quadrangles into triangles.
* *
@ -393,7 +394,7 @@ module SMESH
* \return 1 if 1-3 diagonal is better, 2 if 2-4 * \return 1 if 1-3 diagonal is better, 2 if 2-4
* diagonal is better, 0 if error occurs. * diagonal is better, 0 if error occurs.
*/ */
long BestSplit (in long IDOfQuad, long BestSplit (in long IDOfQuad,
in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception); in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
/*! /*!
@ -443,29 +444,29 @@ module SMESH
enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH }; enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
boolean Smooth(in long_array IDsOfElements, boolean Smooth(in smIdType_array IDsOfElements,
in long_array IDsOfFixedNodes, in smIdType_array IDsOfFixedNodes,
in long MaxNbOfIterations, in short MaxNbOfIterations,
in double MaxAspectRatio, in double MaxAspectRatio,
in Smooth_Method Method) raises (SALOME::SALOME_Exception); in Smooth_Method Method) raises (SALOME::SALOME_Exception);
boolean SmoothObject(in SMESH_IDSource theObject, boolean SmoothObject(in SMESH_IDSource theObject,
in long_array IDsOfFixedNodes, in smIdType_array IDsOfFixedNodes,
in long MaxNbOfIterations, in short MaxNbOfIterations,
in double MaxAspectRatio, in double MaxAspectRatio,
in Smooth_Method Method) raises (SALOME::SALOME_Exception); in Smooth_Method Method) raises (SALOME::SALOME_Exception);
boolean SmoothParametric(in long_array IDsOfElements, boolean SmoothParametric(in smIdType_array IDsOfElements,
in long_array IDsOfFixedNodes, in smIdType_array IDsOfFixedNodes,
in long MaxNbOfIterations, in short MaxNbOfIterations,
in double MaxAspectRatio, in double MaxAspectRatio,
in Smooth_Method Method) raises (SALOME::SALOME_Exception); in Smooth_Method Method) raises (SALOME::SALOME_Exception);
boolean SmoothParametricObject(in SMESH_IDSource theObject, boolean SmoothParametricObject(in SMESH_IDSource theObject,
in long_array IDsOfFixedNodes, in smIdType_array IDsOfFixedNodes,
in long MaxNbOfIterations, in short MaxNbOfIterations,
in double MaxAspectRatio, in double MaxAspectRatio,
in Smooth_Method Method) raises (SALOME::SALOME_Exception); in Smooth_Method Method) raises (SALOME::SALOME_Exception);
void ConvertToQuadratic(in boolean theForce3d) void ConvertToQuadratic(in boolean theForce3d)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
@ -561,12 +562,12 @@ module SMESH
* corresponding to groups the input elements included in. * corresponding to groups the input elements included in.
* \return ListOfGroups - new groups created if \a ToMakeGroups is true * \return ListOfGroups - new groups created if \a ToMakeGroups is true
*/ */
ListOfGroups AdvancedExtrusion(in long_array IDsOfElements, ListOfGroups AdvancedExtrusion(in smIdType_array IDsOfElements,
in DirStruct StepVector, in DirStruct StepVector,
in long NbOfSteps, in long NbOfSteps,
in long ExtrFlags, in long ExtrFlags,
in double SewTolerance, in double SewTolerance,
in boolean ToMakeGroups) in boolean ToMakeGroups)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
enum Extrusion_Error { enum Extrusion_Error {
@ -584,7 +585,7 @@ module SMESH
in ListOfIDSources Faces, in ListOfIDSources Faces,
in SMESH_IDSource Path, in SMESH_IDSource Path,
in GEOM::GEOM_Object PathShape, in GEOM::GEOM_Object PathShape,
in long NodeStart, in smIdType NodeStart,
in boolean HasAngles, in boolean HasAngles,
in double_array Angles, in double_array Angles,
in boolean AnglesVariation, in boolean AnglesVariation,
@ -610,20 +611,20 @@ module SMESH
enum MirrorType { POINT, AXIS, PLANE }; enum MirrorType { POINT, AXIS, PLANE };
void Mirror (in long_array IDsOfElements, void Mirror (in smIdType_array IDsOfElements,
in AxisStruct Mirror, in AxisStruct Mirror,
in MirrorType Type, in MirrorType Type,
in boolean Copy) in boolean Copy)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
ListOfGroups MirrorMakeGroups (in long_array IDsOfElements, ListOfGroups MirrorMakeGroups (in smIdType_array IDsOfElements,
in AxisStruct Mirror, in AxisStruct Mirror,
in MirrorType Type) in MirrorType Type)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements, SMESH_Mesh MirrorMakeMesh (in smIdType_array IDsOfElements,
in AxisStruct Mirror, in AxisStruct Mirror,
in MirrorType Type, in MirrorType Type,
in boolean CopyGroups, in boolean CopyGroups,
in string MeshName) in string MeshName)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void MirrorObject (in SMESH_IDSource theObject, void MirrorObject (in SMESH_IDSource theObject,
@ -642,17 +643,17 @@ module SMESH
in string MeshName) in string MeshName)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void Translate (in long_array IDsOfElements, void Translate (in smIdType_array IDsOfElements,
in DirStruct Vector, in DirStruct Vector,
in boolean Copy) in boolean Copy)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
ListOfGroups TranslateMakeGroups (in long_array IDsOfElements, ListOfGroups TranslateMakeGroups (in smIdType_array IDsOfElements,
in DirStruct Vector) in DirStruct Vector)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements, SMESH_Mesh TranslateMakeMesh (in smIdType_array IDsOfElements,
in DirStruct Vector, in DirStruct Vector,
in boolean CopyGroups, in boolean CopyGroups,
in string MeshName) in string MeshName)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void TranslateObject (in SMESH_IDSource theObject, void TranslateObject (in SMESH_IDSource theObject,
@ -684,20 +685,20 @@ module SMESH
in string MeshName) in string MeshName)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void Rotate (in long_array IDsOfElements, void Rotate (in smIdType_array IDsOfElements,
in AxisStruct Axis, in AxisStruct Axis,
in double AngleInRadians, in double AngleInRadians,
in boolean Copy) in boolean Copy)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
ListOfGroups RotateMakeGroups (in long_array IDsOfElements, ListOfGroups RotateMakeGroups (in smIdType_array IDsOfElements,
in AxisStruct Axis, in AxisStruct Axis,
in double AngleInRadians) in double AngleInRadians)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements, SMESH_Mesh RotateMakeMesh (in smIdType_array IDsOfElements,
in AxisStruct Axis, in AxisStruct Axis,
in double AngleInRadians, in double AngleInRadians,
in boolean CopyGroups, in boolean CopyGroups,
in string MeshName) in string MeshName)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
void RotateObject (in SMESH_IDSource theObject, void RotateObject (in SMESH_IDSource theObject,
@ -775,13 +776,13 @@ module SMESH
* If the given ID is a valid node ID (nodeID > 0), just move this node, else * If the given ID is a valid node ID (nodeID > 0), just move this node, else
* move the node closest to the point to point's location and return ID of the node * move the node closest to the point to point's location and return ID of the node
*/ */
long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID) smIdType MoveClosestNodeToPoint(in double x, in double y, in double z, in smIdType nodeID)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
* Return ID of node closest to a given point * Return ID of node closest to a given point
*/ */
long FindNodeClosestTo(in double x, in double y, in double z) smIdType FindNodeClosestTo(in double x, in double y, in double z)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -789,7 +790,7 @@ module SMESH
* *
* 'ALL' type means elements of any type excluding nodes and 0D elements * 'ALL' type means elements of any type excluding nodes and 0D elements
*/ */
long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type) smIdType_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -798,9 +799,9 @@ module SMESH
* *
* 'ALL' type means elements of any type excluding nodes and 0D elements * 'ALL' type means elements of any type excluding nodes and 0D elements
*/ */
long_array FindAmongElementsByPoint(in SMESH_IDSource elements, smIdType_array FindAmongElementsByPoint(in SMESH_IDSource elements,
in double x, in double y, in double z, in double x, in double y, in double z,
in ElementType type) in ElementType type)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -809,12 +810,12 @@ module SMESH
* and coordinates of the projection point. * and coordinates of the projection point.
* In the case if nothing found, return -1 and [] * In the case if nothing found, return -1 and []
*/ */
long ProjectPoint(in double x, smIdType ProjectPoint(in double x,
in double y, in double y,
in double z, in double z,
in ElementType type, in ElementType type,
in SMESH_IDSource meshObject, in SMESH_IDSource meshObject,
out double_array projecton) out double_array projecton)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -844,7 +845,7 @@ module SMESH
* If a group is closed, the first and last nodes of the group are same. * If a group is closed, the first and last nodes of the group are same.
*/ */
array_of_long_array Get1DBranches( in SMESH_IDSource edges, array_of_long_array Get1DBranches( in SMESH_IDSource edges,
in long startNode, in smIdType startNode,
out array_of_long_array nodeGroups) out array_of_long_array nodeGroups)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
@ -898,38 +899,38 @@ module SMESH
SEW_INTERNAL_ERROR SEW_INTERNAL_ERROR
}; };
Sew_Error SewFreeBorders (in long FirstNodeID1, Sew_Error SewFreeBorders (in smIdType FirstNodeID1,
in long SecondNodeID1, in smIdType SecondNodeID1,
in long LastNodeID1, in smIdType LastNodeID1,
in long FirstNodeID2, in smIdType FirstNodeID2,
in long SecondNodeID2, in smIdType SecondNodeID2,
in long LastNodeID2, in smIdType LastNodeID2,
in boolean CreatePolygons, in boolean CreatePolygons,
in boolean CreatePolyedrs) in boolean CreatePolyedrs)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
Sew_Error SewConformFreeBorders (in long FirstNodeID1, Sew_Error SewConformFreeBorders (in smIdType FirstNodeID1,
in long SecondNodeID1, in smIdType SecondNodeID1,
in long LastNodeID1, in smIdType LastNodeID1,
in long FirstNodeID2, in smIdType FirstNodeID2,
in long SecondNodeID2) in smIdType SecondNodeID2)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder, Sew_Error SewBorderToSide (in smIdType FirstNodeIDOnFreeBorder,
in long SecondNodeIDOnFreeBorder, in smIdType SecondNodeIDOnFreeBorder,
in long LastNodeIDOnFreeBorder, in smIdType LastNodeIDOnFreeBorder,
in long FirstNodeIDOnSide, in smIdType FirstNodeIDOnSide,
in long LastNodeIDOnSide, in smIdType LastNodeIDOnSide,
in boolean CreatePolygons, in boolean CreatePolygons,
in boolean CreatePolyedrs) in boolean CreatePolyedrs)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
Sew_Error SewSideElements (in long_array IDsOfSide1Elements, Sew_Error SewSideElements (in smIdType_array IDsOfSide1Elements,
in long_array IDsOfSide2Elements, in smIdType_array IDsOfSide2Elements,
in long NodeID1OfSide1ToMerge, in smIdType NodeID1OfSide1ToMerge,
in long NodeID1OfSide2ToMerge, in smIdType NodeID1OfSide2ToMerge,
in long NodeID2OfSide1ToMerge, in smIdType NodeID2OfSide1ToMerge,
in long NodeID2OfSide2ToMerge) in smIdType NodeID2OfSide2ToMerge)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -937,7 +938,7 @@ module SMESH
* If number of nodes is not corresponded to type of * If number of nodes is not corresponded to type of
* element - returns false * element - returns false
*/ */
boolean ChangeElemNodes(in long ide, in long_array newIDs) boolean ChangeElemNodes(in smIdType id, in smIdType_array newIDs)
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -965,7 +966,7 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise * \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups() * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
*/ */
boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems ) boolean DoubleNodes( in smIdType_array theNodes, in smIdType_array theModifiedElems )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -976,7 +977,7 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise * \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups() * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
*/ */
boolean DoubleNode( in long theNodeId, in long_array theModifiedElems ) boolean DoubleNode( in smIdType theNodeId, in smIdType_array theModifiedElems )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -1037,9 +1038,9 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise * \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroup(), DoubleNodeGroups() * \sa DoubleNodeGroup(), DoubleNodeGroups()
*/ */
boolean DoubleNodeElem( in long_array theElems, boolean DoubleNodeElem( in smIdType_array theElems,
in long_array theNodesNot, in smIdType_array theNodesNot,
in long_array theAffectedElems ) in smIdType_array theAffectedElems )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);
/*! /*!
@ -1053,8 +1054,8 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise * \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion() * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
*/ */
boolean DoubleNodeElemInRegion( in long_array theElems, boolean DoubleNodeElemInRegion( in smIdType_array theElems,
in long_array theNodesNot, in smIdType_array theNodesNot,
in GEOM::GEOM_Object theShape ) in GEOM::GEOM_Object theShape )
raises (SALOME::SALOME_Exception); raises (SALOME::SALOME_Exception);

View File

@ -29,6 +29,7 @@
#define _SMESH_PATTERN_IDL_ #define _SMESH_PATTERN_IDL_
#include "SMESH_Mesh.idl" #include "SMESH_Mesh.idl"
#include "SMESH_smIdType.idl"
module SMESH module SMESH
{ {
@ -85,10 +86,10 @@ module SMESH
* the loaded pattern to mesh faces. The first key-point * the loaded pattern to mesh faces. The first key-point
* will be mapped into <theNodeIndexOnKeyPoint1>-th node of each face * will be mapped into <theNodeIndexOnKeyPoint1>-th node of each face
*/ */
point_array ApplyToMeshFaces(in SMESH_Mesh theMesh, point_array ApplyToMeshFaces(in SMESH_Mesh theMesh,
in long_array theFacesIDs, in smIdType_array theFacesIDs,
in long theNodeIndexOnKeyPoint1, in short theNodeIndexOnKeyPoint1,
in boolean theReverse); in boolean theReverse);
/*! /*!
* Compute nodes coordinates applying * Compute nodes coordinates applying
@ -97,10 +98,10 @@ module SMESH
* The (0,0,1) key-point will be mapped into <theNode001Index>-th * The (0,0,1) key-point will be mapped into <theNode001Index>-th
* node of each volume. * node of each volume.
*/ */
point_array ApplyToHexahedrons(in SMESH_Mesh theMesh, point_array ApplyToHexahedrons(in SMESH_Mesh theMesh,
in long_array theVolumesIDs, in smIdType_array theVolumesIDs,
in long theNode000Index, in short theNode000Index,
in long theNode001Index); in short theNode001Index);
/*! /*!
* Create nodes and elements in <theMesh> using nodes * Create nodes and elements in <theMesh> using nodes

28
idl/SMESH_smIdType.idl.in Normal file
View File

@ -0,0 +1,28 @@
// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
//
// 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, or (at your option) any later version.
//
// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef __SMESH_SMIDTYPE_IDL__
#define __SMESH_SMIDTYPE_IDL__
module SMESH
{
typedef @SMESH_ID_TYPE@ smIdType;
};
#endif

View File

@ -34,6 +34,7 @@
#include "SMESHDS_Mesh.hxx" #include "SMESHDS_Mesh.hxx"
#include "SMESH_MeshAlgos.hxx" #include "SMESH_MeshAlgos.hxx"
#include "SMESH_OctreeNode.hxx" #include "SMESH_OctreeNode.hxx"
#include "SMESH_Comment.hxx"
#include <GEOMUtils.hxx> #include <GEOMUtils.hxx>
#include <Basics_Utils.hxx> #include <Basics_Utils.hxx>
@ -127,7 +128,7 @@ namespace {
return aDist; return aDist;
} }
int getNbMultiConnection( const SMDS_Mesh* theMesh, const int theId ) int getNbMultiConnection( const SMDS_Mesh* theMesh, const smIdType theId )
{ {
if ( theMesh == 0 ) if ( theMesh == 0 )
return 0; return 0;
@ -225,7 +226,7 @@ void NumericalFunctor::SetMesh( const SMDS_Mesh* theMesh )
myMesh = theMesh; myMesh = theMesh;
} }
bool NumericalFunctor::GetPoints(const int theId, bool NumericalFunctor::GetPoints(const smIdType theId,
TSequenceOfXYZ& theRes ) const TSequenceOfXYZ& theRes ) const
{ {
theRes.clear(); theRes.clear();
@ -322,12 +323,12 @@ bool NumericalFunctor::IsApplicable( long theElementId ) const
*/ */
//================================================================================ //================================================================================
void NumericalFunctor::GetHistogram(int nbIntervals, void NumericalFunctor::GetHistogram(int nbIntervals,
std::vector<int>& nbEvents, std::vector<int>& nbEvents,
std::vector<double>& funValues, std::vector<double>& funValues,
const std::vector<int>& elements, const std::vector<smIdType>& elements,
const double* minmax, const double* minmax,
const bool isLogarithmic) const bool isLogarithmic)
{ {
if ( nbIntervals < 1 || if ( nbIntervals < 1 ||
!myMesh || !myMesh ||
@ -346,7 +347,7 @@ void NumericalFunctor::GetHistogram(int nbIntervals,
} }
else else
{ {
std::vector<int>::const_iterator id = elements.begin(); std::vector<smIdType>::const_iterator id = elements.begin();
for ( ; id != elements.end(); ++id ) for ( ; id != elements.end(); ++id )
values.insert( GetValue( *id )); values.insert( GetValue( *id ));
} }
@ -1971,7 +1972,7 @@ void Length2D::GetValues(TValues& theValues)
{ {
// use special nodes iterator // use special nodes iterator
SMDS_NodeIteratorPtr anIter = anElem->interlacedNodesIterator(); SMDS_NodeIteratorPtr anIter = anElem->interlacedNodesIterator();
long aNodeId[4] = { 0,0,0,0 }; smIdType aNodeId[4] = { 0,0,0,0 };
gp_Pnt P[4]; gp_Pnt P[4];
double aLength = 0; double aLength = 0;
@ -2008,7 +2009,7 @@ void Length2D::GetValues(TValues& theValues)
} }
else { else {
SMDS_NodeIteratorPtr aNodesIter = anElem->nodeIterator(); SMDS_NodeIteratorPtr aNodesIter = anElem->nodeIterator();
long aNodeId[2] = {0,0}; smIdType aNodeId[2] = {0,0};
gp_Pnt P[3]; gp_Pnt P[3];
double aLength; double aLength;
@ -2023,7 +2024,7 @@ void Length2D::GetValues(TValues& theValues)
for( ; aNodesIter->more(); ) for( ; aNodesIter->more(); )
{ {
aNode = aNodesIter->next(); aNode = aNodesIter->next();
long anId = aNode->GetID(); smIdType anId = aNode->GetID();
P[2] = SMESH_NodeXYZ( aNode ); P[2] = SMESH_NodeXYZ( aNode );
@ -2192,7 +2193,7 @@ double MultiConnection2D::GetValue( long theElementId )
if (!anIter) break; if (!anIter) break;
const SMDS_MeshNode *aNode, *aNode0 = 0; const SMDS_MeshNode *aNode, *aNode0 = 0;
TColStd_MapOfInteger aMap, aMapPrev; NCollection_Map< smIdType, smIdHasher > aMap, aMapPrev;
for (i = 0; i <= len; i++) { for (i = 0; i <= len; i++) {
aMapPrev = aMap; aMapPrev = aMap;
@ -2214,7 +2215,7 @@ double MultiConnection2D::GetValue( long theElementId )
while (anElemIter->more()) { while (anElemIter->more()) {
const SMDS_MeshElement* anElem = anElemIter->next(); const SMDS_MeshElement* anElem = anElemIter->next();
if (anElem != 0 && anElem->GetType() == SMDSAbs_Face) { if (anElem != 0 && anElem->GetType() == SMDSAbs_Face) {
int anId = anElem->GetID(); smIdType anId = anElem->GetID();
aMap.Add(anId); aMap.Add(anId);
if (aMapPrev.Contains(anId)) { if (aMapPrev.Contains(anId)) {
@ -2675,14 +2676,14 @@ void FreeEdges::SetMesh( const SMDS_Mesh* theMesh )
myMesh = theMesh; myMesh = theMesh;
} }
bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId ) bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId )
{ {
SMDS_ElemIteratorPtr anElemIter = theNodes[ 0 ]->GetInverseElementIterator(SMDSAbs_Face); SMDS_ElemIteratorPtr anElemIter = theNodes[ 0 ]->GetInverseElementIterator(SMDSAbs_Face);
while( anElemIter->more() ) while( anElemIter->more() )
{ {
if ( const SMDS_MeshElement* anElem = anElemIter->next()) if ( const SMDS_MeshElement* anElem = anElemIter->next())
{ {
const int anId = anElem->GetID(); const smIdType anId = anElem->GetID();
if ( anId != theFaceId && anElem->GetNodeIndex( theNodes[1] ) >= 0 ) if ( anId != theFaceId && anElem->GetNodeIndex( theNodes[1] ) >= 0 )
return false; return false;
} }
@ -2967,8 +2968,8 @@ void GroupColor::SetMesh( const SMDS_Mesh* theMesh )
SMDSAbs_ElementType aGrpElType = (SMDSAbs_ElementType)aGrp->GetType(); SMDSAbs_ElementType aGrpElType = (SMDSAbs_ElementType)aGrp->GetType();
if ( myType == aGrpElType || (myType == SMDSAbs_All && aGrpElType != SMDSAbs_Node) ) { if ( myType == aGrpElType || (myType == SMDSAbs_All && aGrpElType != SMDSAbs_Node) ) {
// add elements IDS into control // add elements IDS into control
int aSize = aGrp->Extent(); smIdType aSize = aGrp->Extent();
for (int i = 0; i < aSize; i++) for (smIdType i = 0; i < aSize; i++)
myIDs.insert( aGrp->GetID(i+1) ); myIDs.insert( aGrp->GetID(i+1) );
} }
} }
@ -3119,7 +3120,7 @@ ConnectedElements::ConnectedElements():
SMDSAbs_ElementType ConnectedElements::GetType() const SMDSAbs_ElementType ConnectedElements::GetType() const
{ return myType; } { return myType; }
int ConnectedElements::GetNode() const smIdType ConnectedElements::GetNode() const
{ return myXYZ.empty() ? myNodeID : 0; } // myNodeID can be found by myXYZ { return myXYZ.empty() ? myNodeID : 0; } // myNodeID can be found by myXYZ
std::vector<double> ConnectedElements::GetPoint() const std::vector<double> ConnectedElements::GetPoint() const
@ -3146,7 +3147,7 @@ void ConnectedElements::SetMesh( const SMDS_Mesh* theMesh )
} }
} }
void ConnectedElements::SetNode( int nodeID ) void ConnectedElements::SetNode( smIdType nodeID )
{ {
myNodeID = nodeID; myNodeID = nodeID;
myXYZ.clear(); myXYZ.clear();
@ -3206,7 +3207,7 @@ bool ConnectedElements::IsSatisfy( long theElementId )
return false; return false;
std::list< const SMDS_MeshNode* > nodeQueue( 1, node0 ); std::list< const SMDS_MeshNode* > nodeQueue( 1, node0 );
std::set< int > checkedNodeIDs; std::set< smIdType > checkedNodeIDs;
// algo: // algo:
// foreach node in nodeQueue: // foreach node in nodeQueue:
// foreach element sharing a node: // foreach element sharing a node:
@ -3231,7 +3232,7 @@ bool ConnectedElements::IsSatisfy( long theElementId )
while ( nIt->more() ) while ( nIt->more() )
{ {
const SMDS_MeshNode* n = static_cast< const SMDS_MeshNode* >( nIt->next() ); const SMDS_MeshNode* n = static_cast< const SMDS_MeshNode* >( nIt->next() );
if ( checkedNodeIDs.insert( n->GetID() ).second ) if ( checkedNodeIDs.insert( n->GetID()).second )
nodeQueue.push_back( n ); nodeQueue.push_back( n );
} }
} }
@ -3378,56 +3379,56 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr )
{ {
theResStr.Clear(); theResStr.Clear();
TColStd_SequenceOfInteger anIntSeq; TIDsSeq anIntSeq;
TColStd_SequenceOfAsciiString aStrSeq; NCollection_Sequence< std::string > aStrSeq;
TColStd_MapIteratorOfMapOfInteger anIter( myIds ); TIDsMap::Iterator anIter( myIds );
for ( ; anIter.More(); anIter.Next() ) for ( ; anIter.More(); anIter.Next() )
{ {
int anId = anIter.Key(); smIdType anId = anIter.Key();
TCollection_AsciiString aStr( anId ); SMESH_Comment aStr( anId );
anIntSeq.Append( anId ); anIntSeq.Append( anId );
aStrSeq.Append( aStr ); aStrSeq.Append( aStr );
} }
for ( int i = 1, n = myMin.Length(); i <= n; i++ ) for ( smIdType i = 1, n = myMin.size(); i <= n; i++ )
{ {
int aMinId = myMin( i ); smIdType aMinId = myMin[i];
int aMaxId = myMax( i ); smIdType aMaxId = myMax[i];
TCollection_AsciiString aStr; SMESH_Comment aStr;
if ( aMinId != IntegerFirst() ) if ( aMinId != IntegerFirst() )
aStr += aMinId; aStr << aMinId;
aStr += "-"; aStr << "-";
if ( aMaxId != IntegerLast() ) if ( aMaxId != std::numeric_limits<smIdType>::max() )
aStr += aMaxId; aStr << aMaxId;
// find position of the string in result sequence and insert string in it // find position of the string in result sequence and insert string in it
if ( anIntSeq.Length() == 0 ) if ( anIntSeq.Length() == 0 )
{ {
anIntSeq.Append( aMinId ); anIntSeq.Append( aMinId );
aStrSeq.Append( aStr ); aStrSeq.Append( (const char*)aStr );
} }
else else
{ {
if ( aMinId < anIntSeq.First() ) if ( aMinId < anIntSeq.First() )
{ {
anIntSeq.Prepend( aMinId ); anIntSeq.Prepend( aMinId );
aStrSeq.Prepend( aStr ); aStrSeq.Prepend( (const char*)aStr );
} }
else if ( aMinId > anIntSeq.Last() ) else if ( aMinId > anIntSeq.Last() )
{ {
anIntSeq.Append( aMinId ); anIntSeq.Append( aMinId );
aStrSeq.Append( aStr ); aStrSeq.Append( (const char*)aStr );
} }
else else
for ( int j = 1, k = anIntSeq.Length(); j <= k; j++ ) for ( int j = 1, k = anIntSeq.Length(); j <= k; j++ )
if ( aMinId < anIntSeq( j ) ) if ( aMinId < anIntSeq( j ) )
{ {
anIntSeq.InsertBefore( j, aMinId ); anIntSeq.InsertBefore( j, aMinId );
aStrSeq.InsertBefore( j, aStr ); aStrSeq.InsertBefore( j, (const char*)aStr );
break; break;
} }
} }
@ -3435,13 +3436,14 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr )
if ( aStrSeq.Length() == 0 ) if ( aStrSeq.Length() == 0 )
return; return;
std::string aResStr;
theResStr = aStrSeq( 1 ); aResStr = aStrSeq( 1 );
for ( int j = 2, k = aStrSeq.Length(); j <= k; j++ ) for ( int j = 2, k = aStrSeq.Length(); j <= k; j++ )
{ {
theResStr += ","; aResStr += ",";
theResStr += aStrSeq( j ); aResStr += aStrSeq( j );
} }
theResStr = aResStr.c_str();
} }
//======================================================================= //=======================================================================
@ -3451,8 +3453,8 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr )
//======================================================================= //=======================================================================
bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr ) bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr )
{ {
myMin.Clear(); myMin.clear();
myMax.Clear(); myMax.clear();
myIds.Clear(); myIds.Clear();
TCollection_AsciiString aStr = theStr; TCollection_AsciiString aStr = theStr;
@ -3490,8 +3492,8 @@ bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr )
(!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue()) ) (!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue()) )
return false; return false;
myMin.Append( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() ); myMin.push_back( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() );
myMax.Append( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() ); myMax.push_back( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() );
} }
} }
@ -3540,8 +3542,8 @@ bool RangeOfIds::IsSatisfy( long theId )
if ( myIds.Contains( theId ) ) if ( myIds.Contains( theId ) )
return true; return true;
for ( int i = 1, n = myMin.Length(); i <= n; i++ ) for ( size_t i = 0; i < myMin.size(); i++ )
if ( theId >= myMin( i ) && theId <= myMax( i ) ) if ( theId >= myMin[i] && theId <= myMax[i] )
return true; return true;
return false; return false;
@ -3917,7 +3919,7 @@ bool ManifoldPart::process()
// the map of non manifold links and bad geometry // the map of non manifold links and bad geometry
TMapOfLink aMapOfNonManifold; TMapOfLink aMapOfNonManifold;
TColStd_MapOfInteger aMapOfTreated; TIDsMap aMapOfTreated;
// begin cycle on faces from start index and run on vector till the end // begin cycle on faces from start index and run on vector till the end
// and from begin to start index to cover whole vector // and from begin to start index to cover whole vector
@ -3930,18 +3932,18 @@ bool ManifoldPart::process()
// as result next time when fi will be equal to aStartIndx // as result next time when fi will be equal to aStartIndx
SMDS_MeshFace* aFacePtr = myAllFacePtr[ fi ]; SMDS_MeshFace* aFacePtr = myAllFacePtr[ fi ];
if ( aMapOfTreated.Contains( aFacePtr->GetID() ) ) if ( aMapOfTreated.Contains( aFacePtr->GetID()) )
continue; continue;
aMapOfTreated.Add( aFacePtr->GetID() ); aMapOfTreated.Add( aFacePtr->GetID() );
TColStd_MapOfInteger aResFaces; TIDsMap aResFaces;
if ( !findConnected( myAllFacePtrIntDMap, aFacePtr, if ( !findConnected( myAllFacePtrIntDMap, aFacePtr,
aMapOfNonManifold, aResFaces ) ) aMapOfNonManifold, aResFaces ) )
continue; continue;
TColStd_MapIteratorOfMapOfInteger anItr( aResFaces ); TIDsMap::Iterator anItr( aResFaces );
for ( ; anItr.More(); anItr.Next() ) for ( ; anItr.More(); anItr.Next() )
{ {
int aFaceId = anItr.Key(); smIdType aFaceId = anItr.Key();
aMapOfTreated.Add( aFaceId ); aMapOfTreated.Add( aFaceId );
myMapIds.Add( aFaceId ); myMapIds.Add( aFaceId );
} }
@ -3977,7 +3979,7 @@ bool ManifoldPart::findConnected
( const ManifoldPart::TDataMapFacePtrInt& theAllFacePtrInt, ( const ManifoldPart::TDataMapFacePtrInt& theAllFacePtrInt,
SMDS_MeshFace* theStartFace, SMDS_MeshFace* theStartFace,
ManifoldPart::TMapOfLink& theNonManifold, ManifoldPart::TMapOfLink& theNonManifold,
TColStd_MapOfInteger& theResFaces ) TIDsMap& theResFaces )
{ {
theResFaces.Clear(); theResFaces.Clear();
if ( !theAllFacePtrInt.size() ) if ( !theAllFacePtrInt.size() )
@ -4045,7 +4047,7 @@ bool ManifoldPart::findConnected
SMDS_MeshFace* aNextFace = *pFace; SMDS_MeshFace* aNextFace = *pFace;
if ( aPrevFace == aNextFace ) if ( aPrevFace == aNextFace )
continue; continue;
int anNextFaceID = aNextFace->GetID(); smIdType anNextFaceID = aNextFace->GetID();
if ( myIsOnlyManifold && theResFaces.Contains( anNextFaceID ) ) if ( myIsOnlyManifold && theResFaces.Contains( anNextFaceID ) )
// should not be with non manifold restriction. probably bad topology // should not be with non manifold restriction. probably bad topology
continue; continue;
@ -4276,7 +4278,9 @@ void ElementsOnSurface::process()
if ( !myMeshModifTracer.GetMesh() ) if ( !myMeshModifTracer.GetMesh() )
return; return;
myIds.ReSize( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType )); int nbElems = FromSmIdType<int>( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ));
if ( nbElems > 0 )
myIds.ReSize( nbElems );
SMDS_ElemIteratorPtr anIter = myMeshModifTracer.GetMesh()->elementsIterator( myType ); SMDS_ElemIteratorPtr anIter = myMeshModifTracer.GetMesh()->elementsIterator( myType );
for(; anIter->more(); ) for(; anIter->more(); )

View File

@ -32,8 +32,8 @@
#include <GeomAPI_ProjectPointOnSurf.hxx> #include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Quantity_Color.hxx> #include <Quantity_Color.hxx>
#include <TColStd_MapOfInteger.hxx> #include <TColStd_MapOfInteger.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <NCollection_Map.hxx>
#include <TopAbs.hxx> #include <TopAbs.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
@ -58,6 +58,9 @@ class ShapeAnalysis_Surface;
class gp_Pln; class gp_Pln;
class gp_Pnt; class gp_Pnt;
typedef NCollection_Map< smIdType, smIdHasher > TIDsMap;
typedef NCollection_Sequence<smIdType> TIDsSeq;
namespace SMESH{ namespace SMESH{
namespace Controls{ namespace Controls{
@ -130,12 +133,12 @@ namespace SMESH{
virtual void SetMesh( const SMDS_Mesh* theMesh ); virtual void SetMesh( const SMDS_Mesh* theMesh );
virtual double GetValue( long theElementId ); virtual double GetValue( long theElementId );
virtual double GetValue(const TSequenceOfXYZ& /*thePoints*/) { return -1.0;}; virtual double GetValue(const TSequenceOfXYZ& /*thePoints*/) { return -1.0;};
void GetHistogram(int nbIntervals, void GetHistogram(int nbIntervals,
std::vector<int>& nbEvents, std::vector<int>& nbEvents,
std::vector<double>& funValues, std::vector<double>& funValues,
const std::vector<int>& elements, const std::vector<smIdType>& elements,
const double* minmax=0, const double* minmax=0,
const bool isLogarithmic = false); const bool isLogarithmic = false);
bool IsApplicable( long theElementId ) const; bool IsApplicable( long theElementId ) const;
virtual bool IsApplicable( const SMDS_MeshElement* element ) const; virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
virtual SMDSAbs_ElementType GetType() const = 0; virtual SMDSAbs_ElementType GetType() const = 0;
@ -144,7 +147,7 @@ namespace SMESH{
void SetPrecision( const long thePrecision ); void SetPrecision( const long thePrecision );
double Round( const double & value ); double Round( const double & value );
bool GetPoints(const int theId, TSequenceOfXYZ& theRes) const; bool GetPoints(const smIdType theId, TSequenceOfXYZ& theRes) const;
static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes); static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes);
protected: protected:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
@ -423,9 +426,9 @@ namespace SMESH{
double GetTolerance () const { return myToler; } double GetTolerance () const { return myToler; }
private: private:
double myToler; double myToler;
TColStd_MapOfInteger myCoincidentIDs; TIDsMap myCoincidentIDs;
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
}; };
typedef boost::shared_ptr<CoincidentNodes> CoincidentNodesPtr; typedef boost::shared_ptr<CoincidentNodes> CoincidentNodesPtr;
@ -591,7 +594,7 @@ namespace SMESH{
virtual void SetMesh( const SMDS_Mesh* theMesh ); virtual void SetMesh( const SMDS_Mesh* theMesh );
virtual bool IsSatisfy( long theElementId ); virtual bool IsSatisfy( long theElementId );
virtual SMDSAbs_ElementType GetType() const; virtual SMDSAbs_ElementType GetType() const;
static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId ); static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId );
typedef long TElemId; typedef long TElemId;
struct Border{ struct Border{
TElemId myElemId; TElemId myElemId;
@ -650,9 +653,9 @@ namespace SMESH{
protected: protected:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
TColStd_SequenceOfInteger myMin; std::vector< smIdType > myMin;
TColStd_SequenceOfInteger myMax; std::vector< smIdType > myMax;
TColStd_MapOfInteger myIds; TIDsMap myIds;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
}; };
@ -833,7 +836,7 @@ namespace SMESH{
bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt, bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
SMDS_MeshFace* theStartFace, SMDS_MeshFace* theStartFace,
TMapOfLink& theNonManifold, TMapOfLink& theNonManifold,
TColStd_MapOfInteger& theResFaces ); TIDsMap& theResFaces );
bool isInPlane( const SMDS_MeshFace* theFace1, bool isInPlane( const SMDS_MeshFace* theFace1,
const SMDS_MeshFace* theFace2 ); const SMDS_MeshFace* theFace2 );
void expandBoundary( TMapOfLink& theMapOfBoundary, void expandBoundary( TMapOfLink& theMapOfBoundary,
@ -847,8 +850,8 @@ namespace SMESH{
private: private:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
TColStd_MapOfInteger myMapIds; TIDsMap myMapIds;
TColStd_MapOfInteger myMapBadGeomIds; TIDsMap myMapBadGeomIds;
TVectorOfFacePtr myAllFacePtr; TVectorOfFacePtr myAllFacePtr;
TDataMapFacePtrInt myAllFacePtrIntDMap; TDataMapFacePtrInt myAllFacePtrIntDMap;
double myAngToler; double myAngToler;
@ -909,7 +912,7 @@ namespace SMESH{
private: private:
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
TColStd_MapOfInteger myIds; TIDsMap myIds;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
TopoDS_Face mySurf; TopoDS_Face mySurf;
double myToler; double myToler;
@ -1149,7 +1152,7 @@ namespace SMESH{
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
long myFaceID; long myFaceID;
double myToler; double myToler;
TColStd_MapOfInteger myCoplanarIDs; TIDsMap myCoplanarIDs;
}; };
typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr; typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
@ -1162,9 +1165,9 @@ namespace SMESH{
public: public:
ConnectedElements(); ConnectedElements();
//virtual Predicate* clone() const { return new ConnectedElements( *this ); } //virtual Predicate* clone() const { return new ConnectedElements( *this ); }
void SetNode( int nodeID ); void SetNode( smIdType nodeID );
void SetPoint( double x, double y, double z ); void SetPoint( double x, double y, double z );
int GetNode() const; smIdType GetNode() const;
std::vector<double> GetPoint() const; std::vector<double> GetPoint() const;
void SetType( SMDSAbs_ElementType theType ); void SetType( SMDSAbs_ElementType theType );
@ -1176,14 +1179,14 @@ namespace SMESH{
//const std::set<long>& GetDomainIDs() const { return myOkIDs; } //const std::set<long>& GetDomainIDs() const { return myOkIDs; }
private: private:
int myNodeID; smIdType myNodeID;
std::vector<double> myXYZ; std::vector<double> myXYZ;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
void clearOkIDs(); void clearOkIDs();
bool myOkIDsReady; bool myOkIDsReady;
std::set< int > myOkIDs; // empty means that there is one domain std::set<smIdType> myOkIDs; // empty means that there is one domain
}; };
typedef boost::shared_ptr<ConnectedElements> ConnectedElementsPtr; typedef boost::shared_ptr<ConnectedElements> ConnectedElementsPtr;

View File

@ -28,6 +28,7 @@
#define _INCLUDE_DRIVER_MESH #define _INCLUDE_DRIVER_MESH
#include "SMESH_ComputeError.hxx" #include "SMESH_ComputeError.hxx"
#include "SMDS_Mesh.hxx"
#include <string> #include <string>
#include <vector> #include <vector>
@ -50,12 +51,13 @@ class MESHDRIVER_EXPORT Driver_Mesh
enum Status { enum Status {
DRS_OK, DRS_OK,
DRS_EMPTY, // a file contains no mesh with the given name DRS_EMPTY, // a file contains no mesh with the given name
DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers, DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers,
// so the numbers from the file are ignored // so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
DRS_FAIL // general failure (exception etc.) DRS_FAIL, // general failure (exception etc.)
DRS_TOO_LARGE_MESH // mesh is too large for export
}; };
void SetMeshId(int theMeshId); void SetMeshId(int theMeshId);
@ -70,6 +72,22 @@ class MESHDRIVER_EXPORT Driver_Mesh
virtual SMESH_ComputeErrorPtr GetError(); virtual SMESH_ComputeErrorPtr GetError();
//virtual bool CanExportMesh() const { return false; } //= 0;
// check if a mesh is too large to export it using IDTYPE;
// check either max ID or number of elements
template< typename IDTYPE >
static bool IsMeshTooLarge( const SMDS_Mesh* mesh, bool checkIDs )
{
if ( sizeof( IDTYPE ) < sizeof( smIdType ))
{
const smIdType maxNB = std::numeric_limits< IDTYPE >::max();
return (( checkIDs ? mesh->MaxNodeID() : mesh->NbNodes() ) > maxNB ||
( checkIDs ? mesh->MaxElementID() : mesh->NbElements() > maxNB ));
}
return false;
}
protected: protected:
std::string myFile; std::string myFile;
std::string myMeshName; std::string myMeshName;

View File

@ -33,6 +33,8 @@
#include "SMESH_Comment.hxx" #include "SMESH_Comment.hxx"
#include "SMESH_TypeDefs.hxx" #include "SMESH_TypeDefs.hxx"
#include <smIdType.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <cgnslib.h> #include <cgnslib.h>
@ -59,9 +61,9 @@ namespace
struct TZoneData struct TZoneData
{ {
int _id; int _id;
int _nodeIdShift; // nb nodes in previously read zones smIdType _nodeIdShift; // nb nodes in previously read zones
int _elemIdShift; // nb faces in previously read zones smIdType _elemIdShift; // nb faces in previously read zones
int _nbNodes, _nbElems; smIdType _nbNodes, _nbElems;
int _meshDim; int _meshDim;
int _sizeX, _sizeY, _sizeZ, _nbCells; // structured int _sizeX, _sizeY, _sizeZ, _nbCells; // structured
cgsize_t _sizes[NB_ZONE_SIZE_VAL]; cgsize_t _sizes[NB_ZONE_SIZE_VAL];
@ -550,10 +552,10 @@ namespace
nbNodes = ids[0]; nbNodes = ids[0];
++ids; ++ids;
#endif #endif
vector<int> idVec( nbNodes ); vector<smIdType> idVec( nbNodes );
for ( int i = 0; i < nbNodes; ++i ) for ( int i = 0; i < nbNodes; ++i )
idVec[ i ] = (int) ids[ i ]; idVec[ i ] = ToSmIdType( ids[ i ]);
return mesh->AddPolygonalFaceWithID( idVec, ID ); return mesh->AddPolygonalFaceWithID( idVec, ToSmIdType(ID) );
} }
typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID); typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID);
@ -890,6 +892,8 @@ Driver_Mesh::Status DriverCGNS_Read::Perform()
curAddElemFun = addElemFuns[ elemType ]; curAddElemFun = addElemFuns[ elemType ];
SMDS_MeshElement* newElem = 0; SMDS_MeshElement* newElem = 0;
const SMDS_MeshElement* face; const SMDS_MeshElement* face;
vector<int> quantities;
vector<const SMDS_MeshNode*> nodes, faceNodes;
while ( pos < eDataSize ) while ( pos < eDataSize )
{ {
@ -921,9 +925,8 @@ Driver_Mesh::Status DriverCGNS_Read::Perform()
// Face1M, Face2M, ... FaceNM // Face1M, Face2M, ... FaceNM
nbFaces = polyOffset[ iElem + 1 ] - polyOffset[ iElem ]; nbFaces = polyOffset[ iElem + 1 ] - polyOffset[ iElem ];
vector<int> quantities( nbFaces ); quantities.resize( nbFaces ); quantities.back() = 0;
vector<const SMDS_MeshNode*> nodes, faceNodes; nodes.clear(); nodes.reserve( nbFaces * 4 );
nodes.reserve( nbFaces * 4 );
for ( int iF = 0; iF < nbFaces; ++iF ) for ( int iF = 0; iF < nbFaces; ++iF )
{ {
const int faceID = std::abs( elemData[ pos++ ]) + zone._elemIdShift; const int faceID = std::abs( elemData[ pos++ ]) + zone._elemIdShift;
@ -945,6 +948,7 @@ Driver_Mesh::Status DriverCGNS_Read::Perform()
} }
else { else {
polyhedError = true; polyhedError = true;
pos += nbFaces - iF - 1;
break; break;
} }
} }
@ -1172,7 +1176,7 @@ Driver_Mesh::Status DriverCGNS_Read::Perform()
case 2: addElemFun = & add_QUAD_4; break; case 2: addElemFun = & add_QUAD_4; break;
case 3: addElemFun = & add_HEXA_8; break; case 3: addElemFun = & add_HEXA_8; break;
} }
int elemID = meshInfo.NbElements(); smIdType elemID = meshInfo.NbElements();
const SMDS_MeshElement* elem = 0; const SMDS_MeshElement* elem = 0;
for ( size_t i = 0; i < ids.size(); i += nbElemNodes ) for ( size_t i = 0; i < ids.size(); i += nbElemNodes )
{ {

View File

@ -201,17 +201,17 @@ namespace
*/ */
struct TPolyhedFace struct TPolyhedFace
{ {
int _id; // id of NGON_n smIdType _id; // id of NGON_n
vector< int > _nodes; // lowest node IDs used for sorting vector< smIdType > _nodes; // lowest node IDs used for sorting
TPolyhedFace( const SMDS_MeshNode** nodes, const int nbNodes, int ID):_id(ID) TPolyhedFace( const SMDS_MeshNode** nodes, const smIdType nbNodes, smIdType ID):_id(ID)
{ {
set< int > ids; set< smIdType > ids;
for ( int i = 0; i < nbNodes; ++i ) for ( smIdType i = 0; i < nbNodes; ++i )
ids.insert( nodes[i]->GetID() ); ids.insert( nodes[i]->GetID() );
_nodes.resize( 3 ); // std::min( nbNodes, 4 )); hope 3 nodes is enough _nodes.resize( 3 ); // std::min( nbNodes, 4 )); hope 3 nodes is enough
set< int >::iterator idIt = ids.begin(); set< smIdType >::iterator idIt = ids.begin();
for ( size_t j = 0; j < _nodes.size(); ++j, ++idIt ) for ( size_t j = 0; j < _nodes.size(); ++j, ++idIt )
_nodes[j] = *idIt; _nodes[j] = *idIt;
} }
@ -267,6 +267,9 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
if ( !myMesh || myMesh->GetMeshInfo().NbElements() < 1 ) if ( !myMesh || myMesh->GetMeshInfo().NbElements() < 1 )
return addMessage( !myMesh ? "NULL mesh" : "Empty mesh (no elements)", /*fatal = */true ); return addMessage( !myMesh ? "NULL mesh" : "Empty mesh (no elements)", /*fatal = */true );
if ( Driver_Mesh::IsMeshTooLarge< cgsize_t >( myMesh, /*checkIDs =*/ false))
return DRS_TOO_LARGE_MESH;
// open the file // open the file
if ( cg_open(myFile.c_str(), CG_MODE_MODIFY, &_fn) != CG_OK && if ( cg_open(myFile.c_str(), CG_MODE_MODIFY, &_fn) != CG_OK &&
cg_open(myFile.c_str(), CG_MODE_WRITE, &_fn) != CG_OK ) cg_open(myFile.c_str(), CG_MODE_WRITE, &_fn) != CG_OK )
@ -295,13 +298,15 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
// create a Zone // create a Zone
// -------------- // --------------
int nbCells = myMesh->NbEdges(); smIdType nbCells = myMesh->NbEdges();
if ( meshDim == 3 ) if ( meshDim == 3 )
nbCells = myMesh->NbVolumes(); nbCells = myMesh->NbVolumes();
else if ( meshDim == 2 ) else if ( meshDim == 2 )
nbCells = myMesh->NbFaces(); nbCells = myMesh->NbFaces();
cgsize_t size[9] = { myMesh->NbNodes(), nbCells, /*NBoundVertex=*/0, 0,0,0,0,0,0 }; cgsize_t size[9] = { FromSmIdType<cgsize_t>( myMesh->NbNodes() ),
FromSmIdType<cgsize_t>( nbCells ),
/*NBoundVertex=*/0, 0,0,0,0,0,0 };
int iZone; int iZone;
if ( cg_zone_write( _fn, iBase, "SMESH_Mesh", size, if ( cg_zone_write( _fn, iBase, "SMESH_Mesh", size,
CGNS_ENUMV( Unstructured ), &iZone) != CG_OK ) CGNS_ENUMV( Unstructured ), &iZone) != CG_OK )
@ -469,7 +474,7 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
cgID-1, /*nbndry=*/0, elemData.data(), &iSec) != CG_OK ) cgID-1, /*nbndry=*/0, elemData.data(), &iSec) != CG_OK )
return addMessage( cg_get_error(), /*fatal = */true ); return addMessage( cg_get_error(), /*fatal = */true );
} }
} } // while ( elem )
// Write polyhedral volumes // Write polyhedral volumes
// ------------------------- // -------------------------

View File

@ -76,7 +76,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint); myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint);
} }
fprintf(stdout, "%d noeuds\n", myMesh->NbNodes()); fprintf(stdout, "%ld noeuds\n", myMesh->NbNodes());
/**************************************************************************** /****************************************************************************
* LECTURE DES ELEMENTS * * LECTURE DES ELEMENTS *
****************************************************************************/ ****************************************************************************/

View File

@ -37,7 +37,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
Kernel_Utils::Localizer loc; Kernel_Utils::Localizer loc;
Status aResult = DRS_OK; Status aResult = DRS_OK;
int nbNodes, nbCells; smIdType nbNodes, nbCells;
#if defined(WIN32) && defined(UNICODE) #if defined(WIN32) && defined(UNICODE)
std::wstring file2Read = Kernel_Utils::utf8_decode_s(myFile); std::wstring file2Read = Kernel_Utils::utf8_decode_s(myFile);
FILE* aFileId = _wfopen(file2Read.c_str(), L"w+"); FILE* aFileId = _wfopen(file2Read.c_str(), L"w+");
@ -60,7 +60,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
nbNodes = myMesh->NbNodes(); nbNodes = myMesh->NbNodes();
/* Combien de mailles, faces ou aretes ? */ /* Combien de mailles, faces ou aretes ? */
int nb_of_edges, nb_of_faces, nb_of_volumes; smIdType nb_of_edges, nb_of_faces, nb_of_volumes;
nb_of_edges = myMesh->NbEdges(); nb_of_edges = myMesh->NbEdges();
nb_of_faces = myMesh->NbFaces(); nb_of_faces = myMesh->NbFaces();
nb_of_volumes = myMesh->NbVolumes(); nb_of_volumes = myMesh->NbVolumes();
@ -70,7 +70,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
SCRUTE(nb_of_volumes); SCRUTE(nb_of_volumes);
//fprintf(stdout, "%d %d\n", nbNodes, nbCells); //fprintf(stdout, "%d %d\n", nbNodes, nbCells);
fprintf(aFileId, "%d %d\n", nbNodes, nbCells); fprintf(aFileId, "%ld %ld\n", nbNodes, nbCells);
/**************************************************************************** /****************************************************************************
* ECRITURE DES NOEUDS * * ECRITURE DES NOEUDS *
@ -104,10 +104,10 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
for ( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); ) for ( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{ {
int nodeID = it->next()->GetID(); smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() ) if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ]; nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID ); fprintf(aFileId, "%ld ", nodeID );
} }
fprintf(aFileId, "\n"); fprintf(aFileId, "\n");
} }
@ -120,10 +120,10 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); ) for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{ {
int nodeID = it->next()->GetID(); smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() ) if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ]; nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID ); fprintf(aFileId, "%ld ", nodeID );
} }
fprintf(aFileId, "\n"); fprintf(aFileId, "\n");
} }
@ -155,10 +155,10 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); ) for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{ {
int nodeID = it->next()->GetID(); smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() ) if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ]; nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID ); fprintf(aFileId, "%ld ", nodeID );
} }
fprintf(aFileId, "\n"); fprintf(aFileId, "\n");

View File

@ -89,7 +89,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
int ref; int ref;
const int nodeIDShift = myMesh->GetMeshInfo().NbNodes(); const smIdType nodeIDShift = myMesh->GetMeshInfo().NbNodes();
if ( version != GmfFloat ) if ( version != GmfFloat )
{ {
double x, y, z; double x, y, z;
@ -114,7 +114,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
int iN[28]; // 28 - nb nodes in HEX27 (+ 1 for safety :) int iN[28]; // 28 - nb nodes in HEX27 (+ 1 for safety :)
/* Read edges */ /* Read edges */
const int edgeIDShift = myMesh->GetMeshInfo().NbElements(); const smIdType edgeIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbEdges = GmfStatKwd(meshID, GmfEdges)) if ( int nbEdges = GmfStatKwd(meshID, GmfEdges))
{ {
// read extra vertices for quadratic edges // read extra vertices for quadratic edges
@ -150,7 +150,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
} }
/* Read triangles */ /* Read triangles */
const int triaIDShift = myMesh->GetMeshInfo().NbElements(); const smIdType triaIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbTria = GmfStatKwd(meshID, GmfTriangles)) if ( int nbTria = GmfStatKwd(meshID, GmfTriangles))
{ {
// read extra vertices for quadratic triangles // read extra vertices for quadratic triangles
@ -194,7 +194,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
} }
/* Read quadrangles */ /* Read quadrangles */
const int quadIDShift = myMesh->GetMeshInfo().NbElements(); const smIdType quadIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilaterals)) if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilaterals))
{ {
// read extra vertices for quadratic quadrangles // read extra vertices for quadratic quadrangles
@ -248,7 +248,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
} }
/* Read terahedra */ /* Read terahedra */
const int tetIDShift = myMesh->GetMeshInfo().NbElements(); const smIdType tetIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbTet = GmfStatKwd( meshID, GmfTetrahedra )) if ( int nbTet = GmfStatKwd( meshID, GmfTetrahedra ))
{ {
// read extra vertices for quadratic tetrahedra // read extra vertices for quadratic tetrahedra
@ -273,14 +273,14 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
for ( int i = 1; i <= nbTet; ++i ) for ( int i = 1; i <= nbTet; ++i )
{ {
GmfGetLin(meshID, GmfTetrahedra, &iN[0], &iN[1], &iN[2], &iN[3], &ref); GmfGetLin(meshID, GmfTetrahedra, &iN[0], &iN[1], &iN[2], &iN[3], &ref);
std::vector<int>& midN = quadNodesAtTetrahedra[ i ]; std::vector<int>& midN = quadNodesAtTetrahedra[ i ];
if ( midN.size() >= 10-4 ) // TETRA10 if ( midN.size() >= 10-4 ) // TETRA10
{ {
if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3],
midN[2], midN[1], midN[0], midN[3], midN[5], midN[4], midN[2], midN[1], midN[0], midN[3], midN[5], midN[4],
tetIDShift + i )) tetIDShift + i ))
status = storeBadNodeIds( "GmfTetrahedra + GmfExtraVerticesAtTetrahedra",i, 10, status = storeBadNodeIds( "GmfTetrahedra + GmfExtraVerticesAtTetrahedra",i, 10,
iN[0], iN[2], iN[1], iN[3], iN[0], iN[2], iN[1], iN[3],
midN[2], midN[1], midN[0], midN[3], midN[5], midN[4] ); midN[2], midN[1], midN[0], midN[3], midN[5], midN[4] );
} }
else // TETRA4 else // TETRA4
@ -293,7 +293,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
} }
/* Read pyramids */ /* Read pyramids */
const int pyrIDShift = myMesh->GetMeshInfo().NbElements(); const smIdType pyrIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbPyr = GmfStatKwd(meshID, GmfPyramids)) if ( int nbPyr = GmfStatKwd(meshID, GmfPyramids))
{ {
GmfGotoKwd(meshID, GmfPyramids); GmfGotoKwd(meshID, GmfPyramids);
@ -306,7 +306,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
} }
/* Read hexahedra */ /* Read hexahedra */
const int hexIDShift = myMesh->GetMeshInfo().NbElements(); const smIdType hexIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra)) if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra))
{ {
// read extra vertices for quadratic hexahedra // read extra vertices for quadratic hexahedra
@ -321,7 +321,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
&iN[6], &iN[7], &iN[8], &iN[9], &iN[6], &iN[7], &iN[8], &iN[9],
&iN[10], &iN[11], &iN[12], &iN[13], // HEXA20 &iN[10], &iN[11], &iN[12], &iN[13], // HEXA20
&iN[14], &iN[14],
&iN[15], &iN[16], &iN[17], &iN[18], &iN[15], &iN[16], &iN[17], &iN[18],
&iN[19], &iN[19],
&iN[20]); // HEXA27 &iN[20]); // HEXA27
if ( iN[0] <= nbHex ) if ( iN[0] <= nbHex )
@ -347,7 +347,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
midN[7], midN[6], midN[5], midN[4], midN[7], midN[6], midN[5], midN[4],
midN[8], midN[11], midN[10], midN[9], midN[8], midN[11], midN[10], midN[9],
hexIDShift + i )) hexIDShift + i ))
status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20, status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20,
iN[0], iN[3], iN[2], iN[1], iN[0], iN[3], iN[2], iN[1],
iN[4], iN[7], iN[6], iN[5], iN[4], iN[7], iN[6], iN[5],
midN[3], midN[2], midN[1], midN[0], midN[3], midN[2], midN[1], midN[0],
@ -366,7 +366,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
midN[17], midN[17],
midN[18], midN[18],
hexIDShift + i )) hexIDShift + i ))
status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27, status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27,
iN[0], iN[3], iN[2], iN[1], iN[0], iN[3], iN[2], iN[1],
iN[4], iN[7], iN[6], iN[5], iN[4], iN[7], iN[6], iN[5],
midN[3], midN[2], midN[1], midN[0], midN[3], midN[2], midN[1], midN[0],
@ -389,7 +389,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
} }
/* Read prism */ /* Read prism */
const int prismIDShift = myMesh->GetMeshInfo().NbElements(); const smIdType prismIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbPrism = GmfStatKwd(meshID, GmfPrisms)) if ( int nbPrism = GmfStatKwd(meshID, GmfPrisms))
{ {
GmfGotoKwd(meshID, GmfPrisms); GmfGotoKwd(meshID, GmfPrisms);
@ -405,33 +405,33 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
// Read some entities into groups // Read some entities into groups
// see MeshGems/Docs/meshgems_formats_description.pdf // see MeshGems/Docs/meshgems_formats_description.pdf
// get ids of existing groups // get ids of existing groups
std::set< int > groupIDs; std::set< int > groupIDs;
const std::set<SMESHDS_GroupBase*>& groups = myMesh->GetGroups(); const std::set<SMESHDS_GroupBase*>& groups = myMesh->GetGroups();
std::set<SMESHDS_GroupBase*>::const_iterator grIter = groups.begin(); std::set<SMESHDS_GroupBase*>::const_iterator grIter = groups.begin();
for ( ; grIter != groups.end(); ++grIter ) for ( ; grIter != groups.end(); ++grIter )
groupIDs.insert( (*grIter)->GetID() ); groupIDs.insert( (*grIter)->GetID() );
if ( groupIDs.empty() ) groupIDs.insert( 0 ); if ( groupIDs.empty() ) groupIDs.insert( 0 );
// Read required entities into groups // Read required entities into groups
if ( _makeRequiredGroups ) if ( _makeRequiredGroups )
{ {
const int kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift }, const smIdType kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift },
{ GmfRequiredEdges, SMDSAbs_Edge, edgeIDShift }, { GmfRequiredEdges, SMDSAbs_Edge, edgeIDShift },
{ GmfRequiredTriangles, SMDSAbs_Face, triaIDShift }, { GmfRequiredTriangles, SMDSAbs_Face, triaIDShift },
{ GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift } { GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift }
}; };
const char* names[4] = { "_required_Vertices" , const char* names[4] = { "_required_Vertices" ,
"_required_Edges" , "_required_Edges" ,
"_required_Triangles" , "_required_Triangles" ,
"_required_Quadrilaterals" "_required_Quadrilaterals"
}; };
for ( int i = 0; i < 4; ++i ) for ( int i = 0; i < 4; ++i )
{ {
int gmfKwd = kes[i][0]; int gmfKwd = FromSmIdType<int>( kes[i][0] );
SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1]; SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
int shift = kes[i][2]; smIdType shift = kes[i][2];
if ( int nb = GmfStatKwd(meshID, gmfKwd)) if ( int nb = GmfStatKwd(meshID, gmfKwd))
{ {
const int newID = *groupIDs.rbegin() + 1; const int newID = *groupIDs.rbegin() + 1;
@ -454,27 +454,27 @@ Driver_Mesh::Status DriverGMF_Read::Perform()
if ( _makeFaultGroups ) if ( _makeFaultGroups )
{ {
const int kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift }, const smIdType kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift },
{ GmfFault_BadShape, SMDSAbs_Face, triaIDShift }, { GmfFault_BadShape, SMDSAbs_Face, triaIDShift },
{ GmfFault_Overlap, SMDSAbs_Face, triaIDShift }, { GmfFault_Overlap, SMDSAbs_Face, triaIDShift },
{ GmfFault_Inter, SMDSAbs_Face, triaIDShift }, { GmfFault_Inter, SMDSAbs_Face, triaIDShift },
{ GmfFault_NearTri, SMDSAbs_Face, triaIDShift }, { GmfFault_NearTri, SMDSAbs_Face, triaIDShift },
{ GmfFault_FreeEdge, SMDSAbs_Face, triaIDShift }, { GmfFault_FreeEdge, SMDSAbs_Face, triaIDShift },
{ GmfFault_MultipleEdge, SMDSAbs_Face, triaIDShift } { GmfFault_MultipleEdge, SMDSAbs_Face, triaIDShift }
}; };
const char* names[7] = { "Fault_SmallTri", const char* names[7] = { "Fault_SmallTri",
"Fault_BadShape", "Fault_BadShape",
"Fault_Overlap", "Fault_Overlap",
"Fault_Inter", "Fault_Inter",
"Fault_NearTri", "Fault_NearTri",
"Fault_FreeEdge", "Fault_FreeEdge",
"Fault_MultipleEdge" "Fault_MultipleEdge"
}; };
for ( int i = 0; i < 7; ++i ) for ( int i = 0; i < 7; ++i )
{ {
int gmfKwd = kes[i][0]; int gmfKwd = FromSmIdType<int>( kes[i][0] );
SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1]; SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
int shift = kes[i][2]; smIdType shift = kes[i][2];
if ( int nb = GmfStatKwd(meshID, gmfKwd)) if ( int nb = GmfStatKwd(meshID, gmfKwd))
{ {
const int newID = *groupIDs.rbegin() + 1; const int newID = *groupIDs.rbegin() + 1;

View File

@ -57,8 +57,8 @@ extern "C"
elemIt = elementIterator( SMDSGeom ); \ elemIt = elementIterator( SMDSGeom ); \
if ( elemIt->more() ) \ if ( elemIt->more() ) \
{ \ { \
int totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom ); \ smIdType totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom );\
int nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \ smIdType nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \
if ( totalNbElems - nbLinearElems > 0 ) \ if ( totalNbElems - nbLinearElems > 0 ) \
{ \ { \
GmfSetKwd(meshID, GmfKwd, totalNbElems - nbLinearElems); \ GmfSetKwd(meshID, GmfKwd, totalNbElems - nbLinearElems); \
@ -100,6 +100,9 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
{ {
Kernel_Utils::Localizer loc; Kernel_Utils::Localizer loc;
if ( Driver_Mesh::IsMeshTooLarge< int >( myMesh, /*checkIDs =*/ false))
return DRS_TOO_LARGE_MESH;
const int dim = 3, version = sizeof(double) < 8 ? 1 : 2; const int dim = 3, version = sizeof(double) < 8 ? 1 : 2;
int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim ); int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim );
@ -115,7 +118,7 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
// nodes // nodes
std::map< const SMDS_MeshNode* , int > node2IdMap; std::map< const SMDS_MeshNode* , int > node2IdMap;
int iN = 0, nbNodes = myMesh->NbNodes(); smIdType iN = 0, nbNodes = myMesh->NbNodes();
GmfSetKwd( meshID, GmfVertices, nbNodes ); GmfSetKwd( meshID, GmfVertices, nbNodes );
double xyz[3]; double xyz[3];
SMDS_NodeIteratorPtr nodeIt = myMesh->nodesIterator(); SMDS_NodeIteratorPtr nodeIt = myMesh->nodesIterator();

View File

@ -36,6 +36,7 @@
#include "MED_Utilities.hxx" #include "MED_Utilities.hxx"
#include <NCollection_Map.hxx> #include <NCollection_Map.hxx>
#include <smIdType.hxx>
#include "utilities.h" #include "utilities.h"
@ -225,7 +226,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
// Reading pre information about all MED cells // Reading pre information about all MED cells
//-------------------------------------------- //--------------------------------------------
typedef MED::TVector<int> TNodeIds; typedef MED::TVector<smIdType> TNodeIds;
bool takeNumbers = true; // initially we trust the numbers from file bool takeNumbers = true; // initially we trust the numbers from file
MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD); MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD);
MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin(); MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
@ -269,7 +270,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end()); aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end());
// allocate array of diameters // allocate array of diameters
vtkIdType maxID = myMesh->MaxElementID() + aNbBalls; vtkIdType maxID = FromSmIdType<vtkIdType>(myMesh->MaxElementID() + aNbBalls);
if ( anIsElemNum && !aBallInfo->myElemNum->empty() ) if ( anIsElemNum && !aBallInfo->myElemNum->empty() )
maxID = *std::max_element( aBallInfo->myElemNum->begin(), maxID = *std::max_element( aBallInfo->myElemNum->begin(),
aBallInfo->myElemNum->end() ); aBallInfo->myElemNum->end() );
@ -318,7 +319,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX; EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX;
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID) typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID)
(const std::vector<int> & nodes_ids, const int ID); (const std::vector<smIdType> & nodes_ids, const smIdType ID);
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon) typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon)
(const std::vector<const SMDS_MeshNode*> & nodes); (const std::vector<const SMDS_MeshNode*> & nodes);
@ -355,7 +356,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
#endif #endif
if ( anIsElemNum ) { if ( anIsElemNum ) {
TInt anElemId = aPolygoneInfo->GetElemNum( iElem ); TInt anElemId = aPolygoneInfo->GetElemNum( iElem );
anElement = (myMesh->*addPolyWithID)( aNodeIds, anElemId ); anElement = (myMesh->*addPolyWithID)( aNodeIds, ToSmIdType(anElemId) );
} }
if ( !anElement ) { if ( !anElement ) {
aNodes.resize( aNbConn ); aNodes.resize( aNbConn );
@ -436,7 +437,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
#endif #endif
if(anIsElemNum){ if(anIsElemNum){
TInt anElemId = aPolyedreInfo->GetElemNum(iElem); TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId); anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToSmIdType(anElemId));
} }
if(!anElement){ if(!anElement){
vector<const SMDS_MeshNode*> aNodes(aNbNodes); vector<const SMDS_MeshNode*> aNodes(aNbNodes);

View File

@ -90,7 +90,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh,
} }
// find out "MED order" of elements - sort elements by geom type // find out "MED order" of elements - sort elements by geom type
int nbElems; smIdType nbElems;
if ( _nbElemsByGeom.empty() || _elemType != type ) if ( _nbElemsByGeom.empty() || _elemType != type )
{ {
_elemType = type; _elemType = type;

View File

@ -246,7 +246,7 @@ namespace
const SMDS_MeshNode* GetNode(){ const SMDS_MeshNode* GetNode(){
return myCurrentNode; return myCurrentNode;
} }
MED::TIntVector::value_type GetID(){ MED::TIDVector::value_type GetID(){
return myCurrentNode->GetID(); return myCurrentNode->GetID();
} }
MED::TFloatVector::value_type GetCoord(TInt theCoodId){ MED::TFloatVector::value_type GetCoord(TInt theCoodId){
@ -343,12 +343,21 @@ namespace
} }
} }
//================================================================================
/*!
* \brief Write my mesh
*/
//================================================================================
Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
{ {
Status aResult = DRS_OK; Status aResult = DRS_OK;
try { try {
//MESSAGE("Perform - myFile : "<<myFile); //MESSAGE("Perform - myFile : "<<myFile);
if ( Driver_Mesh::IsMeshTooLarge< TInt >( myMesh, /*checkIDs =*/ true ))
return DRS_TOO_LARGE_MESH;
// Creating the MED mesh for corresponding SMDS structure // Creating the MED mesh for corresponding SMDS structure
//------------------------------------------------------- //-------------------------------------------------------
string aMeshName; string aMeshName;
@ -475,12 +484,12 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
int myEdgesDefaultFamilyId = 0; int myEdgesDefaultFamilyId = 0;
int myFacesDefaultFamilyId = 0; int myFacesDefaultFamilyId = 0;
int myVolumesDefaultFamilyId = 0; int myVolumesDefaultFamilyId = 0;
int nbNodes = myMesh->NbNodes(); smIdType nbNodes = myMesh->NbNodes();
int nb0DElements = myMesh->Nb0DElements(); smIdType nb0DElements = myMesh->Nb0DElements();
int nbBalls = myMesh->NbBalls(); smIdType nbBalls = myMesh->NbBalls();
int nbEdges = myMesh->NbEdges(); smIdType nbEdges = myMesh->NbEdges();
int nbFaces = myMesh->NbFaces(); smIdType nbFaces = myMesh->NbFaces();
int nbVolumes = myMesh->NbVolumes(); smIdType nbVolumes = myMesh->NbVolumes();
if (myDoGroupOfNodes) myNodesDefaultFamilyId = REST_NODES_FAMILY; if (myDoGroupOfNodes) myNodesDefaultFamilyId = REST_NODES_FAMILY;
if (myDoGroupOfEdges) myEdgesDefaultFamilyId = REST_EDGES_FAMILY; if (myDoGroupOfEdges) myEdgesDefaultFamilyId = REST_EDGES_FAMILY;
if (myDoGroupOfFaces) myFacesDefaultFamilyId = REST_FACES_FAMILY; if (myDoGroupOfFaces) myFacesDefaultFamilyId = REST_FACES_FAMILY;
@ -539,7 +548,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
const EBooleen theIsElemNames = eFAUX; const EBooleen theIsElemNames = eFAUX;
const EConnectivite theConnMode = eNOD; const EConnectivite theConnMode = eNOD;
TInt aNbNodes = myMesh->NbNodes(); TInt aNbNodes = FromSmIdType<TInt>( myMesh->NbNodes() );
PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes, PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes,
theMode, theSystem, theIsElemNum, theIsElemNames); theMode, theSystem, theIsElemNum, theIsElemNames);
@ -559,7 +568,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
aTCoordSlice[2] = 0.; aTCoordSlice[2] = 0.;
// node number // node number
int aNodeID = aCoordHelperPtr->GetID(); TInt aNodeID = FromSmIdType<TInt>( aCoordHelperPtr->GetID() );
aNodeInfo->SetElemNum( iNode, aNodeID ); aNodeInfo->SetElemNum( iNode, aNodeID );
#ifdef _EDF_NODE_IDS_ #ifdef _EDF_NODE_IDS_
aNodeIdMap.insert( aNodeIdMap.end(), make_pair( aNodeID, iNode+1 )); aNodeIdMap.insert( aNodeIdMap.end(), make_pair( aNodeID, iNode+1 ));
@ -625,66 +634,66 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
#endif #endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eBALL, eBALL,
nbElemInfo.NbBalls(), FromSmIdType<TInt>(nbElemInfo.NbBalls()),
SMDSAbs_Ball)); SMDSAbs_Ball));
#ifdef _ELEMENTS_BY_DIM_ #ifdef _ELEMENTS_BY_DIM_
anEntity = eARETE; anEntity = eARETE;
#endif #endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eSEG2, eSEG2,
nbElemInfo.NbEdges( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbEdges( ORDER_LINEAR )),
SMDSAbs_Edge)); SMDSAbs_Edge));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eSEG3, eSEG3,
nbElemInfo.NbEdges( ORDER_QUADRATIC ), FromSmIdType<TInt>(nbElemInfo.NbEdges( ORDER_QUADRATIC )),
SMDSAbs_Edge)); SMDSAbs_Edge));
#ifdef _ELEMENTS_BY_DIM_ #ifdef _ELEMENTS_BY_DIM_
anEntity = eFACE; anEntity = eFACE;
#endif #endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA3, eTRIA3,
nbElemInfo.NbTriangles( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbTriangles( ORDER_LINEAR )),
SMDSAbs_Face)); SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA6, eTRIA6,
nbElemInfo.NbTriangles( ORDER_QUADRATIC ) - FromSmIdType<TInt>(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
nbElemInfo.NbBiQuadTriangles(), nbElemInfo.NbBiQuadTriangles()),
SMDSAbs_Face)); SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA7, eTRIA7,
nbElemInfo.NbBiQuadTriangles(), FromSmIdType<TInt>(nbElemInfo.NbBiQuadTriangles()),
SMDSAbs_Face)); SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD4, eQUAD4,
nbElemInfo.NbQuadrangles( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_LINEAR )),
SMDSAbs_Face)); SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD8, eQUAD8,
nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) - FromSmIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
nbElemInfo.NbBiQuadQuadrangles(), nbElemInfo.NbBiQuadQuadrangles()),
SMDSAbs_Face)); SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD9, eQUAD9,
nbElemInfo.NbBiQuadQuadrangles(), FromSmIdType<TInt>(nbElemInfo.NbBiQuadQuadrangles()),
SMDSAbs_Face)); SMDSAbs_Face));
if ( polyTypesSupported ) { if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE, ePOLYGONE,
nbElemInfo.NbPolygons( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
SMDSAbs_Face)); SMDSAbs_Face));
// we need one more loop on poly elements to count nb of their nodes // we need one more loop on poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE, ePOLYGONE,
nbElemInfo.NbPolygons( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
SMDSAbs_Face)); SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2, ePOLYGON2,
nbElemInfo.NbPolygons( ORDER_QUADRATIC ), FromSmIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
SMDSAbs_Face)); SMDSAbs_Face));
// we need one more loop on QUAD poly elements to count nb of their nodes // we need one more loop on QUAD poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2, ePOLYGON2,
nbElemInfo.NbPolygons( ORDER_QUADRATIC ), FromSmIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
SMDSAbs_Face)); SMDSAbs_Face));
} }
#ifdef _ELEMENTS_BY_DIM_ #ifdef _ELEMENTS_BY_DIM_
@ -692,58 +701,58 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
#endif #endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTETRA4, eTETRA4,
nbElemInfo.NbTetras( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbTetras( ORDER_LINEAR )),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTETRA10, eTETRA10,
nbElemInfo.NbTetras( ORDER_QUADRATIC ), FromSmIdType<TInt>(nbElemInfo.NbTetras( ORDER_QUADRATIC )),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePYRA5, ePYRA5,
nbElemInfo.NbPyramids( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbPyramids( ORDER_LINEAR )),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePYRA13, ePYRA13,
nbElemInfo.NbPyramids( ORDER_QUADRATIC ), FromSmIdType<TInt>(nbElemInfo.NbPyramids( ORDER_QUADRATIC )),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA6, ePENTA6,
nbElemInfo.NbPrisms( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbPrisms( ORDER_LINEAR )),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA15, ePENTA15,
nbElemInfo.NbQuadPrisms(), FromSmIdType<TInt>(nbElemInfo.NbQuadPrisms()),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA18, ePENTA18,
nbElemInfo.NbBiQuadPrisms(), FromSmIdType<TInt>(nbElemInfo.NbBiQuadPrisms()),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA8, eHEXA8,
nbElemInfo.NbHexas( ORDER_LINEAR ), FromSmIdType<TInt>(nbElemInfo.NbHexas( ORDER_LINEAR )),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA20, eHEXA20,
nbElemInfo.NbHexas( ORDER_QUADRATIC )- FromSmIdType<TInt>(nbElemInfo.NbHexas( ORDER_QUADRATIC )-
nbElemInfo.NbTriQuadHexas(), nbElemInfo.NbTriQuadHexas()),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA27, eHEXA27,
nbElemInfo.NbTriQuadHexas(), FromSmIdType<TInt>(nbElemInfo.NbTriQuadHexas()),
SMDSAbs_Volume)); SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eOCTA12, eOCTA12,
nbElemInfo.NbHexPrisms(), FromSmIdType<TInt>(nbElemInfo.NbHexPrisms()),
SMDSAbs_Volume)); SMDSAbs_Volume));
if ( polyTypesSupported ) { if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYEDRE, ePOLYEDRE,
nbElemInfo.NbPolyhedrons(), FromSmIdType<TInt>(nbElemInfo.NbPolyhedrons()),
SMDSAbs_Volume)); SMDSAbs_Volume));
// we need one more loop on poly elements to count nb of their nodes // we need one more loop on poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity, aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYEDRE, ePOLYEDRE,
nbElemInfo.NbPolyhedrons(), FromSmIdType<TInt>(nbElemInfo.NbPolyhedrons()),
SMDSAbs_Volume)); SMDSAbs_Volume));
} }
@ -822,13 +831,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
for(TInt iNode = 0; iNode < aNbNodes; iNode++) { for(TInt iNode = 0; iNode < aNbNodes; iNode++) {
const SMDS_MeshElement* aNode = anElem->GetNode( iNode ); const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
#ifdef _EDF_NODE_IDS_ #ifdef _EDF_NODE_IDS_
aTConnSlice[ iNode ] = aNodeIdMap[aNode->GetID()]; aTConnSlice[ iNode ] = aNodeIdMap[FromSmIdType<TInt>(aNode->GetID())];
#else #else
aTConnSlice[ iNode ] = aNode->GetID(); aTConnSlice[ iNode ] = aNode->GetID();
#endif #endif
} }
// element number // element number
aPolygoneInfo->SetElemNum( iElem, anElem->GetID() ); aPolygoneInfo->SetElemNum( iElem, FromSmIdType<TInt>(anElem->GetID()) );
// family number // family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
@ -896,14 +905,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
while ( nodeIt->more() ) { while ( nodeIt->more() ) {
const SMDS_MeshElement* aNode = nodeIt->next(); const SMDS_MeshElement* aNode = nodeIt->next();
#ifdef _EDF_NODE_IDS_ #ifdef _EDF_NODE_IDS_
conn[ iNode ] = aNodeIdMap[aNode->GetID()]; conn[ iNode ] = aNodeIdMap[FromSmIdType<TInt>(aNode->GetID())];
#else #else
conn[ iNode ] = aNode->GetID(); conn[ iNode ] = aNode->GetID();
#endif #endif
++iNode; ++iNode;
} }
// element number // element number
aPolyhInfo->SetElemNum( iElem, anElem->GetID() ); aPolyhInfo->SetElemNum( iElem, FromSmIdType<TInt>(anElem->GetID()) );
// family number // family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
@ -930,12 +939,12 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
// connectivity // connectivity
const SMDS_MeshElement* aNode = anElem->GetNode( 0 ); const SMDS_MeshElement* aNode = anElem->GetNode( 0 );
#ifdef _EDF_NODE_IDS_ #ifdef _EDF_NODE_IDS_
(*aBallInfo->myConn)[ iElem ] = aNodeIdMap[aNode->GetID()]; (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromSmIdType<TInt>(aNode->GetID())];
#else #else
(*aBallInfo->myConn)[ iElem ] = aNode->GetID(); (*aBallInfo->myConn)[ iElem ] = aNode->GetID();
#endif #endif
// element number // element number
aBallInfo->SetElemNum( iElem, anElem->GetID() ); aBallInfo->SetElemNum( iElem, FromSmIdType<TInt>(anElem->GetID()) );
// diameter // diameter
aBallInfo->myDiameters[ iElem ] = aBallInfo->myDiameters[ iElem ] =
@ -978,13 +987,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
for (TInt iNode = 0; iNode < aNbNodes; iNode++) { for (TInt iNode = 0; iNode < aNbNodes; iNode++) {
const SMDS_MeshElement* aNode = anElem->GetNode( iNode ); const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
#ifdef _EDF_NODE_IDS_ #ifdef _EDF_NODE_IDS_
aTConnSlice[ iNode ] = aNodeIdMap[aNode->GetID()]; aTConnSlice[ iNode ] = aNodeIdMap[FromSmIdType<TInt>(aNode->GetID())];
#else #else
aTConnSlice[ iNode ] = aNode->GetID(); aTConnSlice[ iNode ] = aNode->GetID();
#endif #endif
} }
// element number // element number
aCellInfo->SetElemNum( iElem, anElem->GetID() ); aCellInfo->SetElemNum( iElem, FromSmIdType<TInt>(anElem->GetID()) );
// family number // family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );

View File

@ -45,6 +45,10 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
{ {
Kernel_Utils::Localizer loc; Kernel_Utils::Localizer loc;
Status aResult = DRS_OK; Status aResult = DRS_OK;
if ( Driver_Mesh::IsMeshTooLarge< int >( myMesh, /*checkIDs =*/ false))
return DRS_TOO_LARGE_MESH;
#if defined(WIN32) && defined(UNICODE) #if defined(WIN32) && defined(UNICODE)
std::wstring aFile = Kernel_Utils::utf8_decode_s(myFile); std::wstring aFile = Kernel_Utils::utf8_decode_s(myFile);
std::ofstream out_stream(aFile.c_str()); std::ofstream out_stream(aFile.c_str());
@ -113,7 +117,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
{ {
const SMDS_MeshNode* aNode = aNodesIter->next(); const SMDS_MeshNode* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() ) if ( nodeLabelByID.empty() )
aRec.node_labels.push_back( aNode->GetID() ); aRec.node_labels.push_back( FromSmIdType<int>(aNode->GetID()) );
else else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
} }
@ -137,7 +141,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
for ( aRec.node_labels.clear(); aNodesIter->more(); ) { for ( aRec.node_labels.clear(); aNodesIter->more(); ) {
const SMDS_MeshNode* aNode = aNodesIter->next(); const SMDS_MeshNode* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() ) if ( nodeLabelByID.empty() )
aRec.node_labels.push_back( aNode->GetID() ); aRec.node_labels.push_back( FromSmIdType<int>(aNode->GetID()) );
else else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
} }
@ -195,7 +199,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
{ {
const SMDS_MeshElement* aNode = aNodesIter->next(); const SMDS_MeshElement* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() ) if ( nodeLabelByID.empty() )
aRec.node_labels.push_back( aNode->GetID() ); aRec.node_labels.push_back( FromSmIdType<int>(aNode->GetID()) );
else else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
} }
@ -226,7 +230,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
while ( aIter->more() ) { while ( aIter->more() ) {
const SMDS_MeshElement* aNode = aIter->next(); const SMDS_MeshElement* aNode = aIter->next();
if ( nodeLabelByID.empty() ) if ( nodeLabelByID.empty() )
aRec.NodeList.push_back( aNode->GetID() ); aRec.NodeList.push_back( FromSmIdType<int>(aNode->GetID()) );
else else
aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]); aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]);
} }
@ -236,7 +240,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
while ( aIter->more() ) { while ( aIter->more() ) {
const SMDS_MeshElement* aElem = aIter->next(); const SMDS_MeshElement* aElem = aIter->next();
if ( elemLabelByID.empty() ) if ( elemLabelByID.empty() )
aRec.ElementList.push_back( aElem->GetID() ); aRec.ElementList.push_back( FromSmIdType<int>(aElem->GetID()) );
else else
aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]); aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]);
} }
@ -256,11 +260,11 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
EXCEPTION(runtime_error,"ERROR: Output file not good."); EXCEPTION(runtime_error,"ERROR: Output file not good.");
} }
catch(const std::exception& exc){ catch(const std::exception& exc){
INFOS("Follow exception was cought:\n\t"<<exc.what()); INFOS("Follow exception was caught:\n\t"<<exc.what());
throw; throw;
} }
catch(...){ catch(...){
INFOS("Unknown exception was cought !!!"); INFOS("Unknown exception was caught !!!");
throw; throw;
} }
return aResult; return aResult;

View File

@ -35,7 +35,8 @@ typedef std::list<SMESHDS_GroupBase*> TGroupList;
class MESHDRIVERUNV_EXPORT DriverUNV_W_SMDS_Mesh: public Driver_SMDS_Mesh class MESHDRIVERUNV_EXPORT DriverUNV_W_SMDS_Mesh: public Driver_SMDS_Mesh
{ {
public: public:
virtual Status Perform();
virtual Status Perform() override;
void AddGroup(SMESHDS_GroupBase* theGroup) { myGroups.push_back(theGroup); } void AddGroup(SMESHDS_GroupBase* theGroup) { myGroups.push_back(theGroup); }

View File

@ -32,6 +32,7 @@
#include <map> #include <map>
#include <med.h> #include <med.h>
#include <smIdType.hxx>
#ifdef WIN32 #ifdef WIN32
#pragma warning(disable:4099) #pragma warning(disable:4099)
@ -77,6 +78,7 @@ namespace MED
typedef enum {eCOOR, eCONN, eNOM, eNUM, eFAM, eCOOR_IND1, eCOOR_IND2, eCOOR_IND3} ETable; typedef enum {eCOOR, eCONN, eNOM, eNUM, eFAM, eCOOR_IND1, eCOOR_IND2, eCOOR_IND3} ETable;
typedef TVector<TInt> TIntVector; typedef TVector<TInt> TIntVector;
typedef TVector<smIdType> TIDVector;
typedef TVector<TFloat> TFloatVector; typedef TVector<TFloat> TFloatVector;
typedef TVector<std::string> TStringVector; typedef TVector<std::string> TStringVector;
typedef std::set<std::string> TStringSet; typedef std::set<std::string> TStringSet;

View File

@ -139,8 +139,8 @@ SMESH_ActorDef::SMESH_ActorDef()
myIsFacesOriented = false; myIsFacesOriented = false;
int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement(); float controlsIncrement = (float) SMESH_ActorProps::props()->controlsIncrement();
int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement();
myControlsPrecision = -1; myControlsPrecision = -1;
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@ -148,11 +148,11 @@ SMESH_ActorDef::SMESH_ActorDef()
if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) ) if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1); myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
double aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5); float aElem0DSize = (float) SMESH::GetFloat("SMESH:elem0d_size",5);
double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10); float aBallElemSize = (float) SMESH::GetFloat("SMESH:ball_elem_size",10);
double aBallElemScale = SMESH::GetFloat("SMESH:ball_elem_scale",1.0); float aBallElemScale = (float) SMESH::GetFloat("SMESH:ball_elem_scale",1.0);
double aLineWidth = SMESH::GetFloat("SMESH:element_width",1); float aLineWidth = (float) SMESH::GetFloat("SMESH:element_width",1);
double aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1); float aOutlineWidth = (float) SMESH::GetFloat("SMESH:outline_width",1);
SMESH::LabelFont aFamilyNd = SMESH::FntTimes; SMESH::LabelFont aFamilyNd = SMESH::FntTimes;
bool aBoldNd = true; bool aBoldNd = true;
@ -1035,7 +1035,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
return; return;
} }
int aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0; smIdType aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0;
bool aShowOnlyScalarBarTitle = false; bool aShowOnlyScalarBarTitle = false;
if(aNbCells) { if(aNbCells) {
//myControlMode = theMode; //myControlMode = theMode;
@ -1135,7 +1135,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
//Update(); //Update();
} }
int SMESH_ActorDef::GetNumberControlEntities() smIdType SMESH_ActorDef::GetNumberControlEntities()
{ {
SMESH_DeviceActor* anAct = NULL; SMESH_DeviceActor* anAct = NULL;
switch(myControlMode){ switch(myControlMode){
@ -1161,7 +1161,7 @@ int SMESH_ActorDef::GetNumberControlEntities()
break; break;
default:; default:;
} }
return (anAct) ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1; return anAct ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1;
} }
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer) void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer)
@ -1453,27 +1453,27 @@ void SMESH_ActorDef::UnShrink()
} }
int SMESH_ActorDef::GetNodeObjId(int theVtkID) vtkIdType SMESH_ActorDef::GetNodeObjId(vtkIdType theVtkID)
{ {
return myPickableActor->GetNodeObjId(theVtkID); return myPickableActor->GetNodeObjId(theVtkID);
} }
double* SMESH_ActorDef::GetNodeCoord(int theObjID) double* SMESH_ActorDef::GetNodeCoord(vtkIdType theObjID)
{ {
return myPickableActor->GetNodeCoord(theObjID); return myPickableActor->GetNodeCoord(theObjID);
} }
int SMESH_ActorDef::GetNodeVtkId(int theObjID) vtkIdType SMESH_ActorDef::GetNodeVtkId(vtkIdType theObjID)
{ {
return myPickableActor->GetNodeVtkId(theObjID); return myPickableActor->GetNodeVtkId(theObjID);
} }
int SMESH_ActorDef::GetElemObjId(int theVtkID) vtkIdType SMESH_ActorDef::GetElemObjId(vtkIdType theVtkID)
{ {
return myPickableActor->GetElemObjId(theVtkID); return myPickableActor->GetElemObjId(theVtkID);
} }
vtkCell* SMESH_ActorDef::GetElemCell(int theObjID) vtkCell* SMESH_ActorDef::GetElemCell(vtkIdType theObjID)
{ {
return myPickableActor->GetElemCell(theObjID); return myPickableActor->GetElemCell(theObjID);
} }
@ -1665,11 +1665,11 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
void SMESH_ActorDef::SetRepresentation (int theMode) void SMESH_ActorDef::SetRepresentation (int theMode)
{ {
int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge); smIdType aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face); smIdType aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume); smIdType aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement); smIdType aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball); smIdType aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
if ( myRepresentationCache && aNbEdges + aNbFaces + aNbVolumes + aNb0Ds + aNbBalls ) if ( myRepresentationCache && aNbEdges + aNbFaces + aNbVolumes + aNb0Ds + aNbBalls )
{ {
@ -1714,7 +1714,7 @@ void SMESH_ActorDef::SetRepresentation (int theMode)
myPickableActor = myBaseActor; myPickableActor = myBaseActor;
vtkProperty *aProp = NULL, *aBackProp = NULL; vtkProperty *aProp = NULL, *aBackProp = NULL;
vtkProperty *aPropVN = NULL, *aPropVR = NULL; vtkProperty *aPropVN = NULL, *aPropVR = NULL;
SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::EReperesent(-1); SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::eNoneRepr;
SMESH_Actor::EQuadratic2DRepresentation aQuadraticMode = GetQuadratic2DRepresentation(); SMESH_Actor::EQuadratic2DRepresentation aQuadraticMode = GetQuadratic2DRepresentation();
switch (myRepresentation) { switch (myRepresentation) {
case ePoint: case ePoint:
@ -2126,8 +2126,8 @@ void SMESH_ActorDef::UpdateSelectionProps()
{ {
QColor selectionColor = SMESH_ActorProps::props()->selectionColor(); QColor selectionColor = SMESH_ActorProps::props()->selectionColor();
QColor highlightColor = SMESH_ActorProps::props()->highlightColor(); QColor highlightColor = SMESH_ActorProps::props()->highlightColor();
int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement();
double width = GetLineWidth(); float width = (float) GetLineWidth();
myHighlightProp->SetColor(selectionColor.redF(), selectionColor.greenF(), selectionColor.blueF()); myHighlightProp->SetColor(selectionColor.redF(), selectionColor.greenF(), selectionColor.blueF());
myHighlightProp->SetLineWidth(width + selectionIncrement); myHighlightProp->SetLineWidth(width + selectionIncrement);
myPreselectProp->SetColor(highlightColor.redF(), highlightColor.greenF(), highlightColor.blueF()); myPreselectProp->SetColor(highlightColor.redF(), highlightColor.greenF(), highlightColor.blueF());
@ -2143,17 +2143,17 @@ double SMESH_ActorDef::GetLineWidth()
void SMESH_ActorDef::SetLineWidth(double theVal) void SMESH_ActorDef::SetLineWidth(double theVal)
{ {
int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement(); float controlsIncrement = (float) SMESH_ActorProps::props()->controlsIncrement();
int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement();
myEdgeProp->SetLineWidth(theVal); myEdgeProp->SetLineWidth((float) theVal);
my1DProp->SetLineWidth(theVal + controlsIncrement); my1DProp ->SetLineWidth((float) theVal + controlsIncrement);
my1DExtProp->SetLineWidth(theVal + controlsIncrement); my1DExtProp ->SetLineWidth((float) theVal + controlsIncrement);
my2DExtProp->SetLineWidth(theVal + controlsIncrement); my2DExtProp ->SetLineWidth((float) theVal + controlsIncrement);
my3DExtProp->SetLineWidth(theVal + controlsIncrement); my3DExtProp ->SetLineWidth((float) theVal + controlsIncrement);
myHighlightProp->SetLineWidth(theVal + selectionIncrement); myHighlightProp->SetLineWidth((float) theVal + selectionIncrement);
myPreselectProp->SetLineWidth(theVal + selectionIncrement); myPreselectProp->SetLineWidth((float) theVal + selectionIncrement);
Modified(); Modified();
} }
@ -2164,21 +2164,21 @@ double SMESH_ActorDef::GetOutlineWidth()
void SMESH_ActorDef::SetOutlineWidth(double theVal) void SMESH_ActorDef::SetOutlineWidth(double theVal)
{ {
myOutLineProp->SetLineWidth(theVal); myOutLineProp->SetLineWidth((float) theVal);
Modified(); Modified();
} }
void SMESH_ActorDef::Set0DSize(double theVal) void SMESH_ActorDef::Set0DSize(double theVal)
{ {
my0DProp->SetPointSize(theVal); my0DProp ->SetPointSize((float) theVal);
myHighlightProp->SetPointSize(theVal); myHighlightProp->SetPointSize((float) theVal);
myPreselectProp->SetPointSize(theVal); myPreselectProp->SetPointSize((float) theVal);
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) { if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
aCustom->Set0DSize(theVal); aCustom->Set0DSize((float) theVal);
} }
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) { if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) {
aCustom->Set0DSize(theVal); aCustom->Set0DSize((float) theVal);
} }
Modified(); Modified();
@ -2191,13 +2191,13 @@ double SMESH_ActorDef::Get0DSize()
void SMESH_ActorDef::SetBallSize(double theVal) void SMESH_ActorDef::SetBallSize(double theVal)
{ {
myBallProp->SetPointSize(theVal); myBallProp->SetPointSize((float) theVal);
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) { if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
aCustom->SetBallSize(theVal); aCustom->SetBallSize((float) theVal);
} }
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) { if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) {
aCustom->SetBallSize(theVal); aCustom->SetBallSize((float) theVal);
} }
Modified(); Modified();
@ -2226,7 +2226,7 @@ void SMESH_ActorDef::SetBallScale( double theVal )
Modified(); Modified();
} }
int SMESH_ActorDef::GetObjDimension( const int theObjId ) int SMESH_ActorDef::GetObjDimension( const vtkIdType theObjId )
{ {
return myVisualObj->GetElemDimension( theObjId ); return myVisualObj->GetElemDimension( theObjId );
} }
@ -2496,7 +2496,7 @@ void SMESH_ActorDef::UpdateDistribution()
SMESH_VisualObjDef::TEntityList elems; SMESH_VisualObjDef::TEntityList elems;
if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())) if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get()))
dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())->GetEntities( fun->GetType(), elems ); dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())->GetEntities( fun->GetType(), elems );
std::vector<int> elemIds; elemIds.reserve( elems.size() ); std::vector<smIdType> elemIds; elemIds.reserve( elems.size() );
for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e) for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e)
elemIds.push_back( (*e)->GetID()); elemIds.push_back( (*e)->GetID());
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable()); vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
@ -2682,7 +2682,7 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram()
SMESH_VisualObjDef::TEntityList elems; SMESH_VisualObjDef::TEntityList elems;
if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())) if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get()))
dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())->GetEntities( fun->GetType(), elems ); dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get())->GetEntities( fun->GetType(), elems );
std::vector<int> elemIds; std::vector<smIdType> elemIds;
for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e) for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e)
elemIds.push_back( (*e)->GetID()); elemIds.push_back( (*e)->GetID());

View File

@ -148,7 +148,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
virtual void SetControl(SMESH::Controls::FunctorPtr) = 0; virtual void SetControl(SMESH::Controls::FunctorPtr) = 0;
virtual eControl GetControlMode() = 0; virtual eControl GetControlMode() = 0;
virtual SMESH::Controls::FunctorPtr GetFunctor() = 0; virtual SMESH::Controls::FunctorPtr GetFunctor() = 0;
virtual int GetNumberControlEntities() = 0; virtual smIdType GetNumberControlEntities() = 0;
virtual SMESH_ScalarBarActor* GetScalarBarActor() = 0; virtual SMESH_ScalarBarActor* GetScalarBarActor() = 0;

View File

@ -144,14 +144,14 @@ class SMESH_ActorDef : public SMESH_Actor
virtual void SetBallScale(double size); virtual void SetBallScale(double size);
virtual double GetBallScale(); virtual double GetBallScale();
virtual int GetNodeObjId(int theVtkID); virtual vtkIdType GetNodeObjId(vtkIdType theVtkID);
virtual double* GetNodeCoord(int theObjID); virtual double* GetNodeCoord(vtkIdType theObjID);
virtual int GetNodeVtkId(int theObjID); virtual vtkIdType GetNodeVtkId(vtkIdType theObjID);
virtual int GetElemObjId(int theVtkID); virtual vtkIdType GetElemObjId(vtkIdType theVtkID);
virtual vtkCell* GetElemCell(int theObjID); virtual vtkCell* GetElemCell(vtkIdType theObjID);
virtual int GetObjDimension( const int theObjId ); virtual int GetObjDimension( const vtkIdType theObjId ) override;
virtual void SetVisibility(int theMode); virtual void SetVisibility(int theMode);
void SetVisibility(int theMode, bool theIsUpdateRepersentation); void SetVisibility(int theMode, bool theIsUpdateRepersentation);
@ -206,7 +206,7 @@ class SMESH_ActorDef : public SMESH_Actor
virtual void SetControlMode(eControl theMode); virtual void SetControlMode(eControl theMode);
virtual void SetControl(SMESH::Controls::FunctorPtr theFunctor); virtual void SetControl(SMESH::Controls::FunctorPtr theFunctor);
virtual int GetNumberControlEntities(); virtual smIdType GetNumberControlEntities();
virtual eControl GetControlMode(){ return myControlMode;} virtual eControl GetControlMode(){ return myControlMode;}
virtual SMESH::Controls::FunctorPtr GetFunctor() { return myFunctor; } virtual SMESH::Controls::FunctorPtr GetFunctor() { return myFunctor; }

View File

@ -157,17 +157,17 @@ namespace SMESH
} }
} }
std::map<SMDSAbs_ElementType,int> GetEntitiesFromObject(SMESH_VisualObj *theObject) { std::map<SMDSAbs_ElementType,smIdType> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
std::map<SMDSAbs_ElementType,int> entities; std::map<SMDSAbs_ElementType,smIdType> entities;
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_0DElement, entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_0DElement,
theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Ball, entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Ball,
theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Edge, entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Edge,
theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Face, entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Face,
theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0));
entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Volume, entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Volume,
theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0)); theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
return entities; return entities;
} }

View File

@ -84,7 +84,7 @@ SMESHOBJECT_EXPORT
QString def); QString def);
SMESHOBJECT_EXPORT SMESHOBJECT_EXPORT
std::map<SMDSAbs_ElementType,int> std::map<SMDSAbs_ElementType,smIdType>
GetEntitiesFromObject(SMESH_VisualObj *theObject); GetEntitiesFromObject(SMESH_VisualObj *theObject);
SMESHOBJECT_EXPORT SMESHOBJECT_EXPORT

View File

@ -43,6 +43,7 @@
#include <vtkRenderer.h> #include <vtkRenderer.h>
#include <vtkUnstructuredGrid.h> #include <vtkUnstructuredGrid.h>
#include <vtkCellData.h> #include <vtkCellData.h>
#include <iostream>
vtkStandardNewMacro(SMESH_CellLabelActor) vtkStandardNewMacro(SMESH_CellLabelActor)
@ -70,7 +71,7 @@ SMESH_CellLabelActor::SMESH_CellLabelActor()
myClsLabeledDataMapper = vtkLabeledDataMapper::New(); myClsLabeledDataMapper = vtkLabeledDataMapper::New();
myClsLabeledDataMapper->SetInputConnection(myClsSelectVisiblePoints->GetOutputPort()); myClsLabeledDataMapper->SetInputConnection(myClsSelectVisiblePoints->GetOutputPort());
myClsLabeledDataMapper->SetLabelFormat("%d"); //myClsLabeledDataMapper->SetLabelFormat("%d");
myClsLabeledDataMapper->SetLabelModeToLabelScalars(); myClsLabeledDataMapper->SetLabelModeToLabelScalars();
myClsTextProp = vtkTextProperty::New(); myClsTextProp = vtkTextProperty::New();
@ -156,18 +157,18 @@ void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled)
{ {
myCellsNumDataSet->ShallowCopy(aGrid); myCellsNumDataSet->ShallowCopy(aGrid);
vtkUnstructuredGrid *aDataSet = myCellsNumDataSet; vtkUnstructuredGrid *aDataSet = myCellsNumDataSet;
int aNbElem = aDataSet->GetNumberOfCells(); vtkIdType aNbElem = aDataSet->GetNumberOfCells();
vtkIntArray *anArray = vtkIntArray::New(); vtkIdTypeArray *anArray = vtkIdTypeArray::New();
anArray->SetNumberOfValues(aNbElem); anArray->SetNumberOfValues(aNbElem);
myExtractUnstructuredGrid->BuildOut2InMap(); myExtractUnstructuredGrid->BuildOut2InMap();
for(int anId = 0; anId < aNbElem; anId++) for(vtkIdType anId = 0; anId < aNbElem; anId++)
{ {
vtkIdType id = anId; vtkIdType id = anId;
if(IsImplicitFunctionUsed()) if(IsImplicitFunctionUsed())
id = myExtractGeometry->GetElemObjId(id); id = myExtractGeometry->GetElemObjId(id);
id = myExtractUnstructuredGrid->GetInputId(id); id = myExtractUnstructuredGrid->GetInputId(id);
id = (id >=0) ? id : anId; id = (id >=0) ? id : anId;
int aSMDSId = myVisualObj->GetElemObjId(id); vtkIdType aSMDSId = myVisualObj->GetElemObjId(id);
anArray->SetValue(anId,aSMDSId); anArray->SetValue(anId,aSMDSId);
} }
aDataSet->GetCellData()->SetScalars(anArray); aDataSet->GetCellData()->SetScalars(anArray);

View File

@ -31,7 +31,7 @@
#include "SMESH_ControlsDef.hxx" #include "SMESH_ControlsDef.hxx"
#include "SMESH_ActorUtils.h" #include "SMESH_ActorUtils.h"
#include "SMESH_FaceOrientationFilter.h" #include "SMESH_FaceOrientationFilter.h"
#include "VTKViewer_CellLocationsArray.h" //#include "VTKViewer_CellLocationsArray.h"
#include "VTKViewer_PolyDataMapper.h" #include "VTKViewer_PolyDataMapper.h"
#include <VTKViewer_Transform.h> #include <VTKViewer_Transform.h>
@ -161,7 +161,7 @@ SMESH_DeviceActor
myTransformFilter->Delete(); myTransformFilter->Delete();
for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) for(size_t i = 0, iEnd = myPassFilter.size(); i < iEnd; i++)
myPassFilter[i]->Delete(); myPassFilter[i]->Delete();
myShrinkFilter->Delete(); myShrinkFilter->Delete();
@ -426,7 +426,7 @@ SMESH_DeviceActor
aCellTypesArray->SetNumberOfTuples( aNbCells ); aCellTypesArray->SetNumberOfTuples( aNbCells );
aScalars->SetNumberOfTuples( aNbCells ); aScalars->SetNumberOfTuples( aNbCells );
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells ); aCellLocationsArray->SetNumberOfTuples( aNbCells );
@ -491,7 +491,7 @@ SMESH_DeviceActor
aCellTypesArray->SetNumberOfTuples( aNbCells ); aCellTypesArray->SetNumberOfTuples( aNbCells );
aScalars->SetNumberOfTuples( aNbCells ); aScalars->SetNumberOfTuples( aNbCells );
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells ); aCellLocationsArray->SetNumberOfTuples( aNbCells );
@ -586,7 +586,7 @@ SMESH_DeviceActor
} }
} }
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells ); aCellLocationsArray->SetNumberOfTuples( aNbCells );
@ -604,7 +604,7 @@ SMESH_DeviceActor
( aPredicate = dynamic_cast<CoincidentNodes*>(theFunctor.get()))) ( aPredicate = dynamic_cast<CoincidentNodes*>(theFunctor.get())))
{ {
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node); vtkIdType aNbNodes = FromSmIdType<vtkIdType>(myVisualObj->GetNbEntities(SMDSAbs_Node));
for( vtkIdType i = 0; i < aNbNodes; i++ ){ for( vtkIdType i = 0; i < aNbNodes; i++ ){
vtkIdType anObjId = myVisualObj->GetNodeObjId(i); vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
if(aPredicate->IsSatisfy(anObjId)) if(aPredicate->IsSatisfy(anObjId))
@ -783,6 +783,8 @@ SMESH_DeviceActor
myGeomFilter->SetInside(false); myGeomFilter->SetInside(false);
myGeomFilter->SetWireframeMode(false); myGeomFilter->SetWireframeMode(false);
GetProperty()->SetRepresentation(theMode); GetProperty()->SetRepresentation(theMode);
case eNoneRepr:
return;
} }
SetMarkerEnabled(theMode == ePoint); SetMarkerEnabled(theMode == ePoint);
myRepresentation = theMode; myRepresentation = theMode;
@ -839,9 +841,9 @@ SMESH_DeviceActor
} }
int vtkIdType
SMESH_DeviceActor SMESH_DeviceActor
::GetNodeObjId(int theVtkID) ::GetNodeObjId(vtkIdType theVtkID)
{ {
vtkIdType anID = theVtkID; vtkIdType anID = theVtkID;
@ -855,7 +857,7 @@ SMESH_DeviceActor
double* double*
SMESH_DeviceActor SMESH_DeviceActor
::GetNodeCoord(int theObjID) ::GetNodeCoord(vtkIdType theObjID)
{ {
vtkDataSet* aDataSet = myMergeFilter->GetOutput(); vtkDataSet* aDataSet = myMergeFilter->GetOutput();
vtkIdType anID = myVisualObj->GetNodeVTKId(theObjID); vtkIdType anID = myVisualObj->GetNodeVTKId(theObjID);
@ -864,16 +866,16 @@ SMESH_DeviceActor
return aCoord; return aCoord;
} }
int vtkIdType
SMESH_DeviceActor SMESH_DeviceActor
::GetNodeVtkId(int theObjID) ::GetNodeVtkId(vtkIdType theObjID)
{ {
return myVisualObj->GetNodeVTKId(theObjID); return myVisualObj->GetNodeVTKId(theObjID);
} }
int vtkIdType
SMESH_DeviceActor SMESH_DeviceActor
::GetElemObjId(int theVtkID) ::GetElemObjId(vtkIdType theVtkID)
{ {
vtkIdType anId = myGeomFilter->GetElemObjId(theVtkID); vtkIdType anId = myGeomFilter->GetElemObjId(theVtkID);
if(anId < 0) if(anId < 0)
@ -897,7 +899,7 @@ SMESH_DeviceActor
vtkCell* vtkCell*
SMESH_DeviceActor SMESH_DeviceActor
::GetElemCell(int theObjID) ::GetElemCell(vtkIdType theObjID)
{ {
vtkDataSet* aDataSet = myVisualObj->GetUnstructuredGrid(); vtkDataSet* aDataSet = myVisualObj->GetUnstructuredGrid();
vtkIdType aGridID = myVisualObj->GetElemVTKId(theObjID); vtkIdType aGridID = myVisualObj->GetElemVTKId(theObjID);

View File

@ -68,12 +68,12 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
void SetStoreGemetryMapping(bool theStoreMapping); void SetStoreGemetryMapping(bool theStoreMapping);
void SetStoreIDMapping(bool theStoreMapping); void SetStoreIDMapping(bool theStoreMapping);
virtual int GetNodeObjId(int theVtkID); virtual vtkIdType GetNodeObjId(vtkIdType theVtkID);
virtual double* GetNodeCoord(int theObjID); virtual double* GetNodeCoord(vtkIdType theObjID);
virtual int GetNodeVtkId(int theObjID); virtual vtkIdType GetNodeVtkId(vtkIdType theObjID);
virtual int GetElemObjId(int theVtkID); virtual vtkIdType GetElemObjId(vtkIdType theVtkID);
virtual vtkCell* GetElemCell(int theObjID); virtual vtkCell* GetElemCell(vtkIdType theObjID);
virtual void SetTransform(VTKViewer_Transform* theTransform); virtual void SetTransform(VTKViewer_Transform* theTransform);
virtual vtkMTimeType GetMTime(); virtual vtkMTimeType GetMTime();
@ -108,7 +108,7 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
void SetShrink(); void SetShrink();
void UnShrink(); void UnShrink();
enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe}; enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe, eNoneRepr=-1};
EReperesent GetRepresentation(){ return myRepresentation;} EReperesent GetRepresentation(){ return myRepresentation;}
void SetRepresentation(EReperesent theMode); void SetRepresentation(EReperesent theMode);

View File

@ -58,16 +58,16 @@ SMESH_ExtractGeometry::SMESH_ExtractGeometry()
SMESH_ExtractGeometry::~SMESH_ExtractGeometry() SMESH_ExtractGeometry::~SMESH_ExtractGeometry()
{} {}
vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID) vtkIdType SMESH_ExtractGeometry::GetElemObjId(vtkIdType theVtkID)
{ {
if( theVtkID < 0 || theVtkID >= (int)myElemVTK2ObjIds.size()) return -1; if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1;
return myElemVTK2ObjIds[theVtkID]; return myElemVTK2ObjIds[theVtkID];
} }
vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID) vtkIdType SMESH_ExtractGeometry::GetNodeObjId(vtkIdType theVtkID)
{ {
if ( theVtkID < 0 || theVtkID >= (int)myNodeVTK2ObjIds.size()) return -1; if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1;
return myNodeVTK2ObjIds[theVtkID]; return myNodeVTK2ObjIds[theVtkID];
} }

View File

@ -42,8 +42,8 @@ public:
} }
bool GetStoreMapping(){ return myStoreMapping;} bool GetStoreMapping(){ return myStoreMapping;}
virtual vtkIdType GetNodeObjId(int theVtkID); virtual vtkIdType GetNodeObjId(vtkIdType theVtkID);
virtual vtkIdType GetElemObjId(int theVtkID); virtual vtkIdType GetElemObjId(vtkIdType theVtkID);
protected: protected:
SMESH_ExtractGeometry(); SMESH_ExtractGeometry();

View File

@ -61,7 +61,7 @@ SMESH_NodeLabelActor::SMESH_NodeLabelActor()
myPtsLabeledDataMapper = vtkLabeledDataMapper::New(); myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort()); myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort());
myPtsLabeledDataMapper->SetLabelFormat("%d"); //myPtsLabeledDataMapper->SetLabelFormat("%d");
myPtsLabeledDataMapper->SetLabelModeToLabelScalars(); myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
myPtsTextProp = vtkTextProperty::New(); myPtsTextProp = vtkTextProperty::New();
@ -145,18 +145,18 @@ void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled)
{ {
myPointsNumDataSet->ShallowCopy(aGrid); myPointsNumDataSet->ShallowCopy(aGrid);
vtkUnstructuredGrid *aDataSet = myPointsNumDataSet; vtkUnstructuredGrid *aDataSet = myPointsNumDataSet;
int aNbElem = aDataSet->GetNumberOfPoints(); vtkIdType aNbElem = aDataSet->GetNumberOfPoints();
vtkIntArray *anArray = vtkIntArray::New(); vtkIdTypeArray *anArray = vtkIdTypeArray::New();
anArray->SetNumberOfValues( aNbElem ); anArray->SetNumberOfValues( aNbElem );
for ( vtkIdType anId = 0; anId < aNbElem; anId++ ) for ( vtkIdType anId = 0; anId < aNbElem; anId++ )
{ {
int aSMDSId = myVisualObj->GetNodeObjId( anId ); vtkIdType aSMDSId = myVisualObj->GetNodeObjId( anId );
anArray->SetValue( anId, aSMDSId ); anArray->SetValue( anId, aSMDSId );
} }
aDataSet->GetPointData()->SetScalars( anArray ); aDataSet->GetPointData()->SetScalars( anArray );
myPtsMaskPoints->SetInputData( aDataSet ); myPtsMaskPoints->SetInputData( aDataSet );
myPointLabels->SetVisibility( GetVisibility() ); myPointLabels->SetVisibility( GetVisibility() );

View File

@ -38,7 +38,7 @@
#include <SalomeApp_Application.h> #include <SalomeApp_Application.h>
#include <VTKViewer_ExtractUnstructuredGrid.h> #include <VTKViewer_ExtractUnstructuredGrid.h>
#include <VTKViewer_CellLocationsArray.h> //#include <VTKViewer_CellLocationsArray.h>
#include CORBA_SERVER_HEADER(SMESH_Gen) #include CORBA_SERVER_HEADER(SMESH_Gen)
#include CORBA_SERVER_HEADER(SALOME_Exception) #include CORBA_SERVER_HEADER(SALOME_Exception)
@ -103,7 +103,7 @@ SMESH_VisualObjDef::~SMESH_VisualObjDef()
// functions : GetNodeObjId, GetNodeVTKId, GetElemObjId, GetElemVTKId // functions : GetNodeObjId, GetNodeVTKId, GetElemObjId, GetElemVTKId
// purpose : Methods for retrieving VTK IDs by SMDS IDs and vice versa // purpose : Methods for retrieving VTK IDs by SMDS IDs and vice versa
//================================================================================= //=================================================================================
vtkIdType SMESH_VisualObjDef::GetNodeObjId( int theVTKID ) vtkIdType SMESH_VisualObjDef::GetNodeObjId( vtkIdType theVTKID )
{ {
if (myLocalGrid) if (myLocalGrid)
{ {
@ -114,10 +114,10 @@ vtkIdType SMESH_VisualObjDef::GetNodeObjId( int theVTKID )
if( this->GetMesh() ) if( this->GetMesh() )
aNode = this->GetMesh()->FindNodeVtk( theVTKID ); aNode = this->GetMesh()->FindNodeVtk( theVTKID );
return aNode ? aNode->GetID() : -1; return aNode ? FromSmIdType<vtkIdType>(aNode->GetID()) : -1;
} }
vtkIdType SMESH_VisualObjDef::GetNodeVTKId( int theObjID ) vtkIdType SMESH_VisualObjDef::GetNodeVTKId( vtkIdType theObjID )
{ {
if (myLocalGrid) if (myLocalGrid)
{ {
@ -132,17 +132,17 @@ vtkIdType SMESH_VisualObjDef::GetNodeVTKId( int theObjID )
return aNode ? aNode->GetVtkID() : -1; return aNode ? aNode->GetVtkID() : -1;
} }
vtkIdType SMESH_VisualObjDef::GetElemObjId( int theVTKID ) vtkIdType SMESH_VisualObjDef::GetElemObjId( vtkIdType theVTKID )
{ {
if (myLocalGrid) if (myLocalGrid)
{ {
TMapOfIds::const_iterator i = myVTK2SMDSElems.find(theVTKID); TMapOfIds::const_iterator i = myVTK2SMDSElems.find(theVTKID);
return i == myVTK2SMDSElems.end() ? -1 : i->second; return i == myVTK2SMDSElems.end() ? -1 : i->second;
} }
return this->GetMesh()->FromVtkToSmds(theVTKID); return FromSmIdType<vtkIdType>(this->GetMesh()->FromVtkToSmds(theVTKID));
} }
vtkIdType SMESH_VisualObjDef::GetElemVTKId( int theObjID ) vtkIdType SMESH_VisualObjDef::GetElemVTKId( vtkIdType theObjID )
{ {
if (myLocalGrid) if (myLocalGrid)
{ {
@ -171,7 +171,7 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints )
return; return;
TEntityList aNodes; TEntityList aNodes;
vtkIdType nbNodes = GetEntities( SMDSAbs_Node, aNodes ); vtkIdType nbNodes = FromSmIdType<vtkIdType>(GetEntities( SMDSAbs_Node, aNodes ));
thePoints->SetNumberOfPoints( nbNodes ); thePoints->SetNumberOfPoints( nbNodes );
int nbPoints = 0; int nbPoints = 0;
@ -183,7 +183,7 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints )
if ( aNode != 0 ) if ( aNode != 0 )
{ {
thePoints->SetPoint( nbPoints, aNode->X(), aNode->Y(), aNode->Z() ); thePoints->SetPoint( nbPoints, aNode->X(), aNode->Y(), aNode->Z() );
int anId = aNode->GetID(); smIdType anId = aNode->GetID();
mySMDS2VTKNodes.insert( mySMDS2VTKNodes.end(), std::make_pair( anId, nbPoints )); mySMDS2VTKNodes.insert( mySMDS2VTKNodes.end(), std::make_pair( anId, nbPoints ));
myVTK2SMDSNodes.insert( myVTK2SMDSNodes.end(), std::make_pair( nbPoints, anId )); myVTK2SMDSNodes.insert( myVTK2SMDSNodes.end(), std::make_pair( nbPoints, anId ));
nbPoints++; nbPoints++;
@ -284,7 +284,7 @@ namespace{
theConnect.clear(); theConnect.clear();
for(; theNodesIter->more();) for(; theNodesIter->more();)
theConnect.push_back(theNodesIter->next()); theConnect.push_back(theNodesIter->next());
return theConnect.size(); return (int) theConnect.size();
} }
inline inline
@ -292,7 +292,7 @@ namespace{
const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes, const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes,
const TConnect& theConnect, const TConnect& theConnect,
int thePosition, int thePosition,
int theId) vtkIdType theId)
{ {
theIdList->SetId(thePosition,theSMDS2VTKNodes.find(theConnect[theId]->GetID())->second); theIdList->SetId(thePosition,theSMDS2VTKNodes.find(theConnect[theId]->GetID())->second);
} }
@ -319,7 +319,7 @@ void SMESH_VisualObjDef::buildElemPrs()
{ SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, SMDSAbs_Ball, SMDSAbs_0DElement }; { SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, SMDSAbs_Ball, SMDSAbs_0DElement };
// get entity data // get entity data
map<SMDSAbs_ElementType,int> nbEnts; map<SMDSAbs_ElementType,smIdType> nbEnts;
map<SMDSAbs_ElementType,TEntityList> anEnts; map<SMDSAbs_ElementType,TEntityList> anEnts;
vtkIdType aNbCells = 0; vtkIdType aNbCells = 0;
@ -404,9 +404,9 @@ void SMESH_VisualObjDef::buildElemPrs()
vtkIdType aNbNodes = anElem->NbNodes(); vtkIdType aNbNodes = anElem->NbNodes();
anIdList->SetNumberOfIds( aNbNodes ); anIdList->SetNumberOfIds( aNbNodes );
const vtkIdType vtkElemType = SMDS_MeshCell::toVtkType( anElem->GetEntityType() ); const VTKCellType vtkElemType = SMDS_MeshCell::toVtkType( anElem->GetEntityType() );
int anId = anElem->GetID(); smIdType anId = anElem->GetID();
mySMDS2VTKElems.insert( mySMDS2VTKElems.end(), std::make_pair( anId, iElem )); mySMDS2VTKElems.insert( mySMDS2VTKElems.end(), std::make_pair( anId, iElem ));
myVTK2SMDSElems.insert( myVTK2SMDSElems.end(), std::make_pair( iElem, anId )); myVTK2SMDSElems.insert( myVTK2SMDSElems.end(), std::make_pair( iElem, anId ));
@ -424,7 +424,7 @@ void SMESH_VisualObjDef::buildElemPrs()
anIdList->InsertNextId(ph->NbFaceNodes(i)); anIdList->InsertNextId(ph->NbFaceNodes(i));
for(int j = 1; j <= ph->NbFaceNodes(i); j++) { for(int j = 1; j <= ph->NbFaceNodes(i); j++) {
if ( const SMDS_MeshNode* n = ph->GetFaceNode( i, j )) if ( const SMDS_MeshNode* n = ph->GetFaceNode( i, j ))
anIdList->InsertNextId( mySMDS2VTKNodes[ n->GetID() ]); anIdList->InsertNextId( mySMDS2VTKNodes[ FromSmIdType<vtkIdType>(n->GetID()) ]);
} }
} }
} }
@ -435,13 +435,13 @@ void SMESH_VisualObjDef::buildElemPrs()
if (aConnectivities.size() > 0) { if (aConnectivities.size() > 0) {
aConnect.clear(); aConnect.clear();
GetConnect(aNodesIter,aConnect); GetConnect(aNodesIter,aConnect);
for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++) for (int aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]); SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
} }
else { else {
for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){ for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
const SMDS_MeshElement* aNode = aNodesIter->next(); const SMDS_MeshElement* aNode = aNodesIter->next();
anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] ); anIdList->SetId( aNodeId, mySMDS2VTKNodes[FromSmIdType<vtkIdType>(aNode->GetID())]);
} }
} }
} }
@ -465,7 +465,7 @@ void SMESH_VisualObjDef::buildElemPrs()
// Insert cells in grid // Insert cells in grid
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells ); aCellLocationsArray->SetNumberOfTuples( aNbCells );
@ -491,10 +491,10 @@ void SMESH_VisualObjDef::buildElemPrs()
// function : GetEdgeNodes // function : GetEdgeNodes
// purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 0 ) // purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 0 )
//================================================================================= //=================================================================================
bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, bool SMESH_VisualObjDef::GetEdgeNodes( const smIdType theElemId,
const int theEdgeNum, const int theEdgeNum,
int& theNodeId1, smIdType& theNodeId1,
int& theNodeId2 ) const smIdType& theNodeId2 ) const
{ {
const SMDS_Mesh* aMesh = GetMesh(); const SMDS_Mesh* aMesh = GetMesh();
if ( aMesh == 0 ) if ( aMesh == 0 )
@ -557,7 +557,7 @@ void SMESH_VisualObjDef::updateEntitiesFlags()
unsigned int tmp = myEntitiesState; unsigned int tmp = myEntitiesState;
ClearEntitiesFlags(); ClearEntitiesFlags();
map<SMDSAbs_ElementType,int> entities = SMESH::GetEntitiesFromObject(this); map<SMDSAbs_ElementType,smIdType> entities = SMESH::GetEntitiesFromObject(this);
if( myEntitiesCache[SMDSAbs_0DElement] != 0 || if( myEntitiesCache[SMDSAbs_0DElement] != 0 ||
@ -681,7 +681,7 @@ bool SMESH_MeshObj::NulData()
// function : GetElemDimension // function : GetElemDimension
// purpose : Get dimension of element // purpose : Get dimension of element
//================================================================================= //=================================================================================
int SMESH_MeshObj::GetElemDimension( const int theObjId ) int SMESH_MeshObj::GetElemDimension( const smIdType theObjId )
{ {
const SMDS_MeshElement* anElem = myClient->FindElement( theObjId ); const SMDS_MeshElement* anElem = myClient->FindElement( theObjId );
if ( anElem == 0 ) if ( anElem == 0 )
@ -703,7 +703,7 @@ int SMESH_MeshObj::GetElemDimension( const int theObjId )
// function : GetEntities // function : GetEntities
// purpose : Get entities of specified type. Return number of entities // purpose : Get entities of specified type. Return number of entities
//================================================================================= //=================================================================================
int SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const smIdType SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const
{ {
switch ( theType ) switch ( theType )
{ {
@ -742,7 +742,7 @@ int SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const
} }
} }
int SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const smIdType SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const
{ {
theObjs.clear(); theObjs.clear();
@ -834,7 +834,7 @@ SMESH_SubMeshObj::~SMESH_SubMeshObj()
// function : GetElemDimension // function : GetElemDimension
// purpose : Get dimension of element // purpose : Get dimension of element
//================================================================================= //=================================================================================
int SMESH_SubMeshObj::GetElemDimension( const int theObjId ) int SMESH_SubMeshObj::GetElemDimension( const smIdType theObjId )
{ {
return myMeshObj == 0 ? 0 : myMeshObj->GetElemDimension( theObjId ); return myMeshObj == 0 ? 0 : myMeshObj->GetElemDimension( theObjId );
} }
@ -908,13 +908,13 @@ SMDSAbs_ElementType SMESH_GroupObj::GetElementType() const
// function : getNodesFromElems // function : getNodesFromElems
// purpose : Retrieve nodes from elements // purpose : Retrieve nodes from elements
//================================================================================= //=================================================================================
static int getNodesFromElems( SMESH::long_array_var& theElemIds, static int getNodesFromElems( SMESH::smIdType_array_var& theElemIds,
const SMDS_Mesh* theMesh, const SMDS_Mesh* theMesh,
std::list<const SMDS_MeshElement*>& theResList ) std::list<const SMDS_MeshElement*>& theResList )
{ {
set<const SMDS_MeshElement*> aNodeSet; set<const SMDS_MeshElement*> aNodeSet;
for ( CORBA::Long i = 0, n = theElemIds->length(); i < n; i++ ) for ( CORBA::ULong i = 0, n = theElemIds->length(); i < n; i++ )
{ {
const SMDS_MeshElement* anElem = theMesh->FindElement( theElemIds[ i ] ); const SMDS_MeshElement* anElem = theMesh->FindElement( theElemIds[ i ] );
if ( anElem != 0 ) if ( anElem != 0 )
@ -929,11 +929,9 @@ static int getNodesFromElems( SMESH::long_array_var& theElemIds,
} }
} }
set<const SMDS_MeshElement*>::const_iterator anIter; theResList.assign( aNodeSet.begin(), aNodeSet.end() );
for ( anIter = aNodeSet.begin(); anIter != aNodeSet.end(); ++anIter )
theResList.push_back( *anIter );
return theResList.size(); return (int) aNodeSet.size();
} }
//================================================================================= //=================================================================================
@ -941,11 +939,11 @@ static int getNodesFromElems( SMESH::long_array_var& theElemIds,
// purpose : Get std::list<const SMDS_MeshElement*> from list of IDs // purpose : Get std::list<const SMDS_MeshElement*> from list of IDs
//================================================================================= //=================================================================================
static int getPointers( const SMDSAbs_ElementType theRequestType, static int getPointers( const SMDSAbs_ElementType theRequestType,
SMESH::long_array_var& theElemIds, SMESH::smIdType_array_var& theElemIds,
const SMDS_Mesh* theMesh, const SMDS_Mesh* theMesh,
std::list<const SMDS_MeshElement*>& theResList ) std::list<const SMDS_MeshElement*>& theResList )
{ {
for ( CORBA::Long i = 0, n = theElemIds->length(); i < n; i++ ) for ( CORBA::ULong i = 0, n = theElemIds->length(); i < n; i++ )
{ {
const SMDS_MeshElement* anElem = theRequestType == SMDSAbs_Node const SMDS_MeshElement* anElem = theRequestType == SMDSAbs_Node
? theMesh->FindNode( theElemIds[ i ] ) : theMesh->FindElement( theElemIds[ i ] ); ? theMesh->FindNode( theElemIds[ i ] ) : theMesh->FindElement( theElemIds[ i ] );
@ -954,7 +952,7 @@ static int getPointers( const SMDSAbs_ElementType theRequestType,
theResList.push_back( anElem ); theResList.push_back( anElem );
} }
return theResList.size(); return (int) theResList.size();
} }
@ -962,7 +960,7 @@ static int getPointers( const SMDSAbs_ElementType theRequestType,
// function : GetEntities // function : GetEntities
// purpose : Get entities of specified type. Return number of entities // purpose : Get entities of specified type. Return number of entities
//================================================================================= //=================================================================================
int SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const smIdType SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const
{ {
if(SMDSAbs_ElementType(myGroupServer->GetType()) == theType) { if(SMDSAbs_ElementType(myGroupServer->GetType()) == theType) {
return myGroupServer->Size(); return myGroupServer->Size();
@ -973,11 +971,11 @@ int SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const
return 0; return 0;
} }
int SMESH_GroupObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const smIdType SMESH_GroupObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const
{ {
theResList.clear(); theResList.clear();
SMDS_Mesh* aMesh = myMeshObj->GetMesh(); SMDS_Mesh* aMesh = myMeshObj->GetMesh();
if ( aMesh == 0 ) if ( aMesh == 0 )
return 0; return 0;
@ -985,7 +983,7 @@ int SMESH_GroupObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList&
if ( aGrpType != theType && theType != SMDSAbs_Node ) if ( aGrpType != theType && theType != SMDSAbs_Node )
return 0; return 0;
SMESH::long_array_var anIds = myGroupServer->GetListOfID(); SMESH::smIdType_array_var anIds = myGroupServer->GetListOfID();
if ( anIds->length() == 0 ) if ( anIds->length() == 0 )
return 0; return 0;
@ -1028,7 +1026,7 @@ SMESH_subMeshObj::~SMESH_subMeshObj()
// function : GetEntities // function : GetEntities
// purpose : Get entities of specified type. Return number of entities // purpose : Get entities of specified type. Return number of entities
//================================================================================= //=================================================================================
int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const smIdType SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const
{ {
switch ( theType ) switch ( theType )
{ {
@ -1043,7 +1041,7 @@ int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const
case SMDSAbs_Face: case SMDSAbs_Face:
case SMDSAbs_Volume: case SMDSAbs_Volume:
{ {
SMESH::long_array_var anIds = SMESH::smIdType_array_var anIds =
mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) ); mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
return anIds->length(); return anIds->length();
} }
@ -1053,7 +1051,7 @@ int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const
} }
} }
int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const smIdType SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const
{ {
theResList.clear(); theResList.clear();
@ -1067,7 +1065,7 @@ int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityLis
{ {
if ( theType == SMDSAbs_Node ) if ( theType == SMDSAbs_Node )
{ {
SMESH::long_array_var anIds = mySubMeshServer->GetNodesId(); SMESH::smIdType_array_var anIds = mySubMeshServer->GetNodesId();
return getPointers( SMDSAbs_Node, anIds, aMesh, theResList ); return getPointers( SMDSAbs_Node, anIds, aMesh, theResList );
} }
} }
@ -1075,12 +1073,12 @@ int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityLis
{ {
if ( theType == SMDSAbs_Node ) if ( theType == SMDSAbs_Node )
{ {
SMESH::long_array_var anIds = mySubMeshServer->GetElementsId(); SMESH::smIdType_array_var anIds = mySubMeshServer->GetElementsId();
return getNodesFromElems( anIds, aMesh, theResList ); return getNodesFromElems( anIds, aMesh, theResList );
} }
else else
{ {
SMESH::long_array_var anIds = SMESH::smIdType_array_var anIds =
mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) ); mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
return getPointers( theType, anIds, aMesh, theResList ); return getPointers( theType, anIds, aMesh, theResList );
} }

View File

@ -45,6 +45,7 @@
#include "SMDSAbs_ElementType.hxx" #include "SMDSAbs_ElementType.hxx"
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
#include <smIdType.hxx>
#include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_Mesh)
class SMDS_Mesh; class SMDS_Mesh;
@ -61,24 +62,24 @@ public:
virtual bool Update( int theIsClear = true ) = 0; virtual bool Update( int theIsClear = true ) = 0;
virtual bool NulData() = 0; virtual bool NulData() = 0;
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0; virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
virtual int GetElemDimension( const int theObjId ) = 0; virtual int GetElemDimension( const smIdType theObjId ) = 0;
virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0; virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
virtual SMDS_Mesh* GetMesh() const = 0; virtual SMDS_Mesh* GetMesh() const = 0;
virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0; virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0;
virtual bool GetEdgeNodes( const int theElemId, virtual bool GetEdgeNodes( const smIdType theElemId,
const int theEdgeNum, const int theEdgeNum,
int& theNodeId1, smIdType& theNodeId1,
int& theNodeId2 ) const = 0; smIdType& theNodeId2 ) const = 0;
virtual bool IsValid() const = 0; virtual bool IsValid() const = 0;
virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0; virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
virtual vtkIdType GetNodeObjId( int theVTKID ) = 0; virtual vtkIdType GetNodeObjId( vtkIdType theVTKID ) = 0;
virtual vtkIdType GetNodeVTKId( int theObjID ) = 0; virtual vtkIdType GetNodeVTKId( vtkIdType theObjID ) = 0;
virtual vtkIdType GetElemObjId( int theVTKID ) = 0; virtual vtkIdType GetElemObjId( vtkIdType theVTKID ) = 0;
virtual vtkIdType GetElemVTKId( int theObjID ) = 0; virtual vtkIdType GetElemVTKId( vtkIdType theObjID ) = 0;
virtual void ClearEntitiesFlags() = 0; virtual void ClearEntitiesFlags() = 0;
virtual bool GetEntitiesFlag() = 0; virtual bool GetEntitiesFlag() = 0;
virtual unsigned int GetEntitiesState() = 0; virtual unsigned int GetEntitiesState() = 0;

View File

@ -63,27 +63,27 @@ public:
virtual bool Update( int theIsClear = true ) = 0; virtual bool Update( int theIsClear = true ) = 0;
virtual bool NulData() {return 0; }; virtual bool NulData() {return 0; };
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0; virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
virtual int GetElemDimension( const int theObjId ) = 0; virtual int GetElemDimension( const smIdType theObjId ) = 0;
virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0; virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0; virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0;
virtual bool IsNodePrs() const = 0; virtual bool IsNodePrs() const = 0;
virtual SMDS_Mesh* GetMesh() const = 0; virtual SMDS_Mesh* GetMesh() const = 0;
virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0; virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0;
virtual bool IsValid() const; virtual bool IsValid() const;
virtual bool GetEdgeNodes( const int theElemId, virtual bool GetEdgeNodes( const smIdType theElemId,
const int theEdgeNum, const int theEdgeNum,
int& theNodeId1, smIdType& theNodeId1,
int& theNodeId2 ) const; smIdType& theNodeId2 ) const;
virtual vtkUnstructuredGrid* GetUnstructuredGrid(); virtual vtkUnstructuredGrid* GetUnstructuredGrid();
virtual vtkIdType GetNodeObjId( int theVTKID ); virtual vtkIdType GetNodeObjId( vtkIdType theVTKID );
virtual vtkIdType GetNodeVTKId( int theObjID ); virtual vtkIdType GetNodeVTKId( vtkIdType theObjID );
virtual vtkIdType GetElemObjId( int theVTKID ); virtual vtkIdType GetElemObjId( vtkIdType theVTKID );
virtual vtkIdType GetElemVTKId( int theObjID ); virtual vtkIdType GetElemVTKId( vtkIdType theObjID );
virtual void ClearEntitiesFlags(); virtual void ClearEntitiesFlags();
virtual bool GetEntitiesFlag(); virtual bool GetEntitiesFlag();
@ -108,7 +108,7 @@ protected:
unsigned int myEntitiesState; unsigned int myEntitiesState;
vtkUnstructuredGrid* myGrid; vtkUnstructuredGrid* myGrid;
std::map<SMDSAbs_ElementType,int> myEntitiesCache; std::map<SMDSAbs_ElementType,smIdType> myEntitiesCache;
}; };
@ -127,11 +127,11 @@ public:
virtual bool Update( int theIsClear = true ); virtual bool Update( int theIsClear = true );
virtual bool NulData(); virtual bool NulData();
virtual int GetNbEntities( const SMDSAbs_ElementType) const; virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const;
virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
virtual bool IsNodePrs() const; virtual bool IsNodePrs() const;
virtual int GetElemDimension( const int theObjId ); virtual int GetElemDimension( const smIdType theObjId );
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ); virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
@ -160,7 +160,7 @@ public:
virtual bool Update( int theIsClear = true ); virtual bool Update( int theIsClear = true );
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ); virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
virtual int GetElemDimension( const int theObjId ); virtual int GetElemDimension( const smIdType theObjId );
virtual SMDS_Mesh* GetMesh() const { return myMeshObj->GetMesh(); } virtual SMDS_Mesh* GetMesh() const { return myMeshObj->GetMesh(); }
virtual SMESH::SMESH_Mesh_ptr GetMeshServer() { return myMeshObj->GetMeshServer(); } virtual SMESH::SMESH_Mesh_ptr GetMeshServer() { return myMeshObj->GetMeshServer(); }
@ -181,8 +181,8 @@ public:
SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr, SMESH_MeshObj* ); SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr, SMESH_MeshObj* );
virtual ~SMESH_GroupObj(); virtual ~SMESH_GroupObj();
virtual int GetNbEntities( const SMDSAbs_ElementType) const; virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const;
virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
virtual bool IsNodePrs() const; virtual bool IsNodePrs() const;
virtual SMDSAbs_ElementType GetElementType() const; virtual SMDSAbs_ElementType GetElementType() const;
@ -206,8 +206,8 @@ public:
SMESH_MeshObj* ); SMESH_MeshObj* );
virtual ~SMESH_subMeshObj(); virtual ~SMESH_subMeshObj();
virtual int GetNbEntities( const SMDSAbs_ElementType) const; virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const;
virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
virtual bool IsNodePrs() const; virtual bool IsNodePrs() const;
protected: protected:

View File

@ -108,7 +108,7 @@ SMESH_SVTKActor
void void
SMESH_SVTKActor SMESH_SVTKActor
::MapCells(SALOME_Actor* theMapActor, ::MapCells(SALOME_Actor* theMapActor,
const TColStd_IndexedMapOfInteger& theMapIndex) const SVTK_TIndexedMapOfVtkId& theMapIndex)
{ {
myUnstructuredGrid->Initialize(); myUnstructuredGrid->Initialize();
myUnstructuredGrid->Allocate(); myUnstructuredGrid->Allocate();
@ -134,8 +134,9 @@ SMESH_SVTKActor
cd = aSourceGrid->GetCellData(); cd = aSourceGrid->GetCellData();
} }
outputCD->CopyAllocate(cd,aNbOfParts,aNbOfParts/2); outputCD->CopyAllocate(cd,aNbOfParts,aNbOfParts/2);
for(int ind = 1; ind <= aNbOfParts; ind++){ for(int ind = 1; ind <= aNbOfParts; ind++)
int aPartId = theMapIndex( ind ); {
vtkIdType aPartId = theMapIndex( ind );
if(vtkCell* aCell = theMapActor->GetElemCell(aPartId)) if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
{ {
if (aCell->GetCellType() != VTK_POLYHEDRON) if (aCell->GetCellType() != VTK_POLYHEDRON)

View File

@ -61,7 +61,7 @@ public:
//! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes //! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes
virtual void virtual void
MapCells(SALOME_Actor* theMapActor, MapCells(SALOME_Actor* theMapActor,
const TColStd_IndexedMapOfInteger& theMapIndex); const SVTK_TIndexedMapOfVtkId& theMapIndex);
//! To remove the actor an all its internal devices //! To remove the actor an all its internal devices

View File

@ -30,7 +30,7 @@
void SMDS_BallElement::init(const SMDS_MeshNode * node, double diameter ) void SMDS_BallElement::init(const SMDS_MeshNode * node, double diameter )
{ {
vtkIdType nodeVtkID = node->GetVtkID(); vtkIdType nodeVtkID = node->GetVtkID();
int vtkID = getGrid()->InsertNextLinkedCell( toVtkType( SMDSEntity_Ball ), 1, &nodeVtkID ); vtkIdType vtkID = getGrid()->InsertNextLinkedCell( toVtkType( SMDSEntity_Ball ), 1, &nodeVtkID );
setVtkID( vtkID ); setVtkID( vtkID );
getGrid()->SetBallDiameter( GetVtkID(), diameter ); getGrid()->SetBallDiameter( GetVtkID(), diameter );
} }

View File

@ -25,18 +25,18 @@
#include "SMDS_CellOfNodes.hxx" #include "SMDS_CellOfNodes.hxx"
SMDS_CellOfNodes::SMDS_CellOfNodes( int id, int shapeID ) SMDS_CellOfNodes::SMDS_CellOfNodes( smIdType id, int shapeID )
: myID( id ) : myID( id )
{ {
setShapeID( shapeID ); setShapeID( shapeID );
} }
void SMDS_CellOfNodes::setID(const int id) void SMDS_CellOfNodes::setID(const smIdType id)
{ {
myID = id; myID = id;
} }
int SMDS_CellOfNodes::GetID() const smIdType SMDS_CellOfNodes::GetID() const
{ {
return myID; return myID;
} }

View File

@ -31,6 +31,8 @@
#include "SMDS_MeshElement.hxx" #include "SMDS_MeshElement.hxx"
#include <smIdType.hxx>
// ============================================================ // ============================================================
/*! /*!
* \brief Base class for elements not contained in the mesh * \brief Base class for elements not contained in the mesh
@ -42,8 +44,8 @@ class SMDS_EXPORT SMDS_CellOfNodes : public SMDS_MeshElement
{ {
public: public:
virtual int GetID() const; virtual smIdType GetID() const;
virtual int GetShapeID() const; virtual int GetShapeID() const;
virtual void setIsMarked( bool is ) const; virtual void setIsMarked( bool is ) const;
virtual bool isMarked() const; virtual bool isMarked() const;
@ -52,13 +54,13 @@ public:
protected: protected:
SMDS_CellOfNodes( int id = -1, int shapeID = 0); SMDS_CellOfNodes( smIdType id = -1, int shapeID = 0);
virtual void setID( const int id); virtual void setID( const smIdType id);
virtual void setShapeID( const int shapeID ); virtual void setShapeID( const int shapeID );
int myID; smIdType myID;
int myShapeID; int myShapeID;
enum Bits { // use the 1st right bit of myShapeId to set/unset a mark enum Bits { // use the 1st right bit of myShapeId to set/unset a mark
BIT_IS_MARKED = 1, BIT_IS_MARKED = 1,

View File

@ -27,6 +27,7 @@
#include <vtkCellType.h> #include <vtkCellType.h>
#include <vtkCellLinks.h> #include <vtkCellLinks.h>
#include <smIdType.hxx>
#include <map> #include <map>
@ -232,7 +233,7 @@ void SMDS_Down1D::compactStorage()
_cellIds.resize(_nbDownCells * _maxId); _cellIds.resize(_nbDownCells * _maxId);
_vtkCellIds.resize(_maxId); _vtkCellIds.resize(_maxId);
int sizeUpCells = 0; smIdType sizeUpCells = 0;
for (int i = 0; i < _maxId; i++) for (int i = 0; i < _maxId; i++)
sizeUpCells += _upCellIdsVector[i].size(); sizeUpCells += _upCellIdsVector[i].size();
_upCellIds.resize(sizeUpCells, -1); _upCellIds.resize(sizeUpCells, -1);
@ -258,8 +259,8 @@ void SMDS_Down1D::compactStorage()
void SMDS_Down1D::addUpCell(int cellId, int upCellId, unsigned char aType) void SMDS_Down1D::addUpCell(int cellId, int upCellId, unsigned char aType)
{ {
//ASSERT((cellId >=0) && (cellId < _maxId)); //ASSERT((cellId >=0) && (cellId < _maxId));
int nbFaces = _upCellIdsVector[cellId].size(); smIdType nbFaces = _upCellIdsVector[cellId].size();
for (int i = 0; i < nbFaces; i++) for (smIdType i = 0; i < nbFaces; i++)
{ {
if ((_upCellIdsVector[cellId][i] == upCellId) && (_upCellTypesVector[cellId][i] == aType)) if ((_upCellIdsVector[cellId][i] == upCellId) && (_upCellTypesVector[cellId][i] == aType))
{ {

View File

@ -104,15 +104,15 @@ int SMDS_ElementFactory::ChunkSize()
//================================================================================ //================================================================================
/*! /*!
* \brief Return minimal ID of a non-used element * \brief Return minimal ID of a non-used element
* \return int - minimal element ID * \return smIdType - minimal element ID
*/ */
//================================================================================ //================================================================================
int SMDS_ElementFactory::GetFreeID() smIdType SMDS_ElementFactory::GetFreeID()
{ {
if ( myChunksWithUnused.empty() ) if ( myChunksWithUnused.empty() )
{ {
int id0 = myChunks.size() * theChunkSize + 1; smIdType id0 = myChunks.size() * theChunkSize + 1;
myChunks.push_back( new SMDS_ElementChunk( this, id0 )); myChunks.push_back( new SMDS_ElementChunk( this, id0 ));
} }
SMDS_ElementChunk * chunk = (*myChunksWithUnused.begin()); SMDS_ElementChunk * chunk = (*myChunksWithUnused.begin());
@ -122,15 +122,15 @@ int SMDS_ElementFactory::GetFreeID()
//================================================================================ //================================================================================
/*! /*!
* \brief Return maximal ID of an used element * \brief Return maximal ID of an used element
* \return int - element ID * \return smIdType - element ID
*/ */
//================================================================================ //================================================================================
int SMDS_ElementFactory::GetMaxID() smIdType SMDS_ElementFactory::GetMaxID()
{ {
int id = 0; smIdType id = 0;
TIndexRanges usedRanges; TIndexRanges usedRanges;
for ( int i = myChunks.size() - 1; i >= 0; --i ) for ( smIdType i = myChunks.size() - 1; i >= 0; --i )
if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges )) if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges ))
{ {
int index = usedRanges.back().second-1; int index = usedRanges.back().second-1;
@ -143,13 +143,13 @@ int SMDS_ElementFactory::GetMaxID()
//================================================================================ //================================================================================
/*! /*!
* \brief Return minimal ID of an used element * \brief Return minimal ID of an used element
* \return int - element ID * \return smIdType - element ID
*/ */
//================================================================================ //================================================================================
int SMDS_ElementFactory::GetMinID() smIdType SMDS_ElementFactory::GetMinID()
{ {
int id = 0; smIdType id = 0;
TIndexRanges usedRanges; TIndexRanges usedRanges;
for ( size_t i = 0; i < myChunks.size(); ++i ) for ( size_t i = 0; i < myChunks.size(); ++i )
if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges )) if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges ))
@ -169,20 +169,20 @@ int SMDS_ElementFactory::GetMinID()
*/ */
//================================================================================ //================================================================================
SMDS_MeshElement* SMDS_ElementFactory::NewElement( const int id ) SMDS_MeshElement* SMDS_ElementFactory::NewElement( const smIdType id )
{ {
int iChunk = ( id - 1 ) / theChunkSize; smIdType iChunk = ( id - 1 ) / theChunkSize;
int index = ( id - 1 ) % theChunkSize; smIdType index = ( id - 1 ) % theChunkSize;
while ((int) myChunks.size() <= iChunk ) while ((smIdType) myChunks.size() <= iChunk )
{ {
int id0 = myChunks.size() * theChunkSize + 1; smIdType id0 = myChunks.size() * theChunkSize + 1;
myChunks.push_back( new SMDS_ElementChunk( this, id0 )); myChunks.push_back( new SMDS_ElementChunk( this, id0 ));
} }
SMDS_MeshElement* e = myChunks[iChunk].Element( index ); SMDS_MeshElement* e = myChunks[iChunk].Element( FromSmIdType<int>(index) );
if ( !e->IsNull() ) if ( !e->IsNull() )
return 0; // element with given ID already exists return 0; // element with given ID already exists
myChunks[iChunk].UseElement( index ); myChunks[iChunk].UseElement( FromSmIdType<int>(index) );
++myNbUsedElements; ++myNbUsedElements;
e->myHolder = & myChunks[iChunk]; e->myHolder = & myChunks[iChunk];
@ -200,15 +200,15 @@ SMDS_MeshElement* SMDS_ElementFactory::NewElement( const int id )
*/ */
//================================================================================ //================================================================================
const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const int id ) const const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const smIdType id ) const
{ {
if ( id > 0 ) if ( id > 0 )
{ {
int iChunk = ( id - 1 ) / theChunkSize; smIdType iChunk = ( id - 1 ) / theChunkSize;
int index = ( id - 1 ) % theChunkSize; smIdType index = ( id - 1 ) % theChunkSize;
if ( iChunk < (int) myChunks.size() ) if ( iChunk < (smIdType) myChunks.size() )
{ {
const SMDS_MeshElement* e = myChunks[iChunk].Element( index ); const SMDS_MeshElement* e = myChunks[iChunk].Element( FromSmIdType<int>(index) );
return e->IsNull() ? 0 : e; return e->IsNull() ? 0 : e;
} }
} }
@ -218,12 +218,12 @@ const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const int id ) const
//================================================================================ //================================================================================
/*! /*!
* \brief Return an SMDS ID by a Vtk one * \brief Return an SMDS ID by a Vtk one
* \param [inout] vtkID - Vtk ID * \param [in] vtkID - Vtk ID
* \return int - SMDS ID * \return smIdType - SMDS ID
*/ */
//================================================================================ //================================================================================
int SMDS_ElementFactory::FromVtkToSmds( vtkIdType vtkID ) smIdType SMDS_ElementFactory::FromVtkToSmds( vtkIdType vtkID )
{ {
if ( vtkID >= 0 && vtkID < (vtkIdType)mySmdsIDs.size() ) if ( vtkID >= 0 && vtkID < (vtkIdType)mySmdsIDs.size() )
return mySmdsIDs[vtkID] + 1; return mySmdsIDs[vtkID] + 1;
@ -281,11 +281,11 @@ void SMDS_ElementFactory::Clear()
*/ */
//================================================================================ //================================================================================
void SMDS_ElementFactory::Compact( std::vector<int>& theVtkIDsNewToOld ) void SMDS_ElementFactory::Compact( std::vector<smIdType>& theVtkIDsNewToOld )
{ {
int newNbCells = NbUsedElements(); smIdType newNbCells = NbUsedElements();
int maxCellID = GetMaxID(); smIdType maxCellID = GetMaxID();
int newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize ); smIdType newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize );
theVtkIDsNewToOld.resize( newNbCells ); theVtkIDsNewToOld.resize( newNbCells );
@ -295,7 +295,7 @@ void SMDS_ElementFactory::Compact( std::vector<int>& theVtkIDsNewToOld )
} }
else if ( newNbCells == maxCellID ) // no holes else if ( newNbCells == maxCellID ) // no holes
{ {
int newID, minLastID = std::min( myVtkIDs.size(), theVtkIDsNewToOld.size() ); smIdType newID, minLastID = std::min( myVtkIDs.size(), theVtkIDsNewToOld.size() );
for ( newID = 0; newID < minLastID; ++newID ) for ( newID = 0; newID < minLastID; ++newID )
theVtkIDsNewToOld[ newID ] = myVtkIDs[ newID ]; theVtkIDsNewToOld[ newID ] = myVtkIDs[ newID ];
for ( ; newID < newNbCells; ++newID ) for ( ; newID < newNbCells; ++newID )
@ -303,8 +303,8 @@ void SMDS_ElementFactory::Compact( std::vector<int>& theVtkIDsNewToOld )
} }
else // there are holes in SMDS IDs else // there are holes in SMDS IDs
{ {
int newVtkID = 0; // same as new smds ID (-1) smIdType newVtkID = 0; // same as new smds ID (-1)
for ( int oldID = 1; oldID <= maxCellID; ++oldID ) // smds IDs for ( smIdType oldID = 1; oldID <= maxCellID; ++oldID ) // smds IDs
{ {
const SMDS_MeshElement* oldElem = FindElement( oldID ); const SMDS_MeshElement* oldElem = FindElement( oldID );
if ( !oldElem ) continue; if ( !oldElem ) continue;
@ -377,16 +377,16 @@ SMDS_NodeFactory::~SMDS_NodeFactory()
*/ */
//================================================================================ //================================================================================
void SMDS_NodeFactory::Compact( std::vector<int>& theVtkIDsOldToNew ) void SMDS_NodeFactory::Compact( std::vector<smIdType>& theVtkIDsOldToNew )
{ {
// IDs of VTK nodes always correspond to SMDS IDs but there can be "holes" // IDs of VTK nodes always correspond to SMDS IDs but there can be "holes"
// in the chunks. So we remove holes and report relocation in theVtkIDsOldToNew: // in the chunks. So we remove holes and report relocation in theVtkIDsOldToNew:
// theVtkIDsOldToNew[ old VtkID ] = new VtkID // theVtkIDsOldToNew[ old VtkID ] = new VtkID
int oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints(); smIdType oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints();
int newNbNodes = NbUsedElements(); smIdType newNbNodes = NbUsedElements();
int newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize ); smIdType newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize );
int maxNodeID = GetMaxID(); smIdType maxNodeID = GetMaxID();
theVtkIDsOldToNew.resize( oldNbNodes, -1 ); theVtkIDsOldToNew.resize( oldNbNodes, -1 );
@ -408,13 +408,13 @@ void SMDS_NodeFactory::Compact( std::vector<int>& theVtkIDsOldToNew )
const SMDS_MeshElement* newNode = FindElement( newID+1 ); const SMDS_MeshElement* newNode = FindElement( newID+1 );
if ( !newNode ) if ( !newNode )
newNode = NewElement( newID+1 ); newNode = NewElement( newID+1 );
int shapeID = oldNode->GetShapeID(); int shapeID = oldNode->GetShapeID();
int shapeDim = GetShapeDim( shapeID ); int shapeDim = GetShapeDim( shapeID );
int iChunk = newID / theChunkSize; smIdType iChunk = newID / theChunkSize;
myChunks[ iChunk ].SetShapeID( newNode, shapeID ); myChunks[ iChunk ].SetShapeID( newNode, shapeID );
if ( shapeDim == 2 || shapeDim == 1 ) if ( shapeDim == 2 || shapeDim == 1 )
{ {
int iChunkOld = oldID / theChunkSize; smIdType iChunkOld = oldID / theChunkSize;
TParam* oldPos = myChunks[ iChunkOld ].GetPositionPtr( oldNode ); TParam* oldPos = myChunks[ iChunkOld ].GetPositionPtr( oldNode );
TParam* newPos = myChunks[ iChunk ].GetPositionPtr( newNode, /*allocate=*/true ); TParam* newPos = myChunks[ iChunk ].GetPositionPtr( newNode, /*allocate=*/true );
if ( oldPos ) if ( oldPos )
@ -431,7 +431,7 @@ void SMDS_NodeFactory::Compact( std::vector<int>& theVtkIDsOldToNew )
} }
else // no holes else // no holes
{ {
for ( int i = 0; i < newNbNodes; ++i ) for ( smIdType i = 0; i < newNbNodes; ++i )
theVtkIDsOldToNew[ i ] = i; theVtkIDsOldToNew[ i ] = i;
} }
myChunks.resize( newNbChunks ); myChunks.resize( newNbChunks );
@ -514,7 +514,7 @@ void SMDS_NodeFactory::SetShapeDim( int shapeID, int dim )
*/ */
//================================================================================ //================================================================================
SMDS_ElementChunk::SMDS_ElementChunk( SMDS_ElementFactory* factory, int id0 ): SMDS_ElementChunk::SMDS_ElementChunk( SMDS_ElementFactory* factory, smIdType id0 ):
myFactory( factory ), myFactory( factory ),
my1stID( id0 )//, my1stID( id0 )//,
//mySubIDSet( 0 ) //mySubIDSet( 0 )
@ -565,7 +565,7 @@ void SMDS_ElementChunk::UseElement( const int index )
*/ */
//================================================================================ //================================================================================
int SMDS_ElementChunk::GetUnusedID() const smIdType SMDS_ElementChunk::GetUnusedID() const
{ {
TUsedRangeSet::set_iterator r = myUsedRanges.mySet.begin(); TUsedRangeSet::set_iterator r = myUsedRanges.mySet.begin();
for ( ; r != myUsedRanges.mySet.end(); ++r ) for ( ; r != myUsedRanges.mySet.end(); ++r )
@ -603,7 +603,7 @@ void SMDS_ElementChunk::Free( const SMDS_MeshElement* e )
*/ */
//================================================================================ //================================================================================
int SMDS_ElementChunk::GetID( const SMDS_MeshElement* e ) const smIdType SMDS_ElementChunk::GetID( const SMDS_MeshElement* e ) const
{ {
return my1stID + Index( e ); return my1stID + Index( e );
} }
@ -618,11 +618,12 @@ void SMDS_ElementChunk::SetVTKID( const SMDS_MeshElement* e, const vtkIdType vtk
{ {
if ( e->GetID() - 1 != vtkID ) if ( e->GetID() - 1 != vtkID )
{ {
if ((int) myFactory->myVtkIDs.size() <= e->GetID() - 1 ) if ((smIdType) myFactory->myVtkIDs.size() <= e->GetID() - 1 )
{ {
size_t i = myFactory->myVtkIDs.size(); vtkIdType i = (vtkIdType) myFactory->myVtkIDs.size();
myFactory->myVtkIDs.resize( e->GetID() + 100 ); myFactory->myVtkIDs.resize( e->GetID() + 100 );
for ( ; i < myFactory->myVtkIDs.size(); ++i ) vtkIdType newSize = (vtkIdType) myFactory->myVtkIDs.size();
for ( ; i < newSize; ++i )
myFactory->myVtkIDs[i] = i; myFactory->myVtkIDs[i] = i;
} }
myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID; myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID;
@ -644,10 +645,10 @@ void SMDS_ElementChunk::SetVTKID( const SMDS_MeshElement* e, const vtkIdType vtk
*/ */
//================================================================================ //================================================================================
int SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const vtkIdType SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const
{ {
size_t dfltVtkID = e->GetID() - 1; vtkIdType dfltVtkID = FromSmIdType<vtkIdType>(e->GetID() - 1);
return ( dfltVtkID < myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID; return ( dfltVtkID < (vtkIdType)myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID;
} }
//================================================================================ //================================================================================

View File

@ -40,6 +40,8 @@
#include <vtkType.h> #include <vtkType.h>
#include <smIdType.hxx>
class SMDS_ElementChunk; class SMDS_ElementChunk;
class SMDS_Mesh; class SMDS_Mesh;
class SMDS_MeshCell; class SMDS_MeshCell;
@ -67,8 +69,8 @@ protected:
TChunkVector myChunks; // array of chunks of elements TChunkVector myChunks; // array of chunks of elements
TChunkPtrSet myChunksWithUnused; // sorted chunks having unused elements TChunkPtrSet myChunksWithUnused; // sorted chunks having unused elements
std::vector< vtkIdType > myVtkIDs; // myVtkIDs[ smdsID-1 ] == vtkID std::vector< vtkIdType > myVtkIDs; // myVtkIDs[ smdsID-1 ] == vtkID
std::vector< int > mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1 std::vector< smIdType > mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1
int myNbUsedElements; // counter of elements smIdType myNbUsedElements; // counter of elements
friend class SMDS_ElementChunk; friend class SMDS_ElementChunk;
@ -78,25 +80,25 @@ public:
virtual ~SMDS_ElementFactory(); virtual ~SMDS_ElementFactory();
//! Return minimal ID of a non-used element //! Return minimal ID of a non-used element
int GetFreeID(); smIdType GetFreeID();
//! Return maximal ID of an used element //! Return maximal ID of an used element
int GetMaxID(); smIdType GetMaxID();
//! Return minimal ID of an used element //! Return minimal ID of an used element
int GetMinID(); smIdType GetMinID();
//! Return an element by ID. NULL if the element with the given ID is already used //! Return an element by ID. NULL if the element with the given ID is already used
SMDS_MeshElement* NewElement( const int id ); SMDS_MeshElement* NewElement( const smIdType id );
//! Return a SMDS_MeshCell by ID. NULL if the cell with the given ID is already used //! Return a SMDS_MeshCell by ID. NULL if the cell with the given ID is already used
SMDS_MeshCell* NewCell( const int id ) { return static_cast<SMDS_MeshCell*>( NewElement( id )); } SMDS_MeshCell* NewCell( const smIdType id ) { return static_cast<SMDS_MeshCell*>( NewElement( id )); }
//! Return an used element by ID. NULL if the element with the given ID is not yet used //! Return an used element by ID. NULL if the element with the given ID is not yet used
const SMDS_MeshElement* FindElement( const int id ) const; const SMDS_MeshElement* FindElement( const smIdType id ) const;
//! Return a number of used elements //! Return a number of used elements
int NbUsedElements() const { return myNbUsedElements; } smIdType NbUsedElements() const { return myNbUsedElements; }
//! Return an iterator on all element filtered using a given filter. //! Return an iterator on all element filtered using a given filter.
// nbElemsToReturn is used to optimize by stopping the iteration as soon as // nbElemsToReturn is used to optimize by stopping the iteration as soon as
@ -119,14 +121,14 @@ public:
void Free( const SMDS_MeshElement* ); void Free( const SMDS_MeshElement* );
//! Return an SMDS ID by a Vtk one //! Return an SMDS ID by a Vtk one
int FromVtkToSmds( vtkIdType vtkID ); smIdType FromVtkToSmds( vtkIdType vtkID );
//! De-allocate all elements //! De-allocate all elements
virtual void Clear(); virtual void Clear();
//! Remove unused elements located not at the end of the last chunk. //! Remove unused elements located not at the end of the last chunk.
// Minimize allocated memory // Minimize allocated memory
virtual void Compact(std::vector<int>& idCellsOldToNew); virtual void Compact(std::vector<smIdType>& idCellsOldToNew);
//! Return true if Compact() will change IDs of elements //! Return true if Compact() will change IDs of elements
virtual bool CompactChangePointers(); virtual bool CompactChangePointers();
@ -149,10 +151,10 @@ public:
~SMDS_NodeFactory(); ~SMDS_NodeFactory();
//! Return a SMDS_MeshNode by ID. NULL if the node with the given ID is already used //! Return a SMDS_MeshNode by ID. NULL if the node with the given ID is already used
SMDS_MeshNode* NewNode( int id ) { return (SMDS_MeshNode*) NewElement(id); } SMDS_MeshNode* NewNode( smIdType id ) { return (SMDS_MeshNode*) NewElement(id); }
//! Return an used node by ID. NULL if the node with the given ID is not yet used //! Return an used node by ID. NULL if the node with the given ID is not yet used
const SMDS_MeshNode* FindNode( int id ) { return (const SMDS_MeshNode*) FindElement(id); } const SMDS_MeshNode* FindNode( smIdType id ) { return (const SMDS_MeshNode*) FindElement(id); }
//! Set a total number of sub-shapes in the main shape //! Set a total number of sub-shapes in the main shape
void SetNbShapes( size_t nbShapes ); void SetNbShapes( size_t nbShapes );
@ -168,7 +170,7 @@ public:
//! Remove unused nodes located not at the end of the last chunk. //! Remove unused nodes located not at the end of the last chunk.
// Minimize allocated memory // Minimize allocated memory
virtual void Compact(std::vector<int>& idNodesOldToNew); virtual void Compact(std::vector<smIdType>& idNodesOldToNew);
//! Return true if Compact() will change IDs of node //! Return true if Compact() will change IDs of node
virtual bool CompactChangePointers(); virtual bool CompactChangePointers();
@ -277,7 +279,7 @@ struct _RangeSet
rNext = mySet.upper_bound( theIndex ); rNext = mySet.upper_bound( theIndex );
r = rNext - 1; r = rNext - 1;
} }
int rSize = Size( r ); // range size int rSize = Size( r ); // range size
attr_t rValue = r->myValue; attr_t rValue = r->myValue;
if ( rValue == theValue ) if ( rValue == theValue )
return rValue; // it happens while compacting return rValue; // it happens while compacting
@ -370,7 +372,7 @@ class SMDS_ElementChunk
{ {
SMDS_ElementFactory* myFactory; // holder of this chunk SMDS_ElementFactory* myFactory; // holder of this chunk
SMDS_MeshElement* myElements; // array of elements SMDS_MeshElement* myElements; // array of elements
int my1stID; // ID of myElements[0] smIdType my1stID; // ID of myElements[0]
TBitSet myMarkedSet; // mark some elements TBitSet myMarkedSet; // mark some elements
TUsedRangeSet myUsedRanges; // ranges of used/unused elements TUsedRangeSet myUsedRanges; // ranges of used/unused elements
TSubIDRangeSet mySubIDRanges; // ranges of elements on the same sub-shape TSubIDRangeSet mySubIDRanges; // ranges of elements on the same sub-shape
@ -381,7 +383,7 @@ class SMDS_ElementChunk
public: public:
SMDS_ElementChunk( SMDS_ElementFactory* factory = 0, int id0 = 0 ); SMDS_ElementChunk( SMDS_ElementFactory* factory = 0, smIdType id0 = 0 );
~SMDS_ElementChunk(); ~SMDS_ElementChunk();
//! Return an element by an index [0,ChunkSize()] //! Return an element by an index [0,ChunkSize()]
@ -391,7 +393,7 @@ public:
const SMDS_MeshElement* Element(int index) const { return & myElements[index]; } const SMDS_MeshElement* Element(int index) const { return & myElements[index]; }
//! Return ID of the first non-used element //! Return ID of the first non-used element
int GetUnusedID() const; smIdType GetUnusedID() const;
//! Mark an element as used //! Mark an element as used
void UseElement( const int index ); void UseElement( const int index );
@ -403,10 +405,10 @@ public:
static bool IsUsed( const _UsedRange& r ) { return r.myValue; } static bool IsUsed( const _UsedRange& r ) { return r.myValue; }
//! Return index of an element in the chunk //! Return index of an element in the chunk
int Index( const SMDS_MeshElement* e ) const { return e - myElements; } int Index( const SMDS_MeshElement* e ) const { return (int)( e - myElements ); }
//! Return ID of the 1st element in the chunk //! Return ID of the 1st element in the chunk
int Get1stID() const { return my1stID; } smIdType Get1stID() const { return my1stID; }
//! Return pointer to on-shape-parameters of a node //! Return pointer to on-shape-parameters of a node
TParam* GetPositionPtr( const SMDS_MeshElement* node, bool allocate=false ); TParam* GetPositionPtr( const SMDS_MeshElement* node, bool allocate=false );
@ -429,9 +431,9 @@ public:
// Methods called by SMDS_MeshElement // Methods called by SMDS_MeshElement
int GetID( const SMDS_MeshElement* e ) const; smIdType GetID( const SMDS_MeshElement* e ) const;
int GetVtkID( const SMDS_MeshElement* e ) const; vtkIdType GetVtkID( const SMDS_MeshElement* e ) const;
void SetVTKID( const SMDS_MeshElement* e, const vtkIdType id ); void SetVTKID( const SMDS_MeshElement* e, const vtkIdType id );
int GetShapeID( const SMDS_MeshElement* e ) const; int GetShapeID( const SMDS_MeshElement* e ) const;
@ -563,7 +565,7 @@ SMDS_ElementFactory::GetShapeIterator( int shapeID,
size_t nbElemsToReturn, size_t nbElemsToReturn,
const SMDS_MeshElement* sm1stElem ) const SMDS_MeshElement* sm1stElem )
{ {
int iChunk = sm1stElem ? (( sm1stElem->GetID() - 1 ) / ChunkSize()) : 0; smIdType iChunk = sm1stElem ? (( sm1stElem->GetID() - 1 ) / ChunkSize()) : 0;
typedef _ChunkIterator< ElemIterator, TSubIDRangeSet > TChuckIterator; typedef _ChunkIterator< ElemIterator, TSubIDRangeSet > TChuckIterator;
return boost::make_shared< TChuckIterator >( myChunks, return boost::make_shared< TChuckIterator >( myChunks,
& SMDS_ElementChunk::GetSubIDRangesMinMax, & SMDS_ElementChunk::GetSubIDRangesMinMax,

View File

@ -59,8 +59,7 @@ SMDS_ElementHolder::~SMDS_ElementHolder()
void SMDS_ElementHolder::beforeCompacting() void SMDS_ElementHolder::beforeCompacting()
{ {
int i = 0; for ( SMDS_ElemIteratorPtr it = getElements(); it->more(); )
for ( SMDS_ElemIteratorPtr it = getElements(); it->more(); ++i )
{ {
const SMDS_MeshElement* e = it->next(); const SMDS_MeshElement* e = it->next();
if ( !e ) continue; if ( !e ) continue;
@ -74,7 +73,7 @@ void SMDS_ElementHolder::beforeCompacting()
else else
{ {
myExternalElems.push_back( e ); myExternalElems.push_back( e );
myVtkIDs.push_back( -1 * (int)myExternalElems.size() ); myVtkIDs.push_back( -1 * (vtkIdType) myExternalElems.size() );
} }
} }
} }
@ -84,8 +83,8 @@ void SMDS_ElementHolder::beforeCompacting()
//purpose : restore pointers to elements //purpose : restore pointers to elements
//======================================================================= //=======================================================================
void SMDS_ElementHolder::restoreElements( const std::vector<int>& idNodesOldToNew, void SMDS_ElementHolder::restoreElements( const std::vector<smIdType>& idNodesOldToNew,
const std::vector<int>& idCellsOldToNew ) const std::vector<smIdType>& idCellsOldToNew )
{ {
tmpClear(); tmpClear();
@ -94,21 +93,21 @@ void SMDS_ElementHolder::restoreElements( const std::vector<int>& idNodesOldToNe
std::vector< bool >::iterator isNode = myIsNode.begin(); std::vector< bool >::iterator isNode = myIsNode.begin();
for ( size_t i = 0; i < myVtkIDs.size(); ++i, ++isNode ) for ( size_t i = 0; i < myVtkIDs.size(); ++i, ++isNode )
{ {
int vtkID = myVtkIDs[i]; vtkIdType vtkID = myVtkIDs[i];
if ( vtkID < 0 ) if ( vtkID < 0 )
{ {
elem = myExternalElems[ (-vtkID)-1 ]; elem = myExternalElems[ (-vtkID)-1 ];
} }
else if ( *isNode ) else if ( *isNode )
{ {
if ( vtkID < (int)idNodesOldToNew.size() ) if ( vtkID < (vtkIdType)idNodesOldToNew.size() )
elem = myMesh->FindNodeVtk( idNodesOldToNew[ vtkID ]); elem = myMesh->FindNodeVtk( idNodesOldToNew[ vtkID ]);
else else
elem = myMesh->FindNodeVtk( vtkID ); elem = myMesh->FindNodeVtk( vtkID );
} }
else else
{ {
if ( vtkID < (int)idCellsOldToNew.size() ) if ( vtkID < (vtkIdType)idCellsOldToNew.size() )
elem = myMesh->FindElementVtk( idCellsOldToNew[ vtkID ]); elem = myMesh->FindElementVtk( idCellsOldToNew[ vtkID ]);
else else
elem = myMesh->FindElementVtk( vtkID ); elem = myMesh->FindElementVtk( vtkID );

View File

@ -29,6 +29,9 @@
#include "SMDS_ElemIterator.hxx" #include "SMDS_ElemIterator.hxx"
#include <smIdType.hxx>
#include <vtkType.h>
#include <vector> #include <vector>
#include <set> #include <set>
@ -80,12 +83,12 @@ class SMDS_EXPORT SMDS_ElementHolder
void beforeCompacting(); void beforeCompacting();
//! restore pointers to elements //! restore pointers to elements
void restoreElements( const std::vector<int>& idNodessOldToNew, void restoreElements( const std::vector<smIdType>& idNodessOldToNew,
const std::vector<int>& idCellsOldToNew ); const std::vector<smIdType>& idCellsOldToNew );
std::vector<const SMDS_MeshElement*> myExternalElems; //!< elements not contained in the mesh std::vector<const SMDS_MeshElement*> myExternalElems; //!< elements not contained in the mesh
std::vector< int > myVtkIDs; //!< vtk IDs of elements std::vector< vtkIdType > myVtkIDs; //!< vtk IDs of elements
std::vector< bool > myIsNode; std::vector< bool > myIsNode;
std::set< SMDS_ElementHolder* >::iterator myPtrInMesh; std::set< SMDS_ElementHolder* >::iterator myPtrInMesh;
}; };

View File

@ -183,7 +183,7 @@ SMDS_MeshNode * SMDS_Mesh::AddNode(double x, double y, double z)
///@param ID : The ID of the MeshNode to create ///@param ID : The ID of the MeshNode to create
///@return : The created node or NULL if a node with this ID already exists ///@return : The created node or NULL if a node with this ID already exists
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshNode * SMDS_Mesh::AddNodeWithID( double x, double y, double z, int ID ) SMDS_MeshNode * SMDS_Mesh::AddNodeWithID( double x, double y, double z, smIdType ID )
{ {
// find the MeshNode corresponding to ID // find the MeshNode corresponding to ID
SMDS_MeshNode *node = myNodeFactory->NewNode( ID ); SMDS_MeshNode *node = myNodeFactory->NewNode( ID );
@ -201,7 +201,7 @@ SMDS_MeshNode * SMDS_Mesh::AddNodeWithID( double x, double y, double z, int ID )
/// create a Mesh0DElement and add it to the current Mesh /// create a Mesh0DElement and add it to the current Mesh
/// @return : The created Mesh0DElement /// @return : The created Mesh0DElement
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(int idnode, int ID) SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(smIdType idnode, smIdType ID)
{ {
const SMDS_MeshNode * node = myNodeFactory->FindNode(idnode); const SMDS_MeshNode * node = myNodeFactory->FindNode(idnode);
if (!node) return NULL; if (!node) return NULL;
@ -224,7 +224,7 @@ SMDS_Mesh0DElement* SMDS_Mesh::Add0DElement(const SMDS_MeshNode * node)
/// @return The created 0D element or NULL if an element with this /// @return The created 0D element or NULL if an element with this
/// ID already exists or if input node is not found. /// ID already exists or if input node is not found.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(const SMDS_MeshNode * n, int ID) SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(const SMDS_MeshNode * n, smIdType ID)
{ {
if (!n) return 0; if (!n) return 0;
@ -244,7 +244,7 @@ SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(const SMDS_MeshNode * n, int I
/// create a Ball and add it to the current Mesh /// create a Ball and add it to the current Mesh
/// @return : The created Ball /// @return : The created Ball
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_BallElement* SMDS_Mesh::AddBallWithID( int idnode, double diameter, int ID ) SMDS_BallElement* SMDS_Mesh::AddBallWithID( smIdType idnode, double diameter, smIdType ID )
{ {
const SMDS_MeshNode * node = myNodeFactory->FindNode( idnode ); const SMDS_MeshNode * node = myNodeFactory->FindNode( idnode );
if (!node) return NULL; if (!node) return NULL;
@ -268,7 +268,7 @@ SMDS_BallElement* SMDS_Mesh::AddBall(const SMDS_MeshNode * node, double diameter
/// @return The created 0D element or NULL if an element with this /// @return The created 0D element or NULL if an element with this
/// ID already exists or if input node is not found. /// ID already exists or if input node is not found.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_BallElement* SMDS_Mesh::AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID) SMDS_BallElement* SMDS_Mesh::AddBallWithID(const SMDS_MeshNode * n, double diameter, smIdType ID)
{ {
if (!n) return 0; if (!n) return 0;
@ -288,7 +288,7 @@ SMDS_BallElement* SMDS_Mesh::AddBallWithID(const SMDS_MeshNode * n, double diame
/// @return : The created MeshEdge /// @return : The created MeshEdge
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(int idnode1, int idnode2, int ID) SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(smIdType idnode1, smIdType idnode2, smIdType ID)
{ {
const SMDS_MeshNode * node1 = myNodeFactory->FindNode(idnode1); const SMDS_MeshNode * node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode * node2 = myNodeFactory->FindNode(idnode2); const SMDS_MeshNode * node2 = myNodeFactory->FindNode(idnode2);
@ -318,7 +318,7 @@ SMDS_MeshEdge* SMDS_Mesh::AddEdge(const SMDS_MeshNode * node1,
SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 ) return 0; if ( !n1 || !n2 ) return 0;
@ -347,7 +347,10 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1,
/// Add a triangle defined by its nodes IDs /// Add a triangle defined by its nodes IDs
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int idnode1, int idnode2, int idnode3, int ID) SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType idnode1,
smIdType idnode2,
smIdType idnode3,
smIdType ID)
{ {
const SMDS_MeshNode * node1 = myNodeFactory->FindNode(idnode1); const SMDS_MeshNode * node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode * node2 = myNodeFactory->FindNode(idnode2); const SMDS_MeshNode * node2 = myNodeFactory->FindNode(idnode2);
@ -363,7 +366,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int idnode1, int idnode2, int idnode3, i
SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 ) return 0; if ( !n1 || !n2 || !n3 ) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -394,11 +397,11 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1,
/// Add a quadrangle defined by its nodes IDs /// Add a quadrangle defined by its nodes IDs
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int idnode1, SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType idnode1,
int idnode2, smIdType idnode2,
int idnode3, smIdType idnode3,
int idnode4, smIdType idnode4,
int ID) smIdType ID)
{ {
const SMDS_MeshNode *node1, *node2, *node3, *node4; const SMDS_MeshNode *node1, *node2, *node3, *node4;
node1 = myNodeFactory->FindNode(idnode1); node1 = myNodeFactory->FindNode(idnode1);
@ -417,7 +420,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n4 ) return 0; if ( !n1 || !n2 || !n3 || !n4 ) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -451,11 +454,11 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
///or if input nodes are not found. ///or if input nodes are not found.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
int idnode2, smIdType idnode2,
int idnode3, smIdType idnode3,
int idnode4, smIdType idnode4,
int ID) smIdType ID)
{ {
const SMDS_MeshNode *node1, *node2, *node3, *node4; const SMDS_MeshNode *node1, *node2, *node3, *node4;
node1 = myNodeFactory->FindNode(idnode1); node1 = myNodeFactory->FindNode(idnode1);
@ -476,7 +479,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n4 ) return 0; if ( !n1 || !n2 || !n3 || !n4 ) return 0;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -513,12 +516,12 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
///or if input nodes are not found. ///or if input nodes are not found.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
int idnode2, smIdType idnode2,
int idnode3, smIdType idnode3,
int idnode4, smIdType idnode4,
int idnode5, smIdType idnode5,
int ID) smIdType ID)
{ {
const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5; const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5;
node1 = myNodeFactory->FindNode(idnode1); node1 = myNodeFactory->FindNode(idnode1);
@ -542,7 +545,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n4 || !n5 ) return 0; if ( !n1 || !n2 || !n3 || !n4 || !n5 ) return 0;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -569,7 +572,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6) const SMDS_MeshNode * n6)
{ {
int ID = myCellFactory->GetFreeID(); smIdType ID = myCellFactory->GetFreeID();
return SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID); return SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID);
} }
@ -581,13 +584,13 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
///or if input nodes are not found. ///or if input nodes are not found.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
int idnode2, smIdType idnode2,
int idnode3, smIdType idnode3,
int idnode4, smIdType idnode4,
int idnode5, smIdType idnode5,
int idnode6, smIdType idnode6,
int ID) smIdType ID)
{ {
const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6; const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6;
node1 = myNodeFactory->FindNode(idnode1); node1 = myNodeFactory->FindNode(idnode1);
@ -612,7 +615,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6, const SMDS_MeshNode * n6,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 ) return 0; if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 ) return 0;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -656,19 +659,19 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
///or if input nodes are not found. ///or if input nodes are not found.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
int idnode2, smIdType idnode2,
int idnode3, smIdType idnode3,
int idnode4, smIdType idnode4,
int idnode5, smIdType idnode5,
int idnode6, smIdType idnode6,
int idnode7, smIdType idnode7,
int idnode8, smIdType idnode8,
int idnode9, smIdType idnode9,
int idnode10, smIdType idnode10,
int idnode11, smIdType idnode11,
int idnode12, smIdType idnode12,
int ID) smIdType ID)
{ {
const SMDS_MeshNode *node1 = myNodeFactory->FindNode(idnode1); const SMDS_MeshNode *node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode *node2 = myNodeFactory->FindNode(idnode2); const SMDS_MeshNode *node2 = myNodeFactory->FindNode(idnode2);
@ -705,7 +708,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n10, const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11, const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
int ID) smIdType ID)
{ {
SMDS_MeshVolume* volume = 0; SMDS_MeshVolume* volume = 0;
if(!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || if(!n1 || !n2 || !n3 || !n4 || !n5 || !n6 ||
@ -738,7 +741,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n7, const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8) const SMDS_MeshNode * n8)
{ {
int ID = myCellFactory->GetFreeID(); smIdType ID = myCellFactory->GetFreeID();
return SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, ID); return SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, ID);
} }
@ -750,15 +753,15 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
///exists or if input nodes are not found. ///exists or if input nodes are not found.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
int idnode2, smIdType idnode2,
int idnode3, smIdType idnode3,
int idnode4, smIdType idnode4,
int idnode5, smIdType idnode5,
int idnode6, smIdType idnode6,
int idnode7, smIdType idnode7,
int idnode8, smIdType idnode8,
int ID) smIdType ID)
{ {
const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6, *node7, *node8; const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6, *node7, *node8;
node1 = myNodeFactory->FindNode(idnode1); node1 = myNodeFactory->FindNode(idnode1);
@ -789,7 +792,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n6, const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7, const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8, const SMDS_MeshNode * n8,
int ID) smIdType ID)
{ {
SMDS_MeshVolume* volume = 0; SMDS_MeshVolume* volume = 0;
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8) return volume; if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8) return volume;
@ -809,12 +812,12 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
/// Add a polygon defined by its nodes IDs /// Add a polygon defined by its nodes IDs
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<int> & nodes_ids, SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
const int ID) const smIdType ID)
{ {
int nbNodes = nodes_ids.size(); size_t nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes); std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (int i = 0; i < nbNodes; i++) { for ( size_t i = 0; i < nbNodes; i++) {
nodes[i] = myNodeFactory->FindNode( nodes_ids[i] ); nodes[i] = myNodeFactory->FindNode( nodes_ids[i] );
if (!nodes[i]) return NULL; if (!nodes[i]) return NULL;
} }
@ -827,7 +830,7 @@ SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<int> & nodes
SMDS_MeshFace* SMDS_MeshFace*
SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes, SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes,
const int ID) const smIdType ID)
{ {
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -856,8 +859,8 @@ SMDS_MeshFace* SMDS_Mesh::AddPolygonalFace (const std::vector<const SMDS_MeshNod
/// Add a quadratic polygon defined by its nodes IDs /// Add a quadratic polygon defined by its nodes IDs
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<int> & nodes_ids, SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
const int ID) const smIdType ID)
{ {
std::vector<const SMDS_MeshNode*> nodes( nodes_ids.size() ); std::vector<const SMDS_MeshNode*> nodes( nodes_ids.size() );
for ( size_t i = 0; i < nodes.size(); i++) { for ( size_t i = 0; i < nodes.size(); i++) {
@ -873,7 +876,7 @@ SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<int> & n
SMDS_MeshFace* SMDS_MeshFace*
SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes, SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes,
const int ID) const smIdType ID)
{ {
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
if ( nodes.empty() ) if ( nodes.empty() )
@ -904,13 +907,13 @@ SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFace (const std::vector<const SMDS_Mes
/// or if input nodes are not found. /// or if input nodes are not found.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<int> & nodes_ids, SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdType> & nodes_ids,
const std::vector<int> & quantities, const std::vector<int> & quantities,
const int ID) const smIdType ID)
{ {
int nbNodes = nodes_ids.size(); size_t nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes); std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (int i = 0; i < nbNodes; i++) { for ( size_t i = 0; i < nbNodes; i++) {
nodes[i] = myNodeFactory->FindNode(nodes_ids[i]); nodes[i] = myNodeFactory->FindNode(nodes_ids[i]);
if (!nodes[i]) return NULL; if (!nodes[i]) return NULL;
} }
@ -926,7 +929,7 @@ SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<int> &
SMDS_MeshVolume* SMDS_MeshVolume*
SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<const SMDS_MeshNode*>& nodes, SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int> & quantities, const std::vector<int> & quantities,
const int ID) const smIdType ID)
{ {
if ( nodes.empty() || quantities.empty() ) if ( nodes.empty() || quantities.empty() )
return NULL; return NULL;
@ -951,7 +954,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*> & nodes, (const std::vector<const SMDS_MeshNode*> & nodes,
const std::vector<int> & quantities) const std::vector<int> & quantities)
{ {
int ID = myCellFactory->GetFreeID(); smIdType ID = myCellFactory->GetFreeID();
return SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID); return SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
} }
@ -987,7 +990,7 @@ void SMDS_Mesh::MoveNode(const SMDS_MeshNode *n, double x, double y, double z)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the node whose SMDS ID is 'ID'. /// Return the node whose SMDS ID is 'ID'.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const const SMDS_MeshNode * SMDS_Mesh::FindNode(smIdType ID) const
{ {
return myNodeFactory->FindNode( ID ); return myNodeFactory->FindNode( ID );
} }
@ -995,12 +998,12 @@ const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the node whose VTK ID is 'vtkId'. /// Return the node whose VTK ID is 'vtkId'.
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(int vtkId) const const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(vtkIdType vtkId) const
{ {
return myNodeFactory->FindNode( vtkId + 1 ); return myNodeFactory->FindNode( vtkId + 1 );
} }
const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(int IDelem) const const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(vtkIdType IDelem) const
{ {
return myCellFactory->FindElement( FromVtkToSmds( IDelem )); return myCellFactory->FindElement( FromVtkToSmds( IDelem ));
} }
@ -1356,7 +1359,7 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1,
//purpose : //purpose :
//======================================================================= //=======================================================================
const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const const SMDS_MeshElement* SMDS_Mesh::FindElement(smIdType IDelem) const
{ {
return myCellFactory->FindElement( IDelem ); return myCellFactory->FindElement( IDelem );
} }
@ -1435,7 +1438,7 @@ int SMDS_Mesh::GetElementsByNodes(const std::vector<const SMDS_MeshNode *>& node
} }
foundElems.clear(); foundElems.clear();
if ( n0 ) if ( n0 && minNbInverse > 0 )
{ {
foundElems.reserve( minNbInverse ); foundElems.reserve( minNbInverse );
SMDS_ElemIteratorPtr eIt = n0->GetInverseElementIterator( type ); SMDS_ElemIteratorPtr eIt = n0->GetInverseElementIterator( type );
@ -1456,7 +1459,7 @@ int SMDS_Mesh::GetElementsByNodes(const std::vector<const SMDS_MeshNode *>& node
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of nodes /// Return the number of nodes
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::NbNodes() const smIdType SMDS_Mesh::NbNodes() const
{ {
return myInfo.NbNodes(); return myInfo.NbNodes();
} }
@ -1464,14 +1467,14 @@ int SMDS_Mesh::NbNodes() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of elements /// Return the number of elements
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::NbElements() const smIdType SMDS_Mesh::NbElements() const
{ {
return myInfo.NbElements(); return myInfo.NbElements();
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of 0D elements /// Return the number of 0D elements
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::Nb0DElements() const smIdType SMDS_Mesh::Nb0DElements() const
{ {
return myInfo.Nb0DElements(); return myInfo.Nb0DElements();
} }
@ -1479,7 +1482,7 @@ int SMDS_Mesh::Nb0DElements() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of 0D elements /// Return the number of 0D elements
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::NbBalls() const smIdType SMDS_Mesh::NbBalls() const
{ {
return myInfo.NbBalls(); return myInfo.NbBalls();
} }
@ -1487,7 +1490,7 @@ int SMDS_Mesh::NbBalls() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of edges (including construction edges) /// Return the number of edges (including construction edges)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::NbEdges() const smIdType SMDS_Mesh::NbEdges() const
{ {
return myInfo.NbEdges(); return myInfo.NbEdges();
} }
@ -1495,7 +1498,7 @@ int SMDS_Mesh::NbEdges() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of faces (including construction faces) /// Return the number of faces (including construction faces)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::NbFaces() const smIdType SMDS_Mesh::NbFaces() const
{ {
return myInfo.NbFaces(); return myInfo.NbFaces();
} }
@ -1503,7 +1506,7 @@ int SMDS_Mesh::NbFaces() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of volumes /// Return the number of volumes
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::NbVolumes() const smIdType SMDS_Mesh::NbVolumes() const
{ {
return myInfo.NbVolumes(); return myInfo.NbVolumes();
} }
@ -1512,7 +1515,7 @@ int SMDS_Mesh::NbVolumes() const
/// Return the number of child mesh of this mesh. /// Return the number of child mesh of this mesh.
/// Note that the tree structure of SMDS_Mesh is unused in SMESH /// Note that the tree structure of SMDS_Mesh is unused in SMESH
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
int SMDS_Mesh::NbSubMesh() const smIdType SMDS_Mesh::NbSubMesh() const
{ {
return myChildren.size(); return myChildren.size();
} }
@ -1586,7 +1589,7 @@ SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator() const
SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) const SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) const
{ {
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ), return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ),
nbElems); nbElems);
} }
@ -1597,7 +1600,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementEntityIterator(SMDSAbs_EntityType type) c
{ {
return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter ); return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter );
} }
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator<SMDS_ElemIterator>( new SMDS_MeshElement::EntityFilter( type ), return myCellFactory->GetIterator<SMDS_ElemIterator>( new SMDS_MeshElement::EntityFilter( type ),
nbElems); nbElems);
} }
@ -1617,7 +1620,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter ); return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter );
default: default:
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ),
nbElems); nbElems);
} }
@ -1631,7 +1634,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
{ {
typedef SMDS_EdgeIterator TIterator; typedef SMDS_EdgeIterator TIterator;
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges(); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges();
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ),
nbElems); nbElems);
} }
@ -1643,7 +1646,7 @@ SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
{ {
typedef SMDS_FaceIterator TIterator; typedef SMDS_FaceIterator TIterator;
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces(); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces();
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ),
nbElems); nbElems);
} }
@ -1655,7 +1658,7 @@ SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const
{ {
typedef SMDS_VolumeIterator TIterator; typedef SMDS_VolumeIterator TIterator;
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes(); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes();
return return
myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ), myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ),
nbElems ); nbElems );
@ -1871,7 +1874,7 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem,
n->RemoveInverseElement((*it)); n->RemoveInverseElement((*it));
} }
int vtkid = (*it)->GetVtkID(); vtkIdType vtkid = (*it)->GetVtkID();
switch ((*it)->GetType()) { switch ((*it)->GetType()) {
case SMDSAbs_Node: case SMDSAbs_Node:
@ -1916,7 +1919,7 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem,
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem) void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
{ {
const int vtkId = elem->GetVtkID(); const vtkIdType vtkId = elem->GetVtkID();
SMDSAbs_ElementType aType = elem->GetType(); SMDSAbs_ElementType aType = elem->GetType();
if ( aType == SMDSAbs_Node ) if ( aType == SMDSAbs_Node )
{ {
@ -1977,7 +1980,7 @@ bool SMDS_Mesh::Contains (const SMDS_MeshElement* elem) const
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMDS_Mesh::MaxNodeID() const smIdType SMDS_Mesh::MaxNodeID() const
{ {
return myNodeFactory->GetMaxID(); return myNodeFactory->GetMaxID();
} }
@ -1987,7 +1990,7 @@ int SMDS_Mesh::MaxNodeID() const
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMDS_Mesh::MinNodeID() const smIdType SMDS_Mesh::MinNodeID() const
{ {
return myNodeFactory->GetMinID(); return myNodeFactory->GetMinID();
} }
@ -1997,7 +2000,7 @@ int SMDS_Mesh::MinNodeID() const
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMDS_Mesh::MaxElementID() const smIdType SMDS_Mesh::MaxElementID() const
{ {
return myCellFactory->GetMaxID(); return myCellFactory->GetMaxID();
} }
@ -2007,7 +2010,7 @@ int SMDS_Mesh::MaxElementID() const
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMDS_Mesh::MinElementID() const smIdType SMDS_Mesh::MinElementID() const
{ {
return myCellFactory->GetMinID(); return myCellFactory->GetMinID();
} }
@ -2029,7 +2032,7 @@ int SMDS_Mesh::MinElementID() const
//purpose : Return type of element or node with id //purpose : Return type of element or node with id
//======================================================================= //=======================================================================
SMDSAbs_ElementType SMDS_Mesh::GetElementType( const int id, const bool iselem ) const SMDSAbs_ElementType SMDS_Mesh::GetElementType( const smIdType id, const bool iselem ) const
{ {
const SMDS_MeshElement* elem = 0; const SMDS_MeshElement* elem = 0;
if( iselem ) if( iselem )
@ -2054,7 +2057,7 @@ SMDSAbs_ElementType SMDS_Mesh::GetElementType( const int id, const bool iselem )
//function : AddEdgeWithID //function : AddEdgeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(int n1, int n2, int n12, int ID) SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(smIdType n1, smIdType n2, smIdType n12, smIdType ID)
{ {
return SMDS_Mesh::AddEdgeWithID (myNodeFactory->FindNode(n1), return SMDS_Mesh::AddEdgeWithID (myNodeFactory->FindNode(n1),
myNodeFactory->FindNode(n2), myNodeFactory->FindNode(n2),
@ -2080,7 +2083,7 @@ SMDS_MeshEdge* SMDS_Mesh::AddEdge(const SMDS_MeshNode* n1,
SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n12 ) return 0; if ( !n1 || !n2 || !n12 ) return 0;
@ -2113,8 +2116,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function : AddFaceWithID //function : AddFaceWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
int n12,int n23,int n31, int ID) smIdType n12,smIdType n23,smIdType n31, smIdType ID)
{ {
return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) , return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) , myNodeFactory->FindNode(n2) ,
@ -2135,7 +2138,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31, const SMDS_MeshNode * n31,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31 ) return 0; if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31 ) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -2170,8 +2173,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function : AddFaceWithID //function : AddFaceWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
int n12,int n23,int n31, int nCenter, int ID) smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID)
{ {
return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) , return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) , myNodeFactory->FindNode(n2) ,
@ -2194,7 +2197,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31, const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31 || !nCenter) return 0; if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31 || !nCenter) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -2230,8 +2233,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function : AddFaceWithID //function : AddFaceWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n34,int n41, int ID) smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID)
{ {
return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) , return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) , myNodeFactory->FindNode(n2) ,
@ -2256,7 +2259,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41) return 0; if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -2292,8 +2295,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function : AddFaceWithID //function : AddFaceWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n34,int n41, int nCenter, int ID) smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID)
{ {
return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) , return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) , myNodeFactory->FindNode(n2) ,
@ -2320,7 +2323,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41 || !nCenter) return 0; if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41 || !nCenter) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
@ -2359,9 +2362,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n14,int n24,int n34, int ID) smIdType n14,smIdType n24,smIdType n34, smIdType ID)
{ {
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) , return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) , myNodeFactory->FindNode(n2) ,
@ -2390,7 +2393,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n14, const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24, const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
int ID) smIdType ID)
{ {
if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n31 || !n14 || !n24 || !n34) if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n31 || !n14 || !n24 || !n34)
return 0; return 0;
@ -2433,9 +2436,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n15,int n25,int n35,int n45, int ID) smIdType n15,smIdType n25,smIdType n35,smIdType n45, smIdType ID)
{ {
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) , return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) , myNodeFactory->FindNode(n2) ,
@ -2470,7 +2473,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n25, const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35, const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45, const SMDS_MeshNode * n45,
int ID) smIdType ID)
{ {
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n12 || !n23 || if (!n1 || !n2 || !n3 || !n4 || !n5 || !n12 || !n23 ||
!n34 || !n41 || !n15 || !n25 || !n35 || !n45) !n34 || !n41 || !n15 || !n25 || !n35 || !n45)
@ -2516,11 +2519,11 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : 2d order Pentahedron (prism) with 15 nodes //purpose : 2d order Pentahedron (prism) with 15 nodes
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n45,int n56,int n64, smIdType n45,smIdType n56,smIdType n64,
int n14,int n25,int n36, int ID) smIdType n14,smIdType n25,smIdType n36, smIdType ID)
{ {
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) , return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) , myNodeFactory->FindNode(n2) ,
@ -2559,7 +2562,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n14, const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25, const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36, const SMDS_MeshNode * n36,
int ID) smIdType ID)
{ {
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 || if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 ||
!n31 || !n45 || !n56 || !n64 || !n14 || !n25 || !n36) !n31 || !n45 || !n56 || !n64 || !n14 || !n25 || !n36)
@ -2608,12 +2611,12 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : 2d order Pentahedron (prism) with 18 nodes //purpose : 2d order Pentahedron (prism) with 18 nodes
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n45,int n56,int n64, smIdType n45,smIdType n56,smIdType n64,
int n14,int n25,int n36, smIdType n14,smIdType n25,smIdType n36,
int n1245, int n2356, int n1346, int ID) smIdType n1245, smIdType n2356, smIdType n1346, smIdType ID)
{ {
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) , return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) , myNodeFactory->FindNode(n2) ,
@ -2658,7 +2661,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n1245, const SMDS_MeshNode * n1245,
const SMDS_MeshNode * n2356, const SMDS_MeshNode * n2356,
const SMDS_MeshNode * n1346, const SMDS_MeshNode * n1346,
int ID) smIdType ID)
{ {
//MESSAGE("AddVolumeWithID penta18 "<< ID); //MESSAGE("AddVolumeWithID penta18 "<< ID);
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 || if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 ||
@ -2711,11 +2714,11 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n56,int n67,int n78,int n85, smIdType n56,smIdType n67,smIdType n78,smIdType n85,
int n15,int n26,int n37,int n48, int ID) smIdType n15,smIdType n26,smIdType n37,smIdType n48, smIdType ID)
{ {
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1), return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1),
myNodeFactory->FindNode(n2), myNodeFactory->FindNode(n2),
@ -2764,7 +2767,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n26, const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37, const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48, const SMDS_MeshNode * n48,
int ID) smIdType ID)
{ {
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 || if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 ||
!n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48) !n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48)
@ -2823,13 +2826,13 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n56,int n67,int n78,int n85, smIdType n56,smIdType n67,smIdType n78,smIdType n85,
int n15,int n26,int n37,int n48, smIdType n15,smIdType n26,smIdType n37,smIdType n48,
int n1234,int n1256,int n2367,int n3478, smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
int n1458,int n5678,int nCenter, int ID) smIdType n1458,smIdType n5678,smIdType nCenter, smIdType ID)
{ {
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1), return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1),
myNodeFactory->FindNode(n2), myNodeFactory->FindNode(n2),
@ -2892,7 +2895,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n1458, const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678, const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID) smIdType ID)
{ {
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 || if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 ||
!n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48 || !n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48 ||
@ -2931,7 +2934,7 @@ void SMDS_Mesh::dumpGrid(std::string ficdump)
} }
int nbCells = myGrid->GetNumberOfCells(); int nbCells = myGrid->GetNumberOfCells();
ficcon << "-------------------------------- cells " << nbCells << endl; ficcon << "-------------------------------- cells " << nbCells << endl;
for (int i=0; i<nbCells; i++) for (vtkIdType i=0; i<nbCells; i++)
{ {
ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -"; ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -";
int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints(); int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints();
@ -2970,16 +2973,16 @@ void SMDS_Mesh::CompactMesh()
for ( ; holder != myElemHolders.end(); ++holder ) for ( ; holder != myElemHolders.end(); ++holder )
(*holder)->beforeCompacting(); (*holder)->beforeCompacting();
} }
int oldCellSize = myCellFactory->GetMaxID(); smIdType oldCellSize = myCellFactory->GetMaxID();
// remove "holes" in SMDS numeration // remove "holes" in SMDS numeration
std::vector<int> idNodesOldToNew, idCellsNewToOld, idCellsOldToNew; std::vector<smIdType> idNodesOldToNew, idCellsNewToOld, idCellsOldToNew;
myNodeFactory->Compact( idNodesOldToNew ); myNodeFactory->Compact( idNodesOldToNew );
myCellFactory->Compact( idCellsNewToOld ); myCellFactory->Compact( idCellsNewToOld );
// make VTK IDs correspond to SMDS IDs // make VTK IDs correspond to SMDS IDs
int newNodeSize = myNodeFactory->NbUsedElements(); smIdType newNodeSize = myNodeFactory->NbUsedElements();
int newCellSize = myCellFactory->NbUsedElements(); smIdType newCellSize = myCellFactory->NbUsedElements();
myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize ); myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize );
if ( idsChange && !myElemHolders.empty() ) if ( idsChange && !myElemHolders.empty() )
@ -2988,7 +2991,7 @@ void SMDS_Mesh::CompactMesh()
idCellsOldToNew.resize( oldCellSize, oldCellSize ); idCellsOldToNew.resize( oldCellSize, oldCellSize );
for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); ++iNew ) for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); ++iNew )
{ {
if ( idCellsNewToOld[ iNew ] >= (int) idCellsOldToNew.size() ) if ( idCellsNewToOld[ iNew ] >= (smIdType) idCellsOldToNew.size() )
idCellsOldToNew.resize( ( 1 + idCellsNewToOld[ iNew ]) * 1.5, oldCellSize ); idCellsOldToNew.resize( ( 1 + idCellsNewToOld[ iNew ]) * 1.5, oldCellSize );
idCellsOldToNew[ idCellsNewToOld[ iNew ]] = iNew; idCellsOldToNew[ idCellsNewToOld[ iNew ]] = iNew;
} }
@ -3004,7 +3007,7 @@ void SMDS_Mesh::CompactMesh()
return; return;
} }
int SMDS_Mesh::FromVtkToSmds( int vtkid ) const smIdType SMDS_Mesh::FromVtkToSmds( vtkIdType vtkid ) const
{ {
return myCellFactory->FromVtkToSmds( vtkid ); return myCellFactory->FromVtkToSmds( vtkid );
} }

View File

@ -43,6 +43,7 @@
#include <set> #include <set>
#include <list> #include <list>
#include <vector> #include <vector>
#include <smIdType.hxx>
class SMDS_ElementHolder; class SMDS_ElementHolder;
class SMDS_ElementFactory; class SMDS_ElementFactory;
@ -73,53 +74,53 @@ public:
size_t nbElemsToReturn=-1, size_t nbElemsToReturn=-1,
const SMDS_MeshElement* sm1stElem=0) const; const SMDS_MeshElement* sm1stElem=0) const;
SMDSAbs_ElementType GetElementType( const int id, const bool iselem ) const; SMDSAbs_ElementType GetElementType( const smIdType id, const bool iselem ) const;
SMDS_Mesh *AddSubMesh(); SMDS_Mesh *AddSubMesh();
virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, int ID); virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, smIdType ID);
virtual SMDS_MeshNode* AddNode (double x, double y, double z); virtual SMDS_MeshNode* AddNode (double x, double y, double z);
virtual SMDS_Mesh0DElement* Add0DElementWithID(int n, int ID); virtual SMDS_Mesh0DElement* Add0DElementWithID(smIdType n, smIdType ID);
virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * n, int ID); virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * n, smIdType ID);
virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * n); virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * n);
virtual SMDS_BallElement* AddBallWithID(int n, double diameter, int ID); virtual SMDS_BallElement* AddBallWithID(smIdType n, double diameter, smIdType ID);
virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID); virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, smIdType ID);
virtual SMDS_BallElement* AddBall (const SMDS_MeshNode * n, double diameter); virtual SMDS_BallElement* AddBall (const SMDS_MeshNode * n, double diameter);
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID); virtual SMDS_MeshEdge* AddEdgeWithID(smIdType n1, smIdType n2, smIdType ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
int ID); smIdType ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2); const SMDS_MeshNode * n2);
// 2d order edge with 3 nodes: n12 - node between n1 and n2 // 2d order edge with 3 nodes: n12 - node between n1 and n2
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID); virtual SMDS_MeshEdge* AddEdgeWithID(smIdType n1, smIdType n2, smIdType n12, smIdType ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
int ID); smIdType ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12); const SMDS_MeshNode * n12);
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID); virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3); const SMDS_MeshNode * n3);
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID); virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -127,15 +128,15 @@ public:
// 2d order triangle of 6 nodes // 2d order triangle of 6 nodes
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
int n12,int n23,int n31, int ID); smIdType n12,smIdType n23,smIdType n31, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31, const SMDS_MeshNode * n31,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -144,8 +145,8 @@ public:
const SMDS_MeshNode * n31); const SMDS_MeshNode * n31);
// 2d order triangle of 7 nodes // 2d order triangle of 7 nodes
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
int n12,int n23,int n31, int nCenter, int ID); smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -153,7 +154,7 @@ public:
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31, const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -163,8 +164,8 @@ public:
const SMDS_MeshNode * nCenter); const SMDS_MeshNode * nCenter);
// 2d order quadrangle // 2d order quadrangle
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n34,int n41, int ID); smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -173,7 +174,7 @@ public:
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -183,8 +184,8 @@ public:
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41); const SMDS_MeshNode * n41);
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n34,int n41, int nCenter, int ID); smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -194,7 +195,7 @@ public:
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -205,40 +206,40 @@ public:
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter); const SMDS_MeshNode * nCenter);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID); virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4); const SMDS_MeshNode * n4);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int ID); smIdType n5, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5); const SMDS_MeshNode * n5);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int ID); smIdType n5, smIdType n6, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6, const SMDS_MeshNode * n6,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -246,8 +247,8 @@ public:
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6); const SMDS_MeshNode * n6);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, int ID); smIdType n5, smIdType n6, smIdType n7, smIdType n8, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -256,7 +257,7 @@ public:
const SMDS_MeshNode * n6, const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7, const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8, const SMDS_MeshNode * n8,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -268,9 +269,9 @@ public:
// hexagonal prism // hexagonal prism
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6,
int n7, int n8, int n9, int n10, int n11, int n12, smIdType n7, smIdType n8, smIdType n9, smIdType n10, smIdType n11, smIdType n12,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -283,7 +284,7 @@ public:
const SMDS_MeshNode * n10, const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11, const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -298,9 +299,9 @@ public:
const SMDS_MeshNode * n12); const SMDS_MeshNode * n12);
// 2d order tetrahedron of 10 nodes // 2d order tetrahedron of 10 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n14,int n24,int n34, int ID); smIdType n14,smIdType n24,smIdType n34, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -311,7 +312,7 @@ public:
const SMDS_MeshNode * n14, const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24, const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -324,10 +325,10 @@ public:
const SMDS_MeshNode * n34); const SMDS_MeshNode * n34);
// 2d order pyramid of 13 nodes // 2d order pyramid of 13 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n15,int n25,int n35,int n45, smIdType n15,smIdType n25,smIdType n35,smIdType n45,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -341,7 +342,7 @@ public:
const SMDS_MeshNode * n25, const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35, const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45, const SMDS_MeshNode * n45,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -357,12 +358,12 @@ public:
const SMDS_MeshNode * n45); const SMDS_MeshNode * n45);
// 2d order Pentahedron with 15 nodes // 2d order Pentahedron with 15 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n45,int n56,int n64, smIdType n45,smIdType n56,smIdType n64,
int n14,int n25,int n36, smIdType n14,smIdType n25,smIdType n36,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -378,7 +379,7 @@ public:
const SMDS_MeshNode * n14, const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25, const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36, const SMDS_MeshNode * n36,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -396,13 +397,13 @@ public:
const SMDS_MeshNode * n36); const SMDS_MeshNode * n36);
// 2d order Pentahedron with 18 nodes // 2d order Pentahedron with 18 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n45,int n56,int n64, smIdType n45,smIdType n56,smIdType n64,
int n14,int n25,int n36, smIdType n14,smIdType n25,smIdType n36,
int n1245, int n2356, int n1346, smIdType n1245, smIdType n2356, smIdType n1346,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -421,7 +422,7 @@ public:
const SMDS_MeshNode * n1245, const SMDS_MeshNode * n1245,
const SMDS_MeshNode * n2356, const SMDS_MeshNode * n2356,
const SMDS_MeshNode * n1346, const SMDS_MeshNode * n1346,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -443,12 +444,12 @@ public:
// 2d oreder Hexahedrons with 20 nodes // 2d oreder Hexahedrons with 20 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n56,int n67,int n78,int n85, smIdType n56,smIdType n67,smIdType n78,smIdType n85,
int n15,int n26,int n37,int n48, smIdType n15,smIdType n26,smIdType n37,smIdType n48,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -469,7 +470,7 @@ public:
const SMDS_MeshNode * n26, const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37, const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48, const SMDS_MeshNode * n48,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -492,14 +493,14 @@ public:
const SMDS_MeshNode * n48); const SMDS_MeshNode * n48);
// 2d oreder Hexahedrons with 27 nodes // 2d oreder Hexahedrons with 27 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n56,int n67,int n78,int n85, smIdType n56,smIdType n67,smIdType n78,smIdType n85,
int n15,int n26,int n37,int n48, smIdType n15,smIdType n26,smIdType n37,smIdType n48,
int n1234,int n1256,int n2367,int n3478, smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
int n1458,int n5678,int nCenter, smIdType n1458,smIdType n5678,smIdType nCenter,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -527,7 +528,7 @@ public:
const SMDS_MeshNode * n1458, const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678, const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -556,31 +557,31 @@ public:
const SMDS_MeshNode * n5678, const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter); const SMDS_MeshNode * nCenter);
virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<int> & nodes_ids, virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
const int ID); const smIdType ID);
virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes, virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes,
const int ID); const smIdType ID);
virtual SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*> & nodes); virtual SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*> & nodes);
virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<int> & nodes_ids, virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<smIdType> & nodes_ids,
const int ID); const smIdType ID);
virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<const SMDS_MeshNode*> & nodes, virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<const SMDS_MeshNode*> & nodes,
const int ID); const smIdType ID);
virtual SMDS_MeshFace* AddQuadPolygonalFace(const std::vector<const SMDS_MeshNode*> & nodes); virtual SMDS_MeshFace* AddQuadPolygonalFace(const std::vector<const SMDS_MeshNode*> & nodes);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<int> & nodes_ids, (const std::vector<smIdType> & nodes_ids,
const std::vector<int> & quantities, const std::vector<int> & quantities,
const int ID); const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*> & nodes, (const std::vector<const SMDS_MeshNode*> & nodes,
const std::vector<int> & quantities, const std::vector<int> & quantities,
const int ID); const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolume virtual SMDS_MeshVolume* AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*> & nodes, (const std::vector<const SMDS_MeshNode*> & nodes,
@ -631,10 +632,10 @@ public:
static_cast<const ELEMTYPE*>(e) : 0 ); static_cast<const ELEMTYPE*>(e) : 0 );
} }
const SMDS_MeshNode *FindNode(int idnode) const; const SMDS_MeshNode *FindNode(smIdType idnode) const;
const SMDS_MeshNode *FindNodeVtk(int idnode) const; const SMDS_MeshNode *FindNodeVtk(vtkIdType idnode) const;
const SMDS_MeshElement *FindElementVtk(int IDelem) const; const SMDS_MeshElement *FindElementVtk(vtkIdType IDelem) const;
virtual const SMDS_MeshElement * FindElement(int IDelem) const; virtual const SMDS_MeshElement * FindElement(smIdType IDelem) const;
static const SMDS_Mesh0DElement* Find0DElement(const SMDS_MeshNode * n); static const SMDS_Mesh0DElement* Find0DElement(const SMDS_MeshNode * n);
static const SMDS_BallElement* FindBall(const SMDS_MeshNode * n); static const SMDS_BallElement* FindBall(const SMDS_MeshNode * n);
static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1, static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1,
@ -681,26 +682,26 @@ public:
*/ */
static int CheckMemory(const bool doNotRaise=false); static int CheckMemory(const bool doNotRaise=false);
virtual int MaxNodeID() const; virtual smIdType MaxNodeID() const;
virtual int MinNodeID() const; virtual smIdType MinNodeID() const;
virtual int MaxElementID() const; virtual smIdType MaxElementID() const;
virtual int MinElementID() const; virtual smIdType MinElementID() const;
const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; } const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; }
virtual int NbNodes() const; virtual smIdType NbNodes() const;
virtual int NbElements() const; virtual smIdType NbElements() const;
virtual int Nb0DElements() const; virtual smIdType Nb0DElements() const;
virtual int NbBalls() const; virtual smIdType NbBalls() const;
virtual int NbEdges() const; virtual smIdType NbEdges() const;
virtual int NbFaces() const; virtual smIdType NbFaces() const;
virtual int NbVolumes() const; virtual smIdType NbVolumes() const;
virtual int NbSubMesh() const; virtual smIdType NbSubMesh() const;
virtual ~SMDS_Mesh(); virtual ~SMDS_Mesh();
double getMaxDim(); double getMaxDim();
int FromVtkToSmds(int vtkid) const; smIdType FromVtkToSmds(vtkIdType vtkid) const;
void dumpGrid(std::string ficdump="dumpGrid"); void dumpGrid(std::string ficdump="dumpGrid");
static int chunkSize; static int chunkSize;

View File

@ -461,8 +461,8 @@ void SMDS_MeshCell::init( SMDSAbs_EntityType theEntity, int theNbNodes, ... )
} }
va_end( vl ); va_end( vl );
int vtkType = toVtkType( theEntity ); int vtkType = toVtkType( theEntity );
int vtkID = getGrid()->InsertNextLinkedCell( vtkType, theNbNodes, vtkIds ); vtkIdType vtkID = getGrid()->InsertNextLinkedCell( vtkType, theNbNodes, vtkIds );
setVtkID( vtkID ); setVtkID( vtkID );
} }
@ -473,17 +473,17 @@ void SMDS_MeshCell::init( SMDSAbs_EntityType theEntity,
for ( size_t i = 0; i < nodes.size(); ++i ) for ( size_t i = 0; i < nodes.size(); ++i )
vtkIds[i] = nodes[i]->GetVtkID(); vtkIds[i] = nodes[i]->GetVtkID();
int vtkType = toVtkType( theEntity ); int vtkType = toVtkType( theEntity );
int vtkID = getGrid()->InsertNextLinkedCell( vtkType, nodes.size(), &vtkIds[0] ); vtkIdType vtkID = getGrid()->InsertNextLinkedCell( vtkType, nodes.size(), &vtkIds[0] );
setVtkID( vtkID ); setVtkID( vtkID );
} }
void SMDS_MeshCell::init( SMDSAbs_EntityType theEntity, void SMDS_MeshCell::init( SMDSAbs_EntityType theEntity,
const std::vector<vtkIdType>& vtkNodeIds ) const std::vector<vtkIdType>& vtkNodeIds )
{ {
int vtkType = toVtkType( theEntity ); int vtkType = toVtkType( theEntity );
int vtkID = getGrid()->InsertNextLinkedCell( vtkType, vtkNodeIds.size(), vtkIdType vtkID = getGrid()->InsertNextLinkedCell( vtkType, vtkNodeIds.size(),
const_cast< vtkIdType* > ( &vtkNodeIds[0] )); const_cast< vtkIdType* > ( &vtkNodeIds[0] ));
setVtkID( vtkID ); setVtkID( vtkID );
} }

View File

@ -105,7 +105,7 @@ int SMDS_MeshElement::GetNodeIndex( const SMDS_MeshNode* node ) const
*/ */
//================================================================================ //================================================================================
int SMDS_MeshElement::GetID() const smIdType SMDS_MeshElement::GetID() const
{ {
return myHolder ? myHolder->GetID( this ) : -1; return myHolder ? myHolder->GetID( this ) : -1;
} }
@ -138,7 +138,7 @@ int SMDS_MeshElement::GetShapeID() const
*/ */
//================================================================================ //================================================================================
int SMDS_MeshElement::GetVtkID() const vtkIdType SMDS_MeshElement::GetVtkID() const
{ {
return myHolder->GetVtkID( this ); return myHolder->GetVtkID( this );
} }
@ -171,7 +171,7 @@ bool SMDS_MeshElement::isMarked() const
*/ */
//================================================================================ //================================================================================
void SMDS_MeshElement::setVtkID( const int vtkID ) void SMDS_MeshElement::setVtkID( const vtkIdType vtkID )
{ {
myHolder->SetVTKID( this, vtkID ); myHolder->SetVTKID( this, vtkID );
} }

View File

@ -38,6 +38,7 @@
#include <vtkType.h> #include <vtkType.h>
#include <vtkCellType.h> #include <vtkCellType.h>
#include <smIdType.hxx>
class SMDS_ElementChunk; class SMDS_ElementChunk;
class SMDS_Mesh; class SMDS_Mesh;
@ -127,10 +128,10 @@ public:
virtual int GetNodeIndex( const SMDS_MeshNode* node ) const; virtual int GetNodeIndex( const SMDS_MeshNode* node ) const;
virtual int GetID() const; virtual smIdType GetID() const;
virtual int GetVtkID() const; virtual vtkIdType GetVtkID() const;
virtual int getshapeId() const { return GetShapeID(); } virtual int getshapeId() const { return GetShapeID(); }
virtual int GetShapeID() const; virtual int GetShapeID() const;
// mark this element; to be used in algos // mark this element; to be used in algos
virtual void setIsMarked( bool is ) const; virtual void setIsMarked( bool is ) const;
@ -182,7 +183,7 @@ public:
SMDS_MeshElement(); SMDS_MeshElement();
void setVtkID(const int vtkID ); void setVtkID(const vtkIdType vtkID );
virtual void setShapeID( const int shapeID ) const; virtual void setShapeID( const int shapeID ) const;
SMDS_UnstructuredGrid* getGrid() const; SMDS_UnstructuredGrid* getGrid() const;

View File

@ -45,7 +45,7 @@ class SMDS_EXPORT SMDS_MeshGroup: public SMDS_MeshObject, SMDS_ElementHolder
bool Add(const SMDS_MeshElement * theElem); bool Add(const SMDS_MeshElement * theElem);
bool Remove(const SMDS_MeshElement * theElem); bool Remove(const SMDS_MeshElement * theElem);
bool IsEmpty() const { return myElements.empty(); } bool IsEmpty() const { return myElements.empty(); }
int Extent() const { return myElements.size(); } smIdType Extent() const { return (smIdType) myElements.size(); }
int Tic() const { return myTic; } int Tic() const { return myTic; }
bool Contains(const SMDS_MeshElement * theElem) const; bool Contains(const SMDS_MeshElement * theElem) const;

View File

@ -30,6 +30,7 @@
#include "SMDS_MeshElement.hxx" #include "SMDS_MeshElement.hxx"
#include<utilities.h> #include<utilities.h>
#include <smIdType.hxx>
class SMDS_EXPORT SMDS_MeshInfo class SMDS_EXPORT SMDS_MeshInfo
{ {
@ -39,39 +40,39 @@ public:
inline SMDS_MeshInfo& operator=(const SMDS_MeshInfo& other); inline SMDS_MeshInfo& operator=(const SMDS_MeshInfo& other);
inline void Clear(); inline void Clear();
inline int NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const; inline smIdType NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
inline int NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); } inline smIdType NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); }
inline int NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); } inline smIdType NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); }
inline int NbEntities(SMDSAbs_EntityType type) const; inline smIdType NbEntities(SMDSAbs_EntityType type) const;
inline int NbElementsOfGeom(SMDSAbs_GeometryType geom) const; inline smIdType NbElementsOfGeom(SMDSAbs_GeometryType geom) const;
int NbNodes() const { return myNbNodes; } smIdType NbNodes() const { return myNbNodes; }
int Nb0DElements() const { return myNb0DElements; } smIdType Nb0DElements() const { return myNb0DElements; }
int NbBalls() const { return myNbBalls; } smIdType NbBalls() const { return myNbBalls; }
inline int NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbBiQuadTriangles() const { return myNbBiQuadTriangles; } smIdType NbBiQuadTriangles() const { return myNbBiQuadTriangles; }
int NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; } smIdType NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; }
inline int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbTriQuadHexas() const { return myNbTriQuadHexas; } smIdType NbTriQuadHexas() const { return myNbTriQuadHexas; }
int NbQuadPrisms() const { return myNbQuadPrisms; } smIdType NbQuadPrisms() const { return myNbQuadPrisms; }
int NbBiQuadPrisms() const { return myNbBiQuadPrisms; } smIdType NbBiQuadPrisms() const { return myNbBiQuadPrisms; }
int NbPolyhedrons() const { return myNbPolyhedrons; } smIdType NbPolyhedrons() const { return myNbPolyhedrons; }
protected: protected:
inline void addWithPoly(const SMDS_MeshElement* el); inline void addWithPoly(const SMDS_MeshElement* el);
inline void setNb(const SMDSAbs_EntityType geomType, const int nb); inline void setNb(const SMDSAbs_EntityType geomType, const smIdType nb);
private: private:
friend class SMDS_Mesh; friend class SMDS_Mesh;
@ -79,29 +80,29 @@ private:
// methods to count NOT POLY elements // methods to count NOT POLY elements
inline void remove(const SMDS_MeshElement* el); inline void remove(const SMDS_MeshElement* el);
inline void add (const SMDS_MeshElement* el); inline void add (const SMDS_MeshElement* el);
inline int index(SMDSAbs_ElementType type, int nbNodes) const; inline smIdType index(SMDSAbs_ElementType type, int nbNodes) const;
// methods to remove elements of ANY kind // methods to remove elements of ANY kind
inline void RemoveEdge(const SMDS_MeshElement* el); inline void RemoveEdge(const SMDS_MeshElement* el);
inline void RemoveFace(const SMDS_MeshElement* el); inline void RemoveFace(const SMDS_MeshElement* el);
inline void RemoveVolume(const SMDS_MeshElement* el); inline void RemoveVolume(const SMDS_MeshElement* el);
int myNbNodes; smIdType myNbNodes;
int myNb0DElements; smIdType myNb0DElements;
int myNbBalls; smIdType myNbBalls;
int myNbEdges , myNbQuadEdges ; smIdType myNbEdges , myNbQuadEdges ;
int myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ; smIdType myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ;
int myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles; smIdType myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles;
int myNbPolygons , myNbQuadPolygons; smIdType myNbPolygons , myNbQuadPolygons;
int myNbTetras , myNbQuadTetras ; smIdType myNbTetras , myNbQuadTetras ;
int myNbHexas , myNbQuadHexas, myNbTriQuadHexas; smIdType myNbHexas , myNbQuadHexas, myNbTriQuadHexas;
int myNbPyramids, myNbQuadPyramids; smIdType myNbPyramids, myNbQuadPyramids;
int myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms; smIdType myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms;
int myNbHexPrism; smIdType myNbHexPrism;
int myNbPolyhedrons; smIdType myNbPolyhedrons;
std::vector<int*> myNb; // pointers to myNb... fields std::vector<smIdType*> myNb; // pointers to myNb... fields
std::vector<int> myShift; // shift to get an index in myNb by elem->NbNodes() std::vector<int> myShift; // shift to get an index in myNb by elem->NbNodes()
}; };
@ -212,7 +213,7 @@ SMDS_MeshInfo::Clear()
myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0; myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0;
} }
inline int // index inline smIdType // index
SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const
{ return nbNodes + myShift[ type ]; } { return nbNodes + myShift[ type ]; }
@ -250,54 +251,54 @@ inline void // RemoveVolume
SMDS_MeshInfo::RemoveVolume(const SMDS_MeshElement* el) SMDS_MeshInfo::RemoveVolume(const SMDS_MeshElement* el)
{ if ( el->IsPoly() ) --myNbPolyhedrons; else remove( el ); } { if ( el->IsPoly() ) --myNbPolyhedrons; else remove( el ); }
inline int // NbEdges inline smIdType // NbEdges
SMDS_MeshInfo::NbEdges (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbEdges (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbEdges+myNbQuadEdges : order == ORDER_LINEAR ? myNbEdges : myNbQuadEdges; } { return order == ORDER_ANY ? myNbEdges+myNbQuadEdges : order == ORDER_LINEAR ? myNbEdges : myNbQuadEdges; }
inline int // NbFaces inline smIdType // NbFaces
SMDS_MeshInfo::NbFaces (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbFaces (SMDSAbs_ElementOrder order) const
{ return NbTriangles(order)+NbQuadrangles(order)+(order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons ); } { return NbTriangles(order)+NbQuadrangles(order)+(order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons ); }
inline int // NbTriangles inline smIdType // NbTriangles
SMDS_MeshInfo::NbTriangles (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbTriangles (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbTriangles+myNbQuadTriangles+myNbBiQuadTriangles : order == ORDER_LINEAR ? myNbTriangles : myNbQuadTriangles+myNbBiQuadTriangles; } { return order == ORDER_ANY ? myNbTriangles+myNbQuadTriangles+myNbBiQuadTriangles : order == ORDER_LINEAR ? myNbTriangles : myNbQuadTriangles+myNbBiQuadTriangles; }
inline int // NbQuadrangles inline smIdType // NbQuadrangles
SMDS_MeshInfo::NbQuadrangles(SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbQuadrangles(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbQuadrangles+myNbQuadQuadrangles+myNbBiQuadQuadrangles : order == ORDER_LINEAR ? myNbQuadrangles : myNbQuadQuadrangles+myNbBiQuadQuadrangles; } { return order == ORDER_ANY ? myNbQuadrangles+myNbQuadQuadrangles+myNbBiQuadQuadrangles : order == ORDER_LINEAR ? myNbQuadrangles : myNbQuadQuadrangles+myNbBiQuadQuadrangles; }
inline int // NbPolygons inline smIdType // NbPolygons
SMDS_MeshInfo::NbPolygons(SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbPolygons(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons; } { return order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons; }
inline int // NbVolumes inline smIdType // NbVolumes
SMDS_MeshInfo::NbVolumes (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbVolumes (SMDSAbs_ElementOrder order) const
{ return NbTetras(order) + NbHexas(order) + NbPyramids(order) + NbPrisms(order) + NbHexPrisms(order) + (order == ORDER_QUADRATIC ? 0 : myNbPolyhedrons); } { return NbTetras(order) + NbHexas(order) + NbPyramids(order) + NbPrisms(order) + NbHexPrisms(order) + (order == ORDER_QUADRATIC ? 0 : myNbPolyhedrons); }
inline int // NbTetras inline smIdType // NbTetras
SMDS_MeshInfo::NbTetras (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbTetras (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbTetras+myNbQuadTetras : order == ORDER_LINEAR ? myNbTetras : myNbQuadTetras; } { return order == ORDER_ANY ? myNbTetras+myNbQuadTetras : order == ORDER_LINEAR ? myNbTetras : myNbQuadTetras; }
inline int // NbHexas inline smIdType // NbHexas
SMDS_MeshInfo::NbHexas (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbHexas (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbHexas+myNbQuadHexas+myNbTriQuadHexas : order == ORDER_LINEAR ? myNbHexas : myNbQuadHexas+myNbTriQuadHexas; } { return order == ORDER_ANY ? myNbHexas+myNbQuadHexas+myNbTriQuadHexas : order == ORDER_LINEAR ? myNbHexas : myNbQuadHexas+myNbTriQuadHexas; }
inline int // NbPyramids inline smIdType // NbPyramids
SMDS_MeshInfo::NbPyramids(SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbPyramids(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPyramids+myNbQuadPyramids : order == ORDER_LINEAR ? myNbPyramids : myNbQuadPyramids; } { return order == ORDER_ANY ? myNbPyramids+myNbQuadPyramids : order == ORDER_LINEAR ? myNbPyramids : myNbQuadPyramids; }
inline int // NbPrisms inline smIdType // NbPrisms
SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms+myNbBiQuadPrisms: order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms+myNbBiQuadPrisms; } { return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms+myNbBiQuadPrisms: order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms+myNbBiQuadPrisms; }
inline int // NbHexPrisms inline smIdType // NbHexPrisms
SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbHexPrism : order == ORDER_LINEAR ? myNbHexPrism : 0; } { return order == ORDER_ANY ? myNbHexPrism : order == ORDER_LINEAR ? myNbHexPrism : 0; }
inline int // NbElements inline smIdType // NbElements
SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
{ {
int nb = 0; smIdType nb = 0;
switch (type) { switch (type) {
case SMDSAbs_All: case SMDSAbs_All:
for ( size_t i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i]; for ( size_t i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
@ -330,7 +331,7 @@ SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
return nb; return nb;
} }
inline int // NbEntities inline smIdType // NbEntities
SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
{ {
switch (type) { switch (type) {
@ -366,7 +367,7 @@ SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
return 0; return 0;
} }
inline int // NbElementsOfGeom inline smIdType // NbElementsOfGeom
SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const
{ {
switch ( geom ) { switch ( geom ) {
@ -406,7 +407,7 @@ SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const
} }
inline void // setNb inline void // setNb
SMDS_MeshInfo::setNb(const SMDSAbs_EntityType geomType, const int nb) SMDS_MeshInfo::setNb(const SMDSAbs_EntityType geomType, const smIdType nb)
{ {
switch (geomType) { switch (geomType) {
case SMDSEntity_Node: myNbNodes = nb; break; case SMDSEntity_Node: myNbNodes = nb; break;

View File

@ -36,6 +36,7 @@
#include <utilities.h> #include <utilities.h>
#include <Utils_SALOME_Exception.hxx> #include <Utils_SALOME_Exception.hxx>
#include <cassert> #include <cassert>
#include <smIdType.hxx>
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
@ -122,8 +123,8 @@ namespace
{ {
for (int i = 0; i < ncells; i++) for (int i = 0; i < ncells; i++)
{ {
int vtkId = cells[i]; vtkIdType vtkId = cells[i];
int smdsId = myMesh->FromVtkToSmds( vtkId ); smIdType smdsId = myMesh->FromVtkToSmds( vtkId );
const SMDS_MeshElement* elem = myMesh->FindElement( smdsId ); const SMDS_MeshElement* elem = myMesh->FindElement( smdsId );
if ( elem->GetType() == type ) if ( elem->GetType() == type )
{ {
@ -141,8 +142,8 @@ namespace
const SMDS_MeshElement* next() const SMDS_MeshElement* next()
{ {
int vtkId = myCellList[ myIter++ ]; vtkIdType vtkId = myCellList[ myIter++ ];
int smdsId = myMesh->FromVtkToSmds( vtkId ); smIdType smdsId = myMesh->FromVtkToSmds( vtkId );
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId); const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
if (!elem) if (!elem)
{ {

View File

@ -50,7 +50,7 @@ void SMDS_MeshVolume::init( const std::vector<const SMDS_MeshNode*>& nodes,
ptIds.push_back( nodes[ iN++ ]->GetVtkID() ); ptIds.push_back( nodes[ iN++ ]->GetVtkID() );
} }
int vtkID = getGrid()->InsertNextLinkedCell(VTK_POLYHEDRON, nbFaces, &ptIds[0]); vtkIdType vtkID = getGrid()->InsertNextLinkedCell(VTK_POLYHEDRON, nbFaces, &ptIds[0]);
setVtkID( vtkID ); setVtkID( vtkID );
} }
@ -88,7 +88,7 @@ bool SMDS_MeshVolume::ChangeNodes(const std::vector<const SMDS_MeshNode*>& nodes
// stream size and nb faces should not change // stream size and nb faces should not change
if ((int) quantities.size() != nFaces ) if ((vtkIdType) quantities.size() != nFaces )
{ {
return false; return false;
} }

View File

@ -135,7 +135,7 @@ vtkPoints* SMDS_UnstructuredGrid::GetPoints()
return this->Points; return this->Points;
} }
int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *pts) vtkIdType SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *pts)
{ {
if ( !this->Links ) // don't create Links until they are needed if ( !this->Links ) // don't create Links until they are needed
{ {
@ -146,7 +146,7 @@ int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *p
return vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts); return vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts);
// --- type = VTK_POLYHEDRON // --- type = VTK_POLYHEDRON
int cellid = this->InsertNextCell(type, npts, pts); vtkIdType cellid = this->InsertNextCell(type, npts, pts);
std::set<vtkIdType> setOfNodes; std::set<vtkIdType> setOfNodes;
setOfNodes.clear(); setOfNodes.clear();
@ -175,15 +175,15 @@ void SMDS_UnstructuredGrid::setSMDS_mesh(SMDS_Mesh *mesh)
_mesh = mesh; _mesh = mesh;
} }
void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int newNodeSize, void SMDS_UnstructuredGrid::compactGrid(std::vector<smIdType>& idNodesOldToNew, smIdType newNodeSize,
std::vector<int>& idCellsNewToOld, int newCellSize) std::vector<smIdType>& idCellsNewToOld, smIdType newCellSize)
{ {
this->DeleteLinks(); this->DeleteLinks();
// IDs of VTK nodes always correspond to SMDS IDs but there can be "holes" in SMDS numeration. // IDs of VTK nodes always correspond to SMDS IDs but there can be "holes" in SMDS numeration.
// We compact only if there were holes // We compact only if there were holes
int oldNodeSize = this->GetNumberOfPoints(); vtkIdType oldNodeSize = this->GetNumberOfPoints();
bool updateNodes = ( oldNodeSize > newNodeSize ); bool updateNodes = ( oldNodeSize > newNodeSize );
if ( true /*updateNodes*/ ) if ( true /*updateNodes*/ )
{ {
@ -191,19 +191,19 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
// Use double type for storing coordinates of nodes instead float. // Use double type for storing coordinates of nodes instead float.
vtkPoints *newPoints = vtkPoints::New(); vtkPoints *newPoints = vtkPoints::New();
newPoints->SetDataType( VTK_DOUBLE ); newPoints->SetDataType( VTK_DOUBLE );
newPoints->SetNumberOfPoints( newNodeSize ); newPoints->SetNumberOfPoints( FromSmIdType<vtkIdType>(newNodeSize) );
int i = 0, alreadyCopied = 0; vtkIdType i = 0, alreadyCopied = 0;
while ( i < oldNodeSize ) while ( i < oldNodeSize )
{ {
// skip a hole if any // skip a hole if any
while ( i < oldNodeSize && idNodesOldToNew[i] < 0 ) while ( i < oldNodeSize && idNodesOldToNew[i] < 0 )
++i; ++i;
int startBloc = i; vtkIdType startBloc = i;
// look for a block end // look for a block end
while ( i < oldNodeSize && idNodesOldToNew[i] >= 0 ) while ( i < oldNodeSize && idNodesOldToNew[i] >= 0 )
++i; ++i;
int endBloc = i; vtkIdType endBloc = i;
copyNodes(newPoints, idNodesOldToNew, alreadyCopied, startBloc, endBloc); copyNodes(newPoints, idNodesOldToNew, alreadyCopied, startBloc, endBloc);
} }
this->SetPoints(newPoints); this->SetPoints(newPoints);
@ -217,9 +217,9 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
// Compact cells if VTK IDs do not correspond to SMDS IDs or nodes compacted // Compact cells if VTK IDs do not correspond to SMDS IDs or nodes compacted
int oldCellSize = this->Types->GetNumberOfTuples(); vtkIdType oldCellSize = this->Types->GetNumberOfTuples();
bool updateCells = ( updateNodes || newCellSize != oldCellSize ); bool updateCells = ( updateNodes || newCellSize != oldCellSize );
for ( int newID = 0, nbIDs = idCellsNewToOld.size(); newID < nbIDs && !updateCells; ++newID ) for ( vtkIdType newID = 0, nbIDs = idCellsNewToOld.size(); newID < nbIDs && !updateCells; ++newID )
updateCells = ( idCellsNewToOld[ newID ] != newID ); updateCells = ( idCellsNewToOld[ newID ] != newID );
if ( false /*!updateCells*/ ) // no holes in elements if ( false /*!updateCells*/ ) // no holes in elements
@ -236,18 +236,18 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
return; return;
} }
if ((int) idNodesOldToNew.size() < oldNodeSize ) if ((vtkIdType) idNodesOldToNew.size() < oldNodeSize )
{ {
idNodesOldToNew.reserve( oldNodeSize ); idNodesOldToNew.reserve( oldNodeSize );
for ( int i = idNodesOldToNew.size(); i < oldNodeSize; ++i ) for ( vtkIdType i = idNodesOldToNew.size(); i < oldNodeSize; ++i )
idNodesOldToNew.push_back( i ); idNodesOldToNew.push_back( i );
} }
// --- create new compacted Connectivity, Locations and Types // --- create new compacted Connectivity, Locations and Types
int newConnectivitySize = this->Connectivity->GetNumberOfConnectivityEntries(); vtkIdType newConnectivitySize = this->Connectivity->GetNumberOfConnectivityEntries();
if ( newCellSize != oldCellSize ) if ( newCellSize != oldCellSize )
for ( int i = 0; i < oldCellSize - 1; ++i ) for ( vtkIdType i = 0; i < oldCellSize - 1; ++i )
if ( this->Types->GetValue( i ) == VTK_EMPTY_CELL ) if ( this->Types->GetValue( i ) == VTK_EMPTY_CELL )
newConnectivitySize -= this->Connectivity->GetCellSize( i ); newConnectivitySize -= this->Connectivity->GetCellSize( i );
@ -257,11 +257,11 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New(); vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New();
newTypes->Initialize(); newTypes->Initialize();
newTypes->SetNumberOfValues(newCellSize); newTypes->SetNumberOfValues(FromSmIdType<vtkIdType>(newCellSize));
vtkIdTypeArray *newLocations = vtkIdTypeArray::New(); vtkIdTypeArray *newLocations = vtkIdTypeArray::New();
newLocations->Initialize(); newLocations->Initialize();
newLocations->SetNumberOfValues(newCellSize); newLocations->SetNumberOfValues(FromSmIdType<vtkIdType>(newCellSize));
std::vector< vtkIdType > pointsCell(1024); // --- points id to fill a new cell std::vector< vtkIdType > pointsCell(1024); // --- points id to fill a new cell
@ -273,11 +273,11 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
{ {
vtkDoubleArray* newDiameters = vtkDoubleArray::New(); vtkDoubleArray* newDiameters = vtkDoubleArray::New();
newDiameters->SetNumberOfComponents(1); newDiameters->SetNumberOfComponents(1);
for ( int newCellID = 0; newCellID < newCellSize; newCellID++ ) for ( vtkIdType newCellID = 0; newCellID < newCellSize; newCellID++ )
{ {
if ( newTypes->GetValue( newCellID ) == VTK_POLY_VERTEX ) if ( newTypes->GetValue( newCellID ) == VTK_POLY_VERTEX )
{ {
int oldCellID = idCellsNewToOld[ newCellID ]; vtkIdType oldCellID = idCellsNewToOld[ newCellID ];
newDiameters->InsertValue( newCellID, diameters->GetValue( oldCellID )); newDiameters->InsertValue( newCellID, diameters->GetValue( oldCellID ));
} }
vtkDataSet::CellData->SetScalars( newDiameters ); vtkDataSet::CellData->SetScalars( newDiameters );
@ -292,22 +292,22 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
vtkIdTypeArray *newFaces = vtkIdTypeArray::New(); vtkIdTypeArray *newFaces = vtkIdTypeArray::New();
newFaces->Initialize(); newFaces->Initialize();
newFaces->Allocate(this->Faces->GetSize()); newFaces->Allocate(this->Faces->GetSize());
for ( int newCellID = 0; newCellID < newCellSize; newCellID++ ) for ( vtkIdType newCellID = 0; newCellID < newCellSize; newCellID++ )
{ {
if ( newTypes->GetValue( newCellID ) == VTK_POLYHEDRON ) if ( newTypes->GetValue( newCellID ) == VTK_POLYHEDRON )
{ {
int oldCellId = idCellsNewToOld[ newCellID ]; smIdType oldCellId = idCellsNewToOld[ newCellID ];
newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 ); newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 );
int oldFaceLoc = this->FaceLocations->GetValue( oldCellId ); smIdType oldFaceLoc = this->FaceLocations->GetValue( FromSmIdType<vtkIdType>(oldCellId) );
int nCellFaces = this->Faces->GetValue( oldFaceLoc++ ); smIdType nCellFaces = this->Faces->GetValue( FromSmIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( nCellFaces ); newFaces->InsertNextValue( FromSmIdType<vtkIdType>(nCellFaces) );
for ( int n = 0; n < nCellFaces; n++ ) for ( int n = 0; n < nCellFaces; n++ )
{ {
int nptsInFace = this->Faces->GetValue( oldFaceLoc++ ); int nptsInFace = this->Faces->GetValue( FromSmIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( nptsInFace ); newFaces->InsertNextValue( nptsInFace );
for ( int k = 0; k < nptsInFace; k++ ) for ( int k = 0; k < nptsInFace; k++ )
{ {
int oldpt = this->Faces->GetValue( oldFaceLoc++ ); vtkIdType oldpt = this->Faces->GetValue( FromSmIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]); newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]);
} }
} }
@ -335,15 +335,15 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
newConnectivity->Delete(); newConnectivity->Delete();
} }
void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints, void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints,
std::vector<int>& /*idNodesOldToNew*/, std::vector<smIdType>& /*idNodesOldToNew*/,
int& alreadyCopied, vtkIdType& alreadyCopied,
int start, vtkIdType start,
int end) vtkIdType end)
{ {
void *target = newPoints->GetVoidPointer(3 * alreadyCopied); void *target = newPoints->GetVoidPointer(3 * alreadyCopied);
void *source = this->Points->GetVoidPointer(3 * start); void *source = this->Points->GetVoidPointer(3 * start);
int nbPoints = end - start; vtkIdType nbPoints = end - start;
if (nbPoints > 0) if (nbPoints > 0)
{ {
memcpy(target, source, 3 * sizeof(double) * nbPoints); memcpy(target, source, 3 * sizeof(double) * nbPoints);
@ -352,15 +352,15 @@ void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints,
} }
void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray * newTypes, void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray * newTypes,
const std::vector<int>& idCellsNewToOld, const std::vector<smIdType>& idCellsNewToOld,
const std::vector<int>& idNodesOldToNew, const std::vector<smIdType>& idNodesOldToNew,
vtkCellArray* newConnectivity, vtkCellArray* newConnectivity,
vtkIdTypeArray* newLocations, vtkIdTypeArray* newLocations,
std::vector<vtkIdType>& pointsCell) std::vector<vtkIdType>& pointsCell)
{ {
for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); iNew++ ) for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); iNew++ )
{ {
int iOld = idCellsNewToOld[ iNew ]; vtkIdType iOld = idCellsNewToOld[ iNew ];
newTypes->SetValue( iNew, this->Types->GetValue( iOld )); newTypes->SetValue( iNew, this->Types->GetValue( iOld ));
vtkIdType oldLoc = ((vtkIdTypeArray *)(this->Connectivity->GetOffsetsArray()))->GetValue( iOld ); vtkIdType oldLoc = ((vtkIdTypeArray *)(this->Connectivity->GetOffsetsArray()))->GetValue( iOld );
@ -371,25 +371,25 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray * newTypes,
pointsCell.resize( nbpts ); pointsCell.resize( nbpts );
for ( int l = 0; l < nbpts; l++ ) for ( int l = 0; l < nbpts; l++ )
{ {
int oldval = oldPtsCell[l]; vtkIdType oldval = oldPtsCell[l];
pointsCell[l] = idNodesOldToNew[oldval]; pointsCell[l] = idNodesOldToNew[oldval];
} }
/*int newcnt = */newConnectivity->InsertNextCell( nbpts, pointsCell.data() ); /*vtkIdType newcnt = */newConnectivity->InsertNextCell( nbpts, pointsCell.data() );
int newLoc = newConnectivity->GetInsertLocation( nbpts ); vtkIdType newLoc = newConnectivity->GetInsertLocation( nbpts );
newLocations->SetValue( iNew, newLoc ); newLocations->SetValue( iNew, newLoc );
} }
} }
int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId) int SMDS_UnstructuredGrid::CellIdToDownId(vtkIdType vtkCellId)
{ {
if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size())) if ((vtkCellId < 0) || (vtkCellId >= (vtkIdType)_cellIdToDownId.size()))
{ {
return -1; return -1;
} }
return _cellIdToDownId[vtkCellId]; return _cellIdToDownId[vtkCellId];
} }
void SMDS_UnstructuredGrid::setCellIdToDownId(int vtkCellId, int downId) void SMDS_UnstructuredGrid::setCellIdToDownId(vtkIdType vtkCellId, int downId)
{ {
// ASSERT((vtkCellId >= 0) && (vtkCellId < _cellIdToDownId.size())); // ASSERT((vtkCellId >= 0) && (vtkCellId < _cellIdToDownId.size()));
_cellIdToDownId[vtkCellId] = downId; _cellIdToDownId[vtkCellId] = downId;
@ -446,15 +446,15 @@ void SMDS_UnstructuredGrid::BuildDownwardConnectivity(bool /*withEdges*/)
const SMDS_MeshInfo &meshInfo = _mesh->GetMeshInfo(); const SMDS_MeshInfo &meshInfo = _mesh->GetMeshInfo();
int nbLinTetra = meshInfo.NbTetras (ORDER_LINEAR); int nbLinTetra = FromSmIdType<int>(meshInfo.NbTetras (ORDER_LINEAR));
int nbQuadTetra = meshInfo.NbTetras (ORDER_QUADRATIC); int nbQuadTetra = FromSmIdType<int>(meshInfo.NbTetras (ORDER_QUADRATIC));
int nbLinPyra = meshInfo.NbPyramids(ORDER_LINEAR); int nbLinPyra = FromSmIdType<int>(meshInfo.NbPyramids(ORDER_LINEAR));
int nbQuadPyra = meshInfo.NbPyramids(ORDER_QUADRATIC); int nbQuadPyra = FromSmIdType<int>(meshInfo.NbPyramids(ORDER_QUADRATIC));
int nbLinPrism = meshInfo.NbPrisms (ORDER_LINEAR); int nbLinPrism = FromSmIdType<int>(meshInfo.NbPrisms (ORDER_LINEAR));
int nbQuadPrism = meshInfo.NbPrisms (ORDER_QUADRATIC); int nbQuadPrism = FromSmIdType<int>(meshInfo.NbPrisms (ORDER_QUADRATIC));
int nbLinHexa = meshInfo.NbHexas (ORDER_LINEAR); int nbLinHexa = FromSmIdType<int>(meshInfo.NbHexas (ORDER_LINEAR));
int nbQuadHexa = meshInfo.NbHexas (ORDER_QUADRATIC); int nbQuadHexa = FromSmIdType<int>(meshInfo.NbHexas (ORDER_QUADRATIC));
int nbHexPrism = meshInfo.NbHexPrisms(); int nbHexPrism = FromSmIdType<int>(meshInfo.NbHexPrisms());
int nbLineGuess = int((4.0 / 3.0) * nbLinTetra + 2 * nbLinPrism + 2.5 * nbLinPyra + 3 * nbLinHexa); int nbLineGuess = int((4.0 / 3.0) * nbLinTetra + 2 * nbLinPrism + 2.5 * nbLinPyra + 3 * nbLinHexa);
int nbQuadEdgeGuess = int((4.0 / 3.0) * nbQuadTetra + 2 * nbQuadPrism + 2.5 * nbQuadPyra + 3 * nbQuadHexa); int nbQuadEdgeGuess = int((4.0 / 3.0) * nbQuadTetra + 2 * nbQuadPrism + 2.5 * nbQuadPyra + 3 * nbQuadHexa);

View File

@ -28,6 +28,7 @@
#include <vtkUnstructuredGrid.h> #include <vtkUnstructuredGrid.h>
#include <vtkCellLinks.h> #include <vtkCellLinks.h>
#include <smIdType.hxx>
#include <vector> #include <vector>
#include <set> #include <set>
@ -73,17 +74,17 @@ class SMDS_EXPORT SMDS_UnstructuredGrid: public vtkUnstructuredGrid
{ {
public: public:
void setSMDS_mesh(SMDS_Mesh *mesh); void setSMDS_mesh(SMDS_Mesh *mesh);
void compactGrid(std::vector<int>& idNodesOldToNew, void compactGrid(std::vector<smIdType>& idNodesOldToNew,
int newNodeSize, smIdType newNodeSize,
std::vector<int>& idCellsOldToNew, std::vector<smIdType>& idCellsOldToNew,
int newCellSize); smIdType newCellSize);
virtual vtkMTimeType GetMTime(); virtual vtkMTimeType GetMTime();
virtual vtkPoints *GetPoints(); virtual vtkPoints *GetPoints();
int InsertNextLinkedCell(int type, int npts, vtkIdType *pts); vtkIdType InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
int CellIdToDownId(int vtkCellId); int CellIdToDownId(vtkIdType vtkCellId);
void setCellIdToDownId(int vtkCellId, int downId); void setCellIdToDownId(vtkIdType vtkCellId, int downId);
void CleanDownwardConnectivity(); void CleanDownwardConnectivity();
void BuildDownwardConnectivity(bool withEdges); void BuildDownwardConnectivity(bool withEdges);
int GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId, bool getSkin=false); int GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId, bool getSkin=false);
@ -115,10 +116,10 @@ public:
protected: protected:
SMDS_UnstructuredGrid(); SMDS_UnstructuredGrid();
~SMDS_UnstructuredGrid(); ~SMDS_UnstructuredGrid();
void copyNodes(vtkPoints *newPoints, std::vector<int>& idNodesOldToNew, int& alreadyCopied, int start, int end); void copyNodes(vtkPoints *newPoints, std::vector<smIdType>& idNodesOldToNew, vtkIdType& alreadyCopied, vtkIdType start, vtkIdType end);
void copyBloc(vtkUnsignedCharArray *newTypes, void copyBloc(vtkUnsignedCharArray *newTypes,
const std::vector<int>& idCellsOldToNew, const std::vector<smIdType>& idCellsOldToNew,
const std::vector<int>& idNodesOldToNew, const std::vector<smIdType>& idNodesOldToNew,
vtkCellArray* newConnectivity, vtkCellArray* newConnectivity,
vtkIdTypeArray* newLocations, vtkIdTypeArray* newLocations,
std::vector<vtkIdType>& pointsCell); std::vector<vtkIdType>& pointsCell);

View File

@ -969,7 +969,7 @@ bool SMDS_VolumeTool::GetFaceNodes (int faceIndex,
namespace namespace
{ {
struct NLink : public std::pair<int,int> struct NLink : public std::pair<smIdType,smIdType>
{ {
int myOri; int myOri;
NLink(const SMDS_MeshNode* n1=0, const SMDS_MeshNode* n2=0, int ori=1 ) NLink(const SMDS_MeshNode* n1=0, const SMDS_MeshNode* n2=0, int ori=1 )
@ -2210,7 +2210,7 @@ const SMDS_MeshVolume* SMDS_VolumeTool::Element() const
//purpose : return element ID //purpose : return element ID
//======================================================================= //=======================================================================
int SMDS_VolumeTool::ID() const smIdType SMDS_VolumeTool::ID() const
{ {
return myVolume ? myVolume->GetID() : 0; return myVolume ? myVolume->GetID() : 0;
} }

View File

@ -31,6 +31,8 @@
#include "SMESH_SMDS.hxx" #include "SMESH_SMDS.hxx"
#include <smIdType.hxx>
class SMDS_MeshElement; class SMDS_MeshElement;
class SMDS_MeshNode; class SMDS_MeshNode;
class SMDS_MeshVolume; class SMDS_MeshVolume;
@ -72,7 +74,7 @@ class SMDS_EXPORT SMDS_VolumeTool
const SMDS_MeshVolume* Element() const; const SMDS_MeshVolume* Element() const;
// return element // return element
int ID() const; smIdType ID() const;
// return element ID // return element ID
bool IsPoly() const { return myPolyedre; } bool IsPoly() const { return myPolyedre; }
@ -95,7 +97,7 @@ class SMDS_EXPORT SMDS_VolumeTool
const SMDS_MeshNode** GetNodes() const { return (const SMDS_MeshNode**) &myVolumeNodes[0]; } const SMDS_MeshNode** GetNodes() const { return (const SMDS_MeshNode**) &myVolumeNodes[0]; }
// Return array of volume nodes // Return array of volume nodes
int NbNodes() const { return myVolumeNodes.size(); } int NbNodes() const { return (int) myVolumeNodes.size(); }
// Return array of volume nodes // Return array of volume nodes
double GetSize() const; double GetSize() const;
@ -261,7 +263,7 @@ class SMDS_EXPORT SMDS_VolumeTool
int myNbFaces; int myNbFaces;
std::vector<const SMDS_MeshNode*> myVolumeNodes; std::vector<const SMDS_MeshNode*> myVolumeNodes;
std::vector< int > myPolyIndices; // of a myCurFace std::vector< int > myPolyIndices; // of a myCurFace
std::vector< int > myPolyQuantities; std::vector<int> myPolyQuantities;
std::vector< int > myPolyFacetOri; // -1-in, +1-out, 0-undef std::vector< int > myPolyFacetOri; // -1-in, +1-out, 0-undef
typedef std::pair<int,int> Link; typedef std::pair<int,int> Link;

View File

@ -25,7 +25,7 @@
_GetVtkNodes::_GetVtkNodes( TVtkIdList& vtkIds, _GetVtkNodes::_GetVtkNodes( TVtkIdList& vtkIds,
SMDS_Mesh* mesh, SMDS_Mesh* mesh,
int vtkCellId, vtkIdType vtkCellId,
SMDSAbs_EntityType type ) SMDSAbs_EntityType type )
{ {
vtkUnstructuredGrid* grid = mesh->GetGrid(); vtkUnstructuredGrid* grid = mesh->GetGrid();
@ -47,7 +47,7 @@ _GetVtkNodes::_GetVtkNodes( TVtkIdList& vtkIds,
_GetVtkNodesToUNV::_GetVtkNodesToUNV( TVtkIdList& vtkIds, _GetVtkNodesToUNV::_GetVtkNodesToUNV( TVtkIdList& vtkIds,
SMDS_Mesh* mesh, SMDS_Mesh* mesh,
int vtkCellId, vtkIdType vtkCellId,
SMDSAbs_EntityType type ) SMDSAbs_EntityType type )
{ {
vtkUnstructuredGrid* grid = mesh->GetGrid(); vtkUnstructuredGrid* grid = mesh->GetGrid();
@ -133,7 +133,7 @@ _GetVtkNodesToUNV::_GetVtkNodesToUNV( TVtkIdList& vtkIds,
_GetVtkNodesPolyh::_GetVtkNodesPolyh( TVtkIdList& vtkIds, _GetVtkNodesPolyh::_GetVtkNodesPolyh( TVtkIdList& vtkIds,
SMDS_Mesh* mesh, SMDS_Mesh* mesh,
int vtkCellId, vtkIdType vtkCellId,
SMDSAbs_EntityType type ) SMDSAbs_EntityType type )
{ {
vtkUnstructuredGrid* grid = mesh->GetGrid(); vtkUnstructuredGrid* grid = mesh->GetGrid();

View File

@ -34,15 +34,15 @@ typedef std::vector< vtkIdType > TVtkIdList;
*/ */
struct _GetVtkNodes struct _GetVtkNodes
{ {
_GetVtkNodes( TVtkIdList& nodeIds, SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type); _GetVtkNodes( TVtkIdList& nodeIds, SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type);
}; };
struct _GetVtkNodesToUNV struct _GetVtkNodesToUNV
{ {
_GetVtkNodesToUNV( TVtkIdList& nodeIds, SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type); _GetVtkNodesToUNV( TVtkIdList& nodeIds, SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type);
}; };
struct _GetVtkNodesPolyh struct _GetVtkNodesPolyh
{ {
_GetVtkNodesPolyh( TVtkIdList& nodeIds, SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type); _GetVtkNodesPolyh( TVtkIdList& nodeIds, SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type);
}; };
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
@ -55,7 +55,7 @@ class SMDS_VtkCellIterator: public SMDS_ITERATOR
public: public:
typedef typename SMDS_ITERATOR::value_type result_type; typedef typename SMDS_ITERATOR::value_type result_type;
SMDS_VtkCellIterator(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType aType) SMDS_VtkCellIterator(SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType aType)
: _mesh(mesh), _index(0) : _mesh(mesh), _index(0)
{ {
GET_VTK_NODES getNodes( _vtkIdList, mesh, vtkCellId, aType ); GET_VTK_NODES getNodes( _vtkIdList, mesh, vtkCellId, aType );
@ -78,7 +78,7 @@ class SMDS_VtkCellIteratorToUNV: public SMDS_VtkCellIterator< SMDS_ITERATOR, _Ge
{ {
typedef SMDS_VtkCellIterator< SMDS_ITERATOR, _GetVtkNodesToUNV > parent_t; typedef SMDS_VtkCellIterator< SMDS_ITERATOR, _GetVtkNodesToUNV > parent_t;
public: public:
SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type): SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type):
parent_t( mesh, vtkCellId, type ) {} parent_t( mesh, vtkCellId, type ) {}
}; };
@ -88,7 +88,7 @@ class SMDS_VtkCellIteratorPolyH: public SMDS_VtkCellIterator< SMDS_ITERATOR, _Ge
{ {
typedef SMDS_VtkCellIterator< SMDS_ITERATOR, _GetVtkNodesPolyh > parent_t; typedef SMDS_VtkCellIterator< SMDS_ITERATOR, _GetVtkNodesPolyh > parent_t;
public: public:
SMDS_VtkCellIteratorPolyH(SMDS_Mesh* mesh, int vtkCellId, SMDSAbs_EntityType type): SMDS_VtkCellIteratorPolyH(SMDS_Mesh* mesh, vtkIdType vtkCellId, SMDSAbs_EntityType type):
parent_t( mesh, vtkCellId, type ) {} parent_t( mesh, vtkCellId, type ) {}
}; };

View File

@ -1038,12 +1038,12 @@ void SMESH_Algo::addBadInputElements(const SMESHDS_SubMesh* sm,
*/ */
//============================================================================= //=============================================================================
int SMESH_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W) smIdType SMESH_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W)
{ {
int nbPoints = 0; smIdType nbPoints = 0;
for (TopExp_Explorer exp(W,TopAbs_EDGE); exp.More(); exp.Next()) { for (TopExp_Explorer exp(W,TopAbs_EDGE); exp.More(); exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); smIdType nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
if(_quadraticMesh) if(_quadraticMesh)
nb = nb/2; nb = nb/2;
nbPoints += nb + 1; // internal points plus 1 vertex of 2 (last point ?) nbPoints += nb + 1; // internal points plus 1 vertex of 2 (last point ?)

View File

@ -60,8 +60,8 @@ class TopoDS_Vertex;
class TopoDS_Wire; class TopoDS_Wire;
class gp_XYZ; class gp_XYZ;
typedef std::map< SMESH_subMesh*, std::vector<int> > MapShapeNbElems; typedef std::map< SMESH_subMesh*, std::vector<smIdType> > MapShapeNbElems;
typedef std::map< SMESH_subMesh*, std::vector<int> >::iterator MapShapeNbElemsItr; typedef std::map< SMESH_subMesh*, std::vector<smIdType> >::iterator MapShapeNbElemsItr;
// ================================================================================== // ==================================================================================
/*! /*!
@ -339,7 +339,7 @@ public:
*/ */
static double EdgeLength(const TopoDS_Edge & E); static double EdgeLength(const TopoDS_Edge & E);
int NumberOfPoints(SMESH_Mesh& aMesh,const TopoDS_Wire& W); smIdType NumberOfPoints(SMESH_Mesh& aMesh,const TopoDS_Wire& W);
/*! /*!
* \brief Return continuity of two edges * \brief Return continuity of two edges

View File

@ -1183,7 +1183,7 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
if ( !GetMeshDS()->IsUsedHypothesis( hyp )) if ( !GetMeshDS()->IsUsedHypothesis( hyp ))
return; return;
int nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() ); smIdType nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
if ( hyp && _callUp && !_callUp->IsLoaded() ) // for not loaded mesh (#16648) if ( hyp && _callUp && !_callUp->IsLoaded() ) // for not loaded mesh (#16648)
{ {
_callUp->HypothesisModified( hyp->GetID(), /*updateIcons=*/true ); _callUp->HypothesisModified( hyp->GetID(), /*updateIcons=*/true );
@ -1257,7 +1257,7 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty
GetMeshDS()->Modified(); GetMeshDS()->Modified();
int newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() ); smIdType newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
if ( hyp && _callUp ) if ( hyp && _callUp )
_callUp->HypothesisModified( hyp->GetID(), newNbEntities != nbEntities ); _callUp->HypothesisModified( hyp->GetID(), newNbEntities != nbEntities );
} }
@ -1428,6 +1428,8 @@ void SMESH_Mesh::ExportMED(const char * file,
bool theAllElemsToGroup) bool theAllElemsToGroup)
{ {
MESSAGE("MED_VERSION:"<< theVersion); MESSAGE("MED_VERSION:"<< theVersion);
Driver_Mesh::Status status;
SMESH_TRY; SMESH_TRY;
DriverMED_W_SMESHDS_Mesh myWriter; DriverMED_W_SMESHDS_Mesh myWriter;
@ -1482,9 +1484,12 @@ void SMESH_Mesh::ExportMED(const char * file,
} }
} }
// Perform export // Perform export
myWriter.Perform(); status = myWriter.Perform();
SMESH_CATCH( SMESH::throwSalomeEx ); SMESH_CATCH( SMESH::throwSalomeEx );
if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
throw TooLargeForExport("MED");
} }
//================================================================================ //================================================================================
@ -1509,9 +1514,15 @@ void SMESH_Mesh::ExportSAUV(const char *file,
cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')"; cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
cmd += "\""; cmd += "\"";
system(cmd.c_str()); system(cmd.c_str());
ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1, try {
/*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false, ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1,
/*zTol=*/-1, /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413 /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
/*zTol=*/-1, /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
}
catch ( TooLargeForExport )
{
throw TooLargeForExport("SAUV");
}
#ifdef WIN32 #ifdef WIN32
cmd = "%PYTHONBIN% "; cmd = "%PYTHONBIN% ";
#else #else
@ -1541,12 +1552,19 @@ void SMESH_Mesh::ExportSAUV(const char *file,
void SMESH_Mesh::ExportDAT(const char * file, void SMESH_Mesh::ExportDAT(const char * file,
const SMESHDS_Mesh* meshPart) const SMESHDS_Mesh* meshPart)
{ {
Unexpect aCatch(SalomeException); Driver_Mesh::Status status;
SMESH_TRY;
DriverDAT_W_SMDS_Mesh myWriter; DriverDAT_W_SMDS_Mesh myWriter;
myWriter.SetFile( file ); myWriter.SetFile( file );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS ); myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
myWriter.SetMeshId(_id); myWriter.SetMeshId(_id);
myWriter.Perform(); status = myWriter.Perform();
SMESH_CATCH( SMESH::throwSalomeEx );
if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
throw TooLargeForExport("DAT");
} }
//================================================================================ //================================================================================
@ -1558,7 +1576,9 @@ void SMESH_Mesh::ExportDAT(const char * file,
void SMESH_Mesh::ExportUNV(const char * file, void SMESH_Mesh::ExportUNV(const char * file,
const SMESHDS_Mesh* meshPart) const SMESHDS_Mesh* meshPart)
{ {
Unexpect aCatch(SalomeException); Driver_Mesh::Status status;
SMESH_TRY;
DriverUNV_W_SMDS_Mesh myWriter; DriverUNV_W_SMDS_Mesh myWriter;
myWriter.SetFile( file ); myWriter.SetFile( file );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS ); myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
@ -1579,7 +1599,12 @@ void SMESH_Mesh::ExportUNV(const char * file,
} }
} }
} }
myWriter.Perform(); status = myWriter.Perform();
SMESH_CATCH( SMESH::throwSalomeEx );
if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
throw TooLargeForExport("UNV");
} }
//================================================================================ //================================================================================
@ -1593,14 +1618,21 @@ void SMESH_Mesh::ExportSTL(const char * file,
const char * name, const char * name,
const SMESHDS_Mesh* meshPart) const SMESHDS_Mesh* meshPart)
{ {
Unexpect aCatch(SalomeException); Driver_Mesh::Status status;
SMESH_TRY;
DriverSTL_W_SMDS_Mesh myWriter; DriverSTL_W_SMDS_Mesh myWriter;
myWriter.SetFile( file ); myWriter.SetFile( file );
myWriter.SetIsAscii( isascii ); myWriter.SetIsAscii( isascii );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS); myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS);
myWriter.SetMeshId(_id); myWriter.SetMeshId(_id);
if ( name ) myWriter.SetName( name ); if ( name ) myWriter.SetName( name );
myWriter.Perform(); status = myWriter.Perform();
SMESH_CATCH( SMESH::throwSalomeEx );
if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
throw TooLargeForExport("STL");
} }
//================================================================================ //================================================================================
@ -1614,7 +1646,9 @@ void SMESH_Mesh::ExportCGNS(const char * file,
const char * meshName, const char * meshName,
const bool groupElemsByType) const bool groupElemsByType)
{ {
int res = Driver_Mesh::DRS_FAIL; int res = Driver_Mesh::DRS_FAIL;
SMESH_TRY;
// pass group names to SMESHDS // pass group names to SMESHDS
std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin();
@ -1644,6 +1678,11 @@ void SMESH_Mesh::ExportCGNS(const char * file,
} }
#endif #endif
SMESH_CATCH( SMESH::throwSalomeEx );
if ( res == Driver_Mesh::DRS_TOO_LARGE_MESH )
throw TooLargeForExport("CGNS");
if ( res != Driver_Mesh::DRS_OK ) if ( res != Driver_Mesh::DRS_OK )
throw SALOME_Exception("Export failed"); throw SALOME_Exception("Export failed");
} }
@ -1658,12 +1697,20 @@ void SMESH_Mesh::ExportGMF(const char * file,
const SMESHDS_Mesh* meshDS, const SMESHDS_Mesh* meshDS,
bool withRequiredGroups) bool withRequiredGroups)
{ {
Driver_Mesh::Status status;
SMESH_TRY;
DriverGMF_Write myWriter; DriverGMF_Write myWriter;
myWriter.SetFile( file ); myWriter.SetFile( file );
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS )); myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
myWriter.SetExportRequiredGroups( withRequiredGroups ); myWriter.SetExportRequiredGroups( withRequiredGroups );
myWriter.Perform(); status = myWriter.Perform();
SMESH_CATCH( SMESH::throwSalomeEx );
if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
throw TooLargeForExport("GMF");
} }
//================================================================================ //================================================================================
@ -1746,7 +1793,7 @@ double SMESH_Mesh::GetComputeProgress() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbNodes() const smIdType SMESH_Mesh::NbNodes() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->NbNodes(); return _myMeshDS->NbNodes();
@ -1758,7 +1805,7 @@ int SMESH_Mesh::NbNodes() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::Nb0DElements() const smIdType SMESH_Mesh::Nb0DElements() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().Nb0DElements(); return _myMeshDS->GetMeshInfo().Nb0DElements();
@ -1770,7 +1817,7 @@ int SMESH_Mesh::Nb0DElements() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbEdges(order); return _myMeshDS->GetMeshInfo().NbEdges(order);
@ -1782,7 +1829,7 @@ int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbFaces(order); return _myMeshDS->GetMeshInfo().NbFaces(order);
@ -1794,7 +1841,7 @@ int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriangles(order); return _myMeshDS->GetMeshInfo().NbTriangles(order);
@ -1806,7 +1853,7 @@ int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbBiQuadTriangles() const smIdType SMESH_Mesh::NbBiQuadTriangles() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadTriangles(); return _myMeshDS->GetMeshInfo().NbBiQuadTriangles();
@ -1818,7 +1865,7 @@ int SMESH_Mesh::NbBiQuadTriangles() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadrangles(order); return _myMeshDS->GetMeshInfo().NbQuadrangles(order);
@ -1830,7 +1877,7 @@ int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbBiQuadQuadrangles() const smIdType SMESH_Mesh::NbBiQuadQuadrangles() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadQuadrangles(); return _myMeshDS->GetMeshInfo().NbBiQuadQuadrangles();
@ -1842,7 +1889,7 @@ int SMESH_Mesh::NbBiQuadQuadrangles() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolygons(order); return _myMeshDS->GetMeshInfo().NbPolygons(order);
@ -1854,7 +1901,7 @@ int SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbVolumes(order); return _myMeshDS->GetMeshInfo().NbVolumes(order);
@ -1866,7 +1913,7 @@ int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTetras(order); return _myMeshDS->GetMeshInfo().NbTetras(order);
@ -1878,7 +1925,7 @@ int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexas(order); return _myMeshDS->GetMeshInfo().NbHexas(order);
@ -1890,7 +1937,7 @@ int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbTriQuadraticHexas() const smIdType SMESH_Mesh::NbTriQuadraticHexas() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriQuadHexas(); return _myMeshDS->GetMeshInfo().NbTriQuadHexas();
@ -1902,7 +1949,7 @@ int SMESH_Mesh::NbTriQuadraticHexas() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPyramids(order); return _myMeshDS->GetMeshInfo().NbPyramids(order);
@ -1914,19 +1961,19 @@ int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const smIdType SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPrisms(order); return _myMeshDS->GetMeshInfo().NbPrisms(order);
} }
int SMESH_Mesh::NbQuadPrisms() const smIdType SMESH_Mesh::NbQuadPrisms() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadPrisms(); return _myMeshDS->GetMeshInfo().NbQuadPrisms();
} }
int SMESH_Mesh::NbBiQuadPrisms() const smIdType SMESH_Mesh::NbBiQuadPrisms() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadPrisms(); return _myMeshDS->GetMeshInfo().NbBiQuadPrisms();
@ -1939,7 +1986,7 @@ int SMESH_Mesh::NbBiQuadPrisms() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbHexagonalPrisms() const smIdType SMESH_Mesh::NbHexagonalPrisms() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexPrisms(); return _myMeshDS->GetMeshInfo().NbHexPrisms();
@ -1951,7 +1998,7 @@ int SMESH_Mesh::NbHexagonalPrisms() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbPolyhedrons() const smIdType SMESH_Mesh::NbPolyhedrons() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolyhedrons(); return _myMeshDS->GetMeshInfo().NbPolyhedrons();
@ -1963,7 +2010,7 @@ int SMESH_Mesh::NbPolyhedrons() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbBalls() const smIdType SMESH_Mesh::NbBalls() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBalls(); return _myMeshDS->GetMeshInfo().NbBalls();
@ -1975,7 +2022,7 @@ int SMESH_Mesh::NbBalls() const
*/ */
//================================================================================ //================================================================================
int SMESH_Mesh::NbSubMesh() const smIdType SMESH_Mesh::NbSubMesh() const
{ {
Unexpect aCatch(SalomeException); Unexpect aCatch(SalomeException);
return _myMeshDS->NbSubMesh(); return _myMeshDS->NbSubMesh();
@ -2215,8 +2262,8 @@ ostream& SMESH_Mesh::Dump(ostream& save)
save << ++clause << ") Total number of " << orderStr << " edges:\t" << NbEdges(order) << endl; save << ++clause << ") Total number of " << orderStr << " edges:\t" << NbEdges(order) << endl;
save << ++clause << ") Total number of " << orderStr << " faces:\t" << NbFaces(order) << endl; save << ++clause << ") Total number of " << orderStr << " faces:\t" << NbFaces(order) << endl;
if ( NbFaces(order) > 0 ) { if ( NbFaces(order) > 0 ) {
int nb3 = NbTriangles(order); smIdType nb3 = NbTriangles(order);
int nb4 = NbQuadrangles(order); smIdType nb4 = NbQuadrangles(order);
save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl; save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl;
save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl; save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl;
if ( nb3 + nb4 != NbFaces(order) ) { if ( nb3 + nb4 != NbFaces(order) ) {
@ -2236,10 +2283,10 @@ ostream& SMESH_Mesh::Dump(ostream& save)
} }
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl; save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
if ( NbVolumes(order) > 0 ) { if ( NbVolumes(order) > 0 ) {
int nb8 = NbHexas(order); smIdType nb8 = NbHexas(order);
int nb4 = NbTetras(order); smIdType nb4 = NbTetras(order);
int nb5 = NbPyramids(order); smIdType nb5 = NbPyramids(order);
int nb6 = NbPrisms(order); smIdType nb6 = NbPrisms(order);
save << clause << ".1) Number of " << orderStr << " hexahedrons: \t" << nb8 << endl; save << clause << ".1) Number of " << orderStr << " hexahedrons: \t" << nb8 << endl;
save << clause << ".2) Number of " << orderStr << " tetrahedrons:\t" << nb4 << endl; save << clause << ".2) Number of " << orderStr << " tetrahedrons:\t" << nb4 << endl;
save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl; save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl;
@ -2270,7 +2317,7 @@ ostream& SMESH_Mesh::Dump(ostream& save)
//purpose : Returns type of mesh element with certain id //purpose : Returns type of mesh element with certain id
//======================================================================= //=======================================================================
SMDSAbs_ElementType SMESH_Mesh::GetElementType( const int id, const bool iselem ) SMDSAbs_ElementType SMESH_Mesh::GetElementType( const smIdType id, const bool iselem )
{ {
return _myMeshDS->GetElementType( id, iselem ); return _myMeshDS->GetElementType( id, iselem );
} }

View File

@ -245,12 +245,22 @@ class SMESH_EXPORT SMESH_Mesh
*/ */
typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap; typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap;
const TAncestorMap& GetAncestorMap() const { return _mapAncestors; } const TAncestorMap& GetAncestorMap() const { return _mapAncestors; }
/*! /*!
* \brief Check group names for duplications. * \brief Check group names for duplications.
* Consider maximum group name length stored in MED file * Consider maximum group name length stored in MED file
*/ */
bool HasDuplicatedGroupNamesMED(); bool HasDuplicatedGroupNamesMED();
/*!
* \brief Exception thrown by Export*() in case if a mesh is too large for export
* due to limitation of a format
*/
struct TooLargeForExport : public std::runtime_error
{
TooLargeForExport(const char* format):runtime_error(format) {}
};
void ExportMED(const char * theFile, void ExportMED(const char * theFile,
const char* theMeshName = NULL, const char* theMeshName = NULL,
bool theAutoGroups = true, bool theAutoGroups = true,
@ -282,33 +292,33 @@ class SMESH_EXPORT SMESH_Mesh
double GetComputeProgress() const; double GetComputeProgress() const;
int NbNodes() const; smIdType NbNodes() const;
int Nb0DElements() const; smIdType Nb0DElements() const;
int NbBalls() const; smIdType NbBalls() const;
int NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbBiQuadQuadrangles() const; smIdType NbBiQuadQuadrangles() const;
int NbBiQuadTriangles() const; smIdType NbBiQuadTriangles() const;
int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbTriQuadraticHexas() const; smIdType NbTriQuadraticHexas() const;
int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const; smIdType NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbQuadPrisms() const; smIdType NbQuadPrisms() const;
int NbBiQuadPrisms() const; smIdType NbBiQuadPrisms() const;
int NbHexagonalPrisms() const; smIdType NbHexagonalPrisms() const;
int NbPolyhedrons() const; smIdType NbPolyhedrons() const;
int NbSubMesh() const; smIdType NbSubMesh() const;
int NbGroup() const { return _mapGroup.size(); } size_t NbGroup() const { return _mapGroup.size(); }
int NbMeshes() const; // nb meshes in the Study int NbMeshes() const; // nb meshes in the Study
@ -345,7 +355,7 @@ class SMESH_EXPORT SMESH_Mesh
bool SynchronizeGroups(); bool SynchronizeGroups();
SMDSAbs_ElementType GetElementType( const int id, const bool iselem ); SMDSAbs_ElementType GetElementType( const smIdType id, const bool iselem );
void ClearMeshOrder(); void ClearMeshOrder();
void SetMeshOrder(const TListOfListOfInt& theOrder ); void SetMeshOrder(const TListOfListOfInt& theOrder );

View File

@ -100,6 +100,8 @@
#include "SMESH_TryCatch.hxx" // include after OCCT headers! #include "SMESH_TryCatch.hxx" // include after OCCT headers!
#include <smIdType.hxx>
#define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem ) #define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem )
using namespace std; using namespace std;
@ -186,7 +188,7 @@ SMESH_MeshEditor::AddElement(const vector<const SMDS_MeshNode*> & node,
SMDS_MeshElement* e = 0; SMDS_MeshElement* e = 0;
int nbnode = node.size(); int nbnode = node.size();
SMESHDS_Mesh* mesh = GetMeshDS(); SMESHDS_Mesh* mesh = GetMeshDS();
const int ID = features.myID; const smIdType ID = features.myID;
switch ( features.myType ) { switch ( features.myType ) {
case SMDSAbs_Face: case SMDSAbs_Face:
@ -389,12 +391,12 @@ SMESH_MeshEditor::AddElement(const vector<const SMDS_MeshNode*> & node,
*/ */
//======================================================================= //=======================================================================
SMDS_MeshElement* SMESH_MeshEditor::AddElement(const vector<int> & nodeIDs, SMDS_MeshElement* SMESH_MeshEditor::AddElement(const vector<smIdType> & nodeIDs,
const ElemFeatures& features) const ElemFeatures& features)
{ {
vector<const SMDS_MeshNode*> nodes; vector<const SMDS_MeshNode*> nodes;
nodes.reserve( nodeIDs.size() ); nodes.reserve( nodeIDs.size() );
vector<int>::const_iterator id = nodeIDs.begin(); vector<smIdType>::const_iterator id = nodeIDs.begin();
while ( id != nodeIDs.end() ) { while ( id != nodeIDs.end() ) {
if ( const SMDS_MeshNode* node = GetMeshDS()->FindNode( *id++ )) if ( const SMDS_MeshNode* node = GetMeshDS()->FindNode( *id++ ))
nodes.push_back( node ); nodes.push_back( node );
@ -410,7 +412,7 @@ SMDS_MeshElement* SMESH_MeshEditor::AddElement(const vector<int> & nodeIDs,
// Modify a compute state of sub-meshes which become empty // Modify a compute state of sub-meshes which become empty
//======================================================================= //=======================================================================
int SMESH_MeshEditor::Remove (const list< int >& theIDs, smIdType SMESH_MeshEditor::Remove (const list< smIdType >& theIDs,
const bool isNodes ) const bool isNodes )
{ {
ClearLastCreated(); ClearLastCreated();
@ -418,8 +420,8 @@ int SMESH_MeshEditor::Remove (const list< int >& theIDs,
SMESHDS_Mesh* aMesh = GetMeshDS(); SMESHDS_Mesh* aMesh = GetMeshDS();
set< SMESH_subMesh *> smmap; set< SMESH_subMesh *> smmap;
int removed = 0; smIdType removed = 0;
list<int>::const_iterator it = theIDs.begin(); list<smIdType>::const_iterator it = theIDs.begin();
for ( ; it != theIDs.end(); it++ ) { for ( ; it != theIDs.end(); it++ ) {
const SMDS_MeshElement * elem; const SMDS_MeshElement * elem;
if ( isNodes ) if ( isNodes )
@ -1808,17 +1810,17 @@ namespace
TSplitMethod( int nbTet=0, const int* conn=0, bool addNode=false) TSplitMethod( int nbTet=0, const int* conn=0, bool addNode=false)
: _nbSplits(nbTet), _nbCorners(4), _connectivity(conn), _baryNode(addNode), _ownConn(false) {} : _nbSplits(nbTet), _nbCorners(4), _connectivity(conn), _baryNode(addNode), _ownConn(false) {}
~TSplitMethod() { if ( _ownConn ) delete [] _connectivity; _connectivity = 0; } ~TSplitMethod() { if ( _ownConn ) delete [] _connectivity; _connectivity = 0; }
TSplitMethod(const TSplitMethod &splitMethod) TSplitMethod(const TSplitMethod &splitMethod)
: _nbSplits(splitMethod._nbSplits), : _nbSplits(splitMethod._nbSplits),
_nbCorners(splitMethod._nbCorners), _nbCorners(splitMethod._nbCorners),
_baryNode(splitMethod._baryNode), _baryNode(splitMethod._baryNode),
_ownConn(splitMethod._ownConn), _ownConn(splitMethod._ownConn),
_faceBaryNode(splitMethod._faceBaryNode) _faceBaryNode(splitMethod._faceBaryNode)
{ {
_connectivity = splitMethod._connectivity; _connectivity = splitMethod._connectivity;
const_cast<TSplitMethod&>(splitMethod)._connectivity = nullptr; const_cast<TSplitMethod&>(splitMethod)._connectivity = nullptr;
const_cast<TSplitMethod&>(splitMethod)._ownConn = false; const_cast<TSplitMethod&>(splitMethod)._ownConn = false;
} }
bool hasFacet( const TTriangleFacet& facet ) const bool hasFacet( const TTriangleFacet& facet ) const
{ {
if ( _nbCorners == 4 ) if ( _nbCorners == 4 )
@ -2069,6 +2071,8 @@ namespace
const int methodFlags, const int methodFlags,
const int facetToSplit) const int facetToSplit)
{ {
TSplitMethod method;
// order of facets in HEX according to SMDS_VolumeTool::Hexa_F : // order of facets in HEX according to SMDS_VolumeTool::Hexa_F :
// B, T, L, B, R, F // B, T, L, B, R, F
const int iF = ( facetToSplit < 2 ) ? 0 : 1 + ( facetToSplit-2 ) % 2; // [0,1,2] const int iF = ( facetToSplit < 2 ) ? 0 : 1 + ( facetToSplit-2 ) % 2; // [0,1,2]
@ -2099,12 +2103,12 @@ namespace
to4methods[iF]._nbSplits = 4; to4methods[iF]._nbSplits = 4;
to4methods[iF]._nbCorners = 6; to4methods[iF]._nbCorners = 6;
} }
return to4methods[iF]; method = to4methods[iF];
to4methods[iF]._connectivity = method._connectivity; // as copy ctor resets _connectivity
return method;
} }
// else if ( methodFlags == HEXA_TO_2_PRISMS ) // else if ( methodFlags == HEXA_TO_2_PRISMS )
TSplitMethod method;
const int iQ = vol.Element()->IsQuadratic() ? 2 : 1; const int iQ = vol.Element()->IsQuadratic() ? 2 : 1;
const int nbVariants = 2, nbSplits = 2; const int nbVariants = 2, nbSplits = 2;
@ -2216,7 +2220,7 @@ namespace
*/ */
//======================================================================= //=======================================================================
struct TVolumeFaceKey: pair< pair< int, int>, pair< int, int> > struct TVolumeFaceKey: pair< pair< smIdType, smIdType>, pair< smIdType, smIdType> >
{ {
TVolumeFaceKey( SMDS_VolumeTool& vol, int iF ) TVolumeFaceKey( SMDS_VolumeTool& vol, int iF )
{ {
@ -2276,7 +2280,7 @@ void SMESH_MeshEditor::SplitVolumes (const TFacetOfElem & theElems,
TSplitMethod splitMethod = ( facetToSplit < 0 ? TSplitMethod splitMethod = ( facetToSplit < 0 ?
getTetraSplitMethod( volTool, theMethodFlags ) : getTetraSplitMethod( volTool, theMethodFlags ) :
getPrismSplitMethod( volTool, theMethodFlags, facetToSplit )); getPrismSplitMethod( volTool, theMethodFlags, facetToSplit ));
if ( splitMethod._nbSplits < 1 ) continue; if ( splitMethod._nbSplits < 1 ) continue;
// find submesh to add new tetras to // find submesh to add new tetras to
if ( !subMesh || !subMesh->Contains( elem )) if ( !subMesh || !subMesh->Contains( elem ))
@ -3130,10 +3134,10 @@ public:
:myMesh( theMesh ), myMaxID( theMesh->MaxNodeID() + 1) :myMesh( theMesh ), myMaxID( theMesh->MaxNodeID() + 1)
{} {}
long GetLinkID (const SMDS_MeshNode * n1, smIdType GetLinkID (const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2) const const SMDS_MeshNode * n2) const
{ {
return ( Min(n1->GetID(),n2->GetID()) * myMaxID + Max(n1->GetID(),n2->GetID())); return ( std::min(n1->GetID(),n2->GetID()) * myMaxID + std::max(n1->GetID(),n2->GetID()));
} }
bool GetNodes (const long theLinkID, bool GetNodes (const long theLinkID,
@ -6479,7 +6483,7 @@ SMESH_MeshEditor::PGroupIDs SMESH_MeshEditor::Offset( TIDSortedElemSet & theElem
// copy offsetMesh to theTgtMesh // copy offsetMesh to theTgtMesh
int idShift = meshDS->MaxNodeID(); smIdType idShift = meshDS->MaxNodeID();
for ( size_t i = 0; i < new2OldNodes.size(); ++i ) for ( size_t i = 0; i < new2OldNodes.size(); ++i )
if ( const SMDS_MeshNode* n = new2OldNodes[ i ].first ) if ( const SMDS_MeshNode* n = new2OldNodes[ i ].first )
{ {
@ -6849,7 +6853,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes,
TNodeNodeMap nodeNodeMap; // node to replace - new node TNodeNodeMap nodeNodeMap; // node to replace - new node
set<const SMDS_MeshElement*> elems; // all elements with changed nodes set<const SMDS_MeshElement*> elems; // all elements with changed nodes
list< int > rmElemIds, rmNodeIds; list< smIdType > rmElemIds, rmNodeIds;
vector< ElemFeatures > newElemDefs; vector< ElemFeatures > newElemDefs;
// Fill nodeNodeMap and elems // Fill nodeNodeMap and elems
@ -7444,12 +7448,12 @@ bool SMESH_MeshEditor::applyMerge( const SMDS_MeshElement* elem,
// purpose : allow comparing elements basing on their nodes // purpose : allow comparing elements basing on their nodes
// ======================================================== // ========================================================
class ComparableElement : public boost::container::flat_set< int > class ComparableElement : public boost::container::flat_set< smIdType >
{ {
typedef boost::container::flat_set< int > int_set; typedef boost::container::flat_set< smIdType > int_set;
const SMDS_MeshElement* myElem; const SMDS_MeshElement* myElem;
int mySumID; smIdType mySumID;
mutable int myGroupID; mutable int myGroupID;
public: public:
@ -7460,7 +7464,7 @@ public:
this->reserve( theElem->NbNodes() ); this->reserve( theElem->NbNodes() );
for ( SMDS_ElemIteratorPtr nodeIt = theElem->nodesIterator(); nodeIt->more(); ) for ( SMDS_ElemIteratorPtr nodeIt = theElem->nodesIterator(); nodeIt->more(); )
{ {
int id = nodeIt->next()->GetID(); smIdType id = nodeIt->next()->GetID();
mySumID += id; mySumID += id;
this->insert( id ); this->insert( id );
} }
@ -7483,7 +7487,7 @@ public:
static int HashCode(const ComparableElement& se, int limit ) static int HashCode(const ComparableElement& se, int limit )
{ {
return ::HashCode( se.mySumID, limit ); return ::HashCode( FromSmIdType<int>(se.mySumID), limit );
} }
static Standard_Boolean IsEqual(const ComparableElement& se1, const ComparableElement& se2 ) static Standard_Boolean IsEqual(const ComparableElement& se1, const ComparableElement& se2 )
{ {
@ -7508,7 +7512,7 @@ void SMESH_MeshEditor::FindEqualElements( TIDSortedElemSet & theElements,
else elemIt = SMESHUtils::elemSetIterator( theElements ); else elemIt = SMESHUtils::elemSetIterator( theElements );
typedef NCollection_Map< ComparableElement, ComparableElement > TMapOfElements; typedef NCollection_Map< ComparableElement, ComparableElement > TMapOfElements;
typedef std::list<int> TGroupOfElems; typedef std::list<smIdType> TGroupOfElems;
TMapOfElements mapOfElements; TMapOfElements mapOfElements;
std::vector< TGroupOfElems > arrayOfGroups; std::vector< TGroupOfElems > arrayOfGroups;
TGroupOfElems groupOfElems; TGroupOfElems groupOfElems;
@ -7554,7 +7558,7 @@ void SMESH_MeshEditor::MergeElements(TListOfListOfElementsID & theGroupsOfElemen
{ {
ClearLastCreated(); ClearLastCreated();
typedef list<int> TListOfIDs; typedef list<smIdType> TListOfIDs;
TListOfIDs rmElemIds; // IDs of elems to remove TListOfIDs rmElemIds; // IDs of elems to remove
SMESHDS_Mesh* aMesh = GetMeshDS(); SMESHDS_Mesh* aMesh = GetMeshDS();
@ -8269,8 +8273,8 @@ SMESH_MeshEditor::SewFreeBorder (const SMDS_MeshNode* theBordFirstNode,
TListOfListOfElementsID::iterator itGroups = equalGroups.begin(); TListOfListOfElementsID::iterator itGroups = equalGroups.begin();
for ( ; itGroups != equalGroups.end(); ++itGroups ) for ( ; itGroups != equalGroups.end(); ++itGroups )
{ {
list< int >& group = *itGroups; list< smIdType >& group = *itGroups;
list< int >::iterator id = group.begin(); list< smIdType >::iterator id = group.begin();
for ( ++id; id != group.end(); ++id ) for ( ++id; id != group.end(); ++id )
if ( const SMDS_MeshElement* seg = GetMeshDS()->FindElement( *id )) if ( const SMDS_MeshElement* seg = GetMeshDS()->FindElement( *id ))
segments.erase( seg ); segments.erase( seg );
@ -8702,12 +8706,12 @@ namespace
*/ */
//======================================================================= //=======================================================================
int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm, smIdType SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm,
SMESH_MesherHelper& theHelper, SMESH_MesherHelper& theHelper,
const bool theForce3d) const bool theForce3d)
{ {
//MESSAGE("convertElemToQuadratic"); //MESSAGE("convertElemToQuadratic");
int nbElem = 0; smIdType nbElem = 0;
if( !theSm ) return nbElem; if( !theSm ) return nbElem;
vector<int> nbNodeInFaces; vector<int> nbNodeInFaces;
@ -8760,7 +8764,7 @@ int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm,
} }
// get elem data needed to re-create it // get elem data needed to re-create it
// //
const int id = elem->GetID(); const smIdType id = elem->GetID();
const int nbNodes = elem->NbCornerNodes(); const int nbNodes = elem->NbCornerNodes();
nodes.assign(elem->begin_nodes(), elem->end_nodes()); nodes.assign(elem->begin_nodes(), elem->end_nodes());
if ( aGeomType == SMDSEntity_Polyhedra ) if ( aGeomType == SMDSEntity_Polyhedra )
@ -8855,7 +8859,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT
aHelper.ToFixNodeParameters( true ); aHelper.ToFixNodeParameters( true );
// convert elements assigned to sub-meshes // convert elements assigned to sub-meshes
int nbCheckedElems = 0; smIdType nbCheckedElems = 0;
if ( myMesh->HasShapeToMesh() ) if ( myMesh->HasShapeToMesh() )
{ {
if ( SMESH_subMesh *aSubMesh = myMesh->GetSubMeshContaining(myMesh->GetShapeToMesh())) if ( SMESH_subMesh *aSubMesh = myMesh->GetSubMeshContaining(myMesh->GetShapeToMesh()))
@ -8872,7 +8876,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT
} }
// convert elements NOT assigned to sub-meshes // convert elements NOT assigned to sub-meshes
int totalNbElems = meshDS->NbEdges() + meshDS->NbFaces() + meshDS->NbVolumes(); smIdType totalNbElems = meshDS->NbEdges() + meshDS->NbFaces() + meshDS->NbVolumes();
if ( nbCheckedElems < totalNbElems ) // not all elements are in sub-meshes if ( nbCheckedElems < totalNbElems ) // not all elements are in sub-meshes
{ {
aHelper.SetElementsOnShape(false); aHelper.SetElementsOnShape(false);
@ -8885,7 +8889,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT
const SMDS_MeshEdge* edge = aEdgeItr->next(); const SMDS_MeshEdge* edge = aEdgeItr->next();
if ( !edge->IsQuadratic() ) if ( !edge->IsQuadratic() )
{ {
int id = edge->GetID(); smIdType id = edge->GetID();
const SMDS_MeshNode* n1 = edge->GetNode(0); const SMDS_MeshNode* n1 = edge->GetNode(0);
const SMDS_MeshNode* n2 = edge->GetNode(1); const SMDS_MeshNode* n2 = edge->GetNode(1);
@ -8926,7 +8930,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT
if ( alreadyOK ) if ( alreadyOK )
continue; continue;
const int id = face->GetID(); const smIdType id = face->GetID();
vector<const SMDS_MeshNode *> nodes ( face->begin_nodes(), face->end_nodes()); vector<const SMDS_MeshNode *> nodes ( face->begin_nodes(), face->end_nodes());
meshDS->RemoveFreeElement(face, smDS, /*fromGroups=*/false); meshDS->RemoveFreeElement(face, smDS, /*fromGroups=*/false);
@ -8982,7 +8986,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT
continue; continue;
} }
} }
const int id = volume->GetID(); const smIdType id = volume->GetID();
vector<const SMDS_MeshNode *> nodes (volume->begin_nodes(), volume->end_nodes()); vector<const SMDS_MeshNode *> nodes (volume->begin_nodes(), volume->end_nodes());
if ( type == SMDSEntity_Polyhedra ) if ( type == SMDSEntity_Polyhedra )
nbNodeInFaces = static_cast<const SMDS_MeshVolume* >(volume)->GetQuantities(); nbNodeInFaces = static_cast<const SMDS_MeshVolume* >(volume)->GetQuantities();
@ -9162,7 +9166,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d,
if ( alreadyOK ) continue; if ( alreadyOK ) continue;
const SMDSAbs_ElementType type = elem->GetType(); const SMDSAbs_ElementType type = elem->GetType();
const int id = elem->GetID(); const smIdType id = elem->GetID();
const int nbNodes = elem->NbCornerNodes(); const int nbNodes = elem->NbCornerNodes();
vector<const SMDS_MeshNode *> nodes ( elem->begin_nodes(), elem->end_nodes()); vector<const SMDS_MeshNode *> nodes ( elem->begin_nodes(), elem->end_nodes());
@ -9223,15 +9227,15 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d,
//======================================================================= //=======================================================================
/*! /*!
* \brief Convert quadratic elements to linear ones and remove quadratic nodes * \brief Convert quadratic elements to linear ones and remove quadratic nodes
* \return int - nb of checked elements * \return smIdType - nb of checked elements
*/ */
//======================================================================= //=======================================================================
int SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm, smIdType SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm,
SMDS_ElemIteratorPtr theItr, SMDS_ElemIteratorPtr theItr,
const int /*theShapeID*/) const int /*theShapeID*/)
{ {
int nbElem = 0; smIdType nbElem = 0;
SMESHDS_Mesh* meshDS = GetMeshDS(); SMESHDS_Mesh* meshDS = GetMeshDS();
ElemFeatures elemType; ElemFeatures elemType;
vector<const SMDS_MeshNode *> nodes; vector<const SMDS_MeshNode *> nodes;
@ -9276,7 +9280,7 @@ int SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm,
bool SMESH_MeshEditor::ConvertFromQuadratic() bool SMESH_MeshEditor::ConvertFromQuadratic()
{ {
int nbCheckedElems = 0; smIdType nbCheckedElems = 0;
if ( myMesh->HasShapeToMesh() ) if ( myMesh->HasShapeToMesh() )
{ {
if ( SMESH_subMesh *aSubMesh = myMesh->GetSubMeshContaining(myMesh->GetShapeToMesh())) if ( SMESH_subMesh *aSubMesh = myMesh->GetSubMeshContaining(myMesh->GetShapeToMesh()))
@ -9290,7 +9294,7 @@ bool SMESH_MeshEditor::ConvertFromQuadratic()
} }
} }
int totalNbElems = smIdType totalNbElems =
GetMeshDS()->NbEdges() + GetMeshDS()->NbFaces() + GetMeshDS()->NbVolumes(); GetMeshDS()->NbEdges() + GetMeshDS()->NbFaces() + GetMeshDS()->NbVolumes();
if ( nbCheckedElems < totalNbElems ) // not all elements are in submeshes if ( nbCheckedElems < totalNbElems ) // not all elements are in submeshes
{ {
@ -9329,7 +9333,7 @@ void SMESH_MeshEditor::ConvertFromQuadratic(TIDSortedElemSet& theElements)
if ( theElements.empty() ) return; if ( theElements.empty() ) return;
// collect IDs of medium nodes of theElements; some of these nodes will be removed // collect IDs of medium nodes of theElements; some of these nodes will be removed
set<int> mediumNodeIDs; set<smIdType> mediumNodeIDs;
TIDSortedElemSet::iterator eIt = theElements.begin(); TIDSortedElemSet::iterator eIt = theElements.begin();
for ( ; eIt != theElements.end(); ++eIt ) for ( ; eIt != theElements.end(); ++eIt )
{ {
@ -9348,7 +9352,7 @@ void SMESH_MeshEditor::ConvertFromQuadratic(TIDSortedElemSet& theElements)
// get remaining medium nodes // get remaining medium nodes
TIDSortedNodeSet mediumNodes; TIDSortedNodeSet mediumNodes;
set<int>::iterator nIdsIt = mediumNodeIDs.begin(); set<smIdType>::iterator nIdsIt = mediumNodeIDs.begin();
for ( ; nIdsIt != mediumNodeIDs.end(); ++nIdsIt ) for ( ; nIdsIt != mediumNodeIDs.end(); ++nIdsIt )
if ( const SMDS_MeshNode* n = GetMeshDS()->FindNode( *nIdsIt )) if ( const SMDS_MeshNode* n = GetMeshDS()->FindNode( *nIdsIt ))
mediumNodes.insert( mediumNodes.end(), n ); mediumNodes.insert( mediumNodes.end(), n );
@ -9837,7 +9841,7 @@ SMESH_MeshEditor::SewSideElements (TIDSortedElemSet& theSide1,
if ( aResult != SEW_OK) if ( aResult != SEW_OK)
return aResult; return aResult;
list< int > nodeIDsToRemove; list< smIdType > nodeIDsToRemove;
vector< const SMDS_MeshNode*> nodes; vector< const SMDS_MeshNode*> nodes;
ElemFeatures elemType; ElemFeatures elemType;
@ -10237,7 +10241,8 @@ namespace // automatically find theAffectedElems for DoubleNodes()
if ( maxX < 0 ) if ( maxX < 0 )
{ {
_elems[0]->setIsMarked( false ); _elems[0]->setIsMarked( false );
_elems[1]->setIsMarked( true ); if ( _elems[1] )
_elems[1]->setIsMarked( true );
} }
} }
@ -10409,7 +10414,11 @@ namespace // automatically find theAffectedElems for DoubleNodes()
{ {
fissure.reserve( theElemsOrNodes.size() ); fissure.reserve( theElemsOrNodes.size() );
for ( ; elIt != theElemsOrNodes.end(); ++elIt ) for ( ; elIt != theElemsOrNodes.end(); ++elIt )
{
fissure.push_back( std::move( FissureBorder( *elIt, elemsByFacet ))); fissure.push_back( std::move( FissureBorder( *elIt, elemsByFacet )));
if ( !fissure.back()._elems[1] )
fissure.pop_back();
}
} }
if ( fissure.empty() ) if ( fissure.empty() )
return; return;
@ -10916,7 +10925,7 @@ namespace {
\brief Identify the elements that will be affected by node duplication (actual duplication is not performed). \brief Identify the elements that will be affected by node duplication (actual duplication is not performed).
This method is the first step of DoubleNodeElemGroupsInRegion. This method is the first step of DoubleNodeElemGroupsInRegion.
\param theElems - list of groups of elements (edges or faces) to be replicated \param theElems - list of groups of elements (edges or faces) to be replicated
\param theNodesNot - list of groups of nodes not to replicated \param theNodesNot - list of groups of nodes not to replicate
\param theShape - shape to detect affected elements (element which geometric center \param theShape - shape to detect affected elements (element which geometric center
located on or inside shape). If the shape is null, detection is done on faces orientations located on or inside shape). If the shape is null, detection is done on faces orientations
(select elements with a gravity center on the side given by faces normals). (select elements with a gravity center on the side given by faces normals).
@ -11157,7 +11166,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
const SMDS_MeshElement* anElem = *elemItr; const SMDS_MeshElement* anElem = *elemItr;
if (!anElem) if (!anElem)
continue; continue;
int vtkId = anElem->GetVtkID(); vtkIdType vtkId = anElem->GetVtkID();
//MESSAGE(" vtkId " << vtkId << " smdsId " << anElem->GetID()); //MESSAGE(" vtkId " << vtkId << " smdsId " << anElem->GetID());
int neighborsVtkIds[NBMAXNEIGHBORS]; int neighborsVtkIds[NBMAXNEIGHBORS];
int downIds[NBMAXNEIGHBORS]; int downIds[NBMAXNEIGHBORS];
@ -11165,7 +11174,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
for (int n = 0; n < nbNeighbors; n++) for (int n = 0; n < nbNeighbors; n++)
{ {
int smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]); smIdType smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]);
const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); const SMDS_MeshElement* elem = meshDS->FindElement(smdsId);
if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared
{ {
@ -11394,7 +11403,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
const TIDSortedElemSet& domain = (idom == iRestDom) ? theRestDomElems : theElems[idom]; const TIDSortedElemSet& domain = (idom == iRestDom) ? theRestDomElems : theElems[idom];
for ( int ivol = 0; ivol < nbvol; ivol++ ) for ( int ivol = 0; ivol < nbvol; ivol++ )
{ {
int smdsId = meshDS->FromVtkToSmds(vtkVolIds[ivol]); smIdType smdsId = meshDS->FromVtkToSmds(vtkVolIds[ivol]);
const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); const SMDS_MeshElement* elem = meshDS->FindElement(smdsId);
if (domain.count(elem)) if (domain.count(elem))
{ {
@ -12250,7 +12259,7 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius,
{ {
if (neighborsVtkIds[n]<0) // only smds faces are considered as neighbors here if (neighborsVtkIds[n]<0) // only smds faces are considered as neighbors here
continue; continue;
int smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]); smIdType smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]);
const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); const SMDS_MeshElement* elem = meshDS->FindElement(smdsId);
if ( shapeIds.count(elem->getshapeId()) && !sgrps->Contains(elem)) // edge : neighbor in the set of shape, not in the group if ( shapeIds.count(elem->getshapeId()) && !sgrps->Contains(elem)) // edge : neighbor in the set of shape, not in the group
{ {

View File

@ -87,7 +87,7 @@ public:
{ {
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
bool myIsPoly, myIsQuad; bool myIsPoly, myIsQuad;
int myID; smIdType myID;
double myBallDiameter; double myBallDiameter;
std::vector<int> myPolyhedQuantities; std::vector<int> myPolyhedQuantities;
std::vector<const SMDS_MeshNode*> myNodes; // not managed by ElemFeatures std::vector<const SMDS_MeshNode*> myNodes; // not managed by ElemFeatures
@ -113,7 +113,7 @@ public:
SMESH_EXPORT ElemFeatures& SetPoly(bool isPoly) { myIsPoly = isPoly; return *this; } SMESH_EXPORT ElemFeatures& SetPoly(bool isPoly) { myIsPoly = isPoly; return *this; }
SMESH_EXPORT ElemFeatures& SetQuad(bool isQuad) { myIsQuad = isQuad; return *this; } SMESH_EXPORT ElemFeatures& SetQuad(bool isQuad) { myIsQuad = isQuad; return *this; }
SMESH_EXPORT ElemFeatures& SetID (int ID) { myID = ID; return *this; } SMESH_EXPORT ElemFeatures& SetID (smIdType ID) { myID = ID; return *this; }
}; };
/*! /*!
@ -124,10 +124,10 @@ public:
/*! /*!
* \brief Add element * \brief Add element
*/ */
SMDS_MeshElement* AddElement(const std::vector<int> & nodeIDs, SMDS_MeshElement* AddElement(const std::vector<smIdType> & nodeIDs,
const ElemFeatures& features); const ElemFeatures& features);
int Remove (const std::list< int >& theElemIDs, const bool isNodes); smIdType Remove (const std::list< smIdType >& theElemIDs, const bool isNodes);
// Remove a node or an element. // Remove a node or an element.
// Modify a compute state of sub-meshes which become empty // Modify a compute state of sub-meshes which become empty
@ -352,7 +352,7 @@ public:
bool IsScaleVariation() const { return myFlags & EXTRUSION_FLAG_SCALE_LINEAR_VARIATION; } bool IsScaleVariation() const { return myFlags & EXTRUSION_FLAG_SCALE_LINEAR_VARIATION; }
bool IsAngleVariation() const { return myFlags & EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION; } bool IsAngleVariation() const { return myFlags & EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION; }
int NbSteps() const { int NbSteps() const {
return mySteps.IsNull() ? myPathPoints.size() - 1: mySteps->Length(); return mySteps.IsNull() ? (int)myPathPoints.size() - 1: mySteps->Length();
} }
// stores elements to use for extrusion by normal, depending on // stores elements to use for extrusion by normal, depending on
// state of EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY flag; // state of EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY flag;
@ -501,7 +501,7 @@ public:
// In each group, the cdr of nodes are substituted by the first one // In each group, the cdr of nodes are substituted by the first one
// in all elements. // in all elements.
typedef std::list< std::list< int > > TListOfListOfElementsID; typedef std::list< std::list< smIdType > > TListOfListOfElementsID;
void FindEqualElements(TIDSortedElemSet & theElements, void FindEqualElements(TIDSortedElemSet & theElements,
TListOfListOfElementsID & theGroupsOfElementsID); TListOfListOfElementsID & theGroupsOfElementsID);
@ -735,19 +735,19 @@ public:
/*! /*!
* \brief Convert elements contained in a submesh to quadratic * \brief Convert elements contained in a submesh to quadratic
* \return int - nb of checked elements * \return smIdType - nb of checked elements
*/ */
int convertElemToQuadratic(SMESHDS_SubMesh * theSm, smIdType convertElemToQuadratic(SMESHDS_SubMesh * theSm,
SMESH_MesherHelper& theHelper, SMESH_MesherHelper& theHelper,
const bool theForce3d); const bool theForce3d);
/*! /*!
* \brief Convert quadratic elements to linear ones and remove quadratic nodes * \brief Convert quadratic elements to linear ones and remove quadratic nodes
* \return nb of checked elements * \return nb of checked elements
*/ */
int removeQuadElem( SMESHDS_SubMesh * theSm, smIdType removeQuadElem( SMESHDS_SubMesh * theSm,
SMDS_ElemIteratorPtr theItr, SMDS_ElemIteratorPtr theItr,
const int theShapeID); const int theShapeID);
/*! /*!
* \brief Create groups of elements made during transformation * \brief Create groups of elements made during transformation
* \param nodeGens - nodes making corresponding myLastCreatedNodes * \param nodeGens - nodes making corresponding myLastCreatedNodes

View File

@ -1924,7 +1924,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::getMediumNodeOnComposedWire(const SMDS_
//purpose : Creates a node //purpose : Creates a node
//======================================================================= //=======================================================================
SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID, SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, smIdType ID,
double u, double v) double u, double v)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -1953,7 +1953,7 @@ SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID,
SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1, SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -1987,7 +1987,7 @@ SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1,
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1, SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -2037,7 +2037,7 @@ SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -2101,7 +2101,7 @@ SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESH_MesherHelper::AddPolygonalFace (const vector<const SMDS_MeshNode*>& nodes, SMDS_MeshFace* SMESH_MesherHelper::AddPolygonalFace (const vector<const SMDS_MeshNode*>& nodes,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -2147,7 +2147,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5, const SMDS_MeshNode* n5,
const SMDS_MeshNode* n6, const SMDS_MeshNode* n6,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -2210,7 +2210,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -2251,7 +2251,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5, const SMDS_MeshNode* n5,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMDS_MeshVolume* elem = 0; SMDS_MeshVolume* elem = 0;
@ -2301,7 +2301,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n6, const SMDS_MeshNode* n6,
const SMDS_MeshNode* n7, const SMDS_MeshNode* n7,
const SMDS_MeshNode* n8, const SMDS_MeshNode* n8,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -2420,7 +2420,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n10, const SMDS_MeshNode* n10,
const SMDS_MeshNode* n11, const SMDS_MeshNode* n11,
const SMDS_MeshNode* n12, const SMDS_MeshNode* n12,
const int id, const smIdType id,
bool /*force3d*/) bool /*force3d*/)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -2442,7 +2442,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
SMDS_MeshVolume* SMDS_MeshVolume*
SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes, SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities, const std::vector<int>& quantities,
const int id, const smIdType id,
const bool force3d) const bool force3d)
{ {
SMESHDS_Mesh * meshDS = GetMeshDS(); SMESHDS_Mesh * meshDS = GetMeshDS();
@ -3413,9 +3413,9 @@ TopoDS_Shape SMESH_MesherHelper::GetShapeOfHypothesis( const SMESHDS_Hypothesis
SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh() SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh()
{ {
int NbAllEdgsAndFaces=0; smIdType NbAllEdgsAndFaces=0;
int NbQuadFacesAndEdgs=0; smIdType NbQuadFacesAndEdgs=0;
int NbFacesAndEdges=0; smIdType NbFacesAndEdges=0;
//All faces and edges //All faces and edges
NbAllEdgsAndFaces = myMesh->NbEdges() + myMesh->NbFaces(); NbAllEdgsAndFaces = myMesh->NbEdges() + myMesh->NbFaces();
if ( NbAllEdgsAndFaces == 0 ) if ( NbAllEdgsAndFaces == 0 )

View File

@ -100,7 +100,7 @@ class SMESH_EXPORT SMESH_MesherHelper
* \brief Load nodes bound to face into a map of node columns * \brief Load nodes bound to face into a map of node columns
* \param theParam2ColumnMap - map of node columns to fill * \param theParam2ColumnMap - map of node columns to fill
* \param theFace - the face on which nodes are searched for * \param theFace - the face on which nodes are searched for
* \param theBaseSide - the edges holding nodes on which columns' bases * \param theBaseSide - the edges holding nodes on which columns base
* \param theMesh - the mesh containing nodes * \param theMesh - the mesh containing nodes
* \retval bool - false if something is wrong * \retval bool - false if something is wrong
* *
@ -343,13 +343,13 @@ public:
/*! /*!
* Creates a node (!Note ID before u=0.,v0.) * Creates a node (!Note ID before u=0.,v0.)
*/ */
SMDS_MeshNode* AddNode(double x, double y, double z, int ID = 0, double u=0., double v=0.); SMDS_MeshNode* AddNode(double x, double y, double z, smIdType ID = 0, double u=0., double v=0.);
/*! /*!
* Creates quadratic or linear edge * Creates quadratic or linear edge
*/ */
SMDS_MeshEdge* AddEdge(const SMDS_MeshNode* n1, SMDS_MeshEdge* AddEdge(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const int id = 0, const smIdType id = 0,
const bool force3d = true); const bool force3d = true);
/*! /*!
* Creates quadratic or linear triangle * Creates quadratic or linear triangle
@ -357,7 +357,7 @@ public:
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1, SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const int id=0, const smIdType id=0,
const bool force3d = false); const bool force3d = false);
/*! /*!
* Creates bi-quadratic, quadratic or linear quadrangle * Creates bi-quadratic, quadratic or linear quadrangle
@ -366,13 +366,13 @@ public:
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const int id = 0, const smIdType id = 0,
const bool force3d = false); const bool force3d = false);
/*! /*!
* Creates polygon, with additional nodes in quadratic mesh * Creates polygon, with additional nodes in quadratic mesh
*/ */
SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes, SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes,
const int id = 0, const smIdType id = 0,
const bool force3d = false); const bool force3d = false);
/*! /*!
* Creates quadratic or linear tetrahedron * Creates quadratic or linear tetrahedron
@ -381,7 +381,7 @@ public:
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const int id = 0, const smIdType id = 0,
const bool force3d = true); const bool force3d = true);
/*! /*!
* Creates quadratic or linear pyramid * Creates quadratic or linear pyramid
@ -391,7 +391,7 @@ public:
const SMDS_MeshNode* n3, const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5, const SMDS_MeshNode* n5,
const int id = 0, const smIdType id = 0,
const bool force3d = true); const bool force3d = true);
/*! /*!
* Creates quadratic or linear pentahedron * Creates quadratic or linear pentahedron
@ -402,7 +402,7 @@ public:
const SMDS_MeshNode* n4, const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5, const SMDS_MeshNode* n5,
const SMDS_MeshNode* n6, const SMDS_MeshNode* n6,
const int id = 0, const smIdType id = 0,
const bool force3d = true); const bool force3d = true);
/*! /*!
* Creates bi-quadratic, quadratic or linear hexahedron * Creates bi-quadratic, quadratic or linear hexahedron
@ -415,7 +415,7 @@ public:
const SMDS_MeshNode* n6, const SMDS_MeshNode* n6,
const SMDS_MeshNode* n7, const SMDS_MeshNode* n7,
const SMDS_MeshNode* n8, const SMDS_MeshNode* n8,
const int id = 0, const smIdType id = 0,
bool force3d = true); bool force3d = true);
/*! /*!
@ -433,7 +433,7 @@ public:
const SMDS_MeshNode* n10, const SMDS_MeshNode* n10,
const SMDS_MeshNode* n11, const SMDS_MeshNode* n11,
const SMDS_MeshNode* n12, const SMDS_MeshNode* n12,
const int id = 0, const smIdType id = 0,
bool force3d = true); bool force3d = true);
/*! /*!
@ -441,7 +441,7 @@ public:
*/ */
SMDS_MeshVolume* AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes, SMDS_MeshVolume* AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities, const std::vector<int>& quantities,
const int ID=0, const smIdType ID=0,
const bool force3d = true); const bool force3d = true);
/*! /*!
* \brief Enables fixing node parameters on EDGEs and FACEs by * \brief Enables fixing node parameters on EDGEs and FACEs by
@ -753,7 +753,7 @@ public:
SMESH_MesherHelper (const SMESH_MesherHelper& theOther); SMESH_MesherHelper (const SMESH_MesherHelper& theOther);
// key of a map of bi-quadratic face to it's central node // key of a map of bi-quadratic face to it's central node
struct TBiQuad: public std::pair<int, std::pair<int, int> > struct TBiQuad: public std::pair<smIdType, std::pair<smIdType, smIdType> >
{ {
TBiQuad(const SMDS_MeshNode* n1, TBiQuad(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2, const SMDS_MeshNode* n2,

View File

@ -574,8 +574,8 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh,
SMESH_MesherHelper helper( *theMesh ); SMESH_MesherHelper helper( *theMesh );
helper.SetSubShape( theFace ); helper.SetSubShape( theFace );
int nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() ); smIdType nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() );
int nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() ); smIdType nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() );
if ( nbElems == 0 && aMeshDS->NbFaces() == 0 ) if ( nbElems == 0 && aMeshDS->NbFaces() == 0 )
{ {
MESSAGE( "No elements bound to the face"); MESSAGE( "No elements bound to the face");
@ -3231,7 +3231,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh,
return setErrorCode( ERR_LOADV_BAD_SHAPE ); return setErrorCode( ERR_LOADV_BAD_SHAPE );
// count nodes // count nodes
int nbNodes = 0, shapeID; smIdType nbNodes = 0; int shapeID;
for ( shapeID = 1; shapeID <= myShapeIDMap.Extent(); shapeID++ ) for ( shapeID = 1; shapeID <= myShapeIDMap.Extent(); shapeID++ )
{ {
const TopoDS_Shape& S = myShapeIDMap( shapeID ); const TopoDS_Shape& S = myShapeIDMap( shapeID );
@ -4366,7 +4366,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh* theMes
subMesh->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); subMesh->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
} }
if ( onMeshElements ) { if ( onMeshElements ) {
list< int > elemIDs; list< smIdType > elemIDs;
for ( size_t i = 0; i < theElements.size(); i++ ) for ( size_t i = 0; i < theElements.size(); i++ )
{ {
subMesh = theMesh->GetSubMeshContaining( shapeIDs[ i ] ); subMesh = theMesh->GetSubMeshContaining( shapeIDs[ i ] );

View File

@ -402,9 +402,9 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::GetFaces() const
*/ */
//================================================================================ //================================================================================
int SMESH_ProxyMesh::NbFaces() const smIdType SMESH_ProxyMesh::NbFaces() const
{ {
int nb = 0; smIdType nb = 0;
if ( _mesh->HasShapeToMesh() ) if ( _mesh->HasShapeToMesh() )
{ {
TopTools_IndexedMapOfShape FF; TopTools_IndexedMapOfShape FF;
@ -715,7 +715,7 @@ void SMESH_ProxyMesh::SubMesh::Clear()
*/ */
//================================================================================ //================================================================================
int SMESH_ProxyMesh::SubMesh::NbElements() const smIdType SMESH_ProxyMesh::SubMesh::NbElements() const
{ {
return _uvPtStructVec.empty() ? _elements.size() : _uvPtStructVec.size() - 1; return _uvPtStructVec.empty() ? _elements.size() : _uvPtStructVec.size() - 1;
} }
@ -740,7 +740,7 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::SubMesh::GetElements() const
*/ */
//================================================================================ //================================================================================
int SMESH_ProxyMesh::SubMesh::NbNodes() const smIdType SMESH_ProxyMesh::SubMesh::NbNodes() const
{ {
return _uvPtStructVec.size(); return _uvPtStructVec.size();
} }

View File

@ -32,6 +32,7 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <NCollection_DataMap.hxx> #include <NCollection_DataMap.hxx>
#include <smIdType.hxx>
#include <map> #include <map>
#include <vector> #include <vector>
@ -66,8 +67,8 @@ public:
const SMDS_MeshNode* GetProxyNode( const SMDS_MeshNode* n ) const; const SMDS_MeshNode* GetProxyNode( const SMDS_MeshNode* n ) const;
const UVPtStructVec& GetUVPtStructVec() const { return _uvPtStructVec; } const UVPtStructVec& GetUVPtStructVec() const { return _uvPtStructVec; }
virtual void AddElement(const SMDS_MeshElement * e); virtual void AddElement(const SMDS_MeshElement * e);
virtual int NbElements() const; virtual smIdType NbElements() const;
virtual int NbNodes() const; virtual smIdType NbNodes() const;
virtual SMDS_ElemIteratorPtr GetElements() const; virtual SMDS_ElemIteratorPtr GetElements() const;
virtual SMDS_NodeIteratorPtr GetNodes() const; virtual SMDS_NodeIteratorPtr GetNodes() const;
virtual void Clear(); virtual void Clear();
@ -127,7 +128,7 @@ public:
SMDS_ElemIteratorPtr GetFaces(const TopoDS_Shape& face) const; SMDS_ElemIteratorPtr GetFaces(const TopoDS_Shape& face) const;
// Return total nb of faces taking into account substitutions // Return total nb of faces taking into account substitutions
int NbFaces() const; smIdType NbFaces() const;
bool IsTemporary(const SMDS_MeshElement* elem ) const; bool IsTemporary(const SMDS_MeshElement* elem ) const;

View File

@ -1331,12 +1331,12 @@ static void cleanSubMesh( SMESH_subMesh * subMesh )
if (SMESHDS_SubMesh * subMeshDS = subMesh->GetSubMeshDS()) if (SMESHDS_SubMesh * subMeshDS = subMesh->GetSubMeshDS())
{ {
SMESHDS_Mesh * meshDS = subMesh->GetFather()->GetMeshDS(); SMESHDS_Mesh * meshDS = subMesh->GetFather()->GetMeshDS();
int nbElems = subMeshDS->NbElements(); smIdType nbElems = subMeshDS->NbElements();
if ( nbElems > 0 ) if ( nbElems > 0 )
for ( SMDS_ElemIteratorPtr ite = subMeshDS->GetElements(); ite->more(); ) for ( SMDS_ElemIteratorPtr ite = subMeshDS->GetElements(); ite->more(); )
meshDS->RemoveFreeElement( ite->next(), subMeshDS ); meshDS->RemoveFreeElement( ite->next(), subMeshDS );
int nbNodes = subMeshDS->NbNodes(); smIdType nbNodes = subMeshDS->NbNodes();
if ( nbNodes > 0 ) if ( nbNodes > 0 )
for ( SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes(); itn->more() ; ) for ( SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes(); itn->more() ; )
{ {
@ -1917,7 +1917,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap)
bool ret = true; bool ret = true;
if (_subShape.ShapeType() == TopAbs_VERTEX) { if (_subShape.ShapeType() == TopAbs_VERTEX) {
vector<int> aVec(SMDSEntity_Last,0); vector<smIdType> aVec(SMDSEntity_Last,0);
aVec[SMDSEntity_Node] = 1; aVec[SMDSEntity_Node] = 1;
aResMap.insert(make_pair(this,aVec)); aResMap.insert(make_pair(this,aVec));
return ret; return ret;
@ -1944,7 +1944,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap)
SMESH_subMesh* sm = smIt->next(); SMESH_subMesh* sm = smIt->next();
int dim = SMESH_Gen::GetShapeDim( sm->GetSubShape() ); int dim = SMESH_Gen::GetShapeDim( sm->GetSubShape() );
if (dim < dimToCheck) break; // the rest subMeshes are all of less dimension if (dim < dimToCheck) break; // the rest subMeshes are all of less dimension
const vector<int> & nbs = aResMap[ sm ]; const vector<smIdType> & nbs = aResMap[ sm ];
subMeshEvaluated = (std::accumulate( nbs.begin(), nbs.end(), 0 ) > 0 ); subMeshEvaluated = (std::accumulate( nbs.begin(), nbs.end(), 0 ) > 0 );
} }
if ( !subMeshEvaluated ) if ( !subMeshEvaluated )
@ -1954,7 +1954,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap)
if ( IsMeshComputed() ) if ( IsMeshComputed() )
{ {
vector<int> & nbEntities = aResMap[ this ]; vector<smIdType> & nbEntities = aResMap[ this ];
nbEntities.resize( SMDSEntity_Last, 0 ); nbEntities.resize( SMDSEntity_Last, 0 );
if ( SMESHDS_SubMesh* sm = GetSubMeshDS() ) if ( SMESHDS_SubMesh* sm = GetSubMeshDS() )
{ {
@ -1968,7 +1968,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap)
{ {
ret = algo->Evaluate((*_father), _subShape, aResMap); ret = algo->Evaluate((*_father), _subShape, aResMap);
} }
aResMap.insert( make_pair( this,vector<int>(0))); aResMap.insert( make_pair( this,vector<smIdType>(0)));
} }
return ret; return ret;

View File

@ -34,6 +34,7 @@
#include "SALOME_LifeCycleCORBA.hxx" #include "SALOME_LifeCycleCORBA.hxx"
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
#include <smIdType.hxx>
#include CORBA_SERVER_HEADER(SALOME_Component) #include CORBA_SERVER_HEADER(SALOME_Component)
#include CORBA_SERVER_HEADER(SALOME_Exception) #include CORBA_SERVER_HEADER(SALOME_Exception)
@ -89,14 +90,14 @@ namespace
//======================================================================= //=======================================================================
inline void AddNodesWithID(SMDS_Mesh* theMesh, inline void AddNodesWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::double_array& aCoords = theSeq[theId].coords; const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
if(3*aNbElems != (CORBA::Long) aCoords.length()) if(3*aNbElems != (SMESH::smIdType) aCoords.length())
EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()"); EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()");
for(CORBA::Long aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){ for(SMESH::smIdType aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){
SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId], SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId],
aCoords[aCoordId+1], aCoords[aCoordId+1],
aCoords[aCoordId+2], aCoords[aCoordId+2],
@ -112,13 +113,13 @@ namespace
//======================================================================= //=======================================================================
inline void Add0DElementsWithID(SMDS_Mesh* theMesh, inline void Add0DElementsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
if (2*aNbElems != (CORBA::Long) anIndexes.length()) if (2*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != aCoords.length()"); EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != aCoords.length()");
CORBA::Long anIndexId = 0; SMESH::smIdType anIndexId = 0;
for (; anElemId < aNbElems; anElemId++, anIndexId+=2) for (; anElemId < aNbElems; anElemId++, anIndexId+=2)
{ {
SMDS_MeshElement* anElem = theMesh->Add0DElementWithID(anIndexes[anIndexId+1], SMDS_MeshElement* anElem = theMesh->Add0DElementWithID(anIndexes[anIndexId+1],
@ -134,16 +135,16 @@ namespace
//======================================================================= //=======================================================================
inline void AddBallsWithID(SMDS_Mesh* theMesh, inline void AddBallsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::double_array& aDiameter = theSeq[theId].coords; const SMESH::double_array& aDiameter = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
if (2*aNbElems != (CORBA::Long) anIndexes.length() ) if (2*aNbElems != (SMESH::smIdType) anIndexes.length() )
EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != anIndexes.length()"); EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != anIndexes.length()");
if (aNbElems != (CORBA::Long) aDiameter.length()) if (aNbElems != (SMESH::smIdType) aDiameter.length())
EXCEPTION(runtime_error,"AddEdgeWithID - aNbElems != aDiameter.length()"); EXCEPTION(runtime_error,"AddEdgeWithID - aNbElems != aDiameter.length()");
CORBA::Long anIndexId = 0; SMESH::smIdType anIndexId = 0;
for (; anElemId < aNbElems; anElemId++, anIndexId+=2) for (; anElemId < aNbElems; anElemId++, anIndexId+=2)
{ {
SMDS_MeshElement* anElem = theMesh->AddBallWithID(anIndexes[anIndexId+1], SMDS_MeshElement* anElem = theMesh->AddBallWithID(anIndexes[anIndexId+1],
@ -160,13 +161,13 @@ namespace
//======================================================================= //=======================================================================
inline void AddEdgesWithID(SMDS_Mesh* theMesh, inline void AddEdgesWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
if(3*aNbElems != (CORBA::Long) anIndexes.length()) if(3*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()"); EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){
SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1], SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2], anIndexes[anIndexId+2],
anIndexes[anIndexId]); anIndexes[anIndexId]);
@ -181,13 +182,13 @@ namespace
//======================================================================= //=======================================================================
inline void AddTriasWithID(SMDS_Mesh* theMesh, inline void AddTriasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
if(4*aNbElems != (CORBA::Long) anIndexes.length()) if(4*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddTriasWithID - 4*aNbElems != anIndexes.length()"); EXCEPTION(runtime_error,"AddTriasWithID - 4*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2], anIndexes[anIndexId+2],
anIndexes[anIndexId+3], anIndexes[anIndexId+3],
@ -203,13 +204,13 @@ namespace
//======================================================================= //=======================================================================
inline void AddQuadsWithID(SMDS_Mesh* theMesh, inline void AddQuadsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var theSeq, SMESH::log_array_var theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
if(5*aNbElems != (CORBA::Long) anIndexes.length()) if(5*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddQuadsWithID - 4*aNbElems != anIndexes.length()"); EXCEPTION(runtime_error,"AddQuadsWithID - 4*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2], anIndexes[anIndexId+2],
anIndexes[anIndexId+3], anIndexes[anIndexId+3],
@ -226,16 +227,16 @@ namespace
//======================================================================= //=======================================================================
inline void AddPolygonsWithID(SMDS_Mesh* theMesh, inline void AddPolygonsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anIndexId = 0, aNbElems = theSeq[theId].number;
for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { for (SMESH::smIdType anElemId = 0; anElemId < aNbElems; anElemId++) {
int aFaceId = anIndexes[anIndexId++]; smIdType aFaceId = anIndexes[anIndexId++];
int aNbNodes = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++];
std::vector<int> nodes_ids (aNbNodes); std::vector<smIdType> nodes_ids (aNbNodes);
for (int i = 0; i < aNbNodes; i++) { for (int i = 0; i < aNbNodes; i++) {
nodes_ids[i] = anIndexes[anIndexId++]; nodes_ids[i] = anIndexes[anIndexId++];
} }
@ -253,16 +254,16 @@ namespace
//======================================================================= //=======================================================================
inline void AddQuadPolygonsWithID(SMDS_Mesh* theMesh, inline void AddQuadPolygonsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anIndexId = 0, aNbElems = theSeq[theId].number;
for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { for (SMESH::smIdType anElemId = 0; anElemId < aNbElems; anElemId++) {
int aFaceId = anIndexes[anIndexId++]; smIdType aFaceId = anIndexes[anIndexId++];
int aNbNodes = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++];
std::vector<int> nodes_ids (aNbNodes); std::vector<smIdType> nodes_ids (aNbNodes);
for (int i = 0; i < aNbNodes; i++) { for (int i = 0; i < aNbNodes; i++) {
nodes_ids[i] = anIndexes[anIndexId++]; nodes_ids[i] = anIndexes[anIndexId++];
} }
@ -280,13 +281,13 @@ namespace
//======================================================================= //=======================================================================
inline void AddTetrasWithID(SMDS_Mesh* theMesh, inline void AddTetrasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
if(5*aNbElems != (CORBA::Long) anIndexes.length()) if(5*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()"); EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2], anIndexes[anIndexId+2],
anIndexes[anIndexId+3], anIndexes[anIndexId+3],
@ -303,13 +304,13 @@ namespace
//======================================================================= //=======================================================================
inline void AddPiramidsWithID(SMDS_Mesh* theMesh, inline void AddPiramidsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
if(6*aNbElems != (CORBA::Long) anIndexes.length()) if(6*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()"); EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2], anIndexes[anIndexId+2],
anIndexes[anIndexId+3], anIndexes[anIndexId+3],
@ -327,7 +328,7 @@ namespace
//======================================================================= //=======================================================================
inline void AddPrismsWithID(SMDS_Mesh* theMesh, inline void AddPrismsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq, SMESH::log_array_var& theSeq,
CORBA::Long theId) SMESH::smIdType theId)
{ {
const SMESH::long_array& anIndexes = theSeq[theId].indexes; const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
@ -415,10 +416,10 @@ namespace
CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number;
for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) {
int aFaceId = anIndexes[anIndexId++]; smIdType aFaceId = anIndexes[anIndexId++];
int aNbNodes = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++];
std::vector<int> nodes_ids (aNbNodes); std::vector<smIdType> nodes_ids (aNbNodes);
for (int i = 0; i < aNbNodes; i++) { for (int i = 0; i < aNbNodes; i++) {
nodes_ids[i] = anIndexes[anIndexId++]; nodes_ids[i] = anIndexes[anIndexId++];
} }

View File

@ -52,7 +52,7 @@ SMESHDS_Command::~SMESHDS_Command()
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddNode(int NewNodeID, double x, double y, double z) void SMESHDS_Command::AddNode(smIdType NewNodeID, double x, double y, double z)
{ {
if ( myType != SMESHDS_AddNode) if ( myType != SMESHDS_AddNode)
{ {
@ -70,7 +70,7 @@ void SMESHDS_Command::AddNode(int NewNodeID, double x, double y, double z)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::MoveNode(int NodeID, double x, double y, double z) void SMESHDS_Command::MoveNode(smIdType NodeID, double x, double y, double z)
{ {
if ( myType != SMESHDS_MoveNode) if ( myType != SMESHDS_MoveNode)
{ {
@ -88,7 +88,7 @@ void SMESHDS_Command::MoveNode(int NodeID, double x, double y, double z)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::Add0DElement(int New0DElementID, int idnode) void SMESHDS_Command::Add0DElement(smIdType New0DElementID, smIdType idnode)
{ {
if ( myType != SMESHDS_Add0DElement) if ( myType != SMESHDS_Add0DElement)
{ {
@ -104,7 +104,7 @@ void SMESHDS_Command::Add0DElement(int New0DElementID, int idnode)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddEdge(int NewEdgeID, int idnode1, int idnode2) void SMESHDS_Command::AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2)
{ {
if ( myType != SMESHDS_AddEdge) if ( myType != SMESHDS_AddEdge)
{ {
@ -121,8 +121,8 @@ void SMESHDS_Command::AddEdge(int NewEdgeID, int idnode1, int idnode2)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID, void SMESHDS_Command::AddFace(smIdType NewFaceID,
int idnode1, int idnode2, int idnode3) smIdType idnode1, smIdType idnode2, smIdType idnode3)
{ {
if ( myType != SMESHDS_AddTriangle) if ( myType != SMESHDS_AddTriangle)
{ {
@ -140,8 +140,8 @@ void SMESHDS_Command::AddFace(int NewFaceID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID, void SMESHDS_Command::AddFace(smIdType NewFaceID,
int idnode1, int idnode2, int idnode3, int idnode4) smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4)
{ {
if ( myType != SMESHDS_AddQuadrangle) if ( myType != SMESHDS_AddQuadrangle)
{ {
@ -160,8 +160,8 @@ void SMESHDS_Command::AddFace(int NewFaceID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, void SMESHDS_Command::AddVolume(smIdType NewVolID,
int idnode1, int idnode2, int idnode3, int idnode4) smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4)
{ {
if ( myType != SMESHDS_AddTetrahedron) if ( myType != SMESHDS_AddTetrahedron)
{ {
@ -180,8 +180,8 @@ void SMESHDS_Command::AddVolume(int NewVolID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, void SMESHDS_Command::AddVolume(smIdType NewVolID,
int idnode1, int idnode2, int idnode3, int idnode4, int idnode5) smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4, smIdType idnode5)
{ {
if ( myType != SMESHDS_AddPyramid) if ( myType != SMESHDS_AddPyramid)
{ {
@ -201,9 +201,9 @@ void SMESHDS_Command::AddVolume(int NewVolID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, void SMESHDS_Command::AddVolume(smIdType NewVolID,
int idnode1, smIdType idnode1,
int idnode2, int idnode3, int idnode4, int idnode5, int idnode6) smIdType idnode2, smIdType idnode3, smIdType idnode4, smIdType idnode5, smIdType idnode6)
{ {
if ( myType != SMESHDS_AddPrism) if ( myType != SMESHDS_AddPrism)
{ {
@ -224,11 +224,11 @@ void SMESHDS_Command::AddVolume(int NewVolID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, void SMESHDS_Command::AddVolume(smIdType NewVolID,
int idnode1, smIdType idnode1,
int idnode2, smIdType idnode2,
int idnode3, smIdType idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8) smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8)
{ {
if ( myType != SMESHDS_AddHexahedron) if ( myType != SMESHDS_AddHexahedron)
{ {
@ -247,10 +247,10 @@ void SMESHDS_Command::AddVolume(int NewVolID,
myNumber++; myNumber++;
} }
void SMESHDS_Command::AddVolume(int NewVolID, void SMESHDS_Command::AddVolume(smIdType NewVolID,
int idnode1,int idnode2,int idnode3,int idnode4, smIdType idnode1,smIdType idnode2,smIdType idnode3,smIdType idnode4,
int idnode5, int idnode6, int idnode7, int idnode8, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
int idnode9, int idnode10, int idnode11, int idnode12) smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12)
{ {
if (myType != SMESHDS_AddHexagonalPrism) if (myType != SMESHDS_AddHexagonalPrism)
{ {
@ -277,8 +277,8 @@ void SMESHDS_Command::AddVolume(int NewVolID,
//function : AddPolygonalFace //function : AddPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddPolygonalFace (const int ElementID, void SMESHDS_Command::AddPolygonalFace (const smIdType ElementID,
const std::vector<int>& nodes_ids) const std::vector<smIdType>& nodes_ids)
{ {
if ( myType != SMESHDS_AddPolygon) { if ( myType != SMESHDS_AddPolygon) {
MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type"); MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type");
@ -286,7 +286,7 @@ void SMESHDS_Command::AddPolygonalFace (const int ElementID,
} }
myIntegers.push_back(ElementID); myIntegers.push_back(ElementID);
int i, nbNodes = nodes_ids.size(); smIdType i, nbNodes = nodes_ids.size();
myIntegers.push_back(nbNodes); myIntegers.push_back(nbNodes);
for (i = 0; i < nbNodes; i++) { for (i = 0; i < nbNodes; i++) {
myIntegers.push_back(nodes_ids[i]); myIntegers.push_back(nodes_ids[i]);
@ -299,8 +299,8 @@ void SMESHDS_Command::AddPolygonalFace (const int ElementID,
//function : AddQuadPolygonalFace //function : AddQuadPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID, void SMESHDS_Command::AddQuadPolygonalFace (const smIdType ElementID,
const std::vector<int>& nodes_ids) const std::vector<smIdType>& nodes_ids)
{ {
if ( myType != SMESHDS_AddQuadPolygon) { if ( myType != SMESHDS_AddQuadPolygon) {
MESSAGE("SMESHDS_Command::AddQuadraticPolygonalFace : Bad Type"); MESSAGE("SMESHDS_Command::AddQuadraticPolygonalFace : Bad Type");
@ -308,7 +308,7 @@ void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID,
} }
myIntegers.push_back(ElementID); myIntegers.push_back(ElementID);
int i, nbNodes = nodes_ids.size(); smIdType i, nbNodes = nodes_ids.size();
myIntegers.push_back(nbNodes); myIntegers.push_back(nbNodes);
for (i = 0; i < nbNodes; i++) { for (i = 0; i < nbNodes; i++) {
myIntegers.push_back(nodes_ids[i]); myIntegers.push_back(nodes_ids[i]);
@ -321,9 +321,9 @@ void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID,
//function : AddPolyhedralVolume //function : AddPolyhedralVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, void SMESHDS_Command::AddPolyhedralVolume (const smIdType ElementID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities) const std::vector<int>& quantities)
{ {
if ( myType != SMESHDS_AddPolyhedron) { if ( myType != SMESHDS_AddPolyhedron) {
MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type"); MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type");
@ -331,13 +331,13 @@ void SMESHDS_Command::AddPolyhedralVolume (const int ElementID,
} }
myIntegers.push_back(ElementID); myIntegers.push_back(ElementID);
int i, nbNodes = nodes_ids.size(); smIdType i, nbNodes = nodes_ids.size();
myIntegers.push_back(nbNodes); myIntegers.push_back(nbNodes);
for (i = 0; i < nbNodes; i++) { for (i = 0; i < nbNodes; i++) {
myIntegers.push_back(nodes_ids[i]); myIntegers.push_back(nodes_ids[i]);
} }
int nbFaces = quantities.size(); smIdType nbFaces = quantities.size();
myIntegers.push_back(nbFaces); myIntegers.push_back(nbFaces);
for (i = 0; i < nbFaces; i++) { for (i = 0; i < nbFaces; i++) {
myIntegers.push_back(quantities[i]); myIntegers.push_back(quantities[i]);
@ -350,7 +350,7 @@ void SMESHDS_Command::AddPolyhedralVolume (const int ElementID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::RemoveNode(int NodeID) void SMESHDS_Command::RemoveNode(smIdType NodeID)
{ {
if ( myType != SMESHDS_RemoveNode) if ( myType != SMESHDS_RemoveNode)
{ {
@ -365,7 +365,7 @@ void SMESHDS_Command::RemoveNode(int NodeID)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::RemoveElement(int ElementID) void SMESHDS_Command::RemoveElement(smIdType ElementID)
{ {
if ( myType != SMESHDS_RemoveElement) if ( myType != SMESHDS_RemoveElement)
{ {
@ -381,7 +381,7 @@ void SMESHDS_Command::RemoveElement(int ElementID)
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::ChangeElementNodes(int ElementID, int nodes[], int nbnodes) void SMESHDS_Command::ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes)
{ {
if ( myType != SMESHDS_ChangeElementNodes) if ( myType != SMESHDS_ChangeElementNodes)
{ {
@ -390,7 +390,7 @@ void SMESHDS_Command::ChangeElementNodes(int ElementID, int nodes[], int nbnodes
} }
myIntegers.push_back(ElementID); myIntegers.push_back(ElementID);
myIntegers.push_back(nbnodes); myIntegers.push_back(nbnodes);
for ( int i = 0; i < nbnodes; i++ ) for ( smIdType i = 0; i < nbnodes; i++ )
myIntegers.push_back( nodes[ i ] ); myIntegers.push_back( nodes[ i ] );
myNumber++; myNumber++;
@ -400,8 +400,8 @@ void SMESHDS_Command::ChangeElementNodes(int ElementID, int nodes[], int nbnodes
//function : ChangePolyhedronNodes //function : ChangePolyhedronNodes
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID, void SMESHDS_Command::ChangePolyhedronNodes (const smIdType ElementID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities) const std::vector<int>& quantities)
{ {
if (myType != SMESHDS_ChangePolyhedronNodes) if (myType != SMESHDS_ChangePolyhedronNodes)
@ -411,7 +411,7 @@ void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID,
} }
myIntegers.push_back(ElementID); myIntegers.push_back(ElementID);
int i, nbNodes = nodes_ids.size(); smIdType i, nbNodes = nodes_ids.size();
myIntegers.push_back(nbNodes); myIntegers.push_back(nbNodes);
for (i = 0; i < nbNodes; i++) { for (i = 0; i < nbNodes; i++) {
myIntegers.push_back(nodes_ids[i]); myIntegers.push_back(nodes_ids[i]);
@ -431,7 +431,7 @@ void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID,
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::Renumber (const bool isNodes, const int startID, const int deltaID) void SMESHDS_Command::Renumber (const bool isNodes, const smIdType startID, const smIdType deltaID)
{ {
if ( myType != SMESHDS_Renumber) if ( myType != SMESHDS_Renumber)
{ {
@ -457,7 +457,7 @@ SMESHDS_CommandType SMESHDS_Command::GetType()
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMESHDS_Command::GetNumber() smIdType SMESHDS_Command::GetNumber()
{ {
return myNumber; return myNumber;
} }
@ -466,7 +466,7 @@ int SMESHDS_Command::GetNumber()
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
const list < int >&SMESHDS_Command::GetIndexes() const list < smIdType >&SMESHDS_Command::GetIndexes()
{ {
return myIntegers; return myIntegers;
} }
@ -489,7 +489,7 @@ const list < double >&SMESHDS_Command::GetCoords()
//function : AddEdge //function : AddEdge
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddEdge(int NewEdgeID, int n1, int n2, int n12) void SMESHDS_Command::AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12)
{ {
if ( myType != SMESHDS_AddQuadEdge) { if ( myType != SMESHDS_AddQuadEdge) {
MESSAGE("SMESHDS_Command::AddEdge : Bad Type"); MESSAGE("SMESHDS_Command::AddEdge : Bad Type");
@ -506,9 +506,9 @@ void SMESHDS_Command::AddEdge(int NewEdgeID, int n1, int n2, int n12)
//function : AddFace //function : AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID, void SMESHDS_Command::AddFace(smIdType NewFaceID,
int n1, int n2, int n3, smIdType n1, smIdType n2, smIdType n3,
int n12, int n23, int n31) smIdType n12, smIdType n23, smIdType n31)
{ {
if ( myType != SMESHDS_AddQuadTriangle) { if ( myType != SMESHDS_AddQuadTriangle) {
MESSAGE("SMESHDS_Command::AddFace : Bad Type"); MESSAGE("SMESHDS_Command::AddFace : Bad Type");
@ -528,9 +528,9 @@ void SMESHDS_Command::AddFace(int NewFaceID,
//function : AddFace //function : AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID, void SMESHDS_Command::AddFace(smIdType NewFaceID,
int n1, int n2, int n3, smIdType n1, smIdType n2, smIdType n3,
int n12, int n23, int n31, int nCenter) smIdType n12, smIdType n23, smIdType n31, smIdType nCenter)
{ {
if ( myType != SMESHDS_AddBiQuadTriangle) { if ( myType != SMESHDS_AddBiQuadTriangle) {
MESSAGE("SMESHDS_Command::AddFace : Bad Type"); MESSAGE("SMESHDS_Command::AddFace : Bad Type");
@ -551,9 +551,9 @@ void SMESHDS_Command::AddFace(int NewFaceID,
//function : AddFace //function : AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID, void SMESHDS_Command::AddFace(smIdType NewFaceID,
int n1, int n2, int n3, int n4, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n34, int n41) smIdType n12, smIdType n23, smIdType n34, smIdType n41)
{ {
if ( myType != SMESHDS_AddQuadQuadrangle) { if ( myType != SMESHDS_AddQuadQuadrangle) {
MESSAGE("SMESHDS_Command::AddFace : Bad Type"); MESSAGE("SMESHDS_Command::AddFace : Bad Type");
@ -575,9 +575,9 @@ void SMESHDS_Command::AddFace(int NewFaceID,
//function : AddFace //function : AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID, void SMESHDS_Command::AddFace(smIdType NewFaceID,
int n1, int n2, int n3, int n4, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n34, int n41, int nCenter) smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter)
{ {
if (myType != SMESHDS_AddBiQuadQuadrangle) { if (myType != SMESHDS_AddBiQuadQuadrangle) {
MESSAGE("SMESHDS_Command::AddFace : Bad Type"); MESSAGE("SMESHDS_Command::AddFace : Bad Type");
@ -600,9 +600,9 @@ void SMESHDS_Command::AddFace(int NewFaceID,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n31, smIdType n12, smIdType n23, smIdType n31,
int n14, int n24, int n34) smIdType n14, smIdType n24, smIdType n34)
{ {
if ( myType != SMESHDS_AddQuadTetrahedron) { if ( myType != SMESHDS_AddQuadTetrahedron) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
@ -626,10 +626,10 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2,
int n3, int n4, int n5, smIdType n3, smIdType n4, smIdType n5,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n15, int n25, int n35, int n45) smIdType n15, smIdType n25, smIdType n35, smIdType n45)
{ {
if ( myType != SMESHDS_AddQuadPyramid) { if ( myType != SMESHDS_AddQuadPyramid) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
@ -656,11 +656,11 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2,
int n3, int n4, int n5,int n6, smIdType n3, smIdType n4, smIdType n5,smIdType n6,
int n12, int n23, int n31, smIdType n12, smIdType n23, smIdType n31,
int n45, int n56, int n64, smIdType n45, smIdType n56, smIdType n64,
int n14, int n25, int n36) smIdType n14, smIdType n25, smIdType n36)
{ {
if ( myType != SMESHDS_AddQuadPentahedron) { if ( myType != SMESHDS_AddQuadPentahedron) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
@ -688,12 +688,12 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2,
int n3, int n4, int n5,int n6, smIdType n3, smIdType n4, smIdType n5,smIdType n6,
int n12, int n23, int n31, smIdType n12, smIdType n23, smIdType n31,
int n45, int n56, int n64, smIdType n45, smIdType n56, smIdType n64,
int n14, int n25, int n36, smIdType n14, smIdType n25, smIdType n36,
int n1245, int n2356, int n1346) smIdType n1245, smIdType n2356, smIdType n1346)
{ {
if ( myType != SMESHDS_AddBiQuadPentahedron) { if ( myType != SMESHDS_AddBiQuadPentahedron) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
@ -726,11 +726,11 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, int n7, int n8, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n56, int n67, int n78, int n85, smIdType n56, smIdType n67, smIdType n78, smIdType n85,
int n15, int n26, int n37, int n48) smIdType n15, smIdType n26, smIdType n37, smIdType n48)
{ {
if ( myType != SMESHDS_AddQuadHexahedron) { if ( myType != SMESHDS_AddQuadHexahedron) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
@ -764,13 +764,13 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, int n7, int n8, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n56, int n67, int n78, int n85, smIdType n56, smIdType n67, smIdType n78, smIdType n85,
int n15, int n26, int n37, int n48, smIdType n15, smIdType n26, smIdType n37, smIdType n48,
int n1234,int n1256,int n2367,int n3478, smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
int n1458,int n5678,int nCenter) smIdType n1458,smIdType n5678,smIdType nCenter)
{ {
if ( myType != SMESHDS_AddTriQuadHexa) { if ( myType != SMESHDS_AddTriQuadHexa) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
@ -813,7 +813,7 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3,
*/ */
//================================================================================ //================================================================================
void SMESHDS_Command::AddBall(int NewBallID, int node, double diameter) void SMESHDS_Command::AddBall(smIdType NewBallID, smIdType node, double diameter)
{ {
if ( myType != SMESHDS_AddBall) if ( myType != SMESHDS_AddBall)
{ {

View File

@ -30,6 +30,7 @@
#include "SMESH_SMESHDS.hxx" #include "SMESH_SMESHDS.hxx"
#include "SMESHDS_CommandType.hxx" #include "SMESHDS_CommandType.hxx"
#include <smIdType.hxx>
#include <list> #include <list>
#include <vector> #include <vector>
@ -38,87 +39,87 @@ class SMESHDS_EXPORT SMESHDS_Command
public: public:
SMESHDS_Command(const SMESHDS_CommandType aType); SMESHDS_Command(const SMESHDS_CommandType aType);
void AddNode(int NewNodeID, double x, double y, double z); void AddNode(smIdType NewNodeID, double x, double y, double z);
void Add0DElement(int New0DElementID, int idnode); void Add0DElement(smIdType New0DElementID, smIdType idnode);
void AddEdge(int NewEdgeID, int idnode1, int idnode2); void AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2);
void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3); void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3);
void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3, void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4); smIdType idnode4);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4); smIdType idnode4);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5); smIdType idnode4, smIdType idnode5);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5, int idnode6); smIdType idnode4, smIdType idnode5, smIdType idnode6);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8); smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
int idnode9, int idnode10, int idnode11, int idnode12); smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12);
void AddPolygonalFace (const int ElementID, void AddPolygonalFace (const smIdType ElementID,
const std::vector<int>& nodes_ids); const std::vector<smIdType>& nodes_ids);
void AddQuadPolygonalFace (const int ElementID, void AddQuadPolygonalFace (const smIdType ElementID,
const std::vector<int>& nodes_ids); const std::vector<smIdType>& nodes_ids);
void AddPolyhedralVolume (const int ElementID, void AddPolyhedralVolume (const smIdType ElementID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities); const std::vector<int>& quantities);
void AddBall(int NewBallID, int node, double diameter); void AddBall(smIdType NewBallID, smIdType node, double diameter);
// special methods for quadratic elements // special methods for quadratic elements
void AddEdge(int NewEdgeID, int n1, int n2, int n12); void AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12);
void AddFace(int NewFaceID, int n1, int n2, int n3, void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
int n12, int n23, int n31); smIdType n12, smIdType n23, smIdType n31);
void AddFace(int NewFaceID, int n1, int n2, int n3, void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
int n12, int n23, int n31, int nCenter); smIdType n12, smIdType n23, smIdType n31, smIdType nCenter);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n34, int n41); smIdType n12, smIdType n23, smIdType n34, smIdType n41);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n34, int n41, int nCenter); smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n31, int n14, int n24, int n34); smIdType n12, smIdType n23, smIdType n31, smIdType n14, smIdType n24, smIdType n34);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n15, int n25, int n35, int n45); smIdType n15, smIdType n25, smIdType n35, smIdType n45);
void AddVolume(int NewVolID, int n1, int n2, int n3, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12, int n23, int n31, smIdType n12, smIdType n23, smIdType n31,
int n45, int n56, int n64, smIdType n45, smIdType n56, smIdType n64,
int n14, int n25, int n36); smIdType n14, smIdType n25, smIdType n36);
void AddVolume(int NewVolID, int n1, int n2, int n3, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12, int n23, int n31, smIdType n12, smIdType n23, smIdType n31,
int n45, int n56, int n64, smIdType n45, smIdType n56, smIdType n64,
int n14, int n25, int n36, smIdType n14, smIdType n25, smIdType n36,
int n1245, int n2356, int n1346); smIdType n1245, smIdType n2356, smIdType n1346);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n56, int n67, int n78, int n85, smIdType n56, smIdType n67, smIdType n78, smIdType n85,
int n15, int n26, int n37, int n48); smIdType n15, smIdType n26, smIdType n37, smIdType n48);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n56, int n67, int n78, int n85, smIdType n56, smIdType n67, smIdType n78, smIdType n85,
int n15, int n26, int n37, int n48, smIdType n15, smIdType n26, smIdType n37, smIdType n48,
int n1234,int n1256,int n2367,int n3478, smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
int n1458,int n5678,int nCenter); smIdType n1458,smIdType n5678,smIdType nCenter);
void MoveNode(int NewNodeID, double x, double y, double z); void MoveNode(smIdType NewNodeID, double x, double y, double z);
void RemoveNode(int NodeID); void RemoveNode(smIdType NodeID);
void RemoveElement(int ElementID); void RemoveElement(smIdType ElementID);
void ChangeElementNodes(int ElementID, int nodes[], int nbnodes); void ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes);
void ChangePolyhedronNodes(const int ElementID, void ChangePolyhedronNodes(const smIdType ElementID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities); const std::vector<int>& quantities);
void Renumber (const bool isNodes, const int startID, const int deltaID); void Renumber (const bool isNodes, const smIdType startID, const smIdType deltaID);
SMESHDS_CommandType GetType(); SMESHDS_CommandType GetType();
int GetNumber(); smIdType GetNumber();
const std::list<int> & GetIndexes(); const std::list<smIdType> & GetIndexes();
const std::list<double> & GetCoords(); const std::list<double> & GetCoords();
~SMESHDS_Command(); ~SMESHDS_Command();
private: private:
SMESHDS_CommandType myType; SMESHDS_CommandType myType;
int myNumber; int myNumber;
std::list<double> myReals; std::list<double> myReals;
std::list<int> myIntegers; std::list<smIdType> myIntegers;
}; };
#endif #endif

View File

@ -45,7 +45,7 @@ SMESHDS_Group::SMESHDS_Group (const int theID,
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMESHDS_Group::Extent() const smIdType SMESHDS_Group::Extent() const
{ {
return myGroup.Extent(); return myGroup.Extent();
} }
@ -66,7 +66,7 @@ bool SMESHDS_Group::IsEmpty()
*/ */
//============================================================================= //=============================================================================
bool SMESHDS_Group::Contains (const int theID) bool SMESHDS_Group::Contains (const smIdType theID)
{ {
const SMDS_MeshElement* aElem = findInMesh (theID); const SMDS_MeshElement* aElem = findInMesh (theID);
if (aElem) if (aElem)
@ -92,7 +92,7 @@ bool SMESHDS_Group::Contains (const SMDS_MeshElement* elem)
*/ */
//============================================================================= //=============================================================================
bool SMESHDS_Group::Add (const int theID) bool SMESHDS_Group::Add (const smIdType theID)
{ {
return Add( findInMesh( theID )); return Add( findInMesh( theID ));
} }
@ -121,7 +121,7 @@ bool SMESHDS_Group::Add (const SMDS_MeshElement* aElem )
*/ */
//============================================================================= //=============================================================================
bool SMESHDS_Group::Remove (const int theID) bool SMESHDS_Group::Remove (const smIdType theID)
{ {
bool removed = false; bool removed = false;
if ( const SMDS_MeshElement* aElem = findInMesh( theID )) if ( const SMDS_MeshElement* aElem = findInMesh( theID ))

View File

@ -46,11 +46,11 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase
virtual void SetType(SMDSAbs_ElementType theType); virtual void SetType(SMDSAbs_ElementType theType);
virtual int Extent() const; virtual smIdType Extent() const;
virtual bool IsEmpty(); virtual bool IsEmpty();
virtual bool Contains (const int theID); virtual bool Contains (const smIdType theID);
virtual bool Contains (const SMDS_MeshElement* elem); virtual bool Contains (const SMDS_MeshElement* elem);
@ -58,11 +58,11 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase
virtual int GetTic() const; virtual int GetTic() const;
bool Add (const int theID); bool Add (const smIdType theID);
bool Add (const SMDS_MeshElement* theElem ); bool Add (const SMDS_MeshElement* theElem );
bool Remove (const int theID); bool Remove (const smIdType theID);
void Clear(); void Clear();

View File

@ -55,7 +55,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int theID,
*/ */
//============================================================================= //=============================================================================
int SMESHDS_GroupBase::GetID (const int theIndex) smIdType SMESHDS_GroupBase::GetID (const int theIndex)
{ {
if (myCurIndex < 1 || myCurIndex > theIndex) { if (myCurIndex < 1 || myCurIndex > theIndex) {
myIterator = GetElements(); myIterator = GetElements();
@ -75,7 +75,7 @@ int SMESHDS_GroupBase::GetID (const int theIndex)
*/ */
//============================================================================= //=============================================================================
const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const int theID) const const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const smIdType theID) const
{ {
SMDSAbs_ElementType aType = GetType(); SMDSAbs_ElementType aType = GetType();
const SMDS_MeshElement* aElem = NULL; const SMDS_MeshElement* aElem = NULL;
@ -107,10 +107,10 @@ void SMESHDS_GroupBase::resetIterator()
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMESHDS_GroupBase::Extent() const smIdType SMESHDS_GroupBase::Extent() const
{ {
SMDS_ElemIteratorPtr it = GetElements(); SMDS_ElemIteratorPtr it = GetElements();
int nb = 0; smIdType nb = 0;
if ( it ) if ( it )
for ( ; it->more(); it->next() ) for ( ; it->more(); it->next() )
nb++; nb++;
@ -136,7 +136,7 @@ bool SMESHDS_GroupBase::IsEmpty()
//purpose : //purpose :
//======================================================================= //=======================================================================
bool SMESHDS_GroupBase::Contains (const int theID) bool SMESHDS_GroupBase::Contains (const smIdType theID)
{ {
if ( SMDS_ElemIteratorPtr it = GetElements() ) { if ( SMDS_ElemIteratorPtr it = GetElements() ) {
while ( it->more() ) while ( it->more() )

View File

@ -58,17 +58,17 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
const char* GetStoreName () const { return myStoreName.c_str(); } const char* GetStoreName () const { return myStoreName.c_str(); }
virtual int Extent() const; virtual smIdType Extent() const;
virtual bool IsEmpty(); virtual bool IsEmpty();
virtual bool Contains (const int theID); virtual bool Contains (const smIdType theID);
virtual bool Contains (const SMDS_MeshElement* elem); virtual bool Contains (const SMDS_MeshElement* elem);
virtual SMDS_ElemIteratorPtr GetElements() const = 0; virtual SMDS_ElemIteratorPtr GetElements() const = 0;
virtual int GetID (const int theIndex); virtual smIdType GetID (const int theIndex);
// DON'T use it for iterations 1..Extent() // DON'T use it for iterations 1..Extent()
virtual int GetTic() const = 0; virtual int GetTic() const = 0;
@ -89,7 +89,7 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
{ myDefaultColor = theColor;} { myDefaultColor = theColor;}
protected: protected:
const SMDS_MeshElement* findInMesh (const int theID) const; const SMDS_MeshElement* findInMesh (const smIdType theID) const;
void resetIterator(); void resetIterator();
private: private:
@ -105,8 +105,8 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
Quantity_Color myColor; Quantity_Color myColor;
// for GetID() // for GetID()
int myCurIndex; smIdType myCurIndex;
int myCurID; smIdType myCurID;
SMDS_ElemIteratorPtr myIterator; SMDS_ElemIteratorPtr myIterator;
static Quantity_Color myDefaultColor; static Quantity_Color myDefaultColor;

View File

@ -79,7 +79,7 @@ void SMESHDS_GroupOnFilter::SetPredicate( const SMESH_PredicatePtr& thePredicate
*/ */
//================================================================================ //================================================================================
int SMESHDS_GroupOnFilter::Extent() const smIdType SMESHDS_GroupOnFilter::Extent() const
{ {
update(); update();
return std::accumulate( myMeshInfo.begin(), myMeshInfo.end(), 0 ); return std::accumulate( myMeshInfo.begin(), myMeshInfo.end(), 0 );
@ -120,7 +120,7 @@ bool SMESHDS_GroupOnFilter::IsEmpty()
*/ */
//================================================================================ //================================================================================
bool SMESHDS_GroupOnFilter::Contains (const int theID) bool SMESHDS_GroupOnFilter::Contains (const smIdType theID)
{ {
return myPredicate && myPredicate->IsSatisfy( theID ); return myPredicate && myPredicate->IsSatisfy( theID );
} }
@ -288,7 +288,7 @@ SMDS_ElemIteratorPtr SMESHDS_GroupOnFilter::GetElements() const
*/ */
//================================================================================ //================================================================================
std::vector< int > SMESHDS_GroupOnFilter::GetMeshInfo() const std::vector< smIdType > SMESHDS_GroupOnFilter::GetMeshInfo() const
{ {
update(); update();
return myMeshInfo; return myMeshInfo;
@ -315,7 +315,7 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
if ( IsUpToDate() ) if ( IsUpToDate() )
{ {
for ( ; elIt->more(); curID += idSize ) for ( ; elIt->more(); curID += idSize )
(*(int*) curID) = elIt->next()->GetID(); (*(smIdType*) curID) = elIt->next()->GetID();
} }
else else
{ {
@ -325,11 +325,11 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
me->myMeshInfo.assign( SMDSEntity_Last, 0 ); me->myMeshInfo.assign( SMDSEntity_Last, 0 );
me->myMeshInfo[ firstOkElem->GetEntityType() ]++; me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
(*(int*) curID) = firstOkElem->GetID(); (*(smIdType*) curID) = firstOkElem->GetID();
for ( curID += idSize; elIt->more(); curID += idSize ) for ( curID += idSize; elIt->more(); curID += idSize )
{ {
const SMDS_MeshElement* e = elIt->next(); const SMDS_MeshElement* e = elIt->next();
(*(int*) curID) = e->GetID(); (*(smIdType*) curID) = e->GetID();
me->myMeshInfo[ e->GetEntityType() ]++; me->myMeshInfo[ e->GetEntityType() ]++;
} }
} }
@ -443,7 +443,7 @@ bool SMESHDS_GroupOnFilter::updateParallel() const
return false; // no sense in parallel work return false; // no sense in parallel work
SMDS_ElemIteratorPtr elemIt = GetMesh()->elementsIterator( GetType() ); SMDS_ElemIteratorPtr elemIt = GetMesh()->elementsIterator( GetType() );
const int minID = elemIt->next()->GetID(); const smIdType minID = elemIt->next()->GetID();
myPredicate->IsSatisfy( minID ); // make myPredicate fully initialized for clone() myPredicate->IsSatisfy( minID ); // make myPredicate fully initialized for clone()
SMESH_PredicatePtr clone( myPredicate->clone() ); SMESH_PredicatePtr clone( myPredicate->clone() );
if ( !clone ) if ( !clone )
@ -452,7 +452,7 @@ bool SMESHDS_GroupOnFilter::updateParallel() const
TLocalPredicat threadPredicates; TLocalPredicat threadPredicates;
threadPredicates.local() = clone; threadPredicates.local() = clone;
int maxID = ( GetType() == SMDSAbs_Node ) ? GetMesh()->MaxNodeID() : GetMesh()->MaxElementID(); smIdType maxID = ( GetType() == SMDSAbs_Node ) ? GetMesh()->MaxNodeID() : GetMesh()->MaxElementID();
vector< char > isElemOK( 1 + maxID ); vector< char > isElemOK( 1 + maxID );
tbb::parallel_for ( tbb::blocked_range<size_t>( 0, isElemOK.size() ), tbb::parallel_for ( tbb::blocked_range<size_t>( 0, isElemOK.size() ),

View File

@ -47,20 +47,20 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme
SMESH_PredicatePtr GetPredicate() const { return myPredicate; } SMESH_PredicatePtr GetPredicate() const { return myPredicate; }
std::vector< int > GetMeshInfo() const; std::vector< smIdType > GetMeshInfo() const;
template< typename IDTYPE > template< typename IDTYPE >
int GetElementIds( IDTYPE* ids ) const smIdType GetElementIds( IDTYPE* ids ) const
{ {
return getElementIds( (void*)ids, sizeof(IDTYPE)); return getElementIds( (void*)ids, sizeof(IDTYPE));
} }
virtual int Extent() const; virtual smIdType Extent() const;
virtual bool IsEmpty(); virtual bool IsEmpty();
virtual bool Contains (const int theID); virtual bool Contains (const smIdType theID);
virtual bool Contains (const SMDS_MeshElement* elem); virtual bool Contains (const SMDS_MeshElement* elem);
@ -92,7 +92,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme
// 2) The case of enough free memory. Remember all OK elements (myElements). // 2) The case of enough free memory. Remember all OK elements (myElements).
SMESH_PredicatePtr myPredicate; SMESH_PredicatePtr myPredicate;
std::vector< int > myMeshInfo; std::vector< smIdType > myMeshInfo;
std::vector< const SMDS_MeshElement*> myElements; std::vector< const SMDS_MeshElement*> myElements;
bool myElementsOK; bool myElementsOK;
size_t myMeshModifTime; // when myMeshInfo was updated size_t myMeshModifTime; // when myMeshInfo was updated

View File

@ -132,7 +132,7 @@ SMDS_ElemIteratorPtr SMESHDS_GroupOnGeom::GetElements() const
//purpose : //purpose :
//======================================================================= //=======================================================================
bool SMESHDS_GroupOnGeom::Contains (const int theID) bool SMESHDS_GroupOnGeom::Contains (const smIdType theID)
{ {
return mySubMesh->Contains( findInMesh( theID )); return mySubMesh->Contains( findInMesh( theID ));
} }

View File

@ -47,7 +47,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnGeom: public SMESHDS_GroupBase
TopoDS_Shape GetShape() const { return myShape; } TopoDS_Shape GetShape() const { return myShape; }
virtual bool Contains (const int theID); virtual bool Contains (const smIdType theID);
virtual bool Contains (const SMDS_MeshElement* elem); virtual bool Contains (const SMDS_MeshElement* elem);

View File

@ -194,7 +194,7 @@ SMDS_MeshNode* SMESHDS_Mesh::AddNode(double x, double y, double z){
return node; return node;
} }
SMDS_MeshNode* SMESHDS_Mesh::AddNodeWithID(double x, double y, double z, int ID){ SMDS_MeshNode* SMESHDS_Mesh::AddNodeWithID(double x, double y, double z, smIdType ID){
SMDS_MeshNode* node = SMDS_Mesh::AddNodeWithID(x,y,z,ID); SMDS_MeshNode* node = SMDS_Mesh::AddNodeWithID(x,y,z,ID);
if(node!=NULL) myScript->AddNode(node->GetID(), x, y, z); if(node!=NULL) myScript->AddNode(node->GetID(), x, y, z);
return node; return node;
@ -223,8 +223,8 @@ bool SMESHDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem,
if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes )) if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes ))
return false; return false;
std::vector<int> IDs( nbnodes ); std::vector<smIdType> IDs( nbnodes );
for ( int i = 0; i < nbnodes; i++ ) for ( smIdType i = 0; i < nbnodes; i++ )
IDs [ i ] = nodes[ i ]->GetID(); IDs [ i ] = nodes[ i ]->GetID();
myScript->ChangeElementNodes( elem->GetID(), &IDs[0], nbnodes); myScript->ChangeElementNodes( elem->GetID(), &IDs[0], nbnodes);
@ -258,8 +258,8 @@ bool SMESHDS_Mesh
if ( !SMDS_Mesh::ChangePolyhedronNodes( elem, nodes, quantities )) if ( !SMDS_Mesh::ChangePolyhedronNodes( elem, nodes, quantities ))
return false; return false;
int i, len = nodes.size(); smIdType i, len = nodes.size();
std::vector<int> nodes_ids (len); std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID(); nodes_ids[i] = nodes[i]->GetID();
} }
@ -273,7 +273,7 @@ bool SMESHDS_Mesh
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Mesh::Renumber (const bool /*isNodes*/, const int /*startID*/, const int /*deltaID*/) void SMESHDS_Mesh::Renumber (const bool /*isNodes*/, const smIdType /*startID*/, const smIdType /*deltaID*/)
{ {
// TODO not possible yet to have node numbers not starting to O and continuous. // TODO not possible yet to have node numbers not starting to O and continuous.
if ( !this->IsCompacted() ) if ( !this->IsCompacted() )
@ -286,7 +286,7 @@ void SMESHDS_Mesh::Renumber (const bool /*isNodes*/, const int /*startID*/, cons
//function : Add0DElement //function : Add0DElement
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID(int nodeID, int ID) SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID(smIdType nodeID, smIdType ID)
{ {
SMDS_Mesh0DElement* anElem = SMDS_Mesh::Add0DElementWithID(nodeID, ID); SMDS_Mesh0DElement* anElem = SMDS_Mesh::Add0DElementWithID(nodeID, ID);
if (anElem) myScript->Add0DElement(ID, nodeID); if (anElem) myScript->Add0DElement(ID, nodeID);
@ -294,7 +294,7 @@ SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID(int nodeID, int ID)
} }
SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID
(const SMDS_MeshNode * node, int ID) (const SMDS_MeshNode * node, smIdType ID)
{ {
return Add0DElementWithID(node->GetID(), ID); return Add0DElementWithID(node->GetID(), ID);
} }
@ -311,7 +311,7 @@ SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElement(const SMDS_MeshNode * node)
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(int node, double diameter, int ID) SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(smIdType node, double diameter, smIdType ID)
{ {
SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID); SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID);
if (anElem) myScript->AddBall(anElem->GetID(), node, diameter); if (anElem) myScript->AddBall(anElem->GetID(), node, diameter);
@ -320,7 +320,7 @@ SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(int node, double diameter, int ID)
SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(const SMDS_MeshNode * node, SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(const SMDS_MeshNode * node,
double diameter, double diameter,
int ID) smIdType ID)
{ {
SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID); SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID);
if (anElem) myScript->AddBall(anElem->GetID(), node->GetID(), diameter); if (anElem) myScript->AddBall(anElem->GetID(), node->GetID(), diameter);
@ -340,7 +340,7 @@ SMDS_BallElement* SMESHDS_Mesh::AddBall (const SMDS_MeshNode * node,
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int ID) SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(smIdType n1, smIdType n2, smIdType ID)
{ {
SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,ID); SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,ID);
if(anElem) myScript->AddEdge(ID,n1,n2); if(anElem) myScript->AddEdge(ID,n1,n2);
@ -349,7 +349,7 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int ID)
SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
int ID) smIdType ID)
{ {
return AddEdgeWithID(n1->GetID(), return AddEdgeWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -370,7 +370,7 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdge(const SMDS_MeshNode * n1,
//function :AddFace //function :AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int ID) SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1, n2, n3, ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1, n2, n3, ID);
if(anElem) myScript->AddFace(ID,n1,n2,n3); if(anElem) myScript->AddFace(ID,n1,n2,n3);
@ -380,7 +380,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int ID)
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
int ID) smIdType ID)
{ {
return AddFaceWithID(n1->GetID(), return AddFaceWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -404,7 +404,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace( const SMDS_MeshNode * n1,
//function :AddFace //function :AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, int ID) SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1, n2, n3, n4, ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1, n2, n3, n4, ID);
if(anElem) myScript->AddFace(ID, n1, n2, n3, n4); if(anElem) myScript->AddFace(ID, n1, n2, n3, n4);
@ -415,7 +415,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
int ID) smIdType ID)
{ {
return AddFaceWithID(n1->GetID(), return AddFaceWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -442,7 +442,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function :AddVolume //function :AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int ID) SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, ID); SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, ID);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4);
@ -453,7 +453,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), return AddVolumeWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -480,7 +480,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function :AddVolume //function :AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int ID) SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, ID); SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, ID);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5);
@ -492,7 +492,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), return AddVolumeWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -522,7 +522,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function :AddVolume //function :AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int ID) SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType ID)
{ {
SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID); SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6);
@ -535,7 +535,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6, const SMDS_MeshNode * n6,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), return AddVolumeWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -568,7 +568,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function :AddVolume //function :AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int ID) SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, smIdType ID)
{ {
SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, ID); SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, ID);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8);
@ -583,7 +583,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n6, const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7, const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8, const SMDS_MeshNode * n8,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), return AddVolumeWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -623,10 +623,10 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function :AddVolume //function :AddVolume
//purpose : add hexagonal prism //purpose : add hexagonal prism
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n9, int n10, int n11, int n12, smIdType n9, smIdType n10, smIdType n11, smIdType n12,
int ID) smIdType ID)
{ {
SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, ID); SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, ID);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12);
@ -645,7 +645,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n10, const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11, const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), return AddVolumeWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -697,8 +697,8 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddPolygonalFace //function : AddPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<int>& nodes_ids, SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType>& nodes_ids,
const int ID) const smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes_ids, ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes_ids, ID);
if (anElem) { if (anElem) {
@ -709,12 +709,12 @@ SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<int>& nod
SMDS_MeshFace* SMDS_MeshFace*
SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes, SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes,
const int ID) const smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes, ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes, ID);
if (anElem) { if (anElem) {
int i, len = nodes.size(); smIdType i, len = nodes.size();
std::vector<int> nodes_ids (len); std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID(); nodes_ids[i] = nodes[i]->GetID();
} }
@ -728,8 +728,8 @@ SMESHDS_Mesh::AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFace(nodes); SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFace(nodes);
if (anElem) { if (anElem) {
int i, len = nodes.size(); smIdType i, len = nodes.size();
std::vector<int> nodes_ids (len); std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID(); nodes_ids[i] = nodes[i]->GetID();
} }
@ -743,8 +743,8 @@ SMESHDS_Mesh::AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes)
//function : AddQuadPolygonalFace //function : AddQuadPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<int>& nodes_ids, SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<smIdType>& nodes_ids,
const int ID) const smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes_ids, ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes_ids, ID);
if (anElem) { if (anElem) {
@ -755,12 +755,12 @@ SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<int>&
SMDS_MeshFace* SMDS_MeshFace*
SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes, SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes,
const int ID) const smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes, ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes, ID);
if (anElem) { if (anElem) {
int i, len = nodes.size(); smIdType i, len = nodes.size();
std::vector<int> nodes_ids (len); std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID(); nodes_ids[i] = nodes[i]->GetID();
} }
@ -774,8 +774,8 @@ SMESHDS_Mesh::AddQuadPolygonalFace (const std::vector<const SMDS_MeshNode*>& nod
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFace(nodes); SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFace(nodes);
if (anElem) { if (anElem) {
int i, len = nodes.size(); smIdType i, len = nodes.size();
std::vector<int> nodes_ids (len); std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID(); nodes_ids[i] = nodes[i]->GetID();
} }
@ -789,9 +789,9 @@ SMESHDS_Mesh::AddQuadPolygonalFace (const std::vector<const SMDS_MeshNode*>& nod
//function : AddPolyhedralVolume //function : AddPolyhedralVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<int>& nodes_ids, SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities, const std::vector<int>& quantities,
const int ID) const smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID); SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID);
if (anElem) { if (anElem) {
@ -803,12 +803,12 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<int>
SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*>& nodes, (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities, const std::vector<int>& quantities,
const int ID) const smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID); SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
if (anElem) { if (anElem) {
int i, len = nodes.size(); smIdType i, len = nodes.size();
std::vector<int> nodes_ids (len); std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID(); nodes_ids[i] = nodes[i]->GetID();
} }
@ -823,8 +823,8 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolume
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolume(nodes, quantities); SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolume(nodes, quantities);
if (anElem) { if (anElem) {
int i, len = nodes.size(); smIdType i, len = nodes.size();
std::vector<int> nodes_ids (len); std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID(); nodes_ids[i] = nodes[i]->GetID();
} }
@ -1489,7 +1489,7 @@ SMESHDS_Mesh::~SMESHDS_Mesh()
//function : AddEdgeWithID //function : AddEdgeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int n12, int ID) SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(smIdType n1, smIdType n2, smIdType n12, smIdType ID)
{ {
SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,n12,ID); SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,n12,ID);
if(anElem) myScript->AddEdge(ID,n1,n2,n12); if(anElem) myScript->AddEdge(ID,n1,n2,n12);
@ -1519,7 +1519,7 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdge(const SMDS_MeshNode* n1,
SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
int ID) smIdType ID)
{ {
return AddEdgeWithID(n1->GetID(), return AddEdgeWithID(n1->GetID(),
n2->GetID(), n2->GetID(),
@ -1550,8 +1550,8 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function : AddFaceWithID //function : AddFaceWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
int n12,int n23,int n31, int ID) smIdType n12,smIdType n23,smIdType n31, smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,ID);
if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31); if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31);
@ -1568,7 +1568,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31, const SMDS_MeshNode * n31,
int ID) smIdType ID)
{ {
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n12->GetID(), n23->GetID(), n31->GetID(), n12->GetID(), n23->GetID(), n31->GetID(),
@ -1599,8 +1599,8 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function : AddFaceWithID //function : AddFaceWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
int n12,int n23,int n31, int nCenter, int ID) smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,nCenter,ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,nCenter,ID);
if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31,nCenter); if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31,nCenter);
@ -1618,7 +1618,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31, const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID) smIdType ID)
{ {
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n12->GetID(), n23->GetID(), n31->GetID(), n12->GetID(), n23->GetID(), n31->GetID(),
@ -1650,8 +1650,8 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function : AddFaceWithID //function : AddFaceWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n34,int n41, int ID) smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,ID);
if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41); if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41);
@ -1670,7 +1670,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
int ID) smIdType ID)
{ {
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
@ -1704,9 +1704,9 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1,
//function : AddFaceWithID //function : AddFaceWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int nCenter, int ID) smIdType nCenter, smIdType ID)
{ {
SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,nCenter,ID); SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,nCenter,ID);
if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41,nCenter); if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41,nCenter);
@ -1726,7 +1726,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID) smIdType ID)
{ {
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
@ -1761,9 +1761,9 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n14,int n24,int n34, int ID) smIdType n14,smIdType n24,smIdType n34, smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n12,n23, SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n12,n23,
n31,n14,n24,n34,ID); n31,n14,n24,n34,ID);
@ -1785,7 +1785,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n14, const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24, const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n12->GetID(), n23->GetID(), n31->GetID(), n12->GetID(), n23->GetID(), n31->GetID(),
@ -1825,9 +1825,9 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n15,int n25,int n35,int n45, int ID) smIdType n15,smIdType n25,smIdType n35,smIdType n45, smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5, SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,
n12,n23,n34,n41, n12,n23,n34,n41,
@ -1854,7 +1854,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n25, const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35, const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45, const SMDS_MeshNode * n45,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n4->GetID(), n5->GetID(), n4->GetID(), n5->GetID(),
@ -1899,11 +1899,11 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : 2nd order pentahedron (prism) with 15 nodes //purpose : 2nd order pentahedron (prism) with 15 nodes
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n45,int n56,int n64, smIdType n45,smIdType n56,smIdType n64,
int n14,int n25,int n36, int ID) smIdType n14,smIdType n25,smIdType n36, smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6, SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,
n12,n23,n31, n12,n23,n31,
@ -1933,7 +1933,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n14, const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25, const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36, const SMDS_MeshNode * n36,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n4->GetID(), n5->GetID(), n6->GetID(), n4->GetID(), n5->GetID(), n6->GetID(),
@ -1982,13 +1982,13 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : 2nd order pentahedron (prism) with 18 nodes //purpose : 2nd order pentahedron (prism) with 18 nodes
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n45,int n56,int n64, smIdType n45,smIdType n56,smIdType n64,
int n14,int n25,int n36, smIdType n14,smIdType n25,smIdType n36,
int n1245, int n2356, int n1346, smIdType n1245, smIdType n2356, smIdType n1346,
int ID) smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6, SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,
n12,n23,n31, n12,n23,n31,
@ -2022,7 +2022,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n1245, const SMDS_MeshNode * n1245,
const SMDS_MeshNode * n2356, const SMDS_MeshNode * n2356,
const SMDS_MeshNode * n1346, const SMDS_MeshNode * n1346,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n4->GetID(), n5->GetID(), n6->GetID(), n4->GetID(), n5->GetID(), n6->GetID(),
@ -2076,11 +2076,11 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
//function : AddVolumeWithID //function : AddVolumeWithID
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n56,int n67,int n78,int n85, smIdType n56,smIdType n67,smIdType n78,smIdType n85,
int n15,int n26,int n37,int n48, int ID) smIdType n15,smIdType n26,smIdType n37,smIdType n48, smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8, SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8,
n12,n23,n34,n41, n12,n23,n34,n41,
@ -2115,7 +2115,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n26, const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37, const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48, const SMDS_MeshNode * n48,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(), n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(),
@ -2175,14 +2175,14 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
return anElem; return anElem;
} }
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n56,int n67,int n78,int n85, smIdType n56,smIdType n67,smIdType n78,smIdType n85,
int n15,int n26,int n37,int n48, smIdType n15,smIdType n26,smIdType n37,smIdType n48,
int n1234,int n1256,int n2367,int n3478, smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
int n1458,int n5678,int nCenter, smIdType n1458,smIdType n5678,smIdType nCenter,
int ID) smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8, SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8,
n12,n23,n34,n41, n12,n23,n34,n41,
@ -2225,7 +2225,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n1458, const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678, const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID) smIdType ID)
{ {
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(), n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(),
@ -2262,7 +2262,7 @@ void SMESHDS_Mesh::BuildDownWardConnectivity(bool withEdges)
* @param localClonedNodeIds map old node id to new node id. * @param localClonedNodeIds map old node id to new node id.
* @return ok if success. * @return ok if success.
*/ */
bool SMESHDS_Mesh::ModifyCellNodes(int vtkVolId, std::map<int,int> localClonedNodeIds) bool SMESHDS_Mesh::ModifyCellNodes(vtkIdType vtkVolId, std::map<int,int> localClonedNodeIds)
{ {
myGrid->ModifyCellNodes(vtkVolId, localClonedNodeIds); myGrid->ModifyCellNodes(vtkVolId, localClonedNodeIds);
return true; return true;

View File

@ -77,64 +77,64 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
bool AddHypothesis(const TopoDS_Shape & SS, const SMESHDS_Hypothesis * H); bool AddHypothesis(const TopoDS_Shape & SS, const SMESHDS_Hypothesis * H);
bool RemoveHypothesis(const TopoDS_Shape & S, const SMESHDS_Hypothesis * H); bool RemoveHypothesis(const TopoDS_Shape & S, const SMESHDS_Hypothesis * H);
virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, int ID); virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, smIdType ID);
virtual SMDS_MeshNode* AddNode(double x, double y, double z); virtual SMDS_MeshNode* AddNode(double x, double y, double z);
virtual SMDS_Mesh0DElement* Add0DElementWithID(int nodeID, int ID); virtual SMDS_Mesh0DElement* Add0DElementWithID(smIdType nodeID, smIdType ID);
virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * node, int ID); virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * node, smIdType ID);
virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * node); virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * node);
virtual SMDS_BallElement* AddBallWithID(int n, double diameter, int ID); virtual SMDS_BallElement* AddBallWithID(smIdType n, double diameter, smIdType ID);
virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID); virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, smIdType ID);
virtual SMDS_BallElement* AddBall (const SMDS_MeshNode * n, double diameter); virtual SMDS_BallElement* AddBall (const SMDS_MeshNode * n, double diameter);
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID); virtual SMDS_MeshEdge* AddEdgeWithID(smIdType n1, smIdType n2, smIdType ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
int ID); smIdType ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2); const SMDS_MeshNode * n2);
// 2d order edge with 3 nodes: n12 - node between n1 and n2 // 2d order edge with 3 nodes: n12 - node between n1 and n2
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID); virtual SMDS_MeshEdge* AddEdgeWithID(smIdType n1, smIdType n2, smIdType n12, smIdType ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
int ID); smIdType ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12); const SMDS_MeshNode * n12);
// tria 3 // tria 3
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID); virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3); const SMDS_MeshNode * n3);
// quad 4 // quad 4
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID); virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4); const SMDS_MeshNode * n4);
// 2d order triangle of 6 nodes // 2d order triangle of 6 nodes
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
int n12,int n23,int n31, int ID); smIdType n12,smIdType n23,smIdType n31, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31, const SMDS_MeshNode * n31,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -143,8 +143,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n31); const SMDS_MeshNode * n31);
// biquadratic triangle of 7 nodes // biquadratic triangle of 7 nodes
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
int n12,int n23,int n31, int nCenter, int ID); smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -152,7 +152,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31, const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -162,8 +162,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * nCenter); const SMDS_MeshNode * nCenter);
// 2d order quadrangle // 2d order quadrangle
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n34,int n41, int ID); smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -172,7 +172,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n23, const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -183,8 +183,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n41); const SMDS_MeshNode * n41);
// biquadratic quadrangle of 9 nodes // biquadratic quadrangle of 9 nodes
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n34,int n41, int nCenter, int ID); smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -194,7 +194,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID); smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -205,38 +205,38 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n41, const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter); const SMDS_MeshNode * nCenter);
// tetra 4 // tetra 4
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID); virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4); const SMDS_MeshNode * n4);
// pyra 5 // pyra 5
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int ID); virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5); const SMDS_MeshNode * n5);
// penta 6 // penta 6
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int ID); virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4, const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6, const SMDS_MeshNode * n6,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -244,7 +244,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n5, const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6); const SMDS_MeshNode * n6);
// hexa 8 // hexa 8
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int ID); virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -253,7 +253,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n6, const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7, const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8, const SMDS_MeshNode * n8,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -263,8 +263,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n7, const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8); const SMDS_MeshNode * n8);
// hexagonal prism of 12 nodes // hexagonal prism of 12 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6,
int n7, int n8, int n9, int n10, int n11, int n12, int ID); smIdType n7, smIdType n8, smIdType n9, smIdType n10, smIdType n11, smIdType n12, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -277,7 +277,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n10, const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11, const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12, const SMDS_MeshNode * n12,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -292,9 +292,9 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n12); const SMDS_MeshNode * n12);
// 2d order tetrahedron of 10 nodes // 2d order tetrahedron of 10 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n14,int n24,int n34, int ID); smIdType n14,smIdType n24,smIdType n34, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -305,7 +305,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n14, const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24, const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34, const SMDS_MeshNode * n34,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -318,10 +318,10 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n34); const SMDS_MeshNode * n34);
// 2d order pyramid of 13 nodes // 2d order pyramid of 13 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n15,int n25,int n35,int n45, smIdType n15,smIdType n25,smIdType n35,smIdType n45,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -335,7 +335,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n25, const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35, const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45, const SMDS_MeshNode * n45,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -351,12 +351,12 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n45); const SMDS_MeshNode * n45);
// 2d order Pentahedron with 15 nodes // 2d order Pentahedron with 15 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n45,int n56,int n64, smIdType n45,smIdType n56,smIdType n64,
int n14,int n25,int n36, smIdType n14,smIdType n25,smIdType n36,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -372,7 +372,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n14, const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25, const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36, const SMDS_MeshNode * n36,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -390,13 +390,13 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n36); const SMDS_MeshNode * n36);
// 2d order Pentahedron with 18 nodes // 2d order Pentahedron with 18 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12,int n23,int n31, smIdType n12,smIdType n23,smIdType n31,
int n45,int n56,int n64, smIdType n45,smIdType n56,smIdType n64,
int n14,int n25,int n36, smIdType n14,smIdType n25,smIdType n36,
int n1245, int n2356, int n1346, smIdType n1245, smIdType n2356, smIdType n1346,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -415,7 +415,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n1245, const SMDS_MeshNode * n1245,
const SMDS_MeshNode * n2356, const SMDS_MeshNode * n2356,
const SMDS_MeshNode * n1346, const SMDS_MeshNode * n1346,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -436,12 +436,12 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n1346); const SMDS_MeshNode * n1346);
// 2d order Hexahedrons with 20 nodes // 2d order Hexahedrons with 20 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n56,int n67,int n78,int n85, smIdType n56,smIdType n67,smIdType n78,smIdType n85,
int n15,int n26,int n37,int n48, smIdType n15,smIdType n26,smIdType n37,smIdType n48,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -462,7 +462,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n26, const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37, const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48, const SMDS_MeshNode * n48,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -485,14 +485,14 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n48); const SMDS_MeshNode * n48);
// 2d order Hexahedrons with 27 nodes // 2d order Hexahedrons with 27 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12,int n23,int n34,int n41, smIdType n12,smIdType n23,smIdType n34,smIdType n41,
int n56,int n67,int n78,int n85, smIdType n56,smIdType n67,smIdType n78,smIdType n85,
int n15,int n26,int n37,int n48, smIdType n15,smIdType n26,smIdType n37,smIdType n48,
int n1234,int n1256,int n2367,int n3478, smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
int n1458,int n5678,int nCenter, smIdType n1458,smIdType n5678,smIdType nCenter,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -520,7 +520,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n1458, const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678, const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter, const SMDS_MeshNode * nCenter,
int ID); smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2, const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3, const SMDS_MeshNode * n3,
@ -549,31 +549,31 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
const SMDS_MeshNode * n5678, const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter); const SMDS_MeshNode * nCenter);
virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<int>& nodes_ids, virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<smIdType>& nodes_ids,
const int ID); const smIdType ID);
virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes, virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes,
const int ID); const smIdType ID);
virtual SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes); virtual SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes);
virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<int> & nodes_ids, virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<smIdType> & nodes_ids,
const int ID); const smIdType ID);
virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<const SMDS_MeshNode*> & nodes, virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<const SMDS_MeshNode*> & nodes,
const int ID); const smIdType ID);
virtual SMDS_MeshFace* AddQuadPolygonalFace(const std::vector<const SMDS_MeshNode*> & nodes); virtual SMDS_MeshFace* AddQuadPolygonalFace(const std::vector<const SMDS_MeshNode*> & nodes);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<int>& nodes_ids, (const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities, const std::vector<int>& quantities,
const int ID); const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*>& nodes, (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities, const std::vector<int>& quantities,
const int ID); const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolume virtual SMDS_MeshVolume* AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*>& nodes, (const std::vector<const SMDS_MeshNode*>& nodes,
@ -600,8 +600,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
bool ChangePolyhedronNodes(const SMDS_MeshElement * elem, bool ChangePolyhedronNodes(const SMDS_MeshElement * elem,
const std::vector<const SMDS_MeshNode*>& nodes, const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities); const std::vector<int>& quantities);
bool ModifyCellNodes(int smdsVolId, std::map<int,int> localClonedNodeIds); bool ModifyCellNodes(vtkIdType smdsVolId, std::map<int,int> localClonedNodeIds);
void Renumber (const bool isNodes, const int startID=1, const int deltaID=1); void Renumber (const bool isNodes, const smIdType startID=1, const smIdType deltaID=1);
void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Shell & S); void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Shell & S);
void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Solid & S); void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Solid & S);
@ -641,7 +641,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh
// Groups. SMESHDS_Mesh is not an owner of groups // Groups. SMESHDS_Mesh is not an owner of groups
void AddGroup (SMESHDS_GroupBase* theGroup) { myGroups.insert(theGroup); } void AddGroup (SMESHDS_GroupBase* theGroup) { myGroups.insert(theGroup); }
void RemoveGroup (SMESHDS_GroupBase* theGroup) { myGroups.erase(theGroup); } void RemoveGroup (SMESHDS_GroupBase* theGroup) { myGroups.erase(theGroup); }
int GetNbGroups() const { return myGroups.size(); } size_t GetNbGroups() const { return myGroups.size(); }
const std::set<SMESHDS_GroupBase*>& GetGroups() const { return myGroups; } const std::set<SMESHDS_GroupBase*>& GetGroups() const { return myGroups; }
bool IsGroupOfSubShapes (const TopoDS_Shape& aSubShape) const; bool IsGroupOfSubShapes (const TopoDS_Shape& aSubShape) const;

View File

@ -89,7 +89,7 @@ SMESHDS_Command* SMESHDS_Script::getCommand(const SMESHDS_CommandType aType)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddNode(int NewNodeID, double x, double y, double z) void SMESHDS_Script::AddNode(smIdType NewNodeID, double x, double y, double z)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -102,7 +102,7 @@ void SMESHDS_Script::AddNode(int NewNodeID, double x, double y, double z)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::Add0DElement (int New0DElementID, int idnode) void SMESHDS_Script::Add0DElement (smIdType New0DElementID, smIdType idnode)
{ {
if (myIsEmbeddedMode) { if (myIsEmbeddedMode) {
myIsModified = true; myIsModified = true;
@ -115,7 +115,7 @@ void SMESHDS_Script::Add0DElement (int New0DElementID, int idnode)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddEdge(int NewEdgeID, int idnode1, int idnode2) void SMESHDS_Script::AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -128,8 +128,8 @@ void SMESHDS_Script::AddEdge(int NewEdgeID, int idnode1, int idnode2)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddFace(int NewFaceID, void SMESHDS_Script::AddFace(smIdType NewFaceID,
int idnode1, int idnode2, int idnode3) smIdType idnode1, smIdType idnode2, smIdType idnode3)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -143,9 +143,9 @@ void SMESHDS_Script::AddFace(int NewFaceID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddFace(int NewFaceID, void SMESHDS_Script::AddFace(smIdType NewFaceID,
int idnode1, int idnode2, smIdType idnode1, smIdType idnode2,
int idnode3, int idnode4) smIdType idnode3, smIdType idnode4)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -160,9 +160,9 @@ void SMESHDS_Script::AddFace(int NewFaceID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewID, void SMESHDS_Script::AddVolume(smIdType NewID,
int idnode1, int idnode2, smIdType idnode1, smIdType idnode2,
int idnode3, int idnode4) smIdType idnode3, smIdType idnode4)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -177,9 +177,9 @@ void SMESHDS_Script::AddVolume(int NewID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewID, void SMESHDS_Script::AddVolume(smIdType NewID,
int idnode1, int idnode2, smIdType idnode1, smIdType idnode2,
int idnode3, int idnode4, int idnode5) smIdType idnode3, smIdType idnode4, smIdType idnode5)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -194,9 +194,9 @@ void SMESHDS_Script::AddVolume(int NewID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewID, void SMESHDS_Script::AddVolume(smIdType NewID,
int idnode1, int idnode2, int idnode3, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5, int idnode6) smIdType idnode4, smIdType idnode5, smIdType idnode6)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -211,9 +211,9 @@ void SMESHDS_Script::AddVolume(int NewID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewID, void SMESHDS_Script::AddVolume(smIdType NewID,
int idnode1, int idnode2, int idnode3, int idnode4, smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4,
int idnode5, int idnode6, int idnode7, int idnode8) smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -228,9 +228,9 @@ void SMESHDS_Script::AddVolume(int NewID,
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
int idnode9, int idnode10, int idnode11, int idnode12) smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -246,7 +246,7 @@ void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnod
//function : AddPolygonalFace //function : AddPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector<int>& nodes_ids) void SMESHDS_Script::AddPolygonalFace (smIdType NewFaceID, const std::vector<smIdType>& nodes_ids)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -259,7 +259,7 @@ void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector<int>& no
//function : AddQuadPolygonalFace //function : AddQuadPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddQuadPolygonalFace(int NewFaceID, const std::vector<int>& nodes_ids) void SMESHDS_Script::AddQuadPolygonalFace(smIdType NewFaceID, const std::vector<smIdType>& nodes_ids)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -272,9 +272,9 @@ void SMESHDS_Script::AddQuadPolygonalFace(int NewFaceID, const std::vector<int>&
//function : AddPolyhedralVolume //function : AddPolyhedralVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddPolyhedralVolume (int NewID, void SMESHDS_Script::AddPolyhedralVolume (smIdType NewID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities) const std::vector<int>& quantities)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -289,7 +289,7 @@ void SMESHDS_Script::AddPolyhedralVolume (int NewID,
//purpose : Record adding a Ball //purpose : Record adding a Ball
//======================================================================= //=======================================================================
void SMESHDS_Script::AddBall(int NewBallID, int node, double diameter) void SMESHDS_Script::AddBall(smIdType NewBallID, smIdType node, double diameter)
{ {
if ( myIsEmbeddedMode ) if ( myIsEmbeddedMode )
myIsModified = true; myIsModified = true;
@ -301,7 +301,7 @@ void SMESHDS_Script::AddBall(int NewBallID, int node, double diameter)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::MoveNode(int NewNodeID, double x, double y, double z) void SMESHDS_Script::MoveNode(smIdType NewNodeID, double x, double y, double z)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -314,7 +314,7 @@ void SMESHDS_Script::MoveNode(int NewNodeID, double x, double y, double z)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::RemoveNode(int ID) void SMESHDS_Script::RemoveNode(smIdType ID)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -327,7 +327,7 @@ void SMESHDS_Script::RemoveNode(int ID)
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::RemoveElement(int ElementID) void SMESHDS_Script::RemoveElement(smIdType ElementID)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -341,7 +341,7 @@ void SMESHDS_Script::RemoveElement(int ElementID)
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::ChangeElementNodes(int ElementID, int nodes[], int nbnodes) void SMESHDS_Script::ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -354,8 +354,8 @@ void SMESHDS_Script::ChangeElementNodes(int ElementID, int nodes[], int nbnodes)
//function : ChangePolyhedronNodes //function : ChangePolyhedronNodes
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID, void SMESHDS_Script::ChangePolyhedronNodes (const smIdType ElementID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities) const std::vector<int>& quantities)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
@ -370,7 +370,7 @@ void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID,
//function : Renumber //function : Renumber
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::Renumber (const bool isNodes, const int startID, const int deltaID) void SMESHDS_Script::Renumber (const bool isNodes, const smIdType startID, const smIdType deltaID)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -424,7 +424,7 @@ const list<SMESHDS_Command*>& SMESHDS_Script::GetCommands()
//function : AddEdge //function : AddEdge
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddEdge(int NewEdgeID, int n1, int n2, int n12) void SMESHDS_Script::AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -437,8 +437,8 @@ void SMESHDS_Script::AddEdge(int NewEdgeID, int n1, int n2, int n12)
//function : AddFace //function : AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
int n12, int n23, int n31) smIdType n12, smIdType n23, smIdType n31)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -452,8 +452,8 @@ void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3,
//function : AddFace //function : AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
int n12, int n23, int n31, int nCenter) smIdType n12, smIdType n23, smIdType n31, smIdType nCenter)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -467,8 +467,8 @@ void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3,
//function : AddFace //function : AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4, void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n34, int n41) smIdType n12, smIdType n23, smIdType n34, smIdType n41)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -482,8 +482,8 @@ void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
//function : AddFace //function : AddFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4, void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n34, int n41, int nCenter) smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -497,9 +497,9 @@ void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n31, smIdType n12, smIdType n23, smIdType n31,
int n14, int n24, int n34) smIdType n14, smIdType n24, smIdType n34)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -514,9 +514,9 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n12, int n23, int n34, int n41, smIdType n5, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n15, int n25, int n35, int n45) smIdType n15, smIdType n25, smIdType n35, smIdType n45)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -531,10 +531,10 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5,int n6, int n12, int n23, int n31, smIdType n5,smIdType n6, smIdType n12, smIdType n23, smIdType n31,
int n45, int n56, int n64, smIdType n45, smIdType n56, smIdType n64,
int n14, int n25, int n36) smIdType n14, smIdType n25, smIdType n36)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -550,11 +550,11 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5,int n6, int n12, int n23, int n31, smIdType n5,smIdType n6, smIdType n12, smIdType n23, smIdType n31,
int n45, int n56, int n64, smIdType n45, smIdType n56, smIdType n64,
int n14, int n25, int n36, smIdType n14, smIdType n25, smIdType n36,
int n1245, int n2356, int n1346) smIdType n1245, smIdType n2356, smIdType n1346)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -571,11 +571,11 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, int n7, int n8, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n56, int n67, int n78, int n85, smIdType n56, smIdType n67, smIdType n78, smIdType n85,
int n15, int n26, int n37, int n48) smIdType n15, smIdType n26, smIdType n37, smIdType n48)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -592,13 +592,13 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3,
//function : AddVolume //function : AddVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, int n7, int n8, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n56, int n67, int n78, int n85, smIdType n56, smIdType n67, smIdType n78, smIdType n85,
int n15, int n26, int n37, int n48, smIdType n15, smIdType n26, smIdType n37, smIdType n48,
int n1234,int n1256,int n2367,int n3478, smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
int n1458,int n5678,int nCenter) smIdType n1458,smIdType n5678,smIdType nCenter)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;

View File

@ -31,6 +31,8 @@
#include "SMESHDS_Command.hxx" #include "SMESHDS_Command.hxx"
#include <smIdType.hxx>
#include <list> #include <list>
#include <vector> #include <vector>
@ -44,79 +46,79 @@ class SMESHDS_EXPORT SMESHDS_Script
void SetModified(bool theModified); void SetModified(bool theModified);
bool IsModified(); bool IsModified();
void AddNode(int NewNodeID, double x, double y, double z); void AddNode(smIdType NewNodeID, double x, double y, double z);
void Add0DElement(int New0DElementID, int idnode); void Add0DElement(smIdType New0DElementID, smIdType idnode);
void AddEdge(int NewEdgeID, int idnode1, int idnode2); void AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2);
void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3); void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3);
void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3, void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4); smIdType idnode4);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4); smIdType idnode4);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5); smIdType idnode4, smIdType idnode5);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5, int idnode6); smIdType idnode4, smIdType idnode5, smIdType idnode6);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8); smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8);
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
int idnode9, int idnode10, int idnode11, int idnode12); smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12);
void AddPolygonalFace (const int NewFaceID, void AddPolygonalFace (const smIdType NewFaceID,
const std::vector<int>& nodes_ids); const std::vector<smIdType>& nodes_ids);
void AddQuadPolygonalFace (const int NewFaceID, void AddQuadPolygonalFace (const smIdType NewFaceID,
const std::vector<int>& nodes_ids); const std::vector<smIdType>& nodes_ids);
void AddPolyhedralVolume (const int NewVolID, void AddPolyhedralVolume (const smIdType NewVolID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities); const std::vector<int>& quantities);
void AddBall(int NewBallID, int node, double diameter); void AddBall(smIdType NewBallID, smIdType node, double diameter);
// special methods for quadratic elements // special methods for quadratic elements
void AddEdge(int NewEdgeID, int n1, int n2, int n12); void AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12);
void AddFace(int NewFaceID, int n1, int n2, int n3, void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
int n12, int n23, int n31); smIdType n12, smIdType n23, smIdType n31);
void AddFace(int NewFaceID, int n1, int n2, int n3, void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
int n12, int n23, int n31, int nCenter); smIdType n12, smIdType n23, smIdType n31, smIdType nCenter);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n34, int n41); smIdType n12, smIdType n23, smIdType n34, smIdType n41);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n34, int n41, int nCenter); smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n12, int n23, int n31, int n14, int n24, int n34); smIdType n12, smIdType n23, smIdType n31, smIdType n14, smIdType n24, smIdType n34);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n15, int n25, int n35, int n45); smIdType n15, smIdType n25, smIdType n35, smIdType n45);
void AddVolume(int NewVolID, int n1, int n2, int n3, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12, int n23, int n31, smIdType n12, smIdType n23, smIdType n31,
int n45, int n56, int n64, smIdType n45, smIdType n56, smIdType n64,
int n14, int n25, int n36); smIdType n14, smIdType n25, smIdType n36);
void AddVolume(int NewVolID, int n1, int n2, int n3, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
int n4, int n5, int n6, smIdType n4, smIdType n5, smIdType n6,
int n12, int n23, int n31, smIdType n12, smIdType n23, smIdType n31,
int n45, int n56, int n64, smIdType n45, smIdType n56, smIdType n64,
int n14, int n25, int n36, smIdType n14, smIdType n25, smIdType n36,
int n1245, int n2356, int n1346); smIdType n1245, smIdType n2356, smIdType n1346);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n56, int n67, int n78, int n85, smIdType n56, smIdType n67, smIdType n78, smIdType n85,
int n15, int n26, int n37, int n48); smIdType n15, smIdType n26, smIdType n37, smIdType n48);
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
int n5, int n6, int n7, int n8, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
int n12, int n23, int n34, int n41, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
int n56, int n67, int n78, int n85, smIdType n56, smIdType n67, smIdType n78, smIdType n85,
int n15, int n26, int n37, int n48, smIdType n15, smIdType n26, smIdType n37, smIdType n48,
int n1234,int n1256,int n2367,int n3478, smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
int n1458,int n5678,int nCenter); smIdType n1458,smIdType n5678,smIdType nCenter);
void MoveNode(int NewNodeID, double x, double y, double z); void MoveNode(smIdType NewNodeID, double x, double y, double z);
void RemoveNode(int NodeID); void RemoveNode(smIdType NodeID);
void RemoveElement(int ElementID); void RemoveElement(smIdType ElementID);
void ChangeElementNodes(int ElementID, int nodes[], int nbnodes); void ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes);
void ChangePolyhedronNodes(const int ElementID, void ChangePolyhedronNodes(const smIdType ElementID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities); const std::vector<int>& quantities);
void Renumber (const bool isNodes, const int startID, const int deltaID); void Renumber (const bool isNodes, const smIdType startID, const smIdType deltaID);
void ClearMesh(); void ClearMesh();
void Clear(); void Clear();
const std::list<SMESHDS_Command*> & GetCommands(); const std::list<SMESHDS_Command*> & GetCommands();

View File

@ -235,12 +235,12 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N)
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMESHDS_SubMesh::NbElements() const smIdType SMESHDS_SubMesh::NbElements() const
{ {
if ( !IsComplexSubmesh() ) if ( !IsComplexSubmesh() )
return myNbElements; return myNbElements;
int nbElems = 0; smIdType nbElems = 0;
TSubMeshSet::const_iterator it = mySubMeshes.begin(); TSubMeshSet::const_iterator it = mySubMeshes.begin();
for ( ; it != mySubMeshes.end(); it++ ) for ( ; it != mySubMeshes.end(); it++ )
nbElems += (*it)->NbElements(); nbElems += (*it)->NbElements();
@ -253,12 +253,12 @@ int SMESHDS_SubMesh::NbElements() const
//purpose : //purpose :
//======================================================================= //=======================================================================
int SMESHDS_SubMesh::NbNodes() const smIdType SMESHDS_SubMesh::NbNodes() const
{ {
if ( !IsComplexSubmesh() ) if ( !IsComplexSubmesh() )
return myNbNodes; return myNbNodes;
int nbElems = 0; smIdType nbElems = 0;
TSubMeshSet::const_iterator it = mySubMeshes.begin(); TSubMeshSet::const_iterator it = mySubMeshes.begin();
for ( ; it != mySubMeshes.end(); it++ ) for ( ; it != mySubMeshes.end(); it++ )
nbElems += (*it)->NbNodes(); nbElems += (*it)->NbNodes();

View File

@ -31,6 +31,7 @@
#include "SMDS_ElementHolder.hxx" #include "SMDS_ElementHolder.hxx"
#include "SMDS_Mesh.hxx" #include "SMDS_Mesh.hxx"
#include <smIdType.hxx>
#include <vector> #include <vector>
#include <boost/container/flat_set.hpp> #include <boost/container/flat_set.hpp>
@ -62,12 +63,12 @@ class SMESHDS_EXPORT SMESHDS_SubMesh : public SMDS_ElementHolder
bool RemoveSubMesh( const SMESHDS_SubMesh* theSubMesh ); bool RemoveSubMesh( const SMESHDS_SubMesh* theSubMesh );
void RemoveAllSubmeshes(); void RemoveAllSubmeshes();
bool ContainsSubMesh( const SMESHDS_SubMesh* theSubMesh ) const; bool ContainsSubMesh( const SMESHDS_SubMesh* theSubMesh ) const;
int NbSubMeshes() const { return mySubMeshes.size(); } size_t NbSubMeshes() const { return mySubMeshes.size(); }
SMESHDS_SubMeshIteratorPtr GetSubMeshIterator() const; SMESHDS_SubMeshIteratorPtr GetSubMeshIterator() const;
// for both types // for both types
virtual int NbElements() const; virtual smIdType NbElements() const;
virtual int NbNodes() const; virtual smIdType NbNodes() const;
virtual SMDS_ElemIteratorPtr GetElements() const; virtual SMDS_ElemIteratorPtr GetElements() const;
virtual SMDS_NodeIteratorPtr GetNodes() const; virtual SMDS_NodeIteratorPtr GetNodes() const;
virtual bool Contains(const SMDS_MeshElement * ME) const; // check if elem or node is in virtual bool Contains(const SMDS_MeshElement * ME) const; // check if elem or node is in
@ -89,8 +90,8 @@ class SMESHDS_EXPORT SMESHDS_SubMesh : public SMDS_ElementHolder
private: private:
int myIndex; int myIndex;
int myNbElements; smIdType myNbElements;
int myNbNodes; smIdType myNbNodes;
const SMDS_MeshElement* my1stElemNode[2]; // elem and node with least ID, to optimize iteration const SMDS_MeshElement* my1stElemNode[2]; // elem and node with least ID, to optimize iteration
const SMESHDS_Mesh * myParent; const SMESHDS_Mesh * myParent;
TSubMeshSet mySubMeshes; TSubMeshSet mySubMeshes;

View File

@ -608,7 +608,7 @@ namespace
} }
if ( ! notSupportedElemTypes.empty() ) if ( ! notSupportedElemTypes.empty() )
{ {
SMESH::long_array_var nbElems = aMeshOrGroup->GetMeshInfo(); SMESH::smIdType_array_var nbElems = aMeshOrGroup->GetMeshInfo();
for ( size_t iType = 0; iType < notSupportedElemTypes.size(); ++iType ) for ( size_t iType = 0; iType < notSupportedElemTypes.size(); ++iType )
if ( nbElems[ notSupportedElemTypes[ iType ]] > 0 ) if ( nbElems[ notSupportedElemTypes[ iType ]] > 0 )
presentNotSupported.push_back( notSupportedElemTypes[ iType ]); presentNotSupported.push_back( notSupportedElemTypes[ iType ]);
@ -994,11 +994,19 @@ namespace
aMesh->ExportGMF( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups ); aMesh->ExportGMF( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups );
} }
} }
catch (const SALOME::SALOME_Exception& S_ex){ catch (const SALOME::SALOME_Exception& S_ex)
{
wc.suspend(); wc.suspend();
SUIT_MessageBox::warning(SMESHGUI::desktop(), if ( S_ex.details.type == SALOME::COMM && // communicate about too large mesh
QObject::tr("SMESH_WRN_WARNING"), strncmp( "format=", S_ex.details.sourceFile.in(), 7 ) == 0 )
QObject::tr("SMESH_EXPORT_FAILED") + SalomeApp_Tools::ExceptionToString(S_ex));
SUIT_MessageBox::critical(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr(S_ex.details.text.in() ));
else
SUIT_MessageBox::warning(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_EXPORT_FAILED") + SalomeApp_Tools::ExceptionToString(S_ex));
wc.resume(); wc.resume();
} }
} }
@ -1218,14 +1226,14 @@ namespace
SMESH::Controls::NumericalFunctor* aNumFun = SMESH::Controls::NumericalFunctor* aNumFun =
dynamic_cast<SMESH::Controls::NumericalFunctor*>( aFunctor.get() ); dynamic_cast<SMESH::Controls::NumericalFunctor*>( aFunctor.get() );
if ( aNumFun ) { if ( aNumFun ) {
std::vector<int> elements; std::vector<SMESH::smIdType> elements;
SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIO); SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIO);
if ( mesh->_is_nil() ) { if ( mesh->_is_nil() ) {
SMESH::SMESH_IDSource_var idSource = SMESH::SMESH_IDSource_var idSource =
SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(anIO); SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(anIO);
if ( !idSource->_is_nil() ) if ( !idSource->_is_nil() )
{ {
SMESH::long_array_var ids = idSource->GetIDs(); SMESH::smIdType_array_var ids = idSource->GetIDs();
elements.resize( ids->length() ); elements.resize( ids->length() );
for ( unsigned i = 0; i < elements.size(); ++i ) for ( unsigned i = 0; i < elements.size(); ++i )
elements[i] = ids[i]; elements[i] = ids[i];
@ -1853,7 +1861,7 @@ namespace
if ( anActor->GetControlMode() != aControl ) if ( anActor->GetControlMode() != aControl )
anActor->SetControlMode( aControl ); anActor->SetControlMode( aControl );
QString functorName = functorToString( anActor->GetFunctor() ); QString functorName = functorToString( anActor->GetFunctor() );
int anEntitiesCount = anActor->GetNumberControlEntities(); smIdType anEntitiesCount = anActor->GetNumberControlEntities();
if (anEntitiesCount >= 0) if (anEntitiesCount >= 0)
functorName = functorName + ": " + QString::number(anEntitiesCount); functorName = functorName + ": " + QString::number(anEntitiesCount);
anActor->GetScalarBarActor()->SetTitle( functorName.toUtf8().constData() ); anActor->GetScalarBarActor()->SetTitle( functorName.toUtf8().constData() );
@ -2261,7 +2269,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_IDSource_ptr theMesh,
long updateLimit = resMgr->integerValue( "SMESH", "update_limit", 500000 ); long updateLimit = resMgr->integerValue( "SMESH", "update_limit", 500000 );
bool incrementalLimit = resMgr->booleanValue( "SMESH", "incremental_limit", false ); bool incrementalLimit = resMgr->booleanValue( "SMESH", "incremental_limit", false );
SMESH::long_array_var info = theMesh->GetMeshInfo(); SMESH::smIdType_array_var info = theMesh->GetMeshInfo();
long nbOdElems = info[SMDSEntity_0D]; long nbOdElems = info[SMDSEntity_0D];
long nbEdges = info[SMDSEntity_Edge] + info[SMDSEntity_Quad_Edge]; long nbEdges = info[SMDSEntity_Edge] + info[SMDSEntity_Quad_Edge];
long nbFaces = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle] + long nbFaces = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle] +
@ -3128,10 +3136,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
try { try {
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather(); SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
// get submesh elements list by types // get submesh elements list by types
SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE); SMESH::smIdType_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE); SMESH::smIdType_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE); SMESH::smIdType_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME); SMESH::smIdType_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
// create group for each type o elements // create group for each type o elements
QString aName = IObject->getName(); QString aName = IObject->getName();
QStringList anEntryList; QStringList anEntryList;
@ -3639,7 +3647,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
try { try {
SUIT_OverrideCursor wc; SUIT_OverrideCursor wc;
SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
int removed = aMeshEditor->RemoveOrphanNodes(); smIdType removed = aMeshEditor->RemoveOrphanNodes();
SUIT_MessageBox::information(SMESHGUI::desktop(), SUIT_MessageBox::information(SMESHGUI::desktop(),
tr("SMESH_INFORMATION"), tr("SMESH_INFORMATION"),
tr("NB_NODES_REMOVED").arg(removed)); tr("NB_NODES_REMOVED").arg(removed));
@ -5628,23 +5636,23 @@ void SMESHGUI::createPreferences()
int size0d = addPreference(tr("PREF_SIZE_0D"), elemGroup, int size0d = addPreference(tr("PREF_SIZE_0D"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "elem0d_size"); LightApp_Preferences::IntSpin, "SMESH", "elem0d_size");
/* int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup, /* int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size"); */ LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size"); */
double ballDiameter = addPreference(tr("PREF_BALL_DIAMETER"), elemGroup, int ballDiameter = addPreference(tr("PREF_BALL_DIAMETER"), elemGroup,
LightApp_Preferences::DblSpin, "SMESH", "ball_elem_diameter"); LightApp_Preferences::DblSpin, "SMESH", "ball_elem_diameter");
double ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup, int ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup,
LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale"); LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale");
int elemW = addPreference(tr("PREF_WIDTH"), elemGroup, int elemW = addPreference(tr("PREF_WIDTH"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "element_width"); LightApp_Preferences::IntSpin, "SMESH", "element_width");
int outW = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup, int outW = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "outline_width"); LightApp_Preferences::IntSpin, "SMESH", "outline_width");
int shrink = addPreference(tr("PREF_SHRINK_COEFF"), elemGroup, int shrink = addPreference(tr("PREF_SHRINK_COEFF"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "shrink_coeff"); LightApp_Preferences::IntSpin, "SMESH", "shrink_coeff");
setPreferenceProperty( size0d, "min", 1 ); setPreferenceProperty( size0d, "min", 1 );
setPreferenceProperty( size0d, "max", 10 ); setPreferenceProperty( size0d, "max", 10 );
// setPreferenceProperty( ballSize, "min", 1 ); // setPreferenceProperty( ballSize, "min", 1 );
// setPreferenceProperty( ballSize, "max", 10 ); // setPreferenceProperty( ballSize, "max", 10 );
setPreferenceProperty( ballDiameter, "min", 1e-7 ); setPreferenceProperty( ballDiameter, "min", 1e-7 );
setPreferenceProperty( ballDiameter, "max", 1e9 ); setPreferenceProperty( ballDiameter, "max", 1e9 );
@ -5822,8 +5830,8 @@ void SMESHGUI::createPreferences()
void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
{ {
if ( sect=="SMESH" ) { if ( sect=="SMESH" ) {
float sbX1 = 0.01, sbY1 = 0.01, sbW = 0.08, sbH = 0.08; double sbX1 = 0.01, sbY1 = 0.01, sbW = 0.08, sbH = 0.08;
float aTol = 1.00000009999999; double aTol = 1.00000009999999;
std::string aWarning; std::string aWarning;
SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this); SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);

View File

@ -40,6 +40,7 @@
#include <SUIT_MessageBox.h> #include <SUIT_MessageBox.h>
#include <SVTK_Selector.h> #include <SVTK_Selector.h>
#include <SalomeApp_Tools.h> #include <SalomeApp_Tools.h>
#include <smIdType.hxx>
// Qt includes // Qt includes
#include <QButtonGroup> #include <QButtonGroup>
@ -426,7 +427,7 @@ bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply()
SUIT_MessageBox::warning( myDlg, tr( "SMESH_WRN_WARNING" ), tr( "SMESH_BAD_SELECTION" ) ); SUIT_MessageBox::warning( myDlg, tr( "SMESH_WRN_WARNING" ), tr( "SMESH_BAD_SELECTION" ) );
return false; return false;
} }
SMESH::long_array_var idArray = new SMESH::long_array; SMESH::smIdType_array_var idArray = new SMESH::smIdType_array;
idArray->length( idList.count() ); idArray->length( idList.count() );
QStringList::iterator idIt = idList.begin(); QStringList::iterator idIt = idList.begin();
for ( int i = 0; idIt != idList.end(); ++idIt, ++i ) for ( int i = 0; idIt != idList.end(); ++idIt, ++i )
@ -438,14 +439,14 @@ bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply()
// Create 0D elements // Create 0D elements
int prevNb0D = mesh->Nb0DElements(); smIdType prevNb0D = mesh->Nb0DElements();
QString groupName = myDlg->myGroupListCmBox->currentText(); QString groupName = myDlg->myGroupListCmBox->currentText();
SMESH::SMESH_IDSource_var newObj = SMESH::SMESH_IDSource_var newObj =
editor->Create0DElementsOnAllNodes( meshObject, groupName.toUtf8().data(), editor->Create0DElementsOnAllNodes( meshObject, groupName.toUtf8().data(),
myDlg->myDuplicateElemsChkBox->isChecked() ); myDlg->myDuplicateElemsChkBox->isChecked() );
int newNb0D = mesh->Nb0DElements() - prevNb0D; smIdType newNb0D = mesh->Nb0DElements() - prevNb0D;
SUIT_MessageBox::information( myDlg, tr( "SMESH_INFORMATION" ), SUIT_MessageBox::information( myDlg, tr( "SMESH_INFORMATION" ),
tr( "NB_NEW_0D" ).arg( newNb0D ), tr( "NB_NEW_0D" ).arg( newNb0D ),
SUIT_MessageBox::Ok, SUIT_MessageBox::Ok); SUIT_MessageBox::Ok, SUIT_MessageBox::Ok);

View File

@ -553,7 +553,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
if (myNbOkNodes && !SMESHGUI::isStudyLocked()) { if (myNbOkNodes && !SMESHGUI::isStudyLocked()) {
myBusy = true; myBusy = true;
QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts); QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anArrayOfIndices = new SMESH::long_array; SMESH::smIdType_array_var anArrayOfIndices = new SMESH::smIdType_array;
anArrayOfIndices->length(aListId.count()); anArrayOfIndices->length(aListId.count());
const std::vector<int>& revIndex = SMDS_MeshCell::reverseSmdsOrder( myGeomType ); const std::vector<int>& revIndex = SMDS_MeshCell::reverseSmdsOrder( myGeomType );
if ( ReverseOrDulicate && ReverseOrDulicate->isChecked() && (int)revIndex.size() == aListId.count() ) if ( ReverseOrDulicate && ReverseOrDulicate->isChecked() && (int)revIndex.size() == aListId.count() )
@ -598,10 +598,10 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
} }
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
SMESH::long_array_var anIdList = new SMESH::long_array; SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array;
anIdList->length( 1 ); anIdList->length( 1 );
anIdList[0] = -1; anIdList[0] = -1;
int nbElemsBefore = 0; smIdType nbElemsBefore = 0;
switch (myElementType) { switch (myElementType) {
case SMDSAbs_0DElement: { case SMDSAbs_0DElement: {
@ -611,7 +611,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
for ( size_t i = 0; i < anArrayOfIndices->length(); ++i ) for ( size_t i = 0; i < anArrayOfIndices->length(); ++i )
anIdList[i] = aMeshEditor->Add0DElement(anArrayOfIndices[i], duplicateElements); anIdList[i] = aMeshEditor->Add0DElement(anArrayOfIndices[i], duplicateElements);
CORBA::ULong nbAdded = myMesh->Nb0DElements() - nbElemsBefore; SMESH::smIdType nbAdded = myMesh->Nb0DElements() - nbElemsBefore;
if ( !duplicateElements && nbAdded < anArrayOfIndices->length() ) if ( !duplicateElements && nbAdded < anArrayOfIndices->length() )
SUIT_MessageBox::information(SMESHGUI::desktop(), SUIT_MessageBox::information(SMESHGUI::desktop(),
tr("SMESH_INFORMATION"), tr("SMESH_INFORMATION"),
@ -784,7 +784,7 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
aMesh = myActor->GetObject()->GetMesh(); aMesh = myActor->GetObject()->GetMesh();
if (aMesh) { if (aMesh) {
TColStd_MapOfInteger newIndices; SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool allOk = true; bool allOk = true;

View File

@ -741,7 +741,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false ); ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false );
int aNumberOfIds = anIds.size(); int aNumberOfIds = anIds.size();
SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array; SMESH::smIdType_array_var anArrayOfIdeces = new SMESH::smIdType_array;
anArrayOfIdeces->length( aNumberOfIds ); anArrayOfIdeces->length( aNumberOfIds );
for (int i = 0; i < aNumberOfIds; i++) for (int i = 0; i < aNumberOfIds; i++)
@ -841,7 +841,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
} }
if ( !aGroupUsed->_is_nil() ) { if ( !aGroupUsed->_is_nil() ) {
SMESH::long_array_var anIdList = new SMESH::long_array; SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array;
anIdList->length( 1 ); anIdList->length( 1 );
anIdList[0] = anElemId; anIdList[0] = anElemId;
aGroupUsed->Add( anIdList.inout() ); aGroupUsed->Add( anIdList.inout() );
@ -989,7 +989,7 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText)
myCurrentLineEdit = send; myCurrentLineEdit = send;
if (aMesh) { if (aMesh) {
TColStd_MapOfInteger newIndices; SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool allOk = true; bool allOk = true;

Some files were not shown because too many files have changed in this diff Show More