+ {
+ 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();
+ }
+ }
+ /* {
+ 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));
+ }
+ }
+ UNV2417::Write(out_stream,aDataSet2417);
+ }*/
+
+ out_stream.flush();
+ out_stream.close();
+ if (!check_file(myFile))
+ EXCEPTION(runtime_error,"ERROR: Output file not good.");
+ }
+ catch(const std::exception& exc){