#include "DriverMED_R_SMESHDS_Mesh.h"
#include "DriverUNV_R_SMDS_Mesh.h"
#include "DriverSTL_R_SMDS_Mesh.h"
+#ifdef WITH_CGNS
#include "DriverCGNS_Read.hxx"
#include "DriverCGNS_Write.hxx"
+#endif
#undef _Precision_HeaderFile
#include <BRepBndLib.hxx>
const int theMeshIndex,
std::string& theMeshName)
{
+ int res = Driver_Mesh::DRS_FAIL;
+#ifdef WITH_CGNS
+
DriverCGNS_Read myReader;
myReader.SetMesh(_myMeshDS);
myReader.SetFile(theFileName);
myReader.SetMeshId(theMeshIndex);
- int res = myReader.Perform();
+ res = myReader.Perform();
theMeshName = myReader.GetMeshName();
// create groups
SynchronizeGroups();
+#endif
return res;
}
SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp);
- // subShapes
+ // sub-shapes
if (!SMESH_Hypothesis::IsStatusFatal(ret) &&
anHyp->GetDim() <= SMESH_Gen::GetShapeDim(aSubShape)) // is added on father
{
subMesh->CheckConcurentHypothesis( anHyp->GetType() ) != SMESH_Hypothesis::HYP_OK)
ret = SMESH_Hypothesis::HYP_CONCURENT;
- // subShapes
+ // sub-shapes
if (!SMESH_Hypothesis::IsStatusFatal(ret) &&
anHyp->GetDim() <= SMESH_Gen::GetShapeDim(aSubShape)) // is removed from father
{
}
//================================================================================
/*!
- * \brief Return submeshes of groups containing the given subshape
+ * \brief Return submeshes of groups containing the given sub-shape
*/
//================================================================================
{
Unexpect aCatch(SalomeException);
+ if ( !GetMeshDS()->IsUsedHypothesis( hyp ))
+ return;
+
const SMESH_Algo *foundAlgo = 0;
SMESH_HypoFilter algoKind, compatibleHypoKind;
list <const SMESHDS_Hypothesis * > usedHyps;
return true;
}
- if ( !hasComputed )
+ if ( NbNodes() < 1 )
const_cast<SMESH_Mesh*>(this)->_isModified = false;
return false;
myWriter.Perform();
}
+void SMESH_Mesh::ExportSAUV(const char *file,
+ const char* theMeshName,
+ bool theAutoGroups)
+ throw(SALOME_Exception)
+{
+ std::string medfilename(file);
+ medfilename += ".med";
+ std::string cmd;
+#ifdef WNT
+ cmd = "%PYTHONBIN% ";
+#else
+ cmd = "python ";
+#endif
+ cmd += "-c \"";
+ cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
+ cmd += "\"";
+ system(cmd.c_str());
+ ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, 1);
+#ifdef WNT
+ cmd = "%PYTHONBIN% ";
+#else
+ cmd = "python ";
+#endif
+ cmd += "-c \"";
+ cmd += "from medutilities import convert ; convert(r'" + medfilename + "', 'MED', 'GIBI', 1, r'" + file + "')";
+ cmd += "\"";
+ system(cmd.c_str());
+#ifdef WNT
+ cmd = "%PYTHONBIN% ";
+#else
+ cmd = "python ";
+#endif
+ cmd += "-c \"";
+ cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')";
+ cmd += "\"";
+ system(cmd.c_str());
+}
+
//================================================================================
/*!
* \brief Export the mesh to a DAT file
void SMESH_Mesh::ExportCGNS(const char * file,
const SMESHDS_Mesh* meshDS)
{
+ int res = Driver_Mesh::DRS_FAIL;
+#ifdef WITH_CGNS
DriverCGNS_Write myWriter;
myWriter.SetFile( file );
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
myWriter.SetMeshName( SMESH_Comment("Mesh_") << meshDS->GetPersistentId());
- if ( myWriter.Perform() != Driver_Mesh::DRS_OK )
+ res = myWriter.Perform();
+#endif
+ if ( res != Driver_Mesh::DRS_OK )
throw SALOME_Exception("Export failed");
}
return _myMeshDS->GetMeshInfo().NbQuadrangles(order);
}
+//================================================================================
+/*!
+ * \brief Return number of biquadratic quadrangles in the mesh
+ */
+//================================================================================
+
+int SMESH_Mesh::NbBiQuadQuadrangles() const throw(SALOME_Exception)
+{
+ Unexpect aCatch(SalomeException);
+ return _myMeshDS->GetMeshInfo().NbBiQuadQuadrangles();
+}
+
//================================================================================
/*!
* \brief Return the number of polygonal faces in the mesh
return _myMeshDS->GetMeshInfo().NbHexas(order);
}
+//================================================================================
+/*!
+ * \brief Return number of triquadratic hexahedrons in the mesh
+ */
+//================================================================================
+
+int SMESH_Mesh::NbTriQuadraticHexas() const throw(SALOME_Exception)
+{
+ Unexpect aCatch(SalomeException);
+ return _myMeshDS->GetMeshInfo().NbTriQuadHexas();
+}
+
//================================================================================
/*!
* \brief Return number of pyramids of given order in the mesh
return _myMeshDS->GetMeshInfo().NbPrisms(order);
}
+//================================================================================
+/*!
+ * \brief Return number of hexagonal prisms in the mesh
+ */
+//================================================================================
+
+int SMESH_Mesh::NbHexagonalPrisms() const throw(SALOME_Exception)
+{
+ Unexpect aCatch(SalomeException);
+ return _myMeshDS->GetMeshInfo().NbHexPrisms();
+}
+
//================================================================================
/*!
* \brief Return number of polyhedrons in the mesh
while ( anItr->more() )
aNewGrpDS->Add( (anItr->next())->GetID() );
+ // set color
+ aNewGrpDS->SetColor( anOldGrpDS->GetColor() );
+
// remove old group
delete anOldGrp;
list<SMESH_subMesh*>::iterator onlyBIt = onlyOrderedList.begin();
list<SMESH_subMesh*>::iterator onlyEIt = onlyOrderedList.end();
- // iterates on ordered submeshes and insert them in detected positions
+ // iterate on ordered submeshes and insert them in detected positions
map< int, TPosInList >::iterator i_pos = sortedPos.begin();
for ( ; onlyBIt != onlyEIt; ++onlyBIt, ++i_pos )
*(i_pos->second) = *onlyBIt;