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,7 +386,7 @@ module SMESH
/*! /*!
* Evaluates size of prospective mesh on a shape * Evaluates size of prospective mesh on a shape
*/ */
long_array Evaluate(in SMESH_Mesh theMesh, smIdType_array Evaluate(in SMESH_Mesh theMesh,
in GEOM::GEOM_Object theSubObject) in GEOM::GEOM_Object theSubObject)
raises ( SALOME::SALOME_Exception ); raises ( SALOME::SALOME_Exception );

View File

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

View File

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

View File

@ -32,8 +32,8 @@
#include <GeomAPI_ProjectPointOnSurf.hxx> #include <GeomAPI_ProjectPointOnSurf.hxx>
#include <Quantity_Color.hxx> #include <Quantity_Color.hxx>
#include <TColStd_MapOfInteger.hxx> #include <TColStd_MapOfInteger.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <NCollection_Map.hxx>
#include <TopAbs.hxx> #include <TopAbs.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
@ -58,6 +58,8 @@ class ShapeAnalysis_Surface;
class gp_Pln; class gp_Pln;
class gp_Pnt; class gp_Pnt;
typedef NCollection_Map< smIdType > TIDsMap;
namespace SMESH{ namespace SMESH{
namespace Controls{ namespace Controls{
@ -133,7 +135,7 @@ namespace SMESH{
void GetHistogram(int nbIntervals, void GetHistogram(int nbIntervals,
std::vector<int>& nbEvents, std::vector<int>& nbEvents,
std::vector<double>& funValues, std::vector<double>& funValues,
const std::vector<int>& elements, const std::vector<smIdType>& elements,
const double* minmax=0, const double* minmax=0,
const bool isLogarithmic = false); const bool isLogarithmic = false);
bool IsApplicable( long theElementId ) const; bool IsApplicable( long theElementId ) const;
@ -144,7 +146,7 @@ namespace SMESH{
void SetPrecision( const long thePrecision ); void SetPrecision( const long thePrecision );
double Round( const double & value ); double Round( const double & value );
bool GetPoints(const int theId, TSequenceOfXYZ& theRes) const; bool GetPoints(const smIdType theId, TSequenceOfXYZ& theRes) const;
static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes); static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes);
protected: protected:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
@ -424,7 +426,7 @@ namespace SMESH{
private: private:
double myToler; double myToler;
TColStd_MapOfInteger myCoincidentIDs; TIDsMap myCoincidentIDs;
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
}; };
typedef boost::shared_ptr<CoincidentNodes> CoincidentNodesPtr; typedef boost::shared_ptr<CoincidentNodes> CoincidentNodesPtr;
@ -591,7 +593,7 @@ namespace SMESH{
virtual void SetMesh( const SMDS_Mesh* theMesh ); virtual void SetMesh( const SMDS_Mesh* theMesh );
virtual bool IsSatisfy( long theElementId ); virtual bool IsSatisfy( long theElementId );
virtual SMDSAbs_ElementType GetType() const; virtual SMDSAbs_ElementType GetType() const;
static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId ); static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId );
typedef long TElemId; typedef long TElemId;
struct Border{ struct Border{
TElemId myElemId; TElemId myElemId;
@ -650,9 +652,9 @@ namespace SMESH{
protected: protected:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
TColStd_SequenceOfInteger myMin; std::vector< smIdType> myMin;
TColStd_SequenceOfInteger myMax; std::vector< smIdType > myMax;
TColStd_MapOfInteger myIds; TIDsMap myIds;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
}; };
@ -833,7 +835,7 @@ namespace SMESH{
bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt, bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt,
SMDS_MeshFace* theStartFace, SMDS_MeshFace* theStartFace,
TMapOfLink& theNonManifold, TMapOfLink& theNonManifold,
TColStd_MapOfInteger& theResFaces ); TIDsMap& theResFaces );
bool isInPlane( const SMDS_MeshFace* theFace1, bool isInPlane( const SMDS_MeshFace* theFace1,
const SMDS_MeshFace* theFace2 ); const SMDS_MeshFace* theFace2 );
void expandBoundary( TMapOfLink& theMapOfBoundary, void expandBoundary( TMapOfLink& theMapOfBoundary,
@ -847,8 +849,8 @@ namespace SMESH{
private: private:
const SMDS_Mesh* myMesh; const SMDS_Mesh* myMesh;
TColStd_MapOfInteger myMapIds; TIDsMap myMapIds;
TColStd_MapOfInteger myMapBadGeomIds; TIDsMap myMapBadGeomIds;
TVectorOfFacePtr myAllFacePtr; TVectorOfFacePtr myAllFacePtr;
TDataMapFacePtrInt myAllFacePtrIntDMap; TDataMapFacePtrInt myAllFacePtrIntDMap;
double myAngToler; double myAngToler;
@ -909,7 +911,7 @@ namespace SMESH{
private: private:
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
TColStd_MapOfInteger myIds; TIDsMap myIds;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
TopoDS_Face mySurf; TopoDS_Face mySurf;
double myToler; double myToler;
@ -1149,7 +1151,7 @@ namespace SMESH{
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
long myFaceID; long myFaceID;
double myToler; double myToler;
TColStd_MapOfInteger myCoplanarIDs; TIDsMap myCoplanarIDs;
}; };
typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr; typedef boost::shared_ptr<CoplanarFaces> CoplanarFacesPtr;
@ -1176,14 +1178,14 @@ namespace SMESH{
//const std::set<long>& GetDomainIDs() const { return myOkIDs; } //const std::set<long>& GetDomainIDs() const { return myOkIDs; }
private: private:
int myNodeID; smIdType myNodeID;
std::vector<double> myXYZ; std::vector<double> myXYZ;
SMDSAbs_ElementType myType; SMDSAbs_ElementType myType;
TMeshModifTracer myMeshModifTracer; TMeshModifTracer myMeshModifTracer;
void clearOkIDs(); void clearOkIDs();
bool myOkIDsReady; bool myOkIDsReady;
std::set< int > myOkIDs; // empty means that there is one domain std::set<smIdType> myOkIDs; // empty means that there is one domain
}; };
typedef boost::shared_ptr<ConnectedElements> ConnectedElementsPtr; typedef boost::shared_ptr<ConnectedElements> ConnectedElementsPtr;

View File

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

View File

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

View File

@ -557,7 +557,7 @@ void SMESH_VisualObjDef::updateEntitiesFlags()
unsigned int tmp = myEntitiesState; unsigned int tmp = myEntitiesState;
ClearEntitiesFlags(); ClearEntitiesFlags();
map<SMDSAbs_ElementType,int> entities = SMESH::GetEntitiesFromObject(this); map<SMDSAbs_ElementType,smIdType> entities = SMESH::GetEntitiesFromObject(this);
if( myEntitiesCache[SMDSAbs_0DElement] != 0 || if( myEntitiesCache[SMDSAbs_0DElement] != 0 ||

View File

@ -61,24 +61,24 @@ public:
virtual bool Update( int theIsClear = true ) = 0; virtual bool Update( int theIsClear = true ) = 0;
virtual bool NulData() = 0; virtual bool NulData() = 0;
virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0; virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
virtual int GetElemDimension( const int theObjId ) = 0; virtual int GetElemDimension( const smIdType theObjId ) = 0;
virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0; virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
virtual SMDS_Mesh* GetMesh() const = 0; virtual SMDS_Mesh* GetMesh() const = 0;
virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0; virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0;
virtual bool GetEdgeNodes( const int theElemId, virtual bool GetEdgeNodes( const smIdType theElemId,
const int theEdgeNum, const int theEdgeNum,
int& theNodeId1, smIdType& theNodeId1,
int& theNodeId2 ) const = 0; smIdType& theNodeId2 ) const = 0;
virtual bool IsValid() const = 0; virtual bool IsValid() const = 0;
virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0; virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
virtual vtkIdType GetNodeObjId( int theVTKID ) = 0; virtual vtkIdType GetNodeObjId( vtkIdType theVTKID ) = 0;
virtual vtkIdType GetNodeVTKId( int theObjID ) = 0; virtual vtkIdType GetNodeVTKId( vtkIdType theObjID ) = 0;
virtual vtkIdType GetElemObjId( int theVTKID ) = 0; virtual vtkIdType GetElemObjId( vtkIdType theVTKID ) = 0;
virtual vtkIdType GetElemVTKId( int theObjID ) = 0; virtual vtkIdType GetElemVTKId( vtkIdType theObjID ) = 0;
virtual void ClearEntitiesFlags() = 0; virtual void ClearEntitiesFlags() = 0;
virtual bool GetEntitiesFlag() = 0; virtual bool GetEntitiesFlag() = 0;
virtual unsigned int GetEntitiesState() = 0; virtual unsigned int GetEntitiesState() = 0;

View File

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

View File

@ -584,7 +584,7 @@ smIdType SMDS_ElementChunk::GetUnusedID() const
void SMDS_ElementChunk::Free( const SMDS_MeshElement* e ) void SMDS_ElementChunk::Free( const SMDS_MeshElement* e )
{ {
bool hasHoles = ( myUsedRanges.Size() > 1 ); 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? SetShapeID( e, 0 ); // sub-mesh must do it?
SetIsMarked( e, false ); SetIsMarked( e, false );
if ( !hasHoles ) 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 ) if ((smIdType) myFactory->myVtkIDs.size() <= e->GetID() - 1 )
{ {
size_t i = myFactory->myVtkIDs.size(); vtkIdType i = (vtkIdType) myFactory->myVtkIDs.size();
myFactory->myVtkIDs.resize( e->GetID() + 100 ); myFactory->myVtkIDs.resize( e->GetID() + 100 );
for ( ; i < myFactory->myVtkIDs.size(); ++i ) vtkIdType newSize = (vtkIdType) myFactory->myVtkIDs.size();
myFactory->myVtkIDs[i] = FromIdType<vtkIdType>(i); for ( ; i < newSize; ++i )
myFactory->myVtkIDs[i] = i;
} }
myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID; 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 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(); //const size_t nbRanges = mySubIDRanges.Size();
SMDS_ElementChunk* me = const_cast<SMDS_ElementChunk*>( this ); 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 ( oldShapeID == shapeID ) return;
if ( const SMDS_MeshNode* n = dynamic_cast< const SMDS_MeshNode* >( e )) 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; } static bool IsUsed( const _UsedRange& r ) { return r.myValue; }
//! Return index of an element in the chunk //! Return index of an element in the chunk
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 //! Return ID of the 1st element in the chunk
smIdType Get1stID() const { return my1stID; } 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, SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
const smIdType ID) const smIdType ID)
{ {
smIdType nbNodes = nodes_ids.size(); size_t nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes); std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (smIdType i = 0; i < nbNodes; i++) { for ( size_t i = 0; i < nbNodes; i++) {
nodes[i] = myNodeFactory->FindNode( nodes_ids[i] ); nodes[i] = myNodeFactory->FindNode( nodes_ids[i] );
if (!nodes[i]) return NULL; if (!nodes[i]) return NULL;
} }
@ -911,9 +911,9 @@ SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdTy
const std::vector<int> & quantities, const std::vector<int> & quantities,
const smIdType ID) const smIdType ID)
{ {
smIdType nbNodes = nodes_ids.size(); size_t nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes); std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (smIdType i = 0; i < nbNodes; i++) { for ( size_t i = 0; i < nbNodes; i++) {
nodes[i] = myNodeFactory->FindNode(nodes_ids[i]); nodes[i] = myNodeFactory->FindNode(nodes_ids[i]);
if (!nodes[i]) return NULL; if (!nodes[i]) return NULL;
} }

View File

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

View File

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

View File

@ -60,8 +60,8 @@ class TopoDS_Vertex;
class TopoDS_Wire; class TopoDS_Wire;
class gp_XYZ; class gp_XYZ;
typedef std::map< SMESH_subMesh*, std::vector<int> > MapShapeNbElems; typedef std::map< SMESH_subMesh*, std::vector<smIdType> > MapShapeNbElems;
typedef std::map< SMESH_subMesh*, std::vector<int> >::iterator MapShapeNbElemsItr; typedef std::map< SMESH_subMesh*, std::vector<smIdType> >::iterator MapShapeNbElemsItr;
// ================================================================================== // ==================================================================================
/*! /*!

View File

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

View File

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

View File

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

View File

@ -315,7 +315,7 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
if ( IsUpToDate() ) if ( IsUpToDate() )
{ {
for ( ; elIt->more(); curID += idSize ) for ( ; elIt->more(); curID += idSize )
(*(int*) curID) = FromIdType<int>(elIt->next()->GetID()); (*(smIdType*) curID) = elIt->next()->GetID();
} }
else else
{ {
@ -325,11 +325,11 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const
me->myMeshInfo.assign( SMDSEntity_Last, 0 ); me->myMeshInfo.assign( SMDSEntity_Last, 0 );
me->myMeshInfo[ firstOkElem->GetEntityType() ]++; me->myMeshInfo[ firstOkElem->GetEntityType() ]++;
(*(int*) curID) = FromIdType<int>(firstOkElem->GetID()); (*(smidtype*) curID) = firstOkElem->GetID();
for ( curID += idSize; elIt->more(); curID += idSize ) for ( curID += idSize; elIt->more(); curID += idSize )
{ {
const SMDS_MeshElement* e = elIt->next(); const SMDS_MeshElement* e = elIt->next();
(*(int*) curID) = FromIdType<int>(e->GetID()); (*(smIdtype*) curID) = e->GetID();
me->myMeshInfo[ e->GetEntityType() ]++; 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; std::vector< int > GetMeshInfo() const;
template< typename IDTYPE > template< typename IDTYPE >
int GetElementIds( IDTYPE* ids ) const smIdType GetElementIds( IDTYPE* ids ) const
{ {
return getElementIds( (void*)ids, sizeof(IDTYPE)); return getElementIds( (void*)ids, sizeof(IDTYPE));
} }
virtual int Extent() const; virtual smIdType Extent() const;
virtual bool IsEmpty(); virtual bool IsEmpty();
virtual bool Contains (const int theID); virtual bool Contains (const smIdType theID);
virtual bool Contains (const SMDS_MeshElement* elem); virtual bool Contains (const SMDS_MeshElement* elem);
@ -92,7 +92,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme
// 2) The case of enough free memory. Remember all OK elements (myElements). // 2) The case of enough free memory. Remember all OK elements (myElements).
SMESH_PredicatePtr myPredicate; SMESH_PredicatePtr myPredicate;
std::vector< int > myMeshInfo; std::vector< smIdType > myMeshInfo;
std::vector< const SMDS_MeshElement*> myElements; std::vector< const SMDS_MeshElement*> myElements;
bool myElementsOK; bool myElementsOK;
size_t myMeshModifTime; // when myMeshInfo was updated size_t myMeshModifTime; // when myMeshInfo was updated

View File

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

View File

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

View File

@ -1981,7 +1981,11 @@ SMESH_MeshAlgos::FindSharpEdges( SMDS_Mesh* theMesh,
typedef std::pair< bool, const SMDS_MeshNode* > TIsSharpAndMedium; typedef std::pair< bool, const SMDS_MeshNode* > TIsSharpAndMedium;
typedef NCollection_DataMap< SMESH_TLink, TIsSharpAndMedium, SMESH_TLink > TLinkSharpMap; 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 ); TIsSharpAndMedium sharpMedium( true, 0 );
bool & isSharp = sharpMedium.first; bool & isSharp = sharpMedium.first;
const SMDS_MeshNode* & nMedium = sharpMedium.second; 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 std::vector< const SMDS_MeshElement* > TFaceVec;
typedef NCollection_DataMap< SMESH_TLink, TFaceVec, SMESH_TLink > TFacesByLinks; 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; std::vector< const SMDS_MeshNode* > faceNodes;
for ( SMDS_FaceIteratorPtr faceIt = theMesh->facesIterator(); faceIt->more(); ) for ( SMDS_FaceIteratorPtr faceIt = theMesh->facesIterator(); faceIt->more(); )

View File

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

View File

@ -382,7 +382,7 @@ namespace
void findGroups( const SMDS_MeshElement * theFace, void findGroups( const SMDS_MeshElement * theFace,
TGroupVec & theGroupsToUpdate, TGroupVec & theGroupsToUpdate,
NCollection_DataMap< int, TGroupVec > & theFaceID2Groups, NCollection_DataMap< smIdType, TGroupVec > & theFaceID2Groups,
TGroupVec & theWorkGroups ) TGroupVec & theWorkGroups )
{ {
theWorkGroups.clear(); theWorkGroups.clear();
@ -391,7 +391,7 @@ namespace
theWorkGroups.push_back( theGroupsToUpdate[i] ); theWorkGroups.push_back( theGroupsToUpdate[i] );
if ( !theWorkGroups.empty() ) 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< SMESH_NodeXYZ > facePoints(4);
std::vector< Intersector::TFace > cutFacePoints; std::vector< Intersector::TFace > cutFacePoints;
NCollection_DataMap< int, TGroupVec > faceID2Groups; NCollection_DataMap< smIdType, TGroupVec > faceID2Groups;
TGroupVec groupVec; TGroupVec groupVec;
std::vector< gp_Ax1 > planeNormalVec(2); 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, SMESH::smIdType_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject) GEOM::GEOM_Object_ptr theShapeObject)
// SMESH::long_array& theNbElems)
{ {
Unexpect aCatch(SALOME_SalomeException); Unexpect aCatch(SALOME_SalomeException);
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Evaluate" ); 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 ) ) if ( CORBA::is_nil( theMesh ) )
THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM ); 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); nbels->length(SMESH::Entity_Last);
int i = SMESH::Entity_Node; int i = SMESH::Entity_Node;
for (; i < SMESH::Entity_Last; i++) 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 ) if ( myPreMeshInfo )
return GetType() == SMESH::NODE ? myPreMeshInfo->NbNodes() : myPreMeshInfo->NbElements(); 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); void SetName(const char* name);
char* GetName(); char* GetName();
SMESH::ElementType GetType(); SMESH::ElementType GetType();
CORBA::Long Size(); SMESH::smIdType Size();
CORBA::Boolean IsEmpty(); CORBA::Boolean IsEmpty();
CORBA::Boolean Contains(SMESH::smIdType elem_id); CORBA::Boolean Contains(SMESH::smIdType elem_id);
SMESH::smIdType GetID(SMESH::smIdType elem_index); 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, 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 )) 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]; return & tmpIdSource->_ids[0];
} }
nbIds = 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; SMDSAbs_ElementType iterType = isNodes ? SMDSAbs_Node : elemType;
if ( SMESH_MeshEditor_i::IsTemporaryIDSource( theObject )) if ( SMESH_MeshEditor_i::IsTemporaryIDSource( theObject ))
{ {
int nbIds; SMESH::smIdType nbIds;
if ( SMESH::smIdType* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds )) if ( SMESH::smIdType* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds ))
elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids, nbIds, iterType )); elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids, nbIds, iterType ));
} }