+ if (e1!=NULL) e1->getName (name1);
+ if (e2!=NULL) e2->getName (name2);
+
+ putError (mess, name1, name2);
+}
+// ======================================================== parseSubShape
+SubShape* Document::parseSubShape (XmlTree* node)
+{
+ const string& name = node->findValue ("shape");
+ int subid = node->findInteger ("subid");
+ NewShape* shape = findShape (name);
+ if (shape==NULL)
+ return NULL;
+
+ SubShape* sub_shape = shape->findSubShape (subid);
+ return sub_shape;
+}
+// ======================================================== parseAssociation (v)
+void Document::parseAssociation (XmlTree* node, Vertex* vertex)
+{
+ SubShape* shape = parseSubShape (node);
+ if (shape==NULL || vertex==NULL)
+ return;
+
+ if (shape->getDim()!=0)
+ return;
+ VertexShape* vshape = static_cast <VertexShape*> (shape);
+ vertex->setAssociation (vshape);
+}
+// ======================================================== parseAssociation (e)
+void Document::parseAssociation (XmlTree* node, Edge* edge)
+{
+ SubShape* shape = parseSubShape (node);
+ if (shape==NULL || edge==NULL)
+ return;
+
+ if (shape->getDim()!=1)
+ return;
+
+ const string& inter = node->findValue ("interval");
+ double pdeb, pfin;
+ get_coords (inter, pdeb, pfin);
+
+ EdgeShape* line = static_cast <EdgeShape*> (shape);
+ edge->addAssociation (line, pdeb, pfin);
+}
+// ======================================================== parseAssociation (q)
+void Document::parseAssociation (XmlTree* node, Quad* quad)
+{
+ SubShape* shape = parseSubShape (node);
+ if (shape==NULL || quad==NULL)
+ return;
+
+ if (shape->getDim()!=2)
+ return;
+ FaceShape* face = static_cast <FaceShape*> (shape);
+ quad->addAssociation (face);
+}
+// ======================================================== parseShapes
+void Document::parseShapes (XmlTree& root)
+{
+ XmlTree* rubrique = root.findChild ("ListShapes");
+ int nbrelts = count_children (rubrique);
+
+ for (int nro=0 ; nro < nbrelts ; nro++)
+ {
+ XmlTree* node = rubrique->getChild (nro);
+ const string& type = node->getName();
+ if (type=="Shape")
+ {
+ const string& nom = node->findValue ("id" );
+ int orig = node->findInteger ("type");
+ const string& brep = node->findValue ("brep");
+ NewShape* shape = new NewShape (this, (EnumShape)orig);
+
+ parse_name (node, nom, shape);
+ shape->setBrep (brep);
+ doc_tab_shape.push_back (shape);
+ }
+ else if (type=="Cloud")
+ {
+ int nbvert = count_children (node);
+ for (int nv=0 ; nv < nbvert ; nv++)
+ {
+ Real3 point;
+ XmlTree* sommet = node->getChild (nv);
+ const string& coords = sommet->findValue ("coord");
+ get_coords (coords, point[dir_x], point[dir_y], point[dir_z]);
+ doc_cloud->addPoint (point);
+ }
+ }
+ }
+}