OPTION(SALOME_SMESH_USE_CGNS "Enable import/export to CGNS format" OFF)
OPTION(SALOME_SMESH_USE_TBB "Enable parallel computation" OFF)
OPTION(SALOME_SMESH_DYNLOAD_LOCAL "Load plug-ins' symbols locally (Linux only)" ON)
+OPTION(SALOME_USE_64BIT_IDS "Size of IDs to refer cells and nodes. 32 bits when OFF (default), 64 bits when ON." ON)
OPTION(SMESH_USE_MESHGEMS_HYPOSET "Prefer MeshGems algorithms in sets of hypotheses" OFF)
CMAKE_DEPENDENT_OPTION(SALOME_SMESH_BUILD_FRENCH_DOC "Generate SALOME SMESH French documentation" OFF
"SALOME_BUILD_DOC" OFF)
ADD_DEFINITIONS(-DDYNLOAD_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)
SET(SMESH_USE_MESHGEMS_HYPOSET_VAR "true")
ELSE(SMESH_USE_MESHGEMS_HYPOSET)
SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
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:
IF(NOT (TARGET GEOMbasic))
${PROJECT_BINARY_DIR}/idl
)
+SALOME_CONFIGURE_FILE(SMESH_smIdType.idl.in SMESH_smIdType.idl)
+
SET(SalomeIDLSMESH_IDLSOURCES
SMESH_Gen.idl
SMESH_Mesh.idl
SMESH_Pattern.idl
SMESH_MeshEditor.idl
SMESH_Measurements.idl
+ ${CMAKE_CURRENT_BINARY_DIR}/SMESH_smIdType.idl
)
SET(_idl_include_dirs
${KERNEL_ROOT_DIR}/idl/salome
${GEOM_ROOT_DIR}/idl/salome
+ ${PROJECT_BINARY_DIR}/idl
)
SET(_idl_link_flags
/*!
* 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);
- 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);
/*!
* Sets <number of segments> parameter value
*/
- void SetNumberOfSegments(in long segmentsNumber)
+ void SetNumberOfSegments(in SMESH::smIdType segmentsNumber)
raises (SALOME::SALOME_Exception);
/*!
* Returns <number of segments> parameter value
*/
- long GetNumberOfSegments();
+ long GetNumberOfSegments();
/*!
* Sets <distribution type> parameter value
*/
- void SetDistrType(in long typ)
+ void SetDistrType(in long typ)
raises (SALOME::SALOME_Exception);
/*!
* Returns <distribution type> parameter value
*/
- long GetDistrType();
+ long GetDistrType();
/*!
* Sets <scale factor> parameter value
/*!
* Sets <conversion mode> parameter value for functional distributions
*/
- void SetConversionMode(in long conv )
+ void SetConversionMode(in long conv )
raises (SALOME::SALOME_Exception);
/*!
* Returns <conversion mode> parameter value for functional distributions
*/
- long ConversionMode()
+ long ConversionMode()
raises (SALOME::SALOME_Exception);
};
/*!
* Sets <mode> parameter value
*/
- void SetMode(in long mode)
+ void SetMode(in long mode)
raises (SALOME::SALOME_Exception);
/*!
* Returns <mode> parameter value
*/
- long GetMode();
+ long GetMode();
};
/*!
*/
void SetPoints(in SMESH::double_array listParams)
raises (SALOME::SALOME_Exception);
- void SetNbSegments(in SMESH::long_array listNbSeg)
+ void SetNbSegments(in SMESH::smIdType_array listNbSeg)
raises (SALOME::SALOME_Exception);
/*!
/*!
* Returns list of numbers of segments
*/
- SMESH::long_array GetNbSegments();
+ SMESH::smIdType_array GetNbSegments();
};
/*!
* Sets <number of segments> parameter value
*/
- void SetNumberOfLayers(in long numberOfLayers)
+ void SetNumberOfLayers(in long numberOfLayers)
raises (SALOME::SALOME_Exception);
/*!
* Returns <number of layers> parameter value
*/
- long GetNumberOfLayers();
+ long GetNumberOfLayers();
};
* Result may be nil if association not set.
* Valid indices are 1 and 2
*/
- GEOM::GEOM_Object GetSourceVertex(in long i)
+ GEOM::GEOM_Object GetSourceVertex(in long i)
raises (SALOME::SALOME_Exception);
/*!
* Result may be nil if association not set.
* Valid indices are 1 and 2
*/
- GEOM::GEOM_Object GetTargetVertex(in long i)
+ GEOM::GEOM_Object GetTargetVertex(in long i)
raises (SALOME::SALOME_Exception);
};
* Result may be nil if association not set.
* Valid indices are 1 and 2
*/
- GEOM::GEOM_Object GetSourceVertex(in long i)
+ GEOM::GEOM_Object GetSourceVertex(in long i)
raises (SALOME::SALOME_Exception);
/*!
* Result may be nil if association not set.
* Valid indices are 1 and 2
*/
- GEOM::GEOM_Object GetTargetVertex(in long i)
+ GEOM::GEOM_Object GetTargetVertex(in long i)
raises (SALOME::SALOME_Exception);
};
/*!
* Set base vertex for triangles
*/
- void SetTriaVertex( in long vertID );
+ void SetTriaVertex( in long vertID );
/*!
* Returns base vertex for triangles
*/
- long GetTriaVertex();
+ long GetTriaVertex();
/*!
* Set entry of the main object
#include "SALOME_GenericObj.idl"
#include "GEOM_Gen.idl"
#include "SMESH_Mesh.idl"
+#include "SMESH_smIdType.idl"
module SMESH
{
*/
interface NumericalFunctor: Functor
{
- double GetValue ( in long theElementId );
- boolean IsApplicable( in long theElementId );
+ double GetValue ( in smIdType theElementId );
+ boolean IsApplicable( in smIdType theElementId );
Histogram GetHistogram ( in short nbIntervals, in boolean isLogarithmic );
Histogram GetLocalHistogram( in short nbIntervals, in boolean isLogarithmic,
*/
interface RangeOfIds: Predicate
{
- void SetRange( in long_array theIds );
+ void SetRange( in smIdType_array theIds );
boolean SetRangeStr( in string theRange );
string GetRangeStr();
void SetElementType( in ElementType type );
void SetPoint ( in double x, in double y, in double z );
void SetVertex ( in GEOM::GEOM_Object vertex );
- void SetNode ( in long nodeID );
+ void SetNode ( in smIdType nodeID );
string GetThreshold ( out ThresholdType type );
void SetThreshold ( in string threshold, in ThresholdType type )
raises (SALOME::SALOME_Exception);
typedef sequence<Criterion> Criteria;
- void SetPredicate( in Predicate thePredicate );
- void SetMesh( in SMESH_Mesh theMesh );
+ void SetPredicate( in Predicate thePredicate );
+ void SetMesh( in SMESH_Mesh theMesh );
- long_array GetElementsId( in SMESH_Mesh theMesh );
- long_array GetElementsIdFromParts( in ListOfIDSources theParts );
- ElementType GetElementType();
- Predicate GetPredicate();
+ smIdType_array GetElementsId( in SMESH_Mesh theMesh );
+ smIdType_array GetElementsIdFromParts( in ListOfIDSources theParts );
+ ElementType GetElementType();
+ Predicate GetPredicate();
- boolean GetCriteria( out Criteria theCriteria );
- boolean SetCriteria( in Criteria theCriteria );
+ boolean GetCriteria( out Criteria theCriteria );
+ boolean SetCriteria( in Criteria theCriteria );
};
#include "SMESH_Mesh.idl"
#include "SMESH_Hypothesis.idl"
+#include "SMESH_smIdType.idl"
module SMESH
{
/*!
* Evaluates size of prospective mesh on a shape
*/
- long_array Evaluate(in SMESH_Mesh theMesh,
- in GEOM::GEOM_Object theSubObject)
+ smIdType_array Evaluate(in SMESH_Mesh theMesh,
+ in GEOM::GEOM_Object theSubObject)
raises ( SALOME::SALOME_Exception );
/*!
* The returned geometrical object, if not nil, is either found in the
* study or is published by this method with the given name
*/
- GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh,
- in long theElementID,
- in string theGeomName)
+ GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh,
+ in smIdType theElementID,
+ in string theGeomName)
raises ( SALOME::SALOME_Exception );
/*!
* Return geometrical object the given element is built on.
* The returned geometrical object not published in study by this method.
*/
- GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh,
- in long theElementID)
+ GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh,
+ in smIdType theElementID)
raises ( SALOME::SALOME_Exception );
/*!
#include "SALOMEDS_Attributes.idl"
#include "SMESH_Mesh.idl"
+#include "SMESH_smIdType.idl"
module SMESH
{
/*!
* 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 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
*/
- long GetID( in long elem_index );
+ smIdType GetID( in smIdType elem_index );
/*!
* 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
* 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
* 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
/*!
* 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
*/
- long AddByPredicate( in Predicate thePredicate );
+ smIdType AddByPredicate( in Predicate thePredicate );
/*!
* 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
*/
- 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
*/
- long RemoveByPredicate( in Predicate thePredicate );
+ smIdType RemoveByPredicate( in Predicate thePredicate );
};
/*!
* Get the internal Id
*/
- long GetId();
+ short GetId();
/*!
* Set the variable parameter
#include "SALOME_GenericObj.idl"
#include "SMESH_Mesh.idl"
+#include "SMESH_smIdType.idl"
module SMESH
{
struct Measure {
double minX, minY, minZ;
double maxX, maxY, maxZ;
- long node1, node2;
- long elem1, elem2;
+ smIdType node1, node2;
+ smIdType elem1, elem2;
double value;
};
#include "SALOME_Exception.idl"
#include "SALOME_GenericObj.idl"
#include "GEOM_Gen.idl"
+#include "SMESH_smIdType.idl"
module SMESH
{
typedef sequence<double > double_array ;
typedef sequence<long > long_array ;
+ typedef sequence<smIdType > smIdType_array ;
typedef sequence<string > string_array ;
typedef sequence<long_array> array_of_long_array ;
enum DriverMED_ReadStatus // in the order of severity
{
DRS_OK,
- DRS_EMPTY, // a file contains no mesh with the given name
- DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
- // so the numbers from the file are ignored
- DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
+ DRS_EMPTY, // a file contains no mesh with the given name
+ DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
+ // so the numbers from the file are ignored
+ DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
- DRS_FAIL // general failure (exception etc.)
+ DRS_FAIL // general failure (exception etc.)
};
/*!
*/
struct ElementSubType { ElementType SMDS_ElementType;
boolean isPoly;
- long nbNodesInElement; };
+ short nbNodesInElement; };
typedef sequence<ElementSubType> types_array;
/*!
* Returns a sequence of all element IDs
*/
- long_array GetIDs();
+ smIdType_array GetIDs();
/*!
* Returns number of mesh elements of each \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
* @return array of number of elements per \a ElementType
*/
- long_array GetNbElementsByType();
+ smIdType_array GetNbElementsByType();
/*!
* Returns types of elements it contains.
/*!
* Get information about mesh contents
*/
- long NbNodes()
+ smIdType NbNodes()
raises (SALOME::SALOME_Exception);
- long NbElements()
+ smIdType NbElements()
raises (SALOME::SALOME_Exception);
- long Nb0DElements()
+ smIdType Nb0DElements()
raises (SALOME::SALOME_Exception);
- long NbBalls()
+ smIdType NbBalls()
raises (SALOME::SALOME_Exception);
- long NbEdges()
+ smIdType NbEdges()
raises (SALOME::SALOME_Exception);
- long NbEdgesOfOrder(in ElementOrder order)
+ smIdType NbEdgesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbFaces()
+ smIdType NbFaces()
raises (SALOME::SALOME_Exception);
- long NbFacesOfOrder(in ElementOrder order)
+ smIdType NbFacesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbTriangles()
+ smIdType NbTriangles()
raises (SALOME::SALOME_Exception);
- long NbTrianglesOfOrder(in ElementOrder order)
+ smIdType NbTrianglesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbBiQuadTriangles()
+ smIdType NbBiQuadTriangles()
raises (SALOME::SALOME_Exception);
- long NbQuadrangles()
+ smIdType NbQuadrangles()
raises (SALOME::SALOME_Exception);
- long NbQuadranglesOfOrder(in ElementOrder order)
+ smIdType NbQuadranglesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbBiQuadQuadrangles()
+ smIdType NbBiQuadQuadrangles()
raises (SALOME::SALOME_Exception);
- long NbPolygons()
+ smIdType NbPolygons()
raises (SALOME::SALOME_Exception);
- long NbPolygonsOfOrder(in ElementOrder order)
+ smIdType NbPolygonsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbVolumes()
+ smIdType NbVolumes()
raises (SALOME::SALOME_Exception);
- long NbVolumesOfOrder(in ElementOrder order)
+ smIdType NbVolumesOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbTetras()
+ smIdType NbTetras()
raises (SALOME::SALOME_Exception);
- long NbTetrasOfOrder(in ElementOrder order)
+ smIdType NbTetrasOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbHexas()
+ smIdType NbHexas()
raises (SALOME::SALOME_Exception);
- long NbHexasOfOrder(in ElementOrder order)
+ smIdType NbHexasOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbTriQuadraticHexas()
+ smIdType NbTriQuadraticHexas()
raises (SALOME::SALOME_Exception);
- long NbPyramids()
+ smIdType NbPyramids()
raises (SALOME::SALOME_Exception);
- long NbPyramidsOfOrder(in ElementOrder order)
+ smIdType NbPyramidsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbPrisms()
+ smIdType NbPrisms()
raises (SALOME::SALOME_Exception);
- long NbPrismsOfOrder(in ElementOrder order)
+ smIdType NbPrismsOfOrder(in ElementOrder order)
raises (SALOME::SALOME_Exception);
- long NbHexagonalPrisms()
+ smIdType NbHexagonalPrisms()
raises (SALOME::SALOME_Exception);
- long NbPolyhedrons()
+ smIdType NbPolyhedrons()
raises (SALOME::SALOME_Exception);
- long NbSubMesh()
+ smIdType NbSubMesh()
raises (SALOME::SALOME_Exception);
- long_array GetElementsId()
+ smIdType_array GetElementsId()
raises (SALOME::SALOME_Exception);
- long_array GetElementsByType( in ElementType theType )
+ smIdType_array GetElementsByType( in ElementType theType )
raises (SALOME::SALOME_Exception);
- long_array GetNodesId()
+ smIdType_array GetNodesId()
raises (SALOME::SALOME_Exception);
/*!
* 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);
- EntityType GetElementGeomType( in long id )
+ EntityType GetElementGeomType( in smIdType id )
raises (SALOME::SALOME_Exception);
- GeometryType GetElementShape( in long id )
+ GeometryType GetElementShape( in smIdType id )
raises (SALOME::SALOME_Exception);
- long_array GetSubMeshElementsId(in long ShapeID)
+ smIdType_array GetSubMeshElementsId(in long ShapeID)
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);
ElementType GetSubMeshElementType(in long ShapeID)
* Get XYZ coordinates of node as list of double
* 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
* 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
*/
- NodePosition GetNodePosition(in long NodeID);
+ NodePosition GetNodePosition(in smIdType NodeID);
/*!
* \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 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
* ::FindShape() from SMESH_MeshEditor
* 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
* 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
*/
- long_array GetElemNodes(in long id);
+ smIdType_array GetElemNodes(in smIdType id);
/*!
* Returns ID of node by given index for given element
* If there is not element for given ID - returns -1
* 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
* 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
* 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
*/
- long ElemNbEdges(in long id);
+ long ElemNbEdges(in smIdType id);
/*!
* 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.
*/
- 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 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.
*/
- 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
*/
- boolean IsPoly(in long id);
+ boolean IsPoly(in smIdType id);
/*!
* 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
*/
- double GetBallDiameter(in long id);
+ double GetBallDiameter(in smIdType id);
/*!
* Returns XYZ coordinates of bary center for given element
* as list of double
* 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 */
MedFileInfo GetMEDFileInfo();
/*!
*
*/
- long GetNumberOfElements()
+ smIdType GetNumberOfElements()
raises (SALOME::SALOME_Exception);
/*!
*
*/
- long GetNumberOfNodes( in boolean all )
+ smIdType GetNumberOfNodes( in boolean all )
raises (SALOME::SALOME_Exception);
/*!
*
*/
- long_array GetElementsId()
+ smIdType_array GetElementsId()
raises (SALOME::SALOME_Exception);
/*!
*
*/
- long_array GetElementsByType( in ElementType theType )
+ smIdType_array GetElementsByType( in ElementType theType )
raises (SALOME::SALOME_Exception);
/*!
* 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);
/*!
*
*/
- long_array GetNodesId()
+ smIdType_array GetNodesId()
raises (SALOME::SALOME_Exception);
/*!
#include "SMESH_Mesh.idl"
#include "SMESH_Gen.idl"
+#include "SMESH_smIdType.idl"
module SMESH
{
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
};
struct FreeBorderPart
// else ==> point is at xyz*
// point 1
- long node1ID1;
- long node1ID2;
+ smIdType node1ID1;
+ smIdType node1ID2;
PointStruct xyz1;
// point 2
- long node2ID1;
- long node2ID2;
+ smIdType node2ID1;
+ smIdType node2ID2;
PointStruct xyz2;
// vector on the plane; to use a default plane set vector = (0,0,0)
// face edge defined by two nodes + optional medium node
struct FaceEdge
{
- long node1;
- long node2;
- long medium;
+ smIdType node1;
+ smIdType node2;
+ smIdType medium;
};
typedef sequence<FaceEdge> ListOfEdges;
* created, this method returns list of their IDs, if new nodes
* 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
* created, this method returns list of their IDs, if new elements
* 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
* \param IDsOfElements list of mesh elements identifiers
* \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.
* \param IDsOfElements list of mesh elements identifiers
* \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.
* \param IDsOfNodes list of mesh nodes identifiers
* \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.
* \return number of removed nodes
*/
- long RemoveOrphanNodes() raises (SALOME::SALOME_Exception);
+ smIdType RemoveOrphanNodes() raises (SALOME::SALOME_Exception);
/*!
* \brief Add a new node.
* \param z Z coordinate 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.
* \param IdOfNode Node IDs for creation of element.
* \param DuplicateElements to add one more 0D element to a node or not
*/
- long Add0DElement(in long IDOfNode,
- in boolean DuplicateElements) raises (SALOME::SALOME_Exception);
+ smIdType Add0DElement(in smIdType IDOfNode,
+ in boolean DuplicateElements) raises (SALOME::SALOME_Exception);
/*!
* Create a ball element on the given node.
* \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
* 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.
*/
- 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
* 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.
*/
- 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
* \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
* 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.
*/
- 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.
* \param Quantities List of integer values, Quantities[i]
* gives quantity of nodes in face number i.
*/
- long AddPolyhedralVolume (in long_array IdsOfNodes,
- in long_array Quantities) raises (SALOME::SALOME_Exception);
+ smIdType AddPolyhedralVolume (in smIdType_array IdsOfNodes,
+ in long_array Quantities) raises (SALOME::SALOME_Exception);
/*!
* Create volume of many faces, giving IDs of existing faces.
* \param IdsOfFaces List of face IDs for volume creation.
* \note The created volume will refer only to nodes
* 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.
* \param NodeID - node ID
* \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);
/*!
* \brief Store node position on an edge
* \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
* \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);
/*!
* \brief Store node position on a face
* \param u - U 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);
/*!
* \brief Bind a node to a solid
* \param NodeID - node ID
* \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);
/*!
* \brief Bind an element to a shape
* \param ElementID - element ID
* \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);
- 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);
- boolean InverseDiag(in long NodeID1, in long NodeID2)
+ boolean InverseDiag(in smIdType NodeID1, in smIdType NodeID2)
raises (SALOME::SALOME_Exception);
- boolean DeleteDiag(in long NodeID1, in long NodeID2)
+ boolean DeleteDiag(in smIdType NodeID1, in smIdType NodeID2)
raises (SALOME::SALOME_Exception);
- boolean Reorient(in long_array IDsOfElements)
+ boolean Reorient(in smIdType_array IDsOfElements)
raises (SALOME::SALOME_Exception);
boolean ReorientObject(in SMESH_IDSource theObject)
* is still performed; theMaxAngle is measured in radians.
* \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 double MaxAngle) raises (SALOME::SALOME_Exception);
/*!
* \param theCriterion Is used to choose a diagonal for splitting.
* \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);
/*!
* \brief Split quadrangles into triangles.
* \param the13Diag Is used to choose a diagonal for splitting.
* \return TRUE in case of success, FALSE otherwise.
*/
- boolean SplitQuad (in long_array IDsOfElements,
- in boolean Diag13) raises (SALOME::SALOME_Exception);
+ boolean SplitQuad (in smIdType_array IDsOfElements,
+ in boolean Diag13) raises (SALOME::SALOME_Exception);
/*!
* \brief Split quadrangles into triangles.
*
* \return 1 if 1-3 diagonal is better, 2 if 2-4
* diagonal is better, 0 if error occurs.
*/
- long BestSplit (in long IDOfQuad,
+ long BestSplit (in long IDOfQuad,
in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception);
/*!
enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
- boolean Smooth(in long_array IDsOfElements,
- in long_array IDsOfFixedNodes,
- in long MaxNbOfIterations,
- in double MaxAspectRatio,
- in Smooth_Method Method) raises (SALOME::SALOME_Exception);
-
- boolean SmoothObject(in SMESH_IDSource theObject,
- in long_array IDsOfFixedNodes,
- in long MaxNbOfIterations,
- in double MaxAspectRatio,
- in Smooth_Method Method) raises (SALOME::SALOME_Exception);
-
- boolean SmoothParametric(in long_array IDsOfElements,
- in long_array IDsOfFixedNodes,
- in long MaxNbOfIterations,
- in double MaxAspectRatio,
- in Smooth_Method Method) raises (SALOME::SALOME_Exception);
-
- boolean SmoothParametricObject(in SMESH_IDSource theObject,
- in long_array IDsOfFixedNodes,
- in long MaxNbOfIterations,
- in double MaxAspectRatio,
- in Smooth_Method Method) raises (SALOME::SALOME_Exception);
+ boolean Smooth(in smIdType_array IDsOfElements,
+ in smIdType_array IDsOfFixedNodes,
+ in short MaxNbOfIterations,
+ in double MaxAspectRatio,
+ in Smooth_Method Method) raises (SALOME::SALOME_Exception);
+
+ boolean SmoothObject(in SMESH_IDSource theObject,
+ in smIdType_array IDsOfFixedNodes,
+ in short MaxNbOfIterations,
+ in double MaxAspectRatio,
+ in Smooth_Method Method) raises (SALOME::SALOME_Exception);
+
+ boolean SmoothParametric(in smIdType_array IDsOfElements,
+ in smIdType_array IDsOfFixedNodes,
+ in short MaxNbOfIterations,
+ in double MaxAspectRatio,
+ in Smooth_Method Method) raises (SALOME::SALOME_Exception);
+
+ boolean SmoothParametricObject(in SMESH_IDSource theObject,
+ in smIdType_array IDsOfFixedNodes,
+ in short MaxNbOfIterations,
+ in double MaxAspectRatio,
+ in Smooth_Method Method) raises (SALOME::SALOME_Exception);
void ConvertToQuadratic(in boolean theForce3d)
raises (SALOME::SALOME_Exception);
* corresponding to groups the input elements included in.
* \return ListOfGroups - new groups created if \a ToMakeGroups is true
*/
- ListOfGroups AdvancedExtrusion(in long_array IDsOfElements,
- in DirStruct StepVector,
- in long NbOfSteps,
- in long ExtrFlags,
- in double SewTolerance,
- in boolean ToMakeGroups)
+ ListOfGroups AdvancedExtrusion(in smIdType_array IDsOfElements,
+ in DirStruct StepVector,
+ in long NbOfSteps,
+ in long ExtrFlags,
+ in double SewTolerance,
+ in boolean ToMakeGroups)
raises (SALOME::SALOME_Exception);
enum Extrusion_Error {
in ListOfIDSources Faces,
in SMESH_IDSource Path,
in GEOM::GEOM_Object PathShape,
- in long NodeStart,
+ in smIdType NodeStart,
in boolean HasAngles,
in double_array Angles,
in boolean AnglesVariation,
enum MirrorType { POINT, AXIS, PLANE };
- void Mirror (in long_array IDsOfElements,
- in AxisStruct Mirror,
- in MirrorType Type,
- in boolean Copy)
+ void Mirror (in smIdType_array IDsOfElements,
+ in AxisStruct Mirror,
+ in MirrorType Type,
+ in boolean Copy)
raises (SALOME::SALOME_Exception);
- ListOfGroups MirrorMakeGroups (in long_array IDsOfElements,
- in AxisStruct Mirror,
- in MirrorType Type)
+ ListOfGroups MirrorMakeGroups (in smIdType_array IDsOfElements,
+ in AxisStruct Mirror,
+ in MirrorType Type)
raises (SALOME::SALOME_Exception);
- SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements,
- in AxisStruct Mirror,
- in MirrorType Type,
- in boolean CopyGroups,
- in string MeshName)
+ SMESH_Mesh MirrorMakeMesh (in smIdType_array IDsOfElements,
+ in AxisStruct Mirror,
+ in MirrorType Type,
+ in boolean CopyGroups,
+ in string MeshName)
raises (SALOME::SALOME_Exception);
void MirrorObject (in SMESH_IDSource theObject,
in string MeshName)
raises (SALOME::SALOME_Exception);
- void Translate (in long_array IDsOfElements,
- in DirStruct Vector,
- in boolean Copy)
+ void Translate (in smIdType_array IDsOfElements,
+ in DirStruct Vector,
+ in boolean Copy)
raises (SALOME::SALOME_Exception);
- ListOfGroups TranslateMakeGroups (in long_array IDsOfElements,
- in DirStruct Vector)
+ ListOfGroups TranslateMakeGroups (in smIdType_array IDsOfElements,
+ in DirStruct Vector)
raises (SALOME::SALOME_Exception);
- SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements,
- in DirStruct Vector,
- in boolean CopyGroups,
- in string MeshName)
+ SMESH_Mesh TranslateMakeMesh (in smIdType_array IDsOfElements,
+ in DirStruct Vector,
+ in boolean CopyGroups,
+ in string MeshName)
raises (SALOME::SALOME_Exception);
void TranslateObject (in SMESH_IDSource theObject,
in string MeshName)
raises (SALOME::SALOME_Exception);
- void Rotate (in long_array IDsOfElements,
- in AxisStruct Axis,
- in double AngleInRadians,
- in boolean Copy)
+ void Rotate (in smIdType_array IDsOfElements,
+ in AxisStruct Axis,
+ in double AngleInRadians,
+ in boolean Copy)
raises (SALOME::SALOME_Exception);
- ListOfGroups RotateMakeGroups (in long_array IDsOfElements,
- in AxisStruct Axis,
- in double AngleInRadians)
+ ListOfGroups RotateMakeGroups (in smIdType_array IDsOfElements,
+ in AxisStruct Axis,
+ in double AngleInRadians)
raises (SALOME::SALOME_Exception);
- SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements,
- in AxisStruct Axis,
- in double AngleInRadians,
- in boolean CopyGroups,
- in string MeshName)
+ SMESH_Mesh RotateMakeMesh (in smIdType_array IDsOfElements,
+ in AxisStruct Axis,
+ in double AngleInRadians,
+ in boolean CopyGroups,
+ in string MeshName)
raises (SALOME::SALOME_Exception);
void RotateObject (in SMESH_IDSource theObject,
* 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
*/
- 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);
/*!
* 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);
/*!
*
* '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);
/*!
*
* 'ALL' type means elements of any type excluding nodes and 0D elements
*/
- long_array FindAmongElementsByPoint(in SMESH_IDSource elements,
- in double x, in double y, in double z,
- in ElementType type)
+ smIdType_array FindAmongElementsByPoint(in SMESH_IDSource elements,
+ in double x, in double y, in double z,
+ in ElementType type)
raises (SALOME::SALOME_Exception);
/*!
* and coordinates of the projection point.
* In the case if nothing found, return -1 and []
*/
- long ProjectPoint(in double x,
- in double y,
- in double z,
- in ElementType type,
- in SMESH_IDSource meshObject,
- out double_array projecton)
+ smIdType ProjectPoint(in double x,
+ in double y,
+ in double z,
+ in ElementType type,
+ in SMESH_IDSource meshObject,
+ out double_array projecton)
raises (SALOME::SALOME_Exception);
/*!
* If a group is closed, the first and last nodes of the group are same.
*/
array_of_long_array Get1DBranches( in SMESH_IDSource edges,
- in long startNode,
+ in smIdType startNode,
out array_of_long_array nodeGroups)
raises (SALOME::SALOME_Exception);
SEW_INTERNAL_ERROR
};
- Sew_Error SewFreeBorders (in long FirstNodeID1,
- in long SecondNodeID1,
- in long LastNodeID1,
- in long FirstNodeID2,
- in long SecondNodeID2,
- in long LastNodeID2,
- in boolean CreatePolygons,
- in boolean CreatePolyedrs)
+ Sew_Error SewFreeBorders (in smIdType FirstNodeID1,
+ in smIdType SecondNodeID1,
+ in smIdType LastNodeID1,
+ in smIdType FirstNodeID2,
+ in smIdType SecondNodeID2,
+ in smIdType LastNodeID2,
+ in boolean CreatePolygons,
+ in boolean CreatePolyedrs)
raises (SALOME::SALOME_Exception);
- Sew_Error SewConformFreeBorders (in long FirstNodeID1,
- in long SecondNodeID1,
- in long LastNodeID1,
- in long FirstNodeID2,
- in long SecondNodeID2)
+ Sew_Error SewConformFreeBorders (in smIdType FirstNodeID1,
+ in smIdType SecondNodeID1,
+ in smIdType LastNodeID1,
+ in smIdType FirstNodeID2,
+ in smIdType SecondNodeID2)
raises (SALOME::SALOME_Exception);
- Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
- in long SecondNodeIDOnFreeBorder,
- in long LastNodeIDOnFreeBorder,
- in long FirstNodeIDOnSide,
- in long LastNodeIDOnSide,
- in boolean CreatePolygons,
- in boolean CreatePolyedrs)
+ Sew_Error SewBorderToSide (in smIdType FirstNodeIDOnFreeBorder,
+ in smIdType SecondNodeIDOnFreeBorder,
+ in smIdType LastNodeIDOnFreeBorder,
+ in smIdType FirstNodeIDOnSide,
+ in smIdType LastNodeIDOnSide,
+ in boolean CreatePolygons,
+ in boolean CreatePolyedrs)
raises (SALOME::SALOME_Exception);
- Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
- in long_array IDsOfSide2Elements,
- in long NodeID1OfSide1ToMerge,
- in long NodeID1OfSide2ToMerge,
- in long NodeID2OfSide1ToMerge,
- in long NodeID2OfSide2ToMerge)
+ Sew_Error SewSideElements (in smIdType_array IDsOfSide1Elements,
+ in smIdType_array IDsOfSide2Elements,
+ in smIdType NodeID1OfSide1ToMerge,
+ in smIdType NodeID1OfSide2ToMerge,
+ in smIdType NodeID2OfSide1ToMerge,
+ in smIdType NodeID2OfSide2ToMerge)
raises (SALOME::SALOME_Exception);
/*!
* If number of nodes is not corresponded to type of
* 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);
/*!
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \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);
/*!
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \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);
/*!
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroup(), DoubleNodeGroups()
*/
- boolean DoubleNodeElem( in long_array theElems,
- in long_array theNodesNot,
- in long_array theAffectedElems )
+ boolean DoubleNodeElem( in smIdType_array theElems,
+ in smIdType_array theNodesNot,
+ in smIdType_array theAffectedElems )
raises (SALOME::SALOME_Exception);
/*!
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
*/
- boolean DoubleNodeElemInRegion( in long_array theElems,
- in long_array theNodesNot,
+ boolean DoubleNodeElemInRegion( in smIdType_array theElems,
+ in smIdType_array theNodesNot,
in GEOM::GEOM_Object theShape )
raises (SALOME::SALOME_Exception);
#define _SMESH_PATTERN_IDL_
#include "SMESH_Mesh.idl"
+#include "SMESH_smIdType.idl"
module SMESH
{
* the loaded pattern to mesh faces. The first key-point
* will be mapped into <theNodeIndexOnKeyPoint1>-th node of each face
*/
- point_array ApplyToMeshFaces(in SMESH_Mesh theMesh,
- in long_array theFacesIDs,
- in long theNodeIndexOnKeyPoint1,
- in boolean theReverse);
+ point_array ApplyToMeshFaces(in SMESH_Mesh theMesh,
+ in smIdType_array theFacesIDs,
+ in short theNodeIndexOnKeyPoint1,
+ in boolean theReverse);
/*!
* Compute nodes coordinates applying
* The (0,0,1) key-point will be mapped into <theNode001Index>-th
* node of each volume.
*/
- point_array ApplyToHexahedrons(in SMESH_Mesh theMesh,
- in long_array theVolumesIDs,
- in long theNode000Index,
- in long theNode001Index);
+ point_array ApplyToHexahedrons(in SMESH_Mesh theMesh,
+ in smIdType_array theVolumesIDs,
+ in short theNode000Index,
+ in short theNode001Index);
/*!
* Create nodes and elements in <theMesh> using nodes
--- /dev/null
+// 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
\ No newline at end of file
#include "SMESHDS_Mesh.hxx"
#include "SMESH_MeshAlgos.hxx"
#include "SMESH_OctreeNode.hxx"
+#include "SMESH_Comment.hxx"
#include <GEOMUtils.hxx>
#include <Basics_Utils.hxx>
return aDist;
}
- int getNbMultiConnection( const SMDS_Mesh* theMesh, const int theId )
+ int getNbMultiConnection( const SMDS_Mesh* theMesh, const smIdType theId )
{
if ( theMesh == 0 )
return 0;
myMesh = theMesh;
}
-bool NumericalFunctor::GetPoints(const int theId,
+bool NumericalFunctor::GetPoints(const smIdType theId,
TSequenceOfXYZ& theRes ) const
{
theRes.clear();
*/
//================================================================================
-void NumericalFunctor::GetHistogram(int nbIntervals,
- std::vector<int>& nbEvents,
- std::vector<double>& funValues,
- const std::vector<int>& elements,
- const double* minmax,
- const bool isLogarithmic)
+void NumericalFunctor::GetHistogram(int nbIntervals,
+ std::vector<int>& nbEvents,
+ std::vector<double>& funValues,
+ const std::vector<smIdType>& elements,
+ const double* minmax,
+ const bool isLogarithmic)
{
if ( nbIntervals < 1 ||
!myMesh ||
}
else
{
- std::vector<int>::const_iterator id = elements.begin();
+ std::vector<smIdType>::const_iterator id = elements.begin();
for ( ; id != elements.end(); ++id )
values.insert( GetValue( *id ));
}
{
// use special nodes iterator
SMDS_NodeIteratorPtr anIter = anElem->interlacedNodesIterator();
- long aNodeId[4] = { 0,0,0,0 };
+ smIdType aNodeId[4] = { 0,0,0,0 };
gp_Pnt P[4];
double aLength = 0;
}
else {
SMDS_NodeIteratorPtr aNodesIter = anElem->nodeIterator();
- long aNodeId[2] = {0,0};
+ smIdType aNodeId[2] = {0,0};
gp_Pnt P[3];
double aLength;
for( ; aNodesIter->more(); )
{
aNode = aNodesIter->next();
- long anId = aNode->GetID();
+ smIdType anId = aNode->GetID();
P[2] = SMESH_NodeXYZ( aNode );
if (!anIter) break;
const SMDS_MeshNode *aNode, *aNode0 = 0;
- TColStd_MapOfInteger aMap, aMapPrev;
+ NCollection_Map< smIdType, smIdHasher > aMap, aMapPrev;
for (i = 0; i <= len; i++) {
aMapPrev = aMap;
while (anElemIter->more()) {
const SMDS_MeshElement* anElem = anElemIter->next();
if (anElem != 0 && anElem->GetType() == SMDSAbs_Face) {
- int anId = anElem->GetID();
+ smIdType anId = anElem->GetID();
aMap.Add(anId);
if (aMapPrev.Contains(anId)) {
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);
while( anElemIter->more() )
{
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 )
return false;
}
SMDSAbs_ElementType aGrpElType = (SMDSAbs_ElementType)aGrp->GetType();
if ( myType == aGrpElType || (myType == SMDSAbs_All && aGrpElType != SMDSAbs_Node) ) {
// add elements IDS into control
- int aSize = aGrp->Extent();
- for (int i = 0; i < aSize; i++)
+ smIdType aSize = aGrp->Extent();
+ for (smIdType i = 0; i < aSize; i++)
myIDs.insert( aGrp->GetID(i+1) );
}
}
SMDSAbs_ElementType ConnectedElements::GetType() const
{ return myType; }
-int ConnectedElements::GetNode() const
+smIdType ConnectedElements::GetNode() const
{ return myXYZ.empty() ? myNodeID : 0; } // myNodeID can be found by myXYZ
std::vector<double> ConnectedElements::GetPoint() const
}
}
-void ConnectedElements::SetNode( int nodeID )
+void ConnectedElements::SetNode( smIdType nodeID )
{
myNodeID = nodeID;
myXYZ.clear();
return false;
std::list< const SMDS_MeshNode* > nodeQueue( 1, node0 );
- std::set< int > checkedNodeIDs;
+ std::set< smIdType > checkedNodeIDs;
// algo:
// foreach node in nodeQueue:
// foreach element sharing a node:
while ( nIt->more() )
{
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 );
}
}
{
theResStr.Clear();
- TColStd_SequenceOfInteger anIntSeq;
- TColStd_SequenceOfAsciiString aStrSeq;
+ TIDsSeq anIntSeq;
+ NCollection_Sequence< std::string > aStrSeq;
- TColStd_MapIteratorOfMapOfInteger anIter( myIds );
+ TIDsMap::Iterator anIter( myIds );
for ( ; anIter.More(); anIter.Next() )
{
- int anId = anIter.Key();
- TCollection_AsciiString aStr( anId );
+ smIdType anId = anIter.Key();
+ SMESH_Comment aStr( anId );
anIntSeq.Append( anId );
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 );
- int aMaxId = myMax( i );
+ smIdType aMinId = myMin[i];
+ smIdType aMaxId = myMax[i];
- TCollection_AsciiString aStr;
+ SMESH_Comment aStr;
if ( aMinId != IntegerFirst() )
- aStr += aMinId;
+ aStr << aMinId;
- aStr += "-";
+ aStr << "-";
- if ( aMaxId != IntegerLast() )
- aStr += aMaxId;
+ if ( aMaxId != std::numeric_limits<smIdType>::max() )
+ aStr << aMaxId;
// find position of the string in result sequence and insert string in it
if ( anIntSeq.Length() == 0 )
{
anIntSeq.Append( aMinId );
- aStrSeq.Append( aStr );
+ aStrSeq.Append( (const char*)aStr );
}
else
{
if ( aMinId < anIntSeq.First() )
{
anIntSeq.Prepend( aMinId );
- aStrSeq.Prepend( aStr );
+ aStrSeq.Prepend( (const char*)aStr );
}
else if ( aMinId > anIntSeq.Last() )
{
anIntSeq.Append( aMinId );
- aStrSeq.Append( aStr );
+ aStrSeq.Append( (const char*)aStr );
}
else
for ( int j = 1, k = anIntSeq.Length(); j <= k; j++ )
if ( aMinId < anIntSeq( j ) )
{
anIntSeq.InsertBefore( j, aMinId );
- aStrSeq.InsertBefore( j, aStr );
+ aStrSeq.InsertBefore( j, (const char*)aStr );
break;
}
}
if ( aStrSeq.Length() == 0 )
return;
-
- theResStr = aStrSeq( 1 );
+ std::string aResStr;
+ aResStr = aStrSeq( 1 );
for ( int j = 2, k = aStrSeq.Length(); j <= k; j++ )
{
- theResStr += ",";
- theResStr += aStrSeq( j );
+ aResStr += ",";
+ aResStr += aStrSeq( j );
}
+ theResStr = aResStr.c_str();
}
//=======================================================================
//=======================================================================
bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr )
{
- myMin.Clear();
- myMax.Clear();
+ myMin.clear();
+ myMax.clear();
myIds.Clear();
TCollection_AsciiString aStr = theStr;
(!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue()) )
return false;
- myMin.Append( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() );
- myMax.Append( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() );
+ myMin.push_back( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() );
+ myMax.push_back( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() );
}
}
if ( myIds.Contains( theId ) )
return true;
- for ( int i = 1, n = myMin.Length(); i <= n; i++ )
- if ( theId >= myMin( i ) && theId <= myMax( i ) )
+ for ( size_t i = 0; i < myMin.size(); i++ )
+ if ( theId >= myMin[i] && theId <= myMax[i] )
return true;
return false;
// the map of non manifold links and bad geometry
TMapOfLink aMapOfNonManifold;
- TColStd_MapOfInteger aMapOfTreated;
+ TIDsMap aMapOfTreated;
// begin cycle on faces from start index and run on vector till the end
// and from begin to start index to cover whole vector
// as result next time when fi will be equal to aStartIndx
SMDS_MeshFace* aFacePtr = myAllFacePtr[ fi ];
- if ( aMapOfTreated.Contains( aFacePtr->GetID() ) )
+ if ( aMapOfTreated.Contains( aFacePtr->GetID()) )
continue;
aMapOfTreated.Add( aFacePtr->GetID() );
- TColStd_MapOfInteger aResFaces;
+ TIDsMap aResFaces;
if ( !findConnected( myAllFacePtrIntDMap, aFacePtr,
aMapOfNonManifold, aResFaces ) )
continue;
- TColStd_MapIteratorOfMapOfInteger anItr( aResFaces );
+ TIDsMap::Iterator anItr( aResFaces );
for ( ; anItr.More(); anItr.Next() )
{
- int aFaceId = anItr.Key();
+ smIdType aFaceId = anItr.Key();
aMapOfTreated.Add( aFaceId );
myMapIds.Add( aFaceId );
}
( const ManifoldPart::TDataMapFacePtrInt& theAllFacePtrInt,
SMDS_MeshFace* theStartFace,
ManifoldPart::TMapOfLink& theNonManifold,
- TColStd_MapOfInteger& theResFaces )
+ TIDsMap& theResFaces )
{
theResFaces.Clear();
if ( !theAllFacePtrInt.size() )
SMDS_MeshFace* aNextFace = *pFace;
if ( aPrevFace == aNextFace )
continue;
- int anNextFaceID = aNextFace->GetID();
+ smIdType anNextFaceID = aNextFace->GetID();
if ( myIsOnlyManifold && theResFaces.Contains( anNextFaceID ) )
// should not be with non manifold restriction. probably bad topology
continue;
if ( !myMeshModifTracer.GetMesh() )
return;
- myIds.ReSize( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ));
+ int nbElems = FromIdType<int>( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ));
+ if ( nbElems > 0 )
+ myIds.ReSize( nbElems );
SMDS_ElemIteratorPtr anIter = myMeshModifTracer.GetMesh()->elementsIterator( myType );
for(; anIter->more(); )
#include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Quantity_Color.hxx>
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_SequenceOfInteger.hxx>
#include <TCollection_AsciiString.hxx>
+#include <NCollection_Map.hxx>
#include <TopAbs.hxx>
#include <TopoDS_Face.hxx>
#include <gp_XYZ.hxx>
class gp_Pln;
class gp_Pnt;
+typedef NCollection_Map< smIdType, smIdHasher > TIDsMap;
+typedef NCollection_Sequence<smIdType> TIDsSeq;
+
namespace SMESH{
namespace Controls{
virtual void SetMesh( const SMDS_Mesh* theMesh );
virtual double GetValue( long theElementId );
virtual double GetValue(const TSequenceOfXYZ& /*thePoints*/) { return -1.0;};
- void GetHistogram(int nbIntervals,
- std::vector<int>& nbEvents,
- std::vector<double>& funValues,
- const std::vector<int>& elements,
- const double* minmax=0,
- const bool isLogarithmic = false);
+ void GetHistogram(int nbIntervals,
+ std::vector<int>& nbEvents,
+ std::vector<double>& funValues,
+ const std::vector<smIdType>& elements,
+ const double* minmax=0,
+ const bool isLogarithmic = false);
bool IsApplicable( long theElementId ) const;
virtual bool IsApplicable( const SMDS_MeshElement* element ) const;
virtual SMDSAbs_ElementType GetType() const = 0;
void SetPrecision( const long thePrecision );
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);
protected:
const SMDS_Mesh* myMesh;
double GetTolerance () const { return myToler; }
private:
- double myToler;
- TColStd_MapOfInteger myCoincidentIDs;
- TMeshModifTracer myMeshModifTracer;
+ double myToler;
+ TIDsMap myCoincidentIDs;
+ TMeshModifTracer myMeshModifTracer;
};
typedef boost::shared_ptr<CoincidentNodes> CoincidentNodesPtr;
virtual void SetMesh( const SMDS_Mesh* theMesh );
virtual bool IsSatisfy( long theElementId );
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;
struct Border{
TElemId myElemId;
protected:
const SMDS_Mesh* myMesh;
- TColStd_SequenceOfInteger myMin;
- TColStd_SequenceOfInteger myMax;
- TColStd_MapOfInteger myIds;
+ std::vector< smIdType > myMin;
+ std::vector< smIdType > myMax;
+ TIDsMap myIds;
SMDSAbs_ElementType myType;
};
bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
SMDS_MeshFace* theStartFace,
TMapOfLink& theNonManifold,
- TColStd_MapOfInteger& theResFaces );
+ TIDsMap& theResFaces );
bool isInPlane( const SMDS_MeshFace* theFace1,
const SMDS_MeshFace* theFace2 );
void expandBoundary( TMapOfLink& theMapOfBoundary,
private:
const SMDS_Mesh* myMesh;
- TColStd_MapOfInteger myMapIds;
- TColStd_MapOfInteger myMapBadGeomIds;
+ TIDsMap myMapIds;
+ TIDsMap myMapBadGeomIds;
TVectorOfFacePtr myAllFacePtr;
TDataMapFacePtrInt myAllFacePtrIntDMap;
double myAngToler;
private:
TMeshModifTracer myMeshModifTracer;
- TColStd_MapOfInteger myIds;
+ TIDsMap myIds;
SMDSAbs_ElementType myType;
TopoDS_Face mySurf;
double myToler;
TMeshModifTracer myMeshModifTracer;
long myFaceID;
double myToler;
- TColStd_MapOfInteger myCoplanarIDs;
+ TIDsMap myCoplanarIDs;
};
typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
public:
ConnectedElements();
//virtual Predicate* clone() const { return new ConnectedElements( *this ); }
- void SetNode( int nodeID );
+ void SetNode( smIdType nodeID );
void SetPoint( double x, double y, double z );
- int GetNode() const;
+ smIdType GetNode() const;
std::vector<double> GetPoint() const;
void SetType( SMDSAbs_ElementType theType );
//const std::set<long>& GetDomainIDs() const { return myOkIDs; }
private:
- int myNodeID;
+ smIdType myNodeID;
std::vector<double> myXYZ;
SMDSAbs_ElementType myType;
TMeshModifTracer myMeshModifTracer;
void clearOkIDs();
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;
#define _INCLUDE_DRIVER_MESH
#include "SMESH_ComputeError.hxx"
+#include "SMDS_Mesh.hxx"
#include <string>
#include <vector>
enum Status {
DRS_OK,
- DRS_EMPTY, // a file contains no mesh with the given name
- DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers,
- // so the numbers from the file are ignored
- DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
+ DRS_EMPTY, // a file contains no mesh with the given name
+ DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers,
+ // so the numbers from the file are ignored
+ DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_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);
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:
std::string myFile;
std::string myMeshName;
#include "SMESH_Comment.hxx"
#include "SMESH_TypeDefs.hxx"
+#include <smIdType.hxx>
+
#include <gp_XYZ.hxx>
#include <cgnslib.h>
struct TZoneData
{
int _id;
- int _nodeIdShift; // nb nodes in previously read zones
- int _elemIdShift; // nb faces in previously read zones
- int _nbNodes, _nbElems;
+ smIdType _nodeIdShift; // nb nodes in previously read zones
+ smIdType _elemIdShift; // nb faces in previously read zones
+ smIdType _nbNodes, _nbElems;
int _meshDim;
int _sizeX, _sizeY, _sizeZ, _nbCells; // structured
cgsize_t _sizes[NB_ZONE_SIZE_VAL];
}
SMDS_MeshElement* add_NGON(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID)
{
- vector<int> idVec( ids[0] );
+ vector<smIdType> idVec( ids[0] );
for ( int i = 0; i < ids[0]; ++i )
- idVec[ i ] = (int) ids[ i + 1];
- return mesh->AddPolygonalFaceWithID( idVec, ID );
+ idVec[ i ] = (smIdType) ids[ i + 1];
+ return mesh->AddPolygonalFaceWithID( idVec, ToIdType(ID) );
}
typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID);
case 2: addElemFun = & add_QUAD_4; break;
case 3: addElemFun = & add_HEXA_8; break;
}
- int elemID = meshInfo.NbElements();
+ smIdType elemID = meshInfo.NbElements();
const SMDS_MeshElement* elem = 0;
for ( size_t i = 0; i < ids.size(); i += nbElemNodes )
{
*/
struct TPolyhedFace
{
- int _id; // id of NGON_n
- vector< int > _nodes; // lowest node IDs used for sorting
+ smIdType _id; // id of NGON_n
+ 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;
- for ( int i = 0; i < nbNodes; ++i )
+ set< smIdType > ids;
+ for ( smIdType i = 0; i < nbNodes; ++i )
ids.insert( nodes[i]->GetID() );
_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 )
_nodes[j] = *idIt;
}
if ( !myMesh || myMesh->GetMeshInfo().NbElements() < 1 )
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
if ( cg_open(myFile.c_str(), CG_MODE_MODIFY, &_fn) != CG_OK &&
cg_open(myFile.c_str(), CG_MODE_WRITE, &_fn) != CG_OK )
// create a Zone
// --------------
- int nbCells = myMesh->NbEdges();
+ smIdType nbCells = myMesh->NbEdges();
if ( meshDim == 3 )
nbCells = myMesh->NbVolumes();
else if ( meshDim == 2 )
nbCells = myMesh->NbFaces();
- cgsize_t size[9] = { myMesh->NbNodes(), nbCells, /*NBoundVertex=*/0, 0,0,0,0,0,0 };
+ cgsize_t size[9] = { FromIdType<cgsize_t>( myMesh->NbNodes() ),
+ FromIdType<cgsize_t>( nbCells ),
+ /*NBoundVertex=*/0, 0,0,0,0,0,0 };
int iZone;
if ( cg_zone_write( _fn, iBase, "SMESH_Mesh", size,
CGNS_ENUMV( Unstructured ), &iZone) != CG_OK )
myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint);
}
- fprintf(stdout, "%d noeuds\n", myMesh->NbNodes());
+ fprintf(stdout, "%ld noeuds\n", myMesh->NbNodes());
/****************************************************************************
* LECTURE DES ELEMENTS *
****************************************************************************/
Kernel_Utils::Localizer loc;
Status aResult = DRS_OK;
- int nbNodes, nbCells;
+ smIdType nbNodes, nbCells;
#if defined(WIN32) && defined(UNICODE)
std::wstring file2Read = Kernel_Utils::utf8_decode_s(myFile);
FILE* aFileId = _wfopen(file2Read.c_str(), L"w+");
nbNodes = myMesh->NbNodes();
/* 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_faces = myMesh->NbFaces();
nb_of_volumes = myMesh->NbVolumes();
SCRUTE(nb_of_volumes);
//fprintf(stdout, "%d %d\n", nbNodes, nbCells);
- fprintf(aFileId, "%d %d\n", nbNodes, nbCells);
+ fprintf(aFileId, "%ld %ld\n", nbNodes, nbCells);
/****************************************************************************
* ECRITURE DES NOEUDS *
for ( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{
- int nodeID = it->next()->GetID();
+ smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
- fprintf(aFileId, "%d ", nodeID );
+ fprintf(aFileId, "%ld ", nodeID );
}
fprintf(aFileId, "\n");
}
for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{
- int nodeID = it->next()->GetID();
+ smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
- fprintf(aFileId, "%d ", nodeID );
+ fprintf(aFileId, "%ld ", nodeID );
}
fprintf(aFileId, "\n");
}
for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{
- int nodeID = it->next()->GetID();
+ smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
- fprintf(aFileId, "%d ", nodeID );
+ fprintf(aFileId, "%ld ", nodeID );
}
fprintf(aFileId, "\n");
int ref;
- const int nodeIDShift = myMesh->GetMeshInfo().NbNodes();
+ const smIdType nodeIDShift = myMesh->GetMeshInfo().NbNodes();
if ( version != GmfFloat )
{
double x, y, z;
int iN[28]; // 28 - nb nodes in HEX27 (+ 1 for safety :)
/* Read edges */
- const int edgeIDShift = myMesh->GetMeshInfo().NbElements();
+ const smIdType edgeIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbEdges = GmfStatKwd(meshID, GmfEdges))
{
// read extra vertices for quadratic edges
}
/* Read triangles */
- const int triaIDShift = myMesh->GetMeshInfo().NbElements();
+ const smIdType triaIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbTria = GmfStatKwd(meshID, GmfTriangles))
{
// read extra vertices for quadratic triangles
}
/* Read quadrangles */
- const int quadIDShift = myMesh->GetMeshInfo().NbElements();
+ const smIdType quadIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilaterals))
{
// read extra vertices for quadratic quadrangles
}
/* Read terahedra */
- const int tetIDShift = myMesh->GetMeshInfo().NbElements();
+ const smIdType tetIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbTet = GmfStatKwd( meshID, GmfTetrahedra ))
{
// read extra vertices for quadratic tetrahedra
for ( int i = 1; i <= nbTet; ++i )
{
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 ( !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],
tetIDShift + i ))
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] );
}
else // TETRA4
}
/* Read pyramids */
- const int pyrIDShift = myMesh->GetMeshInfo().NbElements();
+ const smIdType pyrIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbPyr = GmfStatKwd(meshID, GmfPyramids))
{
GmfGotoKwd(meshID, GmfPyramids);
}
/* Read hexahedra */
- const int hexIDShift = myMesh->GetMeshInfo().NbElements();
+ const smIdType hexIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra))
{
// read extra vertices for quadratic hexahedra
&iN[6], &iN[7], &iN[8], &iN[9],
&iN[10], &iN[11], &iN[12], &iN[13], // HEXA20
&iN[14],
- &iN[15], &iN[16], &iN[17], &iN[18],
+ &iN[15], &iN[16], &iN[17], &iN[18],
&iN[19],
&iN[20]); // HEXA27
if ( iN[0] <= nbHex )
midN[7], midN[6], midN[5], midN[4],
midN[8], midN[11], midN[10], midN[9],
hexIDShift + i ))
- status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20,
+ status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20,
iN[0], iN[3], iN[2], iN[1],
iN[4], iN[7], iN[6], iN[5],
midN[3], midN[2], midN[1], midN[0],
midN[17],
midN[18],
hexIDShift + i ))
- status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27,
+ status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27,
iN[0], iN[3], iN[2], iN[1],
iN[4], iN[7], iN[6], iN[5],
midN[3], midN[2], midN[1], midN[0],
}
/* Read prism */
- const int prismIDShift = myMesh->GetMeshInfo().NbElements();
+ const smIdType prismIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbPrism = GmfStatKwd(meshID, GmfPrisms))
{
GmfGotoKwd(meshID, GmfPrisms);
// Read some entities into groups
// see MeshGems/Docs/meshgems_formats_description.pdf
- // get ids of existing groups
- std::set< int > groupIDs;
- const std::set<SMESHDS_GroupBase*>& groups = myMesh->GetGroups();
- std::set<SMESHDS_GroupBase*>::const_iterator grIter = groups.begin();
- for ( ; grIter != groups.end(); ++grIter )
- groupIDs.insert( (*grIter)->GetID() );
- if ( groupIDs.empty() ) groupIDs.insert( 0 );
+ // get ids of existing groups
+ std::set< int > groupIDs;
+ const std::set<SMESHDS_GroupBase*>& groups = myMesh->GetGroups();
+ std::set<SMESHDS_GroupBase*>::const_iterator grIter = groups.begin();
+ for ( ; grIter != groups.end(); ++grIter )
+ groupIDs.insert( (*grIter)->GetID() );
+ if ( groupIDs.empty() ) groupIDs.insert( 0 );
// Read required entities into groups
if ( _makeRequiredGroups )
{
- const int kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift },
- { GmfRequiredEdges, SMDSAbs_Edge, edgeIDShift },
- { GmfRequiredTriangles, SMDSAbs_Face, triaIDShift },
- { GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift }
- };
+ const smIdType kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift },
+ { GmfRequiredEdges, SMDSAbs_Edge, edgeIDShift },
+ { GmfRequiredTriangles, SMDSAbs_Face, triaIDShift },
+ { GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift }
+ };
const char* names[4] = { "_required_Vertices" ,
"_required_Edges" ,
"_required_Triangles" ,
- "_required_Quadrilaterals"
- };
+ "_required_Quadrilaterals"
+ };
for ( int i = 0; i < 4; ++i )
{
- int gmfKwd = kes[i][0];
+ int gmfKwd = FromIdType<int>( kes[i][0] );
SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
- int shift = kes[i][2];
+ smIdType shift = kes[i][2];
if ( int nb = GmfStatKwd(meshID, gmfKwd))
{
const int newID = *groupIDs.rbegin() + 1;
if ( _makeFaultGroups )
{
- const int kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift },
- { GmfFault_BadShape, SMDSAbs_Face, triaIDShift },
- { GmfFault_Overlap, SMDSAbs_Face, triaIDShift },
- { GmfFault_Inter, SMDSAbs_Face, triaIDShift },
- { GmfFault_NearTri, SMDSAbs_Face, triaIDShift },
- { GmfFault_FreeEdge, SMDSAbs_Face, triaIDShift },
- { GmfFault_MultipleEdge, SMDSAbs_Face, triaIDShift }
- };
+ const smIdType kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift },
+ { GmfFault_BadShape, SMDSAbs_Face, triaIDShift },
+ { GmfFault_Overlap, SMDSAbs_Face, triaIDShift },
+ { GmfFault_Inter, SMDSAbs_Face, triaIDShift },
+ { GmfFault_NearTri, SMDSAbs_Face, triaIDShift },
+ { GmfFault_FreeEdge, SMDSAbs_Face, triaIDShift },
+ { GmfFault_MultipleEdge, SMDSAbs_Face, triaIDShift }
+ };
const char* names[7] = { "Fault_SmallTri",
"Fault_BadShape",
"Fault_Overlap",
- "Fault_Inter",
+ "Fault_Inter",
"Fault_NearTri",
"Fault_FreeEdge",
"Fault_MultipleEdge"
- };
+ };
for ( int i = 0; i < 7; ++i )
{
- int gmfKwd = kes[i][0];
+ int gmfKwd = FromIdType<int>( kes[i][0] );
SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
- int shift = kes[i][2];
+ smIdType shift = kes[i][2];
if ( int nb = GmfStatKwd(meshID, gmfKwd))
{
const int newID = *groupIDs.rbegin() + 1;
elemIt = elementIterator( SMDSGeom ); \
if ( elemIt->more() ) \
{ \
- int totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom ); \
- int nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \
+ smIdType totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom );\
+ smIdType nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \
if ( totalNbElems - nbLinearElems > 0 ) \
{ \
GmfSetKwd(meshID, GmfKwd, totalNbElems - nbLinearElems); \
{
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;
int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim );
// nodes
std::map< const SMDS_MeshNode* , int > node2IdMap;
- int iN = 0, nbNodes = myMesh->NbNodes();
+ smIdType iN = 0, nbNodes = myMesh->NbNodes();
GmfSetKwd( meshID, GmfVertices, nbNodes );
double xyz[3];
SMDS_NodeIteratorPtr nodeIt = myMesh->nodesIterator();
#include "MED_Utilities.hxx"
#include <NCollection_Map.hxx>
+#include <smIdType.hxx>
#include "utilities.h"
// 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
MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD);
MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end());
// allocate array of diameters
- vtkIdType maxID = myMesh->MaxElementID() + aNbBalls;
+ vtkIdType maxID = FromIdType<vtkIdType>(myMesh->MaxElementID() + aNbBalls);
if ( anIsElemNum && !aBallInfo->myElemNum->empty() )
maxID = *std::max_element( aBallInfo->myElemNum->begin(),
aBallInfo->myElemNum->end() );
EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX;
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)
(const std::vector<const SMDS_MeshNode*> & nodes);
#endif
if ( anIsElemNum ) {
TInt anElemId = aPolygoneInfo->GetElemNum( iElem );
- anElement = (myMesh->*addPolyWithID)( aNodeIds, anElemId );
+ anElement = (myMesh->*addPolyWithID)( aNodeIds, ToIdType(anElemId) );
}
if ( !anElement ) {
aNodes.resize( aNbConn );
#endif
if(anIsElemNum){
TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
- anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId);
+ anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToIdType(anElemId));
}
if(!anElement){
vector<const SMDS_MeshNode*> aNodes(aNbNodes);
}
// find out "MED order" of elements - sort elements by geom type
- int nbElems;
+ smIdType nbElems;
if ( _nbElemsByGeom.empty() || _elemType != type )
{
_elemType = type;
const SMDS_MeshNode* GetNode(){
return myCurrentNode;
}
- MED::TIntVector::value_type GetID(){
+ MED::TIDVector::value_type GetID(){
return myCurrentNode->GetID();
}
MED::TFloatVector::value_type GetCoord(TInt theCoodId){
}
}
+//================================================================================
+/*!
+ * \brief Write my mesh
+ */
+//================================================================================
+
Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
{
Status aResult = DRS_OK;
try {
//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
//-------------------------------------------------------
string aMeshName;
int myEdgesDefaultFamilyId = 0;
int myFacesDefaultFamilyId = 0;
int myVolumesDefaultFamilyId = 0;
- int nbNodes = myMesh->NbNodes();
- int nb0DElements = myMesh->Nb0DElements();
- int nbBalls = myMesh->NbBalls();
- int nbEdges = myMesh->NbEdges();
- int nbFaces = myMesh->NbFaces();
- int nbVolumes = myMesh->NbVolumes();
+ smIdType nbNodes = myMesh->NbNodes();
+ smIdType nb0DElements = myMesh->Nb0DElements();
+ smIdType nbBalls = myMesh->NbBalls();
+ smIdType nbEdges = myMesh->NbEdges();
+ smIdType nbFaces = myMesh->NbFaces();
+ smIdType nbVolumes = myMesh->NbVolumes();
if (myDoGroupOfNodes) myNodesDefaultFamilyId = REST_NODES_FAMILY;
if (myDoGroupOfEdges) myEdgesDefaultFamilyId = REST_EDGES_FAMILY;
if (myDoGroupOfFaces) myFacesDefaultFamilyId = REST_FACES_FAMILY;
const EBooleen theIsElemNames = eFAUX;
const EConnectivite theConnMode = eNOD;
- TInt aNbNodes = myMesh->NbNodes();
+ TInt aNbNodes = FromIdType<TInt>( myMesh->NbNodes() );
PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes,
theMode, theSystem, theIsElemNum, theIsElemNames);
aTCoordSlice[2] = 0.;
// node number
- int aNodeID = aCoordHelperPtr->GetID();
+ TInt aNodeID = FromIdType<TInt>( aCoordHelperPtr->GetID() );
aNodeInfo->SetElemNum( iNode, aNodeID );
#ifdef _EDF_NODE_IDS_
aNodeIdMap.insert( aNodeIdMap.end(), make_pair( aNodeID, iNode+1 ));
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eBALL,
- nbElemInfo.NbBalls(),
+ FromIdType<TInt>(nbElemInfo.NbBalls()),
SMDSAbs_Ball));
#ifdef _ELEMENTS_BY_DIM_
anEntity = eARETE;
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eSEG2,
- nbElemInfo.NbEdges( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbEdges( ORDER_LINEAR )),
SMDSAbs_Edge));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eSEG3,
- nbElemInfo.NbEdges( ORDER_QUADRATIC ),
+ FromIdType<TInt>(nbElemInfo.NbEdges( ORDER_QUADRATIC )),
SMDSAbs_Edge));
#ifdef _ELEMENTS_BY_DIM_
anEntity = eFACE;
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA3,
- nbElemInfo.NbTriangles( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbTriangles( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA6,
- nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
- nbElemInfo.NbBiQuadTriangles(),
+ FromIdType<TInt>(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
+ nbElemInfo.NbBiQuadTriangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA7,
- nbElemInfo.NbBiQuadTriangles(),
+ FromIdType<TInt>(nbElemInfo.NbBiQuadTriangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD4,
- nbElemInfo.NbQuadrangles( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD8,
- nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
- nbElemInfo.NbBiQuadQuadrangles(),
+ FromIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
+ nbElemInfo.NbBiQuadQuadrangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD9,
- nbElemInfo.NbBiQuadQuadrangles(),
+ FromIdType<TInt>(nbElemInfo.NbBiQuadQuadrangles()),
SMDSAbs_Face));
if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE,
- nbElemInfo.NbPolygons( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
SMDSAbs_Face));
// we need one more loop on poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE,
- nbElemInfo.NbPolygons( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2,
- nbElemInfo.NbPolygons( ORDER_QUADRATIC ),
+ FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
SMDSAbs_Face));
// we need one more loop on QUAD poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2,
- nbElemInfo.NbPolygons( ORDER_QUADRATIC ),
+ FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
SMDSAbs_Face));
}
#ifdef _ELEMENTS_BY_DIM_
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTETRA4,
- nbElemInfo.NbTetras( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbTetras( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTETRA10,
- nbElemInfo.NbTetras( ORDER_QUADRATIC ),
+ FromIdType<TInt>(nbElemInfo.NbTetras( ORDER_QUADRATIC )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePYRA5,
- nbElemInfo.NbPyramids( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbPyramids( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePYRA13,
- nbElemInfo.NbPyramids( ORDER_QUADRATIC ),
+ FromIdType<TInt>(nbElemInfo.NbPyramids( ORDER_QUADRATIC )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA6,
- nbElemInfo.NbPrisms( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbPrisms( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA15,
- nbElemInfo.NbQuadPrisms(),
+ FromIdType<TInt>(nbElemInfo.NbQuadPrisms()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA18,
- nbElemInfo.NbBiQuadPrisms(),
+ FromIdType<TInt>(nbElemInfo.NbBiQuadPrisms()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA8,
- nbElemInfo.NbHexas( ORDER_LINEAR ),
+ FromIdType<TInt>(nbElemInfo.NbHexas( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA20,
- nbElemInfo.NbHexas( ORDER_QUADRATIC )-
- nbElemInfo.NbTriQuadHexas(),
+ FromIdType<TInt>(nbElemInfo.NbHexas( ORDER_QUADRATIC )-
+ nbElemInfo.NbTriQuadHexas()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA27,
- nbElemInfo.NbTriQuadHexas(),
+ FromIdType<TInt>(nbElemInfo.NbTriQuadHexas()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eOCTA12,
- nbElemInfo.NbHexPrisms(),
+ FromIdType<TInt>(nbElemInfo.NbHexPrisms()),
SMDSAbs_Volume));
if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYEDRE,
- nbElemInfo.NbPolyhedrons(),
+ FromIdType<TInt>(nbElemInfo.NbPolyhedrons()),
SMDSAbs_Volume));
// we need one more loop on poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYEDRE,
- nbElemInfo.NbPolyhedrons(),
+ FromIdType<TInt>(nbElemInfo.NbPolyhedrons()),
SMDSAbs_Volume));
}
for(TInt iNode = 0; iNode < aNbNodes; iNode++) {
const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
#ifdef _EDF_NODE_IDS_
- aTConnSlice[ iNode ] = aNodeIdMap[aNode->GetID()];
+ aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
#else
aTConnSlice[ iNode ] = aNode->GetID();
#endif
}
// element number
- aPolygoneInfo->SetElemNum( iElem, anElem->GetID() );
+ aPolygoneInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
while ( nodeIt->more() ) {
const SMDS_MeshElement* aNode = nodeIt->next();
#ifdef _EDF_NODE_IDS_
- conn[ iNode ] = aNodeIdMap[aNode->GetID()];
+ conn[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
#else
conn[ iNode ] = aNode->GetID();
#endif
++iNode;
}
// element number
- aPolyhInfo->SetElemNum( iElem, anElem->GetID() );
+ aPolyhInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
// connectivity
const SMDS_MeshElement* aNode = anElem->GetNode( 0 );
#ifdef _EDF_NODE_IDS_
- (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[aNode->GetID()];
+ (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
#else
(*aBallInfo->myConn)[ iElem ] = aNode->GetID();
#endif
// element number
- aBallInfo->SetElemNum( iElem, anElem->GetID() );
+ aBallInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
// diameter
aBallInfo->myDiameters[ iElem ] =
for (TInt iNode = 0; iNode < aNbNodes; iNode++) {
const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
#ifdef _EDF_NODE_IDS_
- aTConnSlice[ iNode ] = aNodeIdMap[aNode->GetID()];
+ aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
#else
aTConnSlice[ iNode ] = aNode->GetID();
#endif
}
// element number
- aCellInfo->SetElemNum( iElem, anElem->GetID() );
+ aCellInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
{
Kernel_Utils::Localizer loc;
Status aResult = DRS_OK;
+
+ if ( Driver_Mesh::IsMeshTooLarge< int >( myMesh, /*checkIDs =*/ false))
+ return DRS_TOO_LARGE_MESH;
+
#if defined(WIN32) && defined(UNICODE)
std::wstring aFile = Kernel_Utils::utf8_decode_s(myFile);
std::ofstream out_stream(aFile.c_str());
{
const SMDS_MeshNode* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() )
- aRec.node_labels.push_back( aNode->GetID() );
+ aRec.node_labels.push_back( FromIdType<int>(aNode->GetID()) );
else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
for ( aRec.node_labels.clear(); aNodesIter->more(); ) {
const SMDS_MeshNode* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() )
- aRec.node_labels.push_back( aNode->GetID() );
+ aRec.node_labels.push_back( FromIdType<int>(aNode->GetID()) );
else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
{
const SMDS_MeshElement* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() )
- aRec.node_labels.push_back( aNode->GetID() );
+ aRec.node_labels.push_back( FromIdType<int>(aNode->GetID()) );
else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
while ( aIter->more() ) {
const SMDS_MeshElement* aNode = aIter->next();
if ( nodeLabelByID.empty() )
- aRec.NodeList.push_back( aNode->GetID() );
+ aRec.NodeList.push_back( FromIdType<int>(aNode->GetID()) );
else
aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]);
}
while ( aIter->more() ) {
const SMDS_MeshElement* aElem = aIter->next();
if ( elemLabelByID.empty() )
- aRec.ElementList.push_back( aElem->GetID() );
+ aRec.ElementList.push_back( FromIdType<int>(aElem->GetID()) );
else
aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]);
}
EXCEPTION(runtime_error,"ERROR: Output file not good.");
}
catch(const std::exception& exc){
- INFOS("Follow exception was cought:\n\t"<<exc.what());
+ INFOS("Follow exception was caught:\n\t"<<exc.what());
throw;
}
catch(...){
- INFOS("Unknown exception was cought !!!");
+ INFOS("Unknown exception was caught !!!");
throw;
}
return aResult;
class MESHDRIVERUNV_EXPORT DriverUNV_W_SMDS_Mesh: public Driver_SMDS_Mesh
{
public:
- virtual Status Perform();
+
+ virtual Status Perform() override;
void AddGroup(SMESHDS_GroupBase* theGroup) { myGroups.push_back(theGroup); }
#include <map>
#include <med.h>
+#include <smIdType.hxx>
#ifdef WIN32
#pragma warning(disable:4099)
typedef enum {eCOOR, eCONN, eNOM, eNUM, eFAM, eCOOR_IND1, eCOOR_IND2, eCOOR_IND3} ETable;
typedef TVector<TInt> TIntVector;
+ typedef TVector<smIdType> TIDVector;
typedef TVector<TFloat> TFloatVector;
typedef TVector<std::string> TStringVector;
typedef std::set<std::string> TStringSet;
myIsFacesOriented = false;
- int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement();
- int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
+ float controlsIncrement = (float) SMESH_ActorProps::props()->controlsIncrement();
+ float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement();
myControlsPrecision = -1;
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
- double aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
- double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10);
- double aBallElemScale = SMESH::GetFloat("SMESH:ball_elem_scale",1.0);
- double aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
- double aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1);
+ float aElem0DSize = (float) SMESH::GetFloat("SMESH:elem0d_size",5);
+ float aBallElemSize = (float) SMESH::GetFloat("SMESH:ball_elem_size",10);
+ float aBallElemScale = (float) SMESH::GetFloat("SMESH:ball_elem_scale",1.0);
+ float aLineWidth = (float) SMESH::GetFloat("SMESH:element_width",1);
+ float aOutlineWidth = (float) SMESH::GetFloat("SMESH:outline_width",1);
SMESH::LabelFont aFamilyNd = SMESH::FntTimes;
bool aBoldNd = true;
return;
}
- int aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0;
+ smIdType aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0;
bool aShowOnlyScalarBarTitle = false;
if(aNbCells) {
//myControlMode = theMode;
//Update();
}
-int SMESH_ActorDef::GetNumberControlEntities()
+smIdType SMESH_ActorDef::GetNumberControlEntities()
{
SMESH_DeviceActor* anAct = NULL;
switch(myControlMode){
break;
default:;
}
- return (anAct) ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1;
+ return anAct ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1;
}
void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer)
}
-int SMESH_ActorDef::GetNodeObjId(int theVtkID)
+vtkIdType SMESH_ActorDef::GetNodeObjId(vtkIdType theVtkID)
{
return myPickableActor->GetNodeObjId(theVtkID);
}
-double* SMESH_ActorDef::GetNodeCoord(int theObjID)
+double* SMESH_ActorDef::GetNodeCoord(vtkIdType theObjID)
{
return myPickableActor->GetNodeCoord(theObjID);
}
-int SMESH_ActorDef::GetNodeVtkId(int theObjID)
+vtkIdType SMESH_ActorDef::GetNodeVtkId(vtkIdType theObjID)
{
return myPickableActor->GetNodeVtkId(theObjID);
}
-int SMESH_ActorDef::GetElemObjId(int theVtkID)
+vtkIdType SMESH_ActorDef::GetElemObjId(vtkIdType theVtkID)
{
return myPickableActor->GetElemObjId(theVtkID);
}
-vtkCell* SMESH_ActorDef::GetElemCell(int theObjID)
+vtkCell* SMESH_ActorDef::GetElemCell(vtkIdType theObjID)
{
return myPickableActor->GetElemCell(theObjID);
}
void SMESH_ActorDef::SetRepresentation (int theMode)
{
- int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
- int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
- int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
- int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
- int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
+ smIdType aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
+ smIdType aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
+ smIdType aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
+ smIdType aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
+ smIdType aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
if ( myRepresentationCache && aNbEdges + aNbFaces + aNbVolumes + aNb0Ds + aNbBalls )
{
myPickableActor = myBaseActor;
vtkProperty *aProp = NULL, *aBackProp = 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();
switch (myRepresentation) {
case ePoint:
{
QColor selectionColor = SMESH_ActorProps::props()->selectionColor();
QColor highlightColor = SMESH_ActorProps::props()->highlightColor();
- int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
- double width = GetLineWidth();
+ float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement();
+ float width = (float) GetLineWidth();
myHighlightProp->SetColor(selectionColor.redF(), selectionColor.greenF(), selectionColor.blueF());
myHighlightProp->SetLineWidth(width + selectionIncrement);
myPreselectProp->SetColor(highlightColor.redF(), highlightColor.greenF(), highlightColor.blueF());
void SMESH_ActorDef::SetLineWidth(double theVal)
{
- int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement();
- int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
+ float controlsIncrement = (float) SMESH_ActorProps::props()->controlsIncrement();
+ float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement();
- myEdgeProp->SetLineWidth(theVal);
+ myEdgeProp->SetLineWidth((float) theVal);
- my1DProp->SetLineWidth(theVal + controlsIncrement);
- my1DExtProp->SetLineWidth(theVal + controlsIncrement);
- my2DExtProp->SetLineWidth(theVal + controlsIncrement);
- my3DExtProp->SetLineWidth(theVal + controlsIncrement);
- myHighlightProp->SetLineWidth(theVal + selectionIncrement);
- myPreselectProp->SetLineWidth(theVal + selectionIncrement);
+ my1DProp ->SetLineWidth((float) theVal + controlsIncrement);
+ my1DExtProp ->SetLineWidth((float) theVal + controlsIncrement);
+ my2DExtProp ->SetLineWidth((float) theVal + controlsIncrement);
+ my3DExtProp ->SetLineWidth((float) theVal + controlsIncrement);
+ myHighlightProp->SetLineWidth((float) theVal + selectionIncrement);
+ myPreselectProp->SetLineWidth((float) theVal + selectionIncrement);
Modified();
}
void SMESH_ActorDef::SetOutlineWidth(double theVal)
{
- myOutLineProp->SetLineWidth(theVal);
+ myOutLineProp->SetLineWidth((float) theVal);
Modified();
}
void SMESH_ActorDef::Set0DSize(double theVal)
{
- my0DProp->SetPointSize(theVal);
- myHighlightProp->SetPointSize(theVal);
- myPreselectProp->SetPointSize(theVal);
+ my0DProp ->SetPointSize((float) theVal);
+ myHighlightProp->SetPointSize((float) theVal);
+ myPreselectProp->SetPointSize((float) theVal);
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
- aCustom->Set0DSize(theVal);
+ aCustom->Set0DSize((float) theVal);
}
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) {
- aCustom->Set0DSize(theVal);
+ aCustom->Set0DSize((float) theVal);
}
Modified();
void SMESH_ActorDef::SetBallSize(double theVal)
{
- myBallProp->SetPointSize(theVal);
+ myBallProp->SetPointSize((float) theVal);
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) {
- aCustom->SetBallSize(theVal);
+ aCustom->SetBallSize((float) theVal);
}
if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) {
- aCustom->SetBallSize(theVal);
+ aCustom->SetBallSize((float) theVal);
}
Modified();
Modified();
}
-int SMESH_ActorDef::GetObjDimension( const int theObjId )
+int SMESH_ActorDef::GetObjDimension( const vtkIdType theObjId )
{
return myVisualObj->GetElemDimension( theObjId );
}
SMESH_VisualObjDef::TEntityList elems;
if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get()))
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)
elemIds.push_back( (*e)->GetID());
vtkLookupTable* lookupTable = static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
SMESH_VisualObjDef::TEntityList elems;
if ( dynamic_cast<SMESH_SubMeshObj*>(myVisualObj.get()))
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)
elemIds.push_back( (*e)->GetID());
virtual void SetControl(SMESH::Controls::FunctorPtr) = 0;
virtual eControl GetControlMode() = 0;
virtual SMESH::Controls::FunctorPtr GetFunctor() = 0;
- virtual int GetNumberControlEntities() = 0;
+ virtual smIdType GetNumberControlEntities() = 0;
virtual SMESH_ScalarBarActor* GetScalarBarActor() = 0;
virtual void SetBallScale(double size);
virtual double GetBallScale();
- virtual int GetNodeObjId(int theVtkID);
- virtual double* GetNodeCoord(int theObjID);
- virtual int GetNodeVtkId(int theObjID);
+ virtual vtkIdType GetNodeObjId(vtkIdType theVtkID);
+ virtual double* GetNodeCoord(vtkIdType theObjID);
+ virtual vtkIdType GetNodeVtkId(vtkIdType theObjID);
- virtual int GetElemObjId(int theVtkID);
- virtual vtkCell* GetElemCell(int theObjID);
+ virtual vtkIdType GetElemObjId(vtkIdType theVtkID);
+ virtual vtkCell* GetElemCell(vtkIdType theObjID);
- virtual int GetObjDimension( const int theObjId );
+ virtual int GetObjDimension( const vtkIdType theObjId ) override;
virtual void SetVisibility(int theMode);
void SetVisibility(int theMode, bool theIsUpdateRepersentation);
virtual void SetControlMode(eControl theMode);
virtual void SetControl(SMESH::Controls::FunctorPtr theFunctor);
- virtual int GetNumberControlEntities();
+ virtual smIdType GetNumberControlEntities();
virtual eControl GetControlMode(){ return myControlMode;}
virtual SMESH::Controls::FunctorPtr GetFunctor() { return myFunctor; }
}
}
- std::map<SMDSAbs_ElementType,int> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
- std::map<SMDSAbs_ElementType,int> entities;
- entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_0DElement,
+ std::map<SMDSAbs_ElementType,smIdType> GetEntitiesFromObject(SMESH_VisualObj *theObject) {
+ std::map<SMDSAbs_ElementType,smIdType> entities;
+ entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_0DElement,
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));
- entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Edge,
+ entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Edge,
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));
- entities.insert(std::pair<SMDSAbs_ElementType,int>(SMDSAbs_Volume,
+ entities.insert(std::pair<SMDSAbs_ElementType,smIdType>(SMDSAbs_Volume,
theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0));
return entities;
}
QString def);
SMESHOBJECT_EXPORT
- std::map<SMDSAbs_ElementType,int>
+ std::map<SMDSAbs_ElementType,smIdType>
GetEntitiesFromObject(SMESH_VisualObj *theObject);
SMESHOBJECT_EXPORT
#include <vtkRenderer.h>
#include <vtkUnstructuredGrid.h>
#include <vtkCellData.h>
+#include <iostream>
vtkStandardNewMacro(SMESH_CellLabelActor)
myClsLabeledDataMapper = vtkLabeledDataMapper::New();
myClsLabeledDataMapper->SetInputConnection(myClsSelectVisiblePoints->GetOutputPort());
- myClsLabeledDataMapper->SetLabelFormat("%d");
+ //myClsLabeledDataMapper->SetLabelFormat("%d");
myClsLabeledDataMapper->SetLabelModeToLabelScalars();
myClsTextProp = vtkTextProperty::New();
{
myCellsNumDataSet->ShallowCopy(aGrid);
vtkUnstructuredGrid *aDataSet = myCellsNumDataSet;
- int aNbElem = aDataSet->GetNumberOfCells();
- vtkIntArray *anArray = vtkIntArray::New();
+ vtkIdType aNbElem = aDataSet->GetNumberOfCells();
+ vtkIdTypeArray *anArray = vtkIdTypeArray::New();
anArray->SetNumberOfValues(aNbElem);
myExtractUnstructuredGrid->BuildOut2InMap();
- for(int anId = 0; anId < aNbElem; anId++)
+ for(vtkIdType anId = 0; anId < aNbElem; anId++)
{
vtkIdType id = anId;
if(IsImplicitFunctionUsed())
id = myExtractGeometry->GetElemObjId(id);
id = myExtractUnstructuredGrid->GetInputId(id);
id = (id >=0) ? id : anId;
- int aSMDSId = myVisualObj->GetElemObjId(id);
+ vtkIdType aSMDSId = myVisualObj->GetElemObjId(id);
anArray->SetValue(anId,aSMDSId);
}
aDataSet->GetCellData()->SetScalars(anArray);
#include "SMESH_ControlsDef.hxx"
#include "SMESH_ActorUtils.h"
#include "SMESH_FaceOrientationFilter.h"
-#include "VTKViewer_CellLocationsArray.h"
+//#include "VTKViewer_CellLocationsArray.h"
#include "VTKViewer_PolyDataMapper.h"
#include <VTKViewer_Transform.h>
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();
myShrinkFilter->Delete();
aCellTypesArray->SetNumberOfTuples( aNbCells );
aScalars->SetNumberOfTuples( aNbCells );
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells );
aCellTypesArray->SetNumberOfTuples( aNbCells );
aScalars->SetNumberOfTuples( aNbCells );
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells );
}
}
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells );
( aPredicate = dynamic_cast<CoincidentNodes*>(theFunctor.get())))
{
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
- vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node);
+ vtkIdType aNbNodes = FromIdType<vtkIdType>(myVisualObj->GetNbEntities(SMDSAbs_Node));
for( vtkIdType i = 0; i < aNbNodes; i++ ){
vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
if(aPredicate->IsSatisfy(anObjId))
myGeomFilter->SetInside(false);
myGeomFilter->SetWireframeMode(false);
GetProperty()->SetRepresentation(theMode);
+ case eNoneRepr:
+ return;
}
SetMarkerEnabled(theMode == ePoint);
myRepresentation = theMode;
}
-int
+vtkIdType
SMESH_DeviceActor
-::GetNodeObjId(int theVtkID)
+::GetNodeObjId(vtkIdType theVtkID)
{
vtkIdType anID = theVtkID;
double*
SMESH_DeviceActor
-::GetNodeCoord(int theObjID)
+::GetNodeCoord(vtkIdType theObjID)
{
vtkDataSet* aDataSet = myMergeFilter->GetOutput();
vtkIdType anID = myVisualObj->GetNodeVTKId(theObjID);
return aCoord;
}
-int
+vtkIdType
SMESH_DeviceActor
-::GetNodeVtkId(int theObjID)
+::GetNodeVtkId(vtkIdType theObjID)
{
return myVisualObj->GetNodeVTKId(theObjID);
}
-int
+vtkIdType
SMESH_DeviceActor
-::GetElemObjId(int theVtkID)
+::GetElemObjId(vtkIdType theVtkID)
{
vtkIdType anId = myGeomFilter->GetElemObjId(theVtkID);
if(anId < 0)
vtkCell*
SMESH_DeviceActor
-::GetElemCell(int theObjID)
+::GetElemCell(vtkIdType theObjID)
{
vtkDataSet* aDataSet = myVisualObj->GetUnstructuredGrid();
vtkIdType aGridID = myVisualObj->GetElemVTKId(theObjID);
void SetStoreGemetryMapping(bool theStoreMapping);
void SetStoreIDMapping(bool theStoreMapping);
- virtual int GetNodeObjId(int theVtkID);
- virtual double* GetNodeCoord(int theObjID);
- virtual int GetNodeVtkId(int theObjID);
+ virtual vtkIdType GetNodeObjId(vtkIdType theVtkID);
+ virtual double* GetNodeCoord(vtkIdType theObjID);
+ virtual vtkIdType GetNodeVtkId(vtkIdType theObjID);
- virtual int GetElemObjId(int theVtkID);
- virtual vtkCell* GetElemCell(int theObjID);
+ virtual vtkIdType GetElemObjId(vtkIdType theVtkID);
+ virtual vtkCell* GetElemCell(vtkIdType theObjID);
virtual void SetTransform(VTKViewer_Transform* theTransform);
virtual vtkMTimeType GetMTime();
void SetShrink();
void UnShrink();
- enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe};
+ enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe, eNoneRepr=-1};
EReperesent GetRepresentation(){ return myRepresentation;}
void SetRepresentation(EReperesent theMode);
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];
}
-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];
}
}
bool GetStoreMapping(){ return myStoreMapping;}
- virtual vtkIdType GetNodeObjId(int theVtkID);
- virtual vtkIdType GetElemObjId(int theVtkID);
+ virtual vtkIdType GetNodeObjId(vtkIdType theVtkID);
+ virtual vtkIdType GetElemObjId(vtkIdType theVtkID);
protected:
SMESH_ExtractGeometry();
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort());
- myPtsLabeledDataMapper->SetLabelFormat("%d");
+ //myPtsLabeledDataMapper->SetLabelFormat("%d");
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
myPtsTextProp = vtkTextProperty::New();
{
myPointsNumDataSet->ShallowCopy(aGrid);
vtkUnstructuredGrid *aDataSet = myPointsNumDataSet;
-
- int aNbElem = aDataSet->GetNumberOfPoints();
-
- vtkIntArray *anArray = vtkIntArray::New();
+
+ vtkIdType aNbElem = aDataSet->GetNumberOfPoints();
+
+ vtkIdTypeArray *anArray = vtkIdTypeArray::New();
anArray->SetNumberOfValues( aNbElem );
-
+
for ( vtkIdType anId = 0; anId < aNbElem; anId++ )
{
- int aSMDSId = myVisualObj->GetNodeObjId( anId );
+ vtkIdType aSMDSId = myVisualObj->GetNodeObjId( anId );
anArray->SetValue( anId, aSMDSId );
}
-
+
aDataSet->GetPointData()->SetScalars( anArray );
myPtsMaskPoints->SetInputData( aDataSet );
myPointLabels->SetVisibility( GetVisibility() );
#include <SalomeApp_Application.h>
#include <VTKViewer_ExtractUnstructuredGrid.h>
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
#include CORBA_SERVER_HEADER(SMESH_Gen)
#include CORBA_SERVER_HEADER(SALOME_Exception)
// functions : GetNodeObjId, GetNodeVTKId, GetElemObjId, GetElemVTKId
// 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( this->GetMesh() )
aNode = this->GetMesh()->FindNodeVtk( theVTKID );
- return aNode ? aNode->GetID() : -1;
+ return aNode ? FromIdType<vtkIdType>(aNode->GetID()) : -1;
}
-vtkIdType SMESH_VisualObjDef::GetNodeVTKId( int theObjID )
+vtkIdType SMESH_VisualObjDef::GetNodeVTKId( vtkIdType theObjID )
{
if (myLocalGrid)
{
return aNode ? aNode->GetVtkID() : -1;
}
-vtkIdType SMESH_VisualObjDef::GetElemObjId( int theVTKID )
+vtkIdType SMESH_VisualObjDef::GetElemObjId( vtkIdType theVTKID )
{
if (myLocalGrid)
{
TMapOfIds::const_iterator i = myVTK2SMDSElems.find(theVTKID);
return i == myVTK2SMDSElems.end() ? -1 : i->second;
}
- return this->GetMesh()->FromVtkToSmds(theVTKID);
+ return FromIdType<vtkIdType>(this->GetMesh()->FromVtkToSmds(theVTKID));
}
-vtkIdType SMESH_VisualObjDef::GetElemVTKId( int theObjID )
+vtkIdType SMESH_VisualObjDef::GetElemVTKId( vtkIdType theObjID )
{
if (myLocalGrid)
{
return;
TEntityList aNodes;
- vtkIdType nbNodes = GetEntities( SMDSAbs_Node, aNodes );
+ vtkIdType nbNodes = FromIdType<vtkIdType>(GetEntities( SMDSAbs_Node, aNodes ));
thePoints->SetNumberOfPoints( nbNodes );
int nbPoints = 0;
if ( aNode != 0 )
{
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 ));
myVTK2SMDSNodes.insert( myVTK2SMDSNodes.end(), std::make_pair( nbPoints, anId ));
nbPoints++;
theConnect.clear();
for(; theNodesIter->more();)
theConnect.push_back(theNodesIter->next());
- return theConnect.size();
+ return (int) theConnect.size();
}
inline
const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes,
const TConnect& theConnect,
int thePosition,
- int theId)
+ vtkIdType theId)
{
theIdList->SetId(thePosition,theSMDS2VTKNodes.find(theConnect[theId]->GetID())->second);
}
{ SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, SMDSAbs_Ball, SMDSAbs_0DElement };
// get entity data
- map<SMDSAbs_ElementType,int> nbEnts;
+ map<SMDSAbs_ElementType,smIdType> nbEnts;
map<SMDSAbs_ElementType,TEntityList> anEnts;
vtkIdType aNbCells = 0;
vtkIdType aNbNodes = anElem->NbNodes();
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 ));
myVTK2SMDSElems.insert( myVTK2SMDSElems.end(), std::make_pair( iElem, anId ));
anIdList->InsertNextId(ph->NbFaceNodes(i));
for(int j = 1; j <= ph->NbFaceNodes(i); j++) {
if ( const SMDS_MeshNode* n = ph->GetFaceNode( i, j ))
- anIdList->InsertNextId( mySMDS2VTKNodes[ n->GetID() ]);
+ anIdList->InsertNextId( mySMDS2VTKNodes[ FromIdType<vtkIdType>(n->GetID()) ]);
}
}
}
if (aConnectivities.size() > 0) {
aConnect.clear();
GetConnect(aNodesIter,aConnect);
- for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
+ for (int aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
}
else {
for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
const SMDS_MeshElement* aNode = aNodesIter->next();
- anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] );
+ anIdList->SetId( aNodeId, mySMDS2VTKNodes[FromIdType<vtkIdType>(aNode->GetID())] );
}
}
}
// Insert cells in grid
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells );
// function : GetEdgeNodes
// purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 0 )
//=================================================================================
-bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
- const int theEdgeNum,
- int& theNodeId1,
- int& theNodeId2 ) const
+bool SMESH_VisualObjDef::GetEdgeNodes( const smIdType theElemId,
+ const int theEdgeNum,
+ smIdType& theNodeId1,
+ smIdType& theNodeId2 ) const
{
const SMDS_Mesh* aMesh = GetMesh();
if ( aMesh == 0 )
unsigned int tmp = myEntitiesState;
ClearEntitiesFlags();
- map<SMDSAbs_ElementType,int> entities = SMESH::GetEntitiesFromObject(this);
+ map<SMDSAbs_ElementType,smIdType> entities = SMESH::GetEntitiesFromObject(this);
if( myEntitiesCache[SMDSAbs_0DElement] != 0 ||
// function : GetElemDimension
// 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 );
if ( anElem == 0 )
// function : GetEntities
// 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 )
{
}
}
-int SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const
+smIdType SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const
{
theObjs.clear();
// function : GetElemDimension
// 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 );
}
// function : getNodesFromElems
// 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,
std::list<const SMDS_MeshElement*>& theResList )
{
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 ] );
if ( anElem != 0 )
}
}
- set<const SMDS_MeshElement*>::const_iterator anIter;
- for ( anIter = aNodeSet.begin(); anIter != aNodeSet.end(); ++anIter )
- theResList.push_back( *anIter );
+ theResList.assign( aNodeSet.begin(), aNodeSet.end() );
- return theResList.size();
+ return (int) aNodeSet.size();
}
//=================================================================================
// purpose : Get std::list<const SMDS_MeshElement*> from list of IDs
//=================================================================================
static int getPointers( const SMDSAbs_ElementType theRequestType,
- SMESH::long_array_var& theElemIds,
+ SMESH::smIdType_array_var& theElemIds,
const SMDS_Mesh* theMesh,
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
? theMesh->FindNode( theElemIds[ i ] ) : theMesh->FindElement( theElemIds[ i ] );
theResList.push_back( anElem );
}
- return theResList.size();
+ return (int) theResList.size();
}
// function : GetEntities
// 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) {
return myGroupServer->Size();
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();
SMDS_Mesh* aMesh = myMeshObj->GetMesh();
-
+
if ( aMesh == 0 )
return 0;
if ( aGrpType != theType && theType != SMDSAbs_Node )
return 0;
- SMESH::long_array_var anIds = myGroupServer->GetListOfID();
+ SMESH::smIdType_array_var anIds = myGroupServer->GetListOfID();
if ( anIds->length() == 0 )
return 0;
// function : GetEntities
// 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 )
{
case SMDSAbs_Face:
case SMDSAbs_Volume:
{
- SMESH::long_array_var anIds =
+ SMESH::smIdType_array_var anIds =
mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
return anIds->length();
}
}
}
-int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const
+smIdType SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const
{
theResList.clear();
{
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 );
}
}
{
if ( theType == SMDSAbs_Node )
{
- SMESH::long_array_var anIds = mySubMeshServer->GetElementsId();
+ SMESH::smIdType_array_var anIds = mySubMeshServer->GetElementsId();
return getNodesFromElems( anIds, aMesh, theResList );
}
else
{
- SMESH::long_array_var anIds =
+ SMESH::smIdType_array_var anIds =
mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
return getPointers( theType, anIds, aMesh, theResList );
}
#include "SMDSAbs_ElementType.hxx"
#include <SALOMEconfig.h>
+#include <smIdType.hxx>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
class SMDS_Mesh;
virtual bool Update( int theIsClear = true ) = 0;
virtual bool NulData() = 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 SMESH::SMESH_Mesh_ptr GetMeshServer() = 0;
- virtual bool GetEdgeNodes( const int theElemId,
- const int theEdgeNum,
- int& theNodeId1,
- int& theNodeId2 ) const = 0;
+ virtual bool GetEdgeNodes( const smIdType theElemId,
+ const int theEdgeNum,
+ smIdType& theNodeId1,
+ smIdType& theNodeId2 ) const = 0;
virtual bool IsValid() const = 0;
virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
- virtual vtkIdType GetNodeObjId( int theVTKID ) = 0;
- virtual vtkIdType GetNodeVTKId( int theObjID ) = 0;
- virtual vtkIdType GetElemObjId( int theVTKID ) = 0;
- virtual vtkIdType GetElemVTKId( int theObjID ) = 0;
+ virtual vtkIdType GetNodeObjId( vtkIdType theVTKID ) = 0;
+ virtual vtkIdType GetNodeVTKId( vtkIdType theObjID ) = 0;
+ virtual vtkIdType GetElemObjId( vtkIdType theVTKID ) = 0;
+ virtual vtkIdType GetElemVTKId( vtkIdType theObjID ) = 0;
virtual void ClearEntitiesFlags() = 0;
virtual bool GetEntitiesFlag() = 0;
virtual unsigned int GetEntitiesState() = 0;
virtual bool Update( int theIsClear = true ) = 0;
virtual bool NulData() {return 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 int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0;
+ virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
+ virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0;
virtual bool IsNodePrs() const = 0;
virtual SMDS_Mesh* GetMesh() const = 0;
virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0;
virtual bool IsValid() const;
- virtual bool GetEdgeNodes( const int theElemId,
- const int theEdgeNum,
- int& theNodeId1,
- int& theNodeId2 ) const;
+ virtual bool GetEdgeNodes( const smIdType theElemId,
+ const int theEdgeNum,
+ smIdType& theNodeId1,
+ smIdType& theNodeId2 ) const;
virtual vtkUnstructuredGrid* GetUnstructuredGrid();
- virtual vtkIdType GetNodeObjId( int theVTKID );
- virtual vtkIdType GetNodeVTKId( int theObjID );
- virtual vtkIdType GetElemObjId( int theVTKID );
- virtual vtkIdType GetElemVTKId( int theObjID );
+ virtual vtkIdType GetNodeObjId( vtkIdType theVTKID );
+ virtual vtkIdType GetNodeVTKId( vtkIdType theObjID );
+ virtual vtkIdType GetElemObjId( vtkIdType theVTKID );
+ virtual vtkIdType GetElemVTKId( vtkIdType theObjID );
virtual void ClearEntitiesFlags();
virtual bool GetEntitiesFlag();
unsigned int myEntitiesState;
vtkUnstructuredGrid* myGrid;
- std::map<SMDSAbs_ElementType,int> myEntitiesCache;
+ std::map<SMDSAbs_ElementType,smIdType> myEntitiesCache;
};
virtual bool Update( int theIsClear = true );
virtual bool NulData();
- virtual int GetNbEntities( const SMDSAbs_ElementType) const;
- virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
+ virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const;
+ virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) 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 bool Update( int theIsClear = true );
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 SMESH::SMESH_Mesh_ptr GetMeshServer() { return myMeshObj->GetMeshServer(); }
SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr, SMESH_MeshObj* );
virtual ~SMESH_GroupObj();
- virtual int GetNbEntities( const SMDSAbs_ElementType) const;
- virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
+ virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const;
+ virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
virtual bool IsNodePrs() const;
virtual SMDSAbs_ElementType GetElementType() const;
SMESH_MeshObj* );
virtual ~SMESH_subMeshObj();
- virtual int GetNbEntities( const SMDSAbs_ElementType) const;
- virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
+ virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const;
+ virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
virtual bool IsNodePrs() const;
protected:
void
SMESH_SVTKActor
::MapCells(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex)
+ const SVTK_TIndexedMapOfVtkId& theMapIndex)
{
myUnstructuredGrid->Initialize();
myUnstructuredGrid->Allocate();
cd = aSourceGrid->GetCellData();
}
outputCD->CopyAllocate(cd,aNbOfParts,aNbOfParts/2);
- for(int ind = 1; ind <= aNbOfParts; ind++){
- int aPartId = theMapIndex( ind );
+ for(int ind = 1; ind <= aNbOfParts; ind++)
+ {
+ vtkIdType aPartId = theMapIndex( ind );
if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
{
if (aCell->GetCellType() != VTK_POLYHEDRON)
//! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes
virtual void
MapCells(SALOME_Actor* theMapActor,
- const TColStd_IndexedMapOfInteger& theMapIndex);
+ const SVTK_TIndexedMapOfVtkId& theMapIndex);
//! To remove the actor an all its internal devices
#include "SMDS_CellOfNodes.hxx"
-SMDS_CellOfNodes::SMDS_CellOfNodes( int id, int shapeID )
+SMDS_CellOfNodes::SMDS_CellOfNodes( smIdType id, int shapeID )
: myID( id )
{
setShapeID( shapeID );
}
-void SMDS_CellOfNodes::setID(const int id)
+void SMDS_CellOfNodes::setID(const smIdType id)
{
myID = id;
}
-int SMDS_CellOfNodes::GetID() const
+smIdType SMDS_CellOfNodes::GetID() const
{
return myID;
}
#include "SMDS_MeshElement.hxx"
+#include <smIdType.hxx>
+
// ============================================================
/*!
* \brief Base class for elements not contained in the mesh
{
public:
- virtual int GetID() const;
- virtual int GetShapeID() const;
+ virtual smIdType GetID() const;
+ virtual int GetShapeID() const;
virtual void setIsMarked( bool is ) const;
virtual bool isMarked() const;
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 );
- int myID;
- int myShapeID;
+ smIdType myID;
+ int myShapeID;
enum Bits { // use the 1st right bit of myShapeId to set/unset a mark
BIT_IS_MARKED = 1,
#include <vtkCellType.h>
#include <vtkCellLinks.h>
+#include <smIdType.hxx>
#include <map>
_cellIds.resize(_nbDownCells * _maxId);
_vtkCellIds.resize(_maxId);
- int sizeUpCells = 0;
+ smIdType sizeUpCells = 0;
for (int i = 0; i < _maxId; i++)
sizeUpCells += _upCellIdsVector[i].size();
_upCellIds.resize(sizeUpCells, -1);
void SMDS_Down1D::addUpCell(int cellId, int upCellId, unsigned char aType)
{
//ASSERT((cellId >=0) && (cellId < _maxId));
- int nbFaces = _upCellIdsVector[cellId].size();
- for (int i = 0; i < nbFaces; i++)
+ smIdType nbFaces = _upCellIdsVector[cellId].size();
+ for (smIdType i = 0; i < nbFaces; i++)
{
if ((_upCellIdsVector[cellId][i] == upCellId) && (_upCellTypesVector[cellId][i] == aType))
{
//================================================================================
/*!
* \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() )
{
- int id0 = myChunks.size() * theChunkSize + 1;
+ smIdType id0 = myChunks.size() * theChunkSize + 1;
myChunks.push_back( new SMDS_ElementChunk( this, id0 ));
}
SMDS_ElementChunk * chunk = (*myChunksWithUnused.begin());
//================================================================================
/*!
* \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;
- 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 ))
{
int index = usedRanges.back().second-1;
//================================================================================
/*!
* \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;
for ( size_t i = 0; i < myChunks.size(); ++i )
if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges ))
*/
//================================================================================
-SMDS_MeshElement* SMDS_ElementFactory::NewElement( const int id )
+SMDS_MeshElement* SMDS_ElementFactory::NewElement( const smIdType id )
{
- int iChunk = ( id - 1 ) / theChunkSize;
- int index = ( id - 1 ) % theChunkSize;
- while ((int) myChunks.size() <= iChunk )
+ smIdType iChunk = ( id - 1 ) / theChunkSize;
+ smIdType index = ( id - 1 ) % theChunkSize;
+ 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 ));
}
- SMDS_MeshElement* e = myChunks[iChunk].Element( index );
+ SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType<int>(index) );
if ( !e->IsNull() )
return 0; // element with given ID already exists
- myChunks[iChunk].UseElement( index );
+ myChunks[iChunk].UseElement( FromIdType<int>(index) );
++myNbUsedElements;
e->myHolder = & myChunks[iChunk];
*/
//================================================================================
-const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const int id ) const
+const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const smIdType id ) const
{
if ( id > 0 )
{
- int iChunk = ( id - 1 ) / theChunkSize;
- int index = ( id - 1 ) % theChunkSize;
- if ( iChunk < (int) myChunks.size() )
+ smIdType iChunk = ( id - 1 ) / theChunkSize;
+ smIdType index = ( id - 1 ) % theChunkSize;
+ if ( iChunk < (smIdType) myChunks.size() )
{
- const SMDS_MeshElement* e = myChunks[iChunk].Element( index );
+ const SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType<int>(index) );
return e->IsNull() ? 0 : e;
}
}
/*!
* \brief Return an SMDS ID by a Vtk one
* \param [inout] 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() )
return mySmdsIDs[vtkID] + 1;
*/
//================================================================================
-void SMDS_ElementFactory::Compact( std::vector<int>& theVtkIDsNewToOld )
+void SMDS_ElementFactory::Compact( std::vector<smIdType>& theVtkIDsNewToOld )
{
- int newNbCells = NbUsedElements();
- int maxCellID = GetMaxID();
- int newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize );
+ smIdType newNbCells = NbUsedElements();
+ smIdType maxCellID = GetMaxID();
+ smIdType newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize );
theVtkIDsNewToOld.resize( newNbCells );
}
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 )
theVtkIDsNewToOld[ newID ] = myVtkIDs[ newID ];
for ( ; newID < newNbCells; ++newID )
}
else // there are holes in SMDS IDs
{
- int newVtkID = 0; // same as new smds ID (-1)
- for ( int oldID = 1; oldID <= maxCellID; ++oldID ) // smds IDs
+ smIdType newVtkID = 0; // same as new smds ID (-1)
+ for ( smIdType oldID = 1; oldID <= maxCellID; ++oldID ) // smds IDs
{
const SMDS_MeshElement* oldElem = FindElement( oldID );
if ( !oldElem ) continue;
*/
//================================================================================
-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"
// in the chunks. So we remove holes and report relocation in theVtkIDsOldToNew:
// theVtkIDsOldToNew[ old VtkID ] = new VtkID
- int oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints();
- int newNbNodes = NbUsedElements();
- int newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize );
- int maxNodeID = GetMaxID();
+ smIdType oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints();
+ smIdType newNbNodes = NbUsedElements();
+ smIdType newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize );
+ smIdType maxNodeID = GetMaxID();
theVtkIDsOldToNew.resize( oldNbNodes, -1 );
const SMDS_MeshElement* newNode = FindElement( newID+1 );
if ( !newNode )
newNode = NewElement( newID+1 );
- int shapeID = oldNode->GetShapeID();
- int shapeDim = GetShapeDim( shapeID );
- int iChunk = newID / theChunkSize;
+ int shapeID = oldNode->GetShapeID();
+ int shapeDim = GetShapeDim( shapeID );
+ smIdType iChunk = newID / theChunkSize;
myChunks[ iChunk ].SetShapeID( newNode, shapeID );
if ( shapeDim == 2 || shapeDim == 1 )
{
- int iChunkOld = oldID / theChunkSize;
+ smIdType iChunkOld = oldID / theChunkSize;
TParam* oldPos = myChunks[ iChunkOld ].GetPositionPtr( oldNode );
TParam* newPos = myChunks[ iChunk ].GetPositionPtr( newNode, /*allocate=*/true );
if ( oldPos )
}
else // no holes
{
- for ( int i = 0; i < newNbNodes; ++i )
+ for ( smIdType i = 0; i < newNbNodes; ++i )
theVtkIDsOldToNew[ i ] = i;
}
myChunks.resize( newNbChunks );
*/
//================================================================================
-SMDS_ElementChunk::SMDS_ElementChunk( SMDS_ElementFactory* factory, int id0 ):
+SMDS_ElementChunk::SMDS_ElementChunk( SMDS_ElementFactory* factory, smIdType id0 ):
myFactory( factory ),
my1stID( id0 )//,
//mySubIDSet( 0 )
*/
//================================================================================
-int SMDS_ElementChunk::GetUnusedID() const
+smIdType SMDS_ElementChunk::GetUnusedID() const
{
TUsedRangeSet::set_iterator r = myUsedRanges.mySet.begin();
for ( ; r != myUsedRanges.mySet.end(); ++r )
*/
//================================================================================
-int SMDS_ElementChunk::GetID( const SMDS_MeshElement* e ) const
+smIdType SMDS_ElementChunk::GetID( const SMDS_MeshElement* e ) const
{
return my1stID + Index( e );
}
{
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 );
- for ( ; i < myFactory->myVtkIDs.size(); ++i )
+ vtkIdType newSize = (vtkIdType) myFactory->myVtkIDs.size();
+ for ( ; i < newSize; ++i )
myFactory->myVtkIDs[i] = i;
}
myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID;
*/
//================================================================================
-int SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const
+vtkIdType SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const
{
- size_t dfltVtkID = e->GetID() - 1;
- return ( dfltVtkID < myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID;
+ vtkIdType dfltVtkID = FromIdType<vtkIdType>(e->GetID() - 1);
+ return ( dfltVtkID < (vtkIdType)myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID;
}
//================================================================================
#include <vtkType.h>
+#include <smIdType.hxx>
+
class SMDS_ElementChunk;
class SMDS_Mesh;
class SMDS_MeshCell;
TChunkVector myChunks; // array of chunks of elements
TChunkPtrSet myChunksWithUnused; // sorted chunks having unused elements
std::vector< vtkIdType > myVtkIDs; // myVtkIDs[ smdsID-1 ] == vtkID
- std::vector< int > mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1
- int myNbUsedElements; // counter of elements
+ std::vector< smIdType > mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1
+ smIdType myNbUsedElements; // counter of elements
friend class SMDS_ElementChunk;
virtual ~SMDS_ElementFactory();
//! Return minimal ID of a non-used element
- int GetFreeID();
+ smIdType GetFreeID();
//! Return maximal ID of an used element
- int GetMaxID();
+ smIdType GetMaxID();
//! 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
- 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
- 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
- const SMDS_MeshElement* FindElement( const int id ) const;
+ const SMDS_MeshElement* FindElement( const smIdType id ) const;
//! 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.
// nbElemsToReturn is used to optimize by stopping the iteration as soon as
void Free( const SMDS_MeshElement* );
//! Return an SMDS ID by a Vtk one
- int FromVtkToSmds( vtkIdType vtkID );
+ smIdType FromVtkToSmds( vtkIdType vtkID );
//! De-allocate all elements
virtual void Clear();
//! Remove unused elements located not at the end of the last chunk.
// 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
virtual bool CompactChangePointers();
~SMDS_NodeFactory();
//! 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
- 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
void SetNbShapes( size_t nbShapes );
//! Remove unused nodes located not at the end of the last chunk.
// 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
virtual bool CompactChangePointers();
rNext = mySet.upper_bound( theIndex );
r = rNext - 1;
}
- int rSize = Size( r ); // range size
+ int rSize = Size( r ); // range size
attr_t rValue = r->myValue;
if ( rValue == theValue )
return rValue; // it happens while compacting
{
SMDS_ElementFactory* myFactory; // holder of this chunk
SMDS_MeshElement* myElements; // array of elements
- int my1stID; // ID of myElements[0]
+ smIdType my1stID; // ID of myElements[0]
TBitSet myMarkedSet; // mark some elements
TUsedRangeSet myUsedRanges; // ranges of used/unused elements
TSubIDRangeSet mySubIDRanges; // ranges of elements on the same sub-shape
public:
- SMDS_ElementChunk( SMDS_ElementFactory* factory = 0, int id0 = 0 );
+ SMDS_ElementChunk( SMDS_ElementFactory* factory = 0, smIdType id0 = 0 );
~SMDS_ElementChunk();
//! Return an element by an index [0,ChunkSize()]
const SMDS_MeshElement* Element(int index) const { return & myElements[index]; }
//! Return ID of the first non-used element
- int GetUnusedID() const;
+ smIdType GetUnusedID() const;
//! Mark an element as used
void UseElement( const int index );
static bool IsUsed( const _UsedRange& r ) { return r.myValue; }
//! 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
- int Get1stID() const { return my1stID; }
+ smIdType Get1stID() const { return my1stID; }
//! Return pointer to on-shape-parameters of a node
TParam* GetPositionPtr( const SMDS_MeshElement* node, bool allocate=false );
// 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 );
int GetShapeID( const SMDS_MeshElement* e ) const;
size_t nbElemsToReturn,
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;
return boost::make_shared< TChuckIterator >( myChunks,
& SMDS_ElementChunk::GetSubIDRangesMinMax,
void SMDS_ElementHolder::beforeCompacting()
{
- int i = 0;
- for ( SMDS_ElemIteratorPtr it = getElements(); it->more(); ++i )
+ for ( SMDS_ElemIteratorPtr it = getElements(); it->more(); )
{
const SMDS_MeshElement* e = it->next();
if ( !e ) continue;
//purpose : restore pointers to elements
//=======================================================================
-void SMDS_ElementHolder::restoreElements( const std::vector<int>& idNodesOldToNew,
- const std::vector<int>& idCellsOldToNew )
+void SMDS_ElementHolder::restoreElements( const std::vector<smIdType>& idNodesOldToNew,
+ const std::vector<smIdType>& idCellsOldToNew )
{
tmpClear();
std::vector< bool >::iterator isNode = myIsNode.begin();
for ( size_t i = 0; i < myVtkIDs.size(); ++i, ++isNode )
{
- int vtkID = myVtkIDs[i];
+ vtkIdType vtkID = myVtkIDs[i];
if ( vtkID < 0 )
{
elem = myExternalElems[ (-vtkID)-1 ];
}
else if ( *isNode )
{
- if ( vtkID < (int)idNodesOldToNew.size() )
+ if ( vtkID < (vtkIdType)idNodesOldToNew.size() )
elem = myMesh->FindNodeVtk( idNodesOldToNew[ vtkID ]);
else
elem = myMesh->FindNodeVtk( vtkID );
}
else
{
- if ( vtkID < (int)idCellsOldToNew.size() )
+ if ( vtkID < (vtkIdType)idCellsOldToNew.size() )
elem = myMesh->FindElementVtk( idCellsOldToNew[ vtkID ]);
else
elem = myMesh->FindElementVtk( vtkID );
#include "SMDS_ElemIterator.hxx"
+#include <smIdType.hxx>
+#include <vtkType.h>
+
#include <vector>
#include <set>
void beforeCompacting();
//! restore pointers to elements
- void restoreElements( const std::vector<int>& idNodessOldToNew,
- const std::vector<int>& idCellsOldToNew );
+ void restoreElements( const std::vector<smIdType>& idNodessOldToNew,
+ const std::vector<smIdType>& idCellsOldToNew );
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::set< SMDS_ElementHolder* >::iterator myPtrInMesh;
};
///@param ID : The ID of the MeshNode to create
///@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
SMDS_MeshNode *node = myNodeFactory->NewNode( ID );
/// create a Mesh0DElement and add it to the current Mesh
/// @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);
if (!node) return NULL;
/// @return The created 0D element or NULL if an element with this
/// 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;
/// create a Ball and add it to the current Mesh
/// @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 );
if (!node) return NULL;
/// @return The created 0D element or NULL if an element with this
/// 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;
/// @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 * node2 = myNodeFactory->FindNode(idnode2);
SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 ) return 0;
/// 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 * node2 = myNodeFactory->FindNode(idnode2);
SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 ) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
/// Add a quadrangle defined by its nodes IDs
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int idnode1,
- int idnode2,
- int idnode3,
- int idnode4,
- int ID)
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType idnode1,
+ smIdType idnode2,
+ smIdType idnode3,
+ smIdType idnode4,
+ smIdType ID)
{
const SMDS_MeshNode *node1, *node2, *node3, *node4;
node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n4 ) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
///or if input nodes are not found.
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
- int idnode2,
- int idnode3,
- int idnode4,
- int ID)
+SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
+ smIdType idnode2,
+ smIdType idnode3,
+ smIdType idnode4,
+ smIdType ID)
{
const SMDS_MeshNode *node1, *node2, *node3, *node4;
node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n4 ) return 0;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
///or if input nodes are not found.
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
- int idnode2,
- int idnode3,
- int idnode4,
- int idnode5,
- int ID)
+SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
+ smIdType idnode2,
+ smIdType idnode3,
+ smIdType idnode4,
+ smIdType idnode5,
+ smIdType ID)
{
const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5;
node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n4 || !n5 ) return 0;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6)
{
- int ID = myCellFactory->GetFreeID();
+ smIdType ID = myCellFactory->GetFreeID();
return SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID);
}
///or if input nodes are not found.
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
- int idnode2,
- int idnode3,
- int idnode4,
- int idnode5,
- int idnode6,
- int ID)
+SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
+ smIdType idnode2,
+ smIdType idnode3,
+ smIdType idnode4,
+ smIdType idnode5,
+ smIdType idnode6,
+ smIdType ID)
{
const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6;
node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 ) return 0;
if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
///or if input nodes are not found.
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
- int idnode2,
- int idnode3,
- int idnode4,
- int idnode5,
- int idnode6,
- int idnode7,
- int idnode8,
- int idnode9,
- int idnode10,
- int idnode11,
- int idnode12,
- int ID)
+SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
+ smIdType idnode2,
+ smIdType idnode3,
+ smIdType idnode4,
+ smIdType idnode5,
+ smIdType idnode6,
+ smIdType idnode7,
+ smIdType idnode8,
+ smIdType idnode9,
+ smIdType idnode10,
+ smIdType idnode11,
+ smIdType idnode12,
+ smIdType ID)
{
const SMDS_MeshNode *node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode *node2 = myNodeFactory->FindNode(idnode2);
const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12,
- int ID)
+ smIdType ID)
{
SMDS_MeshVolume* volume = 0;
if(!n1 || !n2 || !n3 || !n4 || !n5 || !n6 ||
const SMDS_MeshNode * n7,
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);
}
///exists or if input nodes are not found.
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1,
- int idnode2,
- int idnode3,
- int idnode4,
- int idnode5,
- int idnode6,
- int idnode7,
- int idnode8,
- int ID)
+SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1,
+ smIdType idnode2,
+ smIdType idnode3,
+ smIdType idnode4,
+ smIdType idnode5,
+ smIdType idnode6,
+ smIdType idnode7,
+ smIdType idnode8,
+ smIdType ID)
{
const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6, *node7, *node8;
node1 = myNodeFactory->FindNode(idnode1);
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
- int ID)
+ smIdType ID)
{
SMDS_MeshVolume* volume = 0;
if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8) return volume;
/// Add a polygon defined by its nodes IDs
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<int> & nodes_ids,
- const int ID)
+SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
+ const smIdType ID)
{
- int nbNodes = nodes_ids.size();
+ size_t nbNodes = nodes_ids.size();
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] );
if (!nodes[i]) return NULL;
}
SMDS_MeshFace*
SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes,
- const int ID)
+ const smIdType ID)
{
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
/// Add a quadratic polygon defined by its nodes IDs
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<int> & nodes_ids,
- const int ID)
+SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
+ const smIdType ID)
{
std::vector<const SMDS_MeshNode*> nodes( nodes_ids.size() );
for ( size_t i = 0; i < nodes.size(); i++) {
SMDS_MeshFace*
SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes,
- const int ID)
+ const smIdType ID)
{
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
if ( nodes.empty() )
/// or if input nodes are not found.
///////////////////////////////////////////////////////////////////////////////
-SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<int> & nodes_ids,
- const std::vector<int> & quantities,
- const int ID)
+SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdType> & nodes_ids,
+ const std::vector<int> & quantities,
+ const smIdType ID)
{
- int nbNodes = nodes_ids.size();
+ size_t nbNodes = nodes_ids.size();
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]);
if (!nodes[i]) return NULL;
}
SMDS_MeshVolume*
SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int> & quantities,
- const int ID)
+ const smIdType ID)
{
if ( nodes.empty() || quantities.empty() )
return NULL;
(const std::vector<const SMDS_MeshNode*> & nodes,
const std::vector<int> & quantities)
{
- int ID = myCellFactory->GetFreeID();
+ smIdType ID = myCellFactory->GetFreeID();
return SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, 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 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 );
}
-const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(int IDelem) const
+const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(vtkIdType IDelem) const
{
return myCellFactory->FindElement( FromVtkToSmds( IDelem ));
}
//purpose :
//=======================================================================
-const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const
+const SMDS_MeshElement* SMDS_Mesh::FindElement(smIdType IDelem) const
{
return myCellFactory->FindElement( IDelem );
}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of nodes
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::NbNodes() const
+smIdType SMDS_Mesh::NbNodes() const
{
return myInfo.NbNodes();
}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of elements
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::NbElements() const
+smIdType SMDS_Mesh::NbElements() const
{
return myInfo.NbElements();
}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of 0D elements
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::Nb0DElements() const
+smIdType SMDS_Mesh::Nb0DElements() const
{
return myInfo.Nb0DElements();
}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of 0D elements
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::NbBalls() const
+smIdType SMDS_Mesh::NbBalls() const
{
return myInfo.NbBalls();
}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of edges (including construction edges)
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::NbEdges() const
+smIdType SMDS_Mesh::NbEdges() const
{
return myInfo.NbEdges();
}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of faces (including construction faces)
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::NbFaces() const
+smIdType SMDS_Mesh::NbFaces() const
{
return myInfo.NbFaces();
}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of volumes
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::NbVolumes() const
+smIdType SMDS_Mesh::NbVolumes() const
{
return myInfo.NbVolumes();
}
/// Return the number of child mesh of this mesh.
/// 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();
}
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 ),
nbElems);
}
{
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 ),
nbElems);
}
return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter );
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 ),
nbElems);
}
SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
{
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 ),
nbElems);
}
SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
{
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 ),
nbElems);
}
SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const
{
typedef SMDS_VolumeIterator TIterator;
- int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes();
+ smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes();
return
myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ),
nbElems );
n->RemoveInverseElement((*it));
}
- int vtkid = (*it)->GetVtkID();
+ vtkIdType vtkid = (*it)->GetVtkID();
switch ((*it)->GetType()) {
case SMDSAbs_Node:
///////////////////////////////////////////////////////////////////////////////
void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem)
{
- const int vtkId = elem->GetVtkID();
+ const vtkIdType vtkId = elem->GetVtkID();
SMDSAbs_ElementType aType = elem->GetType();
if ( aType == SMDSAbs_Node )
{
//purpose :
//=======================================================================
-int SMDS_Mesh::MaxNodeID() const
+smIdType SMDS_Mesh::MaxNodeID() const
{
return myNodeFactory->GetMaxID();
}
//purpose :
//=======================================================================
-int SMDS_Mesh::MinNodeID() const
+smIdType SMDS_Mesh::MinNodeID() const
{
return myNodeFactory->GetMinID();
}
//purpose :
//=======================================================================
-int SMDS_Mesh::MaxElementID() const
+smIdType SMDS_Mesh::MaxElementID() const
{
return myCellFactory->GetMaxID();
}
//purpose :
//=======================================================================
-int SMDS_Mesh::MinElementID() const
+smIdType SMDS_Mesh::MinElementID() const
{
return myCellFactory->GetMinID();
}
//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;
if( iselem )
//function : AddEdgeWithID
//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),
myNodeFactory->FindNode(n2),
SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n12 ) return 0;
//function : AddFaceWithID
//purpose :
//=======================================================================
-SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3,
- int n12,int n23,int n31, int ID)
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12,smIdType n23,smIdType n31, smIdType ID)
{
return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) ,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31 ) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
//function : AddFaceWithID
//purpose :
//=======================================================================
-SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3,
- int n12,int n23,int n31, int nCenter, int ID)
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID)
{
return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) ,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31 || !nCenter) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
//function : AddFaceWithID
//purpose :
//=======================================================================
-SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n34,int n41, int ID)
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID)
{
return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) ,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
//function : AddFaceWithID
//purpose :
//=======================================================================
-SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n34,int n41, int nCenter, int ID)
+SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID)
{
return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) ,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41 || !nCenter) return 0;
if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
//function : AddVolumeWithID
//purpose :
//=======================================================================
-SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n31,
- int n14,int n24,int n34, int ID)
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n14,smIdType n24,smIdType n34, smIdType ID)
{
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) ,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34,
- int ID)
+ smIdType ID)
{
if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n31 || !n14 || !n24 || !n34)
return 0;
//function : AddVolumeWithID
//purpose :
//=======================================================================
-SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5,
- int n12,int n23,int n34,int n41,
- int n15,int n25,int n35,int n45, int ID)
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n15,smIdType n25,smIdType n35,smIdType n45, smIdType ID)
{
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) ,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45,
- int ID)
+ smIdType ID)
{
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n12 || !n23 ||
!n34 || !n41 || !n15 || !n25 || !n35 || !n45)
//function : AddVolumeWithID
//purpose : 2d order Pentahedron (prism) with 15 nodes
//=======================================================================
-SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12,int n23,int n31,
- int n45,int n56,int n64,
- int n14,int n25,int n36, int ID)
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n45,smIdType n56,smIdType n64,
+ smIdType n14,smIdType n25,smIdType n36, smIdType ID)
{
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) ,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36,
- int ID)
+ smIdType ID)
{
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 ||
!n31 || !n45 || !n56 || !n64 || !n14 || !n25 || !n36)
//function : AddVolumeWithID
//purpose : 2d order Pentahedron (prism) with 18 nodes
//=======================================================================
-SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12,int n23,int n31,
- int n45,int n56,int n64,
- int n14,int n25,int n36,
- int n1245, int n2356, int n1346, int ID)
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n45,smIdType n56,smIdType n64,
+ smIdType n14,smIdType n25,smIdType n36,
+ smIdType n1245, smIdType n2356, smIdType n1346, smIdType ID)
{
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) ,
myNodeFactory->FindNode(n2) ,
const SMDS_MeshNode * n1245,
const SMDS_MeshNode * n2356,
const SMDS_MeshNode * n1346,
- int ID)
+ smIdType ID)
{
//MESSAGE("AddVolumeWithID penta18 "<< ID);
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 ||
//function : AddVolumeWithID
//purpose :
//=======================================================================
-SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12,int n23,int n34,int n41,
- int n56,int n67,int n78,int n85,
- int n15,int n26,int n37,int n48, int ID)
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n56,smIdType n67,smIdType n78,smIdType n85,
+ smIdType n15,smIdType n26,smIdType n37,smIdType n48, smIdType ID)
{
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1),
myNodeFactory->FindNode(n2),
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48,
- int ID)
+ smIdType ID)
{
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 ||
!n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48)
//function : AddVolumeWithID
//purpose :
//=======================================================================
-SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12,int n23,int n34,int n41,
- int n56,int n67,int n78,int n85,
- int n15,int n26,int n37,int n48,
- int n1234,int n1256,int n2367,int n3478,
- int n1458,int n5678,int nCenter, int ID)
+SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n56,smIdType n67,smIdType n78,smIdType n85,
+ smIdType n15,smIdType n26,smIdType n37,smIdType n48,
+ smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
+ smIdType n1458,smIdType n5678,smIdType nCenter, smIdType ID)
{
return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1),
myNodeFactory->FindNode(n2),
const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter,
- int ID)
+ smIdType ID)
{
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 ||
!n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48 ||
}
int nbCells = myGrid->GetNumberOfCells();
ficcon << "-------------------------------- cells " << nbCells << endl;
- for (int i=0; i<nbCells; i++)
+ for (vtkIdType i=0; i<nbCells; i++)
{
ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -";
int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints();
for ( ; holder != myElemHolders.end(); ++holder )
(*holder)->beforeCompacting();
}
- int oldCellSize = myCellFactory->GetMaxID();
+ smIdType oldCellSize = myCellFactory->GetMaxID();
// remove "holes" in SMDS numeration
- std::vector<int> idNodesOldToNew, idCellsNewToOld, idCellsOldToNew;
+ std::vector<smIdType> idNodesOldToNew, idCellsNewToOld, idCellsOldToNew;
myNodeFactory->Compact( idNodesOldToNew );
myCellFactory->Compact( idCellsNewToOld );
// make VTK IDs correspond to SMDS IDs
- int newNodeSize = myNodeFactory->NbUsedElements();
- int newCellSize = myCellFactory->NbUsedElements();
+ smIdType newNodeSize = myNodeFactory->NbUsedElements();
+ smIdType newCellSize = myCellFactory->NbUsedElements();
myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize );
if ( idsChange && !myElemHolders.empty() )
idCellsOldToNew.resize( oldCellSize, oldCellSize );
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[ idCellsNewToOld[ iNew ]] = iNew;
}
return;
}
-int SMDS_Mesh::FromVtkToSmds( int vtkid ) const
+smIdType SMDS_Mesh::FromVtkToSmds( vtkIdType vtkid ) const
{
return myCellFactory->FromVtkToSmds( vtkid );
}
#include <set>
#include <list>
#include <vector>
+#include <smIdType.hxx>
class SMDS_ElementHolder;
class SMDS_ElementFactory;
size_t nbElemsToReturn=-1,
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();
- 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_Mesh0DElement* Add0DElementWithID(int n, int ID);
- virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * n, int ID);
+ virtual SMDS_Mesh0DElement* Add0DElementWithID(smIdType n, smIdType ID);
+ virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * n, smIdType ID);
virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * n);
- virtual SMDS_BallElement* AddBallWithID(int n, double diameter, int ID);
- virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * 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, smIdType ID);
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,
const SMDS_MeshNode * n2,
- int ID);
+ smIdType ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12,
- int ID);
+ smIdType ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
// 2d order triangle of 6 nodes
- virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
- int n12,int n23,int n31, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12,smIdType n23,smIdType n31, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n31);
// 2d order triangle of 7 nodes
- virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
- int n12,int n23,int n31, int nCenter, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * nCenter);
// 2d order quadrangle
- virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n34,int n41, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41);
- virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n34,int n41, int nCenter, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n41,
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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4);
- 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5);
- 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6);
- 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
// hexagonal prism
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6,
- int n7, int n8, int n9, int n10, int n11, int n12,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6,
+ smIdType n7, smIdType n8, smIdType n9, smIdType n10, smIdType n11, smIdType n12,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12);
// 2d order tetrahedron of 10 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n31,
- int n14,int n24,int n34, int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n14,smIdType n24,smIdType n34, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n34);
// 2d order pyramid of 13 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5,
- int n12,int n23,int n34,int n41,
- int n15,int n25,int n35,int n45,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n15,smIdType n25,smIdType n35,smIdType n45,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n45);
// 2d order Pentahedron with 15 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12,int n23,int n31,
- int n45,int n56,int n64,
- int n14,int n25,int n36,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n45,smIdType n56,smIdType n64,
+ smIdType n14,smIdType n25,smIdType n36,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n36);
// 2d order Pentahedron with 18 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12,int n23,int n31,
- int n45,int n56,int n64,
- int n14,int n25,int n36,
- int n1245, int n2356, int n1346,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n45,smIdType n56,smIdType n64,
+ smIdType n14,smIdType n25,smIdType n36,
+ smIdType n1245, smIdType n2356, smIdType n1346,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n1245,
const SMDS_MeshNode * n2356,
const SMDS_MeshNode * n1346,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
// 2d oreder Hexahedrons with 20 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12,int n23,int n34,int n41,
- int n56,int n67,int n78,int n85,
- int n15,int n26,int n37,int n48,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n56,smIdType n67,smIdType n78,smIdType n85,
+ smIdType n15,smIdType n26,smIdType n37,smIdType n48,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n48);
// 2d oreder Hexahedrons with 27 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12,int n23,int n34,int n41,
- int n56,int n67,int n78,int n85,
- int n15,int n26,int n37,int n48,
- int n1234,int n1256,int n2367,int n3478,
- int n1458,int n5678,int nCenter,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n56,smIdType n67,smIdType n78,smIdType n85,
+ smIdType n15,smIdType n26,smIdType n37,smIdType n48,
+ smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
+ smIdType n1458,smIdType n5678,smIdType nCenter,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter);
- virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<int> & nodes_ids,
- const int ID);
+ virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
+ const smIdType ID);
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* AddQuadPolygonalFaceWithID(const std::vector<int> & nodes_ids,
- const int ID);
+ virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<smIdType> & nodes_ids,
+ const smIdType ID);
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_MeshVolume* AddPolyhedralVolumeWithID
- (const std::vector<int> & nodes_ids,
- const std::vector<int> & quantities,
- const int ID);
+ (const std::vector<smIdType> & nodes_ids,
+ const std::vector<int> & quantities,
+ const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*> & nodes,
const std::vector<int> & quantities,
- const int ID);
+ const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*> & nodes,
static_cast<const ELEMTYPE*>(e) : 0 );
}
- const SMDS_MeshNode *FindNode(int idnode) const;
- const SMDS_MeshNode *FindNodeVtk(int idnode) const;
- const SMDS_MeshElement *FindElementVtk(int IDelem) const;
- virtual const SMDS_MeshElement * FindElement(int IDelem) const;
+ const SMDS_MeshNode *FindNode(smIdType idnode) const;
+ const SMDS_MeshNode *FindNodeVtk(vtkIdType idnode) const;
+ const SMDS_MeshElement *FindElementVtk(vtkIdType IDelem) const;
+ virtual const SMDS_MeshElement * FindElement(smIdType IDelem) const;
static const SMDS_Mesh0DElement* Find0DElement(const SMDS_MeshNode * n);
static const SMDS_BallElement* FindBall(const SMDS_MeshNode * n);
static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1,
*/
static int CheckMemory(const bool doNotRaise=false);
- virtual int MaxNodeID() const;
- virtual int MinNodeID() const;
- virtual int MaxElementID() const;
- virtual int MinElementID() const;
+ virtual smIdType MaxNodeID() const;
+ virtual smIdType MinNodeID() const;
+ virtual smIdType MaxElementID() const;
+ virtual smIdType MinElementID() const;
const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; }
- virtual int NbNodes() const;
- virtual int NbElements() const;
- virtual int Nb0DElements() const;
- virtual int NbBalls() const;
- virtual int NbEdges() const;
- virtual int NbFaces() const;
- virtual int NbVolumes() const;
- virtual int NbSubMesh() const;
+ virtual smIdType NbNodes() const;
+ virtual smIdType NbElements() const;
+ virtual smIdType Nb0DElements() const;
+ virtual smIdType NbBalls() const;
+ virtual smIdType NbEdges() const;
+ virtual smIdType NbFaces() const;
+ virtual smIdType NbVolumes() const;
+ virtual smIdType NbSubMesh() const;
virtual ~SMDS_Mesh();
double getMaxDim();
- int FromVtkToSmds(int vtkid) const;
+ smIdType FromVtkToSmds(vtkIdType vtkid) const;
void dumpGrid(std::string ficdump="dumpGrid");
static int chunkSize;
*/
//================================================================================
-int SMDS_MeshElement::GetID() const
+smIdType SMDS_MeshElement::GetID() const
{
return myHolder ? myHolder->GetID( this ) : -1;
}
*/
//================================================================================
-int SMDS_MeshElement::GetVtkID() const
+vtkIdType SMDS_MeshElement::GetVtkID() const
{
return myHolder->GetVtkID( this );
}
*/
//================================================================================
-void SMDS_MeshElement::setVtkID( const int vtkID )
+void SMDS_MeshElement::setVtkID( const vtkIdType vtkID )
{
myHolder->SetVTKID( this, vtkID );
}
#include <vtkType.h>
#include <vtkCellType.h>
+#include <smIdType.hxx>
class SMDS_ElementChunk;
class SMDS_Mesh;
virtual int GetNodeIndex( const SMDS_MeshNode* node ) const;
- virtual int GetID() const;
- virtual int GetVtkID() const;
- virtual int getshapeId() const { return GetShapeID(); }
- virtual int GetShapeID() const;
+ virtual smIdType GetID() const;
+ virtual vtkIdType GetVtkID() const;
+ virtual int getshapeId() const { return GetShapeID(); }
+ virtual int GetShapeID() const;
// mark this element; to be used in algos
virtual void setIsMarked( bool is ) const;
SMDS_MeshElement();
- void setVtkID(const int vtkID );
+ void setVtkID(const vtkIdType vtkID );
virtual void setShapeID( const int shapeID ) const;
SMDS_UnstructuredGrid* getGrid() const;
bool Add(const SMDS_MeshElement * theElem);
bool Remove(const SMDS_MeshElement * theElem);
bool IsEmpty() const { return myElements.empty(); }
- int Extent() const { return myElements.size(); }
+ smIdType Extent() const { return (smIdType) myElements.size(); }
int Tic() const { return myTic; }
bool Contains(const SMDS_MeshElement * theElem) const;
#include "SMDS_MeshElement.hxx"
#include<utilities.h>
+#include <smIdType.hxx>
class SMDS_EXPORT SMDS_MeshInfo
{
inline SMDS_MeshInfo& operator=(const SMDS_MeshInfo& other);
inline void Clear();
- inline int NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
- inline int NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); }
- inline int NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); }
-
- inline int NbEntities(SMDSAbs_EntityType type) const;
- inline int NbElementsOfGeom(SMDSAbs_GeometryType geom) const;
-
- int NbNodes() const { return myNbNodes; }
- int Nb0DElements() const { return myNb0DElements; }
- int NbBalls() const { return myNbBalls; }
- inline int NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const;
-
- inline int NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const;
- inline int NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const;
- inline int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbBiQuadTriangles() const { return myNbBiQuadTriangles; }
- int NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; }
- inline int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
-
- inline int NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const;
- inline int NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const;
- inline int NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const;
- inline int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- inline int NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const;
- inline int NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbTriQuadHexas() const { return myNbTriQuadHexas; }
- int NbQuadPrisms() const { return myNbQuadPrisms; }
- int NbBiQuadPrisms() const { return myNbBiQuadPrisms; }
- int NbPolyhedrons() const { return myNbPolyhedrons; }
+ inline smIdType NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
+ inline smIdType NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); }
+ inline smIdType NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); }
+
+ inline smIdType NbEntities(SMDSAbs_EntityType type) const;
+ inline smIdType NbElementsOfGeom(SMDSAbs_GeometryType geom) const;
+
+ smIdType NbNodes() const { return myNbNodes; }
+ smIdType Nb0DElements() const { return myNb0DElements; }
+ smIdType NbBalls() const { return myNbBalls; }
+ inline smIdType NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const;
+
+ inline smIdType NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ inline smIdType NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ inline smIdType NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbBiQuadTriangles() const { return myNbBiQuadTriangles; }
+ smIdType NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; }
+ inline smIdType NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+
+ inline smIdType NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ inline smIdType NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ inline smIdType NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ inline smIdType NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ inline smIdType NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ inline smIdType NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbTriQuadHexas() const { return myNbTriQuadHexas; }
+ smIdType NbQuadPrisms() const { return myNbQuadPrisms; }
+ smIdType NbBiQuadPrisms() const { return myNbBiQuadPrisms; }
+ smIdType NbPolyhedrons() const { return myNbPolyhedrons; }
protected:
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:
friend class SMDS_Mesh;
// methods to count NOT POLY elements
inline void remove(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
inline void RemoveEdge(const SMDS_MeshElement* el);
inline void RemoveFace(const SMDS_MeshElement* el);
inline void RemoveVolume(const SMDS_MeshElement* el);
- int myNbNodes;
+ smIdType myNbNodes;
- int myNb0DElements;
- int myNbBalls;
- int myNbEdges , myNbQuadEdges ;
- int myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ;
- int myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles;
- int myNbPolygons , myNbQuadPolygons;
+ smIdType myNb0DElements;
+ smIdType myNbBalls;
+ smIdType myNbEdges , myNbQuadEdges ;
+ smIdType myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ;
+ smIdType myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles;
+ smIdType myNbPolygons , myNbQuadPolygons;
- int myNbTetras , myNbQuadTetras ;
- int myNbHexas , myNbQuadHexas, myNbTriQuadHexas;
- int myNbPyramids, myNbQuadPyramids;
- int myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms;
- int myNbHexPrism;
- int myNbPolyhedrons;
+ smIdType myNbTetras , myNbQuadTetras ;
+ smIdType myNbHexas , myNbQuadHexas, myNbTriQuadHexas;
+ smIdType myNbPyramids, myNbQuadPyramids;
+ smIdType myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms;
+ smIdType myNbHexPrism;
+ 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()
};
myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0;
}
-inline int // index
+inline smIdType // index
SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const
{ return nbNodes + myShift[ type ]; }
SMDS_MeshInfo::RemoveVolume(const SMDS_MeshElement* el)
{ if ( el->IsPoly() ) --myNbPolyhedrons; else remove( el ); }
-inline int // NbEdges
+inline smIdType // NbEdges
SMDS_MeshInfo::NbEdges (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbEdges+myNbQuadEdges : order == ORDER_LINEAR ? myNbEdges : myNbQuadEdges; }
-inline int // NbFaces
+inline smIdType // NbFaces
SMDS_MeshInfo::NbFaces (SMDSAbs_ElementOrder order) const
{ 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
{ 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
{ 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
{ return order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons; }
-inline int // NbVolumes
+inline smIdType // NbVolumes
SMDS_MeshInfo::NbVolumes (SMDSAbs_ElementOrder order) const
{ 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
{ return order == ORDER_ANY ? myNbTetras+myNbQuadTetras : order == ORDER_LINEAR ? myNbTetras : myNbQuadTetras; }
-inline int // NbHexas
+inline smIdType // NbHexas
SMDS_MeshInfo::NbHexas (SMDSAbs_ElementOrder order) const
{ 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
{ return order == ORDER_ANY ? myNbPyramids+myNbQuadPyramids : order == ORDER_LINEAR ? myNbPyramids : myNbQuadPyramids; }
-inline int // NbPrisms
+inline smIdType // NbPrisms
SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const
{ 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
{ return order == ORDER_ANY ? myNbHexPrism : order == ORDER_LINEAR ? myNbHexPrism : 0; }
-inline int // NbElements
+inline smIdType // NbElements
SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
{
- int nb = 0;
+ smIdType nb = 0;
switch (type) {
case SMDSAbs_All:
for ( size_t i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
return nb;
}
-inline int // NbEntities
+inline smIdType // NbEntities
SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
{
switch (type) {
return 0;
}
-inline int // NbElementsOfGeom
+inline smIdType // NbElementsOfGeom
SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const
{
switch ( geom ) {
}
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) {
case SMDSEntity_Node: myNbNodes = nb; break;
#include <utilities.h>
#include <Utils_SALOME_Exception.hxx>
#include <cassert>
+#include <smIdType.hxx>
#include <boost/make_shared.hpp>
{
for (int i = 0; i < ncells; i++)
{
- int vtkId = cells[i];
- int smdsId = myMesh->FromVtkToSmds( vtkId );
+ vtkIdType vtkId = cells[i];
+ smIdType smdsId = myMesh->FromVtkToSmds( vtkId );
const SMDS_MeshElement* elem = myMesh->FindElement( smdsId );
if ( elem->GetType() == type )
{
const SMDS_MeshElement* next()
{
- int vtkId = myCellList[ myIter++ ];
- int smdsId = myMesh->FromVtkToSmds( vtkId );
+ vtkIdType vtkId = myCellList[ myIter++ ];
+ smIdType smdsId = myMesh->FromVtkToSmds( vtkId );
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
if (!elem)
{
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
{
return vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts);
// --- type = VTK_POLYHEDRON
- int cellid = this->InsertNextCell(type, npts, pts);
+ vtkIdType cellid = this->InsertNextCell(type, npts, pts);
std::set<vtkIdType> setOfNodes;
setOfNodes.clear();
_mesh = mesh;
}
-void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int newNodeSize,
- std::vector<int>& idCellsNewToOld, int newCellSize)
+void SMDS_UnstructuredGrid::compactGrid(std::vector<smIdType>& idNodesOldToNew, smIdType newNodeSize,
+ std::vector<smIdType>& idCellsNewToOld, smIdType newCellSize)
{
this->DeleteLinks();
// IDs of VTK nodes always correspond to SMDS IDs but there can be "holes" in SMDS numeration.
// We compact only if there were holes
- int oldNodeSize = this->GetNumberOfPoints();
+ vtkIdType oldNodeSize = this->GetNumberOfPoints();
bool updateNodes = ( oldNodeSize > newNodeSize );
if ( true /*updateNodes*/ )
{
// Use double type for storing coordinates of nodes instead float.
vtkPoints *newPoints = vtkPoints::New();
newPoints->SetDataType( VTK_DOUBLE );
- newPoints->SetNumberOfPoints( newNodeSize );
+ newPoints->SetNumberOfPoints( FromIdType<vtkIdType>(newNodeSize) );
- int i = 0, alreadyCopied = 0;
+ vtkIdType i = 0, alreadyCopied = 0;
while ( i < oldNodeSize )
{
// skip a hole if any
while ( i < oldNodeSize && idNodesOldToNew[i] < 0 )
++i;
- int startBloc = i;
+ vtkIdType startBloc = i;
// look for a block end
while ( i < oldNodeSize && idNodesOldToNew[i] >= 0 )
++i;
- int endBloc = i;
+ vtkIdType endBloc = i;
copyNodes(newPoints, idNodesOldToNew, alreadyCopied, startBloc, endBloc);
}
this->SetPoints(newPoints);
// Compact cells if VTK IDs do not correspond to SMDS IDs or nodes compacted
- int oldCellSize = this->Types->GetNumberOfTuples();
- bool updateCells = ( updateNodes || newCellSize != oldCellSize );
- for ( int newID = 0, nbIDs = idCellsNewToOld.size(); newID < nbIDs && !updateCells; ++newID )
+ vtkIdType oldCellSize = this->Types->GetNumberOfTuples();
+ bool updateCells = ( updateNodes || newCellSize != oldCellSize );
+ for ( vtkIdType newID = 0, nbIDs = idCellsNewToOld.size(); newID < nbIDs && !updateCells; ++newID )
updateCells = ( idCellsNewToOld[ newID ] != newID );
if ( false /*!updateCells*/ ) // no holes in elements
return;
}
- if ((int) idNodesOldToNew.size() < oldNodeSize )
+ if ((vtkIdType) idNodesOldToNew.size() < oldNodeSize )
{
idNodesOldToNew.reserve( oldNodeSize );
- for ( int i = idNodesOldToNew.size(); i < oldNodeSize; ++i )
+ for ( vtkIdType i = idNodesOldToNew.size(); i < oldNodeSize; ++i )
idNodesOldToNew.push_back( i );
}
// --- create new compacted Connectivity, Locations and Types
- int newConnectivitySize = this->Connectivity->GetNumberOfConnectivityEntries();
+ vtkIdType newConnectivitySize = this->Connectivity->GetNumberOfConnectivityEntries();
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 )
newConnectivitySize -= this->Connectivity->GetCellSize( i );
vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New();
newTypes->Initialize();
- newTypes->SetNumberOfValues(newCellSize);
+ newTypes->SetNumberOfValues(FromIdType<vtkIdType>(newCellSize));
vtkIdTypeArray *newLocations = vtkIdTypeArray::New();
newLocations->Initialize();
- newLocations->SetNumberOfValues(newCellSize);
+ newLocations->SetNumberOfValues(FromIdType<vtkIdType>(newCellSize));
std::vector< vtkIdType > pointsCell(1024); // --- points id to fill a new cell
{
vtkDoubleArray* newDiameters = vtkDoubleArray::New();
newDiameters->SetNumberOfComponents(1);
- for ( int newCellID = 0; newCellID < newCellSize; newCellID++ )
+ for ( vtkIdType newCellID = 0; newCellID < newCellSize; newCellID++ )
{
if ( newTypes->GetValue( newCellID ) == VTK_POLY_VERTEX )
{
- int oldCellID = idCellsNewToOld[ newCellID ];
+ vtkIdType oldCellID = idCellsNewToOld[ newCellID ];
newDiameters->InsertValue( newCellID, diameters->GetValue( oldCellID ));
}
vtkDataSet::CellData->SetScalars( newDiameters );
vtkIdTypeArray *newFaces = vtkIdTypeArray::New();
newFaces->Initialize();
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 )
{
- int oldCellId = idCellsNewToOld[ newCellID ];
+ smIdType oldCellId = idCellsNewToOld[ newCellID ];
newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 );
- int oldFaceLoc = this->FaceLocations->GetValue( oldCellId );
- int nCellFaces = this->Faces->GetValue( oldFaceLoc++ );
- newFaces->InsertNextValue( nCellFaces );
+ smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType<vtkIdType>(oldCellId) );
+ smIdType nCellFaces = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
+ newFaces->InsertNextValue( FromIdType<vtkIdType>(nCellFaces) );
for ( int n = 0; n < nCellFaces; n++ )
{
- int nptsInFace = this->Faces->GetValue( oldFaceLoc++ );
+ int nptsInFace = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( nptsInFace );
for ( int k = 0; k < nptsInFace; k++ )
{
- int oldpt = this->Faces->GetValue( oldFaceLoc++ );
+ vtkIdType oldpt = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]);
}
}
newConnectivity->Delete();
}
-void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints,
- std::vector<int>& /*idNodesOldToNew*/,
- int& alreadyCopied,
- int start,
- int end)
+void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints,
+ std::vector<smIdType>& /*idNodesOldToNew*/,
+ vtkIdType& alreadyCopied,
+ vtkIdType start,
+ vtkIdType end)
{
void *target = newPoints->GetVoidPointer(3 * alreadyCopied);
void *source = this->Points->GetVoidPointer(3 * start);
- int nbPoints = end - start;
+ vtkIdType nbPoints = end - start;
if (nbPoints > 0)
{
memcpy(target, source, 3 * sizeof(double) * nbPoints);
}
void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray * newTypes,
- const std::vector<int>& idCellsNewToOld,
- const std::vector<int>& idNodesOldToNew,
+ const std::vector<smIdType>& idCellsNewToOld,
+ const std::vector<smIdType>& idNodesOldToNew,
vtkCellArray* newConnectivity,
vtkIdTypeArray* newLocations,
std::vector<vtkIdType>& pointsCell)
{
for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); iNew++ )
{
- int iOld = idCellsNewToOld[ iNew ];
+ vtkIdType iOld = idCellsNewToOld[ iNew ];
newTypes->SetValue( iNew, this->Types->GetValue( iOld ));
vtkIdType oldLoc = ((vtkIdTypeArray *)(this->Connectivity->GetOffsetsArray()))->GetValue( iOld );
pointsCell.resize( nbpts );
for ( int l = 0; l < nbpts; l++ )
{
- int oldval = oldPtsCell[l];
+ vtkIdType oldval = oldPtsCell[l];
pointsCell[l] = idNodesOldToNew[oldval];
}
- /*int newcnt = */newConnectivity->InsertNextCell( nbpts, pointsCell.data() );
- int newLoc = newConnectivity->GetInsertLocation( nbpts );
+ /*vtkIdType newcnt = */newConnectivity->InsertNextCell( nbpts, pointsCell.data() );
+ vtkIdType newLoc = newConnectivity->GetInsertLocation( nbpts );
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 _cellIdToDownId[vtkCellId];
}
-void SMDS_UnstructuredGrid::setCellIdToDownId(int vtkCellId, int downId)
+void SMDS_UnstructuredGrid::setCellIdToDownId(vtkIdType vtkCellId, int downId)
{
// ASSERT((vtkCellId >= 0) && (vtkCellId < _cellIdToDownId.size()));
_cellIdToDownId[vtkCellId] = downId;
const SMDS_MeshInfo &meshInfo = _mesh->GetMeshInfo();
- int nbLinTetra = meshInfo.NbTetras (ORDER_LINEAR);
- int nbQuadTetra = meshInfo.NbTetras (ORDER_QUADRATIC);
- int nbLinPyra = meshInfo.NbPyramids(ORDER_LINEAR);
- int nbQuadPyra = meshInfo.NbPyramids(ORDER_QUADRATIC);
- int nbLinPrism = meshInfo.NbPrisms (ORDER_LINEAR);
- int nbQuadPrism = meshInfo.NbPrisms (ORDER_QUADRATIC);
- int nbLinHexa = meshInfo.NbHexas (ORDER_LINEAR);
- int nbQuadHexa = meshInfo.NbHexas (ORDER_QUADRATIC);
- int nbHexPrism = meshInfo.NbHexPrisms();
+ int nbLinTetra = FromIdType<int>(meshInfo.NbTetras (ORDER_LINEAR));
+ int nbQuadTetra = FromIdType<int>(meshInfo.NbTetras (ORDER_QUADRATIC));
+ int nbLinPyra = FromIdType<int>(meshInfo.NbPyramids(ORDER_LINEAR));
+ int nbQuadPyra = FromIdType<int>(meshInfo.NbPyramids(ORDER_QUADRATIC));
+ int nbLinPrism = FromIdType<int>(meshInfo.NbPrisms (ORDER_LINEAR));
+ int nbQuadPrism = FromIdType<int>(meshInfo.NbPrisms (ORDER_QUADRATIC));
+ int nbLinHexa = FromIdType<int>(meshInfo.NbHexas (ORDER_LINEAR));
+ int nbQuadHexa = FromIdType<int>(meshInfo.NbHexas (ORDER_QUADRATIC));
+ int nbHexPrism = FromIdType<int>(meshInfo.NbHexPrisms());
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);
#include <vtkUnstructuredGrid.h>
#include <vtkCellLinks.h>
+#include <smIdType.hxx>
#include <vector>
#include <set>
{
public:
void setSMDS_mesh(SMDS_Mesh *mesh);
- void compactGrid(std::vector<int>& idNodesOldToNew,
- int newNodeSize,
- std::vector<int>& idCellsOldToNew,
- int newCellSize);
+ void compactGrid(std::vector<smIdType>& idNodesOldToNew,
+ smIdType newNodeSize,
+ std::vector<smIdType>& idCellsOldToNew,
+ smIdType newCellSize);
virtual vtkMTimeType GetMTime();
virtual vtkPoints *GetPoints();
- int InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
+ vtkIdType InsertNextLinkedCell(int type, int npts, vtkIdType *pts);
- int CellIdToDownId(int vtkCellId);
- void setCellIdToDownId(int vtkCellId, int downId);
+ int CellIdToDownId(vtkIdType vtkCellId);
+ void setCellIdToDownId(vtkIdType vtkCellId, int downId);
void CleanDownwardConnectivity();
void BuildDownwardConnectivity(bool withEdges);
int GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId, bool getSkin=false);
protected:
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,
- const std::vector<int>& idCellsOldToNew,
- const std::vector<int>& idNodesOldToNew,
+ const std::vector<smIdType>& idCellsOldToNew,
+ const std::vector<smIdType>& idNodesOldToNew,
vtkCellArray* newConnectivity,
vtkIdTypeArray* newLocations,
std::vector<vtkIdType>& pointsCell);
namespace
{
- struct NLink : public std::pair<int,int>
+ struct NLink : public std::pair<smIdType,smIdType>
{
int myOri;
NLink(const SMDS_MeshNode* n1=0, const SMDS_MeshNode* n2=0, int ori=1 )
//purpose : return element ID
//=======================================================================
-int SMDS_VolumeTool::ID() const
+smIdType SMDS_VolumeTool::ID() const
{
return myVolume ? myVolume->GetID() : 0;
}
#include "SMESH_SMDS.hxx"
+#include <smIdType.hxx>
+
class SMDS_MeshElement;
class SMDS_MeshNode;
class SMDS_MeshVolume;
const SMDS_MeshVolume* Element() const;
// return element
- int ID() const;
+ smIdType ID() const;
// return element ID
bool IsPoly() const { return myPolyedre; }
const SMDS_MeshNode** GetNodes() const { return (const SMDS_MeshNode**) &myVolumeNodes[0]; }
// Return array of volume nodes
- int NbNodes() const { return myVolumeNodes.size(); }
+ int NbNodes() const { return (int) myVolumeNodes.size(); }
// Return array of volume nodes
double GetSize() const;
int myNbFaces;
std::vector<const SMDS_MeshNode*> myVolumeNodes;
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
typedef std::pair<int,int> Link;
*/
//=============================================================================
-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()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
- int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
+ smIdType nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
if(_quadraticMesh)
nb = nb/2;
nbPoints += nb + 1; // internal points plus 1 vertex of 2 (last point ?)
class TopoDS_Wire;
class gp_XYZ;
-typedef std::map< SMESH_subMesh*, std::vector<int> > MapShapeNbElems;
-typedef std::map< SMESH_subMesh*, std::vector<int> >::iterator MapShapeNbElemsItr;
+typedef std::map< SMESH_subMesh*, std::vector<smIdType> > MapShapeNbElems;
+typedef std::map< SMESH_subMesh*, std::vector<smIdType> >::iterator MapShapeNbElemsItr;
// ==================================================================================
/*!
*/
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
if ( !GetMeshDS()->IsUsedHypothesis( hyp ))
return;
- int nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
+ smIdType nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
if ( hyp && _callUp && !_callUp->IsLoaded() ) // for not loaded mesh (#16648)
{
_callUp->HypothesisModified( hyp->GetID(), /*updateIcons=*/true );
HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty
GetMeshDS()->Modified();
- int newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
+ smIdType newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
if ( hyp && _callUp )
_callUp->HypothesisModified( hyp->GetID(), newNbEntities != nbEntities );
}
bool theAllElemsToGroup)
{
MESSAGE("MED_VERSION:"<< theVersion);
+
+ Driver_Mesh::Status status;
SMESH_TRY;
DriverMED_W_SMESHDS_Mesh myWriter;
}
}
// Perform export
- myWriter.Perform();
+ status = myWriter.Perform();
SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("MED");
}
//================================================================================
cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
cmd += "\"";
system(cmd.c_str());
- ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1,
- /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
- /*zTol=*/-1, /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
+ try {
+ ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1,
+ /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false,
+ /*zTol=*/-1, /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413
+ }
+ catch ( TooLargeForExport )
+ {
+ throw TooLargeForExport("SAUV");
+ }
#ifdef WIN32
cmd = "%PYTHONBIN% ";
#else
void SMESH_Mesh::ExportDAT(const char * file,
const SMESHDS_Mesh* meshPart)
{
- Unexpect aCatch(SalomeException);
+ Driver_Mesh::Status status;
+ SMESH_TRY;
+
DriverDAT_W_SMDS_Mesh myWriter;
myWriter.SetFile( file );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
myWriter.SetMeshId(_id);
- myWriter.Perform();
+ status = myWriter.Perform();
+
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("DAT");
}
//================================================================================
void SMESH_Mesh::ExportUNV(const char * file,
const SMESHDS_Mesh* meshPart)
{
- Unexpect aCatch(SalomeException);
+ Driver_Mesh::Status status;
+
+ SMESH_TRY;
DriverUNV_W_SMDS_Mesh myWriter;
myWriter.SetFile( file );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS );
}
}
}
- myWriter.Perform();
+ status = myWriter.Perform();
+
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("UNV");
}
//================================================================================
const char * name,
const SMESHDS_Mesh* meshPart)
{
- Unexpect aCatch(SalomeException);
+ Driver_Mesh::Status status;
+ SMESH_TRY;
+
DriverSTL_W_SMDS_Mesh myWriter;
myWriter.SetFile( file );
myWriter.SetIsAscii( isascii );
myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS);
myWriter.SetMeshId(_id);
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");
}
//================================================================================
const char * meshName,
const bool groupElemsByType)
{
+
int res = Driver_Mesh::DRS_FAIL;
+ SMESH_TRY;
// pass group names to SMESHDS
std::map<int, SMESH_Group*>::iterator it = _mapGroup.begin();
}
#endif
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( res == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("CGNS");
+
if ( res != Driver_Mesh::DRS_OK )
throw SALOME_Exception("Export failed");
}
const SMESHDS_Mesh* meshDS,
bool withRequiredGroups)
{
+ Driver_Mesh::Status status;
+ SMESH_TRY;
+
DriverGMF_Write myWriter;
myWriter.SetFile( file );
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
myWriter.SetExportRequiredGroups( withRequiredGroups );
- myWriter.Perform();
+ status = myWriter.Perform();
+
+ SMESH_CATCH( SMESH::throwSalomeEx );
+
+ if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH )
+ throw TooLargeForExport("GMF");
}
//================================================================================
*/
//================================================================================
-int SMESH_Mesh::NbNodes() const
+smIdType SMESH_Mesh::NbNodes() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->NbNodes();
*/
//================================================================================
-int SMESH_Mesh::Nb0DElements() const
+smIdType SMESH_Mesh::Nb0DElements() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().Nb0DElements();
*/
//================================================================================
-int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbEdges(order);
*/
//================================================================================
-int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbFaces(order);
*/
//================================================================================
-int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriangles(order);
*/
//================================================================================
-int SMESH_Mesh::NbBiQuadTriangles() const
+smIdType SMESH_Mesh::NbBiQuadTriangles() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadTriangles();
*/
//================================================================================
-int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadrangles(order);
*/
//================================================================================
-int SMESH_Mesh::NbBiQuadQuadrangles() const
+smIdType SMESH_Mesh::NbBiQuadQuadrangles() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadQuadrangles();
*/
//================================================================================
-int SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolygons(order);
*/
//================================================================================
-int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbVolumes(order);
*/
//================================================================================
-int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTetras(order);
*/
//================================================================================
-int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexas(order);
*/
//================================================================================
-int SMESH_Mesh::NbTriQuadraticHexas() const
+smIdType SMESH_Mesh::NbTriQuadraticHexas() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriQuadHexas();
*/
//================================================================================
-int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPyramids(order);
*/
//================================================================================
-int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPrisms(order);
}
-int SMESH_Mesh::NbQuadPrisms() const
+smIdType SMESH_Mesh::NbQuadPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadPrisms();
}
-int SMESH_Mesh::NbBiQuadPrisms() const
+smIdType SMESH_Mesh::NbBiQuadPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadPrisms();
*/
//================================================================================
-int SMESH_Mesh::NbHexagonalPrisms() const
+smIdType SMESH_Mesh::NbHexagonalPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexPrisms();
*/
//================================================================================
-int SMESH_Mesh::NbPolyhedrons() const
+smIdType SMESH_Mesh::NbPolyhedrons() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolyhedrons();
*/
//================================================================================
-int SMESH_Mesh::NbBalls() const
+smIdType SMESH_Mesh::NbBalls() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBalls();
*/
//================================================================================
-int SMESH_Mesh::NbSubMesh() const
+smIdType SMESH_Mesh::NbSubMesh() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->NbSubMesh();
save << ++clause << ") Total number of " << orderStr << " edges:\t" << NbEdges(order) << endl;
save << ++clause << ") Total number of " << orderStr << " faces:\t" << NbFaces(order) << endl;
if ( NbFaces(order) > 0 ) {
- int nb3 = NbTriangles(order);
- int nb4 = NbQuadrangles(order);
+ smIdType nb3 = NbTriangles(order);
+ smIdType nb4 = NbQuadrangles(order);
save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl;
save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl;
if ( nb3 + nb4 != NbFaces(order) ) {
}
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
if ( NbVolumes(order) > 0 ) {
- int nb8 = NbHexas(order);
- int nb4 = NbTetras(order);
- int nb5 = NbPyramids(order);
- int nb6 = NbPrisms(order);
+ smIdType nb8 = NbHexas(order);
+ smIdType nb4 = NbTetras(order);
+ smIdType nb5 = NbPyramids(order);
+ smIdType nb6 = NbPrisms(order);
save << clause << ".1) Number of " << orderStr << " hexahedrons: \t" << nb8 << endl;
save << clause << ".2) Number of " << orderStr << " tetrahedrons:\t" << nb4 << endl;
save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl;
//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 );
}
*/
typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap;
const TAncestorMap& GetAncestorMap() const { return _mapAncestors; }
+
/*!
* \brief Check group names for duplications.
* Consider maximum group name length stored in MED file
*/
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,
const char* theMeshName = NULL,
bool theAutoGroups = true,
double GetComputeProgress() const;
- int NbNodes() const;
- int Nb0DElements() const;
- int NbBalls() const;
+ smIdType NbNodes() const;
+ smIdType Nb0DElements() 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;
- int NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbBiQuadQuadrangles() const;
- int NbBiQuadTriangles() const;
- int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbBiQuadQuadrangles() const;
+ smIdType NbBiQuadTriangles() const;
+ smIdType NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbTriQuadraticHexas() const;
- int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbQuadPrisms() const;
- int NbBiQuadPrisms() const;
- int NbHexagonalPrisms() const;
- int NbPolyhedrons() const;
+ smIdType NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbTriQuadraticHexas() const;
+ smIdType NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbQuadPrisms() const;
+ smIdType NbBiQuadPrisms() const;
+ smIdType NbHexagonalPrisms() 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
bool SynchronizeGroups();
- SMDSAbs_ElementType GetElementType( const int id, const bool iselem );
+ SMDSAbs_ElementType GetElementType( const smIdType id, const bool iselem );
void ClearMeshOrder();
void SetMeshOrder(const TListOfListOfInt& theOrder );
#include "SMESH_TryCatch.hxx" // include after OCCT headers!
+#include <smIdType.hxx>
+
#define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem )
using namespace std;
SMDS_MeshElement* e = 0;
int nbnode = node.size();
SMESHDS_Mesh* mesh = GetMeshDS();
- const int ID = features.myID;
+ const smIdType ID = features.myID;
switch ( features.myType ) {
case SMDSAbs_Face:
*/
//=======================================================================
-SMDS_MeshElement* SMESH_MeshEditor::AddElement(const vector<int> & nodeIDs,
- const ElemFeatures& features)
+SMDS_MeshElement* SMESH_MeshEditor::AddElement(const vector<smIdType> & nodeIDs,
+ const ElemFeatures& features)
{
vector<const SMDS_MeshNode*> nodes;
nodes.reserve( nodeIDs.size() );
- vector<int>::const_iterator id = nodeIDs.begin();
+ vector<smIdType>::const_iterator id = nodeIDs.begin();
while ( id != nodeIDs.end() ) {
if ( const SMDS_MeshNode* node = GetMeshDS()->FindNode( *id++ ))
nodes.push_back( node );
// 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 )
{
ClearLastCreated();
SMESHDS_Mesh* aMesh = GetMeshDS();
set< SMESH_subMesh *> smmap;
- int removed = 0;
- list<int>::const_iterator it = theIDs.begin();
+ smIdType removed = 0;
+ list<smIdType>::const_iterator it = theIDs.begin();
for ( ; it != theIDs.end(); it++ ) {
const SMDS_MeshElement * elem;
if ( isNodes )
*/
//=======================================================================
- struct TVolumeFaceKey: pair< pair< int, int>, pair< int, int> >
+ struct TVolumeFaceKey: pair< pair< smIdType, smIdType>, pair< smIdType, smIdType> >
{
TVolumeFaceKey( SMDS_VolumeTool& vol, int iF )
{
:myMesh( theMesh ), myMaxID( theMesh->MaxNodeID() + 1)
{}
- long GetLinkID (const SMDS_MeshNode * n1,
+ smIdType GetLinkID (const SMDS_MeshNode * n1,
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,
// copy offsetMesh to theTgtMesh
- int idShift = meshDS->MaxNodeID();
+ smIdType idShift = meshDS->MaxNodeID();
for ( size_t i = 0; i < new2OldNodes.size(); ++i )
if ( const SMDS_MeshNode* n = new2OldNodes[ i ].first )
{
TNodeNodeMap nodeNodeMap; // node to replace - new node
set<const SMDS_MeshElement*> elems; // all elements with changed nodes
- list< int > rmElemIds, rmNodeIds;
+ list< smIdType > rmElemIds, rmNodeIds;
vector< ElemFeatures > newElemDefs;
// Fill nodeNodeMap and elems
// 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;
- int mySumID;
+ smIdType mySumID;
mutable int myGroupID;
public:
this->reserve( theElem->NbNodes() );
for ( SMDS_ElemIteratorPtr nodeIt = theElem->nodesIterator(); nodeIt->more(); )
{
- int id = nodeIt->next()->GetID();
+ smIdType id = nodeIt->next()->GetID();
mySumID += id;
this->insert( id );
}
static int HashCode(const ComparableElement& se, int limit )
{
- return ::HashCode( se.mySumID, limit );
+ return ::HashCode( FromIdType<int>(se.mySumID), limit );
}
static Standard_Boolean IsEqual(const ComparableElement& se1, const ComparableElement& se2 )
{
else elemIt = SMESHUtils::elemSetIterator( theElements );
typedef NCollection_Map< ComparableElement, ComparableElement > TMapOfElements;
- typedef std::list<int> TGroupOfElems;
+ typedef std::list<smIdType> TGroupOfElems;
TMapOfElements mapOfElements;
std::vector< TGroupOfElems > arrayOfGroups;
TGroupOfElems groupOfElems;
{
ClearLastCreated();
- typedef list<int> TListOfIDs;
+ typedef list<smIdType> TListOfIDs;
TListOfIDs rmElemIds; // IDs of elems to remove
SMESHDS_Mesh* aMesh = GetMeshDS();
TListOfListOfElementsID::iterator itGroups = equalGroups.begin();
for ( ; itGroups != equalGroups.end(); ++itGroups )
{
- list< int >& group = *itGroups;
- list< int >::iterator id = group.begin();
+ list< smIdType >& group = *itGroups;
+ list< smIdType >::iterator id = group.begin();
for ( ++id; id != group.end(); ++id )
if ( const SMDS_MeshElement* seg = GetMeshDS()->FindElement( *id ))
segments.erase( seg );
*/
//=======================================================================
-int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm,
- SMESH_MesherHelper& theHelper,
- const bool theForce3d)
+smIdType SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm,
+ SMESH_MesherHelper& theHelper,
+ const bool theForce3d)
{
//MESSAGE("convertElemToQuadratic");
- int nbElem = 0;
+ smIdType nbElem = 0;
if( !theSm ) return nbElem;
vector<int> nbNodeInFaces;
}
// get elem data needed to re-create it
//
- const int id = elem->GetID();
+ const smIdType id = elem->GetID();
const int nbNodes = elem->NbCornerNodes();
nodes.assign(elem->begin_nodes(), elem->end_nodes());
if ( aGeomType == SMDSEntity_Polyhedra )
aHelper.ToFixNodeParameters( true );
// convert elements assigned to sub-meshes
- int nbCheckedElems = 0;
+ smIdType nbCheckedElems = 0;
if ( myMesh->HasShapeToMesh() )
{
if ( SMESH_subMesh *aSubMesh = myMesh->GetSubMeshContaining(myMesh->GetShapeToMesh()))
}
// 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
{
aHelper.SetElementsOnShape(false);
const SMDS_MeshEdge* edge = aEdgeItr->next();
if ( !edge->IsQuadratic() )
{
- int id = edge->GetID();
+ smIdType id = edge->GetID();
const SMDS_MeshNode* n1 = edge->GetNode(0);
const SMDS_MeshNode* n2 = edge->GetNode(1);
if ( alreadyOK )
continue;
- const int id = face->GetID();
+ const smIdType id = face->GetID();
vector<const SMDS_MeshNode *> nodes ( face->begin_nodes(), face->end_nodes());
meshDS->RemoveFreeElement(face, smDS, /*fromGroups=*/false);
continue;
}
}
- const int id = volume->GetID();
+ const smIdType id = volume->GetID();
vector<const SMDS_MeshNode *> nodes (volume->begin_nodes(), volume->end_nodes());
if ( type == SMDSEntity_Polyhedra )
nbNodeInFaces = static_cast<const SMDS_MeshVolume* >(volume)->GetQuantities();
if ( alreadyOK ) continue;
const SMDSAbs_ElementType type = elem->GetType();
- const int id = elem->GetID();
+ const smIdType id = elem->GetID();
const int nbNodes = elem->NbCornerNodes();
vector<const SMDS_MeshNode *> nodes ( elem->begin_nodes(), elem->end_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,
- SMDS_ElemIteratorPtr theItr,
- const int /*theShapeID*/)
+smIdType SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm,
+ SMDS_ElemIteratorPtr theItr,
+ const int /*theShapeID*/)
{
- int nbElem = 0;
+ smIdType nbElem = 0;
SMESHDS_Mesh* meshDS = GetMeshDS();
ElemFeatures elemType;
vector<const SMDS_MeshNode *> nodes;
bool SMESH_MeshEditor::ConvertFromQuadratic()
{
- int nbCheckedElems = 0;
+ smIdType nbCheckedElems = 0;
if ( myMesh->HasShapeToMesh() )
{
if ( SMESH_subMesh *aSubMesh = myMesh->GetSubMeshContaining(myMesh->GetShapeToMesh()))
}
}
- int totalNbElems =
+ smIdType totalNbElems =
GetMeshDS()->NbEdges() + GetMeshDS()->NbFaces() + GetMeshDS()->NbVolumes();
if ( nbCheckedElems < totalNbElems ) // not all elements are in submeshes
{
if ( theElements.empty() ) return;
// 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();
for ( ; eIt != theElements.end(); ++eIt )
{
// get remaining medium nodes
TIDSortedNodeSet mediumNodes;
- set<int>::iterator nIdsIt = mediumNodeIDs.begin();
+ set<smIdType>::iterator nIdsIt = mediumNodeIDs.begin();
for ( ; nIdsIt != mediumNodeIDs.end(); ++nIdsIt )
if ( const SMDS_MeshNode* n = GetMeshDS()->FindNode( *nIdsIt ))
mediumNodes.insert( mediumNodes.end(), n );
if ( aResult != SEW_OK)
return aResult;
- list< int > nodeIDsToRemove;
+ list< smIdType > nodeIDsToRemove;
vector< const SMDS_MeshNode*> nodes;
ElemFeatures elemType;
const SMDS_MeshElement* anElem = *elemItr;
if (!anElem)
continue;
- int vtkId = anElem->GetVtkID();
+ vtkIdType vtkId = anElem->GetVtkID();
//MESSAGE(" vtkId " << vtkId << " smdsId " << anElem->GetID());
int neighborsVtkIds[NBMAXNEIGHBORS];
int downIds[NBMAXNEIGHBORS];
int nbNeighbors = grid->GetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId);
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);
if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared
{
const TIDSortedElemSet& domain = (idom == iRestDom) ? theRestDomElems : theElems[idom];
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);
if (domain.count(elem))
{
{
if (neighborsVtkIds[n]<0) // only smds faces are considered as neighbors here
continue;
- int smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]);
+ smIdType smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]);
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
{
{
SMDSAbs_ElementType myType;
bool myIsPoly, myIsQuad;
- int myID;
+ smIdType myID;
double myBallDiameter;
std::vector<int> myPolyhedQuantities;
std::vector<const SMDS_MeshNode*> myNodes; // not managed by ElemFeatures
SMESH_EXPORT ElemFeatures& SetPoly(bool isPoly) { myIsPoly = isPoly; 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; }
};
/*!
/*!
* \brief Add element
*/
- SMDS_MeshElement* AddElement(const std::vector<int> & nodeIDs,
- const ElemFeatures& features);
+ SMDS_MeshElement* AddElement(const std::vector<smIdType> & nodeIDs,
+ 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.
// Modify a compute state of sub-meshes which become empty
bool IsScaleVariation() const { return myFlags & EXTRUSION_FLAG_SCALE_LINEAR_VARIATION; }
bool IsAngleVariation() const { return myFlags & EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION; }
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
// state of EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY flag;
// In each group, the cdr of nodes are substituted by the first one
// in all elements.
- typedef std::list< std::list< int > > TListOfListOfElementsID;
+ typedef std::list< std::list< smIdType > > TListOfListOfElementsID;
void FindEqualElements(TIDSortedElemSet & theElements,
TListOfListOfElementsID & theGroupsOfElementsID);
/*!
* \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,
- SMESH_MesherHelper& theHelper,
- const bool theForce3d);
+ smIdType convertElemToQuadratic(SMESHDS_SubMesh * theSm,
+ SMESH_MesherHelper& theHelper,
+ const bool theForce3d);
/*!
* \brief Convert quadratic elements to linear ones and remove quadratic nodes
* \return nb of checked elements
*/
- int removeQuadElem( SMESHDS_SubMesh * theSm,
- SMDS_ElemIteratorPtr theItr,
- const int theShapeID);
+ smIdType removeQuadElem( SMESHDS_SubMesh * theSm,
+ SMDS_ElemIteratorPtr theItr,
+ const int theShapeID);
/*!
* \brief Create groups of elements made during transformation
* \param nodeGens - nodes making corresponding myLastCreatedNodes
//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)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
//=======================================================================
SMDS_MeshFace* SMESH_MesherHelper::AddPolygonalFace (const vector<const SMDS_MeshNode*>& nodes,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
const SMDS_MeshNode* n6,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMDS_MeshVolume* elem = 0;
const SMDS_MeshNode* n6,
const SMDS_MeshNode* n7,
const SMDS_MeshNode* n8,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n10,
const SMDS_MeshNode* n11,
const SMDS_MeshNode* n12,
- const int id,
+ const smIdType id,
bool /*force3d*/)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshVolume*
SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh()
{
- int NbAllEdgsAndFaces=0;
- int NbQuadFacesAndEdgs=0;
- int NbFacesAndEdges=0;
+ smIdType NbAllEdgsAndFaces=0;
+ smIdType NbQuadFacesAndEdgs=0;
+ smIdType NbFacesAndEdges=0;
//All faces and edges
NbAllEdgsAndFaces = myMesh->NbEdges() + myMesh->NbFaces();
if ( NbAllEdgsAndFaces == 0 )
/*!
* 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
*/
SMDS_MeshEdge* AddEdge(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = true);
/*!
* Creates quadratic or linear triangle
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
- const int id=0,
+ const smIdType id=0,
const bool force3d = false);
/*!
* Creates bi-quadratic, quadratic or linear quadrangle
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = false);
/*!
* Creates polygon, with additional nodes in quadratic mesh
*/
SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = false);
/*!
* Creates quadratic or linear tetrahedron
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = true);
/*!
* Creates quadratic or linear pyramid
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = true);
/*!
* Creates quadratic or linear pentahedron
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
const SMDS_MeshNode* n6,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = true);
/*!
* Creates bi-quadratic, quadratic or linear hexahedron
const SMDS_MeshNode* n6,
const SMDS_MeshNode* n7,
const SMDS_MeshNode* n8,
- const int id = 0,
+ const smIdType id = 0,
bool force3d = true);
/*!
const SMDS_MeshNode* n10,
const SMDS_MeshNode* n11,
const SMDS_MeshNode* n12,
- const int id = 0,
+ const smIdType id = 0,
bool force3d = true);
/*!
*/
SMDS_MeshVolume* AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities,
- const int ID=0,
+ const smIdType ID=0,
const bool force3d = true);
/*!
* \brief Enables fixing node parameters on EDGEs and FACEs by
SMESH_MesherHelper (const SMESH_MesherHelper& theOther);
// 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,
const SMDS_MeshNode* n2,
SMESH_MesherHelper helper( *theMesh );
helper.SetSubShape( theFace );
- int nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() );
- int nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() );
+ smIdType nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() );
+ smIdType nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() );
if ( nbElems == 0 && aMeshDS->NbFaces() == 0 )
{
MESSAGE( "No elements bound to the face");
return setErrorCode( ERR_LOADV_BAD_SHAPE );
// count nodes
- int nbNodes = 0, shapeID;
+ smIdType nbNodes = 0; int shapeID;
for ( shapeID = 1; shapeID <= myShapeIDMap.Extent(); shapeID++ )
{
const TopoDS_Shape& S = myShapeIDMap( shapeID );
subMesh->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
}
if ( onMeshElements ) {
- list< int > elemIDs;
+ list< smIdType > elemIDs;
for ( size_t i = 0; i < theElements.size(); i++ )
{
subMesh = theMesh->GetSubMeshContaining( shapeIDs[ i ] );
*/
//================================================================================
-int SMESH_ProxyMesh::NbFaces() const
+smIdType SMESH_ProxyMesh::NbFaces() const
{
- int nb = 0;
+ smIdType nb = 0;
if ( _mesh->HasShapeToMesh() )
{
TopTools_IndexedMapOfShape FF;
*/
//================================================================================
-int SMESH_ProxyMesh::SubMesh::NbElements() const
+smIdType SMESH_ProxyMesh::SubMesh::NbElements() const
{
return _uvPtStructVec.empty() ? _elements.size() : _uvPtStructVec.size() - 1;
}
*/
//================================================================================
-int SMESH_ProxyMesh::SubMesh::NbNodes() const
+smIdType SMESH_ProxyMesh::SubMesh::NbNodes() const
{
return _uvPtStructVec.size();
}
#include <TopoDS_Shape.hxx>
#include <NCollection_DataMap.hxx>
+#include <smIdType.hxx>
#include <map>
#include <vector>
const SMDS_MeshNode* GetProxyNode( const SMDS_MeshNode* n ) const;
const UVPtStructVec& GetUVPtStructVec() const { return _uvPtStructVec; }
virtual void AddElement(const SMDS_MeshElement * e);
- virtual int NbElements() const;
- virtual int NbNodes() const;
+ virtual smIdType NbElements() const;
+ virtual smIdType NbNodes() const;
virtual SMDS_ElemIteratorPtr GetElements() const;
virtual SMDS_NodeIteratorPtr GetNodes() const;
virtual void Clear();
SMDS_ElemIteratorPtr GetFaces(const TopoDS_Shape& face) const;
// Return total nb of faces taking into account substitutions
- int NbFaces() const;
+ smIdType NbFaces() const;
bool IsTemporary(const SMDS_MeshElement* elem ) const;
if (SMESHDS_SubMesh * subMeshDS = subMesh->GetSubMeshDS())
{
SMESHDS_Mesh * meshDS = subMesh->GetFather()->GetMeshDS();
- int nbElems = subMeshDS->NbElements();
+ smIdType nbElems = subMeshDS->NbElements();
if ( nbElems > 0 )
for ( SMDS_ElemIteratorPtr ite = subMeshDS->GetElements(); ite->more(); )
meshDS->RemoveFreeElement( ite->next(), subMeshDS );
- int nbNodes = subMeshDS->NbNodes();
+ smIdType nbNodes = subMeshDS->NbNodes();
if ( nbNodes > 0 )
for ( SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes(); itn->more() ; )
{
bool ret = true;
if (_subShape.ShapeType() == TopAbs_VERTEX) {
- vector<int> aVec(SMDSEntity_Last,0);
+ vector<smIdType> aVec(SMDSEntity_Last,0);
aVec[SMDSEntity_Node] = 1;
aResMap.insert(make_pair(this,aVec));
return ret;
SMESH_subMesh* sm = smIt->next();
int dim = SMESH_Gen::GetShapeDim( sm->GetSubShape() );
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 );
}
if ( !subMeshEvaluated )
if ( IsMeshComputed() )
{
- vector<int> & nbEntities = aResMap[ this ];
+ vector<smIdType> & nbEntities = aResMap[ this ];
nbEntities.resize( SMDSEntity_Last, 0 );
if ( SMESHDS_SubMesh* sm = GetSubMeshDS() )
{
{
ret = algo->Evaluate((*_father), _subShape, aResMap);
}
- aResMap.insert( make_pair( this,vector<int>(0)));
+ aResMap.insert( make_pair( this,vector<smIdType>(0)));
}
return ret;
#include "SALOME_LifeCycleCORBA.hxx"
#include <SALOMEconfig.h>
+#include <smIdType.hxx>
#include CORBA_SERVER_HEADER(SALOME_Component)
#include CORBA_SERVER_HEADER(SALOME_Exception)
//=======================================================================
inline void AddNodesWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(3*aNbElems != (CORBA::Long) aCoords.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(3*aNbElems != (SMESH::smIdType) 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],
aCoords[aCoordId+1],
aCoords[aCoordId+2],
//=======================================================================
inline void Add0DElementsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if (2*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if (2*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != aCoords.length()");
- CORBA::Long anIndexId = 0;
+ SMESH::smIdType anIndexId = 0;
for (; anElemId < aNbElems; anElemId++, anIndexId+=2)
{
SMDS_MeshElement* anElem = theMesh->Add0DElementWithID(anIndexes[anIndexId+1],
//=======================================================================
inline void AddBallsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::double_array& aDiameter = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if (2*aNbElems != (CORBA::Long) anIndexes.length() )
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if (2*aNbElems != (SMESH::smIdType) 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()");
- CORBA::Long anIndexId = 0;
+ SMESH::smIdType anIndexId = 0;
for (; anElemId < aNbElems; anElemId++, anIndexId+=2)
{
SMDS_MeshElement* anElem = theMesh->AddBallWithID(anIndexes[anIndexId+1],
//=======================================================================
inline void AddEdgesWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(3*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(3*aNbElems != (SMESH::smIdType) anIndexes.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],
anIndexes[anIndexId+2],
anIndexes[anIndexId]);
//=======================================================================
inline void AddTriasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(4*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(4*aNbElems != (SMESH::smIdType) 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],
anIndexes[anIndexId+2],
anIndexes[anIndexId+3],
//=======================================================================
inline void AddQuadsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(5*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(5*aNbElems != (SMESH::smIdType) 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],
anIndexes[anIndexId+2],
anIndexes[anIndexId+3],
//=======================================================================
inline void AddPolygonsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
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++) {
- int aFaceId = anIndexes[anIndexId++];
+ for (SMESH::smIdType anElemId = 0; anElemId < aNbElems; anElemId++) {
+ smIdType aFaceId = 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++) {
nodes_ids[i] = anIndexes[anIndexId++];
}
//=======================================================================
inline void AddQuadPolygonsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
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++) {
- int aFaceId = anIndexes[anIndexId++];
+ for (SMESH::smIdType anElemId = 0; anElemId < aNbElems; anElemId++) {
+ smIdType aFaceId = 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++) {
nodes_ids[i] = anIndexes[anIndexId++];
}
//=======================================================================
inline void AddTetrasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(5*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(5*aNbElems != (SMESH::smIdType) 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],
anIndexes[anIndexId+2],
anIndexes[anIndexId+3],
//=======================================================================
inline void AddPiramidsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(6*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(6*aNbElems != (SMESH::smIdType) 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],
anIndexes[anIndexId+2],
anIndexes[anIndexId+3],
//=======================================================================
inline void AddPrismsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number;
for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) {
- int aFaceId = anIndexes[anIndexId++];
+ smIdType aFaceId = 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++) {
nodes_ids[i] = anIndexes[anIndexId++];
}
//function :
//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)
{
//function :
//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)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::Add0DElement(int New0DElementID, int idnode)
+void SMESHDS_Command::Add0DElement(smIdType New0DElementID, smIdType idnode)
{
if ( myType != SMESHDS_Add0DElement)
{
//function :
//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)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddFace(int NewFaceID,
- int idnode1, int idnode2, int idnode3)
+void SMESHDS_Command::AddFace(smIdType NewFaceID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3)
{
if ( myType != SMESHDS_AddTriangle)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddFace(int NewFaceID,
- int idnode1, int idnode2, int idnode3, int idnode4)
+void SMESHDS_Command::AddFace(smIdType NewFaceID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4)
{
if ( myType != SMESHDS_AddQuadrangle)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1, int idnode2, int idnode3, int idnode4)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4)
{
if ( myType != SMESHDS_AddTetrahedron)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1, int idnode2, int idnode3, int idnode4, int idnode5)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4, smIdType idnode5)
{
if ( myType != SMESHDS_AddPyramid)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,
- int idnode2, int idnode3, int idnode4, int idnode5, int idnode6)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1,
+ smIdType idnode2, smIdType idnode3, smIdType idnode4, smIdType idnode5, smIdType idnode6)
{
if ( myType != SMESHDS_AddPrism)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,
- int idnode2,
- int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1,
+ smIdType idnode2,
+ smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8)
{
if ( myType != SMESHDS_AddHexahedron)
{
myNumber++;
}
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,int idnode2,int idnode3,int idnode4,
- int idnode5, int idnode6, int idnode7, int idnode8,
- int idnode9, int idnode10, int idnode11, int idnode12)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1,smIdType idnode2,smIdType idnode3,smIdType idnode4,
+ smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
+ smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12)
{
if (myType != SMESHDS_AddHexagonalPrism)
{
//function : AddPolygonalFace
//purpose :
//=======================================================================
-void SMESHDS_Command::AddPolygonalFace (const int ElementID,
- const std::vector<int>& nodes_ids)
+void SMESHDS_Command::AddPolygonalFace (const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids)
{
if ( myType != SMESHDS_AddPolygon) {
MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type");
}
myIntegers.push_back(ElementID);
- int i, nbNodes = nodes_ids.size();
+ smIdType i, nbNodes = nodes_ids.size();
myIntegers.push_back(nbNodes);
for (i = 0; i < nbNodes; i++) {
myIntegers.push_back(nodes_ids[i]);
//function : AddQuadPolygonalFace
//purpose :
//=======================================================================
-void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID,
- const std::vector<int>& nodes_ids)
+void SMESHDS_Command::AddQuadPolygonalFace (const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids)
{
if ( myType != SMESHDS_AddQuadPolygon) {
MESSAGE("SMESHDS_Command::AddQuadraticPolygonalFace : Bad Type");
}
myIntegers.push_back(ElementID);
- int i, nbNodes = nodes_ids.size();
+ smIdType i, nbNodes = nodes_ids.size();
myIntegers.push_back(nbNodes);
for (i = 0; i < nbNodes; i++) {
myIntegers.push_back(nodes_ids[i]);
//function : AddPolyhedralVolume
//purpose :
//=======================================================================
-void SMESHDS_Command::AddPolyhedralVolume (const int ElementID,
- const std::vector<int>& nodes_ids,
- const std::vector<int>& quantities)
+void SMESHDS_Command::AddPolyhedralVolume (const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids,
+ const std::vector<int>& quantities)
{
if ( myType != SMESHDS_AddPolyhedron) {
MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type");
}
myIntegers.push_back(ElementID);
- int i, nbNodes = nodes_ids.size();
+ smIdType i, nbNodes = nodes_ids.size();
myIntegers.push_back(nbNodes);
for (i = 0; i < nbNodes; i++) {
myIntegers.push_back(nodes_ids[i]);
}
- int nbFaces = quantities.size();
+ smIdType nbFaces = quantities.size();
myIntegers.push_back(nbFaces);
for (i = 0; i < nbFaces; i++) {
myIntegers.push_back(quantities[i]);
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::RemoveNode(int NodeID)
+void SMESHDS_Command::RemoveNode(smIdType NodeID)
{
if ( myType != SMESHDS_RemoveNode)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::RemoveElement(int ElementID)
+void SMESHDS_Command::RemoveElement(smIdType ElementID)
{
if ( myType != SMESHDS_RemoveElement)
{
//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)
{
}
myIntegers.push_back(ElementID);
myIntegers.push_back(nbnodes);
- for ( int i = 0; i < nbnodes; i++ )
+ for ( smIdType i = 0; i < nbnodes; i++ )
myIntegers.push_back( nodes[ i ] );
myNumber++;
//function : ChangePolyhedronNodes
//purpose :
//=======================================================================
-void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID,
- const std::vector<int>& nodes_ids,
+void SMESHDS_Command::ChangePolyhedronNodes (const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities)
{
if (myType != SMESHDS_ChangePolyhedronNodes)
}
myIntegers.push_back(ElementID);
- int i, nbNodes = nodes_ids.size();
+ smIdType i, nbNodes = nodes_ids.size();
myIntegers.push_back(nbNodes);
for (i = 0; i < nbNodes; i++) {
myIntegers.push_back(nodes_ids[i]);
//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)
{
//function :
//purpose :
//=======================================================================
-int SMESHDS_Command::GetNumber()
+smIdType SMESHDS_Command::GetNumber()
{
return myNumber;
}
//function :
//purpose :
//=======================================================================
-const list < int >&SMESHDS_Command::GetIndexes()
+const list < smIdType >&SMESHDS_Command::GetIndexes()
{
return myIntegers;
}
//function : AddEdge
//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) {
MESSAGE("SMESHDS_Command::AddEdge : Bad Type");
//function : AddFace
//purpose :
//=======================================================================
-void SMESHDS_Command::AddFace(int NewFaceID,
- int n1, int n2, int n3,
- int n12, int n23, int n31)
+void SMESHDS_Command::AddFace(smIdType NewFaceID,
+ smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12, smIdType n23, smIdType n31)
{
if ( myType != SMESHDS_AddQuadTriangle) {
MESSAGE("SMESHDS_Command::AddFace : Bad Type");
//function : AddFace
//purpose :
//=======================================================================
-void SMESHDS_Command::AddFace(int NewFaceID,
- int n1, int n2, int n3,
- int n12, int n23, int n31, int nCenter)
+void SMESHDS_Command::AddFace(smIdType NewFaceID,
+ smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12, smIdType n23, smIdType n31, smIdType nCenter)
{
if ( myType != SMESHDS_AddBiQuadTriangle) {
MESSAGE("SMESHDS_Command::AddFace : Bad Type");
//function : AddFace
//purpose :
//=======================================================================
-void SMESHDS_Command::AddFace(int NewFaceID,
- int n1, int n2, int n3, int n4,
- int n12, int n23, int n34, int n41)
+void SMESHDS_Command::AddFace(smIdType NewFaceID,
+ smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41)
{
if ( myType != SMESHDS_AddQuadQuadrangle) {
MESSAGE("SMESHDS_Command::AddFace : Bad Type");
//function : AddFace
//purpose :
//=======================================================================
-void SMESHDS_Command::AddFace(int NewFaceID,
- int n1, int n2, int n3, int n4,
- int n12, int n23, int n34, int n41, int nCenter)
+void SMESHDS_Command::AddFace(smIdType NewFaceID,
+ smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter)
{
if (myType != SMESHDS_AddBiQuadQuadrangle) {
MESSAGE("SMESHDS_Command::AddFace : Bad Type");
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n31,
- int n14, int n24, int n34)
+void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n31,
+ smIdType n14, smIdType n24, smIdType n34)
{
if ( myType != SMESHDS_AddQuadTetrahedron) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2,
- int n3, int n4, int n5,
- int n12, int n23, int n34, int n41,
- int n15, int n25, int n35, int n45)
+void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2,
+ smIdType n3, smIdType n4, smIdType n5,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n15, smIdType n25, smIdType n35, smIdType n45)
{
if ( myType != SMESHDS_AddQuadPyramid) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2,
- int n3, int n4, int n5,int n6,
- int n12, int n23, int n31,
- int n45, int n56, int n64,
- int n14, int n25, int n36)
+void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2,
+ smIdType n3, smIdType n4, smIdType n5,smIdType n6,
+ smIdType n12, smIdType n23, smIdType n31,
+ smIdType n45, smIdType n56, smIdType n64,
+ smIdType n14, smIdType n25, smIdType n36)
{
if ( myType != SMESHDS_AddQuadPentahedron) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2,
- int n3, int n4, int n5,int n6,
- int n12, int n23, int n31,
- int n45, int n56, int n64,
- int n14, int n25, int n36,
- int n1245, int n2356, int n1346)
+void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2,
+ smIdType n3, smIdType n4, smIdType n5,smIdType n6,
+ smIdType n12, smIdType n23, smIdType n31,
+ smIdType n45, smIdType n56, smIdType n64,
+ smIdType n14, smIdType n25, smIdType n36,
+ smIdType n1245, smIdType n2356, smIdType n1346)
{
if ( myType != SMESHDS_AddBiQuadPentahedron) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3,
- int n4, int n5, int n6, int n7, int n8,
- int n12, int n23, int n34, int n41,
- int n56, int n67, int n78, int n85,
- int n15, int n26, int n37, int n48)
+void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n56, smIdType n67, smIdType n78, smIdType n85,
+ smIdType n15, smIdType n26, smIdType n37, smIdType n48)
{
if ( myType != SMESHDS_AddQuadHexahedron) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3,
- int n4, int n5, int n6, int n7, int n8,
- int n12, int n23, int n34, int n41,
- int n56, int n67, int n78, int n85,
- int n15, int n26, int n37, int n48,
- int n1234,int n1256,int n2367,int n3478,
- int n1458,int n5678,int nCenter)
+void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n56, smIdType n67, smIdType n78, smIdType n85,
+ smIdType n15, smIdType n26, smIdType n37, smIdType n48,
+ smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
+ smIdType n1458,smIdType n5678,smIdType nCenter)
{
if ( myType != SMESHDS_AddTriQuadHexa) {
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
*/
//================================================================================
-void SMESHDS_Command::AddBall(int NewBallID, int node, double diameter)
+void SMESHDS_Command::AddBall(smIdType NewBallID, smIdType node, double diameter)
{
if ( myType != SMESHDS_AddBall)
{
#include "SMESH_SMESHDS.hxx"
#include "SMESHDS_CommandType.hxx"
+#include <smIdType.hxx>
#include <list>
#include <vector>
public:
SMESHDS_Command(const SMESHDS_CommandType aType);
- void AddNode(int NewNodeID, double x, double y, double z);
- void Add0DElement(int New0DElementID, int idnode);
- void AddEdge(int NewEdgeID, int idnode1, int idnode2);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
- int idnode9, int idnode10, int idnode11, int idnode12);
- void AddPolygonalFace (const int ElementID,
- const std::vector<int>& nodes_ids);
- void AddQuadPolygonalFace (const int ElementID,
- const std::vector<int>& nodes_ids);
- void AddPolyhedralVolume (const int ElementID,
- const std::vector<int>& nodes_ids,
- const std::vector<int>& quantities);
- void AddBall(int NewBallID, int node, double diameter);
+ void AddNode(smIdType NewNodeID, double x, double y, double z);
+ void Add0DElement(smIdType New0DElementID, smIdType idnode);
+ void AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2);
+ void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3);
+ void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
+ smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12);
+ void AddPolygonalFace (const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids);
+ void AddQuadPolygonalFace (const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids);
+ void AddPolyhedralVolume (const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids,
+ const std::vector<int>& quantities);
+ void AddBall(smIdType NewBallID, smIdType node, double diameter);
// special methods for quadratic elements
- void AddEdge(int NewEdgeID, int n1, int n2, int n12);
- void AddFace(int NewFaceID, int n1, int n2, int n3,
- int n12, int n23, int n31);
- void AddFace(int NewFaceID, int n1, int n2, int n3,
- int n12, int n23, int n31, int nCenter);
- void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n34, int n41);
- void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n34, int n41, int nCenter);
- void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n31, int n14, int n24, int n34);
- void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5,
- int n12, int n23, int n34, int n41,
- int n15, int n25, int n35, int n45);
- void AddVolume(int NewVolID, int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12, int n23, int n31,
- int n45, int n56, int n64,
- int n14, int n25, int n36);
- void AddVolume(int NewVolID, int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12, int n23, int n31,
- int n45, int n56, int n64,
- int n14, int n25, int n36,
- int n1245, int n2356, int n1346);
- void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12, int n23, int n34, int n41,
- int n56, int n67, int n78, int n85,
- int n15, int n26, int n37, int n48);
- void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12, int n23, int n34, int n41,
- int n56, int n67, int n78, int n85,
- int n15, int n26, int n37, int n48,
- int n1234,int n1256,int n2367,int n3478,
- int n1458,int n5678,int nCenter);
+ void AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12);
+ void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12, smIdType n23, smIdType n31);
+ void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12, smIdType n23, smIdType n31, smIdType nCenter);
+ void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41);
+ void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n31, smIdType n14, smIdType n24, smIdType n34);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n15, smIdType n25, smIdType n35, smIdType n45);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12, smIdType n23, smIdType n31,
+ smIdType n45, smIdType n56, smIdType n64,
+ smIdType n14, smIdType n25, smIdType n36);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12, smIdType n23, smIdType n31,
+ smIdType n45, smIdType n56, smIdType n64,
+ smIdType n14, smIdType n25, smIdType n36,
+ smIdType n1245, smIdType n2356, smIdType n1346);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n56, smIdType n67, smIdType n78, smIdType n85,
+ smIdType n15, smIdType n26, smIdType n37, smIdType n48);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n56, smIdType n67, smIdType n78, smIdType n85,
+ smIdType n15, smIdType n26, smIdType n37, smIdType n48,
+ smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
+ smIdType n1458,smIdType n5678,smIdType nCenter);
- void MoveNode(int NewNodeID, double x, double y, double z);
- void RemoveNode(int NodeID);
- void RemoveElement(int ElementID);
- void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
- void ChangePolyhedronNodes(const int ElementID,
- const std::vector<int>& nodes_ids,
+ void MoveNode(smIdType NewNodeID, double x, double y, double z);
+ void RemoveNode(smIdType NodeID);
+ void RemoveElement(smIdType ElementID);
+ void ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes);
+ void ChangePolyhedronNodes(const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids,
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();
- int GetNumber();
- const std::list<int> & GetIndexes();
+ smIdType GetNumber();
+ const std::list<smIdType> & GetIndexes();
const std::list<double> & GetCoords();
~SMESHDS_Command();
private:
SMESHDS_CommandType myType;
int myNumber;
std::list<double> myReals;
- std::list<int> myIntegers;
+ std::list<smIdType> myIntegers;
};
#endif
//purpose :
//=======================================================================
-int SMESHDS_Group::Extent() const
+smIdType SMESHDS_Group::Extent() const
{
return myGroup.Extent();
}
*/
//=============================================================================
-bool SMESHDS_Group::Contains (const int theID)
+bool SMESHDS_Group::Contains (const smIdType theID)
{
const SMDS_MeshElement* aElem = findInMesh (theID);
if (aElem)
*/
//=============================================================================
-bool SMESHDS_Group::Add (const int theID)
+bool SMESHDS_Group::Add (const smIdType theID)
{
return Add( findInMesh( theID ));
}
*/
//=============================================================================
-bool SMESHDS_Group::Remove (const int theID)
+bool SMESHDS_Group::Remove (const smIdType theID)
{
bool removed = false;
if ( const SMDS_MeshElement* aElem = findInMesh( theID ))
virtual void SetType(SMDSAbs_ElementType theType);
- virtual int Extent() const;
+ virtual smIdType Extent() const;
virtual bool IsEmpty();
- virtual bool Contains (const int theID);
+ virtual bool Contains (const smIdType theID);
virtual bool Contains (const SMDS_MeshElement* elem);
virtual int GetTic() const;
- bool Add (const int theID);
+ bool Add (const smIdType theID);
bool Add (const SMDS_MeshElement* theElem );
- bool Remove (const int theID);
+ bool Remove (const smIdType theID);
void Clear();
*/
//=============================================================================
-int SMESHDS_GroupBase::GetID (const int theIndex)
+smIdType SMESHDS_GroupBase::GetID (const int theIndex)
{
if (myCurIndex < 1 || myCurIndex > theIndex) {
myIterator = GetElements();
*/
//=============================================================================
-const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const int theID) const
+const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const smIdType theID) const
{
SMDSAbs_ElementType aType = GetType();
const SMDS_MeshElement* aElem = NULL;
//purpose :
//=======================================================================
-int SMESHDS_GroupBase::Extent() const
+smIdType SMESHDS_GroupBase::Extent() const
{
SMDS_ElemIteratorPtr it = GetElements();
- int nb = 0;
+ smIdType nb = 0;
if ( it )
for ( ; it->more(); it->next() )
nb++;
//purpose :
//=======================================================================
-bool SMESHDS_GroupBase::Contains (const int theID)
+bool SMESHDS_GroupBase::Contains (const smIdType theID)
{
if ( SMDS_ElemIteratorPtr it = GetElements() ) {
while ( it->more() )
const char* GetStoreName () const { return myStoreName.c_str(); }
- virtual int Extent() const;
+ virtual smIdType Extent() const;
virtual bool IsEmpty();
- virtual bool Contains (const int theID);
+ virtual bool Contains (const smIdType theID);
virtual bool Contains (const SMDS_MeshElement* elem);
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()
virtual int GetTic() const = 0;
{ myDefaultColor = theColor;}
protected:
- const SMDS_MeshElement* findInMesh (const int theID) const;
+ const SMDS_MeshElement* findInMesh (const smIdType theID) const;
void resetIterator();
private:
Quantity_Color myColor;
// for GetID()
- int myCurIndex;
- int myCurID;
+ smIdType myCurIndex;
+ smIdType myCurID;
SMDS_ElemIteratorPtr myIterator;
static Quantity_Color myDefaultColor;
*/
//================================================================================
-int SMESHDS_GroupOnFilter::Extent() const
+smIdType SMESHDS_GroupOnFilter::Extent() const
{
update();
return std::accumulate( myMeshInfo.begin(), myMeshInfo.end(), 0 );
*/
//================================================================================
-bool SMESHDS_GroupOnFilter::Contains (const int theID)
+bool SMESHDS_GroupOnFilter::Contains (const smIdType theID)
{
return myPredicate && myPredicate->IsSatisfy( theID );
}
*/
//================================================================================
-std::vector< int > SMESHDS_GroupOnFilter::GetMeshInfo() const
+std::vector< smIdType > SMESHDS_GroupOnFilter::GetMeshInfo() const
{
update();
return myMeshInfo;
if ( IsUpToDate() )
{
for ( ; elIt->more(); curID += idSize )
- (*(int*) curID) = elIt->next()->GetID();
+ (*(smIdType*) curID) = elIt->next()->GetID();
}
else
{
me->myMeshInfo.assign( SMDSEntity_Last, 0 );
me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
- (*(int*) curID) = firstOkElem->GetID();
+ (*(smIdType*) curID) = firstOkElem->GetID();
for ( curID += idSize; elIt->more(); curID += idSize )
{
const SMDS_MeshElement* e = elIt->next();
- (*(int*) curID) = e->GetID();
+ (*(smIdType*) curID) = e->GetID();
me->myMeshInfo[ e->GetEntityType() ]++;
}
}
return false; // no sense in parallel work
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()
SMESH_PredicatePtr clone( myPredicate->clone() );
if ( !clone )
TLocalPredicat threadPredicates;
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 );
tbb::parallel_for ( tbb::blocked_range<size_t>( 0, isElemOK.size() ),
SMESH_PredicatePtr GetPredicate() const { return myPredicate; }
- std::vector< int > GetMeshInfo() const;
+ std::vector< smIdType > GetMeshInfo() const;
template< typename IDTYPE >
- int GetElementIds( IDTYPE* ids ) const
+ smIdType GetElementIds( IDTYPE* ids ) const
{
return getElementIds( (void*)ids, sizeof(IDTYPE));
}
- virtual int Extent() const;
+ virtual smIdType Extent() const;
virtual bool IsEmpty();
- virtual bool Contains (const int theID);
+ virtual bool Contains (const smIdType theID);
virtual bool Contains (const SMDS_MeshElement* elem);
// 2) The case of enough free memory. Remember all OK elements (myElements).
SMESH_PredicatePtr myPredicate;
- std::vector< int > myMeshInfo;
+ std::vector< smIdType > myMeshInfo;
std::vector< const SMDS_MeshElement*> myElements;
bool myElementsOK;
size_t myMeshModifTime; // when myMeshInfo was updated
//purpose :
//=======================================================================
-bool SMESHDS_GroupOnGeom::Contains (const int theID)
+bool SMESHDS_GroupOnGeom::Contains (const smIdType theID)
{
return mySubMesh->Contains( findInMesh( theID ));
}
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);
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);
if(node!=NULL) myScript->AddNode(node->GetID(), x, y, z);
return node;
if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes ))
return false;
- std::vector<int> IDs( nbnodes );
- for ( int i = 0; i < nbnodes; i++ )
+ std::vector<smIdType> IDs( nbnodes );
+ for ( smIdType i = 0; i < nbnodes; i++ )
IDs [ i ] = nodes[ i ]->GetID();
myScript->ChangeElementNodes( elem->GetID(), &IDs[0], nbnodes);
if ( !SMDS_Mesh::ChangePolyhedronNodes( elem, nodes, quantities ))
return false;
- int i, len = nodes.size();
- std::vector<int> nodes_ids (len);
+ smIdType i, len = nodes.size();
+ std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID();
}
//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.
if ( !this->IsCompacted() )
//function : Add0DElement
//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);
if (anElem) myScript->Add0DElement(ID, nodeID);
}
SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID
-(const SMDS_MeshNode * node, int ID)
+(const SMDS_MeshNode * node, smIdType ID)
{
return Add0DElementWithID(node->GetID(), ID);
}
//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);
if (anElem) myScript->AddBall(anElem->GetID(), node, diameter);
SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(const SMDS_MeshNode * node,
double diameter,
- int ID)
+ smIdType ID)
{
SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID);
if (anElem) myScript->AddBall(anElem->GetID(), node->GetID(), diameter);
//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);
if(anElem) myScript->AddEdge(ID,n1,n2);
SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
- int ID)
+ smIdType ID)
{
return AddEdgeWithID(n1->GetID(),
n2->GetID(),
//function :AddFace
//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);
if(anElem) myScript->AddFace(ID,n1,n2,n3);
SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
- int ID)
+ smIdType ID)
{
return AddFaceWithID(n1->GetID(),
n2->GetID(),
//function :AddFace
//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);
if(anElem) myScript->AddFace(ID, n1, n2, n3, n4);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- int ID)
+ smIdType ID)
{
return AddFaceWithID(n1->GetID(),
n2->GetID(),
//function :AddVolume
//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);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(),
n2->GetID(),
//function :AddVolume
//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);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5);
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(),
n2->GetID(),
//function :AddVolume
//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);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6);
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(),
n2->GetID(),
//function :AddVolume
//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);
if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8);
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(),
n2->GetID(),
//function :AddVolume
//purpose : add hexagonal prism
//=======================================================================
-SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n9, int n10, int n11, int n12,
- int ID)
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n9, smIdType n10, smIdType n11, smIdType n12,
+ smIdType 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);
const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(),
n2->GetID(),
//function : AddPolygonalFace
//purpose :
//=======================================================================
-SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<int>& nodes_ids,
- const int ID)
+SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType>& nodes_ids,
+ const smIdType ID)
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes_ids, ID);
if (anElem) {
SMDS_MeshFace*
SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes,
- const int ID)
+ const smIdType ID)
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes, ID);
if (anElem) {
- int i, len = nodes.size();
- std::vector<int> nodes_ids (len);
+ smIdType i, len = nodes.size();
+ std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID();
}
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFace(nodes);
if (anElem) {
- int i, len = nodes.size();
- std::vector<int> nodes_ids (len);
+ smIdType i, len = nodes.size();
+ std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID();
}
//function : AddQuadPolygonalFace
//purpose :
//=======================================================================
-SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<int>& nodes_ids,
- const int ID)
+SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<smIdType>& nodes_ids,
+ const smIdType ID)
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes_ids, ID);
if (anElem) {
SMDS_MeshFace*
SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*>& nodes,
- const int ID)
+ const smIdType ID)
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes, ID);
if (anElem) {
- int i, len = nodes.size();
- std::vector<int> nodes_ids (len);
+ smIdType i, len = nodes.size();
+ std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID();
}
{
SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFace(nodes);
if (anElem) {
- int i, len = nodes.size();
- std::vector<int> nodes_ids (len);
+ smIdType i, len = nodes.size();
+ std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID();
}
//function : AddPolyhedralVolume
//purpose :
//=======================================================================
-SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<int>& nodes_ids,
- const std::vector<int>& quantities,
- const int ID)
+SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdType>& nodes_ids,
+ const std::vector<int>& quantities,
+ const smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID);
if (anElem) {
SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities,
- const int ID)
+ const smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
if (anElem) {
- int i, len = nodes.size();
- std::vector<int> nodes_ids (len);
+ smIdType i, len = nodes.size();
+ std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID();
}
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolume(nodes, quantities);
if (anElem) {
- int i, len = nodes.size();
- std::vector<int> nodes_ids (len);
+ smIdType i, len = nodes.size();
+ std::vector<smIdType> nodes_ids (len);
for (i = 0; i < len; i++) {
nodes_ids[i] = nodes[i]->GetID();
}
//function : AddEdgeWithID
//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);
if(anElem) myScript->AddEdge(ID,n1,n2,n12);
SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12,
- int ID)
+ smIdType ID)
{
return AddEdgeWithID(n1->GetID(),
n2->GetID(),
//function : AddFaceWithID
//purpose :
//=======================================================================
-SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3,
- int n12,int n23,int n31, int ID)
+SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12,smIdType n23,smIdType n31, smIdType 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);
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
- int ID)
+ smIdType ID)
{
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n12->GetID(), n23->GetID(), n31->GetID(),
//function : AddFaceWithID
//purpose :
//=======================================================================
-SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3,
- int n12,int n23,int n31, int nCenter, int ID)
+SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType 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);
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter,
- int ID)
+ smIdType ID)
{
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n12->GetID(), n23->GetID(), n31->GetID(),
//function : AddFaceWithID
//purpose :
//=======================================================================
-SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n34,int n41, int ID)
+SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ 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);
if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41);
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
- int ID)
+ smIdType ID)
{
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
//function : AddFaceWithID
//purpose :
//=======================================================================
-SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n34,int n41,
- int nCenter, int ID)
+SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType nCenter, smIdType 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);
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter,
- int ID)
+ smIdType ID)
{
return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(),
//function : AddVolumeWithID
//purpose :
//=======================================================================
-SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n31,
- int n14,int n24,int n34, int ID)
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n14,smIdType n24,smIdType n34, smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n12,n23,
n31,n14,n24,n34,ID);
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n12->GetID(), n23->GetID(), n31->GetID(),
//function : AddVolumeWithID
//purpose :
//=======================================================================
-SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5,
- int n12,int n23,int n34,int n41,
- int n15,int n25,int n35,int n45, int ID)
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n15,smIdType n25,smIdType n35,smIdType n45, smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,
n12,n23,n34,n41,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n4->GetID(), n5->GetID(),
//function : AddVolumeWithID
//purpose : 2nd order pentahedron (prism) with 15 nodes
//=======================================================================
-SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12,int n23,int n31,
- int n45,int n56,int n64,
- int n14,int n25,int n36, int ID)
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n45,smIdType n56,smIdType n64,
+ smIdType n14,smIdType n25,smIdType n36, smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,
n12,n23,n31,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n4->GetID(), n5->GetID(), n6->GetID(),
//function : AddVolumeWithID
//purpose : 2nd order pentahedron (prism) with 18 nodes
//=======================================================================
-SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12,int n23,int n31,
- int n45,int n56,int n64,
- int n14,int n25,int n36,
- int n1245, int n2356, int n1346,
- int ID)
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n45,smIdType n56,smIdType n64,
+ smIdType n14,smIdType n25,smIdType n36,
+ smIdType n1245, smIdType n2356, smIdType n1346,
+ smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,
n12,n23,n31,
const SMDS_MeshNode * n1245,
const SMDS_MeshNode * n2356,
const SMDS_MeshNode * n1346,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
n4->GetID(), n5->GetID(), n6->GetID(),
//function : AddVolumeWithID
//purpose :
//=======================================================================
-SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12,int n23,int n34,int n41,
- int n56,int n67,int n78,int n85,
- int n15,int n26,int n37,int n48, int ID)
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n56,smIdType n67,smIdType n78,smIdType n85,
+ smIdType n15,smIdType n26,smIdType n37,smIdType n48, smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8,
n12,n23,n34,n41,
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(),
return anElem;
}
-SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12,int n23,int n34,int n41,
- int n56,int n67,int n78,int n85,
- int n15,int n26,int n37,int n48,
- int n1234,int n1256,int n2367,int n3478,
- int n1458,int n5678,int nCenter,
- int ID)
+SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n56,smIdType n67,smIdType n78,smIdType n85,
+ smIdType n15,smIdType n26,smIdType n37,smIdType n48,
+ smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
+ smIdType n1458,smIdType n5678,smIdType nCenter,
+ smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8,
n12,n23,n34,n41,
const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter,
- int ID)
+ smIdType ID)
{
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(),
n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(),
* @param localClonedNodeIds map old node id to new node id.
* @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);
return true;
bool AddHypothesis(const TopoDS_Shape & SS, 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_Mesh0DElement* Add0DElementWithID(int nodeID, int ID);
- virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * node, int ID);
+ virtual SMDS_Mesh0DElement* Add0DElementWithID(smIdType nodeID, smIdType ID);
+ virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * node, smIdType ID);
virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * node);
- virtual SMDS_BallElement* AddBallWithID(int n, double diameter, int ID);
- virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * 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, smIdType ID);
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,
const SMDS_MeshNode * n2,
- int ID);
+ smIdType ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12,
- int ID);
+ smIdType ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12);
// 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3);
// 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4);
// 2d order triangle of 6 nodes
- virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
- int n12,int n23,int n31, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12,smIdType n23,smIdType n31, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n31);
// biquadratic triangle of 7 nodes
- virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
- int n12,int n23,int n31, int nCenter, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * nCenter);
// 2d order quadrangle
- virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n34,int n41, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n41);
// biquadratic quadrangle of 9 nodes
- virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n34,int n41, int nCenter, int ID);
+ virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter,
- int ID);
+ smIdType ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter);
// 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4);
// 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5);
// 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6);
// 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,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8);
// hexagonal prism of 12 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6,
- int n7, int n8, int n9, int n10, int n11, int n12, int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6,
+ smIdType n7, smIdType n8, smIdType n9, smIdType n10, smIdType n11, smIdType n12, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12);
// 2d order tetrahedron of 10 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n12,int n23,int n31,
- int n14,int n24,int n34, int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n14,smIdType n24,smIdType n34, smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n34);
// 2d order pyramid of 13 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5,
- int n12,int n23,int n34,int n41,
- int n15,int n25,int n35,int n45,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n15,smIdType n25,smIdType n35,smIdType n45,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n45);
// 2d order Pentahedron with 15 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12,int n23,int n31,
- int n45,int n56,int n64,
- int n14,int n25,int n36,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n45,smIdType n56,smIdType n64,
+ smIdType n14,smIdType n25,smIdType n36,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n36);
// 2d order Pentahedron with 18 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12,int n23,int n31,
- int n45,int n56,int n64,
- int n14,int n25,int n36,
- int n1245, int n2356, int n1346,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12,smIdType n23,smIdType n31,
+ smIdType n45,smIdType n56,smIdType n64,
+ smIdType n14,smIdType n25,smIdType n36,
+ smIdType n1245, smIdType n2356, smIdType n1346,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n1245,
const SMDS_MeshNode * n2356,
const SMDS_MeshNode * n1346,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n1346);
// 2d order Hexahedrons with 20 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12,int n23,int n34,int n41,
- int n56,int n67,int n78,int n85,
- int n15,int n26,int n37,int n48,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n56,smIdType n67,smIdType n78,smIdType n85,
+ smIdType n15,smIdType n26,smIdType n37,smIdType n48,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n48);
// 2d order Hexahedrons with 27 nodes
- virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12,int n23,int n34,int n41,
- int n56,int n67,int n78,int n85,
- int n15,int n26,int n37,int n48,
- int n1234,int n1256,int n2367,int n3478,
- int n1458,int n5678,int nCenter,
- int ID);
+ virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12,smIdType n23,smIdType n34,smIdType n41,
+ smIdType n56,smIdType n67,smIdType n78,smIdType n85,
+ smIdType n15,smIdType n26,smIdType n37,smIdType n48,
+ smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
+ smIdType n1458,smIdType n5678,smIdType nCenter,
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter,
- int ID);
+ smIdType ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter);
- virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<int>& nodes_ids,
- const int ID);
+ virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<smIdType>& nodes_ids,
+ const smIdType ID);
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* AddQuadPolygonalFaceWithID(const std::vector<int> & nodes_ids,
- const int ID);
+ virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<smIdType> & nodes_ids,
+ const smIdType ID);
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_MeshVolume* AddPolyhedralVolumeWithID
- (const std::vector<int>& nodes_ids,
- const std::vector<int>& quantities,
- const int ID);
+ (const std::vector<smIdType>& nodes_ids,
+ const std::vector<int>& quantities,
+ const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities,
- const int ID);
+ const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*>& nodes,
bool ChangePolyhedronNodes(const SMDS_MeshElement * elem,
const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities);
- bool ModifyCellNodes(int smdsVolId, std::map<int,int> localClonedNodeIds);
- void Renumber (const bool isNodes, const int startID=1, const int deltaID=1);
+ bool ModifyCellNodes(vtkIdType smdsVolId, std::map<int,int> localClonedNodeIds);
+ 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_Solid & S);
// Groups. SMESHDS_Mesh is not an owner of groups
void AddGroup (SMESHDS_GroupBase* theGroup) { myGroups.insert(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; }
bool IsGroupOfSubShapes (const TopoDS_Shape& aSubShape) const;
//function :
//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){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::Add0DElement (int New0DElementID, int idnode)
+void SMESHDS_Script::Add0DElement (smIdType New0DElementID, smIdType idnode)
{
if (myIsEmbeddedMode) {
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddEdge(int NewEdgeID, int idnode1, int idnode2)
+void SMESHDS_Script::AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddFace(int NewFaceID,
- int idnode1, int idnode2, int idnode3)
+void SMESHDS_Script::AddFace(smIdType NewFaceID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddFace(int NewFaceID,
- int idnode1, int idnode2,
- int idnode3, int idnode4)
+void SMESHDS_Script::AddFace(smIdType NewFaceID,
+ smIdType idnode1, smIdType idnode2,
+ smIdType idnode3, smIdType idnode4)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewID,
- int idnode1, int idnode2,
- int idnode3, int idnode4)
+void SMESHDS_Script::AddVolume(smIdType NewID,
+ smIdType idnode1, smIdType idnode2,
+ smIdType idnode3, smIdType idnode4)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewID,
- int idnode1, int idnode2,
- int idnode3, int idnode4, int idnode5)
+void SMESHDS_Script::AddVolume(smIdType NewID,
+ smIdType idnode1, smIdType idnode2,
+ smIdType idnode3, smIdType idnode4, smIdType idnode5)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewID,
- int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6)
+void SMESHDS_Script::AddVolume(smIdType NewID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewID,
- int idnode1, int idnode2, int idnode3, int idnode4,
- int idnode5, int idnode6, int idnode7, int idnode8)
+void SMESHDS_Script::AddVolume(smIdType NewID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4,
+ smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
- int idnode9, int idnode10, int idnode11, int idnode12)
+void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
+ smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddPolygonalFace
//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){
myIsModified = true;
//function : AddQuadPolygonalFace
//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){
myIsModified = true;
//function : AddPolyhedralVolume
//purpose :
//=======================================================================
-void SMESHDS_Script::AddPolyhedralVolume (int NewID,
- const std::vector<int>& nodes_ids,
- const std::vector<int>& quantities)
+void SMESHDS_Script::AddPolyhedralVolume (smIdType NewID,
+ const std::vector<smIdType>& nodes_ids,
+ const std::vector<int>& quantities)
{
if(myIsEmbeddedMode){
myIsModified = true;
//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 )
myIsModified = true;
//function :
//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){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::RemoveNode(int ID)
+void SMESHDS_Script::RemoveNode(smIdType ID)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::RemoveElement(int ElementID)
+void SMESHDS_Script::RemoveElement(smIdType ElementID)
{
if(myIsEmbeddedMode){
myIsModified = true;
//purpose :
//=======================================================================
-void SMESHDS_Script::ChangeElementNodes(int ElementID, int nodes[], int nbnodes)
+void SMESHDS_Script::ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : ChangePolyhedronNodes
//purpose :
//=======================================================================
-void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID,
- const std::vector<int>& nodes_ids,
+void SMESHDS_Script::ChangePolyhedronNodes (const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities)
{
if(myIsEmbeddedMode){
//function : Renumber
//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){
myIsModified = true;
//function : AddEdge
//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){
myIsModified = true;
//function : AddFace
//purpose :
//=======================================================================
-void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3,
- int n12, int n23, int n31)
+void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12, smIdType n23, smIdType n31)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddFace
//purpose :
//=======================================================================
-void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3,
- int n12, int n23, int n31, int nCenter)
+void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12, smIdType n23, smIdType n31, smIdType nCenter)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddFace
//purpose :
//=======================================================================
-void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n34, int n41)
+void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddFace
//purpose :
//=======================================================================
-void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n34, int n41, int nCenter)
+void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n31,
- int n14, int n24, int n34)
+void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n31,
+ smIdType n14, smIdType n24, smIdType n34)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n5, int n12, int n23, int n34, int n41,
- int n15, int n25, int n35, int n45)
+void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n15, smIdType n25, smIdType n35, smIdType n45)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n5,int n6, int n12, int n23, int n31,
- int n45, int n56, int n64,
- int n14, int n25, int n36)
+void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5,smIdType n6, smIdType n12, smIdType n23, smIdType n31,
+ smIdType n45, smIdType n56, smIdType n64,
+ smIdType n14, smIdType n25, smIdType n36)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n5,int n6, int n12, int n23, int n31,
- int n45, int n56, int n64,
- int n14, int n25, int n36,
- int n1245, int n2356, int n1346)
+void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5,smIdType n6, smIdType n12, smIdType n23, smIdType n31,
+ smIdType n45, smIdType n56, smIdType n64,
+ smIdType n14, smIdType n25, smIdType n36,
+ smIdType n1245, smIdType n2356, smIdType n1346)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3,
- int n4, int n5, int n6, int n7, int n8,
- int n12, int n23, int n34, int n41,
- int n56, int n67, int n78, int n85,
- int n15, int n26, int n37, int n48)
+void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n56, smIdType n67, smIdType n78, smIdType n85,
+ smIdType n15, smIdType n26, smIdType n37, smIdType n48)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function : AddVolume
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3,
- int n4, int n5, int n6, int n7, int n8,
- int n12, int n23, int n34, int n41,
- int n56, int n67, int n78, int n85,
- int n15, int n26, int n37, int n48,
- int n1234,int n1256,int n2367,int n3478,
- int n1458,int n5678,int nCenter)
+void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n56, smIdType n67, smIdType n78, smIdType n85,
+ smIdType n15, smIdType n26, smIdType n37, smIdType n48,
+ smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
+ smIdType n1458,smIdType n5678,smIdType nCenter)
{
if(myIsEmbeddedMode){
myIsModified = true;
#include "SMESHDS_Command.hxx"
+#include <smIdType.hxx>
+
#include <list>
#include <vector>
void SetModified(bool theModified);
bool IsModified();
- void AddNode(int NewNodeID, double x, double y, double z);
- void Add0DElement(int New0DElementID, int idnode);
- void AddEdge(int NewEdgeID, int idnode1, int idnode2);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
- int idnode9, int idnode10, int idnode11, int idnode12);
+ void AddNode(smIdType NewNodeID, double x, double y, double z);
+ void Add0DElement(smIdType New0DElementID, smIdType idnode);
+ void AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2);
+ void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3);
+ void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
+ smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12);
- void AddPolygonalFace (const int NewFaceID,
- const std::vector<int>& nodes_ids);
- void AddQuadPolygonalFace (const int NewFaceID,
- const std::vector<int>& nodes_ids);
- void AddPolyhedralVolume (const int NewVolID,
- const std::vector<int>& nodes_ids,
- const std::vector<int>& quantities);
- void AddBall(int NewBallID, int node, double diameter);
+ void AddPolygonalFace (const smIdType NewFaceID,
+ const std::vector<smIdType>& nodes_ids);
+ void AddQuadPolygonalFace (const smIdType NewFaceID,
+ const std::vector<smIdType>& nodes_ids);
+ void AddPolyhedralVolume (const smIdType NewVolID,
+ const std::vector<smIdType>& nodes_ids,
+ const std::vector<int>& quantities);
+ void AddBall(smIdType NewBallID, smIdType node, double diameter);
// special methods for quadratic elements
- void AddEdge(int NewEdgeID, int n1, int n2, int n12);
- void AddFace(int NewFaceID, int n1, int n2, int n3,
- int n12, int n23, int n31);
- void AddFace(int NewFaceID, int n1, int n2, int n3,
- int n12, int n23, int n31, int nCenter);
- void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n34, int n41);
- void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n34, int n41, int nCenter);
- void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n12, int n23, int n31, int n14, int n24, int n34);
- void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5,
- int n12, int n23, int n34, int n41,
- int n15, int n25, int n35, int n45);
- void AddVolume(int NewVolID, int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12, int n23, int n31,
- int n45, int n56, int n64,
- int n14, int n25, int n36);
- void AddVolume(int NewVolID, int n1, int n2, int n3,
- int n4, int n5, int n6,
- int n12, int n23, int n31,
- int n45, int n56, int n64,
- int n14, int n25, int n36,
- int n1245, int n2356, int n1346);
- void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12, int n23, int n34, int n41,
- int n56, int n67, int n78, int n85,
- int n15, int n26, int n37, int n48);
- void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
- int n5, int n6, int n7, int n8,
- int n12, int n23, int n34, int n41,
- int n56, int n67, int n78, int n85,
- int n15, int n26, int n37, int n48,
- int n1234,int n1256,int n2367,int n3478,
- int n1458,int n5678,int nCenter);
- void MoveNode(int NewNodeID, double x, double y, double z);
- void RemoveNode(int NodeID);
- void RemoveElement(int ElementID);
- void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
- void ChangePolyhedronNodes(const int ElementID,
- const std::vector<int>& nodes_ids,
+ void AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12);
+ void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12, smIdType n23, smIdType n31);
+ void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n12, smIdType n23, smIdType n31, smIdType nCenter);
+ void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41);
+ void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n12, smIdType n23, smIdType n31, smIdType n14, smIdType n24, smIdType n34);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n15, smIdType n25, smIdType n35, smIdType n45);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12, smIdType n23, smIdType n31,
+ smIdType n45, smIdType n56, smIdType n64,
+ smIdType n14, smIdType n25, smIdType n36);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3,
+ smIdType n4, smIdType n5, smIdType n6,
+ smIdType n12, smIdType n23, smIdType n31,
+ smIdType n45, smIdType n56, smIdType n64,
+ smIdType n14, smIdType n25, smIdType n36,
+ smIdType n1245, smIdType n2356, smIdType n1346);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n56, smIdType n67, smIdType n78, smIdType n85,
+ smIdType n15, smIdType n26, smIdType n37, smIdType n48);
+ void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4,
+ smIdType n5, smIdType n6, smIdType n7, smIdType n8,
+ smIdType n12, smIdType n23, smIdType n34, smIdType n41,
+ smIdType n56, smIdType n67, smIdType n78, smIdType n85,
+ smIdType n15, smIdType n26, smIdType n37, smIdType n48,
+ smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478,
+ smIdType n1458,smIdType n5678,smIdType nCenter);
+ void MoveNode(smIdType NewNodeID, double x, double y, double z);
+ void RemoveNode(smIdType NodeID);
+ void RemoveElement(smIdType ElementID);
+ void ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes);
+ void ChangePolyhedronNodes(const smIdType ElementID,
+ const std::vector<smIdType>& nodes_ids,
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 Clear();
const std::list<SMESHDS_Command*> & GetCommands();
//purpose :
//=======================================================================
-int SMESHDS_SubMesh::NbElements() const
+smIdType SMESHDS_SubMesh::NbElements() const
{
if ( !IsComplexSubmesh() )
return myNbElements;
- int nbElems = 0;
+ smIdType nbElems = 0;
TSubMeshSet::const_iterator it = mySubMeshes.begin();
for ( ; it != mySubMeshes.end(); it++ )
nbElems += (*it)->NbElements();
//purpose :
//=======================================================================
-int SMESHDS_SubMesh::NbNodes() const
+smIdType SMESHDS_SubMesh::NbNodes() const
{
if ( !IsComplexSubmesh() )
return myNbNodes;
- int nbElems = 0;
+ smIdType nbElems = 0;
TSubMeshSet::const_iterator it = mySubMeshes.begin();
for ( ; it != mySubMeshes.end(); it++ )
nbElems += (*it)->NbNodes();
#include "SMDS_ElementHolder.hxx"
#include "SMDS_Mesh.hxx"
+#include <smIdType.hxx>
#include <vector>
#include <boost/container/flat_set.hpp>
bool RemoveSubMesh( const SMESHDS_SubMesh* theSubMesh );
void RemoveAllSubmeshes();
bool ContainsSubMesh( const SMESHDS_SubMesh* theSubMesh ) const;
- int NbSubMeshes() const { return mySubMeshes.size(); }
+ size_t NbSubMeshes() const { return mySubMeshes.size(); }
SMESHDS_SubMeshIteratorPtr GetSubMeshIterator() const;
// for both types
- virtual int NbElements() const;
- virtual int NbNodes() const;
+ virtual smIdType NbElements() const;
+ virtual smIdType NbNodes() const;
virtual SMDS_ElemIteratorPtr GetElements() const;
virtual SMDS_NodeIteratorPtr GetNodes() const;
virtual bool Contains(const SMDS_MeshElement * ME) const; // check if elem or node is in
private:
int myIndex;
- int myNbElements;
- int myNbNodes;
+ smIdType myNbElements;
+ smIdType myNbNodes;
const SMDS_MeshElement* my1stElemNode[2]; // elem and node with least ID, to optimize iteration
const SMESHDS_Mesh * myParent;
TSubMeshSet mySubMeshes;
}
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 )
if ( nbElems[ notSupportedElemTypes[ iType ]] > 0 )
presentNotSupported.push_back( notSupportedElemTypes[ iType ]);
aMesh->ExportGMF( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups );
}
}
- catch (const SALOME::SALOME_Exception& S_ex){
+ catch (const SALOME::SALOME_Exception& S_ex)
+ {
wc.suspend();
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_FAILED") + SalomeApp_Tools::ExceptionToString(S_ex));
+ if ( S_ex.details.type == SALOME::COMM && // communicate about too large mesh
+ strncmp( "format=", S_ex.details.sourceFile.in(), 7 ) == 0 )
+
+ 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();
}
}
SMESH::Controls::NumericalFunctor* aNumFun =
dynamic_cast<SMESH::Controls::NumericalFunctor*>( aFunctor.get() );
if ( aNumFun ) {
- std::vector<int> elements;
+ std::vector<SMESH::smIdType> elements;
SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIO);
if ( mesh->_is_nil() ) {
SMESH::SMESH_IDSource_var idSource =
SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(anIO);
if ( !idSource->_is_nil() )
{
- SMESH::long_array_var ids = idSource->GetIDs();
+ SMESH::smIdType_array_var ids = idSource->GetIDs();
elements.resize( ids->length() );
for ( unsigned i = 0; i < elements.size(); ++i )
elements[i] = ids[i];
if ( anActor->GetControlMode() != aControl )
anActor->SetControlMode( aControl );
QString functorName = functorToString( anActor->GetFunctor() );
- int anEntitiesCount = anActor->GetNumberControlEntities();
+ smIdType anEntitiesCount = anActor->GetNumberControlEntities();
if (anEntitiesCount >= 0)
functorName = functorName + ": " + QString::number(anEntitiesCount);
anActor->GetScalarBarActor()->SetTitle( functorName.toUtf8().constData() );
long updateLimit = resMgr->integerValue( "SMESH", "update_limit", 500000 );
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 nbEdges = info[SMDSEntity_Edge] + info[SMDSEntity_Quad_Edge];
long nbFaces = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle] +
try {
SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
// get submesh elements list by types
- SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
- SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
- SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
- SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
+ SMESH::smIdType_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
+ SMESH::smIdType_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
+ SMESH::smIdType_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
+ SMESH::smIdType_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
// create group for each type o elements
QString aName = IObject->getName();
QStringList anEntryList;
try {
SUIT_OverrideCursor wc;
SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
- int removed = aMeshEditor->RemoveOrphanNodes();
+ smIdType removed = aMeshEditor->RemoveOrphanNodes();
SUIT_MessageBox::information(SMESHGUI::desktop(),
tr("SMESH_INFORMATION"),
tr("NB_NODES_REMOVED").arg(removed));
lab = lab + tr("INFO_COMPUTE") + "<br/>";
lab = lab + tr("INFO_REFINE") + ":";
items << wrap(tr("INFO_REFINE_LOCAL_SIZE"), "li")
- << wrap(tr("INFO_REFINE_SUBMESH"), "li");
+ << wrap(tr("INFO_REFINE_SUBMESH"), "li");
lab = lab + wrap(items.join(""), "ul");
items.clear();
gb = app->infoPanel()->addGroup(tr("INFO_GRP_IMPORT_MESH"));
items << wrap("UNV", "li")
- << wrap("MED", "li")
- << wrap("STL", "li")
- << wrap("CGNS", "li")
- << wrap("SAUV", "li")
- << wrap("GMF", "li");
+ << wrap("MED", "li")
+ << wrap("STL", "li")
+ << wrap("CGNS", "li")
+ << wrap("SAUV", "li")
+ << wrap("GMF", "li");
lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul");
items.clear();
-
+
app->infoPanel()->addLabel(lab, gb);
gb = app->infoPanel()->addGroup(tr("INFO_GRP_CHECK_MESH"));
lab = tr("INFO_DISPLAY") + "<br/>";
items << wrap(tr("INFO_QUALITY_AREA"), "li")
- << wrap(tr("INFO_QUALITY_VOLUME"), "li")
- << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li")
- << wrap("...", "li");
+ << wrap(tr("INFO_QUALITY_VOLUME"), "li")
+ << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li")
+ << wrap("...", "li");
lab = lab + tr("INFO_QUALITY_INFO") + ":" + wrap(items.join(""), "ul");
items.clear();
lab = lab + tr("INFO_CLIPPING");
int size0d = addPreference(tr("PREF_SIZE_0D"), elemGroup,
LightApp_Preferences::IntSpin, "SMESH", "elem0d_size");
/* int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup,
- LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size"); */
- double ballDiameter = addPreference(tr("PREF_BALL_DIAMETER"), elemGroup,
- LightApp_Preferences::DblSpin, "SMESH", "ball_elem_diameter");
- double ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup,
- LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale");
- int elemW = addPreference(tr("PREF_WIDTH"), elemGroup,
- LightApp_Preferences::IntSpin, "SMESH", "element_width");
- int outW = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup,
- LightApp_Preferences::IntSpin, "SMESH", "outline_width");
- int shrink = addPreference(tr("PREF_SHRINK_COEFF"), elemGroup,
- LightApp_Preferences::IntSpin, "SMESH", "shrink_coeff");
+ LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size"); */
+ int ballDiameter = addPreference(tr("PREF_BALL_DIAMETER"), elemGroup,
+ LightApp_Preferences::DblSpin, "SMESH", "ball_elem_diameter");
+ int ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup,
+ LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale");
+ int elemW = addPreference(tr("PREF_WIDTH"), elemGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "element_width");
+ int outW = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "outline_width");
+ int shrink = addPreference(tr("PREF_SHRINK_COEFF"), elemGroup,
+ LightApp_Preferences::IntSpin, "SMESH", "shrink_coeff");
setPreferenceProperty( size0d, "min", 1 );
setPreferenceProperty( size0d, "max", 10 );
- // setPreferenceProperty( ballSize, "min", 1 );
- // setPreferenceProperty( ballSize, "max", 10 );
+ // setPreferenceProperty( ballSize, "min", 1 );
+ // setPreferenceProperty( ballSize, "max", 10 );
setPreferenceProperty( ballDiameter, "min", 1e-7 );
setPreferenceProperty( ballDiameter, "max", 1e9 );
void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
{
if ( sect=="SMESH" ) {
- float sbX1 = 0.01, sbY1 = 0.01, sbW = 0.08, sbH = 0.08;
- float aTol = 1.00000009999999;
+ double sbX1 = 0.01, sbY1 = 0.01, sbW = 0.08, sbH = 0.08;
+ double aTol = 1.00000009999999;
std::string aWarning;
SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this);
#include <SUIT_MessageBox.h>
#include <SVTK_Selector.h>
#include <SalomeApp_Tools.h>
+#include <smIdType.hxx>
// Qt includes
#include <QButtonGroup>
SUIT_MessageBox::warning( myDlg, tr( "SMESH_WRN_WARNING" ), tr( "SMESH_BAD_SELECTION" ) );
return false;
}
- SMESH::long_array_var idArray = new SMESH::long_array;
+ SMESH::smIdType_array_var idArray = new SMESH::smIdType_array;
idArray->length( idList.count() );
QStringList::iterator idIt = idList.begin();
for ( int i = 0; idIt != idList.end(); ++idIt, ++i )
// Create 0D elements
- int prevNb0D = mesh->Nb0DElements();
+ smIdType prevNb0D = mesh->Nb0DElements();
QString groupName = myDlg->myGroupListCmBox->currentText();
SMESH::SMESH_IDSource_var newObj =
editor->Create0DElementsOnAllNodes( meshObject, groupName.toUtf8().data(),
myDlg->myDuplicateElemsChkBox->isChecked() );
- int newNb0D = mesh->Nb0DElements() - prevNb0D;
+ smIdType newNb0D = mesh->Nb0DElements() - prevNb0D;
SUIT_MessageBox::information( myDlg, tr( "SMESH_INFORMATION" ),
tr( "NB_NEW_0D" ).arg( newNb0D ),
SUIT_MessageBox::Ok, SUIT_MessageBox::Ok);
if (myNbOkNodes && !SMESHGUI::isStudyLocked()) {
myBusy = true;
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());
const std::vector<int>& revIndex = SMDS_MeshCell::reverseSmdsOrder( myGeomType );
if ( ReverseOrDulicate && ReverseOrDulicate->isChecked() && (int)revIndex.size() == aListId.count() )
}
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[0] = -1;
- int nbElemsBefore = 0;
+ smIdType nbElemsBefore = 0;
switch (myElementType) {
case SMDSAbs_0DElement: {
for ( size_t i = 0; i < anArrayOfIndices->length(); ++i )
anIdList[i] = aMeshEditor->Add0DElement(anArrayOfIndices[i], duplicateElements);
- CORBA::ULong nbAdded = myMesh->Nb0DElements() - nbElemsBefore;
+ SMESH::smIdType nbAdded = myMesh->Nb0DElements() - nbElemsBefore;
if ( !duplicateElements && nbAdded < anArrayOfIndices->length() )
SUIT_MessageBox::information(SMESHGUI::desktop(),
tr("SMESH_INFORMATION"),
aMesh = myActor->GetObject()->GetMesh();
if (aMesh) {
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool allOk = true;
ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false );
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 );
for (int i = 0; i < aNumberOfIds; i++)
}
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[0] = anElemId;
aGroupUsed->Add( anIdList.inout() );
myCurrentLineEdit = send;
if (aMesh) {
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool allOk = true;
}
else if ( theNoCompError && theNoHypoError )
{
- SMESH::long_array_var aRes = myMesh->GetMeshInfo();
+ SMESH::smIdType_array_var aRes = myMesh->GetMeshInfo();
aCompDlg->myFullInfo->SetMeshInfo( aRes );
aCompDlg->myFullInfo->show();
aCompDlg->myBriefInfo->hide();
theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE );
// full or brief mesh info
- SMESH::long_array_var aRes = myMesh->GetMeshInfo();
+ SMESH::smIdType_array_var aRes = myMesh->GetMeshInfo();
if ( onlyWarnings ) {
aCompDlg->myFullInfo->SetMeshInfo( aRes );
aCompDlg->myFullInfo->show();
QString aHypErrors;
bool evaluateFailed = true, memoryLack = false;
- SMESH::long_array_var aRes;
+ SMESH::smIdType_array_var aRes;
_PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh);
if ( !aMeshSObj ) // IPAL21340
}
-void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes,
+void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::smIdType_array& theRes,
const bool theMemoryLack,
const bool theNoCompError,
SMESH::compute_error_array_var& theCompErrors,
const QString& );
SMESHGUI_ComputeDlg* evaluateDlg() const;
void evaluateMesh();
- void showEvaluateResult(const SMESH::long_array& theRes,
+ void showEvaluateResult(const SMESH::smIdType_array& theRes,
const bool,
const bool,
SMESH::compute_error_array_var&,
SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSource,
bool* isMixOrder)
{
- SMESH::long_array_var nbElemOfType = idSource->GetMeshInfo();
+ SMESH::smIdType_array_var nbElemOfType = idSource->GetMeshInfo();
bool hasBiQuad = ( nbElemOfType[SMDSEntity_BiQuad_Triangle ] ||
nbElemOfType[SMDSEntity_BiQuad_Quadrangle ] ||
else
{
QStringList aListElementsId = myLineEditElements->text().split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
anElementsId[i] = aListElementsId[i].toInt();
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
if (myActor && aMesh)
{
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
if (send == myLineEditElements) {
for (int i = 0; i < aListId.count(); i++)
if ( const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()))
if (GetConstructorId() == 0)
{
- SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
+ SMESH::smIdType_array_var anIdsOfNodes = new SMESH::smIdType_array;
SMESH::long_array_var aQuantities = new SMESH::long_array;
aQuantities->length( myFacesByNodes->count() );
}
else if (GetConstructorId() == 1)
{
- SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
+ SMESH::smIdType_array_var anIdsOfFaces = new SMESH::smIdType_array;
QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
anIdsOfFaces->length(aListId.count());
}
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[0] = anElemId;
aGroupUsed->Add( anIdList.inout() );
if (GetConstructorId() == 0)
{
if ( aMesh ) {
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < aListId.count(); i++ ) {
// check entered ids of faces and highlight them
QStringList aListId;
if ( aMesh ) {
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
aListId = theNewText.split( " ", QString::SkipEmptyParts );
SALOME_ListIO aList;
mySelectionMgr->setSelectedObjects( aList );
- TColStd_MapOfInteger aIndexes;
+ SVTK_TVtkIDsMap aIndexes;
QList<QListWidgetItem*> selItems = myFacesByNodes->selectedItems();
QListWidgetItem* anItem;
#include <SUIT_OverrideCursor.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
+#include <smIdType.hxx>
#include <QCheckBox>
#include <QGridLayout>
QGridLayout* hl = new QGridLayout( anEntitiesGrp );
hl->setMargin( MARGIN );
hl->setSpacing( SPACING );
- int nbElements;
+ smIdType nbElements;
// 0DElements
nbElements = myActor ? myActor->GetObject()->GetNbEntities( SMDSAbs_0DElement ) : aMesh->Nb0DElements();
if (bOk) {
const SMDS_MeshNode* n = aMesh->FindNode(ind);
if (n) {
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
newIndices.Add(n->GetID());
mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
}
else
{
- SMESH::long_array_var elems = mesh->GetNodeInverseElements( aNodeStart, SMESH::ALL );
+ SMESH::smIdType_array_var elems = mesh->GetNodeInverseElements( aNodeStart, SMESH::ALL );
if ( elems->length() != 1 ||
mesh->GetElementType( elems[0], true ) != SMESH::EDGE )
return false;
}
else // get indices of selected elements
{
- TColStd_IndexedMapOfInteger aMapIndex;
+ SVTK_TIndexedMapOfVtkId aMapIndex;
mySelector->GetIndex(IO,aMapIndex);
int nbElements = aMapIndex.Extent();
if ( nbElements > 0 )
{
- SMESH::long_array_var ids = new SMESH::long_array;
+ SMESH::smIdType_array_var ids = new SMESH::smIdType_array;
ids->length( nbElements );
for ( int i = 0; i < nbElements; ++i )
aString += QString(" %1").arg( ids[ i ] = aMapIndex( i+1 ));
SMDSAbs_ElementType SMDSType = SMDSAbs_ElementType( iType+1 );
const bool isNode = ( SMDSType == SMDSAbs_Node );
- SMESH::long_array_var ids = new SMESH::long_array;
+ SMESH::smIdType_array_var ids = new SMESH::smIdType_array;
ids->length( aListId.count() );
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
for (int i = 0; i < aListId.count(); i++) {
int id = aListId[ i ].toInt();
bool validId = false;
*/
//================================================================================
-void SMESHGUI_3TypesSelector::addTmpIdSource( SMESH::long_array_var& ids, int iType, int index )
+void SMESHGUI_3TypesSelector::addTmpIdSource( SMESH::smIdType_array_var& ids, int iType, int index )
{
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
SMESH::SMESH_IDSource_var idSrc =
if ( SelectVectorButton->isChecked() )
{
Handle(SALOME_InteractiveObject) IO = aList.First();
- TColStd_IndexedMapOfInteger aMapIndex;
+ SVTK_TIndexedMapOfVtkId aMapIndex;
mySelector->GetIndex(IO,aMapIndex);
if ( aMapIndex.Extent() != 1 )
return;
private:
- void addTmpIdSource( SMESH::long_array_var& ids,
+ void addTmpIdSource( SMESH::smIdType_array_var& ids,
int iType, int index);
QGroupBox* myGroups [3];
// name : SMESHGUI_PredicateFilter::IsValid
// Purpose : Verify whether entry id satisfies to criterion of the filter
//=======================================================================
-bool SMESHGUI_PredicateFilter::IsValid( const int theCellId ) const
+bool SMESHGUI_PredicateFilter::IsValid( const vtkIdType theCellId ) const
{
if ( myActor == 0 || myPred->_is_nil() )
return false;
// name : SMESHGUI_QuadrangleFilter::IsValid
// Purpose : Verify whether selected cell is quadrangle
//=======================================================================
-bool SMESHGUI_QuadrangleFilter::IsValid( const int theCellId ) const
+bool SMESHGUI_QuadrangleFilter::IsValid( const vtkIdType theCellId ) const
{
if ( myActor == 0 )
return false;
// name : SMESHGUI_TriangleFilter::IsValid
// Purpose : Verify whether selected cell is triangle
//=======================================================================
-bool SMESHGUI_TriangleFilter::IsValid( const int theCellId ) const
+bool SMESHGUI_TriangleFilter::IsValid( const vtkIdType theCellId ) const
{
if ( myActor == 0 )
return false;
// name : SMESHGUI_FacesFilter::IsValid
// Purpose : Verify whether selected cell is face
//=======================================================================
-bool SMESHGUI_FacesFilter::IsValid( const int theCellId ) const
+bool SMESHGUI_FacesFilter::IsValid( const vtkIdType theCellId ) const
{
if ( myActor == 0 )
return false;
// name : SMESHGUI_VolumesFilter::IsValid
// Purpose : Verify whether selected cell is volume
//=======================================================================
-bool SMESHGUI_VolumesFilter::IsValid( const int theCellId ) const
+bool SMESHGUI_VolumesFilter::IsValid( const vtkIdType theCellId ) const
{
if ( myActor == 0 || theCellId < 1 )
return false;
// name : SMESHGUI_VolumeShapeFilter::IsValid
// Purpose : Verify whether selected cell is a volume of a certain shape
//=======================================================================
-bool SMESHGUI_VolumeShapeFilter::IsValid( const int theCellId ) const
+bool SMESHGUI_VolumeShapeFilter::IsValid( const vtkIdType theCellId ) const
{
if ( myActor == 0 || theCellId < 1 )
return false;
Standard_EXPORT SMESHGUI_PredicateFilter();
Standard_EXPORT virtual ~SMESHGUI_PredicateFilter();
- Standard_EXPORT virtual bool IsValid( const int ) const;
+ Standard_EXPORT virtual bool IsValid( const vtkIdType ) const;
Standard_EXPORT virtual bool IsObjValid( const int ) const;
Standard_EXPORT virtual int GetId() const;
Standard_EXPORT virtual bool IsNodeFilter() const;
Standard_EXPORT SMESHGUI_QuadrangleFilter();
Standard_EXPORT virtual ~SMESHGUI_QuadrangleFilter();
- Standard_EXPORT virtual bool IsValid( const int ) const;
+ Standard_EXPORT virtual bool IsValid( const vtkIdType ) const;
Standard_EXPORT virtual bool IsObjValid( const int ) const;
Standard_EXPORT virtual int GetId() const;
Standard_EXPORT virtual bool IsNodeFilter() const;
Standard_EXPORT SMESHGUI_TriangleFilter();
Standard_EXPORT virtual ~SMESHGUI_TriangleFilter();
- Standard_EXPORT virtual bool IsValid( const int ) const;
+ Standard_EXPORT virtual bool IsValid( const vtkIdType ) const;
Standard_EXPORT virtual bool IsObjValid( const int ) const;
Standard_EXPORT virtual int GetId() const;
Standard_EXPORT virtual bool IsNodeFilter() const;
Standard_EXPORT SMESHGUI_FacesFilter();
Standard_EXPORT virtual ~SMESHGUI_FacesFilter();
- Standard_EXPORT virtual bool IsValid( const int ) const;
+ Standard_EXPORT virtual bool IsValid( const vtkIdType ) const;
Standard_EXPORT virtual bool IsObjValid( const int ) const;
Standard_EXPORT virtual int GetId() const;
Standard_EXPORT virtual bool IsNodeFilter() const;
Standard_EXPORT SMESHGUI_VolumesFilter();
Standard_EXPORT virtual ~SMESHGUI_VolumesFilter();
- Standard_EXPORT virtual bool IsValid( const int ) const;
+ Standard_EXPORT virtual bool IsValid( const vtkIdType ) const;
Standard_EXPORT virtual bool IsObjValid( const int ) const;
Standard_EXPORT virtual int GetId() const;
Standard_EXPORT virtual bool IsNodeFilter() const;
public:
Standard_EXPORT SMESHGUI_VolumeShapeFilter(const SMDSAbs_GeometryType shape);
- Standard_EXPORT virtual bool IsValid( const int ) const;
+ Standard_EXPORT virtual bool IsValid( const vtkIdType ) const;
Standard_EXPORT virtual bool IsObjValid( const int ) const;
Standard_EXPORT virtual int GetId() const;
Standard_EXPORT virtual bool IsNodeFilter() const;
// SALOME KERNEL includes
#include <SALOMEDSClient_Study.hxx>
#include <Basics_Utils.hxx>
+#include <smIdType.hxx>
// OCCT includes
#include <StdSelect_TypeOfFace.hxx>
SALOME_ListIO aList;
mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected();
- SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter (myIObjects);
+ SALOME_DataMapIteratorOfIOMapOfVtk anIter (myIObjects);
for ( ; anIter.More(); anIter.Next())
{
aList.Append(anIter.Key());
- TColStd_MapOfInteger aResMap;
- const TColStd_IndexedMapOfInteger& anIndMap = anIter.Value();
+ SVTK_TVtkIDsMap aResMap;
+ const SVTK_TIndexedMapOfVtkId& anIndMap = anIter.Value();
for (int i = 1, n = anIndMap.Extent(); i <= n; i++)
aResMap.Add(anIndMap(i));
const SALOME_ListIO& anObjs = mySelector->StoredIObjects();
SALOME_ListIteratorOfListIO anIter (anObjs);
for ( ; anIter.More(); anIter.Next()) {
- TColStd_IndexedMapOfInteger aMap;
+ SVTK_TIndexedMapOfVtkId aMap;
mySelector->GetIndex(anIter.Value(), aMap);
myIObjects.Bind(anIter.Value(), aMap);
}
{
if (myMesh->_is_nil())
return;
- SMESH::long_array_var anIds = myFilter[ theType ]->GetElementsId(myMesh);
+ SMESH::smIdType_array_var anIds = myFilter[ theType ]->GetElementsId(myMesh);
for (int i = 0, n = anIds->length(); i < n; i++)
- theResIds.append(anIds[ i ]);
+ theResIds.append(FromIdType<int>(anIds[ i ]));
}
else if (aSourceId == Selection)
{
// Create map of entities to be filtered
TColStd_MapOfInteger aToBeFiltered;
- SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter(myIObjects);
+ SALOME_DataMapIteratorOfIOMapOfVtk anIter(myIObjects);
for ( ; anIter.More(); anIter.Next())
{
{
if (aSubMesh->GetFather()->GetId() == myMesh->GetId())
{
- SMESH::long_array_var anIds =
+ SMESH::smIdType_array_var anIds =
theType == SMESH::NODE ? aSubMesh->GetNodesId() : aSubMesh->GetElementsId();
for (int i = 0, n = anIds->length(); i < n; i++)
- aToBeFiltered.Add(anIds[ i ]);
+ aToBeFiltered.Add(FromIdType<int>(anIds[ i ]));
}
}
{
if (aGroup->GetType() == theType && aGroup->GetMesh()->GetId() == myMesh->GetId())
{
- SMESH::long_array_var anIds = aGroup->GetListOfID();
+ SMESH::smIdType_array_var anIds = aGroup->GetListOfID();
for (int i = 0, n = anIds->length(); i < n; i++)
- aToBeFiltered.Add(anIds[ i ]);
+ aToBeFiltered.Add(FromIdType<int>(anIds[ i ]));
}
}
SMESH::SMESH_Mesh_var aMeshPtr = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIter.Key());
if (!aMeshPtr->_is_nil() && aMeshPtr->GetId() == myMesh->GetId())
{
- const TColStd_IndexedMapOfInteger& aSelMap = anIter.Value();
+ const SVTK_TIndexedMapOfVtkId& aSelMap = anIter.Value();
if (aSelMap.Extent() > 0)
{
if ( meshActor && meshActor->GetVisibility() )
return meshActor;
- SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter(myIObjects);
+ SALOME_DataMapIteratorOfIOMapOfVtk anIter(myIObjects);
for ( ; anIter.More(); anIter.Next())
{
Handle(SALOME_InteractiveObject) io = anIter.Key();
SMESH::RemoveFilter(aFilterId);
// get vtk ids
- TColStd_MapOfInteger aMap;
+ SVTK_TVtkIDsMap aMap;
QList<int>::const_iterator anIter;
for (anIter = theIds.begin(); anIter != theIds.end(); ++anIter) {
aMap.Add(*anIter);
// SALOME GUI includes
#include <SALOME_DataMapOfIOMapOfInteger.hxx>
#include <SVTK_Selection.h>
+#include <SVTK_Hash.h>
// IDL includes
#include <SALOMEconfig.h>
class SMESH_Actor;
class SVTK_Selector;
+typedef NCollection_DataMap<Handle(SALOME_InteractiveObject), SVTK_TIndexedMapOfVtkId> SALOME_DataMapOfIOMapOfVtk;
+typedef SALOME_DataMapOfIOMapOfVtk::Iterator SALOME_DataMapIteratorOfIOMapOfVtk;
+
/*!
* Class : SMESHGUI_FilterTable
* Description : Frame containing
bool myDiffSourcesEnabled;
QWidget* mySourceWg;
- SALOME_DataMapOfIOMapOfInteger myIObjects;
+ SALOME_DataMapOfIOMapOfVtk myIObjects;
bool myIsSelectionChanged;
QMap< int, SMESH::Filter_var > myFilter;
QMap< int, bool > myInsertState;
QList<QListWidgetItem *> ids = myDlg->myFoundList->selectedItems();
QList<QListWidgetItem*>::iterator id = ids.begin();
- TColStd_MapOfInteger idMap;
+ SVTK_TVtkIDsMap idMap;
for ( ; id != ids.end(); ++id )
idMap.Add( (*id)->text().toInt() );
if (aMeshEditor->_is_nil())
return;
- SMESH::long_array_var foundIds;
+ SMESH::smIdType_array_var foundIds;
if ( aMesh->_is_equivalent( myMeshOrPart ) )
foundIds =
aMeshEditor->FindElementsByPoint( myDlg->myX->GetValue(),
myIdList.clear();
if (!theGroup->IsEmpty()) {
- SMESH::long_array_var anElements = theGroup->GetListOfID();
+ SMESH::smIdType_array_var anElements = theGroup->GetListOfID();
int k = anElements->length();
for (int i = 0; i < k; i++) {
myIdList.append(anElements[i]);
}
else
{
- SMESH::long_array_var anIdList = new SMESH::long_array;
+ SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array;
int i, k = myElements->count();
anIdList->length(k);
for (i = 0; i < k; i++) {
myIdList.removeAt(idx);
}
if (!aAddList.empty()) {
- SMESH::long_array_var anIdList = new SMESH::long_array;
+ SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array;
int added = aAddList.count();
anIdList->length(added);
for (i = 0; i < added; i++)
myGroup->Add(anIdList.inout());
}
if (!myIdList.empty()) {
- SMESH::long_array_var anIdList = new SMESH::long_array;
+ SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array;
int removed = myIdList.count();
anIdList->length(removed);
for (i = 0; i < removed; i++)
if (myCurrentLineEdit == 0) {
mySelectionMgr->clearSelected();
- TColStd_MapOfInteger aIndexes;
+ SVTK_TVtkIDsMap aIndexes;
QList<QListWidgetItem*> selItems = myElements->selectedItems();
QListWidgetItem* anItem;
foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt());
// check if mesh is the same
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
try {
- SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
+ SMESH::smIdType_array_var anElements = aSubMesh->GetElementsByType(aType);
int k = anElements->length();
for (int i = 0; i < k; i++) {
QString aText = QString::number(anElements[i]);
if (!aGroup->_is_nil()) {
// check if mesh is the same
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
- SMESH::long_array_var anElements = aGroup->GetListOfID();
+ SMESH::smIdType_array_var anElements = aGroup->GetListOfID();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QString aText = QString::number(anElements[i]);
aBelongToGeom->SetElementType(aType);
aFilter->SetPredicate(aBelongToGeom);
- SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);
+ SMESH::smIdType_array_var anElements = aFilter->GetElementsId(myMesh);
int k = anElements->length();
for (int i = 0; i < k; i++) {
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
if (aType == SMESH::NODE) {
try {
- SMESH::long_array_var anElements = aSubMesh->GetNodesId();
+ SMESH::smIdType_array_var anElements = aSubMesh->GetNodesId();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
}
else {
try {
- SMESH::long_array_var anElements = aSubMesh->GetElementsId();
+ SMESH::smIdType_array_var anElements = aSubMesh->GetElementsId();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
if (!aGroup->_is_nil()) {
// check if mesh is the same
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
- SMESH::long_array_var anElements = aGroup->GetListOfID();
+ SMESH::smIdType_array_var anElements = aGroup->GetListOfID();
int k = anElements->length();
for (int i = 0; i < k; i++) {
QList<QListWidgetItem*> found =
// PAL5412: sorts items in ascending by "string" value
// myElements->sort(true);
// myElements->update();
- int i, k = myElements->count();
+ vtkIdType i, k = myElements->count();
if (k > 0) {
myIsBusy = true;
- QList<int> aSelected;
- std::vector<int> anArray(k);
+ QList<vtkIdType> aSelected;
+ std::vector<vtkIdType> anArray(k);
// QMemArray<int> anArray(k);
// fill the array
for (i = 0; i < k; i++) {
- int id = myElements->item(i)->text().toInt();
+ vtkIdType id;
+ if (sizeof(vtkIdType)==8)
+ id = myElements->item(i)->text().toLongLong();
+ else
+ id = myElements->item(i)->text().toInt();
anArray[i] = id;
if (myElements->item(i)->isSelected())
aSelected.append(id);
}
void SMESHGUI_IdPreview::SetPointsData ( SMDS_Mesh* theMesh,
- const TColStd_MapOfInteger & theNodesIdMap )
+ const SVTK_TVtkIDsMap & theNodesIdMap )
{
vtkPoints* aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
myIDs.clear();
- TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
+ SVTK_TVtkIDsMapIterator idIter( theNodesIdMap );
for( int i = 0; idIter.More(); idIter.Next(), i++ )
{
const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
#include <vector>
#include <TColStd_MapOfInteger.hxx>
+#include <SVTK_Hash.h>
#include <gp_XYZ.hxx>
SMESHGUI_IdPreview(SVTK_ViewWindow* theViewWindow);
~SMESHGUI_IdPreview();
- void SetPointsData( SMDS_Mesh* theMesh, const TColStd_MapOfInteger & theNodesIdMap );
+ void SetPointsData( SMDS_Mesh* theMesh, const SVTK_TVtkIDsMap & theNodesIdMap );
void SetElemsData ( const std::vector<int> & theElemsIdMap,
const std::list<gp_XYZ> & theGrCentersXYZ );
template< class INT_ITER, class XYZ_ITER >
bool ok;
int anId = myDlg->myId->text().toInt( &ok );
if( !ok || anId < 1 )
- anId = aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
- myDlg->myDestinationY->GetValue(),
- myDlg->myDestinationZ->GetValue());
+ anId = FromIdType<int>(aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
+ myDlg->myDestinationY->GetValue(),
+ myDlg->myDestinationZ->GetValue()));
int aResult = aMeshEditor->MoveNode(anId,
myDlg->myDestinationX->GetValue(),
myDlg->myDestDZ->setReadOnly(true);
}
if ( isPreview && isMoveNode && anId == 0 )
- anId = aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
- myDlg->myDestinationY->GetValue(),
- myDlg->myDestinationZ->GetValue());
+ anId = FromIdType<int>(aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
+ myDlg->myDestinationY->GetValue(),
+ myDlg->myDestinationZ->GetValue()));
// find id and/or just compute preview
aPreviewer->MoveNode(anId,
myDlg->myDestinationX->GetValue(),
if( const SMDS_MeshNode* aNode = aMesh->FindNode( theText.toInt() ) )
{
- TColStd_MapOfInteger aListInd;
- aListInd.Add( aNode->GetID() );
+ SVTK_TVtkIDsMap aListInd;
+ aListInd.Add( FromIdType<int>(aNode->GetID()) );
selector()->AddOrRemoveIndex( anIO, aListInd, false );
if( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() ) )
aViewWindow->highlight( anIO, true, true );
#include <vtkCellArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkDataSetMapper.h>
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
#include <vtkProperty.h>
#include <ElCLib.hxx>
aCells->InsertNextCell( anIdList );
aCellTypesArray->InsertNextValue( VTK_LINE );
anIdList->Delete();
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( 1 );
aCells->InitTraversal();
if ( myFirstActor && selector ) {
Handle(SALOME_InteractiveObject) IO = myFirstActor->getIO();
if ( myFirst->checkedId() == NodeTgt || myFirst->checkedId() == ElementTgt ) {
- TColStd_MapOfInteger ID;
+ SVTK_TVtkIDsMap ID;
ID.Add( myFirstTgt->text().toLong() );
selector->AddOrRemoveIndex( IO, ID, false );
}
Handle(SALOME_InteractiveObject) IO = mySecondActor->getIO();
if ( mySecond->checkedId() == NodeTgt || mySecond->checkedId() == ElementTgt ) {
if ( !text.isEmpty() ) {
- TColStd_MapOfInteger ID;
+ SVTK_TVtkIDsMap ID;
ID.Add( text.toLong() );
selector->AddOrRemoveIndex( IO, ID, false );
}
SMESH::SMESH_Mesh_var m = myFirstSrc->GetMesh();
long id = myFirstTgt->text().toLong();
if ( !CORBA::is_nil( m ) && id ) {
- SMESH::long_array_var ids = new SMESH::long_array();
+ SMESH::smIdType_array_var ids = new SMESH::smIdType_array();
ids->length( 1 );
ids[0] = id;
SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor();
SMESH::SMESH_Mesh_var m = mySecondSrc->GetMesh();
long id = mySecondTgt->text().toLong();
if ( !CORBA::is_nil( m ) && id ) {
- SMESH::long_array_var ids = new SMESH::long_array();
+ SMESH::smIdType_array_var ids = new SMESH::smIdType_array();
ids->length( 1 );
ids[0] = id;
SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor();
aCells->InsertNextCell( anIdList );
aCellTypesArray->InsertNextValue( VTK_LINE );
anIdList->Delete();
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( 12 );
aCells->InitTraversal();
if ( myActor && selector ) {
Handle(SALOME_InteractiveObject) IO = myActor->getIO();
if ( mySourceMode->checkedId() == NodesSrc || mySourceMode->checkedId() == ElementsSrc ) {
- TColStd_MapOfInteger ID;
+ SVTK_TVtkIDsMap ID;
if ( !mySource->isReadOnly() )
myIDs = mySource->text();
QStringList ids = myIDs.split( " ", QString::SkipEmptyParts );
SMESH::SMESH_Mesh_var m = mySrc[0]->GetMesh();
QStringList ids = myIDs.split( " ", QString::SkipEmptyParts );
if ( !CORBA::is_nil( m ) && ids.count() > 0 ) {
- SMESH::long_array_var ids_in = new SMESH::long_array();
+ SMESH::smIdType_array_var ids_in = new SMESH::smIdType_array();
ids_in->length( ids.count() );
for( int i = 0; i < ids.count(); i++ )
ids_in[i] = ids[i].trimmed().toLong();
clear();
QString nodesString;
- TColStd_IndexedMapOfInteger idsMap;
+ SVTK_TIndexedMapOfVtkId idsMap;
SALOME_ListIO selected;
SMESHGUI::selectionMgr()->selectedObjects( selected );
selected.Reverse(); // to keep order of selection
{
clear();
- TColStd_MapOfInteger ID;
+ SVTK_TVtkIDsMap ID;
QStringList ids = myNodes->text().split( " ", QString::SkipEmptyParts );
foreach ( QString idStr, ids )
{
// function : FindGravityCenter()
// purpose :
//=================================================================================
-void SMESHGUI_MergeDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
+void SMESHGUI_MergeDlg::FindGravityCenter(SVTK_TVtkIDsMap & theElemsIdMap,
std::vector<int>& theIDs,
std::list< gp_XYZ > & theGrCentersXYZ)
{
int nbNodes;
theIDs.reserve( theElemsIdMap.Extent() );
- TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
+ SVTK_TVtkIDsMapIterator idIter( theElemsIdMap );
for( ; idIter.More(); idIter.Next() ) {
const SMDS_MeshElement* anElem = aMesh->FindElement(idIter.Key());
if ( !anElem )
int i, nb = KeepList->count();
if ( isKeepIDsSelection() )
{
- SMESH::long_array_var anIdList = new SMESH::long_array();
+ SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array();
anIdList->length(nb);
for (i = 0; i < nb; i++)
anIdList[i] = KeepList->item(i)->text().toInt();
myIsBusy = true;
ListEdit->clear();
- TColStd_MapOfInteger anIndices;
+ SVTK_TVtkIDsMap anIndices;
QList<QListWidgetItem*> selItems = ListCoincident->selectedItems();
QListWidgetItem* anItem;
QStringList aListIds;
if (myIsBusy || !myActor)
return;
- TColStd_MapOfInteger anIndices;
+ SVTK_TVtkIDsMap anIndices;
QList<QListWidgetItem*> selItems = ListEdit->selectedItems();
QListWidgetItem* anItem;
if ( myActor )
{
mySelectionMgr->clearSelected();
- TColStd_MapOfInteger aIndexes;
+ SVTK_TVtkIDsMap aIndexes;
QList<QListWidgetItem*> selItems = KeepList->selectedItems();
QListWidgetItem* anItem;
foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt());
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-// Qt includes
+// GUI and Qt includes
#include <QDialog>
+#include <SVTK_Hash.h>
// OCCT includes
#include <gp_XYZ.hxx>
bool isKeepIDsSelection();
bool isNewKeepGroup( const char* entry );
- void FindGravityCenter( TColStd_MapOfInteger&,
+ void FindGravityCenter( SVTK_TVtkIDsMap&,
std::vector<int>& ,
std::list<gp_XYZ>& );
// add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list
// SALOME GUI includes
#include <SVTK_Renderer.h>
#include <SVTK_ViewWindow.h>
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
// VTK includes
#include <vtkCellArray.h>
anIdList->Delete();
// Insert cells in grid
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( aNbCells );
myIDPreview->SetPointsLabeled( false );
if ( myProxy ) {
- TColStd_MapOfInteger ID;
+ SVTK_TVtkIDsMap ID;
QSet<uint> ids;
std::vector<int> idVec;
std::list< gp_XYZ > aGrCentersXYZ;
for ( int i = 0; i < myButtons.count(); ++i )
myButtons[i]->setEnabled( true );
- SMESH::long_array_var nbElemsByType = obj->GetNbElementsByType();
+ SMESH::smIdType_array_var nbElemsByType = obj->GetNbElementsByType();
if ( ! &nbElemsByType.in() ) return;
const CORBA::Long ctrlLimit =
meshLoaded ? SMESHGUI::resourceMgr()->integerValue( "SMESH", "info_controls_limit", 3000 ) : -1;
// nodes info
- const CORBA::Long nbNodes = nbElemsByType[ SMESH::NODE ];
+ const SMESH::smIdType nbNodes = nbElemsByType[ SMESH::NODE ];
// const CORBA::Long nbElems = ( nbElemsByType[ SMESH::EDGE ] +
// nbElemsByType[ SMESH::FACE ] +
// nbElemsByType[ SMESH::VOLUME ] );
*/
// =========================================================================================
-void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
+void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::smIdType_array& theInfo)
{
// nodes
myNbNode ->setText( QString("%1").arg( theInfo[SMDSEntity_Node] ));
public:
SMESHGUI_MeshInfosBox( const bool, QWidget* );
- void SetMeshInfo( const SMESH::long_array& theInfo );
+ void SetMeshInfo( const SMESH::smIdType_array& theInfo );
private:
bool myFull;
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
// SALOME KERNEL includes
#include <SALOMEDS_SObject.hxx>
}
QList<int> ids;
getIds(ids);
- SMESH::long_array_var varIds = new SMESH::long_array();
+ SMESH::smIdType_array_var varIds = new SMESH::smIdType_array();
varIds->length(ids.count());
- int i = 0;
+ CORBA::ULong i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
varIds[i++] = *it;
myType == Type_2d
SMESH::point_array_var pnts;
QList<int> ids;
if (isRefine() && getIds(ids)) {
- SMESH::long_array_var varIds = new SMESH::long_array();
+ SMESH::smIdType_array_var varIds = new SMESH::smIdType_array();
varIds->length(ids.count());
- int i = 0;
+ CORBA::ULong i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
varIds[i++] = *it;
pnts = myType == Type_2d
else aCellTypesArray->InsertNextValue(VTK_EMPTY_CELL);
}
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(aNbCells);
if (aMesh) {
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
#include <SVTK_Selector.h>
#include <SVTK_ViewWindow.h>
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
// OCCT includes
#include <Bnd_B3d.hxx>
// Purpose : Retrieve identifiers from list box or the whole object
//=======================================================================
-SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj)
+SMESH::smIdType_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj)
{
- SMESH::long_array_var anIds = new SMESH::long_array;
+ SMESH::smIdType_array_var anIds = new SMESH::smIdType_array;
if (myToAllChk->isChecked())
{
if (nbSelected == 0)
return;
- TColStd_IndexedMapOfInteger toBeAdded;
+ SVTK_TIndexedMapOfVtkId toBeAdded;
if (!mySubmeshChk->isChecked() && !myGroupChk->isChecked()) {
if (nbSelected > 0)
SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIter.Value());
if (!aSubMesh->_is_nil()) {
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
- SMESH::long_array_var anIds = aSubMesh->GetElementsId();
+ SMESH::smIdType_array_var anIds = aSubMesh->GetElementsId();
for (int i = 0, n = anIds->length(); i < n; i++) {
- if (isIdValid(anIds[ i ]))
+ if (isIdValid(FromIdType<int>(anIds[ i ])))
toBeAdded.Add(anIds[ i ]);
}
}
if (!aGroup->_is_nil() && ((aGroup->GetType() == SMESH::FACE && entityType() == 0) ||
(aGroup->GetType() == SMESH::VOLUME && entityType() == 1))) {
if (aGroup->GetMesh()->GetId() == myMesh->GetId()) {
- SMESH::long_array_var anIds = aGroup->GetListOfID();
+ SMESH::smIdType_array_var anIds = aGroup->GetListOfID();
for (int i = 0, n = anIds->length(); i < n; i++) {
- if (isIdValid(anIds[ i ]))
+ if (isIdValid(FromIdType<int>(anIds[ i ])))
toBeAdded.Add(anIds[ i ]);
}
}
anActor = myActor;
TVisualObjPtr anObj = anActor->GetObject();
- TColStd_MapOfInteger anIndexes;
+ SVTK_TVtkIDsMap anIndexes;
int total = myListBox->count();
for (int i = 0; i < total; i++)
{
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_IDSource_var obj;
- SMESH::long_array_var anIds = getIds(obj);
+ SMESH::smIdType_array_var anIds = getIds(obj);
bool aResult = process(aMeshEditor, anIds.inout(), obj);
if (aResult) {
{
}
-bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
- const SMESH::long_array& theIds,
- SMESH::SMESH_IDSource_ptr obj)
+bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
+ const SMESH::smIdType_array& theIds,
+ SMESH::SMESH_IDSource_ptr obj)
{
if ( CORBA::is_nil( obj ))
return theEditor->Reorient(theIds);
int SMESHGUI_ChangeOrientationDlg::nbElemsInMesh()
{
- return ( myFilterType == SMESH::FaceFilter ) ? myMesh->NbFaces() : myMesh->NbVolumes();
+ return ( myFilterType == SMESH::FaceFilter ) ? FromIdType<int>(myMesh->NbFaces()) : FromIdType<int>(myMesh->NbVolumes());
}
/*!
}
bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
- const SMESH::long_array& theIds,
+ const SMESH::smIdType_array& theIds,
SMESH::SMESH_IDSource_ptr obj)
{
{
int SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh()
{
- return myMesh->NbTriangles();
+ return FromIdType<int>(myMesh->NbTriangles());
}
void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview )
SUIT_OverrideCursor aWaitCursor;
// get Ids of elements
SMESH::SMESH_IDSource_var obj;
- SMESH::long_array_var anElemIds = getIds( obj );
+ SMESH::smIdType_array_var anElemIds = getIds( obj );
SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
}
bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
- const SMESH::long_array& theIds,
+ const SMESH::smIdType_array& theIds,
SMESH::SMESH_IDSource_ptr obj)
{
bool hasObj = (! CORBA::is_nil( obj ));
int SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh()
{
- return myMesh->NbQuadrangles();
+ return FromIdType<int>(myMesh->NbQuadrangles());
}
SUIT_OverrideCursor aWaitCursor;
// get Ids of elements
SMESH::SMESH_IDSource_var obj;
- SMESH::long_array_var anElemIds = getIds(obj);
+ SMESH::smIdType_array_var anElemIds = getIds(obj);
if (anElemIds->length() == 0 && obj->_is_nil() )
return;
const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(anIter->next());
if (aNode)
{
- if (!anIdToVtk.IsBound(aNode->GetID()))
+ if (!anIdToVtk.IsBound(FromIdType<int>(aNode->GetID())))
{
aPoints->SetPoint(++nbPoints, aNode->X(), aNode->Y(), aNode->Z());
- anIdToVtk.Bind(aNode->GetID(), nbPoints);
+ anIdToVtk.Bind(FromIdType<int>(aNode->GetID()), nbPoints);
}
- aNodes[ k++ ] = aNode->GetID();
+ aNodes[ k++ ] = FromIdType<int>(aNode->GetID());
}
}
else // use numerical functor
{
// compare two sets of possible triangles
- int diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion);
+ smIdType diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion);
if (diag == 1) // 1-3
isDiag13 = true;
else if (diag == 2) // 2-4
}
}
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(aNbCells);
}
bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
- const SMESH::long_array& theIds,
+ const SMESH::smIdType_array& theIds,
SMESH::SMESH_IDSource_ptr theObj)
{
SMESH::IDSource_wrap obj = theObj;
int SMESHGUI_SplitVolumesDlg::nbElemsInMesh()
{
- return isIntoPrisms() ? myMesh->NbHexas() : myMesh->NbVolumes() - myMesh->NbTetras();
+ return isIntoPrisms() ? FromIdType<int>(myMesh->NbHexas()) : FromIdType<int>(myMesh->NbVolumes() - myMesh->NbTetras());
}
bool SMESHGUI_SplitVolumesDlg::isIntoPrisms()
if (!aSelMesh->_is_nil())
myMesh = aSelMesh;
- TColStd_IndexedMapOfInteger aMapIndex;
+ SVTK_TIndexedMapOfVtkId aMapIndex;
mySelector->GetIndex( anIO, aMapIndex );
if ( !aMapIndex.IsEmpty() )
showFacetByElement( aMapIndex(1) );
QWidget* createButtonFrame( QWidget* );
QWidget* createMainFrame( QWidget*, const bool );
virtual bool isValid( const bool );
- SMESH::long_array_var getIds(SMESH::SMESH_IDSource_var& obj);
+ SMESH::smIdType_array_var getIds(SMESH::SMESH_IDSource_var& obj);
void updateButtons();
virtual void setSelectionMode();
virtual bool isIdValid( const int ) const;
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
- const SMESH::long_array& ,
+ const SMESH::smIdType_array& ,
SMESH::SMESH_IDSource_ptr obj) = 0;
virtual int nbElemsInMesh() = 0;
int entityType();
protected:
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
- const SMESH::long_array& ,
+ const SMESH::smIdType_array& ,
SMESH::SMESH_IDSource_ptr obj);
virtual int nbElemsInMesh();
};
protected:
virtual bool isValid( const bool );
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
- const SMESH::long_array&,
+ const SMESH::smIdType_array&,
SMESH::SMESH_IDSource_ptr obj );
virtual int nbElemsInMesh();
protected:
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
- const SMESH::long_array& ,
+ const SMESH::smIdType_array& ,
SMESH::SMESH_IDSource_ptr obj);
virtual int nbElemsInMesh();
protected:
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
- const SMESH::long_array&,
+ const SMESH::smIdType_array&,
SMESH::SMESH_IDSource_ptr obj );
virtual int nbElemsInMesh();
#include <SVTK_ViewWindow.h>
#include <VTKViewer_Algorithm.h>
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
// SALOME KERNEL includes
#include <SALOMEDS_Study.hxx>
aCells->InsertNextCell( anIdList );
aCellTypesArray->InsertNextValue( VTK_VERTEX );
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents( 1 );
aCellLocationsArray->SetNumberOfTuples( 1 );
}
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[0] = aNodeId;
aGroupUsed->Add( anIdList.inout() );
{
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
anElementsId[i] = aListElementsId[i].toInt();
if (aMesh) {
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++)
}
else
{
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
if ( theFunctor ) theFunctor->SetMesh( GetMesh() );
}
-int SMESHGUI_PreVisualObj::GetElemDimension( const int theObjId )
+int SMESHGUI_PreVisualObj::GetElemDimension( const smIdType theObjId )
{
if ( const SMDS_MeshElement* anElem = myMesh->FindElement( theObjId ))
{
return -1;
}
-int SMESHGUI_PreVisualObj::GetNbEntities( const SMDSAbs_ElementType theType ) const
+smIdType SMESHGUI_PreVisualObj::GetNbEntities( const SMDSAbs_ElementType theType ) const
{
return myMesh->GetMeshInfo().NbElements( theType );
}
// purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 1 )
//=================================================================================
-bool SMESHGUI_PreVisualObj::GetEdgeNodes( const int theElemId,
- const int theEdgeNum,
- int& theNodeId1,
- int& theNodeId2 ) const
+bool SMESHGUI_PreVisualObj::GetEdgeNodes( const smIdType theElemId,
+ const int theEdgeNum,
+ smIdType& theNodeId1,
+ smIdType& theNodeId2 ) const
{
const SMDS_MeshElement* e = myMesh->FindElement( theElemId );
if ( !e || e->GetType() != SMDSAbs_Face )
}
-vtkIdType SMESHGUI_PreVisualObj::GetNodeObjId( int theVTKID )
+vtkIdType SMESHGUI_PreVisualObj::GetNodeObjId( vtkIdType theVTKID )
{
const SMDS_MeshNode* aNode = myMesh->FindNodeVtk( theVTKID );
return aNode ? aNode->GetID() : -1;
}
-vtkIdType SMESHGUI_PreVisualObj::GetNodeVTKId( int theObjID )
+vtkIdType SMESHGUI_PreVisualObj::GetNodeVTKId( vtkIdType theObjID )
{
const SMDS_MeshNode* aNode = myMesh->FindNode( theObjID );
return aNode ? aNode->GetID() : -1;
}
-vtkIdType SMESHGUI_PreVisualObj::GetElemObjId( int theVTKID )
+vtkIdType SMESHGUI_PreVisualObj::GetElemObjId( vtkIdType theVTKID )
{
return this->GetMesh()->FromVtkToSmds(theVTKID);
}
-vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( int theObjID )
+vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( vtkIdType theObjID )
{
const SMDS_MeshElement* e = myMesh->FindElement(theObjID);
return e ? e->GetVtkID() : -1;
virtual bool Update( int theIsClear );
virtual bool NulData() { return false; }
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
- virtual int GetElemDimension( const int theObjId );
- virtual int GetNbEntities( const SMDSAbs_ElementType theType) const;
+ virtual int GetElemDimension( const smIdType theObjId );
+ virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const;
virtual bool IsValid() const;
- virtual bool GetEdgeNodes( const int theElemId,
- const int theEdgeNum,
- int& theNodeId1,
- int& theNodeId2 ) const;
+ virtual bool GetEdgeNodes( const smIdType theElemId,
+ const int theEdgeNum,
+ smIdType& theNodeId1,
+ smIdType& theNodeId2 ) const;
- virtual vtkIdType GetNodeObjId( int theVTKID );
- virtual vtkIdType GetNodeVTKId( int theObjID );
- virtual vtkIdType GetElemObjId( int theVTKID );
- virtual vtkIdType GetElemVTKId( int theObjID );
+ virtual vtkIdType GetNodeObjId( vtkIdType theVTKID );
+ virtual vtkIdType GetNodeVTKId( vtkIdType theObjID );
+ virtual vtkIdType GetElemObjId( vtkIdType theVTKID );
+ virtual vtkIdType GetElemVTKId( vtkIdType theObjID );
virtual void ClearEntitiesFlags();
virtual bool GetEntitiesFlag();
virtual unsigned int GetEntitiesState();
SUIT_OverrideCursor wc;
QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
+ SMESH::smIdType_array_var anArrayOfIdeces = new SMESH::smIdType_array;
anArrayOfIdeces->length(aListId.count());
for (int i = 0; i < aListId.count(); i++)
anArrayOfIdeces[i] = aListId[ i ].toInt();
if(SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh()){
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
if (myNbOkNodes) {
QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
+ SMESH::smIdType_array_var anArrayOfIdeces = new SMESH::smIdType_array;
anArrayOfIdeces->length(aListId.count());
for (int i = 0; i < aListId.count(); i++)
anArrayOfIdeces[i] = aListId[ i ].toInt();
if(SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh()){
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
if ( nbSelected == 1 )
{
- TColStd_IndexedMapOfInteger faceIndices;
+ SVTK_TIndexedMapOfVtkId faceIndices;
selector()->GetIndex( anIO, faceIndices );
if ( faceIndices.Extent() == 1 )
{
}
else
{
- TColStd_IndexedMapOfInteger nodeIndices;
+ SVTK_TIndexedMapOfVtkId nodeIndices;
selector()->GetIndex( anIO, nodeIndices );
if ( nodeIndices.Extent() > 0 && nodeIndices.Extent() <=2 )
{
myDlg->activateObject( EFace );
myDlg->setObjectText( EFace, theText );
}
- TColStd_MapOfInteger ids;
+ SVTK_TVtkIDsMap ids;
if ( !theText.isEmpty() && theText.toInt() > 0 )
ids.Add( theText.toInt() );
#include <SVTK_ViewWindow.h>
#include <SVTK_Selector.h>
#include <SALOME_ListIO.hxx>
-#include <VTKViewer_CellLocationsArray.h>
+//#include <VTKViewer_CellLocationsArray.h>
// OCCT includes
#include <TColStd_MapOfInteger.hxx>
return;
Handle(SALOME_InteractiveObject) IO = aList.First();
- TColStd_IndexedMapOfInteger aMapIndex;
+ SVTK_TIndexedMapOfVtkId aMapIndex;
mySelector->GetIndex(IO,aMapIndex);
if ( aMapIndex.Extent() != 1 )
return;
if (myNbOkElements && IsAxisOk()) {
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
if (send == LineEditElements) {
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
if (myPreviewCheckBox->isChecked() && toDisplayPreview) {
if(myNbOkElements && isValid() && IsAxisOk()) {
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
if (myNbOkElements) {
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
if (aMesh) {
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
if ( myNbOkElements && isValid() ) {
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
// Purpose : Select/deselect cells of mesh
//=======================================================================
void SMESHGUI_SelectionOp::addOrRemoveIndex( const Handle( SALOME_InteractiveObject )& obj,
- const TColStd_MapOfInteger& indices,
+ const SVTK_TVtkIDsMap& indices,
const bool isModeShift )
{
SVTK_Selector* sel = selector();
if( !dlg() )
return;
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
SALOME_ListIO sel; selectionMgr()->selectedObjects( sel );
SMESH_Actor* anActor = actor();
// SALOME GUI includes
#include <SVTK_Selection.h>
+#include <SVTK_Hash.h>
#include <SALOME_InteractiveObject.hxx>
// IDL includes
//! Select some nodes or elements in VTK
void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
- const TColStd_MapOfInteger&, const bool isModeShift);
+ const SVTK_TVtkIDsMap&, const bool isModeShift);
SVTK_ViewWindow* viewWindow() const;
SVTK_Selector* selector() const;
SMESH::MeshInfo info;
if ( !isNull() )
{
- SMESH::long_array_var data = myObject->GetMeshInfo();
+ SMESH::smIdType_array_var data = myObject->GetMeshInfo();
for ( uint type = SMESH::Entity_Node; type < SMESH::Entity_Last; type++ )
{
if ( type < data->length() )
SMESH::SMESH_Mesh_var mesh = myObject->GetMesh();
if ( !CORBA::is_nil( mesh ) )
{
- SMESH::long_array_var elements = mesh->GetNodeInverseElements( id, SMESH::ALL );
+ SMESH::smIdType_array_var elements = mesh->GetNodeInverseElements( id, SMESH::ALL );
for ( int i = 0, n = elements->length(); i < n; i++ )
{
SMESH::ElementType type = mesh->GetElementType( elements[i], true );
SMESH::SMESH_Mesh_var mesh = myObject->GetMesh();
if ( !CORBA::is_nil( mesh ) )
{
- SMESH::long_array_var nodes = mesh->GetElemNodes( id );
+ SMESH::smIdType_array_var nodes = mesh->GetElemNodes( id );
result = nodes->length() > 0;
}
}
\param connectivity Return element connectivity.
\return \c true if result is valid; \c false otherwise.
*/
-bool SMESH::SelectionProxy::elementConnectivity( int id, Connectivity& connectivity )
+bool SMESH::SelectionProxy::elementConnectivity( SMESH::smIdType id, Connectivity& connectivity )
{
bool result = false;
connectivity.clear();
if ( !isNull() )
{
- QSet<int> nodes; // order of nodes is important
+ QSet<SMESH::smIdType> nodes; // order of nodes is important
if ( actor() )
{
const SMDS_MeshElement* element = actor()->GetObject()->GetMesh()->FindElement( id );
{
while ( it->more() )
{
- int n = it->next()->GetID();
+ SMESH::smIdType n = it->next()->GetID();
if ( !nodes.contains( n ))
{
connectivity[ SMDSAbs_Node ] << n;
SMESH::SMESH_Mesh_var mesh = myObject->GetMesh();
if ( !CORBA::is_nil( mesh ) )
{
- SMESH::long_array_var nn = mesh->GetElemNodes( id );
+ SMESH::smIdType_array_var nn = mesh->GetElemNodes( id );
for ( int i = 0, nb = nn->length(); i < nb; i++ )
{
if ( !nodes.contains( nn[i] ))
CORBA::Long nbFaces = mesh->ElemNbFaces( id );
for ( CORBA::Long iF = 0; iF < nbFaces; ++iF )
{
- SMESH::long_array_var nodes = mesh->GetElemFaceNodes( id, iF );
+ SMESH::smIdType_array_var nodes = mesh->GetElemFaceNodes( id, iF );
for ( CORBA::ULong iN = 0; iN < nodes->length(); ++iN )
{
connectivity[ iF+1 ] << nodes[iN];
SMESH::SMESH_Mesh_var mesh = myObject->GetMesh();
if ( !CORBA::is_nil( mesh ) )
{
- SMESH::long_array_var nodes = mesh->GetElemNodes( id );
+ SMESH::smIdType_array_var nodes = mesh->GetElemNodes( id );
for ( int i = 0, n = nodes->length(); i < n; i++ )
{
SMESH::double_array_var coords = mesh->GetNodeXYZ( nodes[i] );
\param autoCompute Compute size if it is unavailable. Defaults to \c false.
\return Group's size.
*/
-int SMESH::SelectionProxy::size( bool autoCompute ) const
+SMESH::smIdType SMESH::SelectionProxy::size( bool autoCompute ) const
{
// note: size is not computed for group on filter for performance reasons, see IPAL52831
- int result = -1;
+ SMESH::smIdType result = -1;
if ( !isNull() )
{
SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow( myObject );
\param autoCompute Compute size if it is unavailable. Defaults to \c false.
\return Number of nodes contained in group.
*/
-int SMESH::SelectionProxy::nbNodes( bool autoCompute ) const
+SMESH::smIdType SMESH::SelectionProxy::nbNodes( bool autoCompute ) const
{
// note: nb of nodes is not computed automatically for performance reasons
- int result = -1;
+ SMESH::smIdType result = -1;
if ( !isNull() )
{
SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow( myObject );
SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow( myObject );
if ( !CORBA::is_nil( group ) )
{
- SMESH::long_array_var seq = group->GetListOfID();
+ SMESH::smIdType_array_var seq = group->GetListOfID();
for ( int i = 0, n = seq->length(); i < n; i++ )
result << (uint)seq[i];
}
bool hasElement( int );
SMESH::ElementType elementType( int ) const;
int elementEntityType( int ) const;
- bool elementConnectivity( int, Connectivity& );
+ bool elementConnectivity( SMESH::smIdType, Connectivity& );
bool perFaceConnectivity( int, Connectivity&, int& );
bool elementPosition( int, Position& );
bool elementGravityCenter( int, XYZ& );
// methods that work for group only
SMESH::ElementType groupElementType() const;
QColor color() const;
- int size( bool = false ) const;
- int nbNodes( bool = false ) const;
+ SMESH::smIdType size( bool = false ) const;
+ SMESH::smIdType nbNodes( bool = false ) const;
QSet<uint> ids() const;
private:
QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts);
QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId1 = new SMESH::long_array;
- SMESH::long_array_var anElementsId2 = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId1 = new SMESH::smIdType_array;
+ SMESH::smIdType_array_var anElementsId2 = new SMESH::smIdType_array;
anElementsId1->length(aListElementsId1.count());
anElementsId2->length(aListElementsId2.count());
send->clear();
if (aMesh) {
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
if (GetConstructorId() != 3 || (send != LineEdit1 && send != LineEdit4)) {
SMESH::SetPointRepresentation(true);
case VOLUME: type = SMDSAbs_Volume; break;
default: return;
}
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
for ( int i = 0; i < aListId.count(); i++ ) {
if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
aList.Append(anIO);
mySelectionMgr->setSelectedObjects(aList,false);
- SVTK_IndexedMapOfIds selectedIndices;
- SVTK_ListOfInteger newIndices;
+ SVTK_IndexedMapOfVtkIds selectedIndices;
+ SVTK_ListOfVtk newIndices;
mySelector->GetCompositeIndex(anIO,selectedIndices);
int id1, id2;
if ( findTriangles(aNode1,aNode2,tria1,tria2) )
{
- newIndices.push_back( aNode1->GetID() );
- newIndices.push_back( aNode2->GetID() );
-
+ newIndices.push_back( aNode1->GetID() );
+ newIndices.push_back( aNode2->GetID() );
+
myOkBtn->setEnabled(true);
myApplyBtn->setEnabled(true);
}
if(SMDS_Mesh* aMesh = aVisualObj->GetMesh())
{
const SMDS_MeshElement* tria[2];
-
- bool valid = false;
- SVTK_IndexedMapOfIds anIds;
+
+ bool valid = false;
+ SVTK_IndexedMapOfVtkIds anIds;
mySelector->GetCompositeIndex(anIO,anIds);
if( anIds.Extent() == 1 && anIds(1).size() == 2 ) {
- anId1 = anIds(1)[0];
- anId2 = anIds(1)[1];
- valid = true;
+ anId1 = anIds(1)[0];
+ anId2 = anIds(1)[1];
+ valid = true;
}
-
+
if( valid &&
findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
{
QString aText = QString("%1-%2").arg(anId1).arg(anId2);
myEdge->setText(aText);
-
+
myOkBtn->setEnabled(true);
myApplyBtn->setEnabled(true);
}
QStringList aListElementsId = LineEditElements->text().split(" ", QString::SkipEmptyParts);
QStringList aListNodesId = LineEditNodes->text().split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
- SMESH::long_array_var aNodesId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
+ SMESH::smIdType_array_var aNodesId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
if (send == LineEditElements) {
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
for (int i = 0; i < aListId.count(); i++) {
int id = aListId[ i ].toInt();
if ( id > 0 ) {
}
}
else if (send == LineEditNodes) {
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
for (int i = 0; i < aListId.count(); i++) {
int id = aListId[ i ].toInt();
if ( id > 0 ) {
myNbOkElements = true;
} else {
// get indices of selected elements
- TColStd_IndexedMapOfInteger aMapIndex;
+ SVTK_TIndexedMapOfVtkId aMapIndex;
mySelector->GetIndex(IO,aMapIndex);
myNbOkElements = aMapIndex.Extent();
if (myNbOkElements && IsMirrorOk()) {
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
if (aMesh) {
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
if ( myNbOkElements && isValid() && IsMirrorOk() )
{
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
if (myNbOkElements) {
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
if (aMesh) {
Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
- TColStd_MapOfInteger newIndices;
+ SVTK_TVtkIDsMap newIndices;
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
{
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
- SMESH::long_array_var anElementsId = new SMESH::long_array;
+ SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
{
if ( myViewWindow ) {
SUIT_OverrideCursor wc;
- float opacity = ( 100 - Slider1->value() ) / 100.;
+ //float opacity = ( 100.f - Slider1->value() ) / 100.;
+ float opacity = float( 100 - Slider1->value() ) / 100.;
SALOME_ListIO aList;
mySelectionMgr->selectedObjects( aList );
QString& theName)
{
theName = "";
- TColStd_IndexedMapOfInteger aMapIndex;
+ SVTK_TIndexedMapOfVtkId aMapIndex;
theSelector->GetIndex(theIO,aMapIndex);
for(int i = 1; i <= aMapIndex.Extent(); i++)
QString& theName)
{
theName = "";
- TColStd_IndexedMapOfInteger aMapIndex;
+ SVTK_TIndexedMapOfVtkId aMapIndex;
theSelector->GetIndex(theIO,aMapIndex);
- typedef std::set<int> TIdContainer;
+ typedef std::set<vtkIdType> TIdContainer;
TIdContainer anIdContainer;
for( int i = 1; i <= aMapIndex.Extent(); i++)
anIdContainer.insert(aMapIndex(i));
int GetEdgeNodes(SVTK_Selector* theSelector,
const TVisualObjPtr& theVisualObject,
- int& theId1,
- int& theId2)
+ smIdType& theId1,
+ smIdType& theId2)
{
const SALOME_ListIO& selected = theSelector->StoredIObjects();
if ( anIO.IsNull() || !anIO->hasEntry() )
return -1;
- TColStd_IndexedMapOfInteger aMapIndex;
+ SVTK_TIndexedMapOfVtkId aMapIndex;
theSelector->GetIndex( anIO, aMapIndex );
if ( aMapIndex.Extent() != 2 )
return -1;
- int anObjId = -1, anEdgeNum = -1;
- for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
- int aVal = aMapIndex( i );
+ smIdType anObjId = -1, anEdgeNum = -1;
+ for ( smIdType i = 1; i <= aMapIndex.Extent(); i++ ) {
+ smIdType aVal = aMapIndex( i );
if ( aVal > 0 )
anObjId = aVal;
else
}
- int GetEdgeNodes( LightApp_SelectionMgr* theMgr, int& theId1, int& theId2 )
+ int GetEdgeNodes( LightApp_SelectionMgr* theMgr, smIdType& theId1, smIdType& theId2 )
{
SALOME_ListIO selected; theMgr->selectedObjects( selected );
if ( aMapIndex.Extent() != 2 )
return -1;
- int anObjId = -1, anEdgeNum = -1;
- for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
- int aVal = aMapIndex( i );
+ smIdType anObjId = -1, anEdgeNum = -1;
+ for ( smIdType i = 1; i <= aMapIndex.Extent(); i++ ) {
+ smIdType aVal = aMapIndex( i );
if ( aVal > 0 )
anObjId = aVal;
else
const Handle(SALOME_InteractiveObject)&,
QString& );
SMESHGUI_EXPORT
- int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& );
+ int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, smIdType&, smIdType& );
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
const bool = true );
SMESHGUI_EXPORT
- int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );
+ int GetEdgeNodes( LightApp_SelectionMgr*, smIdType&, smIdType& );
SMESHGUI_EXPORT
void SetControlsPrecision( const long );
const SMDS_MeshNode* NextNode( double bc[3], int triaNodes[3] );
// return nb of nodes returned by NextNode()
- int NbVisitedNodes() const { return _nbVisitedNodes; }
+ size_t NbVisitedNodes() const { return _nbVisitedNodes; }
// find a triangle containing an UV, starting from a given triangle;
double tolerance)
:SMESH_Octree( new LimitAndPool() )
{
- int nbElems = mesh.GetMeshInfo().NbElements( elemType );
+ smIdType nbElems = mesh.GetMeshInfo().NbElements( elemType );
_elements.reserve( nbElems );
TElementBoxPool& elBoPool = getLimitAndPool()->_elBoPool;
typedef std::pair< bool, const SMDS_MeshNode* > TIsSharpAndMedium;
typedef NCollection_DataMap< SMESH_TLink, TIsSharpAndMedium, SMESH_TLink > TLinkSharpMap;
- TLinkSharpMap linkIsSharp( theMesh->NbFaces() );
+ TLinkSharpMap linkIsSharp;
+ Standard_Integer nbBuckets = FromIdType<Standard_Integer>( theMesh->NbFaces() );
+ if ( nbBuckets > 0 )
+ linkIsSharp.ReSize( nbBuckets );
+
TIsSharpAndMedium sharpMedium( true, 0 );
bool & isSharp = sharpMedium.first;
const SMDS_MeshNode* & nMedium = sharpMedium.second;
typedef std::vector< const SMDS_MeshElement* > TFaceVec;
typedef NCollection_DataMap< SMESH_TLink, TFaceVec, SMESH_TLink > TFacesByLinks;
- TFacesByLinks facesByLink( theMesh->NbFaces() );
+ TFacesByLinks facesByLink;
+ Standard_Integer nbBuckets = FromIdType<Standard_Integer>( theMesh->NbFaces() );
+ if ( nbBuckets > 0 )
+ facesByLink.ReSize( nbBuckets );
std::vector< const SMDS_MeshNode* > faceNodes;
for ( SMDS_FaceIteratorPtr faceIt = theMesh->facesIterator(); faceIt->more(); )
/*!
* \brief Return nb nodes in a tree
*/
- int NbNodes() const { return myNodes.size(); }
+ size_t NbNodes() const { return myNodes.size(); }
protected:
static Standard_Integer HashCode(const CutFace& f, const Standard_Integer upper)
{
- return ::HashCode( f.myInitFace->GetID(), upper );
+ return ::HashCode( FromIdType<int>(f.myInitFace->GetID()), upper );
}
static Standard_Boolean IsEqual(const CutFace& f1, const CutFace& f2 )
{
for ( ; cutFacesIt != myCutFaces.cend(); ++cutFacesIt )
{
const CutFace& cf = *cutFacesIt;
- int index = cf.myInitFace->GetID(); // index in theNew2OldFaces
- if ((int) theNew2OldFaces.size() <= index )
+ smIdType index = cf.myInitFace->GetID(); // index in theNew2OldFaces
+ if ((smIdType) theNew2OldFaces.size() <= index )
theNew2OldFaces.resize( index + 1 );
theNew2OldFaces[ index ] = std::make_pair( cf.myInitFace, index );
}
// erase loops that are cut off by face intersections
cf.CutOffLoops( loopSet, theSign, myNormals, cutOffLinks, cutOffCoplanarLinks );
- int index = cf.myInitFace->GetID(); // index in theNew2OldFaces
+ smIdType index = cf.myInitFace->GetID(); // index in theNew2OldFaces
const SMDS_MeshElement* tria;
for ( size_t iL = 0; iL < loopSet.myNbLoops; ++iL )
continue;
for ( size_t iF = 0; iF < faces.size(); ++iF )
{
- int index = faces[iF]->GetID();
+ smIdType index = faces[iF]->GetID();
// if ( //faces[iF]->isMarked() || // kept part of cutFace
// !theNew2OldFaces[ index ].first ) // already removed
// continue;
if ( cf.myInitFace->IsNull() )
continue;
- int index = cf.myInitFace->GetID(); // index in theNew2OldFaces
+ smIdType index = cf.myInitFace->GetID(); // index in theNew2OldFaces
if ( !theNew2OldFaces[ index ].first )
continue; // already cut off
for ( SMDS_ElemIteratorPtr fIt = newNode->GetInverseElementIterator(); fIt->more(); )
{
const SMDS_MeshElement* newFace = fIt->next();
- const int faceIndex = newFace->GetID();
+ const smIdType faceIndex = newFace->GetID();
const gp_XYZ& oldNorm = normals[ faceIndex ];
const gp_XYZ newXYZ = oldXYZ + oldNorm * theOffset;
if ( multiPos.empty() )
for ( SMDS_ElemIteratorPtr fIt = newNode->GetInverseElementIterator(); fIt->more(); )
{
const SMDS_MeshElement* newFace = fIt->next();
- const int faceIndex = newFace->GetID();
+ const smIdType faceIndex = newFace->GetID();
const gp_XYZ& oldNorm = normals[ faceIndex ];
if ( !SMESH_MeshAlgos::FaceNormal( newFace, faceNorm, /*normalize=*/false ) ||
//faceNorm * moveVec < 0 )
*/
//================================================================================
- void findGroups( const SMDS_MeshElement * theFace,
- TGroupVec & theGroupsToUpdate,
- NCollection_DataMap< int, TGroupVec > & theFaceID2Groups,
- TGroupVec & theWorkGroups )
+ void findGroups( const SMDS_MeshElement * theFace,
+ TGroupVec & theGroupsToUpdate,
+ NCollection_DataMap< smIdType, TGroupVec, smIdHasher > & theFaceID2Groups,
+ TGroupVec & theWorkGroups )
{
theWorkGroups.clear();
for ( size_t i = 0; i < theGroupsToUpdate.size(); ++i )
std::vector< SMESH_NodeXYZ > facePoints(4);
std::vector< Intersector::TFace > cutFacePoints;
- NCollection_DataMap< int, TGroupVec > faceID2Groups;
+ NCollection_DataMap< smIdType, TGroupVec, smIdHasher > faceID2Groups;
TGroupVec groupVec;
std::vector< gp_Ax1 > planeNormalVec(2);
//-------------------------------------------------------------------------------------
// A macro makes description of a caught exception and calls onExceptionFun(const char*).
-// Two onExceptionFun() are defined here: SMESH::throwSalomeEx() and SMESH::doNothing().
+// Several onExceptionFun() are defined here: throwSalomeEx(), doNothing() and returnError().
// To add your own catch close, define SMY_OWN_CATCH macro before including this file.
#define SMESH_CATCH( onExceptionFun ) \
} \
+ \
+ SMY_OWN_CATCH \
+ \
catch (Standard_Failure& ex) \
{ \
SMESH_Comment text("OCCT Exception: "); \
{ \
SMESH_CAUGHT onExceptionFun( ex.what() ); \
} \
- \
- SMY_OWN_CATCH \
- \
catch (...) \
{ \
SMESH_CAUGHT onExceptionFun("Unknown Exception caught"); \
#include "SMDS_SetIterator.hxx"
#include "SMDS_MeshNode.hxx"
+#include <smIdType.hxx>
+
#include <gp_XYZ.hxx>
#include <gp_XY.hxx>
// methods for usage of SMESH_TLink as a hasher in NCollection maps
static int HashCode(const SMESH_TLink& link, int aLimit)
{
- return ::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit );
+ return ::HashCode( FromIdType<int>(link.node1()->GetID() + link.node2()->GetID()), aLimit );
}
static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2)
{
{
static Standard_Integer HashCode(const SMDS_MeshElement* e, const Standard_Integer upper)
{
- return ::HashCode( e->GetID(), upper );
+ return ::HashCode( FromIdType<int>(e->GetID()), upper );
}
static Standard_Boolean IsEqual( const SMDS_MeshElement* e1, const SMDS_MeshElement* e2 )
{
Class : NumericalFunctor_i
Description : Base class for numerical functors
*/
-CORBA::Double NumericalFunctor_i::GetValue( CORBA::Long theId )
+CORBA::Double NumericalFunctor_i::GetValue( SMESH::smIdType theId )
{
return myNumericalFunctorPtr->GetValue( theId );
}
-CORBA::Boolean NumericalFunctor_i::IsApplicable( CORBA::Long theElementId )
+CORBA::Boolean NumericalFunctor_i::IsApplicable( SMESH::smIdType theElementId )
{
return myNumericalFunctorPtr->IsApplicable( theElementId );
}
{
std::vector<int> nbEvents;
std::vector<double> funValues;
- std::vector<int> elements;
+ std::vector<SMESH::smIdType> elements;
myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues,elements,0,isLogarithmic);
SMESH::Histogram_var histogram = new SMESH::Histogram;
{
SMESH::Histogram_var histogram = new SMESH::Histogram;
- std::vector<int> nbEvents;
- std::vector<double> funValues;
- std::vector<int> elements;
+ std::vector<int> nbEvents;
+ std::vector<double> funValues;
+ std::vector<SMESH::smIdType> elements;
SMDS_ElemIteratorPtr elemIt;
if ( SMESH::DownCast< SMESH_GroupOnFilter_i* >( object ) ||
}
else
{
- SMESH::SMESH_Mesh_var mesh = object->GetMesh();
- SMESH::long_array_var objNbElems = object->GetNbElementsByType();
- SMESH::long_array_var meshNbElems = mesh-> GetNbElementsByType();
+ SMESH::SMESH_Mesh_var mesh = object->GetMesh();
+ SMESH::smIdType_array_var objNbElems = object->GetNbElementsByType();
+ SMESH::smIdType_array_var meshNbElems = mesh-> GetNbElementsByType();
if ( meshNbElems[ GetElementType() ] !=
objNbElems [ GetElementType() ] )
{
myFunctorPtr = myPredicatePtr = myRangeOfIdsPtr;
}
-void RangeOfIds_i::SetRange( const SMESH::long_array& theIds )
+void RangeOfIds_i::SetRange( const SMESH::smIdType_array& theIds )
{
- CORBA::Long iEnd = theIds.length();
- for ( CORBA::Long i = 0; i < iEnd; i++ )
+ SMESH::smIdType iEnd = theIds.length();
+ for ( SMESH::smIdType i = 0; i < iEnd; i++ )
myRangeOfIdsPtr->AddToRange( theIds[ i ] );
TPythonDump()<<this<<".SetRange("<<theIds<<")";
}
TPythonDump() << this << ".SetVertex( " << vertex << " )";
}
-void ConnectedElements_i::SetNode ( CORBA::Long nodeID )
+void ConnectedElements_i::SetNode ( SMESH::smIdType nodeID )
{
if ( nodeID < 1 )
THROW_SALOME_CORBA_EXCEPTION( "ConnectedElements_i::SetNode(): nodeID must be > 0",
myPredicate->GetPredicate()->SetMesh( aMesh );
}
-SMESH::long_array*
+SMESH::smIdType_array*
Filter_i::
GetIDs()
{
Controls::Filter::GetElementsId(aMesh,thePredicate->GetPredicate(),theSequence);
}
-SMESH::long_array*
+SMESH::smIdType_array*
Filter_i::
GetElementsId( SMESH_Mesh_ptr theMesh )
{
- SMESH::long_array_var anArray = new SMESH::long_array;
+ SMESH::smIdType_array_var anArray = new SMESH::smIdType_array;
if(!CORBA::is_nil(theMesh) && myPredicate){
theMesh->Load();
Controls::Filter::TIdSequence aSequence;
return anArray._retn();
}
-SMESH::long_array*
+SMESH::smIdType_array*
Filter_i::
GetElementsIdFromParts( const ListOfIDSources& theParts )
{
- SMESH::long_array_var array = new SMESH::long_array;
+ SMESH::smIdType_array_var array = new SMESH::smIdType_array;
if ( theParts.length() > 0 && myPredicate )
{
SMESH_Mesh_ptr mesh = theParts[0]->GetMesh();
*/
//=============================================================================
-SMESH::long_array* ::Filter_i::GetMeshInfo()
+SMESH::smIdType_array* ::Filter_i::GetMeshInfo()
{
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::Entity_Last);
for (int i = 0; i < SMESH::Entity_Last; i++)
aRes[i] = 0;
*/
//=============================================================================
-SMESH::long_array* ::Filter_i::GetNbElementsByType()
+SMESH::smIdType_array* ::Filter_i::GetNbElementsByType()
{
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::NB_ELEMENT_TYPES);
for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
aRes[i] = 0;
if ( !CORBA::is_nil(myMesh) && myPredicate ) {
const SMDS_Mesh* aMesh = MeshPtr2SMDSMesh(myMesh);
SMDS_ElemIteratorPtr it = aMesh->elementsIterator( SMDSAbs_ElementType( GetElementType() ));
- CORBA::Long& nbElems = aRes[ GetElementType() ];
+ SMESH::smIdType& nbElems = aRes[ GetElementType() ];
while ( it->more() )
{
const SMDS_MeshElement* anElem = it->next();
public virtual Functor_i
{
public:
- CORBA::Double GetValue( CORBA::Long theElementId );
- CORBA::Boolean IsApplicable( CORBA::Long theElementId );
+ CORBA::Double GetValue( SMESH::smIdType theElementId );
+ CORBA::Boolean IsApplicable( SMESH::smIdType theElementId );
SMESH::Histogram* GetHistogram(CORBA::Short nbIntervals,
CORBA::Boolean isLogarithmic);
SMESH::Histogram* GetLocalHistogram(CORBA::Short nbIntervals,
{
public:
RangeOfIds_i();
- void SetRange( const SMESH::long_array& theIds );
+ void SetRange( const SMESH::smIdType_array& theIds );
CORBA::Boolean SetRangeStr( const char* theRange );
char* GetRangeStr();
void SetElementType( ElementType theType );
void SetPoint( CORBA::Double x, CORBA::Double y, CORBA::Double z );
void SetVertex( GEOM::GEOM_Object_ptr vertex );
- void SetNode ( CORBA::Long nodeID );
+ void SetNode ( SMESH::smIdType nodeID );
void SetThreshold ( const char* threshold,
SMESH::ConnectedElements::ThresholdType type );
char* GetThreshold ( SMESH::ConnectedElements::ThresholdType& type );
Controls::Filter::TIdSequence& );
virtual
- long_array*
+ smIdType_array*
GetElementsId( SMESH_Mesh_ptr );
virtual
- long_array*
+ smIdType_array*
GetElementsIdFromParts( const ListOfIDSources& theParts );
virtual
// =========================
// SMESH_IDSource interface
// =========================
- virtual SMESH::long_array* GetIDs();
- virtual SMESH::long_array* GetMeshInfo();
- virtual SMESH::long_array* GetNbElementsByType();
+ virtual SMESH::smIdType_array* GetIDs();
+ virtual SMESH::smIdType_array* GetMeshInfo();
+ virtual SMESH::smIdType_array* GetNbElementsByType();
virtual SMESH::array_of_ElementType* GetTypes();
virtual SMESH::SMESH_Mesh_ptr GetMesh();
virtual bool IsMeshInfoCorrect() { return true; }
*/
//=============================================================================
-SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
- GEOM::GEOM_Object_ptr theShapeObject)
-// SMESH::long_array& theNbElems)
+SMESH::smIdType_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
+ GEOM::GEOM_Object_ptr theShapeObject)
{
Unexpect aCatch(SALOME_SalomeException);
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Evaluate" );
if ( CORBA::is_nil( theMesh ) )
THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM );
- SMESH::long_array_var nbels = new SMESH::long_array;
+ SMESH::smIdType_array_var nbels = new SMESH::smIdType_array;
nbels->length(SMESH::Entity_Last);
int i = SMESH::Entity_Node;
for (; i < SMESH::Entity_Last; i++)
/*CORBA::Boolean ret =*/ myGen.Evaluate( myLocMesh, myLocShape, aResMap);
MapShapeNbElemsItr anIt = aResMap.begin();
for(; anIt!=aResMap.end(); anIt++) {
- const vector<int>& aVec = (*anIt).second;
+ const vector<smIdType>& aVec = (*anIt).second;
for ( i = SMESH::Entity_Node; i < (int)aVec.size(); i++ ) {
- int nbElem = aVec[i];
+ smIdType nbElem = aVec[i];
if ( nbElem < 0 ) // algo failed, check that it has reported a message
{
SMESH_subMesh* sm = anIt->first;
GEOM::GEOM_Object_ptr
SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
- CORBA::Long theElementID,
+ SMESH::smIdType theElementID,
const char* theGeomName)
{
Unexpect aCatch(SALOME_SalomeException);
GEOM::GEOM_Object_ptr
SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
- CORBA::Long theElementID)
+ SMESH::smIdType theElementID)
{
Unexpect aCatch(SALOME_SalomeException);
if ( CORBA::is_nil( theMesh ) )
}
// remember nb of elements before filling in
- SMESH::long_array_var prevState = newMesh->GetNbElementsByType();
+ SMESH::smIdType_array_var prevState = newMesh->GetNbElementsByType();
// copy nodes
int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 2 : -1 ]; _assert[0]=_assert[1]=0;
}
- SMESH::long_array_var curState = newMesh->GetNbElementsByType();
+ SMESH::smIdType_array_var curState = newMesh->GetNbElementsByType();
for( groupType = SMESH::NODE;
groupType < SMESH::NB_ELEMENT_TYPES;
SMESH::SMESH_GroupBase_ptr group;
CORBA::String_var groupName;
- SMESH::long_array_var newIDs = new SMESH::long_array();
+ SMESH::smIdType_array_var newIDs = new SMESH::smIdType_array();
// loop on groups of a source mesh
SMESH::ListOfGroups_var listOfGroups = initImpl->GetGroups();
}
else
{
- SMESH::long_array_var ids = meshPart->GetIDs();
+ SMESH::smIdType_array_var ids = meshPart->GetIDs();
if ( srcElemTypes->length() == 1 && srcElemTypes[0] == SMESH::NODE ) // group of nodes
{
for ( CORBA::ULong i=0; i < ids->length(); i++ )
{
TE2EMap & e2eMap = e2eMapByType[ groupDS->GetType() ];
if ( e2eMap.empty() ) continue;
- int minID = e2eMap.begin()->first->GetID();
- int maxID = e2eMap.rbegin()->first->GetID();
+ smIdType minID = e2eMap.begin()->first->GetID();
+ smIdType maxID = e2eMap.rbegin()->first->GetID();
TE2EMap::iterator e2e;
while ( eIt->more() && groupElems.size() < e2eMap.size())
{
{
if ( newMeshDS->GetMeshInfo().NbElements( SMDSAbs_ElementType( elemType )) > 0 )
{
- SMESH::long_array_var elemIDs = stdlGroup->GetIDs();
+ SMESH::smIdType_array_var elemIDs = stdlGroup->GetIDs();
const bool isElem = ( elemType != SMESH::NODE );
CORBA::ULong iE = 0;
for ( ; iE < elemIDs->length(); ++iE ) // check if any element has been copied
// write reference on a shape if exists
SALOMEDS::SObject_wrap myRef;
bool shapeRefFound = false;
- bool found = gotBranch->FindSubObject( GetRefOnShapeTag(), myRef.inout() );
+ bool found = gotBranch->FindSubObject( (CORBA::Long)GetRefOnShapeTag(), myRef.inout() );
if ( found ) {
SALOMEDS::SObject_wrap myShape;
bool ok = myRef->ReferencedObject( myShape.inout() );
// write applied hypotheses if exist
SALOMEDS::SObject_wrap myHypBranch;
- found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
+ found = gotBranch->FindSubObject( (CORBA::Long)GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
if ( found && !shapeRefFound && hasShape ) { // remove applied hyps
aStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
}
{
SMDS_ElemIteratorPtr eIt =
mySMESHDSMesh->elementsIterator( isNode ? SMDSAbs_Node : SMDSAbs_All );
- int nbElems = isNode ? mySMESHDSMesh->NbNodes() : mySMESHDSMesh->GetMeshInfo().NbElements();
+ smIdType nbElems = isNode ? mySMESHDSMesh->NbNodes() : mySMESHDSMesh->GetMeshInfo().NbElements();
if ( nbElems < 1 )
continue;
std::vector<int> smIDs; smIDs.reserve( nbElems );
SMESHDS_SubMesh* aSubMesh = const_cast< SMESHDS_SubMesh* >( smIt->next() );
if ( aSubMesh->IsComplexSubmesh() )
continue; // submesh containing other submeshs
- int nbNodes = aSubMesh->NbNodes();
+ smIdType nbNodes = aSubMesh->NbNodes();
if ( nbNodes == 0 ) continue;
int aShapeID = aSubMesh->GetID();
if ( aSubMesh->_is_nil() )
continue;
string iorSubString = GetORB()->object_to_string( aSubMesh );
- int newSubId = myStudyContext->findId( iorSubString );
+ int newSubId = myStudyContext->findId( iorSubString );
myStudyContext->mapOldToNew( subid, newSubId );
}
}
*/
//================================================================================
-CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
+CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
{
if ( myStudyContext && !CORBA::is_nil( theObject )) {
string iorString = GetORB()->object_to_string( theObject );
SMESH::SMESH_Group_var gsource = SMESH::SMESH_Group::_narrow(meshPart);
if ( !gsource->_is_nil() ) {
if(theElemType == SMESH::NODE) {
- SMESH::long_array_var nodes = gsource->GetNodeIDs();
+ SMESH::smIdType_array_var nodes = gsource->GetNodeIDs();
for ( CORBA::ULong i = 0; i < nodes->length(); ++i ) {
if ( const SMDS_MeshNode* node = meshDS->FindNode( nodes[i] )) {
long anId = node->GetID();
}
}
} else if (gsource->GetType() == theElemType || theElemType == SMESH::ALL ) {
- SMESH::long_array_var elems = gsource->GetListOfID();
+ SMESH::smIdType_array_var elems = gsource->GetListOfID();
for ( CORBA::ULong i = 0; i < elems->length(); ++i ) {
if ( const SMDS_MeshElement* elem = meshDS->FindElement( elems[i] )) {
long anId = elem->GetID();
}
SMESH::SMESH_subMesh_var smsource = SMESH::SMESH_subMesh::_narrow(meshPart);
if ( !smsource->_is_nil() ) {
- SMESH::long_array_var elems = smsource->GetElementsByType( theElemType );
+ SMESH::smIdType_array_var elems = smsource->GetElementsByType( theElemType );
for ( CORBA::ULong i = 0; i < elems->length(); ++i ) {
const SMDS_MeshElement* elem = ( theElemType == SMESH::NODE ) ? meshDS->FindNode( elems[i] ) : meshDS->FindElement( elems[i] );
if (elem) {
#include <Utils_CorbaException.hxx>
#include <GEOM_Client.hxx>
+#include <smIdType.hxx>
#include <TCollection_AsciiString.hxx>
#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
* returns statistic of mesh elements
* Result array of number enityties
*/
- SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
+ SMESH::smIdType_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject);
// Returns true if mesh contains enough data to be computed
// Return geometrical object the given element is built on. Publish it in study.
GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
- CORBA::Long theElementID,
+ SMESH::smIdType theElementID,
const char* theGeomName);
// Return geometrical object the given element is built on. Don't publish it in study.
GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh,
- CORBA::Long theElementID);
+ SMESH::smIdType theElementID);
// Concatenate the given meshes into one mesh
SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray,
{
if ( isGroupOnFilter ) // GetTypes() can be very long on GroupOnFilter!
{
- SMESH::long_array_var nbByType = mesh_i->GetNbElementsByType();
+ SMESH::smIdType_array_var nbByType = mesh_i->GetNbElementsByType();
isEmpty = ( nbByType[ grp->GetType() ] == 0 );
}
else
*/
//=============================================================================
-CORBA::Long SMESH_GroupBase_i::Size()
+SMESH::smIdType SMESH_GroupBase_i::Size()
{
if ( myPreMeshInfo )
return GetType() == SMESH::NODE ? myPreMeshInfo->NbNodes() : myPreMeshInfo->NbElements();
*/
//=============================================================================
-CORBA::Boolean SMESH_GroupBase_i::Contains( CORBA::Long theID )
+CORBA::Boolean SMESH_GroupBase_i::Contains( SMESH::smIdType theID )
{
if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Long SMESH_Group_i::Add( const SMESH::long_array& theIDs )
+SMESH::smIdType SMESH_Group_i::Add( const SMESH::smIdType_array& theIDs )
{
if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Long SMESH_Group_i::Remove( const SMESH::long_array& theIDs )
+SMESH::smIdType SMESH_Group_i::Remove( const SMESH::smIdType_array& theIDs )
{
if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-typedef bool (SMESHDS_Group::*TFunChangeGroup)(const int);
+typedef bool (SMESHDS_Group::*TFunChangeGroup)(const smIdType);
CORBA::Long
ChangeByPredicate( SMESH::Predicate_i* thePredicate,
return aNb;
}
-CORBA::Long
+SMESH::smIdType
SMESH_Group_i::
AddByPredicate( SMESH::Predicate_ptr thePredicate )
{
return 0;
}
-CORBA::Long
+SMESH::smIdType
SMESH_Group_i::
RemoveByPredicate( SMESH::Predicate_ptr thePredicate )
{
return 0;
}
-CORBA::Long SMESH_Group_i::AddFrom( SMESH::SMESH_IDSource_ptr theSource )
+SMESH::smIdType SMESH_Group_i::AddFrom( SMESH::SMESH_IDSource_ptr theSource )
{
if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Long SMESH_GroupBase_i::GetID( CORBA::Long theIndex )
+SMESH::smIdType SMESH_GroupBase_i::GetID( SMESH::smIdType theIndex )
{
if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::long_array* SMESH_GroupBase_i::GetListOfID()
+SMESH::smIdType_array* SMESH_GroupBase_i::GetListOfID()
{
if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if (aGroupDS)
{
- int aSize = aGroupDS->Extent();
+ smIdType aSize = aGroupDS->Extent();
aRes->length(aSize);
SMDS_ElemIteratorPtr it = aGroupDS->GetElements();
- for (int i = 0; it->more(); i++)
+ for (smIdType i = 0; it->more(); i++)
aRes[i] = it->next()->GetID();
if ( 0 < aSize && aSize < 100 ) // for comfortable testing ;)
*/
//================================================================================
-CORBA::Long SMESH_GroupBase_i::GetNumberOfNodes()
+SMESH::smIdType SMESH_GroupBase_i::GetNumberOfNodes()
{
if ( GetType() == SMESH::NODE )
return Size();
*/
//================================================================================
-SMESH::long_array* SMESH_GroupBase_i::GetNodeIDs()
+SMESH::smIdType_array* SMESH_GroupBase_i::GetNodeIDs()
{
if ( GetType() == SMESH::NODE )
return GetListOfID();
if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
if ( SMESHDS_GroupBase* g = GetGroupDS())
{
std::set<const SMDS_MeshNode* > nodes;
*
*/
//=============================================================================
-CORBA::Long SMESH_GroupBase_i::GetColorNumber()
+CORBA::Long SMESH_GroupBase_i::GetColorNumber()
{
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if (aGroupDS)
*/
//=============================================================================
-SMESH::long_array* SMESH_GroupBase_i::GetMeshInfo()
+SMESH::smIdType_array* SMESH_GroupBase_i::GetMeshInfo()
{
if ( myPreMeshInfo )
return myPreMeshInfo->GetMeshInfo();
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::Entity_Last);
for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
aRes[i] = 0;
*/
//=============================================================================
-SMESH::long_array* SMESH_GroupBase_i::GetNbElementsByType()
+SMESH::smIdType_array* SMESH_GroupBase_i::GetNbElementsByType()
{
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::NB_ELEMENT_TYPES);
for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
aRes[ i ] = 0;
//purpose : Return ids of members
//=======================================================================
-SMESH::long_array* SMESH_GroupBase_i::GetIDs()
+SMESH::smIdType_array* SMESH_GroupBase_i::GetIDs()
{
return GetListOfID();
}
//purpose : Return ids of members
//=======================================================================
-SMESH::long_array* SMESH_GroupOnFilter_i::GetListOfID()
+SMESH::smIdType_array* SMESH_GroupOnFilter_i::GetListOfID()
{
if ( myPreMeshInfo )
myPreMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if ( SMESHDS_GroupOnFilter* grDS = dynamic_cast< SMESHDS_GroupOnFilter*>( GetGroupDS() ))
{
*/
//=============================================================================
-SMESH::long_array* SMESH_GroupOnFilter_i::GetMeshInfo()
+SMESH::smIdType_array* SMESH_GroupOnFilter_i::GetMeshInfo()
{
if ( myPreMeshInfo )
return myPreMeshInfo->GetMeshInfo();
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::Entity_Last);
for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
aRes[i] = 0;
if ( g->GetType() != SMDSAbs_Node )
{
- std::vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo();
+ std::vector< SMESH::smIdType > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo();
for ( size_t i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
if ( i < nbElems.size() )
aRes[i] = nbElems[ i ];
void SetName(const char* name);
char* GetName();
SMESH::ElementType GetType();
- CORBA::Long Size();
+ SMESH::smIdType Size();
CORBA::Boolean IsEmpty();
- CORBA::Boolean Contains(CORBA::Long elem_id);
- CORBA::Long GetID(CORBA::Long elem_index);
- SMESH::long_array* GetListOfID();
- SMESH::long_array* GetNodeIDs();
- CORBA::Long GetNumberOfNodes();
+ CORBA::Boolean Contains(SMESH::smIdType elem_id);
+ SMESH::smIdType GetID(SMESH::smIdType elem_index);
+ SMESH::smIdType_array* GetListOfID();
+ SMESH::smIdType_array* GetNodeIDs();
+ SMESH::smIdType GetNumberOfNodes();
CORBA::Boolean IsNodeInfoAvailable(); // for gui
virtual SMESH::SMESH_Mesh_ptr GetMesh();
* Result array of number of elements per \a EntityType
* Inherited from SMESH_IDSource
*/
- virtual SMESH::long_array* GetMeshInfo();
+ virtual SMESH::smIdType_array* GetMeshInfo();
/*!
* Returns number of mesh elements of each \a ElementType
*/
- virtual SMESH::long_array* GetNbElementsByType();
+ virtual SMESH::smIdType_array* GetNbElementsByType();
/*!
* Returns a sequence of all element IDs
*/
- virtual SMESH::long_array* GetIDs();
+ virtual SMESH::smIdType_array* GetIDs();
/*!
* Returns types of elements it contains
* Inherited from SMESH_IDSource interface
const int theLocalID );
// CORBA interface implementation
void Clear();
- CORBA::Long Add( const SMESH::long_array& theIDs );
- CORBA::Long Remove( const SMESH::long_array& theIDs );
+ SMESH::smIdType Add( const SMESH::smIdType_array& theIDs );
+ SMESH::smIdType Remove( const SMESH::smIdType_array& theIDs );
- CORBA::Long AddByPredicate( SMESH::Predicate_ptr thePredicate );
- CORBA::Long RemoveByPredicate( SMESH::Predicate_ptr thePredicate );
+ SMESH::smIdType AddByPredicate( SMESH::Predicate_ptr thePredicate );
+ SMESH::smIdType RemoveByPredicate( SMESH::Predicate_ptr thePredicate );
- CORBA::Long AddFrom( SMESH::SMESH_IDSource_ptr theSource );
+ SMESH::smIdType AddFrom( SMESH::SMESH_IDSource_ptr theSource );
};
// =========================
void SetFilter(SMESH::Filter_ptr theFilter);
SMESH::Filter_ptr GetFilter();
virtual CORBA::Boolean IsUpToDate();
- virtual SMESH::long_array* GetListOfID();
- virtual SMESH::long_array* GetMeshInfo();
+ virtual SMESH::smIdType_array* GetListOfID();
+ virtual SMESH::smIdType_array* GetMeshInfo();
//! @return false in two cases: 1) if mesh not loaded and GetMeshInfo() returns
//! incorrect information 2) mesh loaded but group contents is not computed.
virtual bool IsMeshInfoCorrect();
*/
//=============================================================================
-CORBA::Long SMESH_Hypothesis_i::GetId()
+CORBA::Short SMESH_Hypothesis_i::GetId()
{
return myBaseImpl->GetID();
}
void SetLibName( const char* theLibName );
// Get unique id of hypothesis
- virtual CORBA::Long GetId();
+ virtual CORBA::Short GetId();
// Return true if a hypothesis has parameters
virtual CORBA::Boolean HasParameters();
if ( aMesh ) {
theFunctor->SetMesh( aMesh );
- SMESH::long_array_var anElementsId = theSource->GetIDs();
+ SMESH::smIdType_array_var anElementsId = theSource->GetIDs();
for ( CORBA::ULong i = 0; i < anElementsId->length(); i++) {
value += theFunctor->GetValue( anElementsId[i] );
}
bool isNode1 = isNodeType(types1);
bool isNode2 = isOrigin || isNodeType(types2);
- SMESH::long_array_var aElementsId1 = theSource1->GetIDs();
- SMESH::long_array_var aElementsId2;
+ SMESH::smIdType_array_var aElementsId1 = theSource1->GetIDs();
+ SMESH::smIdType_array_var aElementsId2;
// compute distance between two entities
/* NOTE: currently only node-to-node case is implemented
else
{
SMESH::array_of_ElementType_var types = theObject->GetTypes();
- SMESH::long_array_var aElementsId = theObject->GetIDs();
+ SMESH::smIdType_array_var aElementsId = theObject->GetIDs();
// here we assume that type of all IDs defined by first type in array
const bool isNode = isNodeType( types );
for(int i = 0, n = aElementsId->length(); i < n; i++)
{
// copy element nodes
int anElemNbNodes = anElem->NbNodes();
- vector< int > anElemNodesID( anElemNbNodes ) ;
+ vector< smIdType > anElemNodesID( anElemNbNodes ) ;
SMDS_ElemIteratorPtr itElemNodes = anElem->nodesIterator();
- for ( int i = 0; itElemNodes->more(); i++)
+ for ( smIdType i = 0; itElemNodes->more(); i++)
{
const SMDS_MeshNode* anElemNode = cast2Node( itElemNodes->next() );
Copy( anElemNode );
*/
//================================================================================
- void arrayToSet(const SMESH::long_array & IDs,
- const SMESHDS_Mesh* aMesh,
- TIDSortedElemSet& aMap,
- const SMDSAbs_ElementType aType = SMDSAbs_All,
- SMDS_MeshElement::Filter* aFilter = NULL)
+ void arrayToSet(const SMESH::smIdType_array & IDs,
+ const SMESHDS_Mesh* aMesh,
+ TIDSortedElemSet& aMap,
+ const SMDSAbs_ElementType aType = SMDSAbs_All,
+ SMDS_MeshElement::Filter* aFilter = NULL)
{
SMDS_MeshElement::NonNullFilter filter1;
SMDS_MeshElement::TypeFilter filter2( aType );
SMDS_MeshElement::Filter & filter = *aFilter;
if ( aType == SMDSAbs_Node )
- for ( CORBA::ULong i = 0; i < IDs.length(); i++ ) {
+ for ( SMESH::smIdType i = 0; i < IDs.length(); i++ ) {
const SMDS_MeshElement * elem = aMesh->FindNode( IDs[i] );
if ( filter( elem ))
aMap.insert( aMap.end(), elem );
}
else
- for ( CORBA::ULong i = 0; i<IDs.length(); i++) {
+ for ( SMESH::smIdType i = 0; i<IDs.length(); i++) {
const SMDS_MeshElement * elem = aMesh->FindElement( IDs[i] );
if ( filter( elem ))
aMap.insert( aMap.end(), elem );
else
{
SMESH::array_of_ElementType_var types = theObject->GetTypes();
- SMESH::long_array_var aElementsId = theObject->GetIDs();
+ SMESH::smIdType_array_var aElementsId = theObject->GetIDs();
if ( types->length() == 1 && types[0] == SMESH::NODE)
{
for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ )
aMeshElem->nodeIterator() );
while ( itElemNodes->more() ) {
const SMDS_MeshNode* aMeshNode = itElemNodes->next();
- int aNodeID = aMeshNode->GetID();
+ smIdType aNodeID = aMeshNode->GetID();
TNodesMap::iterator anIter = nodesMap.find(aNodeID);
if ( anIter == nodesMap.end() ) {
// filling the nodes coordinates
*/
//================================================================================
-SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedNodes()
+SMESH::smIdType_array* SMESH_MeshEditor_i::GetLastCreatedNodes()
{
SMESH_TRY;
- SMESH::long_array_var myLastCreatedNodes = new SMESH::long_array();
+ SMESH::smIdType_array_var myLastCreatedNodes = new SMESH::smIdType_array();
const SMESH_SequenceOfElemPtr& aSeq = getEditor().GetLastCreatedNodes();
myLastCreatedNodes->length( aSeq.size() );
*/
//================================================================================
-SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedElems()
+SMESH::smIdType_array* SMESH_MeshEditor_i::GetLastCreatedElems()
{
SMESH_TRY;
- SMESH::long_array_var myLastCreatedElems = new SMESH::long_array();
+ SMESH::smIdType_array_var myLastCreatedElems = new SMESH::smIdType_array();
const SMESH_SequenceOfElemPtr& aSeq = getEditor().GetLastCreatedElems();
myLastCreatedElems->length( aSeq.size() );
struct SMESH_MeshEditor_i::_IDSource : public virtual POA_SMESH::SMESH_IDSource,
public virtual SALOME::GenericObj_i
{
- SMESH::long_array _ids;
- SMESH::ElementType _type;
- SMESH::SMESH_Mesh_ptr _mesh;
- SMESH::long_array* GetIDs() { return new SMESH::long_array( _ids ); }
- SMESH::long_array* GetMeshInfo() { return 0; }
- SMESH::long_array* GetNbElementsByType()
+ SMESH::smIdType_array _ids;
+ SMESH::ElementType _type;
+ SMESH::SMESH_Mesh_ptr _mesh;
+ SMESH::smIdType_array* GetIDs() { return new SMESH::smIdType_array( _ids ); }
+ SMESH::smIdType_array* GetMeshInfo() { return 0; }
+ SMESH::smIdType_array* GetNbElementsByType()
{
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::NB_ELEMENT_TYPES);
- for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
+ for (smIdType i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
aRes[ i ] = ( i == _type ) ? _ids.length() : 0;
return aRes._retn();
}
}
};
-SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids,
- SMESH::ElementType type)
+SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::smIdType_array& ids,
+ SMESH::ElementType type)
{
_IDSource* idSrc = new _IDSource;
idSrc->_mesh = myMesh_i->_this();
return SMESH::DownCast<SMESH_MeshEditor_i::_IDSource*>( idSource );
}
-CORBA::Long* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource,
- int& nbIds)
+SMESH::smIdType* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource,
+ SMESH::smIdType& nbIds)
{
if ( _IDSource* tmpIdSource = SMESH::DownCast<SMESH_MeshEditor_i::_IDSource*>( idSource ))
{
- nbIds = (int) tmpIdSource->_ids.length();
+ nbIds = (SMESH::smIdType) tmpIdSource->_ids.length();
return & tmpIdSource->_ids[0];
}
nbIds = 0;
//=============================================================================
CORBA::Boolean
-SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements)
+SMESH_MeshEditor_i::RemoveElements(const SMESH::smIdType_array & IDsOfElements)
{
SMESH_TRY;
initData();
- list< int > IdList;
+ list< smIdType > IdList;
- for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
+ for ( SMESH::smIdType i = 0; i < IDsOfElements.length(); i++ )
IdList.push_back( IDsOfElements[i] );
// Update Python script
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNodes)
+CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::smIdType_array & IDsOfNodes)
{
SMESH_TRY;
initData();
- list< int > IdList;
- for ( CORBA::ULong i = 0; i < IDsOfNodes.length(); i++)
+ list< smIdType > IdList;
+ for ( SMESH::smIdType i = 0; i < IDsOfNodes.length(); i++)
IdList.push_back( IDsOfNodes[i] );
// Update Python script
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes()
+SMESH::smIdType SMESH_MeshEditor_i::RemoveOrphanNodes()
{
SMESH_TRY;
initData();
SMESH::Controls::Filter::GetElementsId( getMeshDS(), predicate, seq );
// remove orphan nodes (if there are any)
- list< int > IdList( seq.begin(), seq.end() );
+ list< smIdType > IdList( seq.begin(), seq.end() );
- int nbNodesBefore = myMesh->NbNodes();
+ SMESH::smIdType nbNodesBefore = myMesh->NbNodes();
getEditor().Remove( IdList, true );
- int nbNodesAfter = myMesh->NbNodes();
+ SMESH::smIdType nbNodesAfter = myMesh->NbNodes();
declareMeshModified( /*isReComputeSafe=*/ IdList.size() == 0 ); // issue 0020693
return nbNodesBefore - nbNodesAfter;
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddNode(CORBA::Double x,CORBA::Double y, CORBA::Double z)
+SMESH::smIdType SMESH_MeshEditor_i::AddNode(CORBA::Double x,CORBA::Double y, CORBA::Double z)
{
SMESH_TRY;
initData();
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::Add0DElement(CORBA::Long IDOfNode,
- CORBA::Boolean DuplicateElements)
+SMESH::smIdType SMESH_MeshEditor_i::Add0DElement(SMESH::smIdType IDOfNode,
+ CORBA::Boolean DuplicateElements)
{
SMESH_TRY;
initData();
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddBall(CORBA::Long IDOfNode, CORBA::Double diameter)
+SMESH::smIdType SMESH_MeshEditor_i::AddBall(SMESH::smIdType IDOfNode, CORBA::Double diameter)
{
SMESH_TRY;
initData();
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes)
+SMESH::smIdType SMESH_MeshEditor_i::AddEdge(const SMESH::smIdType_array & IDsOfNodes)
{
SMESH_TRY;
initData();
- int NbNodes = IDsOfNodes.length();
+ SMESH::smIdType NbNodes = IDsOfNodes.length();
SMDS_MeshElement* elem = 0;
if (NbNodes == 2)
{
- CORBA::Long index1 = IDsOfNodes[0];
- CORBA::Long index2 = IDsOfNodes[1];
+ SMESH::smIdType index1 = IDsOfNodes[0];
+ SMESH::smIdType index2 = IDsOfNodes[1];
elem = getMeshDS()->AddEdge( getMeshDS()->FindNode(index1),
getMeshDS()->FindNode(index2));
<< index1 << ", " << index2 <<" ])";
}
if (NbNodes == 3) {
- CORBA::Long n1 = IDsOfNodes[0];
- CORBA::Long n2 = IDsOfNodes[1];
- CORBA::Long n12 = IDsOfNodes[2];
+ SMESH::smIdType n1 = IDsOfNodes[0];
+ SMESH::smIdType n2 = IDsOfNodes[1];
+ SMESH::smIdType n12 = IDsOfNodes[2];
elem = getMeshDS()->AddEdge( getMeshDS()->FindNode(n1),
getMeshDS()->FindNode(n2),
getMeshDS()->FindNode(n12));
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes)
+SMESH::smIdType SMESH_MeshEditor_i::AddFace(const SMESH::smIdType_array & IDsOfNodes)
{
SMESH_TRY;
initData();
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::long_array & IDsOfNodes)
+SMESH::smIdType SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::smIdType_array & IDsOfNodes)
{
SMESH_TRY;
initData();
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddQuadPolygonalFace (const SMESH::long_array & IDsOfNodes)
+SMESH::smIdType SMESH_MeshEditor_i::AddQuadPolygonalFace (const SMESH::smIdType_array & IDsOfNodes)
{
SMESH_TRY;
initData();
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes)
+SMESH::smIdType SMESH_MeshEditor_i::AddVolume(const SMESH::smIdType_array & IDsOfNodes)
{
SMESH_TRY;
initData();
* AddPolyhedralVolume
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::long_array & IDsOfNodes,
+SMESH::smIdType SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::smIdType_array & IDsOfNodes,
const SMESH::long_array & Quantities)
{
SMESH_TRY;
*/
//=============================================================================
-CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces (const SMESH::long_array & IdsOfFaces)
+SMESH::smIdType SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces (const SMESH::smIdType_array & IdsOfFaces)
{
SMESH_TRY;
initData();
if ( idSourceToSet( theObject, getMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1))
getEditor().Create0DElementsOnAllNodes( elements, elems0D, theDuplicateElements );
- SMESH::long_array_var newElems = new SMESH::long_array;
+ SMESH::smIdType_array_var newElems = new SMESH::smIdType_array;
newElems->length( elems0D.size() );
TIDSortedElemSet::iterator eIt = elems0D.begin();
for ( size_t i = 0; i < elems0D.size(); ++i, ++eIt )
*/
//=============================================================================
-void SMESH_MeshEditor_i::SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
+void SMESH_MeshEditor_i::SetNodeOnVertex(SMESH::smIdType NodeID, CORBA::Long VertexID)
{
SMESH_TRY;
*/
//=============================================================================
-void SMESH_MeshEditor_i::SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
+void SMESH_MeshEditor_i::SetNodeOnEdge(SMESH::smIdType NodeID, CORBA::Long EdgeID,
CORBA::Double paramOnEdge)
{
SMESH_TRY;
*/
//=============================================================================
-void SMESH_MeshEditor_i::SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
+void SMESH_MeshEditor_i::SetNodeOnFace(SMESH::smIdType NodeID, CORBA::Long FaceID,
CORBA::Double u, CORBA::Double v)
{
SMESH_TRY;
*/
//=============================================================================
-void SMESH_MeshEditor_i::SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
+void SMESH_MeshEditor_i::SetNodeInVolume(SMESH::smIdType NodeID, CORBA::Long SolidID)
{
SMESH_TRY;
SMESHDS_Mesh * mesh = getMeshDS();
*/
//=============================================================================
-void SMESH_MeshEditor_i::SetMeshElementOnShape(CORBA::Long ElementID,
+void SMESH_MeshEditor_i::SetMeshElementOnShape(SMESH::smIdType ElementID,
CORBA::Long ShapeID)
{
SMESH_TRY;
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(CORBA::Long NodeID1,
- CORBA::Long NodeID2)
+CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(SMESH::smIdType NodeID1,
+ SMESH::smIdType NodeID2)
{
SMESH_TRY;
initData();
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1,
- CORBA::Long NodeID2)
+CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(SMESH::smIdType NodeID1,
+ SMESH::smIdType NodeID2)
{
SMESH_TRY;
initData();
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfElements)
+CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::smIdType_array & IDsOfElements)
{
SMESH_TRY;
initData();
- for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
+ for ( SMESH::smIdType i = 0; i < IDsOfElements.length(); i++ )
{
- CORBA::Long index = IDsOfElements[i];
+ SMESH::smIdType index = IDsOfElements[i];
const SMDS_MeshElement * elem = getMeshDS()->FindElement(index);
if ( elem )
getEditor().Reorient( elem );
prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::smIdType_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = Reorient(anElementsId);
// Update Python script
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfElements,
+CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::smIdType_array & IDsOfElements,
SMESH::NumericalFunctor_ptr Criterion,
CORBA::Double MaxAngle)
{
TPythonDump aTPythonDump; // suppress dump in TriToQuad()
prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::smIdType_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = TriToQuad(anElementsId, Criterion, MaxAngle);
if ( !myIsPreviewMode ) {
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::long_array & IDsOfElements,
+CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::smIdType_array & IDsOfElements,
SMESH::NumericalFunctor_ptr Criterion)
{
SMESH_TRY;
TPythonDump aTPythonDump; // suppress dump in QuadToTri()
prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::smIdType_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = QuadToTri(anElementsId, Criterion);
SMESH::NumericalFunctor_i* aNumericalFunctor =
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::long_array & IDsOfElements,
+CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::smIdType_array & IDsOfElements,
CORBA::Boolean Diag13)
{
SMESH_TRY;
TPythonDump aTPythonDump; // suppress dump in SplitQuad()
prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::smIdType_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = SplitQuad(anElementsId, Diag13);
// Update Python script
facetToSplitNormal.PS.z ));
TIDSortedElemSet elemSet;
prepareIdSource( elems );
- SMESH::long_array_var anElementsId = elems->GetIDs();
+ SMESH::smIdType_array_var anElementsId = elems->GetIDs();
SMDS_MeshElement::GeomFilter filter( SMDSGeom_HEXA );
arrayToSet( anElementsId, getMeshDS(), elemSet, SMDSAbs_Volume, &filter );
//=======================================================================
CORBA::Boolean
-SMESH_MeshEditor_i::Smooth(const SMESH::long_array & IDsOfElements,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+SMESH_MeshEditor_i::Smooth(const SMESH::smIdType_array & IDsOfElements,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method)
{
//=======================================================================
CORBA::Boolean
-SMESH_MeshEditor_i::SmoothParametric(const SMESH::long_array & IDsOfElements,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+SMESH_MeshEditor_i::SmoothParametric(const SMESH::smIdType_array & IDsOfElements,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method)
{
CORBA::Boolean
SMESH_MeshEditor_i::SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method)
{
CORBA::Boolean
SMESH_MeshEditor_i::SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method)
{
//=============================================================================
CORBA::Boolean
-SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+SMESH_MeshEditor_i::smooth(const SMESH::smIdType_array & IDsOfElements,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method,
bool IsParametric)
arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face);
set<const SMDS_MeshNode*> fixedNodes;
- for ( CORBA::ULong i = 0; i < IDsOfFixedNodes.length(); i++) {
- CORBA::Long index = IDsOfFixedNodes[i];
+ for ( SMESH::smIdType i = 0; i < IDsOfFixedNodes.length(); i++) {
+ SMESH::smIdType index = IDsOfFixedNodes[i];
const SMDS_MeshNode * node = aMesh->FindNode(index);
if ( node )
fixedNodes.insert( node );
CORBA::Boolean
SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObject,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method,
bool IsParametric)
TPythonDump aTPythonDump; // suppress dump in smooth()
prepareIdSource( theObject );
- SMESH::long_array_var anElementsId = theObject->GetIDs();
+ SMESH::smIdType_array_var anElementsId = theObject->GetIDs();
CORBA::Boolean isDone = smooth (anElementsId, IDsOfFixedNodes, MaxNbOfIterations,
MaxAspectRatio, Method, IsParametric);
//=======================================================================
SMESH::ListOfGroups*
-SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
- const SMESH::DirStruct & theStepVector,
- CORBA::Long theNbOfSteps,
- CORBA::Long theExtrFlags,
- CORBA::Double theSewTolerance,
- CORBA::Boolean theMakeGroups)
+SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::smIdType_array & theIDsOfElements,
+ const SMESH::DirStruct & theStepVector,
+ CORBA::Long theNbOfSteps,
+ CORBA::Long theExtrFlags,
+ CORBA::Double theSewTolerance,
+ CORBA::Boolean theMakeGroups)
{
SMESH_TRY;
initData();
const SMESH::ListOfIDSources & theFaces,
SMESH::SMESH_IDSource_ptr thePathObject,
GEOM::GEOM_Object_ptr thePathShape,
- CORBA::Long theNodeStart,
+ SMESH::smIdType theNodeStart,
CORBA::Boolean theHasAngles,
const SMESH::double_array & theAngles,
CORBA::Boolean theAnglesVariation,
SMESH_subMesh* aSubMesh = aMeshImp->GetImpl().GetSubMesh( aShape );
if ( !aSubMesh || !aSubMesh->GetSubMeshDS())
return aResult._retn();
- int nbSteps = aSubMesh->GetSubMeshDS()->NbElements();
+ smIdType nbSteps = aSubMesh->GetSubMeshDS()->NbElements();
if ( nbSteps == nbAngles )
{
aResult.inout() = theAngles;
//purpose :
//=======================================================================
-void SMESH_MeshEditor_i::Mirror(const SMESH::long_array & theIDsOfElements,
+void SMESH_MeshEditor_i::Mirror(const SMESH::smIdType_array & theIDsOfElements,
const SMESH::AxisStruct & theAxis,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
CORBA::Boolean theCopy)
//=======================================================================
SMESH::ListOfGroups*
-SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::long_array& theIDsOfElements,
+SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::smIdType_array& theIDsOfElements,
const SMESH::AxisStruct& theMirror,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType)
{
//=======================================================================
SMESH::SMESH_Mesh_ptr
-SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array& theIDsOfElements,
+SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::smIdType_array& theIDsOfElements,
const SMESH::AxisStruct& theMirror,
SMESH::SMESH_MeshEditor::MirrorType theMirrorType,
CORBA::Boolean theCopyGroups,
//purpose :
//=======================================================================
-void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements,
- const SMESH::DirStruct & theVector,
- CORBA::Boolean theCopy)
+void SMESH_MeshEditor_i::Translate(const SMESH::smIdType_array & theIDsOfElements,
+ const SMESH::DirStruct & theVector,
+ CORBA::Boolean theCopy)
{
if (!myIsPreviewMode) {
TPythonDump() << this << ".Translate( "
//=======================================================================
SMESH::ListOfGroups*
-SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElements,
- const SMESH::DirStruct& theVector)
+SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::smIdType_array& theIDsOfElements,
+ const SMESH::DirStruct& theVector)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
//=======================================================================
SMESH::SMESH_Mesh_ptr
-SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::long_array& theIDsOfElements,
- const SMESH::DirStruct& theVector,
- CORBA::Boolean theCopyGroups,
- const char* theMeshName)
+SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::smIdType_array& theIDsOfElements,
+ const SMESH::DirStruct& theVector,
+ CORBA::Boolean theCopyGroups,
+ const char* theMeshName)
{
SMESH_Mesh_i* mesh_i;
SMESH::SMESH_Mesh_var mesh;
//purpose :
//=======================================================================
-void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements,
- const SMESH::AxisStruct & theAxis,
- CORBA::Double theAngle,
- CORBA::Boolean theCopy)
+void SMESH_MeshEditor_i::Rotate(const SMESH::smIdType_array & theIDsOfElements,
+ const SMESH::AxisStruct & theAxis,
+ CORBA::Double theAngle,
+ CORBA::Boolean theCopy)
{
if (!myIsPreviewMode) {
TPythonDump() << this << ".Rotate( "
//=======================================================================
SMESH::ListOfGroups*
-SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::long_array& theIDsOfElements,
- const SMESH::AxisStruct& theAxis,
- CORBA::Double theAngle)
+SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::smIdType_array& theIDsOfElements,
+ const SMESH::AxisStruct& theAxis,
+ CORBA::Double theAngle)
{
TPythonDump aPythonDump; // it is here to prevent dump of GetGroups()
//=======================================================================
SMESH::SMESH_Mesh_ptr
-SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements,
- const SMESH::AxisStruct& theAxis,
- CORBA::Double theAngleInRadians,
- CORBA::Boolean theCopyGroups,
- const char* theMeshName)
+SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::smIdType_array& theIDsOfElements,
+ const SMESH::AxisStruct& theAxis,
+ CORBA::Double theAngleInRadians,
+ CORBA::Boolean theCopyGroups,
+ const char* theMeshName)
{
SMESH_TRY;
SMESH::SMESH_Mesh_var mesh;
for (CORBA::Long j = 0; arraysIt != aListOfListOfElementsID.end(); ++arraysIt, ++j)
{
SMESH::long_array& aGroup = (*theGroupsOfElementsID)[ j ];
- list<int>& listOfIDs = *arraysIt;
+ list<smIdType>& listOfIDs = *arraysIt;
aGroup.length( listOfIDs.size() );
- list<int>::iterator idIt = listOfIDs.begin();
- for (int k = 0; idIt != listOfIDs.end(); ++idIt, ++k )
+ list<smIdType>::iterator idIt = listOfIDs.begin();
+ for (smIdType k = 0; idIt != listOfIDs.end(); ++idIt, ++k )
aGroup[ k ] = *idIt;
}
SMESH::array_of_ElementType_var elemTypes = theElementsToKeep[i]->GetTypes();
if ( elemTypes->length() == 1 && elemTypes[0] == SMESH::NODE )
continue;
- SMESH::long_array_var elementsId = theElementsToKeep[i]->GetIDs();
- for ( CORBA::ULong j = 0; j < elementsId->length(); ++j )
+ SMESH::smIdType_array_var elementsId = theElementsToKeep[i]->GetIDs();
+ for ( SMESH::smIdType j = 0; j < elementsId->length(); ++j )
idsToKeep.Add( elementsId[ j ]);
}
for ( CORBA::ULong i = 0; i < theGroupsOfElementsID.length(); i++ )
{
const SMESH::long_array& anElemsIDGroup = theGroupsOfElementsID[ i ];
- aListOfListOfElementsID.push_back( list< int >() );
- list< int >& aListOfElemsID = aListOfListOfElementsID.back();
- for ( CORBA::ULong j = 0; j < anElemsIDGroup.length(); j++ )
+ aListOfListOfElementsID.push_back( list< smIdType >() );
+ list< smIdType >& aListOfElemsID = aListOfListOfElementsID.back();
+ for ( SMESH::smIdType j = 0; j < anElemsIDGroup.length(); j++ )
{
- CORBA::Long id = anElemsIDGroup[ j ];
+ SMESH::smIdType id = anElemsIDGroup[ j ];
if ( idsToKeep.Contains( id )) aListOfElemsID.push_front( id );
else aListOfElemsID.push_back( id );
}
*/
//=============================================================================
-CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long NodeID,
- CORBA::Double x,
- CORBA::Double y,
- CORBA::Double z)
+CORBA::Boolean SMESH_MeshEditor_i::MoveNode(SMESH::smIdType NodeID,
+ CORBA::Double x,
+ CORBA::Double y,
+ CORBA::Double z)
{
SMESH_TRY;
initData(/*deleteSearchers=*/false);
*/
//================================================================================
-CORBA::Long SMESH_MeshEditor_i::FindNodeClosestTo(CORBA::Double x,
+SMESH::smIdType SMESH_MeshEditor_i::FindNodeClosestTo(CORBA::Double x,
CORBA::Double y,
CORBA::Double z)
{
*/
//================================================================================
-CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x,
- CORBA::Double y,
- CORBA::Double z,
- CORBA::Long theNodeID)
+SMESH::smIdType SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x,
+ CORBA::Double y,
+ CORBA::Double z,
+ SMESH::smIdType theNodeID)
{
SMESH_TRY;
// We keep theNodeSearcher until any mesh modification:
theSearchersDeleter.Set( myMesh ); // remove theNodeSearcher if mesh is other
- int nodeID = theNodeID;
+ smIdType nodeID = theNodeID;
const SMDS_MeshNode* node = getMeshDS()->FindNode( nodeID );
if ( !node ) // preview moving node
{
*/
//=======================================================================
-SMESH::long_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double x,
+SMESH::smIdType_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double x,
CORBA::Double y,
CORBA::Double z,
SMESH::ElementType type)
{
SMESH_TRY;
- SMESH::long_array_var res = new SMESH::long_array;
+ SMESH::smIdType_array_var res = new SMESH::smIdType_array;
vector< const SMDS_MeshElement* > foundElems;
theSearchersDeleter.Set( myMesh );
// 'ALL' type means elements of any type excluding nodes
//=======================================================================
-SMESH::long_array*
+SMESH::smIdType_array*
SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementIDs,
CORBA::Double x,
CORBA::Double y,
SMESH::ElementType type)
{
SMESH_TRY;
- SMESH::long_array_var res = new SMESH::long_array;
+ SMESH::smIdType_array_var res = new SMESH::smIdType_array;
prepareIdSource( elementIDs );
if ( type != SMESH::NODE )
// In the case if nothing found, return -1 and []
//=======================================================================
-CORBA::Long SMESH_MeshEditor_i::ProjectPoint(CORBA::Double x,
+SMESH::smIdType SMESH_MeshEditor_i::ProjectPoint(CORBA::Double x,
CORBA::Double y,
CORBA::Double z,
SMESH::ElementType type,
SMESH::array_of_long_array*
SMESH_MeshEditor_i::Get1DBranches( SMESH::SMESH_IDSource_ptr theEdges,
- CORBA::Long theStartNode,
+ SMESH::smIdType theStartNode,
SMESH::array_of_long_array_out theNodeGroups )
{
if ( CORBA::is_nil( theEdges ))
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
-SMESH_MeshEditor_i::SewFreeBorders(CORBA::Long FirstNodeID1,
- CORBA::Long SecondNodeID1,
- CORBA::Long LastNodeID1,
- CORBA::Long FirstNodeID2,
- CORBA::Long SecondNodeID2,
- CORBA::Long LastNodeID2,
- CORBA::Boolean CreatePolygons,
- CORBA::Boolean CreatePolyedrs)
+SMESH_MeshEditor_i::SewFreeBorders(SMESH::smIdType FirstNodeID1,
+ SMESH::smIdType SecondNodeID1,
+ SMESH::smIdType LastNodeID1,
+ SMESH::smIdType FirstNodeID2,
+ SMESH::smIdType SecondNodeID2,
+ SMESH::smIdType LastNodeID2,
+ CORBA::Boolean CreatePolygons,
+ CORBA::Boolean CreatePolyedrs)
{
SMESH_TRY;
initData();
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
-SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1,
- CORBA::Long SecondNodeID1,
- CORBA::Long LastNodeID1,
- CORBA::Long FirstNodeID2,
- CORBA::Long SecondNodeID2)
+SMESH_MeshEditor_i::SewConformFreeBorders(SMESH::smIdType FirstNodeID1,
+ SMESH::smIdType SecondNodeID1,
+ SMESH::smIdType LastNodeID1,
+ SMESH::smIdType FirstNodeID2,
+ SMESH::smIdType SecondNodeID2)
{
SMESH_TRY;
initData();
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
-SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
- CORBA::Long SecondNodeIDOnFreeBorder,
- CORBA::Long LastNodeIDOnFreeBorder,
- CORBA::Long FirstNodeIDOnSide,
- CORBA::Long LastNodeIDOnSide,
- CORBA::Boolean CreatePolygons,
- CORBA::Boolean CreatePolyedrs)
+SMESH_MeshEditor_i::SewBorderToSide(SMESH::smIdType FirstNodeIDOnFreeBorder,
+ SMESH::smIdType SecondNodeIDOnFreeBorder,
+ SMESH::smIdType LastNodeIDOnFreeBorder,
+ SMESH::smIdType FirstNodeIDOnSide,
+ SMESH::smIdType LastNodeIDOnSide,
+ CORBA::Boolean CreatePolygons,
+ CORBA::Boolean CreatePolyedrs)
{
SMESH_TRY;
initData();
//=======================================================================
SMESH::SMESH_MeshEditor::Sew_Error
-SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
- const SMESH::long_array& IDsOfSide2Elements,
- CORBA::Long NodeID1OfSide1ToMerge,
- CORBA::Long NodeID1OfSide2ToMerge,
- CORBA::Long NodeID2OfSide1ToMerge,
- CORBA::Long NodeID2OfSide2ToMerge)
+SMESH_MeshEditor_i::SewSideElements(const SMESH::smIdType_array& IDsOfSide1Elements,
+ const SMESH::smIdType_array& IDsOfSide2Elements,
+ SMESH::smIdType NodeID1OfSide1ToMerge,
+ SMESH::smIdType NodeID1OfSide2ToMerge,
+ SMESH::smIdType NodeID2OfSide1ToMerge,
+ SMESH::smIdType NodeID2OfSide2ToMerge)
{
SMESH_TRY;
initData();
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide,
- const SMESH::long_array& newIDs)
+CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(SMESH::smIdType ide,
+ const SMESH::smIdType_array& newIDs)
{
SMESH_TRY;
initData();
}
}
prepareIdSource( theIDSource );
- SMESH::long_array_var anIDs = theIDSource->GetIDs();
+ SMESH::smIdType_array_var anIDs = theIDSource->GetIDs();
if ( anIDs->length() == 0 )
{
if ( error ) *error = IDSource_EMPTY;
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNodes,
- const SMESH::long_array& theModifiedElems )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::smIdType_array& theNodes,
+ const SMESH::smIdType_array& theModifiedElems )
{
SMESH_TRY;
initData();
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( CORBA::Long theNodeId,
- const SMESH::long_array& theModifiedElems )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( SMESH::smIdType theNodeId,
+ const SMESH::smIdType_array& theModifiedElems )
{
SMESH_TRY;
- SMESH::long_array_var aNodes = new SMESH::long_array;
+ SMESH::smIdType_array_var aNodes = new SMESH::smIdType_array;
aNodes->length( 1 );
aNodes[ 0 ] = theNodeId;
if ( CORBA::is_nil( theNodes ) && theNodes->GetType() != SMESH::NODE )
return false;
- SMESH::long_array_var aNodes = theNodes->GetListOfID();
- SMESH::long_array_var aModifiedElems;
+ SMESH::smIdType_array_var aNodes = theNodes->GetListOfID();
+ SMESH::smIdType_array_var aModifiedElems;
if ( !CORBA::is_nil( theModifiedElems ) )
aModifiedElems = theModifiedElems->GetListOfID();
else
- aModifiedElems = new SMESH::long_array;
+ aModifiedElems = new SMESH::smIdType_array;
TPythonDump pyDump; // suppress dump by the next line
return aNewGroup._retn();
// Duplicate nodes
- SMESH::long_array_var aNodes = theNodes->GetListOfID();
- SMESH::long_array_var aModifiedElems;
+ SMESH::smIdType_array_var aNodes = theNodes->GetListOfID();
+ SMESH::smIdType_array_var aModifiedElems;
if ( !CORBA::is_nil( theModifiedElems ) )
aModifiedElems = theModifiedElems->GetListOfID();
else {
- aModifiedElems = new SMESH::long_array;
+ aModifiedElems = new SMESH::smIdType_array;
aModifiedElems->length( 0 );
}
if ( aResult )
{
// Create group with newly created nodes
- SMESH::long_array_var anIds = GetLastCreatedNodes();
+ SMESH::smIdType_array_var anIds = GetLastCreatedNodes();
if (anIds->length() > 0) {
std::string anUnindexedName (theNodes->GetName());
std::string aNewName = GenerateGroupName(anUnindexedName + "_double");
initData();
std::list< int > aNodes;
- int i, n, j, m;
+ smIdType i, n, j, m;
for ( i = 0, n = theNodes.length(); i < n; i++ )
{
SMESH::SMESH_GroupBase_var aGrp = theNodes[ i ];
if ( !CORBA::is_nil( aGrp ) && aGrp->GetType() == SMESH::NODE )
{
- SMESH::long_array_var aCurr = aGrp->GetListOfID();
+ SMESH::smIdType_array_var aCurr = aGrp->GetListOfID();
for ( j = 0, m = aCurr->length(); j < m; j++ )
aNodes.push_back( aCurr[ j ] );
}
SMESH::SMESH_GroupBase_var aGrp = theModifiedElems[ i ];
if ( !CORBA::is_nil( aGrp ) && aGrp->GetType() != SMESH::NODE )
{
- SMESH::long_array_var aCurr = aGrp->GetListOfID();
+ SMESH::smIdType_array_var aCurr = aGrp->GetListOfID();
for ( j = 0, m = aCurr->length(); j < m; j++ )
anElems.push_back( aCurr[ j ] );
}
if ( aResult )
{
// Create group with newly created nodes
- SMESH::long_array_var anIds = GetLastCreatedNodes();
+ SMESH::smIdType_array_var anIds = GetLastCreatedNodes();
if (anIds->length() > 0) {
std::string anUnindexedName (theNodes[0]->GetName());
std::string aNewName = GenerateGroupName(anUnindexedName + "_double");
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theElems,
- const SMESH::long_array& theNodesNot,
- const SMESH::long_array& theAffectedElems )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::smIdType_array& theElems,
+ const SMESH::smIdType_array& theNodesNot,
+ const SMESH::smIdType_array& theAffectedElems )
{
SMESH_TRY;
initData();
*/
//================================================================================
-CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::long_array& theElems,
- const SMESH::long_array& theNodesNot,
- GEOM::GEOM_Object_ptr theShape )
+CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::smIdType_array& theElems,
+ const SMESH::smIdType_array& theNodesNot,
+ GEOM::GEOM_Object_ptr theShape )
{
SMESH_TRY;
initData();
std::string aNewName = GenerateGroupName( std::string(elemGroupName.in()) + "_double");
if ( !getEditor().GetLastCreatedElems().empty() && theElemGroupNeeded )
{
- SMESH::long_array_var anIds = GetLastCreatedElems();
+ SMESH::smIdType_array_var anIds = GetLastCreatedElems();
SMESH::ElementType aGroupType = myMesh_i->GetElementType(anIds[0], true);
aNewElemGroup = myMesh_i->CreateGroup(aGroupType, aNewName.c_str());
aNewElemGroup->Add(anIds);
}
if ( !getEditor().GetLastCreatedNodes().empty() && theNodeGroupNeeded )
{
- SMESH::long_array_var anIds = GetLastCreatedNodes();
+ SMESH::smIdType_array_var anIds = GetLastCreatedNodes();
aNewNodeGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str());
aNewNodeGroup->Add(anIds);
}
if ( !CORBA::is_nil( aGrp ) && (theIsNodeGrp ? aGrp->GetType() == SMESH::NODE
: aGrp->GetType() != SMESH::NODE ) )
{
- SMESH::long_array_var anIDs = aGrp->GetIDs();
+ SMESH::smIdType_array_var anIDs = aGrp->GetIDs();
arrayToSet( anIDs, theMeshDS, theElemSet, theIsNodeGrp ? SMDSAbs_Node : SMDSAbs_All );
}
}
std::string aNewName = GenerateGroupName( std::string(elemGroupName.in()) + "_double");
if ( !getEditor().GetLastCreatedElems().empty() && theElemGroupNeeded )
{
- SMESH::long_array_var anIds = GetLastCreatedElems();
+ SMESH::smIdType_array_var anIds = GetLastCreatedElems();
SMESH::ElementType aGroupType = myMesh_i->GetElementType(anIds[0], true);
aNewElemGroup = myMesh_i->CreateGroup(aGroupType, aNewName.c_str());
aNewElemGroup->Add(anIds);
}
if ( !getEditor().GetLastCreatedNodes().empty() && theNodeGroupNeeded )
{
- SMESH::long_array_var anIds = GetLastCreatedNodes();
+ SMESH::smIdType_array_var anIds = GetLastCreatedNodes();
aNewNodeGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str());
aNewNodeGroup->Add(anIds);
}
TPythonDump pyDump;
if ( aResult && anAffected.size() > 0 )
{
- SMESH::long_array_var volumeIds = new SMESH::long_array;
- SMESH::long_array_var faceIds = new SMESH::long_array;
- SMESH::long_array_var edgeIds = new SMESH::long_array;
+ SMESH::smIdType_array_var volumeIds = new SMESH::smIdType_array;
+ SMESH::smIdType_array_var faceIds = new SMESH::smIdType_array;
+ SMESH::smIdType_array_var edgeIds = new SMESH::smIdType_array;
volumeIds->length( anAffected.size() );
faceIds ->length( anAffected.size() );
edgeIds ->length( anAffected.size() );
for (; eIt != anAffected.end(); ++eIt)
{
const SMDS_MeshElement* anElem = *eIt;
- int elemId = anElem->GetID();
+ smIdType elemId = anElem->GetID();
switch ( anElem->GetType() ) {
case SMDSAbs_Volume: volumeIds[ivol++] = elemId; break;
case SMDSAbs_Face: faceIds[iface++] = elemId; break;
{
// if ( aGrp->GetType() != SMESH::VOLUME )
// THROW_SALOME_CORBA_EXCEPTION("Not a volume group", SALOME::BAD_PARAM);
- SMESH::long_array_var anIDs = aGrp->GetIDs();
+ SMESH::smIdType_array_var anIDs = aGrp->GetIDs();
arrayToSet( anIDs, aMeshDS, domains[ i ], SMDSAbs_All );
}
}
TIDSortedElemSet faceGroup;
faceGroup.clear();
faceGroups.push_back(faceGroup);
- SMESH::long_array_var anIDs = aGrp->GetIDs();
+ SMESH::smIdType_array_var anIDs = aGrp->GetIDs();
arrayToSet( anIDs, aMeshDS, faceGroups[ i ], SMDSAbs_All );
}
}
* created this method returns list of their IDs, if new nodes
* not created - returns an empty list
*/
- SMESH::long_array* GetLastCreatedNodes();
+ SMESH::smIdType_array* GetLastCreatedNodes();
/*!
* If during last operation of MeshEditor some elements were
* created this method returns list of their IDs, if new elements
* not created - returns an empty list
*/
- SMESH::long_array* GetLastCreatedElems();
+ SMESH::smIdType_array* GetLastCreatedElems();
/*!
* \brief Clears sequences of last created elements and nodes
*/
/*!
* \brief Wrap a sequence of ids in a SMESH_IDSource
*/
- SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements,
- SMESH::ElementType type);
+ SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::smIdType_array& IDsOfElements,
+ SMESH::ElementType type);
static bool IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSource );
- static CORBA::Long* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, int& nbIds );
+ static SMESH::smIdType* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, smIdType& nbIds );
/*!
* \brief Generates the unique group name
*/
std::string GenerateGroupName(const std::string& thePrefix);
- CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
- CORBA::Boolean RemoveNodes (const SMESH::long_array & IDsOfNodes);
- CORBA::Long RemoveOrphanNodes();
+ CORBA::Boolean RemoveElements(const SMESH::smIdType_array & IDsOfElements);
+ CORBA::Boolean RemoveNodes (const SMESH::smIdType_array & IDsOfNodes);
+ SMESH::smIdType RemoveOrphanNodes();
/*!
* Methods for creation new elements.
* Returns ID of created element or 0 if element not created
*/
- CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
- CORBA::Long Add0DElement(CORBA::Long IDOfNode, CORBA::Boolean DuplicateElements);
- CORBA::Long AddBall(CORBA::Long IDOfNodem, CORBA::Double diameter);
- CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
- CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
- CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
- CORBA::Long AddQuadPolygonalFace(const SMESH::long_array & IDsOfNodes);
- CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
- CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
+ SMESH::smIdType AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
+ SMESH::smIdType Add0DElement(SMESH::smIdType IDOfNode, CORBA::Boolean DuplicateElements);
+ SMESH::smIdType AddBall(SMESH::smIdType IDOfNodem, CORBA::Double diameter);
+ SMESH::smIdType AddEdge(const SMESH::smIdType_array & IDsOfNodes);
+ SMESH::smIdType AddFace(const SMESH::smIdType_array & IDsOfNodes);
+ SMESH::smIdType AddPolygonalFace(const SMESH::smIdType_array & IDsOfNodes);
+ SMESH::smIdType AddQuadPolygonalFace(const SMESH::smIdType_array & IDsOfNodes);
+ SMESH::smIdType AddVolume(const SMESH::smIdType_array & IDsOfNodes);
+ SMESH::smIdType AddPolyhedralVolume(const SMESH::smIdType_array & IDsOfNodes,
const SMESH::long_array & Quantities);
- CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
+ SMESH::smIdType AddPolyhedralVolumeByFaces(const SMESH::smIdType_array & IdsOfFaces);
/*!
* \brief Create 0D elements on all nodes of the given object except those
* \param NodeID - node ID
* \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
*/
- void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID);
+ void SetNodeOnVertex(SMESH::smIdType NodeID, CORBA::Long VertexID);
/*!
* \brief Store node position on an edge
* \param NodeID - node ID
* \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0]
* \param paramOnEdge - parameter on edge where the node is located
*/
- void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
+ void SetNodeOnEdge(SMESH::smIdType NodeID, CORBA::Long EdgeID,
CORBA::Double paramOnEdge);
/*!
* \brief Store node position on a face
* \param u - U parameter on face where the node is located
* \param v - V parameter on face where the node is located
*/
- void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
+ void SetNodeOnFace(SMESH::smIdType NodeID, CORBA::Long FaceID,
CORBA::Double u, CORBA::Double v);
/*!
* \brief Bind a node to a solid
* \param NodeID - node ID
* \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0]
*/
- void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID);
+ void SetNodeInVolume(SMESH::smIdType NodeID, CORBA::Long SolidID);
/*!
* \brief Bind an element to a shape
* \param ElementID - element ID
* \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0]
*/
- void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID);
+ void SetMeshElementOnShape(SMESH::smIdType ElementID, CORBA::Long ShapeID);
- CORBA::Boolean MoveNode(CORBA::Long NodeID,
+ CORBA::Boolean MoveNode(SMESH::smIdType NodeID,
CORBA::Double x, CORBA::Double y, CORBA::Double z);
- CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
- CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
- CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
+ CORBA::Boolean InverseDiag(SMESH::smIdType NodeID1, SMESH::smIdType NodeID2);
+ CORBA::Boolean DeleteDiag(SMESH::smIdType NodeID1, SMESH::smIdType NodeID2);
+ CORBA::Boolean Reorient(const SMESH::smIdType_array & IDsOfElements);
CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
/*!
CORBA::Boolean outsideNormal);
// Split/Join
- CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements,
- SMESH::NumericalFunctor_ptr Criterion,
- CORBA::Double MaxAngle);
- CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
- SMESH::NumericalFunctor_ptr Criterion,
- CORBA::Double MaxAngle);
- CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements,
- SMESH::NumericalFunctor_ptr Criterion);
- CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
- SMESH::NumericalFunctor_ptr Criterion);
- void QuadTo4Tri (SMESH::SMESH_IDSource_ptr theObject);
- CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements,
- CORBA::Boolean Diag13);
- CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
- CORBA::Boolean Diag13);
- CORBA::Long BestSplit (CORBA::Long IDOfQuad,
- SMESH::NumericalFunctor_ptr Criterion);
+ CORBA::Boolean TriToQuad (const SMESH::smIdType_array & IDsOfElements,
+ SMESH::NumericalFunctor_ptr Criterion,
+ CORBA::Double MaxAngle);
+ CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject,
+ SMESH::NumericalFunctor_ptr Criterion,
+ CORBA::Double MaxAngle);
+ CORBA::Boolean QuadToTri (const SMESH::smIdType_array & IDsOfElements,
+ SMESH::NumericalFunctor_ptr Criterion);
+ CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject,
+ SMESH::NumericalFunctor_ptr Criterion);
+ void QuadTo4Tri (SMESH::SMESH_IDSource_ptr theObject);
+ CORBA::Boolean SplitQuad (const SMESH::smIdType_array & IDsOfElements,
+ CORBA::Boolean Diag13);
+ CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject,
+ CORBA::Boolean Diag13);
+ CORBA::Long BestSplit (CORBA::Long IDOfQuad,
+ SMESH::NumericalFunctor_ptr Criterion);
void SplitVolumesIntoTetra(SMESH::SMESH_IDSource_ptr elems,
CORBA::Short methodFlags);
void SplitHexahedraIntoPrisms(SMESH::SMESH_IDSource_ptr elems,
CORBA::Boolean allDomains);
void SplitBiQuadraticIntoLinear(const SMESH::ListOfIDSources& elems);
- CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ CORBA::Boolean Smooth(const SMESH::smIdType_array & IDsOfElements,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method);
CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method);
- CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ CORBA::Boolean SmoothParametric(const SMESH::smIdType_array & IDsOfElements,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method) ;
CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method);
- CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ CORBA::Boolean smooth(const SMESH::smIdType_array & IDsOfElements,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method,
bool IsParametric);
CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject,
- const SMESH::long_array & IDsOfFixedNodes,
- CORBA::Long MaxNbOfIterations,
+ const SMESH::smIdType_array & IDsOfFixedNodes,
+ CORBA::Short MaxNbOfIterations,
CORBA::Double MaxAspectRatio,
SMESH::SMESH_MeshEditor::Smooth_Method Method,
bool IsParametric);
CORBA::Boolean useInputElemsOnly,
CORBA::Boolean makeGroups,
CORBA::Short dim);
- SMESH::ListOfGroups* AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
- const SMESH::DirStruct & theStepVector,
- CORBA::Long theNbOfSteps,
- CORBA::Long theExtrFlags,
- CORBA::Double theSewTolerance,
- CORBA::Boolean theMakeGroups);
+ SMESH::ListOfGroups* AdvancedExtrusion(const SMESH::smIdType_array & theIDsOfElements,
+ const SMESH::DirStruct & theStepVector,
+ CORBA::Long theNbOfSteps,
+ CORBA::Long theExtrFlags,
+ CORBA::Double theSewTolerance,
+ CORBA::Boolean theMakeGroups);
SMESH::ListOfGroups*
ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & Nodes,
const SMESH::ListOfIDSources & Faces,
SMESH::SMESH_IDSource_ptr PathMesh,
GEOM::GEOM_Object_ptr PathShape,
- CORBA::Long NodeStart,
+ SMESH::smIdType NodeStart,
CORBA::Boolean HasAngles,
const SMESH::double_array & Angles,
CORBA::Boolean AnglesVariation,
GEOM::GEOM_Object_ptr PathShape,
const SMESH::double_array & Angles);
- void Mirror(const SMESH::long_array & IDsOfElements,
+ void Mirror(const SMESH::smIdType_array & IDsOfElements,
const SMESH::AxisStruct & Axis,
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
CORBA::Boolean Copy);
const SMESH::AxisStruct & Axis,
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
CORBA::Boolean Copy);
- void Translate(const SMESH::long_array & IDsOfElements,
- const SMESH::DirStruct & Vector,
- CORBA::Boolean Copy);
+ void Translate(const SMESH::smIdType_array & IDsOfElements,
+ const SMESH::DirStruct & Vector,
+ CORBA::Boolean Copy);
void TranslateObject(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::DirStruct & Vector,
CORBA::Boolean Copy);
- void Rotate(const SMESH::long_array & IDsOfElements,
- const SMESH::AxisStruct & Axis,
- CORBA::Double Angle,
- CORBA::Boolean Copy);
+ void Rotate(const SMESH::smIdType_array & IDsOfElements,
+ const SMESH::AxisStruct & Axis,
+ CORBA::Double Angle,
+ CORBA::Boolean Copy);
void RotateObject(SMESH::SMESH_IDSource_ptr theObject,
const SMESH::AxisStruct & Axis,
CORBA::Double Angle,
CORBA::Boolean Copy);
- SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements,
+ SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::smIdType_array& IDsOfElements,
const SMESH::AxisStruct& Mirror,
SMESH::SMESH_MeshEditor::MirrorType MirrorType);
SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
const SMESH::AxisStruct& Mirror,
SMESH::SMESH_MeshEditor::MirrorType MirrorType);
- SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
- const SMESH::DirStruct& Vector);
+ SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::smIdType_array& IDsOfElements,
+ const SMESH::DirStruct& Vector);
SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
const SMESH::DirStruct& Vector);
- SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
- const SMESH::AxisStruct& Axis,
- CORBA::Double AngleInRadians);
+ SMESH::ListOfGroups* RotateMakeGroups(const SMESH::smIdType_array& IDsOfElements,
+ const SMESH::AxisStruct& Axis,
+ CORBA::Double AngleInRadians);
SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
const SMESH::AxisStruct& Axis,
CORBA::Double AngleInRadians);
- SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array& IDsOfElements,
+ SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::smIdType_array& IDsOfElements,
const SMESH::AxisStruct& Mirror,
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
CORBA::Boolean CopyGroups,
SMESH::SMESH_MeshEditor::MirrorType MirrorType,
CORBA::Boolean CopyGroups,
const char* MeshName);
- SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
- const SMESH::DirStruct& Vector,
- CORBA::Boolean CopyGroups,
- const char* MeshName);
+ SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::smIdType_array& IDsOfElements,
+ const SMESH::DirStruct& Vector,
+ CORBA::Boolean CopyGroups,
+ const char* MeshName);
SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
const SMESH::DirStruct& Vector,
CORBA::Boolean CopyGroups,
const char* MeshName);
- SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
- const SMESH::AxisStruct& Axis,
- CORBA::Double AngleInRadians,
- CORBA::Boolean CopyGroups,
- const char* MeshName);
+ SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::smIdType_array& IDsOfElements,
+ const SMESH::AxisStruct& Axis,
+ CORBA::Double AngleInRadians,
+ CORBA::Boolean CopyGroups,
+ const char* MeshName);
SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
const SMESH::AxisStruct& Axis,
CORBA::Double AngleInRadians,
void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID,
const SMESH::ListOfIDSources& ElementsToKeep);
void MergeEqualElements();
- CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
- CORBA::Double y,
- CORBA::Double z,
- CORBA::Long nodeID);
+ SMESH::smIdType MoveClosestNodeToPoint(CORBA::Double x,
+ CORBA::Double y,
+ CORBA::Double z,
+ SMESH::smIdType nodeID);
/*!
* \brief Return ID of node closest to a given point
*/
- CORBA::Long FindNodeClosestTo(CORBA::Double x,
+ SMESH::smIdType FindNodeClosestTo(CORBA::Double x,
CORBA::Double y,
CORBA::Double z);
/*!
* Return elements of given type where the given point is IN or ON.
* 'ALL' type means elements of any type excluding nodes
*/
- SMESH::long_array* FindElementsByPoint(CORBA::Double x,
+ SMESH::smIdType_array* FindElementsByPoint(CORBA::Double x,
CORBA::Double y,
CORBA::Double z,
SMESH::ElementType type);
* where the given point is IN or ON.
* 'ALL' type means elements of any type excluding nodes
*/
- SMESH::long_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements,
+ SMESH::smIdType_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements,
CORBA::Double x,
CORBA::Double y,
CORBA::Double z,
* and coordinates of the projection point.
* In the case if nothing found, return -1 and []
*/
- CORBA::Long ProjectPoint(CORBA::Double x,
+ SMESH::smIdType ProjectPoint(CORBA::Double x,
CORBA::Double y,
CORBA::Double z,
SMESH::ElementType type,
* If a group is closed, the first and last nodes of the group are same.
*/
SMESH::array_of_long_array* Get1DBranches( SMESH::SMESH_IDSource_ptr edges,
- CORBA::Long startNode,
+ SMESH::smIdType startNode,
SMESH::array_of_long_array_out nodeGroups);
/*!
CORBA::Boolean createPolyedrs);
SMESH::SMESH_MeshEditor::Sew_Error
- SewFreeBorders(CORBA::Long FirstNodeID1,
- CORBA::Long SecondNodeID1,
- CORBA::Long LastNodeID1,
- CORBA::Long FirstNodeID2,
- CORBA::Long SecondNodeID2,
- CORBA::Long LastNodeID2,
- CORBA::Boolean CreatePolygons,
- CORBA::Boolean CreatePolyedrs);
+ SewFreeBorders(SMESH::smIdType FirstNodeID1,
+ SMESH::smIdType SecondNodeID1,
+ SMESH::smIdType LastNodeID1,
+ SMESH::smIdType FirstNodeID2,
+ SMESH::smIdType SecondNodeID2,
+ SMESH::smIdType LastNodeID2,
+ CORBA::Boolean CreatePolygons,
+ CORBA::Boolean CreatePolyedrs);
SMESH::SMESH_MeshEditor::Sew_Error
- SewConformFreeBorders(CORBA::Long FirstNodeID1,
- CORBA::Long SecondNodeID1,
- CORBA::Long LastNodeID1,
- CORBA::Long FirstNodeID2,
- CORBA::Long SecondNodeID2);
+ SewConformFreeBorders(SMESH::smIdType FirstNodeID1,
+ SMESH::smIdType SecondNodeID1,
+ SMESH::smIdType LastNodeID1,
+ SMESH::smIdType FirstNodeID2,
+ SMESH::smIdType SecondNodeID2);
SMESH::SMESH_MeshEditor::Sew_Error
- SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
- CORBA::Long SecondNodeIDOnFreeBorder,
- CORBA::Long LastNodeIDOnFreeBorder,
- CORBA::Long FirstNodeIDOnSide,
- CORBA::Long LastNodeIDOnSide,
+ SewBorderToSide(SMESH::smIdType FirstNodeIDOnFreeBorder,
+ SMESH::smIdType SecondNodeIDOnFreeBorder,
+ SMESH::smIdType LastNodeIDOnFreeBorder,
+ SMESH::smIdType FirstNodeIDOnSide,
+ SMESH::smIdType LastNodeIDOnSide,
CORBA::Boolean CreatePolygons,
CORBA::Boolean CreatePolyedrs);
SMESH::SMESH_MeshEditor::Sew_Error
- SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
- const SMESH::long_array& IDsOfSide2Elements,
- CORBA::Long NodeID1OfSide1ToMerge,
- CORBA::Long NodeID1OfSide2ToMerge,
- CORBA::Long NodeID2OfSide1ToMerge,
- CORBA::Long NodeID2OfSide2ToMerge);
+ SewSideElements(const SMESH::smIdType_array& IDsOfSide1Elements,
+ const SMESH::smIdType_array& IDsOfSide2Elements,
+ SMESH::smIdType NodeID1OfSide1ToMerge,
+ SMESH::smIdType NodeID1OfSide2ToMerge,
+ SMESH::smIdType NodeID2OfSide1ToMerge,
+ SMESH::smIdType NodeID2OfSide2ToMerge);
/*!
* Set new nodes for given element.
* If number of nodes is not corresponded to type of
* element - returns false
*/
- CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
+ CORBA::Boolean ChangeElemNodes(SMESH::smIdType ide, const SMESH::smIdType_array& newIDs);
SMESH::SMESH_Group_ptr DoubleElements(SMESH::SMESH_IDSource_ptr theElements,
const char* theGroupName);
- CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
- const SMESH::long_array& theModifiedElems );
+ CORBA::Boolean DoubleNodes( const SMESH::smIdType_array& theNodes,
+ const SMESH::smIdType_array& theModifiedElems );
- CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
- const SMESH::long_array& theModifiedElems );
+ CORBA::Boolean DoubleNode( SMESH::smIdType theNodeId,
+ const SMESH::smIdType_array& theModifiedElems );
CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
SMESH::SMESH_GroupBase_ptr theModifiedElems );
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroup(), DoubleNodeGroups()
*/
- CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems,
- const SMESH::long_array& theNodesNot,
- const SMESH::long_array& theAffectedElems );
+ CORBA::Boolean DoubleNodeElem( const SMESH::smIdType_array& theElems,
+ const SMESH::smIdType_array& theNodesNot,
+ const SMESH::smIdType_array& theAffectedElems );
/*!
* \brief Creates a hole in a mesh by doubling the nodes of some particular elements
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
*/
- CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems,
- const SMESH::long_array& theNodesNot,
- GEOM::GEOM_Object_ptr theShape );
+ CORBA::Boolean DoubleNodeElemInRegion( const SMESH::smIdType_array& theElems,
+ const SMESH::smIdType_array& theNodesNot,
+ GEOM::GEOM_Object_ptr theShape );
/*!
* \brief Creates a hole in a mesh by doubling the nodes of some particular elements
#include "SMESHDS_Mesh.hxx"
#include "SMESH_TypeDefs.hxx"
+#include <smIdType.hxx>
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
virtual const SMDS_MeshElement *FindElement(int IDelem) const;
virtual bool HasNumerationHoles();
- virtual int MaxNodeID() const;
- virtual int MinNodeID() const;
- virtual int MaxElementID() const;
- virtual int MinElementID() const;
+ virtual smIdType MaxNodeID() const;
+ virtual smIdType MinNodeID() const;
+ virtual smIdType MaxElementID() const;
+ virtual smIdType MinElementID() const;
private:
TIDSortedElemSet _elements[ SMDSAbs_NbElementTypes ];
#include <vtkUnstructuredGridWriter.h>
-// to pass CORBA exception through SMESH_TRY
-#define SMY_OWN_CATCH catch( SALOME::SALOME_Exception& se ) { throw se; }
+// to pass CORBA exception and TooLargeForExport exception through SMESH_TRY
+#define SMY_OWN_CATCH \
+ catch( SALOME::SALOME_Exception& se ) { throw se; } \
+ catch( ::SMESH_Mesh::TooLargeForExport& ex ) \
+ { SALOME::ExceptionStruct se = { \
+ SALOME::COMM, \
+ CORBA::string_dup(SMESH_Comment("Mesh is too large for export in format ") << ex.what()), \
+ CORBA::string_dup(SMESH_Comment("format=") << ex.what() ), 0 }; \
+ throw SALOME::SALOME_Exception( se ); }
#include "SMESH_TryCatch.hxx" // include after OCCT headers!
char* SMESH_Mesh_i::GetVersionString(CORBA::Long minor, CORBA::Short nbDigits)
{
- string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(minor,
- nbDigits);
+ string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(minor, nbDigits);
return CORBA::string_dup( ver.c_str() );
}
{
Unexpect aCatch(SALOME_SalomeException);
- const int prevNbMeshEnt = NbNodes() + NbElements();
+ const smIdType prevNbMeshEnt = NbNodes() + NbElements();
if ( _preMeshInfo )
_preMeshInfo->ForgetOrLoad();
THROW_SALOME_CORBA_EXCEPTION( "RemoveGroupWithContents(): group does not belong to this mesh",
SALOME::BAD_PARAM);
- vector<int> nodeIds; // to remove nodes becoming free
+ vector<smIdType> nodeIds; // to remove nodes becoming free
bool isNodal = ( theGroup->GetType() == SMESH::NODE );
if ( !isNodal && !theGroup->IsEmpty() )
{
- CORBA::Long elemID = theGroup->GetID( 1 );
+ SMESH::smIdType elemID = theGroup->GetID( 1 );
int nbElemNodes = GetElemNbNodes( elemID );
if ( nbElemNodes > 0 )
nodeIds.reserve( theGroup->Size() * nbElemNodes );
SMDS_ElemIteratorPtr nIt = elOfType->nodesIterator();
for ( nbChecked = 1; nIt->more() && !toStopChecking; ++nbChecked )
{
- const int nID = nIt->next()->GetID();
+ const smIdType nID = nIt->next()->GetID();
if ( nID < isNodeInGroupsSize && isNodeInGroups[ nID ] &&
isToInclude( nbChecked, ++nbCommon, nbNodes, nbCorners, toStopChecking ))
{
while ( elemIt->more() )
{
const SMDS_MeshElement* e = elemIt->next();
- const int elemID = e->GetID();
+ const smIdType elemID = e->GetID();
const int shapeID = e->GetShapeID();
TRange & lastRange = ranges.back();
if ( lastRange.shapeID != shapeID ||
lastRange.toID != elemID )
- ranges.push_back( TRange{ shapeID, elemID, elemID + 1 });
+ ranges.push_back( TRange{ shapeID, FromIdType<int>(elemID), FromIdType<int>(elemID + 1) });
else
lastRange.toID = elemID + 1;
if ( !theIsBreakLink )
if ( mainGO->GetType() == GEOM_GROUP || !geomChanged ) // is group or not modified
{
- int nb = NbNodes() + NbElements();
+ smIdType nb = NbNodes() + NbElements();
CheckGeomGroupModif();
if ( nb != NbNodes() + NbElements() ) // something removed due to hypotheses change
_gen_i->UpdateIcons( me );
if ( !_impl->HasShapeToMesh() ) return;
- CORBA::Long nbEntities = NbNodes() + NbElements();
+ SMESH::smIdType nbEntities = NbNodes() + NbElements();
// Check if group contents changed
// Update icons
- CORBA::Long newNbEntities = NbNodes() + NbElements();
+ SMESH::smIdType newNbEntities = NbNodes() + NbElements();
list< SALOMEDS::SObject_wrap > soToUpdateIcons;
if ( newNbEntities != nbEntities )
{
while(its != logDS.end()){
SMESHDS_Command *com = *its;
int comType = com->GetType();
- int lgcom = com->GetNumber();
- const list < int >&intList = com->GetIndexes();
+ smIdType lgcom = com->GetNumber();
+ const list < smIdType >&intList = com->GetIndexes();
int inum = intList.size();
- list < int >::const_iterator ii = intList.begin();
+ list < smIdType >::const_iterator ii = intList.begin();
const list < double >&coordList = com->GetCoords();
int rnum = coordList.size();
list < double >::const_iterator ir = coordList.begin();
*/
//================================================================================
-void SMESH_Mesh_i::ExportMED(const char* file,
- CORBA::Boolean auto_groups,
- CORBA::Long version,
- CORBA::Boolean overwrite,
- CORBA::Boolean autoDimension)
+void SMESH_Mesh_i::ExportMED(const char* file,
+ CORBA::Boolean auto_groups,
+ CORBA::Long version,
+ CORBA::Boolean overwrite,
+ CORBA::Boolean autoDimension)
{
//MESSAGE("MED minor version: "<< minor);
SMESH_TRY;
*/
//================================================================================
-void SMESH_Mesh_i::ExportSAUV (const char* file,
- CORBA::Boolean auto_groups)
+void SMESH_Mesh_i::ExportSAUV( const char* file, CORBA::Boolean auto_groups )
{
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
TPythonDump() << SMESH::SMESH_Mesh_var( _this())
<< ".ExportSAUV( r'" << file << "', " << auto_groups << " )";
_impl->ExportSAUV(file, aMeshName.c_str(), auto_groups);
+
+ SMESH_CATCH( SMESH::throwCorbaException );
}
void SMESH_Mesh_i::ExportDAT (const char *file)
{
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- // Update Python script
// check names of groups
checkGroupNames();
+ // Update Python script
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportDAT( r'" << file << "' )";
// Perform Export
PrepareForWriting(file);
_impl->ExportDAT(file);
+
+ SMESH_CATCH( SMESH::throwCorbaException );
}
//================================================================================
void SMESH_Mesh_i::ExportUNV (const char *file)
{
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- // Update Python script
// check names of groups
checkGroupNames();
+ // Update Python script
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportUNV( r'" << file << "' )";
// Perform Export
PrepareForWriting(file);
_impl->ExportUNV(file);
+
+ SMESH_CATCH( SMESH::throwCorbaException );
}
//================================================================================
void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii)
{
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- // Update Python script
// check names of groups
checkGroupNames();
+ // Update Python script
TPythonDump() << SMESH::SMESH_Mesh_var(_this())
<< ".ExportSTL( r'" << file << "', " << isascii << " )";
// Perform Export
PrepareForWriting( file );
_impl->ExportSTL( file, isascii, name.in() );
+
+ SMESH_CATCH( SMESH::throwCorbaException );
}
//================================================================================
void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart,
const char* file)
{
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
TPythonDump() << SMESH::SMESH_Mesh_var(_this())
<< ".ExportPartToDAT( " << meshPart << ", r'" << file << "' )";
+
+ SMESH_CATCH( SMESH::throwCorbaException );
}
//================================================================================
/*!
void SMESH_Mesh_i::ExportPartToUNV(::SMESH::SMESH_IDSource_ptr meshPart,
const char* file)
{
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
TPythonDump() << SMESH::SMESH_Mesh_var(_this())
<< ".ExportPartToUNV( " << meshPart<< ", r'" << file << "' )";
+
+ SMESH_CATCH( SMESH::throwCorbaException );
}
//================================================================================
/*!
const char* file,
::CORBA::Boolean isascii)
{
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToSTL( "
<< meshPart<< ", r'" << file << "', " << isascii << ")";
+
+ SMESH_CATCH( SMESH::throwCorbaException );
}
//================================================================================
CORBA::Boolean groupElemsByType)
{
#ifdef WITH_CGNS
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportCGNS( "
<< meshPart<< ", r'" << file << "', " << overwrite << ")";
+
+ SMESH_CATCH( SMESH::throwCorbaException );
+
#else
THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR);
#endif
const char* file,
bool withRequiredGroups)
{
- Unexpect aCatch(SALOME_SalomeException);
+ SMESH_TRY;
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
<< meshPart<< ", r'"
<< file << "', "
<< withRequiredGroups << ")";
+
+ SMESH_CATCH( SMESH::throwCorbaException );
}
//=============================================================================
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbNodes()
+SMESH::smIdType SMESH_Mesh_i::NbNodes()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbElements()
+SMESH::smIdType SMESH_Mesh_i::NbElements()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::Nb0DElements()
+SMESH::smIdType SMESH_Mesh_i::Nb0DElements()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbBalls()
+SMESH::smIdType SMESH_Mesh_i::NbBalls()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbEdges()
+SMESH::smIdType SMESH_Mesh_i::NbEdges()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbFaces()
+SMESH::smIdType SMESH_Mesh_i::NbFaces()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbTriangles()
+SMESH::smIdType SMESH_Mesh_i::NbTriangles()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::NbBiQuadTriangles()
+SMESH::smIdType SMESH_Mesh_i::NbBiQuadTriangles()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbBiQuadTriangles();
}
-CORBA::Long SMESH_Mesh_i::NbQuadrangles()
+SMESH::smIdType SMESH_Mesh_i::NbQuadrangles()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbQuadrangles();
}
-CORBA::Long SMESH_Mesh_i::NbBiQuadQuadrangles()
+SMESH::smIdType SMESH_Mesh_i::NbBiQuadQuadrangles()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbBiQuadQuadrangles();
}
-CORBA::Long SMESH_Mesh_i::NbPolygons()
+SMESH::smIdType SMESH_Mesh_i::NbPolygons()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPolygons();
}
-CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPolygons((SMDSAbs_ElementOrder)order);
}
-CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbFaces( (SMDSAbs_ElementOrder) order);
}
-CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbTriangles( (SMDSAbs_ElementOrder) order);
}
-CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
//=============================================================================
-CORBA::Long SMESH_Mesh_i::NbVolumes()
+SMESH::smIdType SMESH_Mesh_i::NbVolumes()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbVolumes();
}
-CORBA::Long SMESH_Mesh_i::NbTetras()
+SMESH::smIdType SMESH_Mesh_i::NbTetras()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbTetras();
}
-CORBA::Long SMESH_Mesh_i::NbHexas()
+SMESH::smIdType SMESH_Mesh_i::NbHexas()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbHexas();
}
-CORBA::Long SMESH_Mesh_i::NbTriQuadraticHexas()
+SMESH::smIdType SMESH_Mesh_i::NbTriQuadraticHexas()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbTriQuadraticHexas();
}
-CORBA::Long SMESH_Mesh_i::NbPyramids()
+SMESH::smIdType SMESH_Mesh_i::NbPyramids()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPyramids();
}
-CORBA::Long SMESH_Mesh_i::NbPrisms()
+SMESH::smIdType SMESH_Mesh_i::NbPrisms()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPrisms();
}
-CORBA::Long SMESH_Mesh_i::NbHexagonalPrisms()
+SMESH::smIdType SMESH_Mesh_i::NbHexagonalPrisms()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbHexagonalPrisms();
}
-CORBA::Long SMESH_Mesh_i::NbPolyhedrons()
+SMESH::smIdType SMESH_Mesh_i::NbPolyhedrons()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPolyhedrons();
}
-CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbVolumes( (SMDSAbs_ElementOrder) order);
}
-CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbTetras( (SMDSAbs_ElementOrder) order);
}
-CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbHexas( (SMDSAbs_ElementOrder) order);
}
-CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
return _impl->NbPyramids( (SMDSAbs_ElementOrder) order);
}
-CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order)
+SMESH::smIdType SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order)
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::NbSubMesh()
+SMESH::smIdType SMESH_Mesh_i::NbSubMesh()
{
Unexpect aCatch(SALOME_SalomeException);
return _mapSubMesh_i.size();
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetIDs()
+SMESH::smIdType_array* SMESH_Mesh_i::GetIDs()
{
return GetElementsId();
}
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetElementsId()
+SMESH::smIdType_array* SMESH_Mesh_i::GetElementsId()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
if ( aSMESHDS_Mesh == NULL )
return aResult._retn();
- long nbElements = NbElements();
+ smIdType nbElements = NbElements();
aResult->length( nbElements );
SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator();
- for ( int i = 0, n = nbElements; i < n && anIt->more(); i++ )
+ for ( smIdType i = 0, n = nbElements; i < n && anIt->more(); i++ )
aResult[i] = anIt->next()->GetID();
return aResult._retn();
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemType )
+SMESH::smIdType_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemType )
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS();
if ( aSMESHDS_Mesh == NULL )
return aResult._retn();
- long nbElements = NbElements();
+ smIdType nbElements = NbElements();
// No sense in returning ids of elements along with ids of nodes:
// when theElemType == SMESH::ALL, return node ids only if
aResult->length( nbElements );
- int i = 0;
+ smIdType i = 0;
SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator( (SMDSAbs_ElementType)theElemType );
while ( i < nbElements && anIt->more() )
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetNodesId()
+SMESH::smIdType_array* SMESH_Mesh_i::GetNodesId()
{
Unexpect aCatch(SALOME_SalomeException);
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS();
if ( aMeshDS == NULL )
return aResult._retn();
- long nbNodes = NbNodes();
+ smIdType nbNodes = NbNodes();
aResult->length( nbNodes );
SMDS_NodeIteratorPtr anIt = aMeshDS->nodesIterator();
- for ( int i = 0, n = nbNodes; i < n && anIt->more(); i++ )
+ for ( smIdType i = 0, n = nbNodes; i < n && anIt->more(); i++ )
aResult[i] = anIt->next()->GetID();
return aResult._retn();
*/
//=============================================================================
-SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem )
+SMESH::ElementType SMESH_Mesh_i::GetElementType( const SMESH::smIdType id, const bool iselem )
{
SMESH::ElementType type = SMESH::ALL;
SMESH_TRY;
*/
//=============================================================================
-SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id )
+SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const SMESH::smIdType id )
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const CORBA::Long id )
+SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const SMESH::smIdType id )
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID)
+SMESH::smIdType_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID)
{
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
SMESH_TRY;
if ( _preMeshInfo )
aResult->length(SDSM->NbElements());
SMDS_ElemIteratorPtr eIt = SDSM->GetElements();
- int i = 0;
+ smIdType i = 0;
while ( eIt->more() ) {
aResult[i++] = eIt->next()->GetID();
}
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID,
+SMESH::smIdType_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID,
CORBA::Boolean all)
{
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
SMESH_TRY;
if ( _preMeshInfo )
SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS();
if(!SDSM) return aResult._retn();
- set<int> theElems;
+ set<smIdType> theElems;
if( !all || (SDSM->NbElements()==0) ) { // internal nodes or vertex submesh
SMDS_NodeIteratorPtr nIt = SDSM->GetNodes();
while ( nIt->more() ) {
}
aResult->length(theElems.size());
- set<int>::iterator itElem;
- int i = 0;
+ set<smIdType>::iterator itElem;
+ smIdType i = 0;
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
aResult[i++] = *itElem;
*/
//=============================================================================
-SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const CORBA::Long id)
+SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id,
- SMESH::ElementType elemType)
+SMESH::smIdType_array* SMESH_Mesh_i::GetNodeInverseElements(const SMESH::smIdType id,
+ SMESH::ElementType elemType)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS();
if ( aMeshDS == NULL )
return aResult._retn();
SMDSAbs_ElementType type = SMDSAbs_ElementType( elemType );
SMDS_ElemIteratorPtr eIt = aNode->GetInverseElementIterator( type );
aResult->length( aNode->NbInverseElements( type ));
- for( int i = 0; eIt->more(); ++i )
+ for( smIdType i = 0; eIt->more(); ++i )
{
const SMDS_MeshElement* elem = eIt->next();
aResult[ i ] = elem->GetID();
*/
//=============================================================================
-SMESH::NodePosition* SMESH_Mesh_i::GetNodePosition(CORBA::Long NodeID)
+SMESH::NodePosition* SMESH_Mesh_i::GetNodePosition(SMESH::smIdType NodeID)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(CORBA::Long ElemID)
+SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(SMESH::smIdType ElemID)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::GetShapeID(const CORBA::Long id)
+CORBA::Long SMESH_Mesh_i::GetShapeID(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const CORBA::Long id)
+CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::GetElemNbNodes(const CORBA::Long id)
+CORBA::Short SMESH_Mesh_i::GetElemNbNodes(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::GetElemNode(const CORBA::Long id, const CORBA::Long index)
+SMESH::smIdType SMESH_Mesh_i::GetElemNode(const SMESH::smIdType id, const CORBA::Short index)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetElemNodes(const CORBA::Long id)
+SMESH::smIdType_array* SMESH_Mesh_i::GetElemNodes(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() )
{
if ( const SMDS_MeshElement* elem = aMeshDS->FindElement(id) )
{
aResult->length( elem->NbNodes() );
- for ( CORBA::ULong i = 0; i < aResult->length(); ++i )
+ for ( SMESH::smIdType i = 0; i < aResult->length(); ++i )
if ( const SMDS_MeshNode* n = elem->GetNode( i ))
aResult[ i ] = n->GetID();
}
*/
//=============================================================================
-CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const CORBA::Long ide, const CORBA::Long idn)
+CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const SMESH::smIdType ide, const SMESH::smIdType idn)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const CORBA::Long idn,
+CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const SMESH::smIdType idn,
SMESH::ElementType theElemType)
{
if ( _preMeshInfo )
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::ElemNbEdges(const CORBA::Long id)
+CORBA::Long SMESH_Mesh_i::ElemNbEdges(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Long SMESH_Mesh_i::ElemNbFaces(const CORBA::Long id)
+CORBA::Long SMESH_Mesh_i::ElemNbFaces(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//================================================================================
-SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId,
- CORBA::Short faceIndex)
+SMESH::smIdType_array* SMESH_Mesh_i::GetElemFaceNodes(SMESH::smIdType elemId,
+ CORBA::Short faceIndex)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() )
{
if ( const SMDS_MeshElement* elem = aMeshDS->FindElement(elemId) )
{
aResult->length( vtool.NbFaceNodes( faceIndex ));
const SMDS_MeshNode** nn = vtool.GetFaceNodes( faceIndex );
- for ( CORBA::ULong i = 0; i < aResult->length(); ++i )
+ for ( SMESH::smIdType i = 0; i < aResult->length(); ++i )
aResult[ i ] = nn[ i ]->GetID();
}
}
*/
//================================================================================
-CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes)
+SMESH::smIdType SMESH_Mesh_i::FindElementByNodes(const SMESH::smIdType_array& nodes)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//================================================================================
-SMESH::long_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::long_array& nodes,
- SMESH::ElementType elemType)
+SMESH::smIdType_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::smIdType_array& nodes,
+ SMESH::ElementType elemType)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
- SMESH::long_array_var result = new SMESH::long_array();
+ SMESH::smIdType_array_var result = new SMESH::smIdType_array();
if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() )
{
vector< const SMDS_MeshNode * > nn( nodes.length() );
- for ( CORBA::ULong i = 0; i < nodes.length(); ++i )
+ for ( SMESH::smIdType i = 0; i < nodes.length(); ++i )
nn[i] = mesh->FindNode( nodes[i] );
std::vector<const SMDS_MeshElement *> elems;
*/
//=============================================================================
-CORBA::Boolean SMESH_Mesh_i::IsPoly(const CORBA::Long id)
+CORBA::Boolean SMESH_Mesh_i::IsPoly(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const CORBA::Long id)
+CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-CORBA::Double SMESH_Mesh_i::GetBallDiameter(CORBA::Long id)
+CORBA::Double SMESH_Mesh_i::GetBallDiameter(SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::double_array* SMESH_Mesh_i::BaryCenter(const CORBA::Long id)
+SMESH::double_array* SMESH_Mesh_i::BaryCenter(const SMESH::smIdType id)
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetMeshInfo()
+SMESH::smIdType_array* SMESH_Mesh_i::GetMeshInfo()
{
if ( _preMeshInfo )
return _preMeshInfo->GetMeshInfo();
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::Entity_Last);
for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
aRes[i] = 0;
*/
//=============================================================================
-SMESH::long_array* SMESH_Mesh_i::GetNbElementsByType()
+SMESH::smIdType_array* SMESH_Mesh_i::GetNbElementsByType()
{
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::NB_ELEMENT_TYPES);
- for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
+ for (smIdType i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
aRes[ i ] = 0;
const SMDS_MeshInfo* meshInfo = 0;
meshInfo = & meshDS->GetMeshInfo();
if (meshInfo)
- for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
+ for (smIdType i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
aRes[i] = meshInfo->NbElements((SMDSAbs_ElementType)i);
return aRes._retn();
//=============================================================================
void SMESH_Mesh_i::CollectMeshInfo(const SMDS_ElemIteratorPtr theItr,
- SMESH::long_array& theInfo)
+ SMESH::smIdType_array& theInfo)
{
if (!theItr) return;
while (theItr->more())
//-----------------------------------------------------------------------------
struct IDSourceIterator : public SMDS_ElemIterator
{
- const CORBA::Long* _idPtr;
- const CORBA::Long* _idEndPtr;
- SMESH::long_array_var _idArray;
- const SMDS_Mesh* _mesh;
- const SMDSAbs_ElementType _type;
- const SMDS_MeshElement* _elem;
-
- IDSourceIterator( const SMDS_Mesh* mesh,
- const CORBA::Long* ids,
- const int nbIds,
- SMDSAbs_ElementType type):
+ const SMESH::smIdType* _idPtr;
+ const SMESH::smIdType* _idEndPtr;
+ SMESH::smIdType_array_var _idArray;
+ const SMDS_Mesh* _mesh;
+ const SMDSAbs_ElementType _type;
+ const SMDS_MeshElement* _elem;
+
+ IDSourceIterator( const SMDS_Mesh* mesh,
+ const SMESH::smIdType* ids,
+ const smIdType nbIds,
+ SMDSAbs_ElementType type):
_idPtr( ids ), _idEndPtr( ids + nbIds ), _mesh( mesh ), _type( type ), _elem( 0 )
{
if ( _idPtr && nbIds && _mesh )
next();
}
- IDSourceIterator( const SMDS_Mesh* mesh,
- SMESH::long_array* idArray,
- SMDSAbs_ElementType type):
+ IDSourceIterator( const SMDS_Mesh* mesh,
+ SMESH::smIdType_array* idArray,
+ SMDSAbs_ElementType type):
_idPtr( 0 ), _idEndPtr( 0 ), _idArray( idArray), _mesh( mesh ), _type( type ), _elem( 0 )
{
if ( idArray && _mesh )
SMDSAbs_ElementType iterType = isNodes ? SMDSAbs_Node : elemType;
if ( SMESH_MeshEditor_i::IsTemporaryIDSource( theObject ))
{
- int nbIds;
- if ( CORBA::Long* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds ))
+ SMESH::smIdType nbIds;
+ if ( SMESH::smIdType* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds ))
elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids, nbIds, iterType ));
}
else
{
- SMESH::long_array_var ids = theObject->GetIDs();
+ SMESH::smIdType_array_var ids = theObject->GetIDs();
elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids._retn(), iterType ));
}
typeOK = ( isNodes == ( elemType == SMDSAbs_Node )) || ( elemType == SMDSAbs_All );
else
{
TMeshInfo tmpInfo;
- SMESH::long_array_var anIDs = meshPart->GetIDs();
+ SMESH::smIdType_array_var anIDs = meshPart->GetIDs();
SMESH::array_of_ElementType_var types = meshPart->GetTypes();
if ( types->length() == 1 && types[0] == SMESH::NODE ) // group of nodes
{
MaxElementID() != NbElements() );
}
// -------------------------------------------------------------------------------------
-int SMESH_MeshPartDS::MaxNodeID() const
+smIdType SMESH_MeshPartDS::MaxNodeID() const
{
if ( _meshDS ) return _meshDS->MaxNodeID();
return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].rbegin())->GetID();
}
// -------------------------------------------------------------------------------------
-int SMESH_MeshPartDS::MinNodeID() const
+smIdType SMESH_MeshPartDS::MinNodeID() const
{
if ( _meshDS ) return _meshDS->MinNodeID();
return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].begin())->GetID();
}
// -------------------------------------------------------------------------------------
-int SMESH_MeshPartDS::MaxElementID() const
+smIdType SMESH_MeshPartDS::MaxElementID() const
{
if ( _meshDS ) return _meshDS->MaxElementID();
- int maxID = 0;
+ smIdType maxID = 0;
for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType )
if ( !_elements[ iType ].empty() )
- maxID = Max( maxID, (*_elements[ iType ].rbegin())->GetID() );
+ maxID = std::max( maxID, (*_elements[ iType ].rbegin())->GetID() );
return maxID;
}
// -------------------------------------------------------------------------------------
-int SMESH_MeshPartDS::MinElementID() const
+smIdType SMESH_MeshPartDS::MinElementID() const
{
if ( _meshDS ) return _meshDS->MinElementID();
- int minID = 0;
+ smIdType minID = 0;
for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType )
if ( !_elements[ iType ].empty() )
- minID = Min( minID, (*_elements[ iType ].begin())->GetID() );
+ minID = std::min( minID, (*_elements[ iType ].begin())->GetID() );
return minID;
}
// -------------------------------------------------------------------------------------
CORBA::Double GetComputeProgress();
- CORBA::Long NbNodes();
+ SMESH::smIdType NbNodes();
- CORBA::Long NbElements();
+ SMESH::smIdType NbElements();
- CORBA::Long Nb0DElements();
+ SMESH::smIdType Nb0DElements();
- CORBA::Long NbBalls();
+ SMESH::smIdType NbBalls();
- CORBA::Long NbEdges();
+ SMESH::smIdType NbEdges();
- CORBA::Long NbEdgesOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbEdgesOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbFaces();
+ SMESH::smIdType NbFaces();
- CORBA::Long NbFacesOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbFacesOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbTriangles();
+ SMESH::smIdType NbTriangles();
- CORBA::Long NbTrianglesOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbTrianglesOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbBiQuadTriangles();
+ SMESH::smIdType NbBiQuadTriangles();
- CORBA::Long NbQuadrangles();
+ SMESH::smIdType NbQuadrangles();
- CORBA::Long NbQuadranglesOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbQuadranglesOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbBiQuadQuadrangles();
+ SMESH::smIdType NbBiQuadQuadrangles();
- CORBA::Long NbPolygons();
+ SMESH::smIdType NbPolygons();
- CORBA::Long NbPolygonsOfOrder(SMESH::ElementOrder order = SMESH::ORDER_ANY);
+ SMESH::smIdType NbPolygonsOfOrder(SMESH::ElementOrder order = SMESH::ORDER_ANY);
- CORBA::Long NbVolumes();
+ SMESH::smIdType NbVolumes();
- CORBA::Long NbVolumesOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbVolumesOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbTetras();
+ SMESH::smIdType NbTetras();
- CORBA::Long NbTetrasOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbTetrasOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbHexas();
+ SMESH::smIdType NbHexas();
- CORBA::Long NbHexasOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbHexasOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbTriQuadraticHexas();
+ SMESH::smIdType NbTriQuadraticHexas();
- CORBA::Long NbPyramids();
+ SMESH::smIdType NbPyramids();
- CORBA::Long NbPyramidsOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbPyramidsOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbPrisms();
+ SMESH::smIdType NbPrisms();
- CORBA::Long NbPrismsOfOrder(SMESH::ElementOrder order);
+ SMESH::smIdType NbPrismsOfOrder(SMESH::ElementOrder order);
- CORBA::Long NbHexagonalPrisms();
+ SMESH::smIdType NbHexagonalPrisms();
- CORBA::Long NbPolyhedrons();
+ SMESH::smIdType NbPolyhedrons();
- CORBA::Long NbSubMesh();
+ SMESH::smIdType NbSubMesh();
- SMESH::long_array* GetElementsId();
+ SMESH::smIdType_array* GetElementsId();
- SMESH::long_array* GetElementsByType( SMESH::ElementType theElemType );
+ SMESH::smIdType_array* GetElementsByType( SMESH::ElementType theElemType );
- SMESH::long_array* GetNodesId();
+ SMESH::smIdType_array* GetNodesId();
- SMESH::ElementType GetElementType( CORBA::Long id, bool iselem );
+ SMESH::ElementType GetElementType( SMESH::smIdType id, bool iselem );
- SMESH::EntityType GetElementGeomType( CORBA::Long id );
+ SMESH::EntityType GetElementGeomType( SMESH::smIdType id );
- SMESH::GeometryType GetElementShape( CORBA::Long id );
+ SMESH::GeometryType GetElementShape( SMESH::smIdType id );
/*!
* Returns ID of elements for given submesh
*/
- SMESH::long_array* GetSubMeshElementsId(CORBA::Long ShapeID);
+ SMESH::smIdType_array* GetSubMeshElementsId(CORBA::Long ShapeID);
/*!
* Returns ID of nodes for given submesh
* If param all==true - returns all nodes, else -
* returns only nodes on shapes.
*/
- SMESH::long_array* GetSubMeshNodesId(CORBA::Long ShapeID, CORBA::Boolean all);
+ SMESH::smIdType_array* GetSubMeshNodesId(CORBA::Long ShapeID, CORBA::Boolean all);
/*!
* Returns type of elements for given submesh
* Get XYZ coordinates of node as list of double
* If there is not node for given ID - returns empty list
*/
- SMESH::double_array* GetNodeXYZ(CORBA::Long id);
+ SMESH::double_array* GetNodeXYZ(SMESH::smIdType id);
/*!
* For given node returns list of IDs of inverse elements
* If there is not node for given ID - returns empty list
*/
- SMESH::long_array* GetNodeInverseElements(CORBA::Long id,
+ SMESH::smIdType_array* GetNodeInverseElements(SMESH::smIdType id,
SMESH::ElementType elemType);
/*!
* \brief Return position of a node on shape
*/
- SMESH::NodePosition* GetNodePosition(CORBA::Long NodeID);
+ SMESH::NodePosition* GetNodePosition(SMESH::smIdType NodeID);
/*!
* \brief Return position of an element on shape
*/
- SMESH::ElementPosition GetElementPosition(CORBA::Long ElemID);
+ SMESH::ElementPosition GetElementPosition(SMESH::smIdType ElemID);
/*!
* If given element is node returns IDs of shape from position
* If there is not node for given ID - returns -1
*/
- CORBA::Long GetShapeID(CORBA::Long id);
+ CORBA::Long GetShapeID(SMESH::smIdType id);
/*!
* For given element returns ID of result shape after
* ::FindShape() from SMESH_MeshEditor
* If there is not element for given ID - returns -1
*/
- CORBA::Long GetShapeIDForElem(CORBA::Long id);
+ CORBA::Long GetShapeIDForElem(SMESH::smIdType id);
/*!
* Returns number of nodes for given element
* If there is not element for given ID - returns -1
*/
- CORBA::Long GetElemNbNodes(CORBA::Long id);
+ CORBA::Short GetElemNbNodes(SMESH::smIdType id);
/*!
* Returns IDs of nodes of given element
*/
- SMESH::long_array* GetElemNodes(CORBA::Long id);
+ SMESH::smIdType_array* GetElemNodes(SMESH::smIdType id);
/*!
* Returns ID of node by given index for given element
* If there is not element for given ID - returns -1
* If there is not node for given index - returns -2
*/
- CORBA::Long GetElemNode(CORBA::Long id, CORBA::Long index);
+ SMESH::smIdType GetElemNode(SMESH::smIdType id, CORBA::Short index);
/*!
* Returns true if given node is medium node
* in given quadratic element
*/
- CORBA::Boolean IsMediumNode(CORBA::Long ide, CORBA::Long idn);
+ CORBA::Boolean IsMediumNode(SMESH::smIdType ide, SMESH::smIdType idn);
/*!
* Returns true if given node is medium node
* in one of quadratic elements
*/
- CORBA::Boolean IsMediumNodeOfAnyElem(CORBA::Long idn,
+ CORBA::Boolean IsMediumNodeOfAnyElem(SMESH::smIdType idn,
SMESH::ElementType elemType);
/*!
* Returns number of edges for given element
*/
- CORBA::Long ElemNbEdges(CORBA::Long id);
+ CORBA::Long ElemNbEdges(SMESH::smIdType id);
/*!
* Returns number of faces for given element
*/
- CORBA::Long ElemNbFaces(CORBA::Long id);
+ CORBA::Long ElemNbFaces(SMESH::smIdType id);
/*!
* Returns nodes of given face (counted from zero) for given element.
*/
- SMESH::long_array* GetElemFaceNodes(CORBA::Long elemId, CORBA::Short faceIndex);
+ SMESH::smIdType_array* GetElemFaceNodes(SMESH::smIdType elemId, CORBA::Short faceIndex);
/*!
* Returns three components of normal of given mesh face (or an empty array in KO case)
/*!
* Returns an element based on all given nodes.
*/
- CORBA::Long FindElementByNodes(const SMESH::long_array& nodes);
+ SMESH::smIdType FindElementByNodes(const SMESH::smIdType_array& nodes);
/*!
* Return elements including all given nodes.
*/
- SMESH::long_array* GetElementsByNodes(const SMESH::long_array& nodes,
+ SMESH::smIdType_array* GetElementsByNodes(const SMESH::smIdType_array& nodes,
SMESH::ElementType elemType);
/*!
* Returns true if given element is polygon
*/
- CORBA::Boolean IsPoly(CORBA::Long id);
+ CORBA::Boolean IsPoly(SMESH::smIdType id);
/*!
* Returns true if given element is quadratic
*/
- CORBA::Boolean IsQuadratic(CORBA::Long id);
+ CORBA::Boolean IsQuadratic(SMESH::smIdType id);
/*!
* Returns diameter of ball discrete element or zero in case of an invalid \a id
*/
- CORBA::Double GetBallDiameter(CORBA::Long id);
+ CORBA::Double GetBallDiameter(SMESH::smIdType id);
/*!
* Returns bary center for given element
*/
- SMESH::double_array* BaryCenter(CORBA::Long id);
+ SMESH::double_array* BaryCenter(SMESH::smIdType id);
/*!
* Returns information about imported MED file
* Collect statistic of mesh elements given by iterator
*/
static void CollectMeshInfo(const SMDS_ElemIteratorPtr theItr,
- SMESH::long_array& theInfo);
+ SMESH::smIdType_array& theInfo);
/*!
* \brief Return iterator on elements of given type in given object
*/
// SMESH_IDSource interface
// =========================
- virtual SMESH::long_array* GetIDs();
+ virtual SMESH::smIdType_array* GetIDs();
/*!
* Returns number of mesh elements of each \a EntityType
* Result array of number of elements per \a EntityType
* Inherited from SMESH_IDSource
*/
- virtual SMESH::long_array* GetMeshInfo();
+ virtual SMESH::smIdType_array* GetMeshInfo();
/*!
* Returns number of mesh elements of each \a ElementType
*/
- virtual SMESH::long_array* GetNbElementsByType();
+ virtual SMESH::smIdType_array* GetNbElementsByType();
/*!
* Returns types of elements it contains
*/
//=======================================================================
SMESH::point_array*
- SMESH_Pattern_i::ApplyToMeshFaces(SMESH::SMESH_Mesh_ptr theMesh,
- const SMESH::long_array& theFacesIDs,
- CORBA::Long theNodeIndexOnKeyPoint1,
- CORBA::Boolean theReverse)
+ SMESH_Pattern_i::ApplyToMeshFaces(SMESH::SMESH_Mesh_ptr theMesh,
+ const SMESH::smIdType_array& theFacesIDs,
+ CORBA::Short theNodeIndexOnKeyPoint1,
+ CORBA::Boolean theReverse)
{
SMESH::point_array_var points = new SMESH::point_array;
list<const gp_XYZ *> xyzList;
set<const SMDS_MeshFace*> fset;
- for ( CORBA::ULong i = 0; i < theFacesIDs.length(); i++)
+ for ( SMESH::smIdType i = 0; i < theFacesIDs.length(); i++)
{
- CORBA::Long index = theFacesIDs[i];
+ SMESH::smIdType index = theFacesIDs[i];
const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index);
if ( elem && elem->GetType() == SMDSAbs_Face )
fset.insert( static_cast<const SMDS_MeshFace *>( elem ));
//=======================================================================
SMESH::point_array*
- SMESH_Pattern_i::ApplyToHexahedrons(SMESH::SMESH_Mesh_ptr theMesh,
- const SMESH::long_array& theVolumesIDs,
- CORBA::Long theNode000Index,
- CORBA::Long theNode001Index)
+ SMESH_Pattern_i::ApplyToHexahedrons(SMESH::SMESH_Mesh_ptr theMesh,
+ const SMESH::smIdType_array& theVolumesIDs,
+ CORBA::Short theNode000Index,
+ CORBA::Short theNode001Index)
{
SMESH::point_array_var points = new SMESH::point_array;
list<const gp_XYZ *> xyzList;
set<const SMDS_MeshVolume*> vset;
- for ( CORBA::ULong i = 0; i < theVolumesIDs.length(); i++)
+ for ( SMESH::smIdType i = 0; i < theVolumesIDs.length(); i++)
{
- CORBA::Long index = theVolumesIDs[i];
+ SMESH::smIdType index = theVolumesIDs[i];
const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index);
if ( elem && elem->GetType() == SMDSAbs_Volume && elem->NbNodes() == 8 )
vset.insert( static_cast<const SMDS_MeshVolume *>( elem ));
<< CreatePolygons << ", " << CreatePolyedrs << " )";
addErrorCode( "MakeMesh" );
- int nb = aMesh->NbNodes() + aMesh->NbEdges() + aMesh->NbFaces() + aMesh->NbVolumes();
+ smIdType nb = aMesh->NbNodes() + aMesh->NbEdges() + aMesh->NbFaces() + aMesh->NbVolumes();
bool res = myPattern.MakeMesh( aMesh, CreatePolygons, CreatePolyedrs );
GEOM::GEOM_Object_ptr theVertex000,
GEOM::GEOM_Object_ptr theVertex001);
- SMESH::point_array* ApplyToMeshFaces(SMESH::SMESH_Mesh_ptr theMesh,
- const SMESH::long_array& theFacesIDs,
- CORBA::Long theNodeIndexOnKeyPoint1,
- CORBA::Boolean theReverse);
-
- SMESH::point_array* ApplyToHexahedrons(SMESH::SMESH_Mesh_ptr theMesh,
- const SMESH::long_array& theVolumesIDs,
- CORBA::Long theNode000Index,
- CORBA::Long theNode001Index);
+ SMESH::point_array* ApplyToMeshFaces(SMESH::SMESH_Mesh_ptr theMesh,
+ const SMESH::smIdType_array& theFacesIDs,
+ CORBA::Short theNodeIndexOnKeyPoint1,
+ CORBA::Boolean theReverse);
+
+ SMESH::point_array* ApplyToHexahedrons(SMESH::SMESH_Mesh_ptr theMesh,
+ const SMESH::smIdType_array& theVolumesIDs,
+ CORBA::Short theNode000Index,
+ CORBA::Short theNode001Index);
//for omniORB conflict compilation
/*CORBA::Boolean MakeMesh (SMESH::SMESH_Mesh_ptr theMesh,
*/
//================================================================================
- void meshInfo2hdf( SMESH::long_array_var meshInfo,
- const std::string& name,
- HDFgroup* hdfGroup)
+ void meshInfo2hdf( SMESH::smIdType_array_var meshInfo,
+ const std::string& name,
+ HDFgroup* hdfGroup)
{
// we use med identification of element (MED::EGeometrieElement) types
// but not enum SMDSAbs_EntityType because values of SMDSAbs_EntityType may
*/
//================================================================================
-SMESH::long_array* SMESH_PreMeshInfo::GetMeshInfo() const
+SMESH::smIdType_array* SMESH_PreMeshInfo::GetMeshInfo() const
{
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::Entity_Last);
for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
aRes[i] = 0;
// meshods of SMESH_IDSource interface
SMESH::array_of_ElementType* GetTypes() const;
- SMESH::long_array* GetMeshInfo() const;
+ SMESH::smIdType_array* GetMeshInfo() const;
bool IsMeshInfoCorrect() const;
~SMESH_PreMeshInfo();
size_t TPythonDump::myCounter = 0;
const char theNotPublishedObjectName[] = "__NOT__Published__Object__";
- TVar::TVar(CORBA::Double value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); }
- TVar::TVar(CORBA::Long value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); }
- TVar::TVar(CORBA::Short value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); }
+ TVar::TVar(CORBA::Double value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); }
+ TVar::TVar(CORBA::Long value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); }
+ TVar::TVar(SMESH::smIdType value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); }
+ TVar::TVar(CORBA::Short value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); }
TVar::TVar(const SMESH::double_array& value):myVals(value.length()), myIsList(true)
{
for ( size_t i = 0; i < value.length(); i++)
return *this;
}
+ TPythonDump&
+ TPythonDump::
+ operator<<(long long theArg){
+ myStream<<theArg;
+ return *this;
+ }
+
TPythonDump&
TPythonDump::
operator<<(double theArg){
return *this;
}
+ TPythonDump&
+ TPythonDump::operator<<(const SMESH::smIdType_array& theArg)
+ {
+ DumpArray( theArg, *this );
+ return *this;
+ }
+
TPythonDump&
TPythonDump::operator<<(const SMESH::double_array& theArg)
{
}
if ( SMESH_MeshEditor_i::IsTemporaryIDSource( theArg ))
{
- SMESH::SMESH_Mesh_var mesh = theArg->GetMesh();
- SMESH::long_array_var anElementsId = theArg->GetIDs();
- SMESH::array_of_ElementType_var types = theArg->GetTypes();
- SMESH::ElementType type = types->length() ? types[0] : SMESH::ALL;
- SALOMEDS::SObject_wrap meshSO = mySmesh->ObjectToSObject(mesh);
+ SMESH::SMESH_Mesh_var mesh = theArg->GetMesh();
+ SMESH::smIdType_array_var anElementsId = theArg->GetIDs();
+ SMESH::array_of_ElementType_var types = theArg->GetTypes();
+ SMESH::ElementType type = types->length() ? types[0] : SMESH::ALL;
+ SALOMEDS::SObject_wrap meshSO = mySmesh->ObjectToSObject(mesh);
+
if ( meshSO->_is_nil() ) // don't waste memory for dumping not published objects
return *this << mesh << ".GetIDSource([], " << type << ")";
else
{
std::vector< std::string > myVals;
bool myIsList;
- TVar(CORBA::Double value);
- TVar(CORBA::Long value);
- TVar(CORBA::Short value);
+ TVar(CORBA::Double value);
+ TVar(CORBA::Long value);
+ TVar(SMESH::smIdType value);
+ TVar(CORBA::Short value);
TVar(const SMESH::double_array& value);
// string used to temporary quote variable names in order
// not to confuse variables with string arguments
TPythonDump&
operator<<(int theArg);
+ TPythonDump&
+ operator<<(long long theArg);
+
TPythonDump&
operator<<(double theArg);
TPythonDump&
operator<<(const SMESH::long_array& theArg);
+ TPythonDump&
+ operator<<(const SMESH::smIdType_array& theArg);
+
TPythonDump&
operator<<(const SMESH::double_array& theArg);
*/
//=============================================================================
-CORBA::Long SMESH_subMesh_i::GetNumberOfElements()
+SMESH::smIdType SMESH_subMesh_i::GetNumberOfElements()
{
Unexpect aCatch(SALOME_SalomeException);
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
- int nbElems = 0;
+ SMESH::smIdType nbElems = 0;
TListOfSubMeshes smList;
if ( getSubMeshes( aSubMesh, smList ))
*/
//=============================================================================
-CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all)
+SMESH::smIdType SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all)
{
Unexpect aCatch(SALOME_SalomeException);
}
if ( all ) // get nodes from aSubMesh and all child sub-meshes
{
- int nbNodes = 0;
+ SMESH::smIdType nbNodes = 0;
SMESH_subMeshIteratorPtr smIt = aSubMesh->getDependsOnIterator( /*includeSelf=*/true );
while ( smIt->more() )
{
*/
//=============================================================================
-SMESH::long_array* SMESH_subMesh_i::GetElementsId()
+SMESH::smIdType_array* SMESH_subMesh_i::GetElementsId()
{
Unexpect aCatch(SALOME_SalomeException);
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
if ( _mesh_i->_mapSubMesh.find( _localId ) == _mesh_i->_mapSubMesh.end() )
return aResult._retn();
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
- int nbElems = 0;
+ SMESH::smIdType nbElems = 0;
TListOfSubMeshes smList;
if ( getSubMeshes( aSubMesh, smList ))
{
*/
//=============================================================================
-SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theElemType )
+SMESH::smIdType_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theElemType )
{
Unexpect aCatch(SALOME_SalomeException);
- SMESH::long_array_var aResult = new SMESH::long_array();
+ SMESH::smIdType_array_var aResult = new SMESH::smIdType_array();
if ( _mesh_i->_mapSubMesh.find( _localId ) == _mesh_i->_mapSubMesh.end() )
return aResult._retn();
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
// PAL5440, return all nodes belonging to elements of the sub-mesh
- set<int> nodeIds;
- int nbElems = 0;
+ set<smIdType> nodeIds;
+ smIdType nbElems = 0;
// volumes may be bound to shell instead of solid
TListOfSubMeshes smList;
int i = 0, n = aResult->length();
if ( theElemType == SMESH::NODE && !nodeIds.empty() ) {
- set<int>::iterator idIt = nodeIds.begin();
+ set<smIdType>::iterator idIt = nodeIds.begin();
for ( ; i < n && idIt != nodeIds.end() ; i++, idIt++ )
aResult[i] = *idIt;
}
*/
//=============================================================================
-SMESH::long_array* SMESH_subMesh_i::GetNodesId()
+SMESH::smIdType_array* SMESH_subMesh_i::GetNodesId()
{
Unexpect aCatch(SALOME_SalomeException);
- SMESH::long_array_var aResult = GetElementsByType( SMESH::NODE );
+ SMESH::smIdType_array_var aResult = GetElementsByType( SMESH::NODE );
return aResult._retn();
}
/*!
*
*/
-//=============================================================================
+//========error:=====================================================================
SMESH::SMESH_Mesh_ptr SMESH_subMesh_i::GetFather()
{
*
*/
//=============================================================================
-SMESH::long_array* SMESH_subMesh_i::GetIDs()
+SMESH::smIdType_array* SMESH_subMesh_i::GetIDs()
{
return GetElementsId();
}
*
*/
//=============================================================================
-SMESH::ElementType SMESH_subMesh_i::GetElementType( const CORBA::Long id, const bool iselem )
+SMESH::ElementType SMESH_subMesh_i::GetElementType( const SMESH::smIdType id, const bool iselem )
{
if ( _preMeshInfo )
_preMeshInfo->FullLoadFromFile();
*/
//=============================================================================
-SMESH::long_array* SMESH_subMesh_i::GetMeshInfo()
+SMESH::smIdType_array* SMESH_subMesh_i::GetMeshInfo()
{
if ( _preMeshInfo )
return _preMeshInfo->GetMeshInfo();
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::Entity_Last);
for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++)
aRes[i] = 0;
*/
//=======================================================================
-SMESH::long_array* SMESH_subMesh_i::GetNbElementsByType()
+SMESH::smIdType_array* SMESH_subMesh_i::GetNbElementsByType()
{
- SMESH::long_array_var aRes = new SMESH::long_array();
+ SMESH::smIdType_array_var aRes = new SMESH::smIdType_array();
aRes->length(SMESH::NB_ELEMENT_TYPES);
for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++)
if ( _preMeshInfo )
int localId );
~SMESH_subMesh_i();
- CORBA::Long GetNumberOfElements();
+ SMESH::smIdType GetNumberOfElements();
- CORBA::Long GetNumberOfNodes( CORBA::Boolean all );
+ SMESH::smIdType GetNumberOfNodes( CORBA::Boolean all );
- SMESH::long_array* GetElementsId();
+ SMESH::smIdType_array* GetElementsId();
- SMESH::long_array* GetElementsByType( SMESH::ElementType theElemType );
+ SMESH::smIdType_array* GetElementsByType( SMESH::ElementType theElemType );
- SMESH::ElementType GetElementType( CORBA::Long id, bool iselem );
+ SMESH::ElementType GetElementType( SMESH::smIdType id, bool iselem );
- SMESH::long_array* GetNodesId();
+ SMESH::smIdType_array* GetNodesId();
SMESH::SMESH_Mesh_ptr GetFather();
/*!
* Returns a sequence of all element IDs
*/
- virtual SMESH::long_array* GetIDs();
+ virtual SMESH::smIdType_array* GetIDs();
/*!
* Returns number of mesh elements of each \a EntityType
* Result array of number of elements per \a EntityType
* Inherited from SMESH_IDSource
*/
- virtual SMESH::long_array* GetMeshInfo();
+ virtual SMESH::smIdType_array* GetMeshInfo();
/*!
* Returns number of mesh elements of each \a ElementType
*/
- virtual SMESH::long_array* GetNbElementsByType();
+ virtual SMESH::smIdType_array* GetNbElementsByType();
/*!
* Returns types of elements it contains
*/
if ( vw->SelectionMode() == ActorSelection )
return;
- TColStd_MapOfInteger idMap;
+ SVTK_TVtkIDsMap idMap;
std::vector<int>::const_iterator it;
for ( it = myIds.begin(); it != myIds.end(); ++it )
{
if ( vw->SelectionMode() != EdgeOfCellSelection )
return;
- SVTK_IndexedMapOfIds idMap;
+ SVTK_IndexedMapOfVtkIds idMap;
std::vector<std::pair<int, int> >::const_iterator it;
for ( it = myIds.begin(); it != myIds.end(); ++it )
{
- std::vector<int> pair;
+ std::vector<vtkIdType> pair;
pair.push_back( (*it).first );
pair.push_back( (*it).second );
idMap.Add( pair );
if ( !actor || !actor->hasIO() )
return;
- TColStd_IndexedMapOfInteger idMap;
+ SVTK_TIndexedMapOfVtkId idMap;
selector->GetIndex( actor->getIO(), idMap );
for ( int i = 1; i <= idMap.Extent(); i++ )
- myResult.push_back( idMap( i ) );
+ myResult.push_back( (int)idMap( i ) );
}
};
if ( !actor || !actor->hasIO() )
return;
- SVTK_IndexedMapOfIds idMap;
+ SVTK_IndexedMapOfVtkIds idMap;
selector->GetCompositeIndex( actor->getIO(), idMap );
for ( int i = 1; i <= idMap.Extent(); i++ ) {
myResult.push_back( std::make_pair( (int)idMap(i)[0], (int)idMap(i)[1]) );
- }
+ }
}
};
SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edge );
if ( !eSubMesh )
return false;
- int nbSeg = eSubMesh->NbElements();
+ smIdType nbSeg = eSubMesh->NbElements();
if ( nbSeg < 1 )
continue;
double segLen = L / nbSeg;
const double p1 = x0 * ( 1. - points[i+1]) + x1 * points[i+1];
const double length = p1 - p0;
- const size_t nbSections = 1000;
+ const int nbSections = 1000;
const double sectionLen = ( p1 - p0 ) / nbSections;
vector< double > nbSegments( nbSections + 1 );
nbSegments[ 0 ] = 0.;
double t, spacing = 0;
- for ( size_t i = 1; i <= nbSections; ++i )
+ for ( int i = 1; i <= nbSections; ++i )
{
t = double( i ) / nbSections;
if ( !fun.value( t, spacing ) || spacing < std::numeric_limits<double>::min() )
if ( coords.empty() ) coords.push_back( p0 );
- for ( size_t iCell = 1, i = 1; i <= nbSections; ++i )
+ for ( int iCell = 1, j = 1; j <= nbSections; ++j )
{
- if ( nbSegments[i]*corr >= iCell )
+ if ( nbSegments[j]*corr >= iCell )
{
- t = (i - ( nbSegments[i] - iCell/corr )/( nbSegments[i] - nbSegments[i-1] )) / nbSections;
+ t = (j - ( nbSegments[j] - iCell/corr )/( nbSegments[j] - nbSegments[j-1] )) / nbSections;
coords.push_back( p0 + t * length );
++iCell;
}
const double tol = minLen * 1e-3;
int iRem = -1;
if (( iF > 1 ) && ( coords[iF] - coords[iF-1] < tol ))
- iRem = iF-1;
+ iRem = (int) iF-1;
else if (( iF < coords.size()-2 ) && ( coords[iF+1] - coords[iF] < tol ))
- iRem = iF+1;
+ iRem = (int) iF+1;
if ( iRem > 0 )
coords.erase( coords.begin() + iRem );
}
};
vector< _nodeDef > _nodes;
- vector< int > _quantities;
+ vector< int > _quantities;
_volumeDef* _next; // to store several _volumeDefs in a chain
TGeomID _solidID;
const SMDS_MeshElement* _volume; // new volume
if ( loopsJoined )
{
// set unchanged polygons
- std::vector< int > newQuantities;
+ std::vector< int > newQuantities;
std::vector< _volumeDef::_nodeDef > newNodes;
vector< SMESH_Block::TShapeID > newNames;
newQuantities.reserve( volDef->_quantities.size() );
bool Contain( const TopoDS_Vertex& vertex ) const;
void AppendSide( const _FaceSide& side );
void SetBottomSide( int i );
- int GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges=0) const;
+ smIdType GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges=0) const;
bool StoreNodes(SMESH_ProxyMesh& mesh, vector<const SMDS_MeshNode*>& myGrid,
bool reverse, bool isProxy, const SMESHDS_SubMesh* smToCheckEdges=0 );
void SetID(EQuadSides id) { myID = id; }
lessComplexSide = & *face;
// Get an 1D size of lessComplexSide
- int nbSeg1 = 0;
+ smIdType nbSeg1 = 0;
vector<TopoDS_Edge> edges;
if ( !lessComplexSide->GetHoriEdges(edges) )
return false;
for ( size_t i = 0; i < edges.size(); ++i )
{
- const vector<int>& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )];
+ const vector<smIdType>& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )];
if ( !nbElems.empty() )
- nbSeg1 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
+ nbSeg1 += std::max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
}
// Get an 1D size of a box side orthogonal to lessComplexSide
- int nbSeg2 = 0;
+ smIdType nbSeg2 = 0;
_QuadFaceGrid* ortoSide =
lessComplexSide->FindAdjacentForSide( Q_LEFT, boxFaceContainer, B_UNDEFINED );
edges.clear();
if ( !ortoSide || !ortoSide->GetHoriEdges(edges) ) return false;
for ( size_t i = 0; i < edges.size(); ++i )
{
- const vector<int>& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )];
+ const vector<smIdType>& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )];
if ( !nbElems.empty() )
- nbSeg2 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
+ nbSeg2 += std::max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
}
// Get an 2D size of a box side orthogonal to lessComplexSide
- int nbFaces = 0, nbQuadFace = 0;
+ smIdType nbFaces = 0, nbQuadFace = 0;
list< TopoDS_Face > sideFaces;
if ( ortoSide->IsComplex() )
for ( _QuadFaceGrid::TChildIterator child = ortoSide->GetChildren(); child.more(); )
list< TopoDS_Face >::iterator f = sideFaces.begin();
for ( ; f != sideFaces.end(); ++f )
{
- const vector<int>& nbElems = aResMap[ theMesh.GetSubMesh( *f )];
+ const vector<smIdType>& nbElems = aResMap[ theMesh.GetSubMesh( *f )];
if ( !nbElems.empty() )
{
nbFaces = nbElems[ SMDSEntity_Quadrangle ];
}
// Fill nb of elements
- vector<int> aResVec(SMDSEntity_Last,0);
- int nbSeg3 = ( nbFaces + nbQuadFace ) / nbSeg2;
+ vector<smIdType> aResVec(SMDSEntity_Last,0);
+ smIdType nbSeg3 = ( nbFaces + nbQuadFace ) / nbSeg2;
aResVec[SMDSEntity_Node] = (nbSeg1-1) * (nbSeg2-1) * (nbSeg3-1);
aResVec[SMDSEntity_Hexa] = nbSeg1 * nbFaces;
aResVec[SMDSEntity_Quad_Hexa] = nbSeg1 * nbQuadFace;
//purpose :
//=======================================================================
-int _FaceSide::GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges) const
+smIdType _FaceSide::GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges) const
{
- int nb = 0;
+ smIdType nb = 0;
if ( myChildren.empty() )
{
nb = mesh.GetSubMesh(myEdge)->NbElements();
bool FunctionTable::findBounds( const double x, int& x_ind_1, int& x_ind_2 ) const
{
- int n = myData.size() / 2;
+ int n = (int) myData.size() / 2;
if( n==0 || x<myData[0] )
{
x_ind_1 = x_ind_2 = 0;
}
bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end,
- const int nbSeg, vector<double>& data, const double eps )
+ const smIdType nbSeg, vector<double>& data, const double eps )
{
FunctionExpr F( f.ToCString(), conv );
return buildDistribution( F, start, end, nbSeg, data, eps );
}
bool buildDistribution( const std::vector<double>& f, const int conv, const double start, const double end,
- const int nbSeg, vector<double>& data, const double eps )
+ const smIdType nbSeg, vector<double>& data, const double eps )
{
FunctionTable F( f, conv );
return buildDistribution( F, start, end, nbSeg, data, eps );
}
-bool buildDistribution( const Function& func, const double start, const double end, const int nbSeg,
- vector<double>& data, const double eps )
+bool buildDistribution( const Function& func, const double start, const double end,
+ const smIdType nbSeg, vector<double>& data, const double eps )
{
if( nbSeg<=0 )
return false;
data.resize( nbSeg+1 );
data[0] = start;
- double J = func.integral( start, end ) / nbSeg;
+ double J = func.integral( start, end ) / double( nbSeg );
if( J<1E-10 )
return false;
bool ok;
//MESSAGE( "distribution:" );
//char buf[1024];
- for( int i=1; i<nbSeg; i++ )
+ for( smIdType i = 1; i < nbSeg; i++ )
{
FunctionIntegral f_int( &func, data[i-1] );
data[i] = dihotomySolve( f_int, J, data[i-1], end, eps, ok );
#include <Expr_Array1OfNamedUnknown.hxx>
#include <TColStd_Array1OfReal.hxx>
+#include <smIdType.hxx>
+
namespace StdMeshers
{
class STDMESHERS_EXPORT Function
STDMESHERS_EXPORT
bool buildDistribution( const Function& f,
const double start, const double end,
- const int nbSeg,
+ const smIdType nbSeg,
std::vector<double>& data,
const double eps );
STDMESHERS_EXPORT
bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end,
- const int nbSeg, std::vector<double>& data, const double eps );
+ const smIdType nbSeg, std::vector<double>& data, const double eps );
STDMESHERS_EXPORT
bool buildDistribution( const std::vector<double>& f, const int conv, const double start, const double end,
- const int nbSeg, std::vector<double>& data, const double eps );
+ const smIdType nbSeg, std::vector<double>& data, const double eps );
}
#endif
if ( mesh->HasModificationsToDiscard() ) // check nb of nodes on the EDGE sub-mesh
{
int iQuad = sm->NbElements() ? sm->GetElements()->next()->IsQuadratic() : 0;
- int nbExpect = sm->NbElements() - 1 + iQuad * sm->NbElements();
+ smIdType nbExpect = sm->NbElements() - 1 + iQuad * sm->NbElements();
if ( nbExpect != sm->NbNodes() ) // some nodes are moved from the EDGE by MergeNodes()
{
// add nodes of all segments
// since creation of this side
//=======================================================================
-int StdMeshers_FaceSide::NbPoints(const bool update) const
+smIdType StdMeshers_FaceSide::NbPoints(const bool update) const
{
if ( !myPoints.empty() )
return myPoints.size();
// since creation of this side
//=======================================================================
-int StdMeshers_FaceSide::NbSegments(const bool update) const
+smIdType StdMeshers_FaceSide::NbSegments(const bool update) const
{
return NbPoints( update ), myNbSegments;
}
* Call it with update == true if mesh of this side can be recomputed
* since creation of this side
*/
- int NbPoints(const bool update = false) const;
+ smIdType NbPoints(const bool update = false) const;
/*!
* \brief Return nb edges
* Call it with update == true if mesh of this side can be recomputed
* since creation of this side
*/
- int NbSegments(const bool update = false) const;
+ smIdType NbSegments(const bool update = false) const;
/*!
* \brief Return mesh
*/
/*!
* \brief Return nb of wrapped edges
*/
- int NbEdges() const { return myEdge.size(); }
+ int NbEdges() const { return (int)myEdge.size(); }
/*!
* \brief Return i-th edge (count starts from zero)
*/
std::vector<double> myEdgeLength;
std::vector<int> myIsUniform;
double myLength;
- int myNbPonits, myNbSegments;
+ smIdType myNbPonits, myNbSegments;
SMESH_ProxyMesh::Ptr myProxyMesh;
bool myMissingVertexNodes, myIgnoreMediumNodes;
gp_Pnt2d myDefaultPnt2d;
inline int StdMeshers_FaceSide::EdgeIndex( double U ) const
{
- int i = myNormPar.size() - 1;
+ int i = (int)myNormPar.size() - 1;
while ( i > 0 && U < myNormPar[ i-1 ] ) --i;
return i;
}
void StdMeshers_FixedPoints1D::SetPoints(const std::vector<double>& listParams)
{
- _params = listParams;
- NotifySubMeshesHypothesisModification();
+ if ( _params != listParams )
+ {
+ _params = listParams;
+ NotifySubMeshesHypothesisModification();
+ }
}
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
-void StdMeshers_FixedPoints1D::SetNbSegments(const std::vector<int>& listNbSeg)
+void StdMeshers_FixedPoints1D::SetNbSegments(const std::vector<smIdType>& listNbSeg)
{
- _nbsegs = listNbSeg;
- NotifySubMeshesHypothesisModification();
+ if ( _nbsegs != listNbSeg )
+ {
+ _nbsegs = listNbSeg;
+ NotifySubMeshesHypothesisModification();
+ }
}
ostream & StdMeshers_FixedPoints1D::SaveTo(ostream & save)
istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load)
{
bool isOK = true;
- int intVal;
+ smIdType intVal;
double dblVal;
isOK = static_cast<bool>(load >> intVal);
#ifndef _SMESH_FIXEDPOINTS1D_HXX_
#define _SMESH_FIXEDPOINTS1D_HXX_
-
-
#include "SMESH_StdMeshers.hxx"
#include "StdMeshers_Reversible1D.hxx"
#include "SMESH_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx"
+#include <smIdType.hxx>
#include <vector>
void SetPoints(const std::vector<double>& listParams);
- void SetNbSegments(const std::vector<int>& listNbSeg) ;
+ void SetNbSegments(const std::vector<smIdType>& listNbSeg) ;
const std::vector<double>& GetPoints() const { return _params; }
- const std::vector<int>& GetNbSegments() const { return _nbsegs; }
+ const std::vector<smIdType>& GetNbSegments() const { return _nbsegs; }
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
*/
virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
-protected:
- std::vector<double> _params;
- std::vector<int> _nbsegs;
+ protected:
+ std::vector<double> _params;
+ std::vector<smIdType> _nbsegs;
};
#endif
// Find all block sides starting from mesh faces sharing the corner node
// --------------------------------------------------------------------
- int nbFacesOnSides = 0;
+ smIdType nbFacesOnSides = 0;
TIDSortedElemSet cornerFaces; // corner faces of found _BlockSide's
list< const SMDS_MeshNode* > corners( 1, nCorner );
list< const SMDS_MeshNode* >::iterator corner = corners.begin();
bool secondOrder = aMesh.NbFaces( ORDER_QUADRATIC );
int entity = secondOrder ? SMDSEntity_Quad_Hexa : SMDSEntity_Hexa;
- vector<int>& nbByType = aResMap[ aMesh.GetSubMesh( aShape )];
+ vector<smIdType>& nbByType = aResMap[ aMesh.GetSubMesh( aShape )];
if ( entity >= (int) nbByType.size() )
nbByType.resize( SMDSEntity_Last, 0 );
// check if the loaded grid corresponds to nb of quadrangles on the FACE
const SMESHDS_SubMesh* faceSubMesh =
proxymesh ? proxymesh->GetSubMesh( F ) : meshDS->MeshElements( F );
- const int nbQuads = faceSubMesh->NbElements();
+ const smIdType nbQuads = faceSubMesh->NbElements();
const int nbHor = aCubeSide[i]._u2nodesMap.size() - 1;
const int nbVer = aCubeSide[i]._u2nodesMap.begin()->second.size() - 1;
ok = ( nbQuads == nbHor * nbVer );
TopoDS_Shape aFace = aFaces.Value(i+1);
SMESH_Algo *algo = _gen->GetAlgo(aMesh, aFace);
if( !algo ) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
if (algoName == "Quadrangle_2D") {
MapShapeNbElemsItr anIt = aResMap.find(meshFaces[i]);
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
if( nbtri == 0 )
isAllQuad = true;
}
if( sm ) {
MapShapeNbElemsItr anIt = aResMap.find(sm);
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
if(IsFirst) {
IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
IsFirst = false;
if( i == OppNum ) continue;
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] );
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[0] );
- std::vector<int> aVec = (*anIt).second;
- int nb2d_face0 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
- int nb0d_face0 = aVec[SMDSEntity_Node];
+ std::vector<smIdType> aVec = (*anIt).second;
+ smIdType nb2d_face0 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ smIdType nb0d_face0 = aVec[SMDSEntity_Node];
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(IsQuadratic) {
aResVec[SMDSEntity_Quad_Hexa] = nb2d_face0 * ( nb2d/nb1d );
- int nb1d_face0_int = ( nb2d_face0*4 - nb1d ) / 2;
+ smIdType nb1d_face0_int = ( nb2d_face0*4 - nb1d ) / 2;
aResVec[SMDSEntity_Node] = nb0d_face0 * ( 2*nb2d/nb1d - 1 ) - nb1d_face0_int * nb2d/nb1d;
}
else {
if ( srcGroups.empty() )
return error("Invalid source groups");
- vector<int> aVec(SMDSEntity_Last,0);
+ vector<smIdType> aVec(SMDSEntity_Last,0);
bool toCopyMesh, toCopyGroups;
_sourceHyp->GetCopySourceMesh(toCopyMesh, toCopyGroups);
if ( srcGroups.empty() )
return error("Invalid source groups");
- vector<int> aVec(SMDSEntity_Last,0);
+ vector<smIdType> aVec(SMDSEntity_Last,0);
bool toCopyMesh, toCopyGroups;
_sourceHyp->GetCopySourceMesh(toCopyMesh, toCopyGroups);
{
TopoDS_Edge geomEdge = TopoDS::Edge( exp.Current() );
SMESH_subMesh* sm = theMesh.GetSubMesh( geomEdge );
- vector<int>& edgeVec = aResMap[sm];
+ vector<smIdType>& edgeVec = aResMap[sm];
if ( edgeVec.empty() )
{
edgeVec.resize(SMDSEntity_Last,0);
TopoDS_Edge E = TopoDS::Edge(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find( aMesh.GetSubMesh(E) );
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
int nbe = Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
NbSeg += nbe;
if(IsFirst) {
}
}
if(NbSeg<1) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
(int)( anArea/(tmpLength*tmpLength*sqrt(3.)/4) );
int nbNodes = (int) ( nbFaces*3 - (NbSeg-1)*2 ) / 6;
- std::vector<int> aVec(SMDSEntity_Last);
+ std::vector<smIdType> aVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
if(IsQuadratic) {
aVec[SMDSEntity_Quad_Triangle] = nbFaces;
*/
//=============================================================================
-void StdMeshers_NumberOfSegments::SetNumberOfSegments(int segmentsNumber)
+void StdMeshers_NumberOfSegments::SetNumberOfSegments(smIdType segmentsNumber)
{
- int oldNumberOfSegments = _numberOfSegments;
+ smIdType oldNumberOfSegments = _numberOfSegments;
if (segmentsNumber <= 0)
throw SALOME_Exception(LOCALIZED("number of segments must be positive"));
_numberOfSegments = segmentsNumber;
*/
//=============================================================================
-int StdMeshers_NumberOfSegments::GetNumberOfSegments() const
+smIdType StdMeshers_NumberOfSegments::GetNumberOfSegments() const
{
return _numberOfSegments;
}
ostream & StdMeshers_NumberOfSegments::SaveTo(ostream & save)
{
- int listSize = _edgeIDs.size();
+ size_t listSize = _edgeIDs.size();
save << _numberOfSegments << " " << (int)_distrType;
switch (_distrType)
{
if ( _distrType != DT_Regular && listSize > 0 ) {
save << " " << listSize;
- for ( int i = 0; i < listSize; i++ )
+ for ( size_t i = 0; i < listSize; i++ )
save << " " << _edgeIDs[i];
save << " " << _objEntry;
}
#include "SMESH_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx"
+#include <smIdType.hxx>
+
#include <vector>
/*!
* \brief Set the number of segments
* \param segmentsNumber - must be greater than zero
*/
- void SetNumberOfSegments(int segmentsNumber);
+ void SetNumberOfSegments(smIdType segmentsNumber);
/*!
* \brief Get the number of segments
*/
- int GetNumberOfSegments() const;
+ smIdType GetNumberOfSegments() const;
/*!
* \brief This enumeration presents available types of distribution
friend std::istream& operator >> (std::istream & load, StdMeshers_NumberOfSegments & hyp);
protected:
- int _numberOfSegments; //!< an edge will be split on to this number of segments
+ smIdType _numberOfSegments; //!< an edge will be split on to this number of segments
DistrType _distrType; //!< the type of distribution of density function
double _scaleFactor; //!< the scale parameter for DT_Scale
std::vector<double> _table, _distr; //!< the table for DT_TabFunc, a sequence of pairs of numbers
void StdMeshers_Penta_3D::MakeNodes()
{
const int aNbSIDs=9;
- int i, j, k, ij, iNbN, aNodeID, aSize, iErr;
+ int i, j, k, ij, aSize, iErr;
+ smIdType iNbN, aNodeID;
double aX, aY, aZ;
SMESH_Block::TShapeID aSID, aSIDs[aNbSIDs]={
SMESH_Block::ID_V000, SMESH_Block::ID_V100,
}
//
// 2. Make pentahedrons
- int aID0, k , aJ[4];
+ smIdType aID0;
+ int k , aJ[4];
vector<const SMDS_MeshNode*> aN;
//
SMDS_ElemIteratorPtr itf, aItNodes;
//=======================================================================
void StdMeshers_Penta_3D::MakeMeshOnFxy1()
{
- int aID0, aJ, aLevel, ij, aNbNodes, k;
+ int aJ, aLevel, ij, k;
+ smIdType aID0, aNbNodes;
//
SMDS_NodeIteratorPtr itn;
SMDS_ElemIteratorPtr itf, aItNodes;
int iNbF = aM.Extent();
if (iNbF == 6) {
//
- int nb_f1 = pMesh->GetSubMeshContaining(aM(1))->GetSubMeshDS()->NbElements();
- int nb_f2 = pMesh->GetSubMeshContaining(aM(2))->GetSubMeshDS()->NbElements();
- int nb_f3 = pMesh->GetSubMeshContaining(aM(3))->GetSubMeshDS()->NbElements();
- int nb_f4 = pMesh->GetSubMeshContaining(aM(4))->GetSubMeshDS()->NbElements();
- int nb_f5 = pMesh->GetSubMeshContaining(aM(5))->GetSubMeshDS()->NbElements();
- int nb_f6 = pMesh->GetSubMeshContaining(aM(6))->GetSubMeshDS()->NbElements();
+ smIdType nb_f1 = pMesh->GetSubMeshContaining(aM(1))->GetSubMeshDS()->NbElements();
+ smIdType nb_f2 = pMesh->GetSubMeshContaining(aM(2))->GetSubMeshDS()->NbElements();
+ smIdType nb_f3 = pMesh->GetSubMeshContaining(aM(3))->GetSubMeshDS()->NbElements();
+ smIdType nb_f4 = pMesh->GetSubMeshContaining(aM(4))->GetSubMeshDS()->NbElements();
+ smIdType nb_f5 = pMesh->GetSubMeshContaining(aM(5))->GetSubMeshDS()->NbElements();
+ smIdType nb_f6 = pMesh->GetSubMeshContaining(aM(6))->GetSubMeshDS()->NbElements();
//
int has_only_quad_f1 = 1;
int has_only_quad_f2 = 1;
int iNbE = aE.Extent();
if (iNbE == 12) {
//
- int nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements();
- int nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements();
- int nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements();
- int nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements();
- int nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements();
- int nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements();
- int nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements();
- int nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements();
- int nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements();
- int nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements();
- int nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements();
- int nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements();
+ smIdType nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements();
+ smIdType nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements();
+ smIdType nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements();
+ smIdType nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements();
+ smIdType nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements();
+ smIdType nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements();
+ smIdType nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements();
+ smIdType nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements();
+ smIdType nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements();
+ smIdType nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements();
+ smIdType nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements();
+ smIdType nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements();
//
int nb_ok = 0 ;
//
if ( sm1->NbNodes() * smb->NbNodes() != smFace->NbNodes() ) {
// check quadratic case
if ( myCreateQuadratic ) {
- int n1 = sm1->NbNodes()/2;
- int n2 = smb->NbNodes()/2;
- int n3 = sm1->NbNodes() - n1;
- int n4 = smb->NbNodes() - n2;
- int nf = sm1->NbNodes()*smb->NbNodes() - n3*n4;
+ smIdType n1 = sm1->NbNodes()/2;
+ smIdType n2 = smb->NbNodes()/2;
+ smIdType n3 = sm1->NbNodes() - n1;
+ smIdType n4 = smb->NbNodes() - n2;
+ smIdType nf = sm1->NbNodes()*smb->NbNodes() - n3*n4;
if( nf != smFace->NbNodes() ) {
MESSAGE( "Wrong nb face nodes: " <<
sm1->NbNodes()<<" "<<smb->NbNodes()<<" "<<smFace->NbNodes());
}
}
// IJ size
- int vsize = sm1->NbNodes() + 2;
- int hsize = smb->NbNodes() + 2;
+ smIdType vsize = sm1->NbNodes() + 2;
+ smIdType hsize = smb->NbNodes() + 2;
if(myCreateQuadratic) {
vsize = vsize - sm1->NbNodes()/2 -1;
hsize = hsize - smb->NbNodes()/2 -1;
NumBase = 0;
break;
}
- std::vector<int> aVec = (*anIt).second;
- int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
- int nbqua = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
+ smIdType nbqua = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
if( nbtri>0 && nbqua==0 ) {
NumBase = i;
}
}
if(NumBase==0) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
if( sm ) {
MapShapeNbElemsItr anIt = aResMap.find(sm);
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
}
}
// find face opposite to base face
if( i==OppNum || i==NumBase ) continue;
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] );
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] );
- std::vector<int> aVec = (*anIt).second;
- int nb2d_face0 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
- int nb0d_face0 = aVec[SMDSEntity_Node];
+ std::vector<smIdType> aVec = (*anIt).second;
+ smIdType nb2d_face0 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ smIdType nb0d_face0 = aVec[SMDSEntity_Node];
anIt = aResMap.find( meshFaces[OppNum-1] );
for(i=SMDSEntity_Node; i<SMDSEntity_Last; i++)
SMESH_MesherHelper aTool (aMesh);
bool _quadraticMesh = aTool.IsQuadraticSubMesh(aShape);
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(_quadraticMesh) {
aResVec[SMDSEntity_Quad_Penta] = nb2d_face0 * ( nb2d/nb1d );
nbQuadSegs += sm2vec->second.at( SMDSEntity_Quad_Edge );
}
- std::vector<int> aVec( SMDSEntity_Last, 0 );
+ std::vector<smIdType> aVec( SMDSEntity_Last, 0 );
switch ( nbLinSegs + nbQuadSegs ) {
case 3:
aVec[ nbQuadSegs ? SMDSEntity_Quad_Triangle : SMDSEntity_Triangle ] = 1;
case TopAbs_FACE:
{
myFaceMesher->Evaluate( theMesh, shape, theResMap );
- std::vector<int> & quantities = theResMap[ sm ];
+ std::vector<smIdType> & quantities = theResMap[ sm ];
_quadraticMesh = ( !quantities.empty() &&
( quantities[ SMDSEntity_Quad_Triangle ] +
quantities[ SMDSEntity_Quad_Quadrangle ] +
case TopAbs_SOLID:
{
- std::vector<int> & quantities = theResMap[ sm ];
+ std::vector<smIdType> & quantities = theResMap[ sm ];
quantities.resize( SMDSEntity_Last, 0 );
SMESH_MesherHelper helper( theMesh );
{
SMESH_subMesh* faceSm = *smIt;
SMESHDS_SubMesh* faceSmDS = faceSm->GetSubMeshDS();
- int nbQuads = faceSmDS ? faceSmDS->NbElements() : 0;
+ smIdType nbQuads = faceSmDS ? faceSmDS->NbElements() : 0;
bool toRemove;
if ( nbQuads > 0 )
toRemove = helper->IsStructured( faceSm );
SMESH_subMesh* faceSM = theMesh.GetSubMesh( face );
if ( !faceSM->IsEmpty() )
{
- int nbFaces = faceSM->GetSubMeshDS()->NbElements();
+ smIdType nbFaces = faceSM->GetSubMeshDS()->NbElements();
if ( prevNbFaces < nbFaces )
{
if ( !meshedFaces.empty() ) meshedFaces.pop_back();
}
// assure that all the source (left) EDGEs are meshed
- int nbSrcSegments = 0;
+ smIdType nbSrcSegments = 0;
for ( int i = 0; i < lftSide->NbEdges(); ++i )
{
if ( isArtificialQuad )
if( anIt==aResMap.end() )
return toSM( error( "Submesh can not be evaluated"));
- std::vector<int> aVec = (*anIt).second;
- int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
- int nbqua = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
+ smIdType nbqua = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
if( nbtri==0 && nbqua>0 ) {
NbQFs++;
}
}
if(NbQFs<4) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
aResMap.insert(std::make_pair(sm,aResVec));
if(NumBase==0) NumBase = 1; // only quads => set 1 faces as base
// find number of 1d elems for base face
- int nb1d = 0;
+ smIdType nb1d = 0;
TopTools_MapOfShape Edges1;
for (TopExp_Explorer exp(aFaces.Value(NumBase), TopAbs_EDGE); exp.More(); exp.Next()) {
Edges1.Add(exp.Current());
if( sm ) {
MapShapeNbElemsItr anIt = aResMap.find(sm);
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
}
}
// find face opposite to base face
}
}
// find number of 2d elems on side faces
- int nb2d = 0;
+ smIdType nb2d = 0;
for(i=1; i<=6; i++) {
if( i==OppNum || i==NumBase ) continue;
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] );
if( anIt == aResMap.end() ) continue;
- std::vector<int> aVec = (*anIt).second;
- nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ std::vector<smIdType> aVec = (*anIt).second;
+ nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] );
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
bool IsQuadratic = (aVec[SMDSEntity_Quad_Triangle]>aVec[SMDSEntity_Triangle]) ||
(aVec[SMDSEntity_Quad_Quadrangle]>aVec[SMDSEntity_Quadrangle]);
- int nb2d_face0_3 = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
- int nb2d_face0_4 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
- int nb0d_face0 = aVec[SMDSEntity_Node];
- int nb1d_face0_int = ( nb2d_face0_3*3 + nb2d_face0_4*4 - nb1d ) / 2;
+ smIdType nb2d_face0_3 = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
+ smIdType nb2d_face0_4 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ smIdType nb0d_face0 = aVec[SMDSEntity_Node];
+ smIdType nb1d_face0_int = ( nb2d_face0_3*3 + nb2d_face0_4*4 - nb1d ) / 2;
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(IsQuadratic) {
aResVec[SMDSEntity_Quad_Penta] = nb2d_face0_3 * ( nb2d/nb1d );
// Fill myBotToColumnMap
- int zSize = myBlock.VerticalSize();
+ size_t zSize = myBlock.VerticalSize();
TNodeNodeMap::const_iterator bN_tN = n2nMapPtr->begin();
for ( ; bN_tN != n2nMapPtr->end(); ++bN_tN )
{
// Fill myBotToColumnMap
- int zSize = myBlock.VerticalSize();
+ size_t zSize = myBlock.VerticalSize();
Prism_3D::TNode prevTNode;
SMDS_NodeIteratorPtr nIt = botSMDS->GetNodes();
while ( nIt->more() )
return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ")
<< "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face ));
}
- if ( !faceColumns.empty() && (int)faceColumns.begin()->second.size() != VerticalSize() )
+ if ( !faceColumns.empty() && faceColumns.begin()->second.size() != VerticalSize() )
return error(COMPERR_BAD_INPUT_MESH, "Different 'vertical' discretization");
// edge columns
const Prism_3D::TPrismTopo& prism) const
{
const bool itTopMeshed = !SubMesh( ID_BOT_FACE )->IsEmpty();
- const int zSize = VerticalSize();
+ const size_t zSize = VerticalSize();
if ( zSize < 3 && !itTopMeshed ) return true;
trsf.resize( zSize - 1 );
gp_Ax3 cs0 = getLayerCoordSys(0, columns, xCol );
//double dist0 = cs0.Location().Distance( gpXYZ( (*columns[0])[0]));
toCs0.SetTransformation( cs0 );
- for ( int z = 1; z < zSize; ++z )
+ for ( size_t z = 1; z < zSize; ++z )
{
gp_Ax3 csZ = getLayerCoordSys(z, columns, xCol );
//double distZ = csZ.Location().Distance( gpXYZ( (*columns[0])[z]));
int botTriaNodes[3], topTriaNodes[3];
bool checkUV = true;
- int nbInternalNodes = myIntColumns.size();
+ size_t nbInternalNodes = myIntColumns.size();
myBotDelaunay->InitTraversal( nbInternalNodes );
while (( botNode = myBotDelaunay->NextNode( botBC, botTriaNodes )))
TopBotTriangles tbTrias;
bool checkUV = true;
- int nbInternalNodes = myIntColumns.size();
+ size_t nbInternalNodes = myIntColumns.size();
myTopBotTriangles.resize( nbInternalNodes );
myBotDelaunay->InitTraversal( nbInternalNodes );
* \brief Return number of nodes on every vertical edge
* \retval int - number of nodes including end nodes
*/
- int VerticalSize() const { return myParam2ColumnMaps[0].begin()->second.size(); }
+ size_t VerticalSize() const { return myParam2ColumnMaps[0].begin()->second.size(); }
bool HasNotQuadElemOnTop() const { return myNotQuadOnTop; }
const SMDS_MeshNode *srcNode, *tgtNode;
// un-mark internal src nodes in order iterate them using _delaunay
- int nbSrcNodes = 0;
+ smIdType nbSrcNodes = 0;
SMDS_NodeIteratorPtr nIt = _srcSubMesh->GetSubMeshDS()->GetNodes();
if ( !nIt || !nIt->more() ) return true;
if ( moveAll )
int nbNodes = params.size();
- std::vector<int> aVec(SMDSEntity_Last);
+ std::vector<smIdType> aVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
aVec[SMDSEntity_Node] = nbNodes;
TopAbs_ShapeEnum shapeType = srcSM->GetSubShape().ShapeType();
if ( shapeType == TopAbs_EDGE )
{
- std::vector<int> aVec;
+ std::vector<smIdType> aVec;
SMESHDS_SubMesh* srcSubMeshDS = srcSM->GetSubMeshDS();
if ( srcSubMeshDS && srcSubMeshDS->NbElements() )
{
tgtNbEW.front() != 4 || srcNbEW.front() != 4 )
return; // not quads
- int srcNbSeg[4];
+ smIdType srcNbSeg[4];
list< TopoDS_Edge >::iterator edgeS = srcEdges.begin(), edgeT = tgtEdges.begin();
for ( int i = 0; edgeS != srcEdges.end(); ++i, ++edgeS )
if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( *edgeS ))
// compare nb nodes on srcEdge1 and srcEdge2
if ( srcEdge2 != srcEdges.end() )
{
- int nbN1 = 0, nbN2 = 0;
+ smIdType nbN1 = 0, nbN2 = 0;
if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( srcEdge1 ))
nbN1 = sm->NbNodes();
if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( *srcEdge2 ))
// Merge
SMESH_MeshEditor editor( tgtMesh );
- int nbFaceBeforeMerge = tgtSubMesh->GetSubMeshDS()->NbElements();
+ smIdType nbFaceBeforeMerge = tgtSubMesh->GetSubMeshDS()->NbElements();
editor.MergeNodes( groupsOfNodes );
- int nbFaceAtferMerge = tgtSubMesh->GetSubMeshDS()->NbElements();
+ smIdType nbFaceAtferMerge = tgtSubMesh->GetSubMeshDS()->NbElements();
if ( nbFaceBeforeMerge != nbFaceAtferMerge && !helper.HasDegeneratedEdges() )
return error(COMPERR_BAD_INPUT_MESH, "Probably invalid node parameters on geom faces");
// Assure that mesh on a source Face is computed/evaluated
// -------------------------------------------------------
- std::vector<int> aVec;
+ std::vector<smIdType> aVec;
SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcFace );
if ( srcSubMesh->IsMeshComputed() )
return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
- std::vector<int> aVec(SMDSEntity_Last);
+ std::vector<smIdType> aVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
aVec[SMDSEntity_Node] = srcSubMesh->GetSubMeshDS()->NbNodes();
if ( isComputed[ edgeIDs1[i]] &&
isComputed[ edgeIDs2[i]] )
{
- int nbNodes1 = meshDS->MeshElements(edgeIDs[ edgeIDs1[i]] )->NbNodes();
- int nbNodes2 = meshDS->MeshElements(edgeIDs[ edgeIDs2[i]] )->NbNodes();
+ smIdType nbNodes1 = meshDS->MeshElements(edgeIDs[ edgeIDs1[i]] )->NbNodes();
+ smIdType nbNodes2 = meshDS->MeshElements(edgeIDs[ edgeIDs2[i]] )->NbNodes();
if ( nbNodes1 != nbNodes2 )
return false;
if (( int(i)-1 >= 0 ) &&
std::vector<int> aNbNodes(4);
bool IsQuadratic = false;
if (!checkNbEdgesForEvaluate(aMesh, aFace, aResMap, aNbNodes, IsQuadratic)) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for (int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aFace);
aResMap.insert(std::make_pair(sm,aResVec));
//int nbFaces4 = (nbhoriz-1-kdh)*(nbvertic-1-kdv);
int nbFaces4 = (nbhoriz-1)*(nbvertic-1);
- std::vector<int> aVec(SMDSEntity_Last,0);
+ std::vector<smIdType> aVec(SMDSEntity_Last,0);
if (IsQuadratic) {
aVec[SMDSEntity_Quad_Triangle] = nbFaces3;
aVec[SMDSEntity_Quad_Quadrangle] = nbFaces4;
if ( theConsiderMesh )
{
- const int nbSegments = Max( faceSide.NbPoints()-1, faceSide.NbSegments() );
+ const smIdType nbSegments = std::max( faceSide.NbPoints()-1, faceSide.NbSegments() );
if ( nbSegments < nbCorners )
return error(COMPERR_BAD_INPUT_MESH, TComm("Too few boundary nodes: ") << nbSegments);
}
if (anIt==aResMap.end()) {
return false;
}
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
if (nbEdgesInWire.front() == 3) { // exactly 3 edges
if (myTriaVertexID>0) {
SMESH_subMesh * sm = aMesh.GetSubMesh(E1);
MapShapeNbElemsItr anIt = aResMap.find(sm);
if (anIt==aResMap.end()) return false;
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
if (IsQuadratic)
aNbNodes[0] = (aVec[SMDSEntity_Node]-1)/2 + 2;
else
if (anIt==aResMap.end()) {
return false;
}
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
if (IsQuadratic)
aNbNodes[nbSides] = (aVec[SMDSEntity_Node]-1)/2 + 2;
else
if (anIt==aResMap.end()) {
return false;
}
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
if (IsQuadratic)
aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1;
else
if (anIt==aResMap.end()) {
return false;
}
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
if (IsQuadratic)
aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1;
else
nbFaces += (drl+addv)*(nb-1) + (nt-1);
} // end new version implementation
- std::vector<int> aVec(SMDSEntity_Last);
+ std::vector<smIdType> aVec(SMDSEntity_Last);
for (int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i] = 0;
if (IsQuadratic) {
aVec[SMDSEntity_Quad_Quadrangle] = nbFaces;
if ( !outerShell.IsSame( It.Value() ))
innerShell = It.Value();
if ( nbShells != 2 ) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
if ( !ProjectionUtils::FindSubShapeAssociation( outerShell, &aMesh,
innerShell, &aMesh,
shape2ShapeMap) ) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
//FacesOut.Append(exp.Current());
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
nb0d_Out += aVec[SMDSEntity_Node];
- nb2d_3_Out += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
- nb2d_4_Out += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ nb2d_3_Out += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
+ nb2d_4_Out += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
- int nb1d_Out = 0;
+ smIdType nb1d_Out = 0;
TopTools_MapOfShape tmpMap;
for (TopExp_Explorer exp(outerShell, TopAbs_EDGE); exp.More(); exp.Next()) {
if( tmpMap.Contains( exp.Current() ) )
tmpMap.Add( exp.Current() );
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
nb0d_Out += aVec[SMDSEntity_Node];
- nb1d_Out += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+ nb1d_Out += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
}
tmpMap.Clear();
for (TopExp_Explorer exp(outerShell, TopAbs_VERTEX); exp.More(); exp.Next()) {
}
// get info for inner shell
- int nb0d_In=0, nb2d_3_In=0, nb2d_4_In=0;
+ smIdType nb0d_In=0, nb2d_3_In=0, nb2d_4_In=0;
//TopTools_SequenceOfShape FacesIn;
for (TopExp_Explorer exp(innerShell, TopAbs_FACE); exp.More(); exp.Next()) {
//FacesIn.Append(exp.Current());
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
nb0d_In += aVec[SMDSEntity_Node];
- nb2d_3_In += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
- nb2d_4_In += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+ nb2d_3_In += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
+ nb2d_4_In += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
}
- int nb1d_In = 0;
+ smIdType nb1d_In = 0;
tmpMap.Clear();
bool IsQuadratic = false;
bool IsFirst = true;
tmpMap.Add( exp.Current() );
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
- std::vector<int> aVec = (*anIt).second;
+ std::vector<smIdType> aVec = (*anIt).second;
nb0d_In += aVec[SMDSEntity_Node];
- nb1d_In += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+ nb1d_In += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
if(IsFirst) {
IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
IsFirst = false;
bool IsOK = (nb0d_Out==nb0d_In) && (nb1d_Out==nb1d_In) &&
(nb2d_3_Out==nb2d_3_In) && (nb2d_4_Out==nb2d_4_In);
if(!IsOK) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
}
if ( myDistributionHypo ) {
if ( !myDistributionHypo->GetLayerDistribution() ) {
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
nbLayers = myLayerPositions.size() + 1;
}
- std::vector<int> aResVec(SMDSEntity_Last);
+ std::vector<smIdType> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(IsQuadratic) {
aResVec[SMDSEntity_Quad_Penta] = nb2d_3_Out * nbLayers;
aResVec[SMDSEntity_Quad_Hexa] = nb2d_4_Out * nbLayers;
- int nb1d = ( nb2d_3_Out*3 + nb2d_4_Out*4 ) / 2;
+ smIdType nb1d = ( nb2d_3_Out*3 + nb2d_4_Out*4 ) / 2;
aResVec[SMDSEntity_Node] = nb0d_Out * ( 2*nbLayers - 1 ) - nb1d * nbLayers;
}
else {
if( aResMap.count(sm) )
return false;
- vector<int>& aResVec =
- aResMap.insert( make_pair(sm, vector<int>(SMDSEntity_Last,0))).first->second;
+ vector<smIdType>& aResVec =
+ aResMap.insert( make_pair(sm, vector<smIdType>(SMDSEntity_Last,0))).first->second;
myHelper = new SMESH_MesherHelper( aMesh );
myHelper->SetSubShape( aShape );
for ( TopExp_Explorer edge( aShape, TopAbs_EDGE ); edge.More() && !isQuadratic ; edge.Next() )
{
sm = aMesh.GetSubMesh( edge.Current() );
- vector<int>& nbElems = aResMap[ sm ];
+ vector<smIdType>& nbElems = aResMap[ sm ];
if ( SMDSEntity_Quad_Edge < (int) nbElems.size() )
isQuadratic = nbElems[ SMDSEntity_Quad_Edge ];
}
- int nbCircSegments = 0;
+ smIdType nbCircSegments = 0;
for ( int iE = 0; iE < circSide->NbEdges(); ++iE )
{
sm = aMesh.GetSubMesh( circSide->Edge( iE ));
- vector<int>& nbElems = aResMap[ sm ];
+ vector<smIdType>& nbElems = aResMap[ sm ];
if ( SMDSEntity_Quad_Edge < (int) nbElems.size() )
nbCircSegments += ( nbElems[ SMDSEntity_Edge ] + nbElems[ SMDSEntity_Quad_Edge ]);
}
- int nbQuads = nbCircSegments * ( layerPositions.size() - 1 );
- int nbTria = nbCircSegments;
- int nbNodes = ( nbCircSegments - 1 ) * ( layerPositions.size() - 2 );
+ smIdType nbQuads = nbCircSegments * ( layerPositions.size() - 1 );
+ smIdType nbTria = nbCircSegments;
+ smIdType nbNodes = ( nbCircSegments - 1 ) * ( layerPositions.size() - 2 );
if ( isQuadratic )
{
nbNodes += (( nbCircSegments - 1 ) * ( layerPositions.size() - 1 ) + // radial
if ( linSide1 )
{
// evaluation for linSides
- vector<int> aResVec(SMDSEntity_Last, 0);
+ vector<smIdType> aResVec(SMDSEntity_Last, 0);
if ( isQuadratic ) {
aResVec[SMDSEntity_Node ] = 2 * ( layerPositions.size() - 1 ) + 1;
aResVec[SMDSEntity_Quad_Edge] = layerPositions.size() - 1;
static bool computeParamByFunc(Adaptor3d_Curve& C3d,
double first, double last, double length,
- bool theReverse, int nbSeg, Function& func,
+ bool theReverse, smIdType nbSeg, Function& func,
list<double>& theParams)
{
// never do this way
if ( nbSeg <= 0 )
return false;
- int nbPnt = 1 + nbSeg;
+ smIdType nbPnt = 1 + nbSeg;
vector<double> x( nbPnt, 0. );
- const double eps = Min( 1E-4, 1./nbSeg/100. );
+ const double eps = Min( 1E-4, 0.01 / double( nbSeg ));
if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, eps ))
return false;
sign = -1.;
}
- for ( int i = 1; i < nbSeg; i++ )
+ for ( smIdType i = 1; i < nbSeg; i++ )
{
double curvLength = length * (x[i] - x[i-1]) * sign;
double tol = Min( Precision::Confusion(), curvLength / 100. );
list<double> & theParams,
bool adjustNeighbors2an = false)
{
- int i, nPar = theParams.size();
+ smIdType i, nPar = theParams.size();
if ( a1 + an <= length && nPar > 1 )
{
bool reverse = ( U1 > Un );
}
else
{
- double q = dUn / ( nPar - 1 );
+ double q = dUn / double( nPar - 1 );
theParams.back() += dUn;
double sign = reverse ? -1 : 1;
double prevU = theParams.back();
return 0;
}
+//================================================================================
+/*!
+ * \brief Divide a curve into equal segments
+ */
+//================================================================================
+
+bool StdMeshers_Regular_1D::divideIntoEqualSegments( SMESH_Mesh & theMesh,
+ Adaptor3d_Curve & theC3d,
+ smIdType theNbPoints,
+ double theTol,
+ double theLength,
+ double theFirstU,
+ double theLastU,
+ std::list<double> & theParameters )
+{
+ bool ok = false;
+ if ( theNbPoints < IntegerLast() )
+ {
+ int nbPnt = FromIdType<int>( theNbPoints );
+ GCPnts_UniformAbscissa discret(theC3d, nbPnt, theFirstU, theLastU, theTol );
+ if ( !discret.IsDone() )
+ return error( "GCPnts_UniformAbscissa failed");
+ if ( discret.NbPoints() < nbPnt )
+ discret.Initialize(theC3d, nbPnt + 1, theFirstU, theLastU, theTol );
+
+ int nbPoints = Min( discret.NbPoints(), nbPnt );
+ for ( int i = 2; i < nbPoints; i++ ) // skip 1st and last points
+ {
+ double param = discret.Parameter(i);
+ theParameters.push_back( param );
+ }
+ ok = true;
+ }
+ else // huge nb segments
+ {
+ // use FIXED_POINTS_1D method
+ StdMeshers_FixedPoints1D fixedPointsHyp( GetGen()->GetANewId(), GetGen() );
+ _fpHyp = &fixedPointsHyp;
+ std::vector<double> params = { 0., 1. };
+ std::vector<smIdType> nbSegs = { theNbPoints - 1 };
+ fixedPointsHyp.SetPoints( params );
+ fixedPointsHyp.SetNbSegments( nbSegs );
+
+ HypothesisType curType = _hypType;
+ _hypType = FIXED_POINTS_1D;
+
+ ok = computeInternalParameters( theMesh, theC3d, theLength, theFirstU, theLastU,
+ theParameters, /*reverse=*/false );
+ _hypType = curType;
+ _fpHyp = 0;
+ }
+ return ok;
+}
+
//================================================================================
/*!
* \brief Tune parameters to fit "SegmentLengthAroundVertex" hypothesis
- * \param theC3d - wire curve
- * \param theLength - curve length
- * \param theParameters - internal nodes parameters to modify
- * \param theVf - 1st vertex
- * \param theVl - 2nd vertex
+ * \param theC3d - wire curve
+ * \param theLength - curve length
+ * \param theParameters - internal nodes parameters to modify
+ * \param theVf - 1st vertex
+ * \param theVl - 2nd vertex
*/
//================================================================================
const TopoDS_Vertex & theVl)
{
double f = theC3d.FirstParameter(), l = theC3d.LastParameter();
- int nPar = theParameters.size();
+ size_t nPar = theParameters.size();
for ( int isEnd1 = 0; isEnd1 < 2; ++isEnd1 )
{
const TopoDS_Vertex & V = isEnd1 ? theVf : theVl;
{
// recompute params between the last segment and a middle one.
// find size of a middle segment
- int nHalf = ( nPar-1 ) / 2;
+ smIdType nHalf = ( nPar-1 ) / 2;
list< double >::reverse_iterator itU = theParameters.rbegin();
std::advance( itU, nHalf );
double Um = *itU++;
size_t dSeg = theReverse ? -1 : +1;
double param = theFirstU;
size_t nbParams = 0;
- for ( int i = 0, nb = segLen.size()-1; i < nb; ++i, iSeg += dSeg )
+ for ( size_t i = 1; i < segLen.size(); ++i, iSeg += dSeg )
{
double tol = Min( Precision::Confusion(), 0.01 * segLen[ iSeg ]);
GCPnts_AbscissaPoint Discret( tol, theC3d, segLen[ iSeg ], param );
case NB_SEGMENTS:
{
double eltSize = 1;
- int nbSegments;
+ smIdType nbSegments;
if ( _hypType == MAX_LENGTH )
{
double nbseg = ceil(theLength / _value[ BEG_LENGTH_IND ]); // integer sup
if (nbseg <= 0)
nbseg = 1; // degenerated edge
eltSize = theLength / nbseg * ( 1. - 1e-9 );
- nbSegments = (int) nbseg;
+ nbSegments = ToIdType( nbseg );
}
else if ( _hypType == LOCAL_LENGTH )
{
}
if (computed) {
SMESHDS_SubMesh* smds = sm->GetSubMeshDS();
- int nb_segments = smds->NbElements();
+ smIdType nb_segments = smds->NbElements();
if (nbseg - 1 <= nb_segments && nb_segments <= nbseg + 1) {
isFound = true;
- nbseg = nb_segments;
+ nbseg = FromIdType<double>( nb_segments );
}
}
}
if (nbseg <= 0)
nbseg = 1; // degenerated edge
eltSize = theLength / nbseg;
- nbSegments = (int) nbseg;
+ nbSegments = ToIdType( nbseg );
}
else
{
if (fabs(scale - 1.0) < Precision::Confusion()) {
// special case to avoid division by zero
- for (int i = 1; i < nbSegments; i++) {
- double param = f + (l - f) * i / nbSegments;
+ for ( smIdType i = 1; i < nbSegments; i++) {
+ double param = f + (l - f) * double( i ) / double( nbSegments );
theParams.push_back( param );
}
- } else {
- // general case of scale distribution
+ }
+ else { // general case of scale distribution
if ( theReverse )
scale = 1.0 / scale;
- double alpha = pow(scale, 1.0 / (nbSegments - 1));
+ double alpha = pow(scale, 1.0 / double( nbSegments - 1 ));
double factor = (l - f) / (1.0 - pow(alpha, nbSegments));
- for (int i = 1; i < nbSegments; i++) {
+ for ( smIdType i = 1; i < nbSegments; i++) {
double param = f + factor * (1.0 - pow(alpha, i));
theParams.push_back( param );
}
break;
case StdMeshers_NumberOfSegments::DT_TabFunc:
{
- FunctionTable func(_vvalue[ TAB_FUNC_IND ], _ivalue[ CONV_MODE_IND ]);
+ FunctionTable func(_vvalue[ TAB_FUNC_IND ], FromIdType<int>( _ivalue[ CONV_MODE_IND ]));
return computeParamByFunc(theC3d, f, l, theLength, theReverse,
_ivalue[ NB_SEGMENTS_IND ], func,
theParams);
break;
case StdMeshers_NumberOfSegments::DT_ExprFunc:
{
- FunctionExpr func(_svalue[ EXPR_FUNC_IND ].c_str(), _ivalue[ CONV_MODE_IND ]);
+ FunctionExpr func(_svalue[ EXPR_FUNC_IND ].c_str(),
+ FromIdType<int>( _ivalue[ CONV_MODE_IND ]));
return computeParamByFunc(theC3d, f, l, theLength, theReverse,
_ivalue[ NB_SEGMENTS_IND ], func,
theParams);
}
break;
case StdMeshers_NumberOfSegments::DT_Regular:
- eltSize = theLength / nbSegments;
+ eltSize = theLength / double( nbSegments );
break;
default:
return false;
}
double tol = Min( Precision::Confusion(), 0.01 * eltSize );
- GCPnts_UniformAbscissa Discret(theC3d, nbSegments + 1, f, l, tol );
- if ( !Discret.IsDone() )
- return error( "GCPnts_UniformAbscissa failed");
- if ( Discret.NbPoints() < nbSegments + 1 )
- Discret.Initialize(theC3d, nbSegments + 2, f, l, tol );
+ divideIntoEqualSegments( theMesh, theC3d, nbSegments + 1, tol,
+ theLength, theFirstU, theLastU, theParams );
- int NbPoints = Min( Discret.NbPoints(), nbSegments + 1 );
- for ( int i = 2; i < NbPoints; i++ ) // skip 1st and last points
- {
- double param = Discret.Parameter(i);
- theParams.push_back( param );
- }
compensateError( eltSize, eltSize, f, l, theLength, theC3d, theParams, true ); // for PAL9899
return true;
}
case FIXED_POINTS_1D:
{
const std::vector<double>& aPnts = _fpHyp->GetPoints();
- std::vector<int> nbsegs = _fpHyp->GetNbSegments();
+ std::vector<smIdType> nbsegs = _fpHyp->GetNbSegments();
// sort normalized params, taking into account theReverse
TColStd_SequenceOfReal Params;
- double tol = 1e-7 / theLength; // GCPnts_UniformAbscissa allows u2-u1 > 1e-7
+ double tol = 1e-7;
for ( size_t i = 0; i < aPnts.size(); i++ )
{
if( aPnts[i] < tol || aPnts[i] > 1 - tol )
double u = theReverse ? ( 1 - aPnts[i] ) : aPnts[i];
int j = 1;
bool IsExist = false;
- for ( ; j <= Params.Length(); j++ ) {
- if ( Abs( u - Params.Value(j) ) < tol ) {
- IsExist = true;
- break;
- }
+ for ( ; j <= Params.Length() && !IsExist; j++ )
+ {
+ IsExist = ( Abs( u - Params.Value(j) ) < tol );
if ( u < Params.Value(j) ) break;
}
if ( !IsExist ) Params.InsertBefore( j, u );
}
+ Params.InsertBefore( 1, 0.0 );
+ Params.Append( 1.0 );
+
+ if ( theReverse )
+ {
+ if ((int) nbsegs.size() > Params.Length() - 1 )
+ nbsegs.resize( Params.Length() - 1 );
+ std::reverse( nbsegs.begin(), nbsegs.end() );
+ }
+ if ( nbsegs.empty() )
+ {
+ nbsegs.push_back( 1 );
+ }
+ if ((int) nbsegs.size() < Params.Length() - 1 )
+ nbsegs.resize( Params.Length() - 1, nbsegs[0] );
+
+ // care of huge nbsegs - additionally divide diapasons
+ for ( int i = 2; i <= Params.Length(); i++ )
+ {
+ smIdType nbTot = nbsegs[ i-2 ];
+ if ( nbTot <= IntegerLast() )
+ continue;
+ smIdType nbDiapason = nbTot / IntegerLast() + 1;
+ smIdType nbSegPerDiap = nbTot / nbDiapason;
+ double par0 = Params( i - 1 ), par1 = Params( i );
+ for ( smIdType iDiap = 0; iDiap < nbDiapason - 1; ++iDiap )
+ {
+ double r = double( nbSegPerDiap * ( iDiap + 1 )) / double( nbTot );
+ double parI = par0 + ( par1 - par0 ) * r;
+ Params.InsertBefore( i, parI );
+ auto it = nbsegs.begin();
+ smIdType incr_it = i - 2 + iDiap;
+ nbsegs.insert( it + incr_it, nbSegPerDiap );
+ }
+ nbsegs[ i-2 + nbDiapason - 1 ] = nbSegPerDiap + nbTot % nbDiapason;
+ }
// transform normalized Params into real ones
- std::vector< double > uVec( Params.Length() + 2 );
+ std::vector< double > uVec( Params.Length() );
uVec[ 0 ] = theFirstU;
double abscissa;
- for ( int i = 1; i <= Params.Length(); i++ )
+ for ( int i = 2; i < Params.Length(); i++ )
{
abscissa = Params( i ) * theLength;
tol = Min( Precision::Confusion(), 0.01 * abscissa );
GCPnts_AbscissaPoint APnt( tol, theC3d, abscissa, theFirstU );
if ( !APnt.IsDone() )
return error( "GCPnts_AbscissaPoint failed");
- uVec[ i ] = APnt.Parameter();
+ uVec[ i-1 ] = APnt.Parameter();
}
uVec.back() = theLastU;
// divide segments
- if ( theReverse )
- {
- if ((int) nbsegs.size() > Params.Length() + 1 )
- nbsegs.resize( Params.Length() + 1 );
- std::reverse( nbsegs.begin(), nbsegs.end() );
- }
- if ( nbsegs.empty() )
- {
- nbsegs.push_back( 1 );
- }
- Params.InsertBefore( 1, 0.0 );
- Params.Append( 1.0 );
double eltSize, segmentSize, par1, par2;
- for ( size_t i = 0; i < uVec.size()-1; i++ )
+ for ( int i = 0; i < (int)uVec.size()-1; i++ )
{
par1 = uVec[ i ];
par2 = uVec[ i+1 ];
- int nbseg = ( i < nbsegs.size() ) ? nbsegs[i] : nbsegs[0];
- if ( nbseg == 1 )
- {
- theParams.push_back( par2 );
- }
- else
+ smIdType nbseg = ( i < (int) nbsegs.size() ) ? nbsegs[i] : nbsegs[0];
+ if ( nbseg > 1 )
{
segmentSize = ( Params( i+2 ) - Params( i+1 )) * theLength;
- eltSize = segmentSize / nbseg;
+ eltSize = segmentSize / double( nbseg );
tol = Min( Precision::Confusion(), 0.01 * eltSize );
- GCPnts_UniformAbscissa Discret( theC3d, eltSize, par1, par2, tol );
- if ( !Discret.IsDone() )
- return error( "GCPnts_UniformAbscissa failed");
- if ( Discret.NbPoints() < nbseg + 1 ) {
- eltSize = segmentSize / ( nbseg + 0.5 );
- Discret.Initialize( theC3d, eltSize, par1, par2, tol );
- }
- int NbPoints = Discret.NbPoints();
- for ( int i = 2; i <= NbPoints; i++ ) {
- double param = Discret.Parameter(i);
- theParams.push_back( param );
- }
+ if ( !divideIntoEqualSegments( theMesh, theC3d, nbseg + 1, tol,
+ segmentSize, par1, par2, theParams ))
+ return false;
}
+ theParams.push_back( par2 );
}
theParams.pop_back();
ASSERT(!VFirst.IsNull());
ASSERT(!VLast.IsNull());
- std::vector<int> aVec(SMDSEntity_Last,0);
+ std::vector<smIdType> aVec(SMDSEntity_Last,0);
double length = EdgeLength( E );
if ( !Curve.IsNull() && length > 0 )
if (nbHyp == 0) // nothing propagated nor assigned to aShape
{
SMESH_Algo::GetUsedHypothesis( aMesh, aShape, ignoreAuxiliary );
- nbHyp = _usedHypList.size();
+ nbHyp = (int)_usedHypList.size();
}
else
{
double theLength,
std::list< double > & theParameters,
const TopoDS_Vertex & theVf,
- const TopoDS_Vertex & theVl);
+ const TopoDS_Vertex & thieve);
+
+ bool divideIntoEqualSegments( SMESH_Mesh & theMesh,
+ Adaptor3d_Curve & theC3d,
+ smIdType theNbPoints,
+ double theTol,
+ double theLength,
+ double theFirstU,
+ double theLastU,
+ std::list<double> & theParameters );
/*!
* \brief Return StdMeshers_SegmentLengthAroundVertex assigned to vertex
const StdMeshers_FixedPoints1D* _fpHyp;
const StdMeshers_Adaptive1D* _adaptiveHyp;
- double _value[2];
- int _ivalue[3];
+ double _value [2];
+ smIdType _ivalue[3];
std::vector<double> _vvalue[1];
std::string _svalue[1];
std::vector<int> _revEdgesIDs;
{
points.reserve( _boundarySize );
size_t nb = _boundary.rbegin()->_nodes.size();
- int lastID = _boundary.rbegin()->Node( nb - 1 )->GetID();
+ smIdType lastID = _boundary.rbegin()->Node( nb - 1 )->GetID();
std::list< BndPart >::const_iterator part = _boundary.begin();
for ( ; part != _boundary.end(); ++part )
{
GeomAdaptor_Curve aCurve(C, f,l);
const double totLen = GCPnts_AbscissaPoint::Length(aCurve, f, l);
- int nbExpectNodes = eSubMesh->NbNodes();
+ smIdType nbExpectNodes = eSubMesh->NbNodes();
_initU .reserve( nbExpectNodes );
_normPar.reserve( nbExpectNodes );
_nodes .reserve( nbExpectNodes );
#include <gp_Ax1.hxx>
#include <gp_Vec.hxx>
#include <gp_XY.hxx>
+#include <smIdType.hxx>
#include <list>
#include <string>
{
_EdgeSubMesh(const SMDS_Mesh* mesh, int index=0): SubMesh(mesh,index) {}
//virtual int NbElements() const { return _elements.size()+1; }
- virtual int NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); }
+ virtual smIdType NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); }
void SetUVPtStructVec(UVPtStructVec& vec) { _uvPtStructVec.swap( vec ); }
UVPtStructVec& GetUVPtStructVec() { return _uvPtStructVec; }
};
return idx >= 0 && idx < myListWidget->count() ? myListWidget->item( idx )->data( Qt::UserRole ).toDouble() : 0.;
}
-void StdMeshersGUI_FixedPointsParamWdg::setNbSegments( int idx, int val )
+void StdMeshersGUI_FixedPointsParamWdg::setNbSegments( int idx, SMESH::smIdType val )
{
- if ( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ) {
- myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, val );
+ if ( idx >= 0 && idx < myTreeWidget->topLevelItemCount() )
+ {
+ myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, FromIdType<int>( val ));
myTreeWidget->topLevelItem( idx )->setText( 1, idx > 0 && mySameValues->isChecked() ? QString( SAME_TEXT ) : QString::number( val ) );
}
}
-int StdMeshersGUI_FixedPointsParamWdg::nbSegments( int idx ) const
+smIdType StdMeshersGUI_FixedPointsParamWdg::nbSegments( int idx ) const
{
- return idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toInt() : 1;
+ return ToIdType( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toInt() : 1 );
}
//=================================================================================
// function : GetListOfSegments
// purpose : Called to get the list Number of Segments
//=================================================================================
-SMESH::long_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfSegments()
+SMESH::smIdType_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfSegments()
{
- SMESH::long_array_var anArray = new SMESH::long_array;
+ SMESH::smIdType_array_var anArray = new SMESH::smIdType_array;
int size = mySameValues->isChecked() ? 1 : myTreeWidget->topLevelItemCount();
anArray->length( size );
for (int i = 0; i < size; i++) {
// function : SetListOfPoints
// purpose : Called to set the list of Points
//=================================================================================
-void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::long_array_var theSegments)
+void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::smIdType_array_var theSegments)
{
if ( myListWidget->count() > 0 && theSegments->length() == 1)
mySameValues->setChecked(true);
#include <SMESHGUI.h>
#include "SMESH_StdMeshersGUI.hxx"
+#include <smIdType.hxx>
+
// Qt includes
#include <QWidget>
#include <QStringList>
SMESH::double_array_var GetListOfPoints();
void SetListOfPoints( SMESH::double_array_var );
- SMESH::long_array_var GetListOfSegments();
- void SetListOfSegments( SMESH::long_array_var );
+ SMESH::smIdType_array_var GetListOfSegments();
+ void SetListOfSegments( SMESH::smIdType_array_var );
QString GetValue() const { return myParamValue; }
void addPoint( double );
void removePoints();
double point( int ) const;
- void setNbSegments( int, int );
- int nbSegments( int ) const;
+ void setNbSegments( int, SMESH::smIdType );
+ smIdType nbSegments( int ) const;
static QTreeWidgetItem* newTreeItem( double v1, double v2 );
static QListWidgetItem* newListItem( double v1 );
void SetObjects(SMESH::string_array_var& objEntries);
template<class TInterface>
- typename TInterface::_var_type GetObject(unsigned i=0) const {
+ typename TInterface::_var_type GetObject(size_t i=0) const {
if ( IsObjectSelected(i) ) return TInterface::_narrow(myObjects[i]);
return TInterface::_nil();
}
- int NbObjects() const { return myObjects.size(); }
+ size_t NbObjects() const { return myObjects.size(); }
QString GetValue() const { return myParamValue; }
- bool IsObjectSelected(unsigned i=0) const
+ bool IsObjectSelected(size_t i=0) const
{ return i < myObjects.size() && !CORBA::is_nil(myObjects[i]); }
/*!
GEOM::ListOfGO_var shapes;
SMESH::nodes_array_var points;
h->GetEnforcedNodes( shapes, points );
- for ( size_t i = 0; i < shapes->length(); ++i )
+ for ( CORBA::ULong i = 0; i < shapes->length(); ++i )
{
CORBA::String_var name = shapes[i]->GetName();
CORBA::String_var entry = shapes[i]->GetStudyEntry();
item->setData( Qt::UserRole, entry.in() );
myShapesList->addItem( item );
}
- for ( size_t i = 0; i < points->length(); ++i )
+ for ( CORBA::ULong i = 0; i < points->length(); ++i )
{
QTreeWidgetItem* item = new QTreeWidgetItem
( QStringList()
*/
//=============================================================================
-void StdMeshers_FixedPoints1D_i::SetNbSegments(const SMESH::long_array& listNbSeg)
-
+void StdMeshers_FixedPoints1D_i::SetNbSegments(const SMESH::smIdType_array& listNbSeg)
+
{
ASSERT( myBaseImpl );
try {
- std::vector<int> nbsegs( listNbSeg.length() );
- CORBA::Long iEnd = listNbSeg.length();
- for ( CORBA::Long i = 0; i < iEnd; i++ )
+ std::vector<smIdType> nbsegs( listNbSeg.length() );
+ CORBA::ULong iEnd = listNbSeg.length();
+ for ( CORBA::ULong i = 0; i < iEnd; i++ )
nbsegs[ i ] = listNbSeg[ i ];
this->GetImpl()->SetNbSegments( nbsegs );
}
ASSERT( myBaseImpl );
SMESH::double_array_var anArray = new SMESH::double_array;
std::vector<double> params = this->GetImpl()->GetPoints();
- anArray->length( params.size() );
+ anArray->length( static_cast<CORBA::ULong>( params.size() ));
for ( CORBA::ULong i = 0; i < params.size(); i++)
anArray [ i ] = params [ i ];
*/
//=============================================================================
-SMESH::long_array* StdMeshers_FixedPoints1D_i::GetNbSegments()
+SMESH::smIdType_array* StdMeshers_FixedPoints1D_i::GetNbSegments()
{
ASSERT( myBaseImpl );
- SMESH::long_array_var anArray = new SMESH::long_array;
- std::vector<int> nbsegs = this->GetImpl()->GetNbSegments();
- anArray->length( nbsegs.size() );
+ SMESH::smIdType_array_var anArray = new SMESH::smIdType_array;
+ std::vector<smIdType> nbsegs = this->GetImpl()->GetNbSegments();
+ anArray->length( static_cast<CORBA::ULong>( nbsegs.size() ));
for ( CORBA::ULong i = 0; i < nbsegs.size(); i++)
anArray [ i ] = nbsegs [ i ];
// create list of reversed edges if it is needed) and sets numbers
// of segments between given points (default values are equals 1)
void SetPoints(const SMESH::double_array& listParams);
- void SetNbSegments(const SMESH::long_array& listNbSeg);
+ void SetNbSegments(const SMESH::smIdType_array& listNbSeg);
// Returns list of point's parameters
SMESH::double_array* GetPoints();
// Returns list of numbers of segments
- SMESH::long_array* GetNbSegments();
+ SMESH::smIdType_array* GetNbSegments();
// Get implementation
::StdMeshers_FixedPoints1D* GetImpl();
*/
//=============================================================================
-void StdMeshers_NumberOfSegments_i::SetNumberOfSegments( CORBA::Long theSegmentsNumber )
+void StdMeshers_NumberOfSegments_i::SetNumberOfSegments( SMESH::smIdType theSegmentsNumber )
{
ASSERT( myBaseImpl );
try {
SMESH::double_array* BuildDistributionTab( const SMESH::double_array&, CORBA::Long, CORBA::Long );
// Set number of segments
- void SetNumberOfSegments( CORBA::Long theSegmentsNumber );
+ void SetNumberOfSegments( SMESH::smIdType theSegmentsNumber );
// Get number of segments
CORBA::Long GetNumberOfSegments();