-
- s1 = (char*) malloc(sizeof(char)*100);
- s2 = (char*) malloc(sizeof(char)*100);
- s3 = (char*) malloc(sizeof(char)*100);
-
- found_block2411 = false;
- found_block2412 = false;
-
- do {
-
- while (i1==-1) {
- fscanf(myFileId,"%d\n",&blockId);
- switch (blockId) {
- case 2411 : {
- MESSAGE("BlockId "<<blockId);
- fscanf(myFileId,"%d",&node);
- //MESSAGE("Node "<<node);
- while (node!=-1) {
- fscanf(myFileId,"%d %d %d\n",&n1,&n2,&n3);
- fscanf(myFileId,"%s %s %s\n",s1,s2,s3);
- str1=string(s1);
- str2=string(s2);
- str3=string(s3);
- if (str1.find("D")!=string::npos) str1.replace(str1.find("D"),1,"E");
- if (str2.find("D")!=string::npos) str2.replace(str2.find("D"),1,"E");
- if (str3.find("D")!=string::npos) str3.replace(str3.find("D"),1,"E");
- ok = myMesh->AddNodeWithID(atof(str1.c_str()),atof(str2.c_str()),atof(str3.c_str()),node);
- fscanf(myFileId,"%d",&node);
+ {
+ using namespace UNV2412;
+ in_stream.seekg(0);
+ TDataSet aDataSet2412;
+ UNV2412::Read(in_stream,aDataSet2412);
+ 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)) {
+ if(aRec.fe_descriptor_id == 11) {
+ // edge with two nodes
+ anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aLabel);
+ }
+ else {
+ // quadratic edge (with 3 nodes)
+ anElement = myMesh->AddEdgeWithID(aRec.node_labels[0],
+ aRec.node_labels[1],
+ aRec.node_labels[2],
+ aLabel);
+ }