namespace
{
+ //=======================================================================
+ //function : FindNode
+ //=======================================================================
inline const SMDS_MeshNode* FindNode(const SMDS_Mesh* theMesh, int theId){
if(const SMDS_MeshNode* anElem = theMesh->FindNode(theId)) return anElem;
EXCEPTION(runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<<theId);
}
+ //=======================================================================
+ //function : FindElement
+ //=======================================================================
inline const SMDS_MeshElement* FindElement(const SMDS_Mesh* theMesh, int theId){
if(const SMDS_MeshElement* anElem = theMesh->FindElement(theId)) return anElem;
EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot find a SMDS_MeshElement for ID = "<<theId);
}
+ //=======================================================================
+ //function : AddNodesWithID
+ //=======================================================================
inline void AddNodesWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
}
+ //=======================================================================
+ //function : AddEdgesWithID
+ //=======================================================================
inline void AddEdgesWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
}
+ //=======================================================================
+ //function : AddTriasWithID
+ //=======================================================================
inline void AddTriasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(4*aNbElems != anIndexes.length())
- EXCEPTION(runtime_error,"AddEdgeWithID - 4*aNbElems != anIndexes.length()");
+ EXCEPTION(runtime_error,"AddTriasWithID - 4*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
}
+ //=======================================================================
+ //function : AddQuadsWithID
+ //=======================================================================
inline void AddQuadsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var theSeq,
CORBA::Long theId)
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(5*aNbElems != anIndexes.length())
- EXCEPTION(runtime_error,"AddEdgeWithID - 4*aNbElems != anIndexes.length()");
+ EXCEPTION(runtime_error,"AddQuadsWithID - 4*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
}
+ //=======================================================================
+ //function : AddPolygonsWithID
+ //=======================================================================
inline void AddPolygonsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
}
+ //=======================================================================
+ //function : AddTetrasWithID
+ //=======================================================================
inline void AddTetrasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(5*aNbElems != anIndexes.length())
- EXCEPTION(runtime_error,"AddEdgeWithID - 5*aNbElems != anIndexes.length()");
+ EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
}
+ //=======================================================================
+ //function : AddPiramidsWithID
+ //=======================================================================
inline void AddPiramidsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(6*aNbElems != anIndexes.length())
- EXCEPTION(runtime_error,"AddEdgeWithID - 6*aNbElems != anIndexes.length()");
+ EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
}
+ //=======================================================================
+ //function : AddPrismsWithID
+ //=======================================================================
inline void AddPrismsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(7*aNbElems != anIndexes.length())
- EXCEPTION(runtime_error,"AddEdgeWithID - 7*aNbElems != anIndexes.length()");
+ EXCEPTION(runtime_error,"AddPrismsWithID - 7*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
}
+ //=======================================================================
+ //function : AddHexasWithID
+ //=======================================================================
inline void AddHexasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
if(9*aNbElems != anIndexes.length())
- EXCEPTION(runtime_error,"AddEdgeWithID - 9*aNbElems != anIndexes.length()");
+ EXCEPTION(runtime_error,"AddHexasWithID - 9*aNbElems != anIndexes.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
}
+ //=======================================================================
+ //function : AddPolyhedronsWithID
+ //=======================================================================
inline void AddPolyhedronsWithID (SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
}
+ //=======================================================================
+ //function : AddQuadEdgesWithID
+ //=======================================================================
+ inline void AddQuadEdgesWithID(SMDS_Mesh* theMesh,
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
+ {
+ const SMESH::long_array& anIndexes = theSeq[theId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
+ if(4*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddQuadEdgeWithID - 4*aNbElems != aCoords.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
+ SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
+ }
+ }
+
+
+ //=======================================================================
+ //function : AddQuadTriasWithID
+ //=======================================================================
+ inline void AddQuadTriasWithID(SMDS_Mesh* theMesh,
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
+ {
+ const SMESH::long_array& anIndexes = theSeq[theId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
+ if(7*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddQuadTriasWithID - 7*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=7){
+ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
+ }
+ }
+
+
+ //=======================================================================
+ //function : AddQuadQuadsWithID
+ //=======================================================================
+ inline void AddQuadQuadsWithID(SMDS_Mesh* theMesh,
+ SMESH::log_array_var theSeq,
+ CORBA::Long theId)
+ {
+ const SMESH::long_array& anIndexes = theSeq[theId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
+ if(9*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddQuadQuadsWithID - 9*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=9){
+ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
+ }
+ }
+
+
+ //=======================================================================
+ //function : AddQuadTetrasWithID
+ //=======================================================================
+ inline void AddQuadTetrasWithID(SMDS_Mesh* theMesh,
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
+ {
+ const SMESH::long_array& anIndexes = theSeq[theId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
+ if(11*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddQuadTetrasWithID - 11*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=11){
+ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId+9],
+ anIndexes[anIndexId+10],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ }
+ }
+
+
+ //=======================================================================
+ //function : AddQuadPiramidsWithID
+ //=======================================================================
+ inline void AddQuadPiramidsWithID(SMDS_Mesh* theMesh,
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
+ {
+ const SMESH::long_array& anIndexes = theSeq[theId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
+ if(14*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddQuadPiramidsWithID - 14*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=14){
+ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId+9],
+ anIndexes[anIndexId+10],
+ anIndexes[anIndexId+11],
+ anIndexes[anIndexId+12],
+ anIndexes[anIndexId+13],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ }
+ }
+
+
+ //=======================================================================
+ //function : AddQuadPentasWithID
+ //=======================================================================
+ inline void AddQuadPentasWithID(SMDS_Mesh* theMesh,
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
+ {
+ const SMESH::long_array& anIndexes = theSeq[theId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
+ if(16*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddQuadPentasWithID - 16*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=16){
+ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId+9],
+ anIndexes[anIndexId+10],
+ anIndexes[anIndexId+11],
+ anIndexes[anIndexId+12],
+ anIndexes[anIndexId+13],
+ anIndexes[anIndexId+14],
+ anIndexes[anIndexId+15],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ }
+ }
+
+
+ //=======================================================================
+ //function : AddQuadHexasWithID
+ //=======================================================================
+ inline void AddQuadHexasWithID(SMDS_Mesh* theMesh,
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
+ {
+ const SMESH::long_array& anIndexes = theSeq[theId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
+ if(21*aNbElems != anIndexes.length())
+ EXCEPTION(runtime_error,"AddQuadHexasWithID - 21*aNbElems != anIndexes.length()");
+ for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=21){
+ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId+6],
+ anIndexes[anIndexId+7],
+ anIndexes[anIndexId+8],
+ anIndexes[anIndexId+9],
+ anIndexes[anIndexId+10],
+ anIndexes[anIndexId+11],
+ anIndexes[anIndexId+12],
+ anIndexes[anIndexId+13],
+ anIndexes[anIndexId+14],
+ anIndexes[anIndexId+15],
+ anIndexes[anIndexId+16],
+ anIndexes[anIndexId+17],
+ anIndexes[anIndexId+18],
+ anIndexes[anIndexId+19],
+ anIndexes[anIndexId+20],
+ anIndexes[anIndexId]);
+ if(!anElem)
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ }
+ }
+
+
+ //=======================================================================
+ //function : ChangePolyhedronNodes
+ //=======================================================================
inline void ChangePolyhedronNodes (SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
CORBA::Long theId)
case SMESH::ADD_HEXAHEDRON : AddHexasWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_POLYHEDRON : AddPolyhedronsWithID( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADEDGE : AddQuadEdgesWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADTRIANGLE : AddQuadTriasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADQUADRANGLE : AddQuadQuadsWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADTETRAHEDRON: AddQuadTetrasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADPYRAMID : AddQuadPiramidsWithID( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADPENTAHEDRON: AddQuadPentasWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_QUADHEXAHEDRON : AddQuadHexasWithID ( mySMDSMesh, aSeq, anId ); break;
+
case SMESH::REMOVE_NODE:
for( ; anElemId < aNbElems; anElemId++ )
mySMDSMesh->RemoveNode( FindNode( mySMDSMesh, anIndexes[anElemId] ) );