long NbQuadrangles()
raises (SALOME::SALOME_Exception);
- long NbPolygones()
+ long NbPolygons()
raises (SALOME::SALOME_Exception);
long NbVolumes()
long NbPrisms()
raises (SALOME::SALOME_Exception);
- long NbPolyhedrones()
+ long NbPolyhedrons()
raises (SALOME::SALOME_Exception);
long NbSubMesh()
TElemNum aIndex = aPolygoneInfo->GetIndex();
TInt nbPolygons = aPolygoneInfo->GetNbElem();
+
for (TInt iPG = 0; iPG < nbPolygons; iPG++) {
// get nodes
TInt aCurrPG_FirstNodeIndex = aIndex[iPG] - 1;
- int aNbNodes = aPolygoneInfo->GetNbConn(iPG);
- std::vector<int> nodes_ids (aNbNodes);
- for (TInt inode = 0; inode < aNbNodes; inode++) {
+ int nbNodes = aPolygoneInfo->GetNbConn(iPG);
+ std::vector<int> nodes_ids (nbNodes);
+ for (TInt inode = 0; inode < nbNodes; inode++) {
nodes_ids[inode] = aConn[aCurrPG_FirstNodeIndex + inode];
}
(nodes_ids, aPolygoneInfo->GetElemNum(iPG));
}
if (!anElement) {
- std::vector<const SMDS_MeshNode*> nodes (aNbNodes);
- for (int inode = 0; inode < aNbNodes; inode++) {
+ std::vector<const SMDS_MeshNode*> nodes (nbNodes);
+ for (int inode = 0; inode < nbNodes; inode++) {
nodes[inode] = FindNode(myMesh, nodes_ids[inode]);
}
anElement = myMesh->AddPolygonalFace(nodes);
isRenum = anIsElemNum;
}
-
} catch (const std::exception& exc) {
aResult = DRS_FAIL;
- INFOS("Follow exception was cought:\n\t"<<exc.what());
} catch (...) {
aResult = DRS_FAIL;
- INFOS("Follow unknown exception was cought!");
}
if (!anElement) {
}
if (myFamilies.find(aFamNum) != myFamilies.end()) {
// Save reference to this element from its family
- if (MYDEBUG){
- cout<<"myFamilies["<<aFamNum
- <<"] IsPoly()="<<anElement->IsPoly()
- <<"; GetType="<<anElement->GetType()
- <<"; aNbNodes="<<aNbNodes<<endl;
- }
myFamilies[aFamNum]->AddElement(anElement);
myFamilies[aFamNum]->SetType(anElement->GetType());
}
}
- }
+ } // for (TInt iPG = 0; iPG < nbPolygons; iPG++)
continue;
} else if (aGeom == ePOLYEDRE) {
TElemNum aIndex = aPolyedreInfo->GetIndex();
TInt nbPolyedres = aPolyedreInfo->GetNbElem();
-
+
for (int iPE = 0; iPE < nbPolyedres; iPE++) {
// get faces
int aCurrPE_FirstFaceIndex = aIndex[iPE] - 1;
int aCurrFace_FirstNodeIndex = aFacesIndex[aCurrPE_FirstFaceIndex + iFa] - 1;
int aNextFace_FirstNodeIndex = aFacesIndex[aCurrPE_FirstFaceIndex + iFa + 1] - 1;
- int aNbNodes = aNextFace_FirstNodeIndex - aCurrFace_FirstNodeIndex;
- quantities[iFa] = aNbNodes;
+ int nbNodes = aNextFace_FirstNodeIndex - aCurrFace_FirstNodeIndex;
+ quantities[iFa] = nbNodes;
}
// get nodes
}
} catch (const std::exception& exc) {
aResult = DRS_FAIL;
- INFOS("Follow exception was cought:\n\t"<<exc.what());
} catch (...) {
aResult = DRS_FAIL;
- INFOS("Follow unknown exception was cought!");
}
if (!anElement) {
}
if (myFamilies.find(aFamNum) != myFamilies.end()) {
// Save reference to this element from its family
- if (MYDEBUG){
- cout<<"myFamilies["<<aFamNum
- <<"] IsPoly()="<<anElement->IsPoly()
- <<"; GetType="<<anElement->GetType()
- <<"; aNbNodes="<<nbPENodes<<endl;
- }
myFamilies[aFamNum]->AddElement(anElement);
myFamilies[aFamNum]->SetType(anElement->GetType());
}
}
- }
+ } // for (int iPE = 0; iPE < nbPolyedres; iPE++)
continue;
+ } else {
}
PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
SMDS_MeshElement* anElement = NULL;
TInt aFamNum = aCellInfo->GetFamNum(iElem);
try{
+ //MESSAGE("Try to create element # " << iElem << " with id = "
+ // << aCellInfo->GetElemNum(iElem));
switch(aGeom){
case eSEG2:
case eSEG3:
std::vector<int> aConnectivities;
GetConnect(aNodesIter,aConnect);
// Convertions connectivities from SMDS to VTK
- if (anElem->IsPoly() && aNbNodes>3){ // POLYEDRE
- if (MYDEBUG) cout << "SMESH:Polyedre IsPoly()="<<anElem->IsPoly()<<"; aType="<<aType<<"; aNbNodes="<<aNbNodes<<endl;
- for (int k=0; k<aNbNodes ; k++){
+ if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
+ for (int k = 0; k < aNbNodes; k++) {
aConnectivities.push_back(k);
- if (MYDEBUG) cout << " "<<k;
}
- if (MYDEBUG) cout << endl;
- }
- else if (aNbNodes == 4){
+
+ } else if (aNbNodes == 4) {
static int anIds[] = {0,2,1,3};
- for (int k=0; k<aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- }
- else if (aNbNodes == 5){
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+
+ } else if (aNbNodes == 5) {
static int anIds[] = {0,3,2,1,4};
- for (int k=0; k<aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- }
- else if (aNbNodes == 6){
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+
+ } else if (aNbNodes == 6) {
static int anIds[] = {0,1,2,3,4,5};
- for (int k=0; k<aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- }
- else if (aNbNodes == 8){
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+
+ } else if (aNbNodes == 8) {
static int anIds[] = {0,3,2,1,4,7,6,5};
- for (int k=0; k<aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- }
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+
+ } else {
+ }
- if(aConnectivities.size()>0){
- for( vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++ )
+ if (aConnectivities.size() > 0) {
+ for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
}
break;
}
aConnectivity->InsertNextCell( anIdList );
- aCellTypesArray->InsertNextValue( getCellType( aType, anElem->IsPoly(),aNbNodes ) );
+ aCellTypesArray->InsertNextValue( getCellType( aType, anElem->IsPoly(), aNbNodes ) );
iElem++;
}
//SMDS_VolumeOfNodes::ChangeNodes(aNodes, aNbNodes);
delete [] myNodes;
+ //myNbNodes = nodes.size();
myNbNodes = aNbNodes;
myNodes = new const SMDS_MeshNode* [myNbNodes];
for (int i = 0; i < myNbNodes; i++) {
+ //myNodes[i] = nodes[i];
myNodes[i] = aNodes[i];
}
int Nb = 0;
SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator();
- while(itFaces->more()) if(itFaces->next()->NbNodes()==3) Nb++;
+ //while(itFaces->more()) if(itFaces->next()->NbNodes()==3) Nb++;
+ const SMDS_MeshFace * curFace;
+ while (itFaces->more()) {
+ curFace = itFaces->next();
+ if (!curFace->IsPoly() && curFace->NbNodes() == 3) Nb++;
+ }
return Nb;
}
int Nb = 0;
SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator();
- while(itFaces->more()) if(itFaces->next()->NbNodes()==4) Nb++;
+ //while(itFaces->more()) if(itFaces->next()->NbNodes()==4) Nb++;
+ const SMDS_MeshFace * curFace;
+ while (itFaces->more()) {
+ curFace = itFaces->next();
+ if (!curFace->IsPoly() && curFace->NbNodes() == 4) Nb++;
+ }
return Nb;
}
///////////////////////////////////////////////////////////////////////////////
-/// Return the number of polygone faces in the mesh. This method run in O(n)
+/// Return the number of polygonal faces in the mesh. This method run in O(n)
///////////////////////////////////////////////////////////////////////////////
-int SMESH_Mesh::NbPolygones() throw(SALOME_Exception)
+int SMESH_Mesh::NbPolygons() throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
int Nb = 0;
-
- SMDS_FaceIteratorPtr itFaces=_myMeshDS->facesIterator();
- while(itFaces->more()) if(itFaces->next()->IsPoly()) Nb++;
+ SMDS_FaceIteratorPtr itFaces = _myMeshDS->facesIterator();
+ while (itFaces->more())
+ if (itFaces->next()->IsPoly()) Nb++;
return Nb;
}
Unexpect aCatch(SalomeException);
int Nb = 0;
SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
- while(itVolumes->more()) if(itVolumes->next()->NbNodes()==4) Nb++;
+ //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==4) Nb++;
+ const SMDS_MeshVolume * curVolume;
+ while (itVolumes->more()) {
+ curVolume = itVolumes->next();
+ if (!curVolume->IsPoly() && curVolume->NbNodes() == 4) Nb++;
+ }
return Nb;
}
Unexpect aCatch(SalomeException);
int Nb = 0;
SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
- while(itVolumes->more()) if(itVolumes->next()->NbNodes()==8) Nb++;
+ //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==8) Nb++;
+ const SMDS_MeshVolume * curVolume;
+ while (itVolumes->more()) {
+ curVolume = itVolumes->next();
+ if (!curVolume->IsPoly() && curVolume->NbNodes() == 8) Nb++;
+ }
return Nb;
}
Unexpect aCatch(SalomeException);
int Nb = 0;
SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
- while(itVolumes->more()) if(itVolumes->next()->NbNodes()==5) Nb++;
+ //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==5) Nb++;
+ const SMDS_MeshVolume * curVolume;
+ while (itVolumes->more()) {
+ curVolume = itVolumes->next();
+ if (!curVolume->IsPoly() && curVolume->NbNodes() == 5) Nb++;
+ }
return Nb;
}
Unexpect aCatch(SalomeException);
int Nb = 0;
SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
- while(itVolumes->more()) if(itVolumes->next()->NbNodes()==6) Nb++;
+ //while(itVolumes->more()) if(itVolumes->next()->NbNodes()==6) Nb++;
+ const SMDS_MeshVolume * curVolume;
+ while (itVolumes->more()) {
+ curVolume = itVolumes->next();
+ if (!curVolume->IsPoly() && curVolume->NbNodes() == 6) Nb++;
+ }
return Nb;
}
-int SMESH_Mesh::NbPolyhedrones() throw(SALOME_Exception)
+int SMESH_Mesh::NbPolyhedrons() throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
int Nb = 0;
- SMDS_VolumeIteratorPtr itVolumes=_myMeshDS->volumesIterator();
- while(itVolumes->more()) if(itVolumes->next()->IsPoly()) Nb++;
+ SMDS_VolumeIteratorPtr itVolumes = _myMeshDS->volumesIterator();
+ while (itVolumes->more())
+ if (itVolumes->next()->IsPoly()) Nb++;
return Nb;
}
int NbQuadrangles() throw(SALOME_Exception);
- int NbPolygones() throw(SALOME_Exception);
+ int NbPolygons() throw(SALOME_Exception);
int NbVolumes() throw(SALOME_Exception);
int NbPyramids() throw(SALOME_Exception);
- int NbPolyhedrones() throw(SALOME_Exception);
-
int NbPrisms() throw(SALOME_Exception);
+ int NbPolyhedrons() throw(SALOME_Exception);
+
int NbSubMesh() throw(SALOME_Exception);
int NbGroup() const { return _mapGroup.size(); }
myMeshNbFaces->setNum( (int)aMesh->NbFaces() );
myMeshNbTriangles->setNum( (int)aMesh->NbTriangles() );
myMeshNbQuadrangles->setNum( (int)aMesh->NbQuadrangles() );
- myMeshNbPolygones->setNum( (int)aMesh->NbPolygones() );
+ myMeshNbPolygones->setNum( (int)aMesh->NbPolygons() );
myMeshNbVolumes->setNum( (int)aMesh->NbVolumes() );
myMeshNbTetra->setNum( (int)aMesh->NbTetras() );
myMeshNbHexa->setNum( (int)aMesh->NbHexas() );
myMeshNbPrism->setNum( (int)aMesh->NbPrisms() );
myMeshNbPyra->setNum( (int)aMesh->NbPyramids() );
- myMeshNbPolyhedrones->setNum( (int)aMesh->NbPolyhedrones() );
+ myMeshNbPolyhedrones->setNum( (int)aMesh->NbPolyhedrons() );
return;
}
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( anObject );
return _impl->NbQuadrangles();
}
-CORBA::Long SMESH_Mesh_i::NbPolygones()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPolygons()throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
- return _impl->NbPolygones();
+ return _impl->NbPolygons();
}
//=============================================================================
return _impl->NbPrisms();
}
-CORBA::Long SMESH_Mesh_i::NbPolyhedrones()throw(SALOME::SALOME_Exception)
+CORBA::Long SMESH_Mesh_i::NbPolyhedrons()throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
- return _impl->NbPolyhedrones();
+ return _impl->NbPolyhedrons();
}
//=============================================================================
SALOME_MED::MESH_ptr GetMEDMesh()
throw (SALOME::SALOME_Exception);
-
+
CORBA::Long NbNodes()
throw (SALOME::SALOME_Exception);
-
+
CORBA::Long NbElements()
throw (SALOME::SALOME_Exception);
-
+
CORBA::Long NbEdges()
throw (SALOME::SALOME_Exception);
-
+
CORBA::Long NbFaces()
throw (SALOME::SALOME_Exception);
CORBA::Long NbQuadrangles()
throw (SALOME::SALOME_Exception);
- CORBA::Long NbPolygones()
+ CORBA::Long NbPolygons()
throw (SALOME::SALOME_Exception);
-
+
CORBA::Long NbVolumes()
throw (SALOME::SALOME_Exception);
CORBA::Long NbHexas()
throw (SALOME::SALOME_Exception);
-
+
CORBA::Long NbPyramids()
throw (SALOME::SALOME_Exception);
-
+
CORBA::Long NbPrisms()
throw (SALOME::SALOME_Exception);
- CORBA::Long NbPolyhedrones()
+ CORBA::Long NbPolyhedrons()
throw (SALOME::SALOME_Exception);
-
+
CORBA::Long NbSubMesh()
throw (SALOME::SALOME_Exception);