//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// SMESH Driver : implementaion of driver for reading and writing
+// SMESH Driver : implementaion of driver for reading and writing
// File : Mesh_Reader.cxx
// Module : SMESH
//
ValDegre = 3;
nbNoeuds = 2;
ok = myMesh->AddEdgeWithID(NoeudsMaille[0], NoeudsMaille[1],
- intNumMaille);
+ intNumMaille);
break;
case 204:
case 208:
ValDegre = 9;
nbNoeuds = 4;
ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], NoeudsMaille[3],
- intNumMaille);
+ NoeudsMaille[2], NoeudsMaille[3],
+ intNumMaille);
break;
case 203:
case 206:
ValDegre = 5;
nbNoeuds = 3;
ok = myMesh->AddFaceWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], intNumMaille);
+ NoeudsMaille[2], intNumMaille);
break;
case 308:
case 320:
ValDegre = 12;
nbNoeuds = 8;
if (ValElement == 320){
- //A voir, correspondance VTK
- NoeudsMaille[4] = NoeudsMaille[8];
- NoeudsMaille[5] = NoeudsMaille[9];
- NoeudsMaille[6] = NoeudsMaille[10];
- NoeudsMaille[7] = NoeudsMaille[11];
+ //A voir, correspondance VTK
+ NoeudsMaille[4] = NoeudsMaille[8];
+ NoeudsMaille[5] = NoeudsMaille[9];
+ NoeudsMaille[6] = NoeudsMaille[10];
+ NoeudsMaille[7] = NoeudsMaille[11];
}
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], NoeudsMaille[3],
- NoeudsMaille[4], NoeudsMaille[5],
- NoeudsMaille[6], NoeudsMaille[7],
- intNumMaille);
+ NoeudsMaille[2], NoeudsMaille[3],
+ NoeudsMaille[4], NoeudsMaille[5],
+ NoeudsMaille[6], NoeudsMaille[7],
+ intNumMaille);
break;
case 304:
case 310:
ValDegre = 10;
nbNoeuds = 4;
if (ValElement == 310)
- NoeudsMaille[3] = NoeudsMaille[6];
+ NoeudsMaille[3] = NoeudsMaille[6];
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], NoeudsMaille[3],
- intNumMaille);
+ NoeudsMaille[2], NoeudsMaille[3],
+ intNumMaille);
break;
case 306:
case 315:
ValDegre = 12;
nbNoeuds = 8;
if (ValElement == 315) {
- NoeudsMaille[3] = NoeudsMaille[6];
- NoeudsMaille[4] = NoeudsMaille[7];
- NoeudsMaille[5] = NoeudsMaille[8];
+ NoeudsMaille[3] = NoeudsMaille[6];
+ NoeudsMaille[4] = NoeudsMaille[7];
+ NoeudsMaille[5] = NoeudsMaille[8];
}
NoeudsMaille[7] = NoeudsMaille[5];
NoeudsMaille[6] = NoeudsMaille[5];
NoeudsMaille[4] = NoeudsMaille[3];
NoeudsMaille[3] = NoeudsMaille[2];
ok = myMesh->AddVolumeWithID(NoeudsMaille[0], NoeudsMaille[1],
- NoeudsMaille[2], NoeudsMaille[3],
- NoeudsMaille[4], NoeudsMaille[5],
- intNumMaille);
- break;
+ NoeudsMaille[2], NoeudsMaille[3],
+ NoeudsMaille[4], NoeudsMaille[5],
+ intNumMaille);
+ break;
}
}
/****************************************************************************
fprintf(stdout, "(************************)\n");
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
- while(itNodes->more()){
+ while(itNodes->more()){
const SMDS_MeshNode * node = itNodes->next();
fprintf(aFileId, "%d %e %e %e\n", node->GetID(), node->X(), node->Y(), node->Z());
}
-
+
/****************************************************************************
* ECRITURE DES ELEMENTS *
****************************************************************************/
// static methods
static void writeInteger( const Standard_Integer& theVal,
- OSD_File& ofile )
+ OSD_File& ofile )
{
union {
Standard_Integer i;
}
static void writeFloat ( const Standard_ShortReal& theVal,
- OSD_File& ofile)
+ OSD_File& ofile)
{
union {
Standard_ShortReal f;
SMDS_ElemIteratorPtr aNodeIter = aFace->nodesIterator();
for (; aNodeIter->more(); ) {
- SMDS_MeshNode* node = (SMDS_MeshNode*)aNodeIter->next();
+ SMDS_MeshNode* node = (SMDS_MeshNode*)aNodeIter->next();
buf += " vertex ";
sprintf (sval,"% 12e",node->X());
buf += sval;
SMDS_ElemIteratorPtr aNodeIter = aFace->nodesIterator();
for (; aNodeIter->more(); ) {
- SMDS_MeshNode* node = (SMDS_MeshNode*)aNodeIter->next();
- writeFloat(node->X(),aFile);
- writeFloat(node->Y(),aFile);
- writeFloat(node->Z(),aFile);
+ SMDS_MeshNode* node = (SMDS_MeshNode*)aNodeIter->next();
+ writeFloat(node->X(),aFile);
+ writeFloat(node->Y(),aFile);
+ writeFloat(node->Z(),aFile);
}
aFile.Write (&dum,2);
}
if(MYDEBUG) MESSAGE("Perform - aDataSet2411.size() = "<<aDataSet2411.size());
TDataSet::const_iterator anIter = aDataSet2411.begin();
for(; anIter != aDataSet2411.end(); anIter++){
- const TNodeLab& aLabel = anIter->first;
- const TRecord& aRec = anIter->second;
- myMesh->AddNodeWithID(aRec.coord[0],aRec.coord[1],aRec.coord[2],aLabel);
+ const TNodeLab& aLabel = anIter->first;
+ const TRecord& aRec = anIter->second;
+ myMesh->AddNodeWithID(aRec.coord[0],aRec.coord[1],aRec.coord[2],aLabel);
}
}
{
TDataSet::const_iterator anIter = aDataSet2412.begin();
if(MYDEBUG) MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
for(; anIter != aDataSet2412.end(); anIter++){
- SMDS_MeshElement* anElement = NULL;
- const TElementLab& aLabel = anIter->first;
- const TRecord& aRec = anIter->second;
- if(IsBeam(aRec.fe_descriptor_id)) {
+ SMDS_MeshElement* anElement = NULL;
+ const TElementLab& aLabel = anIter->first;
+ const TRecord& aRec = anIter->second;
+ if(IsBeam(aRec.fe_descriptor_id)) {
switch ( aRec.node_labels.size() ) {
case 2: // edge with two nodes
anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
aRec.node_labels[1],
aLabel);
}
- }
+ }
else if(IsFace(aRec.fe_descriptor_id)) {
- switch(aRec.fe_descriptor_id){
- case 71: // TRI3
- case 72:
- case 74:
-
- case 41: // Plane Stress Linear Triangle - TRI3
- case 91: // Thin Shell Linear Triangle - TRI3
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
- aLabel);
- break;
-
- case 42: // Plane Stress Quadratic Triangle - TRI6
- case 92: // Thin Shell Quadratic Triangle - TRI6
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[4],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aRec.node_labels[5],
- aLabel);
- break;
-
- case 44: // Plane Stress Linear Quadrilateral - QUAD4
- case 94: // Thin Shell Linear Quadrilateral - QUAD4
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[1],
- aRec.node_labels[2],
- aRec.node_labels[3],
- aLabel);
- break;
-
- case 45: // Plane Stress Quadratic Quadrilateral - QUAD8
- case 95: // Thin Shell Quadratic Quadrilateral - QUAD8
- anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[4],
- aRec.node_labels[6],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aRec.node_labels[5],
- aRec.node_labels[7],
- aLabel);
- break;
- }
- }
+ switch(aRec.fe_descriptor_id){
+ case 71: // TRI3
+ case 72:
+ case 74:
+
+ case 41: // Plane Stress Linear Triangle - TRI3
+ case 91: // Thin Shell Linear Triangle - TRI3
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aRec.node_labels[2],
+ aLabel);
+ break;
+
+ case 42: // Plane Stress Quadratic Triangle - TRI6
+ case 92: // Thin Shell Quadratic Triangle - TRI6
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[4],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aLabel);
+ break;
+
+ case 44: // Plane Stress Linear Quadrilateral - QUAD4
+ case 94: // Thin Shell Linear Quadrilateral - QUAD4
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aRec.node_labels[2],
+ aRec.node_labels[3],
+ aLabel);
+ break;
+
+ case 45: // Plane Stress Quadratic Quadrilateral - QUAD8
+ case 95: // Thin Shell Quadratic Quadrilateral - QUAD8
+ anElement = myMesh->AddFaceWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[4],
+ aRec.node_labels[6],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[7],
+ aLabel);
+ break;
+ }
+ }
else if(IsVolume(aRec.fe_descriptor_id)){
- switch(aRec.fe_descriptor_id){
-
- case 111: // Solid Linear Tetrahedron - TET4
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aLabel);
- break;
+ switch(aRec.fe_descriptor_id){
+
+ case 111: // Solid Linear Tetrahedron - TET4
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aLabel);
+ break;
- case 118: // Solid Quadratic Tetrahedron - TET10
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[4],
- aRec.node_labels[2],
+ case 118: // Solid Quadratic Tetrahedron - TET10
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
- aRec.node_labels[9],
+ aRec.node_labels[9],
- aRec.node_labels[5],
- aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
aRec.node_labels[1],
aRec.node_labels[6],
- aRec.node_labels[8],
- aRec.node_labels[7],
- aLabel);
- break;
-
- case 112: // Solid Linear Prism - PRISM6
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[2],
- aRec.node_labels[1],
- aRec.node_labels[3],
- aRec.node_labels[5],
- aRec.node_labels[4],
- aLabel);
- break;
-
- case 113: // Solid Quadratic Prism - PRISM15
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[4],
- aRec.node_labels[2],
+ aRec.node_labels[8],
+ aRec.node_labels[7],
+ aLabel);
+ break;
+
+ case 112: // Solid Linear Prism - PRISM6
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[4],
+ aLabel);
+ break;
+
+ case 113: // Solid Quadratic Prism - PRISM15
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
- aRec.node_labels[9],
- aRec.node_labels[13],
- aRec.node_labels[11],
+ aRec.node_labels[9],
+ aRec.node_labels[13],
+ aRec.node_labels[11],
- aRec.node_labels[5],
- aRec.node_labels[3],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
aRec.node_labels[1],
- aRec.node_labels[14],
- aRec.node_labels[12],
+ aRec.node_labels[14],
+ aRec.node_labels[12],
aRec.node_labels[10],
aRec.node_labels[6],
- aRec.node_labels[8],
- aRec.node_labels[7],
- aLabel);
- break;
-
- case 115: // Solid Linear Brick - HEX8
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[3],
- aRec.node_labels[2],
- aRec.node_labels[1],
- aRec.node_labels[4],
- aRec.node_labels[7],
- aRec.node_labels[6],
- aRec.node_labels[5],
- aLabel);
- break;
+ aRec.node_labels[8],
+ aRec.node_labels[7],
+ aLabel);
+ break;
+
+ case 115: // Solid Linear Brick - HEX8
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[3],
+ aRec.node_labels[2],
+ aRec.node_labels[1],
+ aRec.node_labels[4],
+ aRec.node_labels[7],
+ aRec.node_labels[6],
+ aRec.node_labels[5],
+ aLabel);
+ break;
- case 116: // Solid Quadratic Brick - HEX20
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[6],
- aRec.node_labels[4],
- aRec.node_labels[2],
+ case 116: // Solid Quadratic Brick - HEX20
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[6],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
- aRec.node_labels[12],
- aRec.node_labels[18],
- aRec.node_labels[16],
- aRec.node_labels[14],
+ aRec.node_labels[12],
+ aRec.node_labels[18],
+ aRec.node_labels[16],
+ aRec.node_labels[14],
- aRec.node_labels[7],
- aRec.node_labels[5],
- aRec.node_labels[3],
- aRec.node_labels[1],
+ aRec.node_labels[7],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
+ aRec.node_labels[1],
- aRec.node_labels[19],
- aRec.node_labels[17],
- aRec.node_labels[15],
+ aRec.node_labels[19],
+ aRec.node_labels[17],
+ aRec.node_labels[15],
aRec.node_labels[13],
aRec.node_labels[8],
- aRec.node_labels[11],
- aRec.node_labels[10],
- aRec.node_labels[9],
- aLabel);
- break;
+ aRec.node_labels[11],
+ aRec.node_labels[10],
+ aRec.node_labels[9],
+ aLabel);
+ break;
- case 114: // pyramid of 13 nodes (quadratic) - PIRA13
- anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
- aRec.node_labels[6],
- aRec.node_labels[4],
- aRec.node_labels[2],
- aRec.node_labels[7],
- aRec.node_labels[5],
- aRec.node_labels[3],
- aRec.node_labels[1],
+ case 114: // pyramid of 13 nodes (quadratic) - PIRA13
+ anElement = myMesh->AddVolumeWithID(aRec.node_labels[0],
+ aRec.node_labels[6],
+ aRec.node_labels[4],
+ aRec.node_labels[2],
+ aRec.node_labels[7],
+ aRec.node_labels[5],
+ aRec.node_labels[3],
+ aRec.node_labels[1],
- aRec.node_labels[8],
- aRec.node_labels[11],
- aRec.node_labels[10],
- aRec.node_labels[9],
- aRec.node_labels[12],
- aLabel);
- break;
+ aRec.node_labels[8],
+ aRec.node_labels[11],
+ aRec.node_labels[10],
+ aRec.node_labels[9],
+ aRec.node_labels[12],
+ aLabel);
+ break;
- }
- }
- // if(!anElement)
- // MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
+ }
+ }
+ // if(!anElement)
+ // MESSAGE("DriverUNV_R_SMDS_Mesh::Perform - can not add element with ID = "<<aLabel<<" and type = "<<aRec.fe_descriptor_id);
}
}
{
UNV2417::Read(in_stream,aDataSet2417);
if(MYDEBUG) MESSAGE("Perform - aDataSet2417.size() = "<<aDataSet2417.size());
if (aDataSet2417.size() > 0) {
- myGroup = new SMDS_MeshGroup(myMesh);
- TDataSet::const_iterator anIter = aDataSet2417.begin();
- for(; anIter != aDataSet2417.end(); anIter++){
- const TGroupId& aLabel = anIter->first;
- const TRecord& aRec = anIter->second;
+ myGroup = new SMDS_MeshGroup(myMesh);
+ TDataSet::const_iterator anIter = aDataSet2417.begin();
+ for(; anIter != aDataSet2417.end(); anIter++){
+ const TGroupId& aLabel = anIter->first;
+ const TRecord& aRec = anIter->second;
- int aNodesNb = aRec.NodeList.size();
- int aElementsNb = aRec.ElementList.size();
+ int aNodesNb = aRec.NodeList.size();
+ int aElementsNb = aRec.ElementList.size();
- bool useSuffix = ((aNodesNb > 0) && (aElementsNb > 0));
- int i;
- if (aNodesNb > 0) {
- SMDS_MeshGroup* aNodesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Node);
- std::string aGrName = (useSuffix) ? aRec.GroupName + "_Nodes" : aRec.GroupName;
- int i = aGrName.find( "\r" );
- if (i > 0)
- aGrName.erase (i, 2);
- myGroupNames.insert(TGroupNamesMap::value_type(aNodesGroup, aGrName));
- myGroupId.insert(TGroupIdMap::value_type(aNodesGroup, aLabel));
+ bool useSuffix = ((aNodesNb > 0) && (aElementsNb > 0));
+ int i;
+ if (aNodesNb > 0) {
+ SMDS_MeshGroup* aNodesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Node);
+ std::string aGrName = (useSuffix) ? aRec.GroupName + "_Nodes" : aRec.GroupName;
+ int i = aGrName.find( "\r" );
+ if (i > 0)
+ aGrName.erase (i, 2);
+ myGroupNames.insert(TGroupNamesMap::value_type(aNodesGroup, aGrName));
+ myGroupId.insert(TGroupIdMap::value_type(aNodesGroup, aLabel));
- for (i = 0; i < aNodesNb; i++) {
- const SMDS_MeshNode* aNode = myMesh->FindNode(aRec.NodeList[i]);
- if (aNode)
- aNodesGroup->Add(aNode);
- }
- }
- if (aElementsNb > 0){
- SMDS_MeshGroup* aEdgesGroup = 0;
- SMDS_MeshGroup* aFacesGroup = 0;
- SMDS_MeshGroup* aVolumeGroup = 0;
- bool createdGroup = false;
+ for (i = 0; i < aNodesNb; i++) {
+ const SMDS_MeshNode* aNode = myMesh->FindNode(aRec.NodeList[i]);
+ if (aNode)
+ aNodesGroup->Add(aNode);
+ }
+ }
+ if (aElementsNb > 0){
+ SMDS_MeshGroup* aEdgesGroup = 0;
+ SMDS_MeshGroup* aFacesGroup = 0;
+ SMDS_MeshGroup* aVolumeGroup = 0;
+ bool createdGroup = false;
- for (i = 0; i < aElementsNb; i++) {
- const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]);
- if (aElement) {
- switch (aElement->GetType()) {
- case SMDSAbs_Edge:
- if (!aEdgesGroup) {
- aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge);
- if (!useSuffix && createdGroup) useSuffix = true;
- std::string aEdgesGrName = (useSuffix) ? aRec.GroupName + "_Edges" : aRec.GroupName;
- int i = aEdgesGrName.find( "\r" );
- if (i > 0)
- aEdgesGrName.erase (i, 2);
- myGroupNames.insert(TGroupNamesMap::value_type(aEdgesGroup, aEdgesGrName));
- myGroupId.insert(TGroupIdMap::value_type(aEdgesGroup, aLabel));
- createdGroup = true;
- }
- aEdgesGroup->Add(aElement);
- break;
- case SMDSAbs_Face:
- if (!aFacesGroup) {
- aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face);
- if (!useSuffix && createdGroup) useSuffix = true;
- std::string aFacesGrName = (useSuffix) ? aRec.GroupName + "_Faces" : aRec.GroupName;
- int i = aFacesGrName.find( "\r" );
- if (i > 0)
- aFacesGrName.erase (i, 2);
- myGroupNames.insert(TGroupNamesMap::value_type(aFacesGroup, aFacesGrName));
- myGroupId.insert(TGroupIdMap::value_type(aFacesGroup, aLabel));
- createdGroup = true;
- }
- aFacesGroup->Add(aElement);
- break;
- case SMDSAbs_Volume:
- if (!aVolumeGroup) {
- aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume);
- if (!useSuffix && createdGroup) useSuffix = true;
- std::string aVolumeGrName = (useSuffix) ? aRec.GroupName + "_Volumes" : aRec.GroupName;
- int i = aVolumeGrName.find( "\r" );
- if (i > 0)
- aVolumeGrName.erase (i, 2);
- myGroupNames.insert(TGroupNamesMap::value_type(aVolumeGroup, aVolumeGrName));
- myGroupId.insert(TGroupIdMap::value_type(aVolumeGroup, aLabel));
- createdGroup = true;
- }
- aVolumeGroup->Add(aElement);
- break;
- }
- }
- }
- }
- }
+ for (i = 0; i < aElementsNb; i++) {
+ const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]);
+ if (aElement) {
+ switch (aElement->GetType()) {
+ case SMDSAbs_Edge:
+ if (!aEdgesGroup) {
+ aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge);
+ if (!useSuffix && createdGroup) useSuffix = true;
+ std::string aEdgesGrName = (useSuffix) ? aRec.GroupName + "_Edges" : aRec.GroupName;
+ int i = aEdgesGrName.find( "\r" );
+ if (i > 0)
+ aEdgesGrName.erase (i, 2);
+ myGroupNames.insert(TGroupNamesMap::value_type(aEdgesGroup, aEdgesGrName));
+ myGroupId.insert(TGroupIdMap::value_type(aEdgesGroup, aLabel));
+ createdGroup = true;
+ }
+ aEdgesGroup->Add(aElement);
+ break;
+ case SMDSAbs_Face:
+ if (!aFacesGroup) {
+ aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face);
+ if (!useSuffix && createdGroup) useSuffix = true;
+ std::string aFacesGrName = (useSuffix) ? aRec.GroupName + "_Faces" : aRec.GroupName;
+ int i = aFacesGrName.find( "\r" );
+ if (i > 0)
+ aFacesGrName.erase (i, 2);
+ myGroupNames.insert(TGroupNamesMap::value_type(aFacesGroup, aFacesGrName));
+ myGroupId.insert(TGroupIdMap::value_type(aFacesGroup, aLabel));
+ createdGroup = true;
+ }
+ aFacesGroup->Add(aElement);
+ break;
+ case SMDSAbs_Volume:
+ if (!aVolumeGroup) {
+ aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume);
+ if (!useSuffix && createdGroup) useSuffix = true;
+ std::string aVolumeGrName = (useSuffix) ? aRec.GroupName + "_Volumes" : aRec.GroupName;
+ int i = aVolumeGrName.find( "\r" );
+ if (i > 0)
+ aVolumeGrName.erase (i, 2);
+ myGroupNames.insert(TGroupNamesMap::value_type(aVolumeGroup, aVolumeGrName));
+ myGroupId.insert(TGroupIdMap::value_type(aVolumeGroup, aLabel));
+ createdGroup = true;
+ }
+ aVolumeGroup->Add(aElement);
+ break;
+ }
+ }
+ }
+ }
+ }
}
}
}
typedef std::vector<size_t> TConnect;
int GetConnect(const SMDS_ElemIteratorPtr& theNodesIter,
- TConnect& theConnect)
+ TConnect& theConnect)
{
theConnect.clear();
for(; theNodesIter->more();){
MESSAGE("Perform - myMesh->NbNodes() = "<<myMesh->NbNodes());
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
for(; aNodesIter->more();){
- const SMDS_MeshNode* aNode = aNodesIter->next();
- TRecord aRec;
- aRec.coord[0] = aNode->X();
- aRec.coord[1] = aNode->Y();
- aRec.coord[2] = aNode->Z();
- const TNodeLab& aLabel = aNode->GetID();
- aDataSet2411.insert(TDataSet::value_type(aLabel,aRec));
+ const SMDS_MeshNode* aNode = aNodesIter->next();
+ TRecord aRec;
+ aRec.coord[0] = aNode->X();
+ aRec.coord[1] = aNode->Y();
+ aRec.coord[2] = aNode->Z();
+ const TNodeLab& aLabel = aNode->GetID();
+ aDataSet2411.insert(TDataSet::value_type(aLabel,aRec));
}
MESSAGE("Perform - aDataSet2411.size() = "<<aDataSet2411.size());
UNV2411::Write(out_stream,aDataSet2411);
// Storing SMDS Edges
MESSAGE("Perform - myMesh->NbEdges() = "<<myMesh->NbEdges());
if(myMesh->NbEdges()){
- SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
- for(; anIter->more();){
- const SMDS_MeshEdge* anElem = anIter->next();
- TElementLab aLabel = anElem->GetID();
- int aNbNodes = anElem->NbNodes();
- TRecord aRec;
- aRec.node_labels.reserve(aNbNodes);
- SMDS_ElemIteratorPtr aNodesIter;
+ SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
+ for(; anIter->more();){
+ const SMDS_MeshEdge* anElem = anIter->next();
+ TElementLab aLabel = anElem->GetID();
+ int aNbNodes = anElem->NbNodes();
+ TRecord aRec;
+ aRec.node_labels.reserve(aNbNodes);
+ SMDS_ElemIteratorPtr aNodesIter;
if( anElem->IsQuadratic() ) {
aNodesIter = static_cast<const SMDS_QuadraticEdge* >
( anElem )->interlacedNodesElemIterator();
aNodesIter = anElem->nodesIterator();
aRec.fe_descriptor_id = 11;
}
- for(; aNodesIter->more();){
- const SMDS_MeshElement* aNode = aNodesIter->next();
- aRec.node_labels.push_back(aNode->GetID());
- }
- aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
- }
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
+ for(; aNodesIter->more();){
+ const SMDS_MeshElement* aNode = aNodesIter->next();
+ aRec.node_labels.push_back(aNode->GetID());
+ }
+ aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ }
+ MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
MESSAGE("Perform - myMesh->NbFaces() = "<<myMesh->NbFaces());
if(myMesh->NbFaces()){
- SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
- for(; anIter->more();){
- const SMDS_MeshFace* anElem = anIter->next();
- TElementLab aLabel = anElem->GetID();
- int aNbNodes = anElem->NbNodes();
- TRecord aRec;
- aRec.node_labels.reserve(aNbNodes);
- SMDS_ElemIteratorPtr aNodesIter;
+ SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
+ for(; anIter->more();){
+ const SMDS_MeshFace* anElem = anIter->next();
+ TElementLab aLabel = anElem->GetID();
+ int aNbNodes = anElem->NbNodes();
+ TRecord aRec;
+ aRec.node_labels.reserve(aNbNodes);
+ SMDS_ElemIteratorPtr aNodesIter;
if( anElem->IsQuadratic() )
aNodesIter = static_cast<const SMDS_QuadraticFaceOfNodes* >
( anElem )->interlacedNodesElemIterator();
else
aNodesIter = anElem->nodesIterator();
- for(; aNodesIter->more();){
- const SMDS_MeshElement* aNode = aNodesIter->next();
- aRec.node_labels.push_back(aNode->GetID());
- }
- switch(aNbNodes){
- case 3:
- aRec.fe_descriptor_id = 41;
- break;
- case 4:
- aRec.fe_descriptor_id = 44;
- break;
- case 6:
- aRec.fe_descriptor_id = 42;
- break;
- case 8:
- aRec.fe_descriptor_id = 45;
- break;
- default:
- continue;
- }
- aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
- }
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
+ for(; aNodesIter->more();){
+ const SMDS_MeshElement* aNode = aNodesIter->next();
+ aRec.node_labels.push_back(aNode->GetID());
+ }
+ switch(aNbNodes){
+ case 3:
+ aRec.fe_descriptor_id = 41;
+ break;
+ case 4:
+ aRec.fe_descriptor_id = 44;
+ break;
+ case 6:
+ aRec.fe_descriptor_id = 42;
+ break;
+ case 8:
+ aRec.fe_descriptor_id = 45;
+ break;
+ default:
+ continue;
+ }
+ aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ }
+ MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
MESSAGE("Perform - myMesh->NbVolumes() = "<<myMesh->NbVolumes());
if(myMesh->NbVolumes()){
- SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
- for(; anIter->more();){
- const SMDS_MeshVolume* anElem = anIter->next();
- TElementLab aLabel = anElem->GetID();
+ SMDS_VolumeIteratorPtr anIter = myMesh->volumesIterator();
+ for(; anIter->more();){
+ const SMDS_MeshVolume* anElem = anIter->next();
+ TElementLab aLabel = anElem->GetID();
- int aNbNodes = anElem->NbNodes();
- SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
+ int aNbNodes = anElem->NbNodes();
+ SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
if ( anElem->IsPoly() ) {
if ( const SMDS_PolyhedralVolumeOfNodes* ph =
dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem))
aNodesIter = ph->uniqueNodesIterator();
}
}
- aConnect.resize(aNbNodes);
- GetConnect(aNodesIter,aConnect);
+ aConnect.resize(aNbNodes);
+ GetConnect(aNodesIter,aConnect);
- int anId = -1;
- int* aConn = NULL;
- switch(aNbNodes){
- case 4: {
- static int anIds[] = {0,2,1,3};
- aConn = anIds;
- anId = 111;
- break;
- }
- case 6: {
- static int anIds[] = {0,2,1,3,5,4};
- aConn = anIds;
- anId = 112;
- break;
- }
- case 8: {
- static int anIds[] = {0,3,2,1,4,7,6,5};
- aConn = anIds;
- anId = 115;
- break;
- }
- case 10: {
- static int anIds[] = {0,4,2,9,5,3, 1,6,8, 7};
- aConn = anIds;
- anId = 118;
- break;
- }
- case 13: {
- static int anIds[] = {0,6,4,2,7,5,3,1,8,11,10,9,12};
- aConn = anIds;
- anId = 114;
- break;
- }
- case 15: {
- static int anIds[] = {0,4,2,9,13,11,5,3,1,14,12,10,6,8,7};
- aConn = anIds;
- anId = 113;
- break;
- }
- case 20: {
- static int anIds[] = {0,6, 4,2, 12,18,16,14,7, 5, 3, 1, 19,17,15,13,8, 11,10,9};
- aConn = anIds;
- anId = 116;
- break;
- }
- default:
- continue;
- }
- if(aConn){
- TRecord aRec;
- aRec.fe_descriptor_id = anId;
- aRec.node_labels.resize(aNbNodes);
- for(int aNodeId = 0; aNodeId < aNbNodes; aNodeId++){
- aRec.node_labels[aConn[aNodeId]] = aConnect[aNodeId];
- }
- aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
- }
- }
- MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
+ int anId = -1;
+ int* aConn = NULL;
+ switch(aNbNodes){
+ case 4: {
+ static int anIds[] = {0,2,1,3};
+ aConn = anIds;
+ anId = 111;
+ break;
+ }
+ case 6: {
+ static int anIds[] = {0,2,1,3,5,4};
+ aConn = anIds;
+ anId = 112;
+ break;
+ }
+ case 8: {
+ static int anIds[] = {0,3,2,1,4,7,6,5};
+ aConn = anIds;
+ anId = 115;
+ break;
+ }
+ case 10: {
+ static int anIds[] = {0,4,2,9,5,3, 1,6,8, 7};
+ aConn = anIds;
+ anId = 118;
+ break;
+ }
+ case 13: {
+ static int anIds[] = {0,6,4,2,7,5,3,1,8,11,10,9,12};
+ aConn = anIds;
+ anId = 114;
+ break;
+ }
+ case 15: {
+ static int anIds[] = {0,4,2,9,13,11,5,3,1,14,12,10,6,8,7};
+ aConn = anIds;
+ anId = 113;
+ break;
+ }
+ case 20: {
+ static int anIds[] = {0,6, 4,2, 12,18,16,14,7, 5, 3, 1, 19,17,15,13,8, 11,10,9};
+ aConn = anIds;
+ anId = 116;
+ break;
+ }
+ default:
+ continue;
+ }
+ if(aConn){
+ TRecord aRec;
+ aRec.fe_descriptor_id = anId;
+ aRec.node_labels.resize(aNbNodes);
+ for(int aNodeId = 0; aNodeId < aNbNodes; aNodeId++){
+ aRec.node_labels[aConn[aNodeId]] = aConnect[aNodeId];
+ }
+ aDataSet2412.insert(TDataSet::value_type(aLabel,aRec));
+ }
+ }
+ MESSAGE("Perform - aDataSet2412.size() = "<<aDataSet2412.size());
}
UNV2412::Write(out_stream,aDataSet2412);
}
{
using namespace UNV2417;
if (myGroups.size() > 0) {
- TDataSet aDataSet2417;
- TGroupList::const_iterator aIter = myGroups.begin();
- for (; aIter != myGroups.end(); aIter++) {
- SMESHDS_GroupBase* aGroupDS = *aIter;
- TRecord aRec;
- aRec.GroupName = aGroupDS->GetStoreName();
+ TDataSet aDataSet2417;
+ TGroupList::const_iterator aIter = myGroups.begin();
+ for (; aIter != myGroups.end(); aIter++) {
+ SMESHDS_GroupBase* aGroupDS = *aIter;
+ TRecord aRec;
+ aRec.GroupName = aGroupDS->GetStoreName();
- int i;
- SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
- if (aGroupDS->GetType() == SMDSAbs_Node) {
- aRec.NodeList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.NodeList[i] = aElem->GetID();
- i++;
- }
- } else {
- aRec.ElementList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.ElementList[i] = aElem->GetID();
- i++;
- }
- }
+ int i;
+ SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
+ if (aGroupDS->GetType() == SMDSAbs_Node) {
+ aRec.NodeList.resize(aGroupDS->Extent());
+ i = 0;
+ while (aIter->more()) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ aRec.NodeList[i] = aElem->GetID();
+ i++;
+ }
+ } else {
+ aRec.ElementList.resize(aGroupDS->Extent());
+ i = 0;
+ while (aIter->more()) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ aRec.ElementList[i] = aElem->GetID();
+ i++;
+ }
+ }
// 0019936: EDF 794 SMESH : Export UNV : Node color and group id
- //aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
+ //aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID()+1, aRec));
- }
- UNV2417::Write(out_stream,aDataSet2417);
- myGroups.clear();
+ }
+ UNV2417::Write(out_stream,aDataSet2417);
+ myGroups.clear();
}
}
/* {
using namespace UNV2417;
TDataSet aDataSet2417;
for ( TGroupsMap::iterator it = myGroupsMap.begin(); it != myGroupsMap.end(); it++ ) {
- SMESH_Group* aGroup = it->second;
- SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
- if ( aGroupDS ) {
- TRecord aRec;
- aRec.GroupName = aGroup->GetName();
- int i;
- SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
- if (aGroupDS->GetType() == SMDSAbs_Node) {
- aRec.NodeList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.NodeList[i] = aElem->GetID();
- i++;
- }
- } else {
- aRec.ElementList.resize(aGroupDS->Extent());
- i = 0;
- while (aIter->more()) {
- const SMDS_MeshElement* aElem = aIter->next();
- aRec.ElementList[i] = aElem->GetID();
- i++;
- }
- }
- aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
- }
+ SMESH_Group* aGroup = it->second;
+ SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
+ if ( aGroupDS ) {
+ TRecord aRec;
+ aRec.GroupName = aGroup->GetName();
+ int i;
+ SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
+ if (aGroupDS->GetType() == SMDSAbs_Node) {
+ aRec.NodeList.resize(aGroupDS->Extent());
+ i = 0;
+ while (aIter->more()) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ aRec.NodeList[i] = aElem->GetID();
+ i++;
+ }
+ } else {
+ aRec.ElementList.resize(aGroupDS->Extent());
+ i = 0;
+ while (aIter->more()) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ aRec.ElementList[i] = aElem->GetID();
+ i++;
+ }
+ }
+ aDataSet2417.insert(TDataSet::value_type(aGroupDS->GetID(), aRec));
+ }
}
UNV2417::Write(out_stream,aDataSet2417);
}*/
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <fstream>
-#include <stdio.h>
+#include <fstream>
+#include <stdio.h>
#include "UNV2411_Structure.hxx"
#include "UNV_Utilities.hxx"
const TRecord& aRec = anIter->second;
char buf[78];
sprintf(buf, "%10d%10d%10d%10d\n",
- aLabel,
- aRec.exp_coord_sys_num,
- aRec.disp_coord_sys_num,
- aRec.color);
+ aLabel,
+ aRec.exp_coord_sys_num,
+ aRec.disp_coord_sys_num,
+ aRec.color);
out_stream<<buf;
// the coordinates
sprintf(buf, "%25.16E%25.16E%25.16E\n",
- aRec.coord[0],
- aRec.coord[1],
- aRec.coord[2]);
+ aRec.coord[0],
+ aRec.coord[1],
+ aRec.coord[2]);
out_stream<<buf;
}
#include "SMESH_DriverUNV.hxx"
#include <map>
-#include <fstream>
+#include <fstream>
namespace UNV2411{
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-#include <fstream>
+#include <fstream>
#include <iomanip>
#include "UNV2412_Structure.hxx"
for(int i = 0, k = 0; i < iEnd; i++){
int jEnd = n_nodes - 8*(i+1);
if(jEnd < 0)
- jEnd = 8 + jEnd;
+ jEnd = 8 + jEnd;
else
- jEnd = 8;
+ jEnd = 8;
for(int j = 0; j < jEnd ; k++, j++){
- out_stream<<std::setw(10)<<aRec.node_labels[k];
+ out_stream<<std::setw(10)<<aRec.node_labels[k];
}
out_stream<<std::endl;
}
#include <map>
#include <vector>
-#include <fstream>
+#include <fstream>
namespace UNV2412{
#include "UNV2417_Structure.hxx"
#include "UNV_Utilities.hxx"
-#include <fstream>
+#include <fstream>
#include <iomanip>
using namespace std;
static string _group_labels[] = {"2417", "2429", "2430", "2432",
- "2435", "2452", "2467", "2477"};
+ "2435", "2452", "2467", "2477"};
#define NBGROUP 8
static string _label_dataset = "2467";
* a "-1" followed by a number means the beginning of a dataset
* stop combing at the end of the file
*/
- while( ((olds != "-1") || (news == "-1") ) && !in_stream.eof() ){
+ while( ((olds != "-1") || (news == "-1") ) && !in_stream.eof() ){
olds = news;
in_stream >> news;
}
return;
for (int i = 0; i < NBGROUP; i++) {
if (news == _group_labels[i]) {
- ReadGroup(news, in_stream, theDataSet);
+ ReadGroup(news, in_stream, theDataSet);
}
}
}
in_stream>>aElType;
in_stream>>aElId;
if ((myGroupLabel.compare("2435") == 0) ||
- (myGroupLabel.compare("2452") == 0) ||
- (myGroupLabel.compare("2467") == 0) ||
- (myGroupLabel.compare("2477") == 0)) {
- in_stream>>aTmp;
- in_stream>>aTmp;
+ (myGroupLabel.compare("2452") == 0) ||
+ (myGroupLabel.compare("2467") == 0) ||
+ (myGroupLabel.compare("2477") == 0)) {
+ in_stream>>aTmp;
+ in_stream>>aTmp;
}
switch (aElType) {
case 7: // Nodes
- aNum = aRec.NodeList.size();
- aRec.NodeList.resize(aNum + 1);
- aRec.NodeList[aNum] = aElId;
- break;
+ aNum = aRec.NodeList.size();
+ aRec.NodeList.resize(aNum + 1);
+ aRec.NodeList[aNum] = aElId;
+ break;
case 8: // Elements
- aNum = aRec.ElementList.size();
- aRec.ElementList.resize(aNum + 1);
- aRec.ElementList[aNum] = aElId;
- break;
+ aNum = aRec.ElementList.size();
+ aRec.ElementList.resize(aNum + 1);
+ aRec.ElementList[aNum] = aElId;
+ break;
}
}
theDataSet.insert(TDataSet::value_type(aId,aRec));
int i;
for (i = 0; i < aNbNodes; i++) {
if (aRow == 2) {
- out_stream<<std::endl;
- aRow = 0;
+ out_stream<<std::endl;
+ aRow = 0;
}
out_stream<<std::setw(10)<<7;
out_stream<<std::setw(10)<<aRec.NodeList[i];
}
for (i = 0; i < aNbElements; i++) {
if (aRow == 2) {
- out_stream<<std::endl;
- aRow = 0;
+ out_stream<<std::endl;
+ aRow = 0;
}
out_stream<<std::setw(10)<<8;
out_stream<<std::setw(10)<<aRec.ElementList[i];
#include <map>
#include <vector>
-#include <fstream>
-#include <string>
+#include <fstream>
+#include <string>
namespace UNV2417{
#include "SMESH_DriverUNV.hxx"
-#include <iostream>
-#include <sstream>
+#include <iostream>
+#include <sstream>
#include <fstream>
#include <string>
#include <stdexcept>
* a "-1" followed by a number means the beginning of a dataset
* stop combing at the end of the file
*/
- while( ((olds != "-1") || (news == "-1") ) && !in_file.eof() ){
- olds = news;
- in_file >> news;
+ while( ((olds != "-1") || (news == "-1") ) && !in_file.eof() ){
+ olds = news;
+ in_file >> news;
}
if(in_file.eof())
- return false;
+ return false;
if (news == ds_name)
- return true;
+ return true;
}
// should never end up here
return false;
bool DansPave( R3 & xyzMin, R3 & xyzMax )
{ return xyzMin.x<=x && x<=xyzMax.x &&
- xyzMin.y<=y && y<=xyzMax.y &&
- xyzMin.z<=z && z<=xyzMax.z; }
+ xyzMin.y<=y && y<=xyzMax.y &&
+ xyzMin.z<=z && z<=xyzMax.z; }
};
//la classe R4
void aptrte( Z nutysu, R aretmx,
- Z nblf, Z * nudslf, R2 * uvslf,
- Z nbpti, R2 * uvpti,
- Z & nbst, R2 * & uvst,
- Z & nbt, Z * & nust,
- Z & ierr )
+ Z nblf, Z * nudslf, R2 * uvslf,
+ Z nbpti, R2 * uvpti,
+ Z & nbst, R2 * & uvst,
+ Z & nbt, Z * & nust,
+ Z & ierr )
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : appel de la triangulation par un arbre-4 recouvrant
// ----- de triangles equilateraux
mxsomm = Max( 20000, 64*nbpti+i*i );
MESSAGE( "APTRTE: Debut de la triangulation plane avec " );
MESSAGE( "nutysu=" << nutysu << " aretmx=" << aretmx
- << " mxsomm=" << mxsomm );
+ << " mxsomm=" << mxsomm );
MESSAGE( nbarfr << " sommets sur la frontiere et " << nbpti << " points internes");
NEWDEPART:
mnpxyd[ns0].y = uvslf[ns0].y;
mnpxyd[ns0].z = areteideale();//( mnpxyd[ns0], direction );
// MESSAGE("Sommet " << ns0 << ": " << mnpxyd[ns0].x
-// << " " << mnpxyd[ns0].y << " longueur arete=" << mnpxyd[ns0].z);
+// << " " << mnpxyd[ns0].y << " longueur arete=" << mnpxyd[ns0].z);
//carre de la longueur de l'arete 1 de la ligne fermee n
d = pow( uvslf[ns0+1].x - uvslf[ns0].x, 2 )
//le numero n de la ligne du sommet et son numero ns1 dans la ligne
mnslig[ns0-1] = 1000000 * n + ns1-nudslf[n-1];
fasoar( ns1, ns2, moins1, moins1, n,
- mosoar, mxsoar, n1soar, mnsoar, mnarst,
- noar0, ierr );
+ mosoar, mxsoar, n1soar, mnsoar, mnarst,
+ noar0, ierr );
//pas de test sur ierr car pas de saturation possible a ce niveau
//le pointeur dans le hachage sur la premiere arete de la ligne fermee n
{
ns1 = ns2; //le numero de l'arete et le numero du premier sommet de l'arete
if( i < nbarli )
- //nbs+1 est le 2-eme sommet de l'arete i de la ligne fermee n
- ns2 = ns1+1;
+ //nbs+1 est le 2-eme sommet de l'arete i de la ligne fermee n
+ ns2 = ns1+1;
else
- //le 2-eme sommet de la derniere arete est le premier sommet de la ligne
- ns2 = ns0;
+ //le 2-eme sommet de la derniere arete est le premier sommet de la ligne
+ ns2 = ns0;
//l'arete precedente est dotee de sa suivante:celle cree ensuite
//les 2 coordonnees du sommet ns2 de la ligne
mnpxyd[ns].y = uvslf[ns].y;
mnpxyd[ns].z = areteideale();//( mnpxyd[ns], direction );
// MESSAGE("Sommet " << ns << ": " << mnpxyd[ns].x
-// << " " << mnpxyd[ns].y << " longueur arete=" << mnpxyd[ns].z);
+// << " " << mnpxyd[ns].y << " longueur arete=" << mnpxyd[ns].z);
//carre de la longueur de l'arete
d = pow( uvslf[ns2-1].x - uvslf[ns1-1].x, 2)
//ajout de l'arete dans la liste
fasoar( ns1, ns2, moins1, moins1, n,
- mosoar, mxsoar, n1soar, mnsoar,
- mnarst, noar, ierr );
+ mosoar, mxsoar, n1soar, mnsoar,
+ mnarst, noar, ierr );
//pas de test sur ierr car pas de saturation possible a ce niveau
//chainage des aretes frontalieres en position 6 du tableau mnsoar
MESSAGE("Sur le bord: arete min=" << aremin << " arete max=" << aremax );
MESSAGE("Triangulation: arete mx=" << aretmx
- << " triangle aire mx=" << airemx );
+ << " triangle aire mx=" << airemx );
//chainage des aretes frontalieres : la derniere arete frontaliere
mnsoar[ mosoar * noar - mosoar + 5 ] = 0;
if( mnqueu==NULL) goto ERREUR;
tehote( nutysu, nbarpi, mxsomm, nbsomm, mnpxyd,
- comxmi, aretmx,
- mntree, mxqueu, mnqueu,
- ierr );
+ comxmi, aretmx,
+ mntree, mxqueu, mnqueu,
+ ierr );
deltacpu_( d );
tcpu += d;
// et des points de la frontiere, des points internes imposes interieurs
// ==========================================================================
tetrte( comxmi, aretmx, nbarpi, mxsomm, mnpxyd,
- mxqueu, mnqueu, mntree, mosoar, mxsoar, n1soar, mnsoar,
- moartr, mxartr, n1artr, mnartr, mnarst,
- ierr );
+ mxqueu, mnqueu, mntree, mosoar, mxsoar, n1soar, mnsoar,
+ moartr, mxartr, n1artr, mnartr, mnarst,
+ ierr );
// destruction de la queue et de l'arbre devenus inutiles
delete [] mnqueu; mnqueu=NULL;
//qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// boucle sur les aretes internes (non sur une ligne de la frontiere)
// avec echange des 2 diagonales afin de rendre la triangulation delaunay
// formation du chainage 6 des aretes internes a echanger eventuellement
aisoar( mosoar, mxsoar, mnsoar, na );
tedela( mnpxyd, mnarst,
- mosoar, mxsoar, n1soar, mnsoar, na,
- moartr, mxartr, n1artr, mnartr, n );
+ mosoar, mxsoar, n1soar, mnsoar, na,
+ moartr, mxartr, n1artr, mnartr, n );
MESSAGE( "Nombre d'echanges des diagonales de 2 triangles=" << n );
deltacpu_( d );
//qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// detection des aretes frontalieres initiales perdues
// triangulation frontale pour les restaurer
if( mnarcf2 == NULL ) goto ERREUR;
terefr( nbarpi, mnpxyd,
- mosoar, mxsoar, n1soar, mnsoar,
- moartr, mxartr, n1artr, mnartr, mnarst,
- mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2,
- n, ierr );
+ mosoar, mxsoar, n1soar, mnsoar,
+ moartr, mxartr, n1artr, mnartr, mnarst,
+ mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2,
+ n, ierr );
MESSAGE( "Restauration de " << n << " aretes perdues de la frontiere ierr=" << ierr );
deltacpu_( d );
//qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// fin de la triangulation avec respect des aretes initiales frontalieres
mnlftr[n] = n+1;
tesuex( nblf, mnlftr,
- ndtri0, nbsomm, mnpxyd, mnslig,
- mosoar, mxsoar, mnsoar,
- moartr, mxartr, n1artr, mnartr, mnarst,
- nbt, mntrsu, ierr );
+ ndtri0, nbsomm, mnpxyd, mnslig,
+ mosoar, mxsoar, mnsoar,
+ moartr, mxartr, n1artr, mnartr, mnarst,
+ nbt, mntrsu, ierr );
delete [] mnlftr; mnlftr=NULL;
delete [] mntrsu; mntrsu=NULL;
//qualites de la triangulation actuelle
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// amelioration de la qualite de la triangulation par
// barycentrage des sommets internes a la triangulation
goto ERREUR;
}
teamqt( nutysu, aretmx, airemx,
- mnarst, mosoar, mxsoar, n1soar, mnsoar,
- moartr, mxartr, n1artr, mnartr,
- mxarcf, mnarcf2, mnarcf3,
- mn1arcf, mnarcf, mnarcf1,
- nbarpi, nbsomm, mxsomm, mnpxyd, mnslig,
- ierr );
+ mnarst, mosoar, mxsoar, n1soar, mnsoar,
+ moartr, mxartr, n1artr, mnartr,
+ mxarcf, mnarcf2, mnarcf3,
+ mn1arcf, mnarcf, mnarcf1,
+ nbarpi, nbsomm, mxsomm, mnpxyd, mnslig,
+ ierr );
if( mnarcf3 != NULL ) {delete [] mnarcf3; mnarcf3=NULL;}
if( mn1arcf != NULL ) {delete [] mn1arcf; mn1arcf=NULL;}
if( mnarcf != NULL ) {delete [] mnarcf; mnarcf =NULL;}
//qualites de la triangulation finale
qualitetrte( mnpxyd, mosoar, mxsoar, mnsoar, moartr, mxartr, mnartr,
- nbt, quamoy, quamin );
+ nbt, quamoy, quamin );
// renumerotation des sommets internes: mnarst(i)=numero final du sommet
// ===================================
n = mnslig[i];
if( n > 0 )
{
- if( n >= 1000000 )
- {
- //sommet d'une ligne
- //retour aux coordonnees initiales dans uvslf
- l = n / 1000000;
- n = n - 1000000 * l + nudslf[l-1] - 1;
- uvst[nbst].x = uvslf[n].x;
- uvst[nbst].y = uvslf[n].y;
- }
- else
- {
- //point utilisateur n interne impose
- //retour aux coordonnees initiales dans uvpti
- uvst[nbst].x = uvpti[n-1].x;
- uvst[nbst].y = uvpti[n-1].y;
- }
+ if( n >= 1000000 )
+ {
+ //sommet d'une ligne
+ //retour aux coordonnees initiales dans uvslf
+ l = n / 1000000;
+ n = n - 1000000 * l + nudslf[l-1] - 1;
+ uvst[nbst].x = uvslf[n].x;
+ uvst[nbst].y = uvslf[n].y;
+ }
+ else
+ {
+ //point utilisateur n interne impose
+ //retour aux coordonnees initiales dans uvpti
+ uvst[nbst].x = uvpti[n-1].x;
+ uvst[nbst].y = uvpti[n-1].y;
+ }
}
}
}
}
nbt /= nbsttria; //le nombre final de triangles de la surface
MESSAGE( "APTRTE: Fin de la triangulation plane avec "<<nbst<<" sommets et "
- << nbt << " triangles" );
+ << nbt << " triangles" );
deltacpu_( d );
tcpu += d;
MESSAGE( "APTRTE: Temps total de la triangulation plane=" << tcpu << " secondes" );
#endif
#endif
qualitetrte( R3 *mnpxyd,
- Z & mosoar, Z & mxsoar, Z *mnsoar,
- Z & moartr, Z & mxartr, Z *mnartr,
- Z & nbtria, R & quamoy, R & quamin )
+ Z & mosoar, Z & mxsoar, Z *mnsoar,
+ Z & moartr, Z & mxartr, Z *mnartr,
+ Z & nbtria, R & quamoy, R & quamin )
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : calculer la qualite moyenne et minimale de la triangulation
// ----- actuelle definie par les tableaux mnsoar et mnartr
//la qualite du triangle ns1 ns2 ns3
qutr2d( mnpxyd[nosotr[0]-1], mnpxyd[nosotr[1]-1], mnpxyd[nosotr[2]-1],
- qualite );
+ qualite );
//la qualite moyenne
quamoy += qualite;
d = surtd2( mnpxyd[nosotr[0]-1], mnpxyd[nosotr[1]-1], mnpxyd[nosotr[2]-1] );
if( d<0 )
{
- //un triangle d'aire negative de plus
- nbtrianeg++;
- MESSAGE("ATTENTION: le triangle " << nt << " de sommets:"
- << nosotr[0] << " " << nosotr[1] << " " << nosotr[2]
- << " a une aire " << d <<"<=0");
+ //un triangle d'aire negative de plus
+ nbtrianeg++;
+ MESSAGE("ATTENTION: le triangle " << nt << " de sommets:"
+ << nosotr[0] << " " << nosotr[1] << " " << nosotr[2]
+ << " a une aire " << d <<"<=0");
}
//aire des triangles actuels
<<nosotr[0]<<" "<<nosotr[1]<<" "<<nosotr[2]<<" ");
for (int i=0;i<3;i++)
MESSAGE("Sommet "<<nosotr[i]<<": x="<< mnpxyd[nosotr[i]-1].x
- <<" y="<< mnpxyd[nosotr[i]-1].y);
+ <<" y="<< mnpxyd[nosotr[i]-1].y);
}
if( nbtrianeg>0 )
MEFISTO2D_EXPORT
void aptrte( Z nutysu, R aretmx,
- Z nblf, Z *nudslf, R2 *uvslf,
- Z nbpti, R2 *uvpti,
- Z & nbst, R2 * & uvst, Z & nbt, Z * & nust,
- Z & ierr );
+ Z nblf, Z *nudslf, R2 *uvslf,
+ Z nbpti, R2 *uvpti,
+ Z & nbst, R2 * & uvst, Z & nbt, Z * & nust,
+ Z & ierr );
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : appel de la triangulation par un arbre-4 recouvrant
// ----- de triangles equilateraux
#define nusotr NUSOTR
#define qutr2d QUTR2D
#define surtd2 SURTD2
- #define qualitetrte QUALITETRTE
+ #define qualitetrte QUALITETRTE
#define areteideale ARETEIDEALE
#endif
#endif
qualitetrte( R3 *mnpxyd,
- Z & mosoar, Z & mxsoar, Z *mnsoar,
- Z & moartr, Z & mxartr, Z *mnartr,
- Z & nbtria, R & quamoy, R & quamin ); }
+ Z & mosoar, Z & mxsoar, Z *mnsoar,
+ Z & moartr, Z & mxartr, Z *mnartr,
+ Z & nbtria, R & quamoy, R & quamin ); }
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : calculer la qualite moyenne et minimale de la triangulation
// ----- actuelle definie par les tableaux nosoar et noartr
#endif
#endif
fasoar( Z & ns1, Z & ns2, Z & nt1, Z & nt2, Z & nolign,
- Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z * mnarst,
- Z & noar, Z & ierr );
+ Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z * mnarst,
+ Z & noar, Z & ierr );
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// but : former l'arete de sommet ns1-ns2 dans le hachage du tableau
#endif
#endif
teajte( Z & mxsomm, Z & nbsomm, R3 * mnpxyd, R3 * comxmi,
- R & aretmx, Z & mxtree, Z * letree,
- Z & ierr );
+ R & aretmx, Z & mxtree, Z * letree,
+ Z & ierr );
}
extern "C" {void
#endif
#endif
tehote( Z & nutysu, Z & nbarpi, Z & mxsomm, Z & nbsomm, R3 * mnpxyd,
- R3 * comxmi, R & aretmx,
- Z * letree, Z & mxqueu, Z * mnqueu,
- Z & ierr );
+ R3 * comxmi, R & aretmx,
+ Z * letree, Z & mxqueu, Z * mnqueu,
+ Z & ierr );
}
// homogeneisation de l'arbre des te a un saut de taille au plus
// prise en compte des tailles d'aretes souhaitees autour des sommets initiaux
#endif
#endif
tetrte( R3 * comxmi, R & aretmx, Z & nbarpi, Z & mxsomm, R3 * mnpxyd,
- Z & mxqueu, Z * mnqueu, Z * mntree,
- Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
- Z & ierr );
+ Z & mxqueu, Z * mnqueu, Z * mntree,
+ Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
+ Z & ierr );
}
// trianguler les triangles equilateraux feuilles a partir de leurs 3 sommets
// et des points de la frontiere, des points internes imposes interieurs
#endif
#endif
tedela( R3 * mnpxyd, Z * mnarst,
- Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z & na,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z & n );
+ Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z & na,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z & n );
}
// boucle sur les aretes internes (non sur une ligne de la frontiere)
// avec echange des 2 diagonales afin de rendre la triangulation delaunay
#endif
#endif
terefr( Z & nbarpi, R3 * mnpxyd,
- Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
- Z & mxarcf, Z * mnarc1, Z * mnarc2,
- Z * mnarc3, Z * mnarc4,
- Z & n, Z & ierr );
+ Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
+ Z & mxarcf, Z * mnarc1, Z * mnarc2,
+ Z * mnarc3, Z * mnarc4,
+ Z & n, Z & ierr );
}
// detection des aretes frontalieres initiales perdues
// triangulation frontale pour les restaurer
#endif
#endif
tesuex( Z & nblf, Z * nulftr,
- Z & ndtri0, Z & nbsomm, R3 * mnpxyd, Z * mnslig,
- Z & mosoar, Z & mxsoar, Z * mnsoar,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
- Z & nbtria, Z * mntrsu, Z & ierr );
+ Z & ndtri0, Z & nbsomm, R3 * mnpxyd, Z * mnslig,
+ Z & mosoar, Z & mxsoar, Z * mnsoar,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr, Z * mnarst,
+ Z & nbtria, Z * mntrsu, Z & ierr );
}
// suppression des triangles externes a la surface
#endif
#endif
teamqt( Z & nutysu, R & aretmx, R & airemx,
- Z * mnarst, Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
- Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr,
- Z & mxarcf, Z * mntrcf, Z * mnstbo,
- Z * n1arcf, Z * mnarcf, Z * mnarc1,
- Z & nbarpi, Z & nbsomm, Z & mxsomm,
- R3 * mnpxyd, Z * mnslig,
- Z & ierr );
+ Z * mnarst, Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
+ Z & moartr, Z & mxartr, Z & n1artr, Z * mnartr,
+ Z & mxarcf, Z * mntrcf, Z * mnstbo,
+ Z * n1arcf, Z * mnarcf, Z * mnarc1,
+ Z & nbarpi, Z & nbsomm, Z & mxsomm,
+ R3 * mnpxyd, Z * mnslig,
+ Z & ierr );
}
// amelioration de la qualite de la triangulation par
// barycentrage des sommets internes a la triangulation
SMDS_MemoryLimit_LDADD = \
$(KERNEL_LDFLAGS) -lSALOMELocalTrace
+
+#libSMDS_la_LDFLAGS += -L/data/eap/S5_MV/INSTALL/SMESH/lib/salome -lPerfmeter
{
public:
- SMDS_EdgePosition(const int aEdgeId=0, const double aUParam=0);
- const virtual double * Coords() const;
- SMDS_TypeOfPosition GetTypeOfPosition() const;
- void SetUParameter(double aUparam);
- double GetUParameter() const;
+ SMDS_EdgePosition(const int aEdgeId=0, const double aUParam=0);
+ const virtual double * Coords() const;
+ SMDS_TypeOfPosition GetTypeOfPosition() const;
+ void SetUParameter(double aUparam);
+ double GetUParameter() const;
private:
- double myUParameter;
+ double myUParameter;
};
int SMDS_FaceOfEdges::NbEdges() const
{
- return myNbEdges;
+ return myNbEdges;
}
int SMDS_FaceOfEdges::NbFaces() const
{
- return 1;
+ return 1;
}
//=======================================================================
//function : Print
void SMDS_FaceOfEdges::Print(ostream & OS) const
{
- OS << "face <" << GetID() << " > : ";
- int i;
- for (i = 0; i < NbEdges() - 1; i++) OS << myEdges[i] << ",";
- OS << myEdges[i] << ") " << endl;
+ OS << "face <" << GetID() << " > : ";
+ int i;
+ for (i = 0; i < NbEdges() - 1; i++) OS << myEdges[i] << ",";
+ OS << myEdges[i] << ") " << endl;
}
SMDSAbs_ElementType SMDS_FaceOfEdges::GetType() const
{
- return SMDSAbs_Face;
+ return SMDSAbs_Face;
}
//=======================================================================
{
index++;
return mySet[index-1];
- }
+ }
};
SMDS_ElemIteratorPtr SMDS_FaceOfEdges::elementsIterator
const SMDS_MeshEdge* edge2,
const SMDS_MeshEdge* edge3)
{
- myNbEdges = 3;
- myEdges[0]=edge1;
- myEdges[1]=edge2;
- myEdges[2]=edge3;
- myEdges[3]=0;
+ myNbEdges = 3;
+ myEdges[0]=edge1;
+ myEdges[1]=edge2;
+ myEdges[2]=edge3;
+ myEdges[3]=0;
}
SMDS_FaceOfEdges::SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
const SMDS_MeshEdge* edge3,
const SMDS_MeshEdge* edge4)
{
- myNbEdges = 4;
- myEdges[0]=edge1;
- myEdges[1]=edge2;
- myEdges[2]=edge3;
- myEdges[3]=edge4;
+ myNbEdges = 4;
+ myEdges[0]=edge1;
+ myEdges[1]=edge2;
+ myEdges[2]=edge3;
+ myEdges[3]=edge4;
}
/*bool operator<(const SMDS_FaceOfEdges& f1, const SMDS_FaceOfEdges& f2)
{
- set<SMDS_MeshNode> set1,set2;
- SMDS_ElemIteratorPtr it;
- const SMDS_MeshNode * n;
-
- it=f1.nodesIterator();
-
- while(it->more())
- {
- n=static_cast<const SMDS_MeshNode *>(it->next());
- set1.insert(*n);
- }
-
- delete it;
- it=f2.nodesIterator();
-
- while(it->more())
- {
- n=static_cast<const SMDS_MeshNode *>(it->next());
- set2.insert(*n);
- }
-
- delete it;
- return set1<set2;
+ set<SMDS_MeshNode> set1,set2;
+ SMDS_ElemIteratorPtr it;
+ const SMDS_MeshNode * n;
+
+ it=f1.nodesIterator();
+
+ while(it->more())
+ {
+ n=static_cast<const SMDS_MeshNode *>(it->next());
+ set1.insert(*n);
+ }
+
+ delete it;
+ it=f2.nodesIterator();
+
+ while(it->more())
+ {
+ n=static_cast<const SMDS_MeshNode *>(it->next());
+ set2.insert(*n);
+ }
+
+ delete it;
+ return set1<set2;
}*/
class SMDS_EXPORT SMDS_FaceOfEdges:public SMDS_MeshFace
{
public:
- void Print(std::ostream & OS) const;
- SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
+ void Print(std::ostream & OS) const;
+ SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
const SMDS_MeshEdge* edge2,
const SMDS_MeshEdge* edge3);
- SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
+ SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
const SMDS_MeshEdge* edge2,
const SMDS_MeshEdge* edge3,
const SMDS_MeshEdge* edge4);
-
- SMDSAbs_ElementType GetType() const;
+
+ SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const;
- int NbNodes() const;
- int NbEdges() const;
- int NbFaces() const;
-// friend bool operator<(const SMDS_FaceOfEdges& e1, const SMDS_FaceOfEdges& e2);
+ int NbNodes() const;
+ int NbEdges() const;
+ int NbFaces() const;
+// friend bool operator<(const SMDS_FaceOfEdges& e1, const SMDS_FaceOfEdges& e2);
/*!
virtual const SMDS_MeshNode* GetNode(const int ind) const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
private:
- const SMDS_MeshEdge* myEdges[4];
+ const SMDS_MeshEdge* myEdges[4];
int myNbEdges;
};
int SMDS_FaceOfNodes::NbEdges() const
{
- return NbNodes();
+ return NbNodes();
}
int SMDS_FaceOfNodes::NbFaces() const
{
- return 1;
+ return 1;
}
int SMDS_FaceOfNodes::NbNodes() const
{
- return myNbNodes;
+ return myNbNodes;
}
//=======================================================================
void SMDS_FaceOfNodes::Print(ostream & OS) const
{
- OS << "face <" << GetID() << " > : ";
- int i;
- for (i = 0; i < NbNodes() - 1; i++) OS << myNodes[i] << ",";
- OS << myNodes[i] << ") " << endl;
+ OS << "face <" << GetID() << " > : ";
+ int i;
+ for (i = 0; i < NbNodes() - 1; i++) OS << myNodes[i] << ",";
+ OS << myNodes[i] << ") " << endl;
}
//=======================================================================
const SMDS_MeshNode* node2,
const SMDS_MeshNode* node3)
{
- myNbNodes = 3;
- myNodes[0]=node1;
- myNodes[1]=node2;
- myNodes[2]=node3;
- myNodes[3]=0;
+ myNbNodes = 3;
+ myNodes[0]=node1;
+ myNodes[1]=node2;
+ myNodes[2]=node3;
+ myNodes[3]=0;
}
SMDS_FaceOfNodes::SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
const SMDS_MeshNode* node3,
const SMDS_MeshNode* node4)
{
- myNbNodes = 4;
- myNodes[0]=node1;
- myNodes[1]=node2;
- myNodes[2]=node3;
- myNodes[3]=node4;
+ myNbNodes = 4;
+ myNodes[0]=node1;
+ myNodes[1]=node2;
+ myNodes[2]=node3;
+ myNodes[3]=node4;
}
bool SMDS_FaceOfNodes::ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes)
class SMDS_EXPORT SMDS_FaceOfNodes:public SMDS_MeshFace
{
public:
- void Print(std::ostream & OS) const;
- SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
+ void Print(std::ostream & OS) const;
+ SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
const SMDS_MeshNode* node2,
const SMDS_MeshNode* node3);
- SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
+ SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
const SMDS_MeshNode* node2,
const SMDS_MeshNode* node3,
const SMDS_MeshNode* node4);
bool ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes);
- int NbEdges() const;
- int NbFaces() const;
- int NbNodes() const;
+ int NbEdges() const;
+ int NbFaces() const;
+ int NbNodes() const;
/*!
* \brief Return node by its index
virtual SMDSAbs_EntityType GetEntityType() const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
private:
- const SMDS_MeshNode* myNodes[4];
+ const SMDS_MeshNode* myNodes[4];
int myNbNodes;
};
//=======================================================================
SMDS_FacePosition::SMDS_FacePosition(const int aEdgeId,
- const double aUParam,
- const double aVParam)
+ const double aUParam,
+ const double aVParam)
:SMDS_Position(aEdgeId),
myUParameter(aUParam),myVParameter(aVParam)
{
//=======================================================================
const double *SMDS_FacePosition::Coords() const
{
- static double origin[]={0,0,0};
- MESSAGE("SMDS_EdgePosition::Coords not implemented");
- return origin;
+ static double origin[]={0,0,0};
+ MESSAGE("SMDS_EdgePosition::Coords not implemented");
+ return origin;
}
/**
*/
SMDS_TypeOfPosition SMDS_FacePosition::GetTypeOfPosition() const
{
- return SMDS_TOP_FACE;
+ return SMDS_TOP_FACE;
}
void SMDS_FacePosition::SetUParameter(double aUparam)
{
- myUParameter = aUparam;
+ myUParameter = aUparam;
}
//=======================================================================
void SMDS_FacePosition::SetVParameter(double aVparam)
{
- myVParameter = aVparam;
+ myVParameter = aVparam;
}
//=======================================================================
double SMDS_FacePosition::GetUParameter() const
{
- return myUParameter;
+ return myUParameter;
}
//=======================================================================
double SMDS_FacePosition::GetVParameter() const
{
- return myVParameter;
+ return myVParameter;
}
{
public:
- SMDS_FacePosition(int aFaceId=0, double aUParam=0,
- double aVParam=0);
- const virtual double * Coords() const;
- SMDS_TypeOfPosition GetTypeOfPosition() const;
- void SetUParameter(double aUparam);
- void SetVParameter(double aVparam);
- double GetUParameter() const;
- double GetVParameter() const;
+ SMDS_FacePosition(int aFaceId=0, double aUParam=0,
+ double aVParam=0);
+ const virtual double * Coords() const;
+ SMDS_TypeOfPosition GetTypeOfPosition() const;
+ void SetUParameter(double aUparam);
+ void SetVParameter(double aVparam);
+ double GetUParameter() const;
+ double GetVParameter() const;
private:
- double myUParameter;
- double myVParameter;
+ double myUParameter;
+ double myVParameter;
};
#endif
template<typename VALUE> class SMDS_Iterator
{
public:
- /// Return true if and only if there are other object in this iterator
- virtual bool more()=0;
-
- /// Return the current object and step to the next one
- virtual VALUE next()=0;
-
- /// Delete the current element and step to the next one
- virtual void remove(){}
-
- /// Provide virtual destructor just for case if some derived iterator
+ /// Return true if and only if there are other object in this iterator
+ virtual bool more()=0;
+
+ /// Return the current object and step to the next one
+ virtual VALUE next()=0;
+
+ /// Delete the current element and step to the next one
+ virtual void remove(){}
+
+ /// Provide virtual destructor just for case if some derived iterator
/// must have a destructor
- virtual ~SMDS_Iterator(){}
+ virtual ~SMDS_Iterator(){}
};
#endif
bool SMDS_IteratorOfElements::subMore()
{
- if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
- {
- if(t1Iterator->more())
- {
- t2Iterator=t1Iterator->next()->elementsIterator(myType);
- return subMore();
- }
- else return false;
- }
- else return true;
+ if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
+ {
+ if(t1Iterator->more())
+ {
+ t2Iterator=t1Iterator->next()->elementsIterator(myType);
+ return subMore();
+ }
+ else return false;
+ }
+ else return true;
}
const SMDS_MeshElement * SMDS_IteratorOfElements::subNext()
{
- if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
- if(t1Iterator->more())
- t2Iterator=t1Iterator->next()->elementsIterator(myType);
- return t2Iterator->next();
+ if((t2Iterator.get()==NULL)||(!t2Iterator->more()))
+ if(t1Iterator->more())
+ t2Iterator=t1Iterator->next()->elementsIterator(myType);
+ return t2Iterator->next();
}
/////////////////////////////////////////////////////////////////////////////
myType(type), myElement(element),
myProxyElement(NULL)
{
- while(subMore())
- alreadyReturnedElements.insert(subNext());
- itAlreadyReturned= alreadyReturnedElements.begin();
- switch(myElement->GetType())
- {
- case SMDSAbs_Node:
- case SMDSAbs_Edge: myReverseIteration=true; break;
- case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break;
- default: myReverseIteration=false;
- }
+ while(subMore())
+ alreadyReturnedElements.insert(subNext());
+ itAlreadyReturned= alreadyReturnedElements.begin();
+ switch(myElement->GetType())
+ {
+ case SMDSAbs_Node:
+ case SMDSAbs_Edge: myReverseIteration=true; break;
+ case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break;
+ default: myReverseIteration=false;
+ }
}
bool SMDS_IteratorOfElements::more()
{
- if(myProxyElement==NULL)
- {
- while(itAlreadyReturned!=alreadyReturnedElements.end())
- {
- myProxyElement=*itAlreadyReturned;
- itAlreadyReturned++;
+ if(myProxyElement==NULL)
+ {
+ while(itAlreadyReturned!=alreadyReturnedElements.end())
+ {
+ myProxyElement=*itAlreadyReturned;
+ itAlreadyReturned++;
- if(myReverseIteration)
- {
- SMDS_ElemIteratorPtr it=
- myProxyElement->elementsIterator(myElement->GetType());
- while(it->more())
- {
- if(it->next()==myElement) return true;
- }
- }
- else return true;
- }
- myProxyElement=NULL;
- return false;
- }
- else return true;
+ if(myReverseIteration)
+ {
+ SMDS_ElemIteratorPtr it=
+ myProxyElement->elementsIterator(myElement->GetType());
+ while(it->more())
+ {
+ if(it->next()==myElement) return true;
+ }
+ }
+ else return true;
+ }
+ myProxyElement=NULL;
+ return false;
+ }
+ else return true;
}
const SMDS_MeshElement * SMDS_IteratorOfElements::next()
{
- more();
- const SMDS_MeshElement *e=myProxyElement;
- myProxyElement=NULL;
- return e;
+ more();
+ const SMDS_MeshElement *e=myProxyElement;
+ myProxyElement=NULL;
+ return e;
}
/// Create an iterator which look for elements of type type which are linked
/// to the element element. it is the iterator to get connectivity of element
//////////////////////////////////////////////////////////////////////////////
- SMDS_IteratorOfElements(const SMDS_MeshElement * element,
+ SMDS_IteratorOfElements(const SMDS_MeshElement * element,
SMDSAbs_ElementType type,
const SMDS_ElemIteratorPtr& it);
- bool more();
- const SMDS_MeshElement * next();
+ bool more();
+ const SMDS_MeshElement * next();
private:
- SMDS_ElemIteratorPtr t2Iterator;
- SMDS_ElemIteratorPtr t1Iterator;
- SMDSAbs_ElementType myType;
- const SMDS_MeshElement * myProxyElement;
- const SMDS_MeshElement * myElement;
- bool myReverseIteration;
+ SMDS_ElemIteratorPtr t2Iterator;
+ SMDS_ElemIteratorPtr t1Iterator;
+ SMDSAbs_ElementType myType;
+ const SMDS_MeshElement * myProxyElement;
+ const SMDS_MeshElement * myElement;
+ bool myReverseIteration;
- std::set<const SMDS_MeshElement*> alreadyReturnedElements;
- std::set<const SMDS_MeshElement*>::iterator itAlreadyReturned;
- bool subMore();
- const SMDS_MeshElement * subNext();
+ std::set<const SMDS_MeshElement*> alreadyReturnedElements;
+ std::set<const SMDS_MeshElement*>::iterator itAlreadyReturned;
+ bool subMore();
+ const SMDS_MeshElement * subNext();
};
//purpose :
//=======================================================================
SMDS_Mesh0DElement::SMDS_Mesh0DElement (const SMDS_MeshNode * node)
-{
+{
myNode = node;
}
SMDS_MeshEdge::SMDS_MeshEdge(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2)
-{
- myNodes[0]=node1;
- myNodes[1]=node2;
+{
+ myNodes[0]=node1;
+ myNodes[1]=node2;
}
//=======================================================================
void SMDS_MeshEdge::Print(ostream & OS) const
{
- OS << "edge <" << GetID() << "> : (" << myNodes[0] << " , " << myNodes[1] <<
- ") " << endl;
+ OS << "edge <" << GetID() << "> : (" << myNodes[0] << " , " << myNodes[1] <<
+ ") " << endl;
}
int SMDS_MeshEdge::NbNodes() const
{
- return 2;
+ return 2;
}
int SMDS_MeshEdge::NbEdges() const
{
- return 1;
+ return 1;
}
SMDSAbs_ElementType SMDS_MeshEdge::GetType() const
{
- return SMDSAbs_Edge;
+ return SMDSAbs_Edge;
}
class SMDS_MeshEdge_MyNodeIterator:public SMDS_ElemIterator
};
SMDS_ElemIteratorPtr SMDS_MeshEdge::
- elementsIterator(SMDSAbs_ElementType type) const
+ elementsIterator(SMDSAbs_ElementType type) const
{
switch(type)
{
bool operator<(const SMDS_MeshEdge & e1, const SMDS_MeshEdge & e2)
{
- int id11=e1.myNodes[0]->GetID();
- int id21=e2.myNodes[0]->GetID();
- int id12=e1.myNodes[1]->GetID();
- int id22=e2.myNodes[1]->GetID();
- int tmp;
-
- if(id11>=id12)
- {
- tmp=id11;
- id11=id12;
- id12=tmp;
- }
- if(id21>=id22)
- {
- tmp=id21;
- id21=id22;
- id22=tmp;
- }
-
- if(id11<id21) return true;
- else if(id11==id21) return (id21<id22);
- else return false;
+ int id11=e1.myNodes[0]->GetID();
+ int id21=e2.myNodes[0]->GetID();
+ int id12=e1.myNodes[1]->GetID();
+ int id22=e2.myNodes[1]->GetID();
+ int tmp;
+
+ if(id11>=id12)
+ {
+ tmp=id11;
+ id11=id12;
+ id12=tmp;
+ }
+ if(id21>=id22)
+ {
+ tmp=id21;
+ id21=id22;
+ id22=tmp;
+ }
+
+ if(id11<id21) return true;
+ else if(id11==id21) return (id21<id22);
+ else return false;
}
/*!
{
public:
- SMDS_MeshEdge(const SMDS_MeshNode * node1,
+ SMDS_MeshEdge(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2);
bool ChangeNodes(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2);
- void Print(std::ostream & OS) const;
+ void Print(std::ostream & OS) const;
- virtual SMDSAbs_ElementType GetType() const;
- virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Edge; }
- int NbNodes() const;
- int NbEdges() const;
- friend bool operator<(const SMDS_MeshEdge& e1, const SMDS_MeshEdge& e2);
+ virtual SMDSAbs_ElementType GetType() const;
+ virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Edge; }
+ int NbNodes() const;
+ int NbEdges() const;
+ friend bool operator<(const SMDS_MeshEdge& e1, const SMDS_MeshEdge& e2);
/*!
* \brief Return node by its index
virtual const SMDS_MeshNode* GetNode(const int ind) const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
protected:
- const SMDS_MeshNode* myNodes[3];
+ const SMDS_MeshNode* myNodes[3];
};
#endif
void SMDS_MeshElement::Print(ostream & OS) const
{
- OS << "dump of mesh element" << endl;
+ OS << "dump of mesh element" << endl;
}
ostream & operator <<(ostream & OS, const SMDS_MeshElement * ME)
{
- ME->Print(OS);
- return OS;
+ ME->Print(OS);
+ return OS;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SMDS_ElemIteratorPtr SMDS_MeshElement::nodesIterator() const
{
- return elementsIterator(SMDSAbs_Node);
+ return elementsIterator(SMDSAbs_Node);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SMDS_ElemIteratorPtr SMDS_MeshElement::edgesIterator() const
{
- return elementsIterator(SMDSAbs_Edge);
+ return elementsIterator(SMDSAbs_Edge);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SMDS_ElemIteratorPtr SMDS_MeshElement::facesIterator() const
{
- return elementsIterator(SMDSAbs_Face);
+ return elementsIterator(SMDSAbs_Face);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int SMDS_MeshElement::NbNodes() const
{
- int nbnodes=0;
- SMDS_ElemIteratorPtr it=nodesIterator();
- while(it->more())
- {
- it->next();
- nbnodes++;
- }
- return nbnodes;
+ int nbnodes=0;
+ SMDS_ElemIteratorPtr it=nodesIterator();
+ while(it->more())
+ {
+ it->next();
+ nbnodes++;
+ }
+ return nbnodes;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int SMDS_MeshElement::NbEdges() const
{
- int nbedges=0;
- SMDS_ElemIteratorPtr it=edgesIterator();
- while(it->more())
- {
- it->next();
- nbedges++;
- }
- return nbedges;
+ int nbedges=0;
+ SMDS_ElemIteratorPtr it=edgesIterator();
+ while(it->more())
+ {
+ it->next();
+ nbedges++;
+ }
+ return nbedges;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int SMDS_MeshElement::NbFaces() const
{
- int nbfaces=0;
- SMDS_ElemIteratorPtr it=facesIterator();
- while(it->more())
- {
- it->next();
- nbfaces++;
- }
- return nbfaces;
+ int nbfaces=0;
+ SMDS_ElemIteratorPtr it=facesIterator();
+ while(it->more())
+ {
+ it->next();
+ nbfaces++;
+ }
+ return nbfaces;
}
///////////////////////////////////////////////////////////////////////////////
const SMDS_MeshElement* next()
{
myMore=false;
- return myElement;
- }
+ return myElement;
+ }
};
SMDS_ElemIteratorPtr SMDS_MeshElement::
- elementsIterator(SMDSAbs_ElementType type) const
+ elementsIterator(SMDSAbs_ElementType type) const
{
- /** @todo Check that iterator in the child classes return elements
- in the same order for each different implementation (i.e: SMDS_VolumeOfNodes
- and SMDS_VolumeOfFaces */
-
- if(type==GetType())
+ /** @todo Check that iterator in the child classes return elements
+ in the same order for each different implementation (i.e: SMDS_VolumeOfNodes
+ and SMDS_VolumeOfFaces */
+
+ if(type==GetType())
return SMDS_ElemIteratorPtr(new SMDS_MeshElement_MyIterator(this));
- else
- {
+ else
+ {
MESSAGE("Iterator not implemented");
return SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL);
- }
+ }
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int SMDS_MeshElement::GetID() const
{
- return myID;
+ return myID;
}
bool operator<(const SMDS_MeshElement& e1, const SMDS_MeshElement& e2)
{
- if(e1.GetType()!=e2.GetType()) return false;
- switch(e1.GetType())
- {
- case SMDSAbs_Node:
- return static_cast<const SMDS_MeshNode &>(e1) <
- static_cast<const SMDS_MeshNode &>(e2);
+ if(e1.GetType()!=e2.GetType()) return false;
+ switch(e1.GetType())
+ {
+ case SMDSAbs_Node:
+ return static_cast<const SMDS_MeshNode &>(e1) <
+ static_cast<const SMDS_MeshNode &>(e2);
- case SMDSAbs_Edge:
- return static_cast<const SMDS_MeshEdge &>(e1) <
- static_cast<const SMDS_MeshEdge &>(e2);
+ case SMDSAbs_Edge:
+ return static_cast<const SMDS_MeshEdge &>(e1) <
+ static_cast<const SMDS_MeshEdge &>(e2);
- case SMDSAbs_Face:
- return static_cast<const SMDS_MeshFace &>(e1) <
- static_cast<const SMDS_MeshFace &>(e2);
+ case SMDSAbs_Face:
+ return static_cast<const SMDS_MeshFace &>(e1) <
+ static_cast<const SMDS_MeshFace &>(e2);
- case SMDSAbs_Volume:
- return static_cast<const SMDS_MeshVolume &>(e1) <
- static_cast<const SMDS_MeshVolume &>(e2);
+ case SMDSAbs_Volume:
+ return static_cast<const SMDS_MeshVolume &>(e1) <
+ static_cast<const SMDS_MeshVolume &>(e2);
- default : MESSAGE("Internal Error");
- }
+ default : MESSAGE("Internal Error");
+ }
return false;
}
#define _SMDS_MeshElement_HeaderFile
#include "SMESH_SMDS.hxx"
-
+
#include "SMDSAbs_ElementType.hxx"
#include "SMDS_MeshObject.hxx"
#include "SMDS_ElemIterator.hxx"
class SMDS_MeshNode;
class SMDS_MeshEdge;
-class SMDS_MeshFace;
+class SMDS_MeshFace;
// ============================================================
/*!
SMDSAbs_ElementType SMDS_MeshFace::GetType() const
{
- return SMDSAbs_Face;
+ return SMDSAbs_Face;
}
class SMDS_EXPORT SMDS_MeshFace:public SMDS_MeshElement
{
public:
- SMDSAbs_ElementType GetType() const;
+ SMDSAbs_ElementType GetType() const;
};
#endif
SMDS_MeshGroup::SMDS_MeshGroup(const SMDS_Mesh * theMesh,
const SMDSAbs_ElementType theType)
- :myMesh(theMesh),myType(theType), myParent(NULL)
+ :myMesh(theMesh),myType(theType), myParent(NULL)
{
}
SMDS_MeshGroup::SMDS_MeshGroup(SMDS_MeshGroup * theParent,
const SMDSAbs_ElementType theType)
- :myMesh(theParent->myMesh),myType(theType), myParent(theParent)
+ :myMesh(theParent->myMesh),myType(theType), myParent(theParent)
{
}
const SMDS_MeshGroup *SMDS_MeshGroup::AddSubGroup
(const SMDSAbs_ElementType theType)
{
- const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this,theType);
- myChildren.insert(myChildren.end(),subgroup);
- return subgroup;
+ const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this,theType);
+ myChildren.insert(myChildren.end(),subgroup);
+ return subgroup;
}
//=======================================================================
bool SMDS_MeshGroup::RemoveSubGroup(const SMDS_MeshGroup * theGroup)
{
- bool found = false;
- list<const SMDS_MeshGroup*>::iterator itgroup;
- for(itgroup=myChildren.begin(); itgroup!=myChildren.end(); itgroup++)
- {
- const SMDS_MeshGroup* subgroup=*itgroup;
- if (subgroup == theGroup)
- {
- found = true;
- myChildren.erase(itgroup);
- }
- }
-
- return found;
+ bool found = false;
+ list<const SMDS_MeshGroup*>::iterator itgroup;
+ for(itgroup=myChildren.begin(); itgroup!=myChildren.end(); itgroup++)
+ {
+ const SMDS_MeshGroup* subgroup=*itgroup;
+ if (subgroup == theGroup)
+ {
+ found = true;
+ myChildren.erase(itgroup);
+ }
+ }
+
+ return found;
}
//=======================================================================
bool SMDS_MeshGroup::RemoveFromParent()
{
-
- if (myParent==NULL) return false;
- else
- {
- return (myParent->RemoveSubGroup(this));
- }
+
+ if (myParent==NULL) return false;
+ else
+ {
+ return (myParent->RemoveSubGroup(this));
+ }
}
//=======================================================================
//function : Clear
void SMDS_MeshGroup::Clear()
{
- myElements.clear();
- myType = SMDSAbs_All;
+ myElements.clear();
+ myType = SMDSAbs_All;
}
//=======================================================================
void SMDS_MeshGroup::Add(const SMDS_MeshElement * theElem)
{
- // the type of the group is determined by the first element added
- if (myElements.empty()) myType = theElem->GetType();
- else if (theElem->GetType() != myType) {
- MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
- return;
- }
-
- myElements.insert(theElem);
+ // the type of the group is determined by the first element added
+ if (myElements.empty()) myType = theElem->GetType();
+ else if (theElem->GetType() != myType) {
+ MESSAGE("SMDS_MeshGroup::Add : Type Mismatch "<<theElem->GetType()<<"!="<<myType);
+ return;
+ }
+
+ myElements.insert(theElem);
}
//=======================================================================
bool SMDS_MeshGroup::Contains(const SMDS_MeshElement * theElem) const
{
- return myElements.find(theElem)!=myElements.end();
+ return myElements.find(theElem)!=myElements.end();
}
//=======================================================================
class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject
{
public:
- SMDS_MeshGroup(const SMDS_Mesh * theMesh,
+ SMDS_MeshGroup(const SMDS_Mesh * theMesh,
const SMDSAbs_ElementType theType = SMDSAbs_All);
- const SMDS_MeshGroup * AddSubGroup
+ const SMDS_MeshGroup * AddSubGroup
(const SMDSAbs_ElementType theType = SMDSAbs_All);
- virtual bool RemoveSubGroup(const SMDS_MeshGroup* theGroup);
- virtual bool RemoveFromParent();
+ virtual bool RemoveSubGroup(const SMDS_MeshGroup* theGroup);
+ virtual bool RemoveFromParent();
const SMDS_Mesh* GetMesh() const { return myMesh; }
void SetType (const SMDSAbs_ElementType theType);
void Clear();
- void Add(const SMDS_MeshElement * theElem);
- bool Remove(const SMDS_MeshElement * theElem);
- bool IsEmpty() const { return myElements.empty(); }
- int Extent() const { return myElements.size(); }
+ void Add(const SMDS_MeshElement * theElem);
+ bool Remove(const SMDS_MeshElement * theElem);
+ bool IsEmpty() const { return myElements.empty(); }
+ int Extent() const { return myElements.size(); }
- int SubGroupsNb() const { return myChildren.size(); }
+ int SubGroupsNb() const { return myChildren.size(); }
SMDSAbs_ElementType GetType() const { return myType; }
- bool Contains(const SMDS_MeshElement * theElem) const;
+ bool Contains(const SMDS_MeshElement * theElem) const;
void InitIterator() const
{ const_cast<TIterator&>(myIterator) = myElements.begin(); }
{ return *(const_cast<TGroupIterator&>(myGroupIterator))++; }
private:
- SMDS_MeshGroup(SMDS_MeshGroup* theParent,
+ SMDS_MeshGroup(SMDS_MeshGroup* theParent,
const SMDSAbs_ElementType theType = SMDSAbs_All);
typedef std::set<const SMDS_MeshElement *>::const_iterator TIterator;
typedef std::list<const SMDS_MeshGroup *>::const_iterator TGroupIterator;
- const SMDS_Mesh * myMesh;
- SMDSAbs_ElementType myType;
- std::set<const SMDS_MeshElement *> myElements;
- SMDS_MeshGroup * myParent;
- std::list<const SMDS_MeshGroup*> myChildren;
+ const SMDS_Mesh * myMesh;
+ SMDSAbs_ElementType myType;
+ std::set<const SMDS_MeshElement *> myElements;
+ SMDS_MeshGroup * myParent;
+ std::list<const SMDS_MeshGroup*> myChildren;
TIterator myIterator;
TGroupIterator myGroupIterator;
};
int SMDS_MeshIDFactory::GetFreeID()
{
- if (myPoolOfID.empty()) return ++myMaxID;
- else
- {
+ if (myPoolOfID.empty()) return ++myMaxID;
+ else
+ {
set<int>::iterator i = myPoolOfID.begin();
- int ID = *i;//myPoolOfID.top();
- myPoolOfID.erase( i );//myPoolOfID.pop();
- return ID;
- }
+ int ID = *i;//myPoolOfID.top();
+ myPoolOfID.erase( i );//myPoolOfID.pop();
+ return ID;
+ }
}
//=======================================================================
virtual void Clear();
protected:
- SMDS_MeshIDFactory();
- int myMaxID;
- std::set<int> myPoolOfID;
+ SMDS_MeshIDFactory();
+ int myMaxID;
+ std::set<int> myPoolOfID;
};
#endif
//=======================================================================
SMDS_MeshNode::SMDS_MeshNode(double x, double y, double z):
- myX(x), myY(y), myZ(z),
- myPosition(SMDS_SpacePosition::originSpacePosition())
+ myX(x), myY(y), myZ(z),
+ myPosition(SMDS_SpacePosition::originSpacePosition())
{
}
void SMDS_MeshNode::Print(ostream & OS) const
{
- OS << "Node <" << GetID() << "> : X = " << myX << " Y = "
- << myY << " Z = " << myZ << endl;
+ OS << "Node <" << GetID() << "> : X = " << myX << " Y = "
+ << myY << " Z = " << myZ << endl;
}
//=======================================================================
void SMDS_MeshNode::SetPosition(const SMDS_PositionPtr& aPos)
{
- myPosition = aPos;
+ myPosition = aPos;
}
//=======================================================================
const SMDS_PositionPtr& SMDS_MeshNode::GetPosition() const
{
- return myPosition;
+ return myPosition;
}
//=======================================================================
const SMDS_MeshElement* current=myIterator.Value();
myIterator.Next();
return current;
- }
+ }
};
SMDS_ElemIteratorPtr SMDS_MeshNode::
- GetInverseElementIterator(SMDSAbs_ElementType type) const
+ GetInverseElementIterator(SMDSAbs_ElementType type) const
{
return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(myInverseElements,type));
}
};
SMDS_ElemIteratorPtr SMDS_MeshNode::
- elementsIterator(SMDSAbs_ElementType type) const
+ elementsIterator(SMDSAbs_ElementType type) const
{
if(type==SMDSAbs_Node)
return SMDS_MeshElement::elementsIterator(SMDSAbs_Node);
int SMDS_MeshNode::NbNodes() const
{
- return 1;
+ return 1;
}
double SMDS_MeshNode::X() const
{
- return myX;
+ return myX;
}
double SMDS_MeshNode::Y() const
{
- return myY;
+ return myY;
}
double SMDS_MeshNode::Z() const
{
- return myZ;
+ return myZ;
}
void SMDS_MeshNode::setXYZ(double x, double y, double z)
{
- myX=x;
- myY=y;
- myZ=z;
+ myX=x;
+ myY=y;
+ myZ=z;
}
SMDSAbs_ElementType SMDS_MeshNode::GetType() const
{
- return SMDSAbs_Node;
+ return SMDSAbs_Node;
}
//=======================================================================
///////////////////////////////////////////////////////////////////////////////
bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2)
{
- return e1.GetID()<e2.GetID();
- /*if(e1.myX<e2.myX) return true;
- else if(e1.myX==e2.myX)
- {
- if(e1.myY<e2.myY) return true;
- else if(e1.myY==e2.myY) return (e1.myZ<e2.myZ);
- else return false;
- }
- else return false;*/
+ return e1.GetID()<e2.GetID();
+ /*if(e1.myX<e2.myX) return true;
+ else if(e1.myX==e2.myX)
+ {
+ if(e1.myY<e2.myY) return true;
+ else if(e1.myY==e2.myY) return (e1.myZ<e2.myZ);
+ else return false;
+ }
+ else return false;*/
}
SMDSAbs_ElementType SMDS_MeshVolume::GetType() const
{
- return SMDSAbs_Volume;
+ return SMDSAbs_Volume;
}
class SMDS_EXPORT SMDS_MeshVolume:public SMDS_MeshElement
{
-
+
public:
- SMDSAbs_ElementType GetType() const;
+ SMDSAbs_ElementType GetType() const;
};
#endif
//virtual ~SMDS_PolyhedralVolumeOfNodes();
- virtual SMDSAbs_ElementType GetType() const;
+ virtual SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Polyhedra; }
virtual bool IsPoly() const { return true; };
void SMDS_Position::SetShapeId(int aShapeId)
{
- myShapeId = aShapeId;
+ myShapeId = aShapeId;
}
//=======================================================================
int SMDS_Position::GetShapeId() const
{
- return myShapeId;
+ return myShapeId;
}
//=======================================================================
{
public:
- const virtual double * Coords() const = 0;
- virtual SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
- virtual int GetDim() const;
- void SetShapeId(int aShapeId);
- int GetShapeId() const;
- virtual ~SMDS_Position() {}
+ const virtual double * Coords() const = 0;
+ virtual SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
+ virtual int GetDim() const;
+ void SetShapeId(int aShapeId);
+ int GetShapeId() const;
+ virtual ~SMDS_Position() {}
protected:
- SMDS_Position(int aShapeId);
+ SMDS_Position(int aShapeId);
private:
- int myShapeId;
+ int myShapeId;
};
const SMDS_MeshNode * node2,
const SMDS_MeshNode * node12)
:SMDS_MeshEdge(node1,node2)
-{
+{
myNodes[2]=node12;
}
//=======================================================================
SMDS_SpacePosition::SMDS_SpacePosition(double x, double y, double z):
- SMDS_Position(0)
+ SMDS_Position(0)
{
- myCoords[0]=x;
- myCoords[1]=y;
- myCoords[2]=z;
+ myCoords[0]=x;
+ myCoords[1]=y;
+ myCoords[2]=z;
}
/**
*/
SMDS_TypeOfPosition SMDS_SpacePosition::GetTypeOfPosition() const
{
- return SMDS_TOP_3DSPACE;
+ return SMDS_TOP_3DSPACE;
}
const double * SMDS_SpacePosition::Coords() const
{
- return myCoords;
+ return myCoords;
}
SMDS_PositionPtr SMDS_SpacePosition::originSpacePosition()
{
public:
- SMDS_SpacePosition(double x=0, double y=0, double z=0);
- const virtual double * Coords() const;
- virtual inline SMDS_TypeOfPosition GetTypeOfPosition() const;
- inline void SetCoords(const double x, const double y, const double z);
+ SMDS_SpacePosition(double x=0, double y=0, double z=0);
+ const virtual double * Coords() const;
+ virtual inline SMDS_TypeOfPosition GetTypeOfPosition() const;
+ inline void SetCoords(const double x, const double y, const double z);
static SMDS_PositionPtr originSpacePosition();
private:
- double myCoords[3];
+ double myCoords[3];
};
#endif
enum SMDS_TypeOfPosition // Value is equal to shape dimention
{
- SMDS_TOP_UNSPEC = -1,
- SMDS_TOP_VERTEX = 0,
- SMDS_TOP_EDGE = 1,
- SMDS_TOP_FACE = 2,
- SMDS_TOP_3DSPACE = 3
+ SMDS_TOP_UNSPEC = -1,
+ SMDS_TOP_VERTEX = 0,
+ SMDS_TOP_EDGE = 1,
+ SMDS_TOP_FACE = 2,
+ SMDS_TOP_3DSPACE = 3
};
#endif
//=======================================================================
SMDS_VertexPosition:: SMDS_VertexPosition(const int aVertexId)
- :SMDS_Position(aVertexId)
+ :SMDS_Position(aVertexId)
{
}
const double *SMDS_VertexPosition::Coords() const
{
- const static double origin[]={0,0,0};
- MESSAGE("SMDS_VertexPosition::Coords not implemented");
- return origin;
+ const static double origin[]={0,0,0};
+ MESSAGE("SMDS_VertexPosition::Coords not implemented");
+ return origin;
}
SMDS_TypeOfPosition SMDS_VertexPosition::GetTypeOfPosition() const
{
- return SMDS_TOP_VERTEX;
+ return SMDS_TOP_VERTEX;
}
class SMDS_EXPORT SMDS_VertexPosition:public SMDS_Position
{
- public:
- SMDS_TypeOfPosition GetTypeOfPosition() const;
- SMDS_VertexPosition(int aVertexId=0);
- const double *Coords() const;
+ public:
+ SMDS_TypeOfPosition GetTypeOfPosition() const;
+ SMDS_VertexPosition(int aVertexId=0);
+ const double *Coords() const;
};
#endif
void SMDS_VolumeOfFaces::Print(ostream & OS) const
{
- OS << "volume <" << GetID() << "> : ";
- int i;
- for (i = 0; i < NbFaces()-1; ++i) OS << myFaces[i] << ",";
- OS << myFaces[i]<< ") " << endl;
+ OS << "volume <" << GetID() << "> : ";
+ int i;
+ for (i = 0; i < NbFaces()-1; ++i) OS << myFaces[i] << ",";
+ OS << myFaces[i]<< ") " << endl;
}
int SMDS_VolumeOfFaces::NbFaces() const
{
- return myNbFaces;
+ return myNbFaces;
}
class SMDS_VolumeOfFaces_MyIterator:public SMDS_ElemIterator
};
SMDS_ElemIteratorPtr SMDS_VolumeOfFaces::
- elementsIterator(SMDSAbs_ElementType type) const
+ elementsIterator(SMDSAbs_ElementType type) const
{
switch(type)
{
const SMDS_MeshFace * face3,
const SMDS_MeshFace * face4)
{
- myNbFaces = 4;
- myFaces[0]=face1;
- myFaces[1]=face2;
- myFaces[2]=face3;
- myFaces[3]=face4;
- myFaces[4]=0;
- myFaces[5]=0;
+ myNbFaces = 4;
+ myFaces[0]=face1;
+ myFaces[1]=face2;
+ myFaces[2]=face3;
+ myFaces[3]=face4;
+ myFaces[4]=0;
+ myFaces[5]=0;
}
SMDS_VolumeOfFaces::SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face4,
const SMDS_MeshFace * face5)
{
- myNbFaces = 5;
- myFaces[0]=face1;
- myFaces[1]=face2;
- myFaces[2]=face3;
- myFaces[3]=face4;
- myFaces[4]=face5;
- myFaces[5]=0;
+ myNbFaces = 5;
+ myFaces[0]=face1;
+ myFaces[1]=face2;
+ myFaces[2]=face3;
+ myFaces[3]=face4;
+ myFaces[4]=face5;
+ myFaces[5]=0;
}
SMDS_VolumeOfFaces::SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face5,
const SMDS_MeshFace * face6)
{
- myNbFaces = 6;
- myFaces[0]=face1;
- myFaces[1]=face2;
- myFaces[2]=face3;
- myFaces[3]=face4;
- myFaces[4]=face5;
- myFaces[5]=face6;
+ myNbFaces = 6;
+ myFaces[0]=face1;
+ myFaces[1]=face2;
+ myFaces[2]=face3;
+ myFaces[3]=face4;
+ myFaces[4]=face5;
+ myFaces[5]=face6;
}
SMDSAbs_EntityType SMDS_VolumeOfFaces::GetEntityType() const
class SMDS_EXPORT SMDS_VolumeOfFaces:public SMDS_MeshVolume
{
-
+
public:
- SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
+ SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face2,
const SMDS_MeshFace * face3,
const SMDS_MeshFace * face4);
- SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
+ SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face2,
const SMDS_MeshFace * face3,
const SMDS_MeshFace * face4,
const SMDS_MeshFace * face5);
- SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
+ SMDS_VolumeOfFaces(const SMDS_MeshFace * face1,
const SMDS_MeshFace * face2,
const SMDS_MeshFace * face3,
const SMDS_MeshFace * face4,
const SMDS_MeshFace * face6);
virtual SMDSAbs_EntityType GetEntityType() const;
- void Print(std::ostream & OS) const;
-
- int NbFaces() const;
+ void Print(std::ostream & OS) const;
+
+ int NbFaces() const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
- const SMDS_MeshFace * myFaces[6];
- int myNbFaces;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
+ const SMDS_MeshFace * myFaces[6];
+ int myNbFaces;
};
#endif
class SMDS_EXPORT SMDS_VolumeOfNodes:public SMDS_MeshVolume
{
-
+
public:
- SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4);
- SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5);
- SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5,
- const SMDS_MeshNode * node6);
- SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5,
- const SMDS_MeshNode * node6,
- const SMDS_MeshNode * node7,
- const SMDS_MeshNode * node8);
+ SMDS_VolumeOfNodes(
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4);
+ SMDS_VolumeOfNodes(
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5);
+ SMDS_VolumeOfNodes(
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5,
+ const SMDS_MeshNode * node6);
+ SMDS_VolumeOfNodes(
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5,
+ const SMDS_MeshNode * node6,
+ const SMDS_MeshNode * node7,
+ const SMDS_MeshNode * node8);
bool ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes);
~SMDS_VolumeOfNodes();
- void Print(std::ostream & OS) const;
- int NbFaces() const;
- int NbNodes() const;
- int NbEdges() const;
- virtual SMDSAbs_ElementType GetType() const;
+ void Print(std::ostream & OS) const;
+ int NbFaces() const;
+ int NbNodes() const;
+ int NbEdges() const;
+ virtual SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const;
/*!
virtual const SMDS_MeshNode* GetNode(const int ind) const;
protected:
- SMDS_ElemIteratorPtr
- elementsIterator(SMDSAbs_ElementType type) const;
- const SMDS_MeshNode** myNodes;
- int myNbNodes;
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
+ const SMDS_MeshNode** myNodes;
+ int myNbNodes;
};
#endif
private:
- int _localId; // unique Id of created objects, within SMESH_Gen entity
+ int _localId; // unique Id of created objects, within SMESH_Gen entity
std::map < int, StudyContextStruct * >_mapStudyContext;
// hypotheses managing
//function : AddNodesWithID
//=======================================================================
inline void AddNodesWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()");
for(CORBA::Long aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){
SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId],
- aCoords[aCoordId+1],
- aCoords[aCoordId+2],
- anIndexes[anElemId]);
+ aCoords[aCoordId+1],
+ aCoords[aCoordId+2],
+ anIndexes[anElemId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddNodeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddNodeWithID for ID = "<<anElemId);
}
}
SMDS_MeshElement* anElem = theMesh->Add0DElementWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId]);
if (!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot Add0DElementWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot Add0DElementWithID for ID = "<<anElemId);
}
}
//function : AddEdgesWithID
//=======================================================================
inline void AddEdgesWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()");
for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){
SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
- anIndexes[anIndexId+2],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
}
}
//function : AddTriasWithID
//=======================================================================
inline void AddTriasWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
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],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
}
}
//function : AddQuadsWithID
//=======================================================================
inline void AddQuadsWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
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],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
}
}
SMDS_MeshElement* anElem = theMesh->AddPolygonalFaceWithID(nodes_ids, aFaceId);
if (!anElem)
- EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolygonalFaceWithID for ID = "
+ EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolygonalFaceWithID for ID = "
<< anElemId);
}
}
//function : AddTetrasWithID
//=======================================================================
inline void AddTetrasWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
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],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
//function : AddPiramidsWithID
//=======================================================================
inline void AddPiramidsWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
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],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId+4],
+ anIndexes[anIndexId+5],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
//function : AddPrismsWithID
//=======================================================================
inline void AddPrismsWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
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],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId]);
+ 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 AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
//function : AddHexasWithID
//=======================================================================
inline void AddHexasWithID(SMDS_Mesh* theMesh,
- SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::log_array_var& theSeq,
+ CORBA::Long theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
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],
- anIndexes[anIndexId+3],
- anIndexes[anIndexId+4],
- anIndexes[anIndexId+5],
- anIndexes[anIndexId+6],
- anIndexes[anIndexId+7],
- anIndexes[anIndexId+8],
- anIndexes[anIndexId]);
+ 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 AddVolumeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
SMDS_MeshElement* anElem =
theMesh->AddPolyhedralVolumeWithID(nodes_ids, quantities, aFaceId);
if (!anElem)
- EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolyhedralVolumeWithID for ID = "
+ EXCEPTION(runtime_error, "SMDS_Mesh::FindElement - cannot AddPolyhedralVolumeWithID for ID = "
<< anElemId);
}
}
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]);
+ anIndexes[anIndexId+2],
+ anIndexes[anIndexId+3],
+ anIndexes[anIndexId]);
if(!anElem)
- EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddEdgeWithID for ID = "<<anElemId);
}
}
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]);
+ 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);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
}
}
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]);
+ 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);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddFaceWithID for ID = "<<anElemId);
}
}
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]);
+ 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);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
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]);
+ 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);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
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]);
+ 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);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
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]);
+ 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);
+ EXCEPTION(runtime_error,"SMDS_Mesh::FindElement - cannot AddVolumeWithID for ID = "<<anElemId);
}
}
//=======================================================================
SMESH::SMESH_Gen_var
SMESH_Client::GetSMESHGen(CORBA::ORB_ptr theORB,
- CORBA::Boolean& theIsEmbeddedMode)
+ CORBA::Boolean& theIsEmbeddedMode)
{
static SMESH::SMESH_Gen_var aMeshGen;
// purpose :
//=======================================================================
SMESH_Client::SMESH_Client(CORBA::ORB_ptr theORB,
- SMESH::SMESH_Mesh_ptr theMesh):
+ SMESH::SMESH_Mesh_ptr theMesh):
myMeshServer(SMESH::SMESH_Mesh::_duplicate(theMesh)),
mySMESHDSMesh(NULL),
mySMDSMesh(NULL)
{
for ( CORBA::Long anId = 0; anId < aLength; anId++)
{
- const SMESH::double_array& aCoords = aSeq[anId].coords;
- const SMESH::long_array& anIndexes = aSeq[anId].indexes;
- CORBA::Long anElemId = 0, aNbElems = aSeq[anId].number;
- CORBA::Long aCommand = aSeq[anId].commandType;
+ const SMESH::double_array& aCoords = aSeq[anId].coords;
+ const SMESH::long_array& anIndexes = aSeq[anId].indexes;
+ CORBA::Long anElemId = 0, aNbElems = aSeq[anId].number;
+ CORBA::Long aCommand = aSeq[anId].commandType;
- switch(aCommand)
+ switch(aCommand)
{
- case SMESH::ADD_NODE : AddNodesWithID ( mySMDSMesh, aSeq, anId ); break;
+ case SMESH::ADD_NODE : AddNodesWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_ELEM0D : Add0DElementsWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_EDGE : AddEdgesWithID ( mySMDSMesh, aSeq, anId ); break;
case SMESH::ADD_TRIANGLE : AddTriasWithID ( mySMDSMesh, aSeq, anId ); break;
break;
default:;
- }
+ }
}
}
catch ( SALOME::SALOME_Exception& exc )
static
SMESH::SMESH_Gen_var
GetSMESHGen(CORBA::ORB_ptr theORB,
- CORBA::Boolean& theIsEmbeddedMode);
+ CORBA::Boolean& theIsEmbeddedMode);
SMESH_Client(CORBA::ORB_ptr theORB,
- SMESH::SMESH_Mesh_ptr theMesh);
+ SMESH::SMESH_Mesh_ptr theMesh);
~SMESH_Client();
bool
//=======================================================================
void SMESHDS_Command::AddNode(int NewNodeID, double x, double y, double z)
{
- if (!myType == SMESHDS_AddNode)
- {
- MESSAGE("SMESHDS_Command::AddNode : Bad Type");
- return;
- }
- myIntegers.push_back(NewNodeID);
- myReals.push_back(x);
- myReals.push_back(y);
- myReals.push_back(z);
- myNumber++;
+ if (!myType == SMESHDS_AddNode)
+ {
+ MESSAGE("SMESHDS_Command::AddNode : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewNodeID);
+ myReals.push_back(x);
+ myReals.push_back(y);
+ myReals.push_back(z);
+ myNumber++;
}
//=======================================================================
//=======================================================================
void SMESHDS_Command::MoveNode(int NodeID, double x, double y, double z)
{
- if (!myType == SMESHDS_MoveNode)
- {
- MESSAGE("SMESHDS_Command::MoveNode : Bad Type");
- return;
- }
- myIntegers.push_back(NodeID);
- myReals.push_back(x);
- myReals.push_back(y);
- myReals.push_back(z);
- myNumber++;
+ if (!myType == SMESHDS_MoveNode)
+ {
+ MESSAGE("SMESHDS_Command::MoveNode : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NodeID);
+ myReals.push_back(x);
+ myReals.push_back(y);
+ myReals.push_back(z);
+ myNumber++;
}
//=======================================================================
//=======================================================================
void SMESHDS_Command::AddEdge(int NewEdgeID, int idnode1, int idnode2)
{
- if (!myType == SMESHDS_AddEdge)
- {
- MESSAGE("SMESHDS_Command::AddEdge : Bad Type");
- return;
- }
- myIntegers.push_back(NewEdgeID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myNumber++;
+ if (!myType == SMESHDS_AddEdge)
+ {
+ MESSAGE("SMESHDS_Command::AddEdge : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewEdgeID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID,
- int idnode1, int idnode2, int idnode3)
+ int idnode1, int idnode2, int idnode3)
{
- if (!myType == SMESHDS_AddTriangle)
- {
- MESSAGE("SMESHDS_Command::AddFace : Bad Type");
- return;
- }
- myIntegers.push_back(NewFaceID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myNumber++;
+ if (!myType == SMESHDS_AddTriangle)
+ {
+ MESSAGE("SMESHDS_Command::AddFace : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewFaceID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddFace(int NewFaceID,
- int idnode1, int idnode2, int idnode3, int idnode4)
+ int idnode1, int idnode2, int idnode3, int idnode4)
{
- if (!myType == SMESHDS_AddQuadrangle)
- {
- MESSAGE("SMESHDS_Command::AddFace : Bad Type");
- return;
- }
- myIntegers.push_back(NewFaceID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myNumber++;
+ if (!myType == SMESHDS_AddQuadrangle)
+ {
+ MESSAGE("SMESHDS_Command::AddFace : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewFaceID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1, int idnode2, int idnode3, int idnode4)
+ int idnode1, int idnode2, int idnode3, int idnode4)
{
- if (!myType == SMESHDS_AddTetrahedron)
- {
- MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
- return;
- }
- myIntegers.push_back(NewVolID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myNumber++;
+ if (!myType == SMESHDS_AddTetrahedron)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1, int idnode2, int idnode3, int idnode4, int idnode5)
+ int idnode1, int idnode2, int idnode3, int idnode4, int idnode5)
{
- if (!myType == SMESHDS_AddPyramid)
- {
- MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
- return;
- }
- myIntegers.push_back(NewVolID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myIntegers.push_back(idnode5);
- myNumber++;
+ if (!myType == SMESHDS_AddPyramid)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myIntegers.push_back(idnode5);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,
- int idnode2, int idnode3, int idnode4, int idnode5, int idnode6)
+ int idnode1,
+ int idnode2, int idnode3, int idnode4, int idnode5, int idnode6)
{
- if (!myType == SMESHDS_AddPrism)
- {
- MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
- return;
- }
- myIntegers.push_back(NewVolID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myIntegers.push_back(idnode5);
- myIntegers.push_back(idnode6);
- myNumber++;
+ if (!myType == SMESHDS_AddPrism)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myIntegers.push_back(idnode5);
+ myIntegers.push_back(idnode6);
+ myNumber++;
}
//=======================================================================
//purpose :
//=======================================================================
void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,
- int idnode2,
- int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8)
+ int idnode1,
+ int idnode2,
+ int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8)
{
- if (!myType == SMESHDS_AddHexahedron)
- {
- MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
- return;
- }
- myIntegers.push_back(NewVolID);
- myIntegers.push_back(idnode1);
- myIntegers.push_back(idnode2);
- myIntegers.push_back(idnode3);
- myIntegers.push_back(idnode4);
- myIntegers.push_back(idnode5);
- myIntegers.push_back(idnode6);
- myIntegers.push_back(idnode7);
- myIntegers.push_back(idnode8);
- myNumber++;
+ if (!myType == SMESHDS_AddHexahedron)
+ {
+ MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NewVolID);
+ myIntegers.push_back(idnode1);
+ myIntegers.push_back(idnode2);
+ myIntegers.push_back(idnode3);
+ myIntegers.push_back(idnode4);
+ myIntegers.push_back(idnode5);
+ myIntegers.push_back(idnode6);
+ myIntegers.push_back(idnode7);
+ myIntegers.push_back(idnode8);
+ myNumber++;
}
//=======================================================================
//=======================================================================
void SMESHDS_Command::RemoveNode(int NodeID)
{
- if (!myType == SMESHDS_RemoveNode)
- {
- MESSAGE("SMESHDS_Command::RemoveNode : Bad Type");
- return;
- }
- myIntegers.push_back(NodeID);
- myNumber++;
+ if (!myType == SMESHDS_RemoveNode)
+ {
+ MESSAGE("SMESHDS_Command::RemoveNode : Bad Type");
+ return;
+ }
+ myIntegers.push_back(NodeID);
+ myNumber++;
}
//=======================================================================
//=======================================================================
void SMESHDS_Command::RemoveElement(int ElementID)
{
- if (!myType == SMESHDS_RemoveElement)
- {
- MESSAGE("SMESHDS_Command::RemoveElement : Bad Type");
- return;
- }
- myIntegers.push_back(ElementID);
- myNumber++;
+ if (!myType == SMESHDS_RemoveElement)
+ {
+ MESSAGE("SMESHDS_Command::RemoveElement : Bad Type");
+ return;
+ }
+ myIntegers.push_back(ElementID);
+ myNumber++;
}
//=======================================================================
//=======================================================================
SMESHDS_CommandType SMESHDS_Command::GetType()
{
- return myType;
+ return myType;
}
//=======================================================================
//=======================================================================
int SMESHDS_Command::GetNumber()
{
- return myNumber;
+ return myNumber;
}
//=======================================================================
//=======================================================================
const list < int >&SMESHDS_Command::GetIndexes()
{
- return myIntegers;
+ return myIntegers;
}
//=======================================================================
//=======================================================================
const list < double >&SMESHDS_Command::GetCoords()
{
- return myReals;
+ return myReals;
}
{
public:
- SMESHDS_Command(const SMESHDS_CommandType aType);
- void AddNode(int NewNodeID, double x, double y, double z);
- void Add0DElement(int New0DElementID, int idnode);
- void AddEdge(int NewEdgeID, int idnode1, int idnode2);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
+ SMESHDS_Command(const SMESHDS_CommandType aType);
+ void AddNode(int NewNodeID, double x, double y, double z);
+ void Add0DElement(int New0DElementID, int idnode);
+ void AddEdge(int NewEdgeID, int idnode1, int idnode2);
+ void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
+ void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
+ int idnode4);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
void AddPolygonalFace (const int ElementID,
std::vector<int> nodes_ids);
void AddPolyhedralVolume (const int ElementID,
std::vector<int> nodes_ids,
std::vector<int> quantities);
// special methods for quadratic elements
- void AddEdge(int NewEdgeID, int n1, int n2, int n12);
+ void AddEdge(int NewEdgeID, int n1, int n2, int n12);
void AddFace(int NewFaceID, int n1, int n2, int n3,
int n12, int n23, int n31);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
int n56, int n67, int n78, int n85,
int n15, int n26, int n37, int n48);
- void MoveNode(int NewNodeID, double x, double y, double z);
- void RemoveNode(int NodeID);
- void RemoveElement(int ElementID);
- void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
- void ChangePolyhedronNodes(const int ElementID,
+ void MoveNode(int NewNodeID, double x, double y, double z);
+ void RemoveNode(int NodeID);
+ void RemoveElement(int ElementID);
+ void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
+ void ChangePolyhedronNodes(const int ElementID,
std::vector<int> nodes_ids,
std::vector<int> quantities);
- void Renumber (const bool isNodes, const int startID, const int deltaID);
- SMESHDS_CommandType GetType();
- int GetNumber();
- const std::list<int> & GetIndexes();
- const std::list<double> & GetCoords();
- ~SMESHDS_Command();
+ void Renumber (const bool isNodes, const int startID, const int deltaID);
+ SMESHDS_CommandType GetType();
+ int GetNumber();
+ const std::list<int> & GetIndexes();
+ const std::list<double> & GetCoords();
+ ~SMESHDS_Command();
private:
- SMESHDS_CommandType myType;
- int myNumber;
- std::list<double> myReals;
- std::list<int> myIntegers;
+ SMESHDS_CommandType myType;
+ int myNumber;
+ std::list<double> myReals;
+ std::list<int> myIntegers;
};
#endif
//=======================================================================
SMESHDS_Mesh *SMESHDS_Document::GetMesh(int MeshID)
{
- map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
- if (it==myMeshes.end())
- {
- MESSAGE("SMESHDS_Document::GetMesh : ID not found");
- return NULL;
- }
- else return (*it).second;
+ map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
+ if (it==myMeshes.end())
+ {
+ MESSAGE("SMESHDS_Document::GetMesh : ID not found");
+ return NULL;
+ }
+ else return (*it).second;
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::RemoveMesh(int MeshID)
{
- map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
- if (it==myMeshes.end())
- MESSAGE("SMESHDS_Document::RemoveMesh : ID not found");
- myMeshes.erase(it);
+ map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
+ if (it==myMeshes.end())
+ MESSAGE("SMESHDS_Document::RemoveMesh : ID not found");
+ myMeshes.erase(it);
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::AddHypothesis(SMESHDS_Hypothesis * H)
{
- myHypothesis[H->GetID()]=H;
+ myHypothesis[H->GetID()]=H;
}
//=======================================================================
//=======================================================================
SMESHDS_Hypothesis * SMESHDS_Document::GetHypothesis(int HypID)
{
- map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
- if (it==myHypothesis.end())
- {
- MESSAGE("SMESHDS_Document::GetHypothesis : ID not found");
- return NULL;
- }
- else return (*it).second;
+ map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
+ if (it==myHypothesis.end())
+ {
+ MESSAGE("SMESHDS_Document::GetHypothesis : ID not found");
+ return NULL;
+ }
+ else return (*it).second;
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::RemoveHypothesis(int HypID)
{
- map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
- if (it==myHypothesis.end())
- MESSAGE("SMESHDS_Document::RemoveHypothesis : ID not found");
- myHypothesis.erase(it);
+ map<int,SMESHDS_Hypothesis*>::iterator it=myHypothesis.find(HypID);
+ if (it==myHypothesis.end())
+ MESSAGE("SMESHDS_Document::RemoveHypothesis : ID not found");
+ myHypothesis.erase(it);
}
//=======================================================================
//=======================================================================
int SMESHDS_Document::NbMeshes()
{
- return myMeshes.size();
+ return myMeshes.size();
}
//=======================================================================
//=======================================================================
int SMESHDS_Document::NbHypothesis()
{
- return myHypothesis.size();
+ return myHypothesis.size();
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::InitMeshesIterator()
{
- myMeshesIt=myMeshes.begin();
+ myMeshesIt=myMeshes.begin();
}
//=======================================================================
//=======================================================================
SMESHDS_Mesh * SMESHDS_Document::NextMesh()
{
- SMESHDS_Mesh * toReturn=(*myMeshesIt).second;
- myMeshesIt++;
- return toReturn;
+ SMESHDS_Mesh * toReturn=(*myMeshesIt).second;
+ myMeshesIt++;
+ return toReturn;
}
//=======================================================================
//=======================================================================
bool SMESHDS_Document::MoreMesh()
{
- return myMeshesIt!=myMeshes.end();
+ return myMeshesIt!=myMeshes.end();
}
//=======================================================================
//=======================================================================
void SMESHDS_Document::InitHypothesisIterator()
{
- myHypothesisIt=myHypothesis.begin();
+ myHypothesisIt=myHypothesis.begin();
}
//=======================================================================
//=======================================================================
SMESHDS_Hypothesis * SMESHDS_Document::NextHypothesis()
{
- SMESHDS_Hypothesis * toReturn=(*myHypothesisIt).second;
- myHypothesisIt++;
- return toReturn;
+ SMESHDS_Hypothesis * toReturn=(*myHypothesisIt).second;
+ myHypothesisIt++;
+ return toReturn;
}
//=======================================================================
//=======================================================================
bool SMESHDS_Document::MoreHypothesis()
{
- return myHypothesisIt!=myHypothesis.end();
+ return myHypothesisIt!=myHypothesis.end();
}
class SMESHDS_EXPORT SMESHDS_Document
{
public:
- SMESHDS_Document(int UserID);
- int NewMesh(bool theIsEmbeddedMode);
- void RemoveMesh(int MeshID);
- SMESHDS_Mesh * GetMesh(int MeshID);
- void AddHypothesis(SMESHDS_Hypothesis * H);
- void RemoveHypothesis(int HypID);
- SMESHDS_Hypothesis * GetHypothesis(int HypID);
- int NbMeshes();
- int NbHypothesis();
- void InitMeshesIterator();
- SMESHDS_Mesh * NextMesh();
- bool MoreMesh();
- void InitHypothesisIterator();
- SMESHDS_Hypothesis * NextHypothesis();
- bool MoreHypothesis();
- ~SMESHDS_Document();
+ SMESHDS_Document(int UserID);
+ int NewMesh(bool theIsEmbeddedMode);
+ void RemoveMesh(int MeshID);
+ SMESHDS_Mesh * GetMesh(int MeshID);
+ void AddHypothesis(SMESHDS_Hypothesis * H);
+ void RemoveHypothesis(int HypID);
+ SMESHDS_Hypothesis * GetHypothesis(int HypID);
+ int NbMeshes();
+ int NbHypothesis();
+ void InitMeshesIterator();
+ SMESHDS_Mesh * NextMesh();
+ bool MoreMesh();
+ void InitHypothesisIterator();
+ SMESHDS_Hypothesis * NextHypothesis();
+ bool MoreHypothesis();
+ ~SMESHDS_Document();
private:
- int myUserID;
- std::map<int,SMESHDS_Mesh*> myMeshes;
- std::map<int,SMESHDS_Hypothesis*> myHypothesis;
- std::map<int,SMESHDS_Mesh*>::iterator myMeshesIt;
- std::map<int,SMESHDS_Hypothesis*>::iterator myHypothesisIt;
+ int myUserID;
+ std::map<int,SMESHDS_Mesh*> myMeshes;
+ std::map<int,SMESHDS_Hypothesis*> myHypothesis;
+ std::map<int,SMESHDS_Mesh*>::iterator myMeshesIt;
+ std::map<int,SMESHDS_Hypothesis*>::iterator myHypothesisIt;
};
#endif
class SMESHDS_EXPORT SMESHDS_Script
{
public:
- SMESHDS_Script(bool theIsEmbeddedMode);
- ~SMESHDS_Script();
+ SMESHDS_Script(bool theIsEmbeddedMode);
+ ~SMESHDS_Script();
void SetModified(bool theModified);
bool IsModified();
- void AddNode(int NewNodeID, double x, double y, double z);
- void Add0DElement(int New0DElementID, int idnode);
- void AddEdge(int NewEdgeID, int idnode1, int idnode2);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
- void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
+ void AddNode(int NewNodeID, double x, double y, double z);
+ void Add0DElement(int New0DElementID, int idnode);
+ void AddEdge(int NewEdgeID, int idnode1, int idnode2);
+ void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
+ void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
+ int idnode4);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6);
+ void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
+ int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
void AddPolygonalFace (const int NewFaceID,
std::vector<int> nodes_ids);
- void AddPolyhedralVolume (const int NewVolID,
+ void AddPolyhedralVolume (const int NewVolID,
std::vector<int> nodes_ids,
std::vector<int> quantities);
// special methods for quadratic elements
- void AddEdge(int NewEdgeID, int n1, int n2, int n12);
+ void AddEdge(int NewEdgeID, int n1, int n2, int n12);
void AddFace(int NewFaceID, int n1, int n2, int n3,
int n12, int n23, int n31);
void AddFace(int NewFaceID, int n1, int n2, int n3, int n4,
int n56, int n67, int n78, int n85,
int n15, int n26, int n37, int n48);
void MoveNode(int NewNodeID, double x, double y, double z);
- void RemoveNode(int NodeID);
- void RemoveElement(int ElementID);
- void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
- void ChangePolyhedronNodes(const int ElementID,
+ void RemoveNode(int NodeID);
+ void RemoveElement(int ElementID);
+ void ChangeElementNodes(int ElementID, int nodes[], int nbnodes);
+ void ChangePolyhedronNodes(const int ElementID,
std::vector<int> nodes_ids,
std::vector<int> quantities);
- void Renumber (const bool isNodes, const int startID, const int deltaID);
- void ClearMesh();
- void Clear();
- const std::list<SMESHDS_Command*> & GetCommands();
+ void Renumber (const bool isNodes, const int startID, const int deltaID);
+ void ClearMesh();
+ void Clear();
+ const std::list<SMESHDS_Command*> & GetCommands();
private:
- SMESHDS_Command* getCommand(const SMESHDS_CommandType aType);
+ SMESHDS_Command* getCommand(const SMESHDS_CommandType aType);
- std::list<SMESHDS_Command*> myCommands;
+ std::list<SMESHDS_Command*> myCommands;
bool myIsEmbeddedMode;
bool myIsModified;
{
typedef SMDS_SetIterator<ELEM, typename TSET::const_iterator > TFather;
public:
- MySetIterator(const TSET& s):TFather(s.begin(),s.end())
- {
- }
+ MySetIterator(const TSET& s):TFather(s.begin(),s.end())
+ {
+ }
};
// =====================
switch (myType)
{
case HYPOTHESIS:
- {
- if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_HypothesisRoot))
+ {
+ if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_HypothesisRoot))
// hypo definition
- Ok = true;
- else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
+ Ok = true;
+ else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
// applied global hypo
- Ok = true;
- else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
+ Ok = true;
+ else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedHypothesis))
// applied local hypo
- Ok = true;
- break;
- }
+ Ok = true;
+ break;
+ }
case ALGORITHM:
- {
- if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_AlgorithmsRoot))
+ {
+ if (aLevel == 2 && (objFather->Tag() == SMESH::Tag_AlgorithmsRoot))
// algo definition
- Ok = true;
- else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
+ Ok = true;
+ else if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
// applied global algo
- Ok = true;
- else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
+ Ok = true;
+ else if (aLevel == 5 && (objFather->Tag() == SMESH::Tag_RefOnAppliedAlgorithms))
// applied local algo
- Ok = true;
- break;
- }
+ Ok = true;
+ break;
+ }
case MESH:
- {
- if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
+ Ok = true;
+ break;
+ }
case SUBMESH:
- {
- // see SMESH_Gen_i.cxx for tag numbers
- if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh &&
+ {
+ // see SMESH_Gen_i.cxx for tag numbers
+ if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh &&
objFather->Tag() <= SMESH::Tag_LastSubMesh))
- Ok = true;
- break;
- }
+ Ok = true;
+ break;
+ }
case MESHorSUBMESH:
- {
- if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
- Ok = true; // mesh
+ {
+ if (aLevel == 1 && (obj->Tag() >= SMESH::Tag_FirstMeshRoot))
+ Ok = true; // mesh
else if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstSubMesh &&
objFather->Tag() <= SMESH::Tag_LastSubMesh))
- Ok = true;
- break;
- }
+ Ok = true;
+ break;
+ }
case SUBMESH_VERTEX: // Label "SubMeshes on vertexes"
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnVertex))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnVertex))
+ Ok = true;
+ break;
+ }
case SUBMESH_EDGE:
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnEdge))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnEdge))
+ Ok = true;
+ break;
+ }
case SUBMESH_FACE:
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnFace))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnFace))
+ Ok = true;
+ break;
+ }
case SUBMESH_SOLID:
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnSolid))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnSolid))
+ Ok = true;
+ break;
+ }
case SUBMESH_COMPOUND:
- {
- if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnCompound))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() == SMESH::Tag_SubMeshOnCompound))
+ Ok = true;
+ break;
+ }
case GROUP:
- {
- if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstGroup))
- Ok = true;
- break;
- }
+ {
+ if (aLevel == 3 && (objFather->Tag() >= SMESH::Tag_FirstGroup))
+ Ok = true;
+ break;
+ }
}
}
return Ok;
aMesh = SMESH::GetMeshByIO(selected.First());
if (aMesh->_is_nil()) {
SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NO_AVAILABLE_DATA"));
onCancel();
return;
}
myMgr->SetMesh( aMesh );
if ( !myMgr->GetMeshOrder() ) {
SUIT_MessageBox::information(desktop(),
- tr("SMESH_INFORMATION"),
- tr("SMESH_NO_CONCURENT_MESH"));
+ tr("SMESH_INFORMATION"),
+ tr("SMESH_NO_CONCURENT_MESH"));
onCancel();
return;
inline
SALOMEDS::SObject_var
GetDomainRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- CORBA::Long theDomainRootTag,
- const QString& theName,
- const QString& thePixmap)
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ CORBA::Long theDomainRootTag,
+ const QString& theName,
+ const QString& thePixmap)
{
SALOMEDS::SObject_var aDomainRoot;
if (!theSComponentMesh->FindSubObject(theDomainRootTag,aDomainRoot)) {
inline
SALOMEDS::SObject_var
GetHypothesisRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
return GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_HypothesisRoot,
- QObject::tr("SMESH_MEN_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
+ theStudyBuilder,
+ SMESH::Tag_HypothesisRoot,
+ QObject::tr("SMESH_MEN_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
}
inline
SALOMEDS::SObject_var
GetAlgorithmsRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
return GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- QObject::tr("SMESH_MEN_ALGORITHMS"),
- "ICON_SMESH_TREE_ALGO");
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ QObject::tr("SMESH_MEN_ALGORITHMS"),
+ "ICON_SMESH_TREE_ALGO");
}
inline
SALOMEDS::SObject_var
AddToDomain(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- CORBA::Long theDomainRootTag,
- const QString& theDomainName,
- const QString& theDomainPixmap)
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ CORBA::Long theDomainRootTag,
+ const QString& theDomainName,
+ const QString& theDomainPixmap)
{
SALOMEDS::SObject_var aDomain = GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- theDomainName,
- theDomainPixmap);
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ theDomainName,
+ theDomainPixmap);
// Add New Hypothesis
SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(aDomain);
SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap");
//---------------------------------------------------------------
SALOMEDS::SObject_var
AddHypothesis(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
return AddToDomain(theIOR,
- theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_HypothesisRoot,
- QObject::tr("SMESH_MEN_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
+ theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_HypothesisRoot,
+ QObject::tr("SMESH_MEN_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
}
//---------------------------------------------------------------
SALOMEDS::SObject_var
AddAlgorithms(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
return AddToDomain(theIOR,
- theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- QObject::tr("SMESH_MEN_ALGORITHMS"),
- "ICON_SMESH_TREE_ALGO");
+ theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ QObject::tr("SMESH_MEN_ALGORITHMS"),
+ "ICON_SMESH_TREE_ALGO");
}
//---------------------------------------------------------------
void
SetDomain(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- long theRefOnAppliedDomainTag,
- const QString& theAppliedDomainMEN,
- const QString& theAppliedDomainICON)
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ long theRefOnAppliedDomainTag,
+ const QString& theAppliedDomainMEN,
+ const QString& theAppliedDomainICON)
{
SALOMEDS::SObject_var aMeshOrSubMeshSO = theStudy->FindObjectID(theMeshOrSubMeshEntry);
SALOMEDS::SObject_var aHypothesisSO = theStudy->FindObjectID(theDomainEntry);
//Find or Create Applied Hypothesis root
SALOMEDS::SObject_var anAppliedDomainSO;
if(!aMeshOrSubMeshSO->FindSubObject(theRefOnAppliedDomainTag,anAppliedDomainSO)){
- anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag);
- SALOMEDS::GenericAttribute_var anAttr =
- theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(theAppliedDomainMEN.toLatin1().data());
- anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable");
- SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
- aSelAttr->SetSelectable(false);
- anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributePixMap");
- SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap(theAppliedDomainICON.toLatin1().data());
+ anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag);
+ SALOMEDS::GenericAttribute_var anAttr =
+ theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(theAppliedDomainMEN.toLatin1().data());
+ anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable");
+ SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
+ aSelAttr->SetSelectable(false);
+ anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributePixMap");
+ SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixmap->SetPixMap(theAppliedDomainICON.toLatin1().data());
}
SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(anAppliedDomainSO);
theStudyBuilder->Addreference(aSObject,aHypothesisSO);
//---------------------------------------------------------------
void
SetHypothesis(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
SetDomain(theMeshOrSubMeshEntry,
- theDomainEntry,
- theStudy,
- theStudyBuilder,
- SMESH::Tag_RefOnAppliedHypothesis,
- QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
+ theDomainEntry,
+ theStudy,
+ theStudyBuilder,
+ SMESH::Tag_RefOnAppliedHypothesis,
+ QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
}
//---------------------------------------------------------------
void
SetAlgorithms(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
{
SetDomain(theMeshOrSubMeshEntry,
- theDomainEntry,
- theStudy,
- theStudyBuilder,
- SMESH::Tag_RefOnAppliedAlgorithms,
- QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
- "ICON_SMESH_TREE_ALGO");
+ theDomainEntry,
+ theStudy,
+ theStudyBuilder,
+ SMESH::Tag_RefOnAppliedAlgorithms,
+ QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
+ "ICON_SMESH_TREE_ALGO");
}
}
Execute()
{
try {
- ORB_INIT &anORBInit = *SINGLETON_<ORB_INIT>::Instance();
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- myORB = anORBInit( 0, 0 );
+ ORB_INIT &anORBInit = *SINGLETON_<ORB_INIT>::Instance();
+ ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
+ myORB = anORBInit( 0, 0 );
} catch (...) {
- INFOS("internal error : orb not found");
+ INFOS("internal error : orb not found");
}
}
};
SALOMEDS::SComponent_var& mySComponentMesh;
public:
TEvent(int theStudyID,
- SALOMEDS::Study_var& theStudy,
- SALOMEDS::StudyBuilder_var& theStudyBuilder,
- SALOMEDS::SComponent_var& theSComponentMesh):
+ SALOMEDS::Study_var& theStudy,
+ SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ SALOMEDS::SComponent_var& theSComponentMesh):
myStudyID(theStudyID),
myStudy(theStudy),
myStudyBuilder(theStudyBuilder),
SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
if(aSComponent->_is_nil()){
- bool aLocked = myStudy->GetProperties()->IsLocked();
- if (aLocked)
- myStudy->GetProperties()->SetLocked(false);
-
- aSComponent = myStudyBuilder->NewComponent("SMESH");
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributeName");
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
-
- SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
- if (!aSMESHGUI){
- CAM_Module* aModule = anApp->module("Mesh");
- if(!aModule)
- aModule = anApp->loadModule("Mesh");
- aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
- } //SRN: BugID IPAL9186: end of a fix
- aName->SetValue(aSMESHGUI->moduleName().toLatin1().data());
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap");
- aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
- myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
- if (aLocked)
- myStudy->GetProperties()->SetLocked(true);
+ bool aLocked = myStudy->GetProperties()->IsLocked();
+ if (aLocked)
+ myStudy->GetProperties()->SetLocked(false);
+
+ aSComponent = myStudyBuilder->NewComponent("SMESH");
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributeName");
+ aName = SALOMEDS::AttributeName::_narrow(anAttr);
+
+ SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
+ if (!aSMESHGUI){
+ CAM_Module* aModule = anApp->module("Mesh");
+ if(!aModule)
+ aModule = anApp->loadModule("Mesh");
+ aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
+ } //SRN: BugID IPAL9186: end of a fix
+ aName->SetValue(aSMESHGUI->moduleName().toLatin1().data());
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap");
+ aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
+ myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
+ if (aLocked)
+ myStudy->GetProperties()->SetLocked(true);
}
mySComponentMesh = SALOMEDS::SComponent::_narrow(aSComponent);
MESSAGE("Init");
ProcessVoidEvent(new TEvent(theStudyID,
- myStudy,
- myStudyBuilder,
- mySComponentMesh));
+ myStudy,
+ myStudyBuilder,
+ mySComponentMesh));
}
MESSAGE("AddNewHypothesis");
SALOMEDS::SObject_var aSObject = ::AddHypothesis(theIOR,
- mySComponentMesh,
- myStudyBuilder);
+ mySComponentMesh,
+ myStudyBuilder);
CORBA::String_var anEntry = aSObject->GetID();
return anEntry._retn();
}
MESSAGE("AddNewAlgorithms");
SALOMEDS::SObject_var aSObject = ::AddAlgorithms(theIOR,
- mySComponentMesh,
- myStudyBuilder);
+ mySComponentMesh,
+ myStudyBuilder);
CORBA::String_var anEntry = aSObject->GetID();
return anEntry._retn();
}
const char* theDomainEntry)
{
::SetHypothesis(theMeshOrSubMeshEntry,
- theDomainEntry,
- myStudy,
- myStudyBuilder);
+ theDomainEntry,
+ myStudy,
+ myStudyBuilder);
}
const char* theDomainEntry)
{
::SetAlgorithms(theMeshOrSubMeshEntry,
- theDomainEntry,
- myStudy,
- myStudyBuilder);
+ theDomainEntry,
+ myStudy,
+ myStudyBuilder);
}
//================================================================================
void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
- const bool theIsComputed,
+ const bool theIsComputed,
const bool isEmpty)
{
class TEvent: public SALOME_Event
bool myIsComputed, myIsEmpty;
public:
TEvent(const SALOMEDS::Study_var& theStudy,
- const std::string& theMeshEntry,
- const bool theIsComputed,
+ const std::string& theMeshEntry,
+ const bool theIsComputed,
const bool isEmpty):
myStudy(theStudy),
myMeshEntry(theMeshEntry),
{
SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str());
if(!aMeshSO->_is_nil())
- if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
- SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
+ if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
+ SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
}
};
ProcessVoidEvent(new TEvent(myStudy,
- theMeshEntry,
- theIsComputed,
+ theMeshEntry,
+ theIsComputed,
isEmpty));
}
//virtual ~StdMeshers_CompositeHexa_3D();
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
virtual ~StdMeshers_CompositeSegment_1D();
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
/*!
* \brief Sets event listener to submeshes if necessary
* \param subMesh - submesh where algo is set
}
bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end,
- const int nbSeg, vector<double>& data, const double eps )
+ const int nbSeg, vector<double>& data, const double eps )
{
FunctionExpr F( f.ToCString(), conv );
return buildDistribution( F, start, end, nbSeg, data, eps );
}
bool buildDistribution( const std::vector<double>& f, const int conv, const double start, const double end,
- const int nbSeg, vector<double>& data, const double eps )
+ const int nbSeg, vector<double>& data, const double eps )
{
FunctionTable F( f, conv );
return buildDistribution( F, start, end, nbSeg, data, eps );
}
bool buildDistribution( const Function& func, const double start, const double end, const int nbSeg,
- vector<double>& data, const double eps )
+ vector<double>& data, const double eps )
{
if( nbSeg<=0 )
return false;
STDMESHERS_EXPORT
bool buildDistribution( const Function& f,
- const double start, const double end,
- const int nbSeg,
- std::vector<double>& data,
- const double eps );
+ const double start, const double end,
+ const int nbSeg,
+ std::vector<double>& data,
+ const double eps );
STDMESHERS_EXPORT
bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end,
- const int nbSeg, std::vector<double>& data, const double eps );
+ const int nbSeg, std::vector<double>& data, const double eps );
STDMESHERS_EXPORT
bool buildDistribution( const std::vector<double>& f, const int conv, const double start, const double end,
- const int nbSeg, std::vector<double>& data, const double eps );
+ const int nbSeg, std::vector<double>& data, const double eps );
#endif
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
+ const TopoDS_Shape& aShape)
/*throw (SALOME_Exception)*/;
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
protected:
TopoDS_Edge
EdgeNotInFace(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- const TopoDS_Face& aFace,
- const TopoDS_Vertex& aVertex,
- const TopTools_IndexedDataMapOfShapeListOfShape& MS);
+ const TopoDS_Shape& aShape,
+ const TopoDS_Face& aFace,
+ const TopoDS_Vertex& aVertex,
+ const TopTools_IndexedDataMapOfShapeListOfShape& MS);
int GetFaceIndex(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- const std::vector<SMESH_subMesh*>& meshFaces,
- const TopoDS_Vertex& V0,
- const TopoDS_Vertex& V1,
- const TopoDS_Vertex& V2,
- const TopoDS_Vertex& V3);
+ const TopoDS_Shape& aShape,
+ const std::vector<SMESH_subMesh*>& meshFaces,
+ const TopoDS_Vertex& V0,
+ const TopoDS_Vertex& V1,
+ const TopoDS_Vertex& V2,
+ const TopoDS_Vertex& V3);
void GetConv2DCoefs(const faceQuadStruct& quad,
- const TopoDS_Shape& aShape,
- const TopoDS_Vertex& V0,
- const TopoDS_Vertex& V1,
- const TopoDS_Vertex& V2,
- const TopoDS_Vertex& V3,
- Conv2DStruct& conv);
+ const TopoDS_Shape& aShape,
+ const TopoDS_Vertex& V0,
+ const TopoDS_Vertex& V1,
+ const TopoDS_Vertex& V2,
+ const TopoDS_Vertex& V3,
+ Conv2DStruct& conv);
void GetPoint(Pt3 p,
- int i, int j, int k,
- int nbx, int nby, int nbz,
- Point3DStruct *np,
- const SMESHDS_Mesh* meshDS);
+ int i, int j, int k,
+ int nbx, int nby, int nbz,
+ Point3DStruct *np,
+ const SMESHDS_Mesh* meshDS);
bool ClearAndReturn(FaceQuadStruct* theQuads[6], const bool res);
};
//=============================================================================
bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape & aShape,
+ MapShapeNbElems& aResMap)
{
MESSAGE("StdMeshers_MEFISTO_2D::Evaluate");
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
typedef std::vector< StdMeshers_FaceSidePtr > TWireVector;
bool LoadPoints(TWireVector & wires,
- R2* uvslf,
- std::vector< const SMDS_MeshNode*>& mefistoToDS,
+ R2* uvslf,
+ std::vector< const SMDS_MeshNode*>& mefistoToDS,
double scalex, double scaley);
void ComputeScaleOnFace(SMESH_Mesh& aMesh,
- const TopoDS_Face& aFace,
- double& scalex,
- double& scaley);
+ const TopoDS_Face& aFace,
+ double& scalex,
+ double& scaley);
void StoreResult (Z nbst, R2* uvst, Z nbt, Z* nust,
- std::vector< const SMDS_MeshNode*>& mefistoToDS,
+ std::vector< const SMDS_MeshNode*>& mefistoToDS,
double scalex, double scaley);
-
+
protected:
double _edgeLength;
double _maxElementArea;
void Load (const TopoDS_Shell& theShell);
void Load (const TopoDS_Shell& theShell,
- const TopoDS_Vertex& theV000,
- const TopoDS_Vertex& theV001);
+ const TopoDS_Vertex& theV000,
+ const TopoDS_Vertex& theV001);
void ComputeParameters(const gp_Pnt& thePnt,
- gp_XYZ& theXYZ);
+ gp_XYZ& theXYZ);
void ComputeParameters(const gp_Pnt& thePnt,
- const TopoDS_Shape& theShape,
- gp_XYZ& theXYZ);
+ const TopoDS_Shape& theShape,
+ gp_XYZ& theXYZ);
void ComputeParameters(const double& theU,
- const TopoDS_Shape& theShape,
- gp_XYZ& theXYZ);
+ const TopoDS_Shape& theShape,
+ gp_XYZ& theXYZ);
void Point(const gp_XYZ& theParams,
- gp_Pnt& thePnt);
+ gp_Pnt& thePnt);
void Point(const gp_XYZ& theParams,
- const TopoDS_Shape& theShape,
- gp_Pnt& thePnt);
+ const TopoDS_Shape& theShape,
+ gp_Pnt& thePnt);
int ShapeID(const TopoDS_Shape& theShape);
// 0-the node on theBaseEdge.
bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
- MapShapeNbElems& aResMap);
+ MapShapeNbElems& aResMap);
protected: // methods
std::vector<const SMDS_MeshNode*>*& aCol2);
void ShapeSupportID(const bool theIsUpperLayer,
- const SMESH_Block::TShapeID theBNSSID,
- SMESH_Block::TShapeID& theSSID);
+ const SMESH_Block::TShapeID theBNSSID,
+ SMESH_Block::TShapeID& theSSID);
void FindNodeOnShape(const TopoDS_Shape& aS,
- const gp_XYZ& aParams,
+ const gp_XYZ& aParams,
const int z,
- StdMeshers_TNode& aTN);
+ StdMeshers_TNode& aTN);
void CreateNode(const bool theIsUpperLayer,
- const gp_XYZ& aParams,
- StdMeshers_TNode& aTN);
+ const gp_XYZ& aParams,
+ StdMeshers_TNode& aTN);
void ClearMeshOnFxy1();
:SMESH_3D_Algo(hypId, studyId, gen)
{
_name = "Prism_3D";
- _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit per shape type
myProjectTriangles = false;
}
//=======================================================================
bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh,
- const TopoDS_Shape& theShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape& theShape,
+ MapShapeNbElems& aResMap)
{
// find face contains only triangles
vector < SMESH_subMesh * >meshFaces;
bool IsOpposite = true;
for(TopExp_Explorer exp(aFaces.Value(i), TopAbs_EDGE); exp.More(); exp.Next()) {
if( Edges1.Contains(exp.Current()) ) {
- IsOpposite = false;
- break;
+ IsOpposite = false;
+ break;
}
}
if(IsOpposite) {
:SMESH_1D_Algo(hypId, studyId, gen)
{
_name = "Projection_1D";
- _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type
_compatibleHypothesis.push_back("ProjectionSource1D");
_sourceHypo = 0;
//=======================================================================
bool StdMeshers_Projection_1D::Evaluate(SMESH_Mesh& theMesh,
- const TopoDS_Shape& theShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape& theShape,
+ MapShapeNbElems& aResMap)
{
if ( !_sourceHypo )
return false;
:SMESH_2D_Algo(hypId, studyId, gen)
{
_name = "Projection_2D";
- _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type
_compatibleHypothesis.push_back("ProjectionSource2D");
_sourceHypo = 0;
//=======================================================================
bool StdMeshers_Projection_2D::Evaluate(SMESH_Mesh& theMesh,
- const TopoDS_Shape& theShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape& theShape,
+ MapShapeNbElems& aResMap)
{
if ( !_sourceHypo )
return false;
//=============================================================================
StdMeshers_QuadrangleParams::StdMeshers_QuadrangleParams(int hypId, int studyId,
- SMESH_Gen * gen)
+ SMESH_Gen * gen)
:SMESH_Hypothesis(hypId, studyId, gen)
{
_name = "QuadrangleParams";
//================================================================================
bool StdMeshers_QuadrangleParams::SetParametersByMesh(const SMESH_Mesh* theMesh,
- const TopoDS_Shape& theShape)
+ const TopoDS_Shape& theShape)
{
if ( !theMesh || theShape.IsNull() )
return false;
//================================================================================
bool StdMeshers_QuadrangleParams::SetParametersByDefaults(const TDefaults& dflts,
- const SMESH_Mesh* /*mesh*/)
+ const SMESH_Mesh* /*mesh*/)
{
return true;
}
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
friend std::ostream& operator << (std::ostream & save,
- StdMeshers_QuadrangleParams & hyp);
+ StdMeshers_QuadrangleParams & hyp);
friend std::istream& operator >> (std::istream & load,
- StdMeshers_QuadrangleParams & hyp);
+ StdMeshers_QuadrangleParams & hyp);
/*!
* \brief Initialize start and end length by the mesh built on the geometry
* \retval bool - true if parameter values have been successfully defined
*/
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh,
- const TopoDS_Shape& theShape);
+ const TopoDS_Shape& theShape);
/*!
* \brief Initialize my parameter values by default parameters.
* \retval bool - true if parameter values have been successfully defined
*/
virtual bool SetParametersByDefaults(const TDefaults& dflts,
- const SMESH_Mesh* theMesh=0);
+ const SMESH_Mesh* theMesh=0);
protected:
int _triaVertexID;
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
FaceQuadStruct* CheckAnd2Dcompute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
+ const TopoDS_Shape& aShape,
const bool CreateQuadratic);
protected:
const TopoDS_Shape& aShape);
bool CheckNbEdgesForEvaluate(SMESH_Mesh& aMesh,
- const TopoDS_Shape & aShape,
- MapShapeNbElems& aResMap,
- std::vector<int>& aNbNodes,
+ const TopoDS_Shape & aShape,
+ MapShapeNbElems& aResMap,
+ std::vector<int>& aNbNodes,
bool& IsQuadratic);
bool SetNormalizedGrid(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- FaceQuadStruct*& quad);
+ const TopoDS_Shape& aShape,
+ FaceQuadStruct*& quad);
void SplitQuad(SMESHDS_Mesh *theMeshDS,
const int theFaceID,
FaceQuadStruct* quad);
bool EvaluateQuadPref(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- std::vector<int>& aNbNodes,
- MapShapeNbElems& aResMap,
+ const TopoDS_Shape& aShape,
+ std::vector<int>& aNbNodes,
+ MapShapeNbElems& aResMap,
bool IsQuadratic);
UVPtStruct* LoadEdgePoints2(SMESH_Mesh& aMesh,
- const TopoDS_Face& F, const TopoDS_Edge& E,
+ const TopoDS_Face& F, const TopoDS_Edge& E,
bool IsReverse);
UVPtStruct* LoadEdgePoints(SMESH_Mesh& aMesh,
- const TopoDS_Face& F, const TopoDS_Edge& E,
- double first, double last);
+ const TopoDS_Face& F, const TopoDS_Edge& E,
+ double first, double last);
UVPtStruct* MakeEdgePoints(SMESH_Mesh& aMesh,
- const TopoDS_Face& F, const TopoDS_Edge& E,
- double first, double last, int nb_segm);
+ const TopoDS_Face& F, const TopoDS_Edge& E,
+ double first, double last, int nb_segm);
// true if QuadranglePreference hypothesis is assigned that forces
// construction of quadrangles if the number of nodes on opposite edges
:SMESH_3D_Algo(hypId, studyId, gen)
{
_name = "RadialPrism_3D";
- _shapeType = (1 << TopAbs_SOLID); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_SOLID); // 1 bit per shape type
_compatibleHypothesis.push_back("LayerDistribution");
_compatibleHypothesis.push_back("NumberOfLayers");
//=======================================================================
bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape& aShape,
+ MapShapeNbElems& aResMap)
{
// get 2 shells
TopoDS_Solid solid = TopoDS::Solid( aShape );
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
+ const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
{
_name = "SegmentAroundVertex_0D";
// it is assigned to vertices but influence a state of EDGE submeshes
- _shapeType = (1 << TopAbs_VERTEX); // 1 bit per shape type
+ _shapeType = (1 << TopAbs_VERTEX); // 1 bit per shape type
_compatibleHypothesis.push_back("SegmentLengthAroundVertex");
}
//=======================================================================
bool StdMeshers_SegmentAroundVertex_0D::Evaluate(SMESH_Mesh&,
- const TopoDS_Shape&,
- MapShapeNbElems&)
+ const TopoDS_Shape&,
+ MapShapeNbElems&)
{
// This algorithm exists in order just to enable assignation of
// StdMeshers_SegmentLengthAroundVertex hypothesis
//=======================================================================
bool StdMeshers_UseExisting_1D::Evaluate(SMESH_Mesh&,
- const TopoDS_Shape&,
- MapShapeNbElems&)
+ const TopoDS_Shape&,
+ MapShapeNbElems&)
{
// This algorithm exists to allow mesh generation by mesh
// edition functions in TUI mode
//=======================================================================
bool StdMeshers_UseExisting_2D::Evaluate(SMESH_Mesh&,
- const TopoDS_Shape&,
- MapShapeNbElems&)
+ const TopoDS_Shape&,
+ MapShapeNbElems&)
{
// This algorithm exists to allow mesh generation by mesh edition
// functions in TUI mode
{
SMESH::double_array* arr = 0;
if( isTableFunc() )
- arr = h->BuildDistributionTab( myTableFunc, myNbSeg, ( int )myConv );
+ arr = h->BuildDistributionTab( myTableFunc, myNbSeg, ( int )myConv );
else
- arr = h->BuildDistributionExpr( myFunction.toLatin1().data(), myNbSeg, ( int )myConv );
+ arr = h->BuildDistributionExpr( myFunction.toLatin1().data(), myNbSeg, ( int )myConv );
if( arr )
{
- distr = *arr;
- delete arr;
+ distr = *arr;
+ delete arr;
}
}
}
if( !name.IsNull() )
{
if( name->GetName()!="t" )
- res = false;
+ res = false;
}
else
res = isCorrectArg( sub );
#ifdef NO_CAS_CATCH
OCC_CATCH_SIGNALS;
#endif
- // in StdMeshers_NumberOfSegments.cc
- // const double PRECISION = 1e-7;
- //
- if(v < -7) v = -7.0;
- v = pow( 10.0, v );
+ // in StdMeshers_NumberOfSegments.cc
+ // const double PRECISION = 1e-7;
+ //
+ if(v < -7) v = -7.0;
+ v = pow( 10.0, v );
} catch(Standard_Failure) {
- Handle(Standard_Failure) aFail = Standard_Failure::Caught();
- v = 0.0;
- ok = false;
+ Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+ v = 0.0;
+ ok = false;
}
}
break;
~SpinBoxDelegate();
QWidget* createEditor( QWidget*,
- const QStyleOptionViewItem&,
- const QModelIndex& ) const;
+ const QStyleOptionViewItem&,
+ const QModelIndex& ) const;
void setEditorData( QWidget*, const QModelIndex&) const;
void setModelData( QWidget*, QAbstractItemModel*,
- const QModelIndex& ) const;
+ const QModelIndex& ) const;
void updateEditorGeometry( QWidget*,
- const QStyleOptionViewItem&,
- const QModelIndex& ) const;
+ const QStyleOptionViewItem&,
+ const QModelIndex& ) const;
private:
StdMeshersGUI_DistrTableFrame::Table* myTable;
QWidget*
StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
createEditor( QWidget* parent,
- const QStyleOptionViewItem& /*option*/,
- const QModelIndex& index ) const
+ const QStyleOptionViewItem& /*option*/,
+ const QModelIndex& index ) const
{
QDoubleSpinBox* sb = new QDoubleSpinBox( parent );
sb->setFrame(false);
sb->setMinimum( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
- myTable->argMinimum( index.row() ) :
- myTable->funcMinimum( index.row() ) );
+ myTable->argMinimum( index.row() ) :
+ myTable->funcMinimum( index.row() ) );
sb->setMaximum( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
- myTable->argMaximum( index.row() ) :
- myTable->funcMaximum( index.row() ) );
+ myTable->argMaximum( index.row() ) :
+ myTable->funcMaximum( index.row() ) );
sb->setSingleStep( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
- myTable->argStep( index.row() ) :
- myTable->funcStep( index.row() ) );
+ myTable->argStep( index.row() ) :
+ myTable->funcStep( index.row() ) );
myTable->setEditor( index.row(), index.column(), sb );
return sb;
}
void
StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
setModelData( QWidget* editor, QAbstractItemModel* model,
- const QModelIndex& index ) const
+ const QModelIndex& index ) const
{
QDoubleSpinBox* sb = static_cast<QDoubleSpinBox*>(editor);
model->setData( index, QString::number( sb->value() ), Qt::DisplayRole );
void
StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
updateEditorGeometry( QWidget* editor,
- const QStyleOptionViewItem& option,
- const QModelIndex& /*index*/ ) const
+ const QStyleOptionViewItem& option,
+ const QModelIndex& /*index*/ ) const
{
editor->setGeometry( option.rect );
}
connect( myButtons[ InsertRowBtn ], SIGNAL( clicked() ), this, SLOT( onInsert() ) );
connect( myButtons[ RemoveRowBtn ], SIGNAL( clicked() ), this, SLOT( onRemove() ) );
connect( myTable, SIGNAL( currentCellChanged( int, int, int, int ) ),
- this, SIGNAL( currentChanged( int, int ) ) );
+ this, SIGNAL( currentChanged( int, int ) ) );
connect( myTable, SIGNAL( cellChanged( int, int ) ),
- this, SIGNAL( valueChanged( int, int ) ) );
+ this, SIGNAL( valueChanged( int, int ) ) );
}
StdMeshersGUI_DistrTableFrame::
}
QWidget* StdMeshersGUI_FixedPointsParamWdg::LineDelegate::createEditor( QWidget* parent,
- const QStyleOptionViewItem& option,
- const QModelIndex& index ) const
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
{
QWidget* w = 0;
if ( (index.column() == 1 ) ) {
}
void StdMeshersGUI_FixedPointsParamWdg::LineDelegate::setModelData( QWidget* editor,
- QAbstractItemModel* model,
- const QModelIndex& index ) const
+ QAbstractItemModel* model,
+ const QModelIndex& index ) const
{
model->setData( index, qobject_cast<QtxIntSpinBox*>( editor )->value(), Qt::EditRole );
model->setData( index, qobject_cast<QtxIntSpinBox*>( editor )->value(), Qt::UserRole );
{
addPoint( mySpinBox->value() );
}
-
+
//=================================================================================
// function : onRemove()
// purpose : Called when Remove Button Clicked
double lv = point( i );
if ( EQUAL_DBL(lv, v) ) { toInsert = false; break; }
else if ( GT_DBL(lv, v) ) {
- idx = i; break;
+ idx = i; break;
}
}
if ( toInsert ) {
delete myTreeWidget->topLevelItem( idx );
delete item;
myTreeWidget->topLevelItem( idx )->setText( 0, treeItemText( idx == 0 ? 0 : point( idx-1 ),
- idx > myListWidget->count()-1 ? 1 : point( idx ) ) );
+ idx > myListWidget->count()-1 ? 1 : point( idx ) ) );
}
onCheckBoxChanged();
updateState();
StdMeshersGUI_LayerDistributionParamWdg
::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr hyp,
- const QString& theName,
+ const QString& theName,
QDialog* dlg):
QWidget(), myName(theName), myDlg( dlg )
{
public:
StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr,
- const QString&,
+ const QString&,
QDialog*);
~StdMeshersGUI_LayerDistributionParamWdg();
QString aMainFatherEntry = "";
TopoDS_Shape shape;
if ( !CORBA::is_nil( aGeomFatherObj ) ) {
- // Get Main Shape
- GEOM::GEOM_Object_var aGeomMain = GetGeomObjectByEntry( myEntry );
- if ( !CORBA::is_nil( aGeomMain ) && aGeomMain->GetType() == 37 ) { // Main Shape is a Group
- GEOM::GEOM_Object_ptr aMainFatherObj = aGeomMain->GetMainShape();
- if ( !CORBA::is_nil( aMainFatherObj ) )
- aMainFatherEntry = aMainFatherObj->GetStudyEntry();
- }
- aFatherEntry = aGeomFatherObj->GetStudyEntry();
+ // Get Main Shape
+ GEOM::GEOM_Object_var aGeomMain = GetGeomObjectByEntry( myEntry );
+ if ( !CORBA::is_nil( aGeomMain ) && aGeomMain->GetType() == 37 ) { // Main Shape is a Group
+ GEOM::GEOM_Object_ptr aMainFatherObj = aGeomMain->GetMainShape();
+ if ( !CORBA::is_nil( aMainFatherObj ) )
+ aMainFatherEntry = aMainFatherObj->GetStudyEntry();
+ }
+ aFatherEntry = aGeomFatherObj->GetStudyEntry();
}
if ( aFatherEntry != "" && ( aFatherEntry == myEntry || aFatherEntry == aMainFatherEntry ) ) {
- if ( aGeomObj->GetType() == 37 /*GEOM_GROUP*/ ) { // Selected Group that belongs the main object
- GEOMBase::GetShape(aGeomObj, shape);
- if ( !shape.IsNull() ) {
- TopExp_Explorer exp( shape, mySubShType );
- for ( ; exp.More(); exp.Next() ) {
- int index = myPreviewActor->GetIndexByShape( exp.Current() );
- if ( index ) {
- mySelectedIDs.append( index );
- myPreviewActor->HighlightID( index );
- }
- }
- }
- } else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ) {
- GEOMBase::GetShape(aGeomObj, shape);
- if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
- int index = myPreviewActor->GetIndexByShape( shape );
- if ( index ) {
- mySelectedIDs.append( index );
- myPreviewActor->HighlightID( index );
- }
- }
- }
+ if ( aGeomObj->GetType() == 37 /*GEOM_GROUP*/ ) { // Selected Group that belongs the main object
+ GEOMBase::GetShape(aGeomObj, shape);
+ if ( !shape.IsNull() ) {
+ TopExp_Explorer exp( shape, mySubShType );
+ for ( ; exp.More(); exp.Next() ) {
+ int index = myPreviewActor->GetIndexByShape( exp.Current() );
+ if ( index ) {
+ mySelectedIDs.append( index );
+ myPreviewActor->HighlightID( index );
+ }
+ }
+ }
+ } else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/ ) {
+ GEOMBase::GetShape(aGeomObj, shape);
+ if ( !shape.IsNull() && shape.ShapeType() == mySubShType ) {
+ int index = myPreviewActor->GetIndexByShape( shape );
+ if ( index ) {
+ mySelectedIDs.append( index );
+ myPreviewActor->HighlightID( index );
+ }
+ }
+ }
}
} else { // Selected Actor from Actor Collection
QString anEntry = IO->getEntry();
anEntry.remove(0, index+1);
int ind = anEntry.toInt();
if ( ind )
- mySelectedIDs.append( ind );
+ mySelectedIDs.append( ind );
}
}
}
myListWidget->blockSignals( false );
myAddButton->setEnabled( myListOfIDs.size() < myMaxSize );
}
-
+
//=================================================================================
// function : onRemove()
// purpose : Called when Remove Button Clicked
anArray->length( size );
if ( size ) {
for (int i = 0; i < size; i++) {
- anArray[i] = myListOfIDs.at(i);
+ anArray[i] = myListOfIDs.at(i);
}
}
return anArray;
//=============================================================================
StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i" );
myBaseImpl = new ::StdMeshers_Arithmetic1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
//=============================================================================
void StdMeshers_Arithmetic1D_i::SetLength(CORBA::Double theLength,
- CORBA::Boolean theIsStart )
+ CORBA::Boolean theIsStart )
throw ( SALOME::SALOME_Exception )
{
MESSAGE( "StdMeshers_StartEndLength_i::SetLength" );
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
SMESH::TPythonDump() << _this() << ".SetFineness( " << theFineness << " )";
//=============================================================================
StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i" );
myBaseImpl = new ::StdMeshers_Deflection1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
//=============================================================================
StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i" );
myBaseImpl = new ::StdMeshers_Hexa_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
// Constructor
StdMeshers_Hexa_3D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Hexa_3D_i();
//=============================================================================
StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i" );
myBaseImpl = new ::StdMeshers_LengthFromEdges( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
//=============================================================================
StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i" );
myBaseImpl = new ::StdMeshers_MEFISTO_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
// Constructor
StdMeshers_MEFISTO_2D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_MEFISTO_2D_i();
//=============================================================================
StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i" );
myBaseImpl = new ::StdMeshers_MaxElementArea( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
// Constructor
StdMeshers_MaxElementArea_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_MaxElementArea_i();
//=============================================================================
StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i" );
myBaseImpl = new ::StdMeshers_MaxElementVolume( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// this is an internal kitchen call - no Python dump
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// this is an internal kitchen call - no Python dump
// Update Python script
//=============================================================================
StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i" );
myBaseImpl = new ::StdMeshers_NumberOfSegments( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
*/
//=============================================================================
SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionExpr( const char* func,
- CORBA::Long nbSeg,
- CORBA::Long conv )
+ CORBA::Long nbSeg,
+ CORBA::Long conv )
throw ( SALOME::SALOME_Exception )
{
ASSERT( myBaseImpl );
}
SMESH::double_array* StdMeshers_NumberOfSegments_i::BuildDistributionTab( const SMESH::double_array& func,
- CORBA::Long nbSeg,
- CORBA::Long conv )
+ CORBA::Long nbSeg,
+ CORBA::Long conv )
throw ( SALOME::SALOME_Exception )
{
ASSERT( myBaseImpl );
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
return scale;
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
SMESH::double_array_var aRes = new SMESH::double_array();
aRes->length(tbl->size());
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
return CORBA::string_dup(expr);
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
}
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
return conv;
}
// Constructor
StdMeshers_NumberOfSegments_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_NumberOfSegments_i();
//=============================================================================
StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
//=============================================================================
StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i" );
myBaseImpl = new ::StdMeshers_RadialPrism_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
{
MESSAGE( "StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i" );
myBaseImpl = new ::StdMeshers_Projection_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
{
MESSAGE( "StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i" );
myBaseImpl = new ::StdMeshers_Projection_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
{
MESSAGE( "StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i" );
myBaseImpl = new ::StdMeshers_Projection_1D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//-----------------------------------------------------------------------------
StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i
(PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_QuadrangleParams_i::StdMeshers_QuadrangleParams_i" );
myBaseImpl = new ::StdMeshers_QuadrangleParams(theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl);
+ theStudyId,
+ theGenImpl);
}
//=============================================================================
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
public:
// Constructor
StdMeshers_QuadrangleParams_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_QuadrangleParams_i();
//=============================================================================
StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
+ int theStudyId,
+ ::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
{
MESSAGE( "StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i" );
myBaseImpl = new ::StdMeshers_Quadrangle_2D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
+ theStudyId,
+ theGenImpl );
}
//=============================================================================
// Constructor
StdMeshers_Quadrangle_2D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Quadrangle_2D_i();
// Constructor
StdMeshers_Regular_1D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
- ::SMESH_Gen* theGenImpl );
+ ::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_Regular_1D_i();
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
- SALOME::BAD_PARAM );
+ SALOME::BAD_PARAM );
}
// Update Python script