change header

This commit is contained in:
eap 2021-02-09 14:52:53 +03:00
parent 72a751fef5
commit e0662f4678
31 changed files with 204 additions and 195 deletions

View File

@ -386,8 +386,8 @@ 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 );
/*!

View File

@ -62,7 +62,7 @@ module SMESH
/*!
* Returns the number of elements in the group
*/
long Size();
smIdType Size();
/*!
* Returns true if the group does not contain any elements

View File

@ -127,7 +127,7 @@ namespace {
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;
@ -225,7 +225,7 @@ void NumericalFunctor::SetMesh( const SMDS_Mesh* theMesh )
myMesh = theMesh;
}
bool NumericalFunctor::GetPoints(const int theId,
bool NumericalFunctor::GetPoints(const smIdType theId,
TSequenceOfXYZ& theRes ) const
{
theRes.clear();
@ -322,12 +322,12 @@ bool NumericalFunctor::IsApplicable( long theElementId ) const
*/
//================================================================================
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 ||
@ -346,7 +346,7 @@ void NumericalFunctor::GetHistogram(int nbIntervals,
}
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 ));
}
@ -1871,7 +1871,7 @@ void Length2D::GetValues(TValues& theValues)
{
// 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;
@ -1908,7 +1908,7 @@ void Length2D::GetValues(TValues& theValues)
}
else {
SMDS_NodeIteratorPtr aNodesIter = anElem->nodeIterator();
long aNodeId[2] = {0,0};
smIdType aNodeId[2] = {0,0};
gp_Pnt P[3];
double aLength;
@ -1923,7 +1923,7 @@ void Length2D::GetValues(TValues& theValues)
for( ; aNodesIter->more(); )
{
aNode = aNodesIter->next();
long anId = aNode->GetID();
smIdType anId = aNode->GetID();
P[2] = SMESH_NodeXYZ( aNode );
@ -2092,7 +2092,7 @@ double MultiConnection2D::GetValue( long theElementId )
if (!anIter) break;
const SMDS_MeshNode *aNode, *aNode0 = 0;
TColStd_MapOfInteger aMap, aMapPrev;
NCollection_Map< smIdType > aMap, aMapPrev;
for (i = 0; i <= len; i++) {
aMapPrev = aMap;
@ -2468,7 +2468,7 @@ void CoincidentNodes::SetMesh( const SMDS_Mesh* theMesh )
std::list< const SMDS_MeshNode*>& coincNodes = *groupIt;
std::list< const SMDS_MeshNode*>::iterator n = coincNodes.begin();
for ( ; n != coincNodes.end(); ++n )
myCoincidentIDs.Add( FromIdType<int>((*n)->GetID()) );
myCoincidentIDs.Add( (*n)->GetID() );
}
}
}
@ -2575,14 +2575,14 @@ void FreeEdges::SetMesh( const SMDS_Mesh* theMesh )
myMesh = theMesh;
}
bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId )
bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId )
{
SMDS_ElemIteratorPtr anElemIter = theNodes[ 0 ]->GetInverseElementIterator(SMDSAbs_Face);
while( anElemIter->more() )
{
if ( const SMDS_MeshElement* anElem = anElemIter->next())
{
const int anId = FromIdType<int>(anElem->GetID());
const smIdType anId = anElem->GetID();
if ( anId != theFaceId && anElem->GetNodeIndex( theNodes[1] ) >= 0 )
return false;
}
@ -3084,7 +3084,7 @@ void ConnectedElements::SetPoint( double x, double y, double z )
if ( !foundElems.empty() )
{
myNodeID = FromIdType<int>(foundElems[0]->GetNode(0)->GetID());
myNodeID = foundElems[0]->GetNode(0)->GetID();
if ( myOkIDsReady && !myMeshModifTracer.IsMeshModified() )
isSameDomain = IsSatisfy( foundElems[0]->GetID() );
}
@ -3106,7 +3106,7 @@ bool ConnectedElements::IsSatisfy( long theElementId )
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:
@ -3124,14 +3124,14 @@ bool ConnectedElements::IsSatisfy( long theElementId )
// keep elements of myType
const SMDS_MeshElement* element = eIt->next();
if ( myType == SMDSAbs_All || element->GetType() == myType )
myOkIDs.insert( myOkIDs.end(), FromIdType<int>(element->GetID()) );
myOkIDs.insert( myOkIDs.end(), element->GetID() );
// enqueue nodes of the element
SMDS_ElemIteratorPtr nIt = element->nodesIterator();
while ( nIt->more() )
{
const SMDS_MeshNode* n = static_cast< const SMDS_MeshNode* >( nIt->next() );
if ( checkedNodeIDs.insert( FromIdType<int>(n->GetID()) ).second )
if ( checkedNodeIDs.insert( n->GetID()) )
nodeQueue.push_back( n );
}
}
@ -3217,7 +3217,7 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
gp_Vec norm = getNormale( static_cast<const SMDS_MeshFace*>(f), &normOK );
if (!normOK || isLessAngle( myNorm, norm, cosTol))
{
myCoplanarIDs.Add( FromIdType<int>(f->GetID()) );
myCoplanarIDs.Add( f->GetID() );
faceQueue.push_back( std::make_pair( f, norm ));
}
}
@ -3817,7 +3817,7 @@ bool ManifoldPart::process()
// 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
@ -3830,18 +3830,18 @@ bool ManifoldPart::process()
// as result next time when fi will be equal to aStartIndx
SMDS_MeshFace* aFacePtr = myAllFacePtr[ fi ];
if ( aMapOfTreated.Contains( FromIdType<int>(aFacePtr->GetID()) ) )
if ( aMapOfTreated.Contains( aFacePtr->GetID()) )
continue;
aMapOfTreated.Add( FromIdType<int>(aFacePtr->GetID()) );
TColStd_MapOfInteger aResFaces;
aMapOfTreated.Add( aFacePtr->GetID() );
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 );
}
@ -3877,7 +3877,7 @@ bool ManifoldPart::findConnected
( const ManifoldPart::TDataMapFacePtrInt& theAllFacePtrInt,
SMDS_MeshFace* theStartFace,
ManifoldPart::TMapOfLink& theNonManifold,
TColStd_MapOfInteger& theResFaces )
TIDsMap& theResFaces )
{
theResFaces.Clear();
if ( !theAllFacePtrInt.size() )
@ -3885,13 +3885,13 @@ bool ManifoldPart::findConnected
if ( getNormale( theStartFace ).SquareModulus() <= gp::Resolution() )
{
myMapBadGeomIds.Add( FromIdType<int>(theStartFace->GetID()) );
myMapBadGeomIds.Add( theStartFace->GetID() );
return false;
}
ManifoldPart::TMapOfLink aMapOfBoundary, aMapToSkip;
ManifoldPart::TVectorOfLink aSeqOfBoundary;
theResFaces.Add( FromIdType<int>(theStartFace->GetID()) );
theResFaces.Add( theStartFace->GetID() );
ManifoldPart::TDataMapOfLinkFacePtr aDMapLinkFace;
expandBoundary( aMapOfBoundary, aSeqOfBoundary,
@ -3945,7 +3945,7 @@ bool ManifoldPart::findConnected
SMDS_MeshFace* aNextFace = *pFace;
if ( aPrevFace == aNextFace )
continue;
int anNextFaceID = FromIdType<int>(aNextFace->GetID());
smIdType anNextFaceID = aNextFace->GetID();
if ( myIsOnlyManifold && theResFaces.Contains( anNextFaceID ) )
// should not be with non manifold restriction. probably bad topology
continue;
@ -3973,7 +3973,7 @@ bool ManifoldPart::isInPlane( const SMDS_MeshFace* theFace1,
gp_XYZ aNorm2XYZ = getNormale( theFace2 );
if ( aNorm2XYZ.SquareModulus() <= gp::Resolution() )
{
myMapBadGeomIds.Add( FromIdType<int>(theFace2->GetID()) );
myMapBadGeomIds.Add( theFace2->GetID() );
return false;
}
if ( aNorm1.IsParallel( gp_Dir( aNorm2XYZ ), myAngToler ) )
@ -4176,7 +4176,9 @@ void ElementsOnSurface::process()
if ( !myMeshModifTracer.GetMesh() )
return;
myIds.ReSize( FromIdType<int>(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(); )
@ -4197,7 +4199,7 @@ void ElementsOnSurface::process( const SMDS_MeshElement* theElemPtr )
}
}
if ( isSatisfy )
myIds.Add( FromIdType<int>(theElemPtr->GetID()) );
myIds.Add( heElemPtr->GetID() );
}
bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode )

View File

@ -32,8 +32,8 @@
#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>
@ -58,6 +58,8 @@ class ShapeAnalysis_Surface;
class gp_Pln;
class gp_Pnt;
typedef NCollection_Map< smIdType > TIDsMap;
namespace SMESH{
namespace Controls{
@ -130,12 +132,12 @@ namespace SMESH{
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;
@ -144,7 +146,7 @@ namespace SMESH{
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;
@ -423,9 +425,9 @@ namespace SMESH{
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;
@ -591,7 +593,7 @@ namespace SMESH{
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;
@ -650,9 +652,9 @@ namespace SMESH{
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;
};
@ -833,7 +835,7 @@ namespace SMESH{
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,
@ -847,8 +849,8 @@ namespace SMESH{
private:
const SMDS_Mesh* myMesh;
TColStd_MapOfInteger myMapIds;
TColStd_MapOfInteger myMapBadGeomIds;
TIDsMap myMapIds;
TIDsMap myMapBadGeomIds;
TVectorOfFacePtr myAllFacePtr;
TDataMapFacePtrInt myAllFacePtrIntDMap;
double myAngToler;
@ -909,7 +911,7 @@ namespace SMESH{
private:
TMeshModifTracer myMeshModifTracer;
TColStd_MapOfInteger myIds;
TIDsMap myIds;
SMDSAbs_ElementType myType;
TopoDS_Face mySurf;
double myToler;
@ -1149,7 +1151,7 @@ namespace SMESH{
TMeshModifTracer myMeshModifTracer;
long myFaceID;
double myToler;
TColStd_MapOfInteger myCoplanarIDs;
TIDsMap myCoplanarIDs;
};
typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
@ -1176,14 +1178,14 @@ namespace SMESH{
//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;

View File

@ -539,7 +539,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
const EBooleen theIsElemNames = eFAUX;
const EConnectivite theConnMode = eNOD;
TInt aNbNodes = FromIdType<int>(myMesh->NbNodes());
TInt aNbNodes = FromIdType<TInt>( myMesh->NbNodes() );
PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes,
theMode, theSystem, theIsElemNum, theIsElemNames);
@ -625,66 +625,66 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eBALL,
FromIdType<int>(nbElemInfo.NbBalls()),
FromIdType<TInt>(nbElemInfo.NbBalls()),
SMDSAbs_Ball));
#ifdef _ELEMENTS_BY_DIM_
anEntity = eARETE;
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eSEG2,
FromIdType<int>(nbElemInfo.NbEdges( ORDER_LINEAR )),
FromIdType<TInt>(nbElemInfo.NbEdges( ORDER_LINEAR )),
SMDSAbs_Edge));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eSEG3,
FromIdType<int>(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,
FromIdType<int>(nbElemInfo.NbTriangles( ORDER_LINEAR )),
FromIdType<TInt>(nbElemInfo.NbTriangles( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA6,
FromIdType<int>(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
FromIdType<TInt>(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
nbElemInfo.NbBiQuadTriangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA7,
FromIdType<int>(nbElemInfo.NbBiQuadTriangles()),
FromIdType<TInt>(nbElemInfo.NbBiQuadTriangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD4,
FromIdType<int>(nbElemInfo.NbQuadrangles( ORDER_LINEAR )),
FromIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD8,
FromIdType<int>(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
FromIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
nbElemInfo.NbBiQuadQuadrangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD9,
FromIdType<int>(nbElemInfo.NbBiQuadQuadrangles()),
FromIdType<TInt>(nbElemInfo.NbBiQuadQuadrangles()),
SMDSAbs_Face));
if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE,
FromIdType<int>(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,
FromIdType<int>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2,
FromIdType<int>(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,
FromIdType<int>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
SMDSAbs_Face));
}
#ifdef _ELEMENTS_BY_DIM_
@ -692,58 +692,58 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTETRA4,
FromIdType<int>(nbElemInfo.NbTetras( ORDER_LINEAR )),
FromIdType<TInt>(nbElemInfo.NbTetras( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTETRA10,
FromIdType<int>(nbElemInfo.NbTetras( ORDER_QUADRATIC )),
FromIdType<TInt>(nbElemInfo.NbTetras( ORDER_QUADRATIC )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePYRA5,
FromIdType<int>(nbElemInfo.NbPyramids( ORDER_LINEAR )),
FromIdType<TInt>(nbElemInfo.NbPyramids( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePYRA13,
FromIdType<int>(nbElemInfo.NbPyramids( ORDER_QUADRATIC )),
FromIdType<TInt>(nbElemInfo.NbPyramids( ORDER_QUADRATIC )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA6,
FromIdType<int>(nbElemInfo.NbPrisms( ORDER_LINEAR )),
FromIdType<TInt>(nbElemInfo.NbPrisms( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA15,
FromIdType<int>(nbElemInfo.NbQuadPrisms()),
FromIdType<TInt>(nbElemInfo.NbQuadPrisms()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA18,
FromIdType<int>(nbElemInfo.NbBiQuadPrisms()),
FromIdType<TInt>(nbElemInfo.NbBiQuadPrisms()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA8,
FromIdType<int>(nbElemInfo.NbHexas( ORDER_LINEAR )),
FromIdType<TInt>(nbElemInfo.NbHexas( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA20,
FromIdType<int>(nbElemInfo.NbHexas( ORDER_QUADRATIC )-
FromIdType<TInt>(nbElemInfo.NbHexas( ORDER_QUADRATIC )-
nbElemInfo.NbTriQuadHexas()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA27,
FromIdType<int>(nbElemInfo.NbTriQuadHexas()),
FromIdType<TInt>(nbElemInfo.NbTriQuadHexas()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eOCTA12,
FromIdType<int>(nbElemInfo.NbHexPrisms()),
FromIdType<TInt>(nbElemInfo.NbHexPrisms()),
SMDSAbs_Volume));
if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYEDRE,
FromIdType<int>(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,
FromIdType<int>(nbElemInfo.NbPolyhedrons()),
FromIdType<TInt>(nbElemInfo.NbPolyhedrons()),
SMDSAbs_Volume));
}
@ -822,13 +822,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
for(TInt iNode = 0; iNode < aNbNodes; iNode++) {
const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
#ifdef _EDF_NODE_IDS_
aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<int>(aNode->GetID())];
aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
#else
aTConnSlice[ iNode ] = aNode->GetID();
#endif
}
// element number
aPolygoneInfo->SetElemNum( iElem, FromIdType<int>(anElem->GetID()) );
aPolygoneInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
@ -896,14 +896,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
while ( nodeIt->more() ) {
const SMDS_MeshElement* aNode = nodeIt->next();
#ifdef _EDF_NODE_IDS_
conn[ iNode ] = aNodeIdMap[FromIdType<int>(aNode->GetID())];
conn[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
#else
conn[ iNode ] = aNode->GetID();
#endif
++iNode;
}
// element number
aPolyhInfo->SetElemNum( iElem, FromIdType<int>(anElem->GetID()) );
aPolyhInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
@ -930,12 +930,12 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
// connectivity
const SMDS_MeshElement* aNode = anElem->GetNode( 0 );
#ifdef _EDF_NODE_IDS_
(*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType<int>(aNode->GetID())];
(*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
#else
(*aBallInfo->myConn)[ iElem ] = aNode->GetID();
#endif
// element number
aBallInfo->SetElemNum( iElem, FromIdType<int>(anElem->GetID()) );
aBallInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
// diameter
aBallInfo->myDiameters[ iElem ] =
@ -978,13 +978,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
for (TInt iNode = 0; iNode < aNbNodes; iNode++) {
const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
#ifdef _EDF_NODE_IDS_
aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<int>(aNode->GetID())];
aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
#else
aTConnSlice[ iNode ] = aNode->GetID();
#endif
}
// element number
aCellInfo->SetElemNum( iElem, FromIdType<int>(anElem->GetID()) );
aCellInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );

View File

@ -158,16 +158,16 @@ namespace SMESH
}
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> 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;
}

View File

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

View File

@ -557,7 +557,7 @@ void SMESH_VisualObjDef::updateEntitiesFlags()
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 ||

View File

@ -61,24 +61,24 @@ public:
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;

View File

@ -63,27 +63,27 @@ public:
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();
@ -108,7 +108,7 @@ protected:
unsigned int myEntitiesState;
vtkUnstructuredGrid* myGrid;
std::map<SMDSAbs_ElementType,int> myEntitiesCache;
std::map<SMDSAbs_ElementType,smIdType> myEntitiesCache;
};
@ -127,11 +127,11 @@ public:
virtual bool Update( int theIsClear = true );
virtual bool 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 );
@ -160,7 +160,7 @@ public:
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(); }
@ -181,8 +181,8 @@ public:
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;
@ -206,8 +206,8 @@ public:
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:

View File

@ -584,7 +584,7 @@ smIdType SMDS_ElementChunk::GetUnusedID() const
void SMDS_ElementChunk::Free( const SMDS_MeshElement* e )
{
bool hasHoles = ( myUsedRanges.Size() > 1 );
myUsedRanges.SetValue( FromIdType<int>(Index( e )), false );
myUsedRanges.SetValue( Index( e ), false );
SetShapeID( e, 0 ); // sub-mesh must do it?
SetIsMarked( e, false );
if ( !hasHoles )
@ -620,10 +620,11 @@ void SMDS_ElementChunk::SetVTKID( const SMDS_MeshElement* e, const vtkIdType vtk
{
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 )
myFactory->myVtkIDs[i] = FromIdType<vtkIdType>(i);
vtkIdType newSize = (vtkIdType) myFactory->myVtkIDs.size();
for ( ; i < newSize; ++i )
myFactory->myVtkIDs[i] = i;
}
myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID;
@ -658,7 +659,7 @@ vtkIdType SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const
int SMDS_ElementChunk::GetShapeID( const SMDS_MeshElement* e ) const
{
return mySubIDRanges.GetValue( FromIdType<int>(Index( e )));
return mySubIDRanges.GetValue( Index( e ));
}
//================================================================================
@ -672,7 +673,7 @@ void SMDS_ElementChunk::SetShapeID( const SMDS_MeshElement* e, int shapeID ) con
//const size_t nbRanges = mySubIDRanges.Size();
SMDS_ElementChunk* me = const_cast<SMDS_ElementChunk*>( this );
int oldShapeID = me->mySubIDRanges.SetValue( FromIdType<int>(Index( e )), shapeID );
int oldShapeID = me->mySubIDRanges.SetValue( Index( e ), shapeID );
if ( oldShapeID == shapeID ) return;
if ( const SMDS_MeshNode* n = dynamic_cast< const SMDS_MeshNode* >( e ))

View File

@ -405,7 +405,7 @@ public:
static bool IsUsed( const _UsedRange& r ) { return r.myValue; }
//! Return index of an element in the chunk
smIdType 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
smIdType Get1stID() const { return my1stID; }

View File

@ -815,9 +815,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
const smIdType ID)
{
smIdType nbNodes = nodes_ids.size();
size_t nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (smIdType 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;
}
@ -911,9 +911,9 @@ SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdTy
const std::vector<int> & quantities,
const smIdType ID)
{
smIdType nbNodes = nodes_ids.size();
size_t nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (smIdType 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;
}

View File

@ -45,7 +45,7 @@ class SMDS_EXPORT SMDS_MeshGroup: public SMDS_MeshObject, SMDS_ElementHolder
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;

View File

@ -191,7 +191,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<smIdType>& idNodesOldToNew,
// Use double type for storing coordinates of nodes instead float.
vtkPoints *newPoints = vtkPoints::New();
newPoints->SetDataType( VTK_DOUBLE );
newPoints->SetNumberOfPoints( FromIdType<int>(newNodeSize) );
newPoints->SetNumberOfPoints( FromIdType<vtkIdType>(newNodeSize) );
vtkIdType i = 0, alreadyCopied = 0;
while ( i < oldNodeSize )
@ -298,16 +298,16 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<smIdType>& idNodesOldToNew,
{
smIdType oldCellId = idCellsNewToOld[ newCellID ];
newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 );
smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType<int>(oldCellId) );
smIdType nCellFaces = this->Faces->GetValue( FromIdType<int>(oldFaceLoc++) );
newFaces->InsertNextValue( FromIdType<int>(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( FromIdType<int>(oldFaceLoc++) );
int nptsInFace = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( nptsInFace );
for ( int k = 0; k < nptsInFace; k++ )
{
vtkIdType oldpt = this->Faces->GetValue( FromIdType<int>(oldFaceLoc++) );
vtkIdType oldpt = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]);
}
}

View File

@ -60,8 +60,8 @@ class TopoDS_Vertex;
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;
// ==================================================================================
/*!

View File

@ -46,11 +46,11 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase
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);
@ -58,11 +58,11 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase
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();

View File

@ -55,7 +55,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int theID,
*/
//=============================================================================
int SMESHDS_GroupBase::GetID (const int theIndex)
smIdType SMESHDS_GroupBase::GetID (const int theIndex)
{
if (myCurIndex < 1 || myCurIndex > theIndex) {
myIterator = GetElements();
@ -64,7 +64,7 @@ int SMESHDS_GroupBase::GetID (const int theIndex)
}
while (myCurIndex < theIndex && myIterator->more()) {
myCurIndex++;
myCurID = FromIdType<int>(myIterator->next()->GetID());
myCurID = myIterator->next()->GetID();
}
return myCurIndex == theIndex ? myCurID : -1;
}

View File

@ -58,17 +58,17 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
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;
@ -89,7 +89,7 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
{ myDefaultColor = theColor;}
protected:
const SMDS_MeshElement* findInMesh (const int theID) const;
const SMDS_MeshElement* findInMesh (const smIdType theID) const;
void resetIterator();
private:
@ -105,8 +105,8 @@ class SMESHDS_EXPORT SMESHDS_GroupBase
Quantity_Color myColor;
// for GetID()
int myCurIndex;
int myCurID;
smIdType myCurIndex;
smIdType myCurID;
SMDS_ElemIteratorPtr myIterator;
static Quantity_Color myDefaultColor;

View File

@ -315,7 +315,7 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
if ( IsUpToDate() )
{
for ( ; elIt->more(); curID += idSize )
(*(int*) curID) = FromIdType<int>(elIt->next()->GetID());
(*(smIdType*) curID) = elIt->next()->GetID();
}
else
{
@ -325,11 +325,11 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
me->myMeshInfo.assign( SMDSEntity_Last, 0 );
me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
(*(int*) curID) = FromIdType<int>(firstOkElem->GetID());
(*(smidtype*) curID) = firstOkElem->GetID();
for ( curID += idSize; elIt->more(); curID += idSize )
{
const SMDS_MeshElement* e = elIt->next();
(*(int*) curID) = FromIdType<int>(e->GetID());
(*(smIdtype*) curID) = e->GetID();
me->myMeshInfo[ e->GetEntityType() ]++;
}
}

View File

@ -50,17 +50,17 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme
std::vector< int > 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);
@ -92,7 +92,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme
// 2) The case of enough free memory. Remember all OK elements (myElements).
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

View File

@ -47,7 +47,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnGeom: public SMESHDS_GroupBase
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);

View File

@ -2229,9 +2229,7 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
SUIT_OverrideCursor aWaitCursor;
try {
OCC_CATCH_SIGNALS;
SMESH::long_array_var tmp = gen->Evaluate(myMesh, myMainShape);
for ( int i = 0; i < tmp->length(); ++i)
aRes[ i ] = tmp [ i ];
aRes = gen->Evaluate(myMesh, myMainShape);
}
catch(const SALOME::SALOME_Exception & S_ex){
memoryLack = true;

View File

@ -1981,7 +1981,11 @@ SMESH_MeshAlgos::FindSharpEdges( SMDS_Mesh* theMesh,
typedef std::pair< bool, const SMDS_MeshNode* > TIsSharpAndMedium;
typedef NCollection_DataMap< SMESH_TLink, TIsSharpAndMedium, SMESH_TLink > TLinkSharpMap;
TLinkSharpMap linkIsSharp( FromIdType<int>(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;
@ -2088,7 +2092,10 @@ SMESH_MeshAlgos::SeparateFacesByEdges( SMDS_Mesh* theMesh, const std::vector< Ed
typedef std::vector< const SMDS_MeshElement* > TFaceVec;
typedef NCollection_DataMap< SMESH_TLink, TFaceVec, SMESH_TLink > TFacesByLinks;
TFacesByLinks facesByLink( FromIdType<int>(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(); )

View File

@ -1934,7 +1934,7 @@ namespace SMESH_MeshAlgos
{
const CutFace& cf = *cutFacesIt;
smIdType index = cf.myInitFace->GetID(); // index in theNew2OldFaces
if ((int) theNew2OldFaces.size() <= index )
if ((smIdType) theNew2OldFaces.size() <= index )
theNew2OldFaces.resize( index + 1 );
theNew2OldFaces[ index ] = std::make_pair( cf.myInitFace, index );
}
@ -3226,7 +3226,7 @@ SMDS_Mesh* SMESH_MeshAlgos::MakeOffset( SMDS_ElemIteratorPtr theFaceIt,
for ( SMDS_ElemIteratorPtr fIt = newNode->GetInverseElementIterator(); fIt->more(); )
{
const SMDS_MeshElement* newFace = fIt->next();
const int faceIndex = FromIdType<int>(newFace->GetID());
const smIdType faceIndex = newFace->GetID();
const gp_XYZ& oldNorm = normals[ faceIndex ];
const gp_XYZ newXYZ = oldXYZ + oldNorm * theOffset;
if ( multiPos.empty() )
@ -3275,7 +3275,7 @@ SMDS_Mesh* SMESH_MeshAlgos::MakeOffset( SMDS_ElemIteratorPtr theFaceIt,
for ( SMDS_ElemIteratorPtr fIt = newNode->GetInverseElementIterator(); fIt->more(); )
{
const SMDS_MeshElement* newFace = fIt->next();
const int faceIndex = FromIdType<int>(newFace->GetID());
const smIdType faceIndex = newFace->GetID();
const gp_XYZ& oldNorm = normals[ faceIndex ];
if ( !SMESH_MeshAlgos::FaceNormal( newFace, faceNorm, /*normalize=*/false ) ||
//faceNorm * moveVec < 0 )

View File

@ -380,10 +380,10 @@ namespace
*/
//================================================================================
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 > & theFaceID2Groups,
TGroupVec & theWorkGroups )
{
theWorkGroups.clear();
for ( size_t i = 0; i < theGroupsToUpdate.size(); ++i )
@ -391,7 +391,7 @@ namespace
theWorkGroups.push_back( theGroupsToUpdate[i] );
if ( !theWorkGroups.empty() )
theFaceID2Groups.Bind( FromIdType<int>(theFace->GetID()), theWorkGroups );
theFaceID2Groups.Bind( theFace->GetID(), theWorkGroups );
}
//================================================================================
@ -583,7 +583,7 @@ SMESH_MeshAlgos::MakeSlot( SMDS_ElemIteratorPtr theSegmentIt,
std::vector< SMESH_NodeXYZ > facePoints(4);
std::vector< Intersector::TFace > cutFacePoints;
NCollection_DataMap< int, TGroupVec > faceID2Groups;
NCollection_DataMap< smIdType, TGroupVec > faceID2Groups;
TGroupVec groupVec;
std::vector< gp_Ax1 > planeNormalVec(2);

View File

@ -2330,9 +2330,8 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh
*/
//=============================================================================
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" );
@ -2343,7 +2342,7 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
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++)

View File

@ -209,7 +209,7 @@ SMESH::ElementType SMESH_GroupBase_i::GetType()
*/
//=============================================================================
CORBA::Long SMESH_GroupBase_i::Size()
CORBA::smIdType SMESH_GroupBase_i::Size()
{
if ( myPreMeshInfo )
return GetType() == SMESH::NODE ? myPreMeshInfo->NbNodes() : myPreMeshInfo->NbElements();

View File

@ -61,7 +61,7 @@ class SMESH_I_EXPORT SMESH_GroupBase_i:
void SetName(const char* name);
char* GetName();
SMESH::ElementType GetType();
CORBA::Long Size();
SMESH::smIdType Size();
CORBA::Boolean IsEmpty();
CORBA::Boolean Contains(SMESH::smIdType elem_id);
SMESH::smIdType GetID(SMESH::smIdType elem_index);

View File

@ -756,11 +756,11 @@ bool SMESH_MeshEditor_i::IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSourc
}
SMESH::smIdType* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource,
int& nbIds)
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;

View File

@ -6324,7 +6324,7 @@ SMDS_ElemIteratorPtr SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_ptr theObje
SMDSAbs_ElementType iterType = isNodes ? SMDSAbs_Node : elemType;
if ( SMESH_MeshEditor_i::IsTemporaryIDSource( theObject ))
{
int nbIds;
SMESH::smIdType nbIds;
if ( SMESH::smIdType* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds ))
elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids, nbIds, iterType ));
}