+ 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();
+
+ int aNbNodes = anElem->NbNodes();
+ SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
+ if ( anElem->IsPoly() ) {
+ if ( const SMDS_PolyhedralVolumeOfNodes* ph =
+ dynamic_cast<const SMDS_PolyhedralVolumeOfNodes*> (anElem))
+ {
+ aNbNodes = ph->NbUniqueNodes();
+ aNodesIter = ph->uniqueNodesIterator();
+ }
+ }
+ 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());
+ }
+ 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();
+
+ 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()+1, aRec));
+ }
+ UNV2417::Write(out_stream,aDataSet2417);
+ myGroups.clear();
+ }