int is;
double val;
- isOK = (load >> val);
+ isOK = static_cast<bool>(load >> val);
if (isOK)
_maxSize = val;
else
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> is);
+ isOK = static_cast<bool>(load >> is);
if (isOK)
SetFineness((Fineness) is);
else
if (_fineness == UserDefined)
{
- isOK = (load >> val);
+ isOK = static_cast<bool>(load >> val);
if (isOK)
_growthRate = val;
else
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> val);
+ isOK = static_cast<bool>(load >> val);
if (isOK)
_nbSegPerEdge = val;
else
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> val);
+ isOK = static_cast<bool>(load >> val);
if (isOK)
_nbSegPerRadius = val;
else
load.clear(ios::badbit | load.rdstate());
}
- isOK = (load >> is);
+ isOK = static_cast<bool>(load >> is);
if (isOK)
_secondOrder = (bool) is;
else
load.clear(ios::badbit | load.rdstate());
- isOK = (load >> is);
+ isOK = static_cast<bool>(load >> is);
if (isOK)
_optimize = (bool) is;
else
std::string option_or_sm;
bool hasLocalSize = false;
- isOK = (load >> option_or_sm);
+ isOK = static_cast<bool>(load >> option_or_sm);
if (isOK)
if (option_or_sm == "__LOCALSIZE_BEGIN__")
hasLocalSize = true;
std::string smEntry, smValue;
while (isOK && hasLocalSize) {
- isOK = (load >> smEntry);
+ isOK = static_cast<bool>(load >> smEntry);
if (isOK) {
if (smEntry == "__LOCALSIZE_END__")
break;
- isOK = (load >> smValue);
+ isOK = static_cast<bool>(load >> smValue);
}
if (isOK) {
std::istringstream tmp(smValue);
if ( !hasLocalSize && !option_or_sm.empty() )
_minSize = atof( option_or_sm.c_str() );
- isOK = ( load >> _quadAllowed );
+ isOK = static_cast<bool>( load >> _quadAllowed );
if ( !isOK )
_quadAllowed = GetDefaultQuadAllowed();
- isOK = ( load >> _surfaceCurvature );
+ isOK = static_cast<bool>( load >> _surfaceCurvature );
if ( !isOK )
_surfaceCurvature = GetDefaultSurfaceCurvature();
- isOK = ( load >> _fuseEdges );
+ isOK = static_cast<bool>( load >> _fuseEdges );
if ( !isOK )
_fuseEdges = GetDefaultFuseEdges();
const NETGENPlugin_Hypothesis::TLocalSize localSizes = hyp->GetLocalSizesAndEntries();
NETGENPlugin_Hypothesis::TLocalSize::const_iterator it = localSizes.begin();
- for (it ; it != localSizes.end() ; it++)
+ for ( ; it != localSizes.end() ; it++)
{
std::string entry = (*it).first;
double val = (*it).second;
Standard_Boolean IsEqual(const Link& aLink1, const Link& aLink2)
{
- return (aLink1.n1 == aLink2.n1 && aLink1.n2 == aLink2.n2 ||
- aLink1.n1 == aLink2.n2 && aLink1.n2 == aLink2.n1);
+ return (( aLink1.n1 == aLink2.n1 && aLink1.n2 == aLink2.n2 ) ||
+ ( aLink1.n1 == aLink2.n2 && aLink1.n2 == aLink2.n1 ));
}
namespace
// get ordered EDGEs
list< TopoDS_Edge > edges;
list< int > nbEdgesInWire;
- int nbWires = SMESH_Block::GetOrderedEdges( face, edges, nbEdgesInWire);
+ /*int nbWires =*/ SMESH_Block::GetOrderedEdges( face, edges, nbEdgesInWire);
// find <edge> within <edges>
list< TopoDS_Edge >::iterator eItFwd = edges.begin();
SMESH_ProxyMesh::Ptr proxyMesh)
{
TNode2IdMap nodeNgIdMap;
- for ( int i = 1; i < nodeVec.size(); ++i )
+ for ( size_t i = 1; i < nodeVec.size(); ++i )
nodeNgIdMap.insert( make_pair( nodeVec[i], i ));
TopTools_MapOfShape visitedShapes;
{
// duplicate faces
int i, nbFaces = ngMesh.GetNSE();
- for (int i = 1; i <= nbFaces; ++i)
+ for ( i = 1; i <= nbFaces; ++i)
{
netgen::Element2d elem = ngMesh.SurfaceElement(i);
if ( ngFaceIds.count( elem.GetIndex() ))
if ( occgeom.fmap.Extent() < faceID )
return false;
- const TopoDS_Face& face = TopoDS::Face( occgeom.fmap( faceID ));
+ //const TopoDS_Face& face = TopoDS::Face( occgeom.fmap( faceID ));
// find free links on the FACE
NCollection_Map<Link> linkMap;
vector<const SMDS_MeshNode*>& nodeVec,
NETGENPlugin_Internals& internalShapes)
{
- if ( nodeVec.size() < ngMesh.GetNP() )
+ if ((int) nodeVec.size() < ngMesh.GetNP() )
nodeVec.resize( ngMesh.GetNP(), 0 );
SMESHDS_Mesh* meshDS = internalShapes.getMesh().GetMeshDS();
<< "smesh = smeshBuilder.New(salome.myStudy)"<<endl
<< "m = smesh.Mesh(name='triangles')" << endl;
#endif
- if ( nodeVec.size() < ngMesh.GetNP() )
+ if ((int) nodeVec.size() < ngMesh.GetNP() )
nodeVec.resize( ngMesh.GetNP(), 0 );
SMESHDS_Mesh* meshDS = internalShapes.getMesh().GetMeshDS();
// decide whether to use the closest node and the node with best angle or to create new ones
for ( int isBestAngleN = 0; isBestAngleN < 2; ++isBestAngleN )
{
- bool createNew = !angleOK, distOK = true;
+ bool createNew = !angleOK; //, distOK = true;
double distFromV;
int triInd = isBestAngleN ? 2 : 1;
mp[isBestAngleN] = ngMesh.Point( tri[triInd] );
// Check wires and count nodes
// ----------------------------
int nbNodes = 0;
- for ( int iW = 0; iW < wires.size(); ++iW )
+ for ( size_t iW = 0; iW < wires.size(); ++iW )
{
StdMeshers_FaceSidePtr wire = wires[ iW ];
if ( wire->MissVertexNode() )
// (new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH, "Missing nodes on vertices"));
}
const vector<UVPtStruct>& uvPtVec = wire->GetUVPtStruct();
- if ( uvPtVec.size() != wire->NbPoints() )
+ if ((int) uvPtVec.size() != wire->NbPoints() )
return SMESH_ComputeError::New(COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Unexpected nb of points on wire ") << iW
<< ": " << uvPtVec.size()<<" != "<<wire->NbPoints());
if ( !wasNgMeshEmpty ) // fill node2ngID with nodes built by NETGEN
{
set< int > subIDs; // ids of sub-shapes of the FACE
- for ( int iW = 0; iW < wires.size(); ++iW )
+ for ( size_t iW = 0; iW < wires.size(); ++iW )
{
StdMeshers_FaceSidePtr wire = wires[ iW ];
for ( int iE = 0, nbE = wire->NbEdges(); iE < nbE; ++iE )
if ( ngMesh.GetNFD() < 1 )
ngMesh.AddFaceDescriptor (netgen::FaceDescriptor(faceID, solidID, solidID, 0));
- for ( int iW = 0; iW < wires.size(); ++iW )
+ for ( size_t iW = 0; iW < wires.size(); ++iW )
{
StdMeshers_FaceSidePtr wire = wires[ iW ];
const vector<UVPtStruct>& uvPtVec = wire->GetUVPtStruct();
int edgeID = 1, posID = -2;
bool isInternalWire = false;
double vertexNormPar = 0;
- const int prevNbNGSeg = ngMesh.GetNSeg();
+ //const int prevNbNGSeg = ngMesh.GetNSeg();
for ( int i = 0; i < nbSegments; ++i ) // loop on segments
{
// Add the first point of a segment
for (int j=1; j <= elem.GetNP(); ++j)
{
int pind = elem.PNum(j);
- if ( pind < 1 || pind >= nodeVec.size() )
+ if ( pind < 1 || pind >= (int) nodeVec.size() )
break;
if ( SMDS_MeshNode* node = nodeVec_ACCESS(pind))
{
}
}
}
- if ( nodes.size() != elem.GetNP() )
+ if ((int) nodes.size() != elem.GetNP() )
{
if ( comment.empty() )
comment << "Invalid netgen 2d element #" << i;
for (int j=1; j <= elem.GetNP(); ++j)
{
int pind = elem.PNum(j);
- if ( pind < 1 || pind >= nodeVec.size() )
+ if ( pind < 1 || pind >= (int)nodeVec.size() )
break;
if ( SMDS_MeshNode* node = nodeVec_ACCESS(pind) )
{
meshDS->SetNodeInVolume(node, aSolid);
}
}
- if ( nodes.size() != elem.GetNP() )
+ if ((int) nodes.size() != elem.GetNP() )
{
if ( comment.empty() )
comment << "Invalid netgen 3d element #" << i;
vector<int> three1(3), three2(3);
const char* badEdgeStr = " multiple times in surface mesh";
const int badEdgeStrLen = strlen( badEdgeStr );
+ const int nbNodes = nodeVec.size();
while( !file.eof() )
{
if ( strncmp( file, "Edge ", 5 ) == 0 &&
file.getInts( two ) &&
strncmp( file, badEdgeStr, badEdgeStrLen ) == 0 &&
- two[0] < nodeVec.size() && two[1] < nodeVec.size())
+ two[0] < nbNodes && two[1] < nbNodes )
{
err->myBadElements.push_back( new SMDS_LinearEdge( nodeVec[ two[0]], nodeVec[ two[1]] ));
file += badEdgeStrLen;
ok = ok && file.getInts( three1 );
ok = ok && file.getInts( three2 );
for ( int i = 0; ok && i < 3; ++i )
- ok = ( three1[i] < nodeVec.size() && nodeVec[ three1[i]]);
+ ok = ( three1[i] < nbNodes && nodeVec[ three1[i]]);
for ( int i = 0; ok && i < 3; ++i )
- ok = ( three2[i] < nodeVec.size() && nodeVec[ three2[i]]);
+ ok = ( three2[i] < nbNodes && nodeVec[ three2[i]]);
if ( ok )
{
err->myBadElements.push_back( new SMDS_FaceOfNodes( nodeVec[ three1[0]],