dist2 = ( nn1[1] - nn2[1] ).Modulus();
tol = 1e-5 * ( nn1[0] - nn1[1] ).Modulus();
}
- return ( dist1 < tol & dist2 < tol );
+ return ( dist1 < tol && dist2 < tol );
}
return false;
}
if ( !_nodeReplacementMap.empty() )
{
map< int, int >::const_iterator it, end = _nodeReplacementMap.end();
- for ( size_t i = 0; i < nbIds; ++i )
+ for ( int i = 0; i < nbIds; ++i )
if (( it = _nodeReplacementMap.find( ids[i] + idShift)) != end )
ids[i] = it->second;
else
}
else if ( idShift )
{
- for ( size_t i = 0; i < nbIds; ++i )
+ for ( int i = 0; i < nbIds; ++i )
ids[i] += idShift;
}
}
if ( zone.IsStructured() )
{
int axis = 0; // axis perpendiculaire to which boundary elements are oriented
- if ( ids.size() >= meshDim * 2 )
+ if ( (int) ids.size() >= meshDim * 2 )
{
for ( ; axis < meshDim; ++axis )
if ( ids[axis] - ids[axis+meshDim] == 0 )
if ( psType == CGNS_ENUMV( PointRange ) && ids.size() == 2 )
{
- for ( size_t i = ids[0]; i <= ids[1]; ++i )
+ for ( cgsize_t i = ids[0]; i <= ids[1]; ++i )
if ( const SMDS_MeshElement* e = myMesh->FindElement( i ))
groupDS.Add( e );
}
void DriverMED_W_Field::SetCompName(const int iComp, const char* name)
{
- if ( _compNames.size() <= iComp )
+ if ( (int)_compNames.size() <= iComp )
_compNames.resize( iComp + 1 );
_compNames[ iComp ] = name;
}
MED::PIntTimeStampValue timeStampIntVal = timeStampVal;
// set values
- int iVal = 0, i, nbE;
+ int iVal = 0;
MED::TFloat* ptrDbl = 0;
MED::TInt* ptrInt = 0;
for ( size_t iG = 1; iG < _nbElemsByGeom.size(); ++iG )
_dblValues.clear();
_intValues.clear();
+
+ return DRS_OK;
}
namespace DriverMED // Implemetation of fuctions declared in DriverMED.hxx
aRec.fe_descriptor_id = anId;
aRec.node_labels.reserve(aNbNodes);
SMDS_NodeIteratorPtr aNodesIter = anElem->nodesIteratorToUNV();
- while ( aNodesIter->more() && aRec.node_labels.size() < aNbNodes )
+ while ( aNodesIter->more() && (int)aRec.node_labels.size() < aNbNodes )
{
const SMDS_MeshElement* aNode = aNodesIter->next();
aRec.node_labels.push_back(aNode->GetID());
*/
inline double D_to_e(std::string& number)
{
- /* find "D" in string, start looking at
+ /* find "D" in string, start looking at
* 6th element, to improve speed.
* We dont expect a "D" earlier
*/
- const int position = number.find("D",6);
- if(position != std::string::npos){
- number.replace(position, 1, "e");
- }
+ const size_t position = number.find("D",6);
+ if ( position != std::string::npos )
+ number.replace(position, 1, "e");
+
return atof (number.c_str());
}
-
+
/**
* @returns \p false when file is incorrect, \p true otherwise.
* Check file with name \p theFileName for correct terminate
class _MyEdgeIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
- int myIndex;
+ size_t myIndex;
public:
_MyEdgeIterator(const SMDS_FaceOfNodes* face):myIndex(0) {
myElems.reserve( face->NbNodes() );
virtual const SMDS_MeshElement* next() { return myElems[ myIndex++ ]; }
};
-SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator
- (SMDSAbs_ElementType type) const
+SMDS_ElemIteratorPtr SMDS_FaceOfNodes::elementsIterator( SMDSAbs_ElementType type ) const
{
switch(type)
{
///////////////////////////////////////////////////////////////////////////////
/// Create a new mesh object
///////////////////////////////////////////////////////////////////////////////
-SMDS_Mesh::SMDS_Mesh()
- :myParent(NULL),
- myNodeIDFactory(new SMDS_MeshNodeIDFactory()),
- myElementIDFactory(new SMDS_MeshElementIDFactory()),
- myHasConstructionEdges(false), myHasConstructionFaces(false),
- myHasInverseElements(true),
- myNodeMin(0), myNodeMax(0),
- myNodePool(0), myEdgePool(0), myFacePool(0), myVolumePool(0),myBallPool(0),
- myModified(false), myModifTime(0), myCompactTime(0),
- xmin(0), xmax(0), ymin(0), ymax(0), zmin(0), zmax(0)
+SMDS_Mesh::SMDS_Mesh():
+ myNodePool(0), myVolumePool(0), myFacePool(0), myEdgePool(0), myBallPool(0),
+ myParent(NULL),
+ myNodeIDFactory(new SMDS_MeshNodeIDFactory()),
+ myElementIDFactory(new SMDS_MeshElementIDFactory()),
+ myModified(false), myModifTime(0), myCompactTime(0),
+ myNodeMin(0), myNodeMax(0),
+ myHasConstructionEdges(false), myHasConstructionFaces(false),
+ myHasInverseElements(true),
+ xmin(0), xmax(0), ymin(0), ymax(0), zmin(0), zmax(0)
{
myMeshId = _meshList.size(); // --- index of the mesh to push back in the vector
myNodeIDFactory->SetMesh(this);
/// Note that the tree structure of SMDS_Mesh seems to be unused in this version
/// (2003-09-08) of SMESH
///////////////////////////////////////////////////////////////////////////////
-SMDS_Mesh::SMDS_Mesh(SMDS_Mesh * parent)
- :myParent(parent), myNodeIDFactory(parent->myNodeIDFactory),
- myElementIDFactory(parent->myElementIDFactory),
- myHasConstructionEdges(false), myHasConstructionFaces(false),
- myHasInverseElements(true),
- myNodePool(parent->myNodePool),
- myEdgePool(parent->myEdgePool),
- myFacePool(parent->myFacePool),
- myVolumePool(parent->myVolumePool),
- myBallPool(parent->myBallPool)
+SMDS_Mesh::SMDS_Mesh(SMDS_Mesh * parent):
+ myNodePool(parent->myNodePool),
+ myVolumePool(parent->myVolumePool),
+ myFacePool(parent->myFacePool),
+ myEdgePool(parent->myEdgePool),
+ myBallPool(parent->myBallPool),
+ myParent(parent), myNodeIDFactory(parent->myNodeIDFactory),
+ myElementIDFactory(parent->myElementIDFactory),
+ myHasConstructionEdges(false), myHasConstructionFaces(false),
+ myHasInverseElements(true)
{
}
SMDS_Mesh *SMDS_Mesh::AddSubMesh()
{
- SMDS_Mesh *submesh = new SMDS_Mesh(this);
- myChildren.insert(myChildren.end(), submesh);
- return submesh;
+ SMDS_Mesh *submesh = new SMDS_Mesh(this);
+ myChildren.insert(myChildren.end(), submesh);
+ return submesh;
}
///////////////////////////////////////////////////////////////////////////////
SMDS_MeshNode * node = myNodePool->getNew();
node->init(ID, myMeshId, 0, x, y, z);
- if (ID >= myNodes.size())
+ if (ID >= (int)myNodes.size())
{
myNodes.resize(ID+SMDS_Mesh::chunkSize, 0);
// MESSAGE(" ------------------ myNodes resize " << ID << " --> " << ID+SMDS_Mesh::chunkSize);
bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
{
//MESSAGE("registerElement " << ID);
- if ((ID >=0) && (ID < myCells.size()) && myCells[ID]) // --- already bound
+ if ((ID >=0) && (ID < (int)myCells.size()) && myCells[ID]) // --- already bound
{
MESSAGE(" ------------------ already bound "<< ID << " " << myCells[ID]->getVtkId());
return false;
if (vtkId == -1)
vtkId = myElementIDFactory->SetInVtkGrid(element);
- if (vtkId >= myCellIdVtkToSmds.size()) // --- resize local vector
+ if (vtkId >= (int)myCellIdVtkToSmds.size()) // --- resize local vector
{
// MESSAGE(" --------------------- resize myCellIdVtkToSmds " << vtkId << " --> " << vtkId + SMDS_Mesh::chunkSize);
myCellIdVtkToSmds.resize(vtkId + SMDS_Mesh::chunkSize, -1);
///////////////////////////////////////////////////////////////////////////////
const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const
{
- if (ID < 1 || ID >= myNodes.size())
+ if (ID < 1 || ID >= (int)myNodes.size())
{
// MESSAGE("------------------------------------------------------------------------- ");
// MESSAGE("----------------------------------- bad ID " << ID << " " << myNodes.size());
const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(int vtkId) const
{
// TODO if needed use mesh->nodeIdFromVtkToSmds
- if (vtkId < 0 || vtkId >= (myNodes.size() -1))
+ if ( vtkId < 0 || vtkId+1 >= (int) myNodes.size() )
{
MESSAGE("------------------------------------------------------------------------- ");
MESSAGE("---------------------------- bad VTK ID " << vtkId << " " << myNodes.size());
const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const
{
- if ((IDelem <= 0) || IDelem >= myCells.size())
+ if ( IDelem <= 0 || IDelem >= (int)myCells.size() )
{
MESSAGE("--------------------------------------------------------------------------------- ");
MESSAGE("----------------------------------- bad IDelem " << IDelem << " " << myCells.size());
{
const SMDS_MeshElement* e = itF->next();
int nbNodesToCheck = noMedium ? e->NbCornerNodes() : e->NbNodes();
- if ( nbNodesToCheck == nodes.size() )
+ if ( nbNodesToCheck == (int)nodes.size() )
{
for ( size_t i = 1; e && i < nodes.size(); ++i )
{
///////////////////////////////////////////////////////////////////////////////
/// Return the list of nodes used only by the given elements
///////////////////////////////////////////////////////////////////////////////
-static set<const SMDS_MeshElement*> * getExclusiveNodes(
- set<const SMDS_MeshElement*>& elements)
+static set<const SMDS_MeshElement*> * getExclusiveNodes(set<const SMDS_MeshElement*>& elements)
{
- set<const SMDS_MeshElement*> * toReturn=new set<const SMDS_MeshElement*>();
- set<const SMDS_MeshElement*>::iterator itElements=elements.begin();
+ set<const SMDS_MeshElement*> * toReturn=new set<const SMDS_MeshElement*>();
+ set<const SMDS_MeshElement*>::iterator itElements=elements.begin();
- while(itElements!=elements.end())
- {
- SMDS_ElemIteratorPtr itNodes = (*itElements)->nodesIterator();
- itElements++;
+ while(itElements!=elements.end())
+ {
+ SMDS_ElemIteratorPtr itNodes = (*itElements)->nodesIterator();
+ itElements++;
- while(itNodes->more())
- {
- const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(itNodes->next());
- SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
- set<const SMDS_MeshElement*> s;
- while(itFe->more())
- s.insert(itFe->next());
- if(s==elements) toReturn->insert(n);
- }
- }
- return toReturn;
+ while(itNodes->more())
+ {
+ const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(itNodes->next());
+ SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
+ set<const SMDS_MeshElement*> s;
+ while(itFe->more())
+ s.insert(itFe->next());
+ if(s==elements) toReturn->insert(n);
+ }
+ }
+ return toReturn;
}
///////////////////////////////////////////////////////////////////////////////
set<const SMDS_MeshElement*>& nodes)
{
switch(element->GetType())
+ {
+ case SMDSAbs_Node:
+ MESSAGE("Internal Error: This should not happen");
+ break;
+ case SMDSAbs_0DElement:
+ {
+ }
+ break;
+ case SMDSAbs_Edge:
+ {
+ SMDS_ElemIteratorPtr itn=element->nodesIterator();
+ while(itn->more())
{
- case SMDSAbs_Node:
- MESSAGE("Internal Error: This should not happen");
- break;
- case SMDSAbs_0DElement:
+ const SMDS_MeshElement * e=itn->next();
+ if(nodes.find(e)!=nodes.end())
{
+ setOfChildren.insert(element);
+ break;
}
- break;
- case SMDSAbs_Edge:
- {
- SMDS_ElemIteratorPtr itn=element->nodesIterator();
- while(itn->more())
- {
- const SMDS_MeshElement * e=itn->next();
- if(nodes.find(e)!=nodes.end())
- {
- setOfChildren.insert(element);
- break;
- }
- }
- } break;
- case SMDSAbs_Face:
- {
- SMDS_ElemIteratorPtr itn=element->nodesIterator();
- while(itn->more())
- {
- const SMDS_MeshElement * e=itn->next();
- if(nodes.find(e)!=nodes.end())
- {
- setOfChildren.insert(element);
- break;
- }
- }
- if(hasConstructionEdges())
- {
- SMDS_ElemIteratorPtr ite=element->edgesIterator();
- while(ite->more())
- addChildrenWithNodes(setOfChildren, ite->next(), nodes);
- }
- } break;
- case SMDSAbs_Volume:
- {
- if(hasConstructionFaces())
- {
- SMDS_ElemIteratorPtr ite=element->facesIterator();
- while(ite->more())
- addChildrenWithNodes(setOfChildren, ite->next(), nodes);
- }
- else if(hasConstructionEdges())
- {
- SMDS_ElemIteratorPtr ite=element->edgesIterator();
- while(ite->more())
- addChildrenWithNodes(setOfChildren, ite->next(), nodes);
- }
- }
}
+ } break;
+ case SMDSAbs_Face:
+ {
+ SMDS_ElemIteratorPtr itn=element->nodesIterator();
+ while(itn->more())
+ {
+ const SMDS_MeshElement * e=itn->next();
+ if(nodes.find(e)!=nodes.end())
+ {
+ setOfChildren.insert(element);
+ break;
+ }
+ }
+ if(hasConstructionEdges())
+ {
+ SMDS_ElemIteratorPtr ite=element->edgesIterator();
+ while(ite->more())
+ addChildrenWithNodes(setOfChildren, ite->next(), nodes);
+ }
+ } break;
+ case SMDSAbs_Volume:
+ {
+ if(hasConstructionFaces())
+ {
+ SMDS_ElemIteratorPtr ite=element->facesIterator();
+ while(ite->more())
+ addChildrenWithNodes(setOfChildren, ite->next(), nodes);
+ }
+ else if(hasConstructionEdges())
+ {
+ SMDS_ElemIteratorPtr ite=element->edgesIterator();
+ while(ite->more())
+ addChildrenWithNodes(setOfChildren, ite->next(), nodes);
+ }
+ }
+ case SMDSAbs_All: break;
+ }
}
///////////////////////////////////////////////////////////////////////////////
else
delete (*it);
break;
+
+ case SMDSAbs_All:
+ case SMDSAbs_NbElementTypes: break;
}
if (vtkid >= 0)
{
myNodeMax=0;
return;
}
- while (!myNodes[myNodeMin] && (myNodeMin<myNodes.size()))
+ while ( !myNodes[myNodeMin] && myNodeMin < (int)myNodes.size() )
myNodeMin++;
myNodeMax=myNodes.size()-1;
while (!myNodes[myNodeMax] && (myNodeMin>=0))
int SMDS_Mesh::fromVtkToSmds(int vtkid)
{
- if (vtkid >= 0 && vtkid < myCellIdVtkToSmds.size())
+ if (vtkid >= 0 && vtkid < (int)myCellIdVtkToSmds.size())
return myCellIdVtkToSmds[vtkid];
throw SALOME_Exception(LOCALIZED ("vtk id out of bounds"));
}
{
assert(ID >= 0);
myElementIDFactory->adjustMaxId(ID);
- if (ID >= myCells.size())
+ if (ID >= (int)myCells.size())
myCells.resize(ID+SMDS_Mesh::chunkSize,0);
}
SMDS_MeshElementIDFactory *myElementIDFactory;
SMDS_MeshInfo myInfo;
+ //! any add, remove or change of node or cell
+ bool myModified;
//! use a counter to keep track of modifications
unsigned long myModifTime, myCompactTime;
bool myHasConstructionFaces;
bool myHasInverseElements;
- //! any add, remove or change of node or cell
- bool myModified;
-
double xmin;
double xmax;
double ymin;
//=======================================================================
SMDS_MeshElement* SMDS_MeshElementIDFactory::MeshElement(int ID)
{
- if ((ID<1) || (ID>=myMesh->myCells.size()))
+ if ( ID<1 || ID >= (int) myMesh->myCells.size() )
return NULL;
const SMDS_MeshElement* elem = GetMesh()->FindElement(ID);
return (SMDS_MeshElement*)(elem);
//MESSAGE("~~~~~~~~~~~~~~ SMDS_MeshElementIDFactory::ReleaseID smdsId vtkId " << ID << " " << vtkId);
if (vtkId >= 0)
{
- assert(vtkId < myMesh->myCellIdVtkToSmds.size());
+ assert(vtkId < (int)myMesh->myCellIdVtkToSmds.size());
myMesh->myCellIdVtkToSmds[vtkId] = -1;
myMesh->setMyModified();
}
{
myMin = INT_MAX;
myMax = 0;
- for (int i = 0; i < myMesh->myCells.size(); i++)
+ for (size_t i = 0; i < myMesh->myCells.size(); i++)
{
if (myMesh->myCells[i])
{
inline SMDS_MeshInfo& // operator=
SMDS_MeshInfo::operator=(const SMDS_MeshInfo& other)
-{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=(*other.myNb[i]);
+{ for ( size_t i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=(*other.myNb[i]);
myNbPolygons = other.myNbPolygons;
myNbQuadPolygons = other.myNbQuadPolygons;
myNbPolyhedrons = other.myNbPolyhedrons;
inline void // Clear
SMDS_MeshInfo::Clear()
-{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
+{ for ( size_t i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0;
}
int nb = 0;
switch (type) {
case SMDSAbs_All:
- for ( int i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
+ for ( size_t i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
nb += myNbPolygons + myNbQuadPolygons + myNbPolyhedrons;
break;
case SMDSAbs_Volume:
case SMDSEntity_Ball: return myNbBalls;
case SMDSEntity_Quad_Polygon: return myNbQuadPolygons;
case SMDSEntity_Quad_Polyhedra:
+ case SMDSEntity_Last:
break;
}
return 0;
case SMDSEntity_Triangle: myNbTriangles = nb; break;
case SMDSEntity_Quad_Polygon: myNbQuadPolygons = nb; break;
case SMDSEntity_Quad_Polyhedra:
+ case SMDSEntity_Last:
break;
}
}
class _MyEdgeIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
- int myIndex;
+ size_t myIndex;
public:
_MyEdgeIterator(const SMDS_MeshFace* face):myIndex(0) {
myElems.reserve( face->NbNodes() );
//=======================================================================
//class : _MyInterlacedNodeIterator
- //purpose :
+ //purpose :
//=======================================================================
class _MyInterlacedNodeIterator:public SMDS_NodeIterator
{
const vector<const SMDS_MeshNode *>& mySet;
- int myIndex;
- const int * myInterlace;
+ size_t myIndex;
+ const int * myInterlace;
public:
_MyInterlacedNodeIterator(const vector<const SMDS_MeshNode *>& s,
const int * interlace):
class _MyEdgeIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
- int myIndex;
+ size_t myIndex;
public:
_MyEdgeIterator(const SMDS_QuadraticFaceOfNodes* face):myIndex(0) {
myElems.reserve( face->NbNodes() );
int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId)
{
- if((vtkCellId < 0) || (vtkCellId >= _cellIdToDownId.size()))
- {
- //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId="
- // << vtkCellId << " max="<< _cellIdToDownId.size());
- return -1;
- }
+ if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size()))
+ {
+ //MESSAGE("SMDS_UnstructuredGrid::CellIdToDownId structure not up to date: vtkCellId="
+ // << vtkCellId << " max="<< _cellIdToDownId.size());
+ return -1;
+ }
return _cellIdToDownId[vtkCellId];
}
void SMDS_UnstructuredGrid::CleanDownwardConnectivity()
{
- for (int i = 0; i < _downArray.size(); i++)
- {
- if (_downArray[i])
- delete _downArray[i];
- _downArray[i] = 0;
- }
+ for (size_t i = 0; i < _downArray.size(); i++)
+ {
+ if (_downArray[i])
+ delete _downArray[i];
+ _downArray[i] = 0;
+ }
_cellIdToDownId.clear();
}
class _MySubIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
- int myIndex;
+ size_t myIndex;
public:
_MySubIterator(const SMDS_VolumeOfNodes* vol, SMDSAbs_ElementType type):myIndex(0) {
SMDS_VolumeTool vTool(vol);
const std::vector<int>& interlace = SMDS_MeshCell::toVtkOrder( VTKCellType( aVtkType ));
if ( !interlace.empty() )
{
- ASSERT( interlace.size() == nbNodes );
+ ASSERT( (int)interlace.size() == nbNodes );
std::vector<const SMDS_MeshNode*> initNodes( nodes, nodes+nbNodes );
for ( size_t i = 0; i < interlace.size(); ++i )
nodes[i] = initNodes[ interlace[i] ];
if ( n2 && ++nbNodes )
theNodes.insert( make_pair( l, n2 ));
- return theNodes.size() == nbNodes;
+ return (int)theNodes.size() == nbNodes;
}
//================================================================================
{
SMESH_HypoFilter* filter = new SMESH_HypoFilter();
filter->Init( filter->HasName( _compatibleHypothesis[0] ));
- for ( int i = 1; i < _compatibleHypothesis.size(); ++i )
+ for ( size_t i = 1; i < _compatibleHypothesis.size(); ++i )
filter->Or( filter->HasName( _compatibleHypothesis[ i ] ));
SMESH_HypoFilter* filterNoAux = new SMESH_HypoFilter( filter );
int _algoDim;
bool _isGlobalAlgo;
- TAlgoStateError(): _algoDim(0),_algo(0),_name(SMESH_Hypothesis::HYP_OK) {}
+ TAlgoStateError(): _name(SMESH_Hypothesis::HYP_OK), _algo(0), _algoDim(0) {}
void Set(TAlgoStateErrorName name, const SMESH_Algo* algo, bool isGlobal)
{ _name = name; _algo = algo; _algoDim = algo->GetDim(); _isGlobalAlgo = isGlobal; }
void Set(TAlgoStateErrorName name, const int algoDim, bool isGlobal)
{
const int shapeID = _mesh.GetMeshDS()->ShapeToIndex( _shape );
const TListOfListOfInt& listOfShapeIDList = _mesh.GetMeshOrder();
- TListOfListOfInt::const_iterator listsIt = listOfShapeIDList.begin();
+ TListOfListOfInt::const_iterator listsIt = listOfShapeIDList.begin();
for ( ; listsIt != listOfShapeIDList.end(); ++listsIt )
{
- const TListOfInt& idList = *listsIt;
+ const TListOfInt& idList = *listsIt;
TListOfInt::const_iterator idIt =
std::find( idList.begin(), idList.end(), shapeID );
if ( idIt != idList.end() && *idIt != idList.front() )
{
- for ( ; idIt != idList.end(); --idIt )
+ for ( --idIt; true; --idIt )
{
const TopoDS_Shape& shape = _mesh.GetMeshDS()->IndexToShape( *idIt );
if ( !shape.IsNull())
_preferableShapes.Add( shape );
+
+ if ( idIt == idList.begin() )
+ break;
}
}
}
case ALGO_1D: dim = 1; break;
case ALGO_2D: dim = 2; break;
case ALGO_3D: dim = 3; break;
+ case ALGO_0D: dim = 0; break;
case PARAM_ALGO:
dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break;
}
SMESH_Mesh* SMESH_Hypothesis::GetMeshByPersistentID(int id)
{
StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
- map<int, SMESH_Mesh*>::iterator itm = itm = myStudyContext->mapMesh.begin();
+ map<int, SMESH_Mesh*>::iterator itm = myStudyContext->mapMesh.begin();
for ( ; itm != myStudyContext->mapMesh.end(); itm++)
{
SMESH_Mesh* mesh = (*itm).second;
bool SMESH_Mesh::SynchronizeGroups()
{
- int nbGroups = _mapGroup.size();
+ size_t nbGroups = _mapGroup.size();
const set<SMESHDS_GroupBase*>& groups = _myMeshDS->GetGroups();
set<SMESHDS_GroupBase*>::const_iterator gIt = groups.begin();
for ( ; gIt != groups.end(); ++gIt )
{
const SMESHDS_SubMesh* sm = 0;
- int i = shapeIndex(shape);
+ size_t i = shapeIndex(shape);
if ( i < _subMeshes.size() )
sm = _subMeshes[i];
if ( !sm )
const SMESH_ProxyMesh::SubMesh*
SMESH_ProxyMesh::GetProxySubMesh(const TopoDS_Shape& shape) const
{
- int i = shapeIndex(shape);
+ size_t i = shapeIndex(shape);
return i < _subMeshes.size() ? _subMeshes[i] : 0;
}
!theAlgo->OnlyUnaryInput() ) // all adjacent shapes will be meshed by this algo?
return true;
- SMESH_Gen* gen =_father->GetGen();
-
// only local algo is to be checked
//if ( gen->IsGlobalHypothesis( theAlgo, *_father ))
if ( _subShape.ShapeType() == _father->GetMeshDS()->ShapeToMesh().ShapeType() )
{
_Iterator(SMDS_Iterator<SMESH_subMesh*>* subIt,
SMESH_subMesh* prepend,
- SMESH_subMesh* append): myIt(subIt),myAppend(append)
+ SMESH_subMesh* append): myAppend(append), myIt(subIt)
{
myCur = prepend ? prepend : myIt->more() ? myIt->next() : append;
if ( myCur == append ) append = 0;
bool SMESH_subMesh::FindIntersection(const SMESH_subMesh* theOther,
std::set<const SMESH_subMesh*>& theSetOfCommon ) const
{
- int oldNb = theSetOfCommon.size();
+ size_t oldNb = theSetOfCommon.size();
// check main submeshes
const map <int, SMESH_subMesh*>::const_iterator otherEnd = theOther->_mapDepend.end();
}
else
{
- if ( myVec.size() <= id )
+ if ( (int)myVec.size() <= id )
myVec.resize( id+1, (SUBMESH*) NULL );
myVec[ id ] = sm;
}
}
else
{
- return (SUBMESH*) ( id >= myVec.size() ? NULL : myVec[ id ]);
+ return (SUBMESH*) ( id >= (int)myVec.size() ? NULL : myVec[ id ]);
}
}
void DeleteAll()
disconnect( myDlg, SIGNAL( objectChanged( int, const QStringList& )),
this, SLOT ( onTextChanged( int, const QStringList& )));
+ connect( myDlg->myGroupListCmBox, SIGNAL( editTextChanged(const QString & )),
+ this, SLOT( updateButtons() ));
+
selectionDone();
}
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myFilterDlg(0),
mySelectedObject(SMESH::SMESH_IDSource::_nil()),
+ myFilterDlg(0),
myIsApplyAndClose( false )
{
QPixmap image (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_COPY_MESH")));
//=================================================================================
SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule):
QDialog(SMESH::GetDesktop(theModule)),
- mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
- mySMESHGUI(theModule)
+ mySMESHGUI(theModule),
+ mySelectionMgr(SMESH::GetSelectionMgr(theModule))
{
setModal(false);
setWindowTitle(tr("CAPTION"));
SMESH::SMESH_IDSource_var idSrc =
aMeshEditor->MakeIDSource( ids, SMESH::ElementType( iType+1 ));
- if ( myIDSource[ iType ]->length() <= index )
+ if ( (int) myIDSource[ iType ]->length() <= index )
myIDSource[ iType ]->length( index + 1 );
myIDSource[ iType ][ index ] = idSrc;
{
int nbSelected = 0;
if ( myTree->isEnabled() )
- for ( size_t i = 0; i < myTree->topLevelItemCount(); ++i )
+ for ( int i = 0; i < myTree->topLevelItemCount(); ++i )
{
QTreeWidgetItem* meshItem = myTree->topLevelItem( i );
int iM = meshItem->data( 0, Qt::UserRole ).toInt();
}
else
{
- for ( size_t iF = 0; iF < myFields->count(); ++iF )
+ for ( int iF = 0; iF < myFields->count(); ++iF )
{
GEOM::ListOfFields& fields = (*myFields)[ iF ].first.inout();
fields.length( 0 );
myElemTypeCombo->blockSignals(true);
myElemTypeCombo->clear();
int nbTypes = 0, hasNodes = 0;
- for ( int i = 0; i < types->length(); ++i )
+ for ( int i = 0; i < (int) types->length(); ++i )
{
switch ( types[i] ) {
case SMESH::NODE:
myDlg->myZ->GetValue(),
SMESH::ElementType( myDlg->myElemTypeCombo->currentId()));
myDlg->myFoundList->clear();
- for ( int i = 0; i < foundIds->length(); ++i )
+ for ( int i = 0; i < (int) foundIds->length(); ++i )
myDlg->myFoundList->addItem( QString::number( foundIds[i] ));
if ( foundIds->length() > 0 )
{
SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
- for( int i = 0; i < meshList.size(); i++ )
+ for( size_t i = 0; i < meshList.size(); i++ )
RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
}
}
QString GetMessageOnAlgoStateErrors(const algo_error_array& errors)
{
QString resMsg; // PAL14861 = QObject::tr("SMESH_WRN_MISSING_PARAMETERS") + ":\n";
- for ( int i = 0; i < errors.length(); ++i ) {
+ for ( size_t i = 0; i < errors.length(); ++i ) {
const SMESH::AlgoStateError & error = errors[ i ];
const bool hasAlgo = ( strlen( error.algoName ) != 0 );
QString msg;
break;
}
- for (int i = 0; i < aGroupsArray->length(); i++) {
+ for (int i = 0; i < (int)aGroupsArray->length(); i++) {
SMESH::long_array& aGroup = aGroupsArray[i];
QStringList anIDs;
- for (int j = 0; j < aGroup.length(); j++)
+ for (int j = 0; j < (int)aGroup.length(); j++)
anIDs.append(QString::number(aGroup[j]));
ListCoincident->addItem(anIDs.join(" "));
vtkPoints* aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(aNodesXYZ.length());
- for ( int i = 0; i < aNodesXYZ.length(); i++ ) {
+ for ( size_t i = 0; i < aNodesXYZ.length(); i++ ) {
aPoints->SetPoint( i, aNodesXYZ[i].x, aNodesXYZ[i].y, aNodesXYZ[i].z );
}
myGrid->SetPoints(aPoints);
vtkIdList *anIdList = vtkIdList::New();
int aNodePos = 0;
- for ( int i = 0; i < anElemTypes.length(); i++ ) {
+ for ( size_t i = 0; i < anElemTypes.length(); i++ ) {
const SMESH::ElementSubType& anElementSubType = anElemTypes[i];
SMDSAbs_ElementType aType = SMDSAbs_ElementType(anElementSubType.SMDS_ElementType);
vtkIdType aNbNodes = anElementSubType.nbNodesInElement;
myLabelActors.resize( nbArrows, ( vtkTextActor*) NULL );
char label[] = "X";
if ( labels )
- for ( int iP = 0, iA = 0; iA < nbArrows; ++iA )
+ for ( int iA = 0; iA < nbArrows; ++iA )
{
label[0] = labels[iA];
vtkTextMapper* text = vtkTextMapper::New();
{
vtkPoints* aPoints = myGrid->GetPoints();
- for ( int iP = 0, iA = 0; iA < myLabelActors.size(); ++iA )
+ for ( int iP = 0, iA = 0; iA < (int) myLabelActors.size(); ++iA )
{
gp_Trsf trsf;
trsf.SetTransformation( gp_Ax3( axes[iA].Location(), axes[iA].Direction() ), gp::XOY() );
const bool the3d2d,
bool theDoInit):
SMESHGUI_PreviewDlg(theModule),
- mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySMESHGUI(theModule)
{
setModal(false);
QLabel* dXLbl = new QLabel( tr("SMESH_DX"), myFacetSelGrp);
QLabel* dYLbl = new QLabel( tr("SMESH_DY"), myFacetSelGrp);
QLabel* dZLbl = new QLabel( tr("SMESH_DZ"), myFacetSelGrp);
- QPushButton* axisBtn[3];
for ( int i = 0; i < 3; ++i )
{
myPointSpin[i] = new SMESHGUI_SpinBox( myFacetSelGrp );
if ( sender() == myAxisBtn[i] )
break;
if ( i == 3 )
- i == 0;
+ i = 0;
myDirSpin[i]->SetValue(1.);
if ( myActor && !myMesh->_is_nil() && myMesh->NbNodes() > 0 )
//=================================================================================
SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ):
QDialog( SMESH::GetDesktop( theModule ) ),
- mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
mySMESHGUI( theModule )
{
setModal( false );
// purpose :
//=================================================================================
SMESHGUI_PreviewDlg::SMESHGUI_PreviewDlg(SMESHGUI* theModule) :
- mySMESHGUI(theModule),
QDialog(SMESH::GetDesktop( theModule )),
+ mySMESHGUI(theModule),
myIsApplyAndClose( false )
{
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
// purpose :
//=================================================================================
SMESHGUI_MultiPreviewDlg::SMESHGUI_MultiPreviewDlg( SMESHGUI* theModule ) :
- mySMESHGUI( theModule ),
QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
myIsApplyAndClose( false )
{
mySimulationList.clear();
SMESHGUI_RemoveElementsDlg
::SMESHGUI_RemoveElementsDlg(SMESHGUI* theModule)
: QDialog(SMESH::GetDesktop(theModule)),
- mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySMESHGUI(theModule),
myBusy(false),
myFilterDlg(0)
SMESHGUI_RemoveNodesDlg
::SMESHGUI_RemoveNodesDlg(SMESHGUI* theModule)
: QDialog(SMESH::GetDesktop(theModule)),
- mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySMESHGUI(theModule),
myBusy(false),
myFilterDlg(0)
if ( !aMesh )
return;
- int aNbUnits = 0;
-
- bool isNodeSelected = (myEditCurrentArgument == (QWidget*)SpinBox_X ||
+ bool isNodeSelected = ((myEditCurrentArgument == (QWidget*)SpinBox_X ) ||
(myEditCurrentArgument == (QWidget*)SpinBox_DX &&
myVectorDefinition==POINT_SELECT));
if ( !CORBA::is_nil( idSrc ) )
{
SMESH::array_of_ElementType_var types = idSrc->GetTypes();
- for ( int i = 0; i < types->length(); ++ i) {
+ for ( size_t i = 0; i < types->length(); ++ i) {
switch ( types[i] ) {
case SMESH::EDGE : dim = std::max( dim, 1 ); break;
case SMESH::FACE : dim = std::max( dim, 2 ); break;
SMESHGUI_SingleEditDlg
::SMESHGUI_SingleEditDlg(SMESHGUI* theModule)
: QDialog(SMESH::GetDesktop(theModule)),
- mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySMESHGUI(theModule)
{
setModal(false);
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myFilterDlg(0),
- mySelectedObject(SMESH::SMESH_IDSource::_nil())
+ mySelectedObject(SMESH::SMESH_IDSource::_nil()),
+ myFilterDlg(0)
{
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
if ( myObjects.isEmpty() )
return;
// get IDs from mesh
- /*
- SMDS_Mesh* aSMDSMesh = myActor->GetObject()->GetMesh();
- if (!aSMDSMesh)
- return;
-
- for (int i = aSMDSMesh->MinElementID(); i <= aSMDSMesh->MaxElementID(); i++) {
- const SMDS_MeshElement * e = aSMDSMesh->FindElement(i);
- if (e) {
- myElementsId += QString(" %1").arg(i);
- aNbUnits++;
- }
- }
- } else if (!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) { //SUBMESH
- // get submesh
- SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
-
- // get IDs from submesh
- /*
- SMESH::long_array_var anElementsIds = new SMESH::long_array;
- anElementsIds = aSubMesh->GetElementsId();
- for (int i = 0; i < anElementsIds->length(); i++) {
- myElementsId += QString(" %1").arg(anElementsIds[i]);
- }
- aNbUnits = anElementsIds->length();
- } else { // GROUP
- // get smesh group
- SMESH::SMESH_GroupBase_var aGroup =
- SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
- if (aGroup->_is_nil())
- return;
-
- // get IDs from smesh group
- SMESH::long_array_var anElementsIds = new SMESH::long_array;
- anElementsIds = aGroup->GetListOfID();
- for (int i = 0; i < anElementsIds->length(); i++) {
- myElementsId += QString(" %1").arg(anElementsIds[i]);
- }
- aNbUnits = anElementsIds->length();
- }
- */
+ // get IDs from submesh
+ // get IDs from smesh group
} else {
aNbUnits = SMESH::GetNameOfSelectedElements( mySelector, aList.First(), aString);
myElementsId = aString;
class toStrT : public _STRING {
CORBA::String_var myStr;
public:
- toStrT( char* s ): myStr(s), _STRING( s )
+ toStrT( char* s ): _STRING( s ), myStr(s)
{}
operator const char*() const
{ return myStr.in(); }
for ( int i = 0; i < 3; ++i )
{
const gp_Pnt& pn = myNodes->Value(n[i]);
- if ( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 ))
+ if (( avoidTria = ( pn.SquareDistance( *avoidPnt ) <= tol2 )))
break;
if ( !projectedOnly )
minD2 = Min( minD2, pn.SquareDistance( p ));
for ( ; edExp.More(); edExp.Next() )
{
- const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() );
+ //const TopoDS_Edge & edge = TopoDS::Edge( edExp.Current() );
StdMeshers_Regular_1D::Evaluate( theMesh, theShape, theResMap );
}
return true;
isOK = (load >> intVal);
if (isOK && intVal > 0) {
_edgeIDs.reserve( intVal );
- for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+ for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
isOK = (load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
#ifdef _DEBUG_
// #define DEB_FACES
// #define DEB_GRID
-// #define DUMP_VERT(msg,V) \
-// { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v); \
-// cout << msg << "( "<< p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl;}
+// #define DUMP_VERT(msg,V) { TopoDS_Vertex v = V; gp_Pnt p = BRep_Tool::Pnt(v); cout << msg << "( "<< p.X()<<", "<<p.Y()<<", "<<p.Z()<<" )"<<endl; }
#endif
#ifndef DUMP_VERT
const SMDS_MeshElement* firstQuad = 0; // most left face above the last row of found nodes
int nbFoundNodes = myIndexer._xSize;
- while ( nbFoundNodes != myGrid.size() )
+ while ( nbFoundNodes != (int) myGrid.size() )
{
// first and last nodes of the last filled row of nodes
const SMDS_MeshNode* n1down = myGrid[ nbFoundNodes - myIndexer._xSize ];
if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params ))
{
nbEdges++;
- for ( int i = 1; i < params.size(); ++i )
+ for ( size_t i = 1; i < params.size(); ++i )
_value = Max( _value, deflection( AdaptCurve, params[ i-1 ], params[ i ]));
}
}
if (isOK && intVal > 0) {
_params.clear();
_params.reserve( intVal );
- for (int i = 0; i < _params.capacity() && isOK; i++) {
+ for ( size_t i = 0; i < _params.capacity() && isOK; i++) {
isOK = (load >> dblVal);
if ( isOK ) _params.push_back( dblVal );
}
if (isOK && intVal > 0) {
_nbsegs.clear();
_nbsegs.reserve( intVal );
- for (int i = 0; i < _nbsegs.capacity() && isOK; i++) {
+ for ( size_t i = 0; i < _nbsegs.capacity() && isOK; i++) {
isOK = (load >> intVal);
if ( isOK ) _nbsegs.push_back( intVal );
}
if (isOK && intVal > 0) {
_edgeIDs.clear();
_edgeIDs.reserve( intVal );
- for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+ for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
isOK = (load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
{
aCubeSide[i]._columns.resize( aCubeSide[i]._u2nodesMap.size() );
- int iFwd = 0, iRev = aCubeSide[i]._columns.size()-1;
- int* pi = isReverse[i] ? &iRev : &iFwd;
+ size_t iFwd = 0, iRev = aCubeSide[i]._columns.size()-1;
+ size_t* pi = isReverse[i] ? &iRev : &iFwd;
TParam2ColumnMap::iterator u2nn = aCubeSide[i]._u2nodesMap.begin();
for ( ; iFwd < aCubeSide[i]._columns.size(); --iRev, ++iFwd, ++u2nn )
aCubeSide[i]._columns[ *pi ].swap( u2nn->second );
// import edges from groups
TNodeNodeMap* n2n;
TElemElemMap* e2e;
- for ( int iG = 0; iG < srcGroups.size(); ++iG )
+ for ( size_t iG = 0; iG < srcGroups.size(); ++iG )
{
const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
double mytol = a.Distance(edge->GetNode(edge->NbNodes()-1))/25;
//mytol = max(1.E-5, 10*edgeTol); // too strict and not necessary
//MESSAGE("mytol = " << mytol);
- for ( unsigned i = 0; i < newNodes.size(); ++i, ++node )
+ for ( size_t i = 0; i < newNodes.size(); ++i, ++node )
{
TNodeNodeMap::iterator n2nIt = n2n->insert( make_pair( *node, (SMDS_MeshNode*)0 )).first;
if ( n2nIt->second )
// copy meshes
vector<SMESH_Mesh*> srcMeshes = _sourceHyp->GetSourceMeshes();
- for ( unsigned i = 0; i < srcMeshes.size(); ++i )
+ for ( size_t i = 0; i < srcMeshes.size(); ++i )
importMesh( srcMeshes[i], theMesh, _sourceHyp, theShape );
return true;
(*e2eIt).second = newElem;
}
// copy free nodes
- if ( srcMeshDS->NbNodes() > n2n->size() )
+ if ( srcMeshDS->NbNodes() > (int) n2n->size() )
{
SMDS_NodeIteratorPtr nIt = srcMeshDS->nodesIterator();
while( nIt->more() )
// count edges imported from groups
int nbEdges = 0, nbQuadEdges = 0;
- for ( int iG = 0; iG < srcGroups.size(); ++iG )
+ for ( size_t iG = 0; iG < srcGroups.size(); ++iG )
{
const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
SMDS_ElemIteratorPtr srcElems = srcGroup->GetElements();
}
SMESH_subMesh * sm = theMesh.GetSubMesh(theShape);
- aResMap.insert(make_pair(sm,aVec));
+ aResMap.insert( make_pair( sm, aVec ));
return true;
}
set<const SMDS_MeshNode* > allNodes;
gp_XY uv;
double minGroupTol = 1e100;
- for ( int iG = 0; iG < srcGroups.size(); ++iG )
+ for ( size_t iG = 0; iG < srcGroups.size(); ++iG )
{
const SMESHDS_GroupBase* srcGroup = srcGroups[iG]->GetGroupDS();
const double groupTol = 0.5 * sqrt( getMinElemSize2( srcGroup ));
SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();
if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params ))
{
- for ( int i = 1; i < params.size(); ++i )
+ for ( size_t i = 1; i < params.size(); ++i )
_length += GCPnts_AbscissaPoint::Length( AdaptCurve, params[ i-1 ], params[ i ]);
nbEdges += params.size() - 1;
}
F = TopoDS::Face( _helper->GetSubShape() );
TopExp::MapShapesAndAncestors( F, TopAbs_VERTEX, TopAbs_WIRE, VWMap );
int nbVertices = 0;
- for ( int iW = 0; iW < wires.size(); ++iW )
+ for ( size_t iW = 0; iW < wires.size(); ++iW )
nbVertices += wires[ iW ]->NbEdges();
if ( nbVertices == VWMap.Extent() )
VWMap.Clear(); // wires have no common vertices
int m = 0;
- for ( int iW = 0; iW < wires.size(); ++iW )
+ for ( size_t iW = 0; iW < wires.size(); ++iW )
{
const vector<UVPtStruct>& uvPtVec = wires[ iW ]->GetUVPtStruct();
- if ( uvPtVec.size() != wires[ iW ]->NbPoints() ) {
+ if ((int) uvPtVec.size() != wires[ iW ]->NbPoints() ) {
return error(COMPERR_BAD_INPUT_MESH,SMESH_Comment("Unexpected nb of points on wire ")
<< iW << ": " << uvPtVec.size()<<" != "<<wires[ iW ]->NbPoints()
<< ", probably because of invalid node parameters on geom edges");
SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();
if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params ))
{
- for ( int i = 1; i < params.size(); ++i )
+ for ( size_t i = 1; i < params.size(); ++i )
_length += GCPnts_AbscissaPoint::Length( AdaptCurve, params[ i-1 ], params[ i ]);
nbEdges += params.size() - 1;
}
int nbFaceNodes = pE0->NbNodes();
if(myCreateQuadratic)
nbFaceNodes = nbFaceNodes/2;
- if ( aN.size() < nbFaceNodes * 2 )
+ if ( (int) aN.size() < nbFaceNodes * 2 )
aN.resize( nbFaceNodes * 2 );
//
for ( k=0; k<nbFaceNodes; ++k ) {
aNbNodes = pE0->NbNodes();
if(myCreateQuadratic)
aNbNodes = aNbNodes/2;
- if ( aNodes1.size() < aNbNodes )
+ if ( (int) aNodes1.size() < aNbNodes )
aNodes1.resize( aNbNodes );
//
k = aNbNodes-1; // reverse a face
nVec.resize( vsize, nullNode );
loadedNodes.insert( nVec[ 0 ] = node );
}
- if ( theIJNodes.size() != hsize ) {
+ if ( (int) theIJNodes.size() != hsize ) {
MESSAGE( "Wrong node positions on theBaseEdge" );
return false;
}
#ifdef _DEBUG_
#define DBGOUT(msg) //cout << msg << endl;
#define SHOWYXZ(msg, xyz) \
- // { gp_Pnt p (xyz); \
- // cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
+ //{ gp_Pnt p (xyz); cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
#else
#define DBGOUT(msg)
#define SHOWYXZ(msg, xyz)
}
}
-// #define SHOWYXZ(msg, xyz) { \
-// gp_Pnt p (xyz); \
-// cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; \
-// }
+// #define SHOWYXZ(msg, xyz) { gp_Pnt p(xyz); cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
+
// double _u[]={ 0.1, 0.1, 0.9, 0.9 };
// double _v[]={ 0.1, 0.9, 0.1, 0.9 };
// for ( int z = 0; z < 2; ++z )
#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
-#define SHOWYXZ(msg, xyz) // {\
-// gp_Pnt p (xyz); \
-// cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl;\
-// }
+#define SHOWYXZ(msg, xyz) \
+ //{gp_Pnt p(xyz); cout<<msg<< " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl; }
namespace TAssocTool = StdMeshers_ProjectionUtils;
shape2ShapeMap.Clear();
vector< int > edgeIdVec;
SMESH_Block::GetFaceEdgesIDs( fId, edgeIdVec );
- for ( int i = 0; i < edgeIdVec.size(); ++i ) {
+ for ( size_t i = 0; i < edgeIdVec.size(); ++i ) {
int eID = edgeIdVec[ i ];
shape2ShapeMap.Bind( scrShapes( eID ), tgtShapes( eID ));
if ( i < 2 ) {
// Get ordered edges and find index of anE in a sequence
edges.clear();
BRepTools_WireExplorer aWE (TopoDS::Wire(itA.Value()));
- int edgeIndex = 0;
+ size_t edgeIndex = 0;
for (; aWE.More(); aWE.Next()) {
TopoDS_Edge edge = aWE.Current();
edge.Orientation( aWE.Orientation() );
else {
// count nb sides
TopoDS_Edge prevEdge = anE;
- int nbSide = 0, eIndex = edgeIndex + 1;
- for ( int i = 0; i < edges.size(); ++i, ++eIndex )
+ size_t nbSide = 0, eIndex = edgeIndex + 1;
+ for ( size_t i = 0; i < edges.size(); ++i, ++eIndex )
{
if ( eIndex == edges.size() )
eIndex = 0;
}
return;
}
+ case MEANINGLESS_LAST: {
+ break;
+ }
} // switch by SubMeshState
- }
+
+ } // ProcessEvent()
} // namespace
{
const SMDS_MeshNode* _node;
double _u;
- int _edgeInd; // index in theSinuEdges vector
+ size_t _edgeInd; // index in theSinuEdges vector
NodePoint(): _node(0), _u(0), _edgeInd(-1) {}
NodePoint(const SMDS_MeshNode* n, double u, size_t iEdge ): _node(n), _u(u), _edgeInd(iEdge) {}
const vector<TopoDS_Edge>& theSinuEdges = theSinuFace._sinuEdges;
const vector< Handle(Geom_Curve) >& curves = theSinuFace._sinuCurves;
- SMESH_MAT2d::BoundaryPoint bp[2];
- const SMESH_MAT2d::Branch& branch = *theMA.getBranch(0);
+ //SMESH_MAT2d::BoundaryPoint bp[2];
+ //const SMESH_MAT2d::Branch& branch = *theMA.getBranch(0);
typedef TMAPar2NPoints::iterator TIterator;
{
// find an existing node on VERTEX among sameU2NP and get underlying EDGEs
const SMDS_MeshNode* existingNode = 0;
- set< int > edgeInds;
+ set< size_t > edgeInds;
NodePoint* np;
for ( size_t i = 0; i < sameU2NP.size(); ++i )
{
if ( u2NPprev->first < 0. ) ++u2NPprev;
if ( u2NPnext->first > 1. ) --u2NPnext;
- set< int >::iterator edgeID = edgeInds.begin();
+ set< size_t >::iterator edgeID = edgeInds.begin();
for ( ; edgeID != edgeInds.end(); ++edgeID )
{
// get U range on iEdge within which the equal points will be distributed
const double dksi = 0.5, deta = 0.5;
const double dksi2 = dksi*dksi, deta2 = deta*deta;
double err = 0., g11, g22, g12;
- int nbErr = 0;
+ //int nbErr = 0;
FaceQuadStruct& q = *quad;
UVPtStruct pNew;
- double refArea = area( q.UVPt(0,0), q.UVPt(1,0), q.UVPt(1,1) );
+ //double refArea = area( q.UVPt(0,0), q.UVPt(1,0), q.UVPt(1,1) );
for ( int iLoop = 0; iLoop < nbLoops; ++iLoop )
{
myParams = NULL;
myQuadList.clear();
- bool isOk = true;
- aStatus = SMESH_Hypothesis::HYP_OK;
+ aStatus = SMESH_Hypothesis::HYP_OK;
const list <const SMESHDS_Hypothesis * >& hyps =
GetUsedHypothesis(aMesh, aShape, false);
return isOK;
}
-/*//================================================================================
+//================================================================================
/*!
* \brief Finds vertices at the most sharp face corners
* \param [in] theFace - the FACE
//================================================================================
FaceQuadStruct::Side::Side(StdMeshers_FaceSidePtr theGrid)
- : grid(theGrid), nbNodeOut(0), from(0), to(theGrid ? theGrid->NbPoints() : 0 ), di(1)
+ : grid(theGrid), from(0), to(theGrid ? theGrid->NbPoints() : 0 ), di(1), nbNodeOut(0)
{
}
size_t iSeg = theReverse ? segLen.size()-1 : 0;
size_t dSeg = theReverse ? -1 : +1;
double param = theFirstU;
- int nbParams = 0;
+ size_t nbParams = 0;
for ( int i = 0, nb = segLen.size()-1; i < nb; ++i, iSeg += dSeg )
{
GCPnts_AbscissaPoint Discret( theC3d, segLen[ iSeg ], param );
case FIXED_POINTS_1D: {
const std::vector<double>& aPnts = _fpHyp->GetPoints();
const std::vector<int>& nbsegs = _fpHyp->GetNbSegments();
- int i = 0;
TColStd_SequenceOfReal Params;
- for(; i<aPnts.size(); i++) {
+ for ( size_t i = 0; i < aPnts.size(); i++ )
+ {
if( aPnts[i]<0.0001 || aPnts[i]>0.9999 ) continue;
int j=1;
bool IsExist = false;
}
double eltSize, segmentSize = 0.;
double currAbscissa = 0;
- for(i=0; i<Params.Length(); i++) {
- int nbseg = ( i > nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i];
+ for ( int i = 0; i < Params.Length(); i++ )
+ {
+ int nbseg = ( i > (int)nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i];
segmentSize = Params.Value(i+1)*theLength - currAbscissa;
currAbscissa += segmentSize;
GCPnts_AbscissaPoint APnt(theC3d, sign*segmentSize, par1);
par1 = par2;
}
// add for last
- int nbseg = ( nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0];
+ int nbseg = ( (int)nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0];
segmentSize = theLength - currAbscissa;
eltSize = segmentSize/nbseg;
GCPnts_UniformAbscissa Discret;
if (!isOK)
load.clear(ios::badbit | load.rdstate());
-
+
isOK = (load >> intVal);
if (isOK && intVal > 0) {
_edgeIDs.reserve( intVal );
- for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+ for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) {
isOK = (load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
//=============================================================================
/*!
- *
+ *
*/
//=============================================================================
{
hasVL = false;
for ( hyp = allHyps.begin(); hyp != allHyps.end() && !hasVL; ++hyp )
- if ( viscHyp = dynamic_cast<const THypVL*>( *hyp ))
+ if (( viscHyp = dynamic_cast<const THypVL*>( *hyp )))
hasVL = viscHyp->IsShapeWithLayers( neighbourID );
}
if ( !hasVL )
_PolyLine::TEdgeIterator eIt = isR ? L._lEdges.end()-1 : L._lEdges.begin();
if ( eIt->_length2D == 0 ) continue;
_Segment seg1( eIt->_uvOut, eIt->_uvIn );
- for ( eIt += deltaIt; nbRemove < L._lEdges.size()-1; eIt += deltaIt )
+ for ( eIt += deltaIt; nbRemove < (int)L._lEdges.size()-1; eIt += deltaIt )
{
_Segment seg2( eIt->_uvOut, eIt->_uvIn );
if ( !intersection.Compute( seg1, seg2 ))
++nbRemove;
}
if ( nbRemove > 0 ) {
- if ( nbRemove == L._lEdges.size()-1 ) // 1st and last _LayerEdge's intersect
+ if ( nbRemove == (int)L._lEdges.size()-1 ) // 1st and last _LayerEdge's intersect
{
--nbRemove;
_LayerEdge& L0 = L._lEdges.front();
// store a proxyMesh in a sub-mesh
// make faces on each _PolyLine
vector< double > layersHeight;
- double prevLen2D = -1;
+ //double prevLen2D = -1;
for ( size_t iL = 0; iL < _polyLineVec.size(); ++iL )
{
_PolyLine& L = _polyLineVec[ iL ];
void _SegmentTree::buildChildrenData()
{
- for ( int i = 0; i < _segments.size(); ++i )
+ for ( size_t i = 0; i < _segments.size(); ++i )
for (int j = 0; j < nbChildren(); j++)
if ( !myChildren[j]->getBox()->IsOut( *_segments[i]._seg->_uv[0],
*_segments[i]._seg->_uv[1] ))
for (int j = 0; j < nbChildren(); j++)
{
_SegmentTree* child = static_cast<_SegmentTree*>( myChildren[j]);
- child->myIsLeaf = ( child->_segments.size() <= maxNbSegInLeaf() );
+ child->myIsLeaf = ((int) child->_segments.size() <= maxNbSegInLeaf() );
}
}
if ( isLeaf() )
{
- for ( int i = 0; i < _segments.size(); ++i )
+ for ( size_t i = 0; i < _segments.size(); ++i )
if ( !_segments[i].IsOut( seg ))
found.push_back( _segments[i]._seg );
}
if ( isLeaf() )
{
- for ( int i = 0; i < _segments.size(); ++i )
+ for ( size_t i = 0; i < _segments.size(); ++i )
if ( !_segments[i].IsOut( ray ))
found.push_back( _segments[i]._seg );
}
case TabFunc : {
//valStr += tr("SMESH_TAB_FUNC");
bool param = true;
- for( int i=0; i < data.myTable.length(); i++, param = !param ) {
+ for( size_t i=0; i < data.myTable.length(); i++, param = !param ) {
if ( param )
valStr += "[";
valStr += QString::number( data.myTable[ i ]);
std::vector< int > * chain = 0;
if ( QListWidgetItem * item = myListWidget->currentItem() )
{
- int i = item->data( Qt::UserRole ).toInt();
+ size_t i = (size_t) item->data( Qt::UserRole ).toInt();
if ( 0 <= i && i < myChains.size() )
chain = & myChains[i];
}
GEOM::ListOfGO_var shapes;
SMESH::nodes_array_var points;
h->GetEnforcedNodes( shapes, points );
- for ( int i = 0; i < shapes->length(); ++i )
+ for ( size_t i = 0; i < shapes->length(); ++i )
{
CORBA::String_var name = shapes[i]->GetName();
CORBA::String_var entry = shapes[i]->GetStudyEntry();
item->setData( Qt::UserRole, entry.in() );
myShapesList->addItem( item );
}
- for ( int i = 0; i < points->length(); ++i )
+ for ( size_t i = 0; i < points->length(); ++i )
{
QTreeWidgetItem* item = new QTreeWidgetItem
( QStringList()
StdMeshersGUI_SubShapeSelectorWdg
::StdMeshersGUI_SubShapeSelectorWdg( QWidget * parent, TopAbs_ShapeEnum aSubShType ):
QWidget( parent ),
- myPreviewActor( 0 ),
- myMaxSize( -1 )
+ myMaxSize( -1 ),
+ myPreviewActor( 0 )
{
QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> ids = this->GetImpl()->GetReversedEdges();
anArray->length( ids.size() );
- for ( CORBA::Long i = 0; i < ids.size(); i++)
+ for ( CORBA::ULong i = 0; i < ids.size(); i++)
anArray [ i ] = ids [ i ];
return anArray._retn();
(PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl )
-: StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl),
- SMESH_Hypothesis_i( thePOA )
+:SMESH_Hypothesis_i( thePOA ),
+ StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl)
{
MESSAGE( "StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i" );
myBaseImpl = new ::StdMeshers_LayerDistribution2D(theGenImpl->GetANewId(),
(PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl)
-: StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl),
- SMESH_Hypothesis_i( thePOA )
+ :SMESH_Hypothesis_i( thePOA ),
+ StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl)
{
MESSAGE("StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i");
myBaseImpl = new ::StdMeshers_NumberOfLayers2D(theGenImpl->GetANewId(),
SMESH::TPythonDump() << _this() << ".SetExpressionFunction( '" << expr << "' )";
}
catch ( SALOME_Exception& S_ex ) {
- THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
}
}
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> ids = this->GetImpl()->GetReversedEdges();
anArray->length( ids.size() );
- for ( CORBA::Long i = 0; i < ids.size(); i++)
+ for ( CORBA::ULong i = 0; i < ids.size(); i++)
anArray [ i ] = ids [ i ];
return anArray._retn();
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> ids = this->GetImpl()->GetReversedEdges();
anArray->length( ids.size() );
- for ( CORBA::Long i = 0; i < ids.size(); i++)
+ for ( CORBA::ULong i = 0; i < ids.size(); i++)
anArray [ i ] = ids [ i ];
return anArray._retn();