+
+ // --------------------
+ // Storing SMDS Groups
+ // --------------------
+ {
+ using namespace UNV2417;
+ if ( myGroups.size() > 0 ) {
+ TRecord aRec;
+ TDataSet aDataSet2417;
+ TGroupList::const_iterator aIter = myGroups.begin();
+ for ( ; aIter != myGroups.end(); aIter++ )
+ {
+ SMESHDS_GroupBase* aGroupDS = *aIter;
+ aRec.GroupName = aGroupDS->GetStoreName();
+ aRec.NodeList.clear();
+ aRec.ElementList.clear();
+
+ SMDS_ElemIteratorPtr aIter = aGroupDS->GetElements();
+ if ( aGroupDS->GetType() == SMDSAbs_Node ) {
+ while ( aIter->more() ) {
+ const SMDS_MeshElement* aNode = aIter->next();
+ if ( nodeLabelByID.empty() )
+ aRec.NodeList.push_back( aNode->GetID() );
+ else
+ aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]);
+ }
+ }
+ else
+ {
+ while ( aIter->more() ) {
+ const SMDS_MeshElement* aElem = aIter->next();
+ if ( elemLabelByID.empty() )
+ aRec.ElementList.push_back( aElem->GetID() );
+ else
+ aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]);
+ }
+ }
+ // 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();
+ }
+ }
+
+ out_stream.flush();
+ out_stream.close();
+ if (!check_file(myFile))
+ EXCEPTION(runtime_error,"ERROR: Output file not good.");
+ }
+ catch(const std::exception& exc){