return aShape;
}
-//=======================================================================
-//function : findEdge
-//purpose :
-//=======================================================================
-
-static int findEdge(const SMDS_MeshNode* aNode,
- const SMESHDS_Mesh* aMesh,
- const int nEdge,
- const TopoDS_Shape* t_Edge) {
-
- TopoDS_Shape aPntShape, foundEdge;
- TopoDS_Vertex aVertex;
- gp_Pnt aPnt( aNode->X(), aNode->Y(), aNode->Z() );
-
- int foundInd, ind;
- double nearest = RealLast(), *t_Dist;
- double epsilon = Precision::Confusion();
-
- t_Dist = new double[ nEdge ];
- aPntShape = BRepBuilderAPI_MakeVertex( aPnt ).Shape();
- aVertex = TopoDS::Vertex( aPntShape );
-
- for ( ind=0; ind < nEdge; ind++ ) {
- BRepExtrema_DistShapeShape aDistance ( aVertex, t_Edge[ind] );
- t_Dist[ind] = aDistance.Value();
- if ( t_Dist[ind] < nearest ) {
- nearest = t_Dist[ind];
- foundEdge = t_Edge[ind];
- foundInd = ind;
- if ( nearest < epsilon )
- ind = nEdge;
- }
- }
-
- delete [] t_Dist;
- return aMesh->ShapeToIndex( foundEdge );
-}
-
//=======================================================================
//function : getNbShape
//purpose :
const TopoDS_Shape* tabShape,
double** tabBox)
{
- // ---------------------------------
- // Optimisation of the plugin ...
- // Retrieve the correspondance edge --> shape
- // (which is very costly) only when user
- // has defined at least one group of edges
- // which should be rare for a 3d mesh !
- // ---------------------------------
-
- bool retrieve_edges = false;
- const std::set<SMESHDS_GroupBase*>& aGroups = theMesh->GetGroups();
- set<SMESHDS_GroupBase*>::const_iterator GrIt = aGroups.begin();
- for (; GrIt != aGroups.end(); GrIt++)
- {
- SMESHDS_GroupBase* aGrp = *GrIt;
- if ( !aGrp )
- continue;
- if ( aGrp->GetType() == SMDSAbs_Edge )
- {
- retrieve_edges = true;
- break;
- }
- }
-
// ---------------------------------
// Read generated elements and nodes
// ---------------------------------
}
nbElem = 0;
- if ( nField < (mapField.size() - 1) && nField >= 0 )
+ if ( nField < int(mapField.size() - 1) && nField >= 0 )
fileRes >> nbElem;
switch (nField) {
if ( aPnt.Distance( HexoticPnt ) < epsilon )
break;
}
+ if ( nodeAssigne[ nodeID[0] ] != 0 ) { // because "Edges" go before "Corners"
+ theMesh->UnSetNodeOnShape( node[0] );
+ nodeAssigne[ nodeID[0] ] = 0;
+ }
break;
}
case 4: { // "Edges"
int iNode = 1;
if ( nodeAssigne[ nodeID[0] ] == 0 || nodeAssigne[ nodeID[0] ] == 2 )
iNode = 0;
- if(retrieve_edges)
- shapeID = findEdge( node[iNode], theMesh, nbShapeEdge, tabEdge );
- else
- shapeID = 0;
+ shapeID = dummy;
break;
}
case 5: { // "Ridges"
}
nbElem = 0;
- if ( nField < (mapField.size() - 1) && nField >= 0 )
+ if ( nField < int(mapField.size() - 1) && nField >= 0 )
fileRes >> nbElem;
switch (nField) {
//purpose :
//=======================================================================
-static TCollection_AsciiString getTmpDir()
-{
- TCollection_AsciiString aTmpDir;
-
- char *Tmp_dir = getenv("SALOME_TMP_DIR");
-#ifdef WIN32
- if(Tmp_dir == NULL) {
- Tmp_dir = getenv("TEMP");
- if( Tmp_dir== NULL )
- Tmp_dir = getenv("TMP");
- }
-#endif
-
- if(Tmp_dir != NULL) {
- aTmpDir = Tmp_dir;
-#ifdef WIN32
- if(aTmpDir.Value(aTmpDir.Length()) != '\\') aTmpDir+='\\';
-#else
- if(aTmpDir.Value(aTmpDir.Length()) != '/') aTmpDir+='/';
-#endif
- }
- else {
-#ifdef WIN32
- aTmpDir = TCollection_AsciiString("C:\\");
-#else
- aTmpDir = TCollection_AsciiString("/tmp/");
-#endif
- }
- return aTmpDir;
-}
+// static TCollection_AsciiString getTmpDir()
+// {
+// TCollection_AsciiString aTmpDir;
+
+// char *Tmp_dir = getenv("SALOME_TMP_DIR");
+// #ifdef WIN32
+// if(Tmp_dir == NULL) {
+// Tmp_dir = getenv("TEMP");
+// if( Tmp_dir== NULL )
+// Tmp_dir = getenv("TMP");
+// }
+// #endif
+
+// if(Tmp_dir != NULL) {
+// aTmpDir = Tmp_dir;
+// #ifdef WIN32
+// if(aTmpDir.Value(aTmpDir.Length()) != '\\') aTmpDir+='\\';
+// #else
+// if(aTmpDir.Value(aTmpDir.Length()) != '/') aTmpDir+='/';
+// #endif
+// }
+// else {
+// #ifdef WIN32
+// aTmpDir = TCollection_AsciiString("C:\\");
+// #else
+// aTmpDir = TCollection_AsciiString("/tmp/");
+// #endif
+// }
+// return aTmpDir;
+// }
//=======================================================================
//function : getSuffix
cout << " " << _name << " Growth = " << _growth << std::endl;
if (!_facesWithLayers.empty()) {
cout << " " << _name << " Faces with layers = ";
- for (int i = 0; i < _facesWithLayers.size(); i++)
+ for (size_t i = 0; i < _facesWithLayers.size(); i++)
{
cout << _facesWithLayers.at(i);
if ((i + 1) != _facesWithLayers.size())
}
if (!_imprintedFaces.empty()) {
cout << " " << _name << " Imprinted faces = ";
- for (int i = 0; i < _imprintedFaces.size(); i++)
+ for (size_t i = 0; i < _imprintedFaces.size(); i++)
{
cout << _imprintedFaces.at(i);
if ((i + 1) != _imprintedFaces.size())
firstLayerSize = _firstLayerSize;
direction = _direction ? "1" : "-1";
growth = _growth;
- for (int i = 0; i < _facesWithLayers.size(); i++)
+ for (size_t i = 0; i < _facesWithLayers.size(); i++)
{
facesWithLayers += _facesWithLayers[i];
if ((i + 1) != _facesWithLayers.size())
facesWithLayers += ",";
}
- for (int i = 0; i < _imprintedFaces.size(); i++)
+ for (size_t i = 0; i < _imprintedFaces.size(); i++)
{
imprintedFaces += _imprintedFaces[i];
if ((i + 1) != _imprintedFaces.size())
removeFile(Hexotic_Out);
removeFile(Hexotic_In);
removeFile(aLogFileName);
- for( int i=0; i<sizeMapFiles.size(); i++)
+ for( size_t i=0; i<sizeMapFiles.size(); i++)
{
removeFile( TCollection_AsciiString(sizeMapFiles[i].c_str()) );
}
_hexoticInvalidElements( GetDefaultHexoticInvalidElements() ),
_hexoticSharpAngleThreshold( GetDefaultHexoticSharpAngleThreshold() ),
_hexoticNbProc( GetDefaultHexoticNbProc() ),
- _hexoticWorkingDirectory( GetDefaultHexoticWorkingDirectory() ),
_hexoticSdMode(GetDefaultHexoticSdMode()),
_hexoticVerbosity(GetDefaultHexoticVerbosity()),
_hexoticMaxMemory(GetDefaultHexoticMaxMemory()),
_textOptions(GetDefaultTextOptions()),
_sizeMaps(GetDefaultHexoticSizeMaps()),
+ _hexoticWorkingDirectory( GetDefaultHexoticWorkingDirectory() ),
_nbLayers(GetDefaultNbLayers()),
_firstLayerSize(GetDefaultFirstLayerSize()),
_direction(GetDefaultDirection()),
bool HexoticPlugin_Hypothesis::SetFacesWithLayers(const std::vector<int>& theVal) {
if ( _facesWithLayers != theVal ) {
- _facesWithLayers = theVal;
+ _facesWithLayers = theVal;
NotifySubMeshesHypothesisModification();
return true;
}
bool HexoticPlugin_Hypothesis::SetImprintedFaces(const std::vector<int>& theVal) {
if ( _imprintedFaces != theVal ) {
- _imprintedFaces = theVal;
+ _imprintedFaces = theVal;
NotifySubMeshesHypothesisModification();
return true;
}
{
//explicit outputs for future code compatibility of saved .hdf
//save without any whitespaces!
- int dummy = -1;
+ //int dummy = -1;
save<<"hexesMinLevel="<<_hexesMinLevel<<";";
save<<"hexesMaxLevel="<<_hexesMaxLevel<<";";
save<<"hexoticIgnoreRidges="<<(int)_hexoticIgnoreRidges<<";";
if ( !_facesWithLayers.empty() )
{
save<<"facesWithLayers=";
- for ( int i = 0; i < _facesWithLayers.size(); i++ )
+ for ( size_t i = 0; i < _facesWithLayers.size(); i++ )
{
save<< _facesWithLayers.at(i) << "#" ;
}
if ( !_imprintedFaces.empty() )
{
save<<"imprintedFaces=";
- for ( int i = 0; i < _imprintedFaces.size(); i++ )
+ for ( size_t i = 0; i < _imprintedFaces.size(); i++ )
{
save<< _imprintedFaces.at(i) << "#" ;
}
if (str3 == "facesWithLayers")
{
std::string id;
- int pos = 0;
+ size_t pos = 0;
while ( pos < str4.length() )
{
int found = str4.find('#',pos);
if (str3 == "imprintedFaces")
{
std::string id;
- int pos = 0;
+ size_t pos = 0;
while ( pos < str4.length() )
{
int found = str4.find('#',pos);