1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_ResultBody.cpp
4 // Created: 08 Jul 2014
5 // Author: Mikhail PONIKAROV
7 #include <Model_ResultBody.h>
8 #include <Model_Data.h>
9 #include <Model_Document.h>
10 #include <TNaming_Builder.hxx>
11 #include <TNaming_NamedShape.hxx>
12 #include <TDataStd_Name.hxx>
14 #include <TopoDS_Shape.hxx>
15 #include <TopoDS_Face.hxx>
16 #include <TDF_ChildIterator.hxx>
17 #include <TopTools_MapOfShape.hxx>
18 #include <TopExp_Explorer.hxx>
19 #include <TopTools_ListOfShape.hxx>
20 #include <TopTools_ListIteratorOfListOfShape.hxx>
21 #include <TopTools_DataMapOfShapeListOfShape.hxx>
22 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
23 #include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
24 #include <TopTools_MapIteratorOfMapOfShape.hxx>
25 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
26 #include <TopTools_IndexedMapOfShape.hxx>
27 #include <TopTools_DataMapOfShapeShape.hxx>
29 #include <BRepTools.hxx>
30 #include <GeomAPI_Shape.h>
31 #include <GeomAlgoAPI_MakeShape.h>
33 //#include <TCollection_AsciiString.hxx>
34 //#include <TDF_Tool.hxx>
35 Model_ResultBody::Model_ResultBody()
37 setIsConcealed(false);
40 void Model_ResultBody::store(const std::shared_ptr<GeomAPI_Shape>& theShape)
42 std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
44 TDF_Label& aShapeLab = aData->shapeLab();
47 // store the new shape as primitive
48 TNaming_Builder aBuilder(aShapeLab);
51 TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
53 return; // null shape inside
55 aBuilder.Generated(aShape);
57 if(!aBuilder.NamedShape()->IsEmpty()) {
58 Handle(TDataStd_Name) anAttr;
59 if(aBuilder.NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(),anAttr)) {
60 std::string aName (TCollection_AsciiString(anAttr->Get()).ToCString());
62 std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(document());
63 aDoc->addNamingName(aBuilder.NamedShape()->Label(), aName);
70 void Model_ResultBody::storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
71 const std::shared_ptr<GeomAPI_Shape>& theToShape)
73 std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
75 TDF_Label& aShapeLab = aData->shapeLab();
78 // store the new shape as primitive
79 TNaming_Builder aBuilder(aShapeLab);
80 if (!theFromShape || !theToShape)
82 TopoDS_Shape aShapeBasis = theFromShape->impl<TopoDS_Shape>();
83 if (aShapeBasis.IsNull())
84 return; // null shape inside
85 TopoDS_Shape aShapeNew = theToShape->impl<TopoDS_Shape>();
86 if (aShapeNew.IsNull())
87 return; // null shape inside
88 aBuilder.Generated(aShapeBasis, aShapeNew);
90 if(!aBuilder.NamedShape()->IsEmpty()) {
91 Handle(TDataStd_Name) anAttr;
92 if(aBuilder.NamedShape()->Label().FindAttribute(TDataStd_Name::GetID(),anAttr)) {
93 std::string aName (TCollection_AsciiString(anAttr->Get()).ToCString());
95 std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(document());
96 aDoc->addNamingName(aBuilder.NamedShape()->Label(), aName);
103 void Model_ResultBody::storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
104 const std::shared_ptr<GeomAPI_Shape>& theNewShape)
106 std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
108 TDF_Label& aShapeLab = aData->shapeLab();
111 // store the new shape as primitive
112 TNaming_Builder aBuilder(aShapeLab);
113 if (!theOldShape || !theNewShape)
115 TopoDS_Shape aShapeOld = theOldShape->impl<TopoDS_Shape>();
116 if (aShapeOld.IsNull())
117 return; // null shape inside
118 TopoDS_Shape aShapeNew = theNewShape->impl<TopoDS_Shape>();
119 if (aShapeNew.IsNull())
120 return; // null shape inside
121 aBuilder.Modify(aShapeOld, aShapeNew);
125 std::shared_ptr<GeomAPI_Shape> Model_ResultBody::shape()
127 std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
129 TDF_Label& aShapeLab = aData->shapeLab();
130 Handle(TNaming_NamedShape) aName;
131 if (aShapeLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) {
132 TopoDS_Shape aShape = aName->Get();
133 if (!aShape.IsNull()) {
134 std::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
135 aRes->setImpl(new TopoDS_Shape(aShape));
140 return std::shared_ptr<GeomAPI_Shape>();
143 void Model_ResultBody::clean()
145 std::vector<TNaming_Builder*>::iterator aBuilder = myBuilders.begin();
146 for(; aBuilder != myBuilders.end(); aBuilder++)
151 Model_ResultBody::~Model_ResultBody()
156 TNaming_Builder* Model_ResultBody::builder(const int theTag)
158 if (myBuilders.size() <= (unsigned int)theTag) {
159 myBuilders.insert(myBuilders.end(), theTag - myBuilders.size() + 1, NULL);
161 if (!myBuilders[theTag]) {
162 std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
163 myBuilders[theTag] = new TNaming_Builder(aData->shapeLab().FindChild(theTag));
164 //TCollection_AsciiString entry;//
165 //TDF_Tool::Entry(aData->shapeLab().FindChild(theTag), entry);
166 //cout << "Label = " <<entry.ToCString() <<endl;
168 return myBuilders[theTag];
171 void Model_ResultBody::buildName(const int theTag, const std::string& theName)
173 std::string aName = data()->name() + "/" + theName;
174 std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(document());
175 aDoc->addNamingName(builder(theTag)->NamedShape()->Label(), aName);
176 TDataStd_Name::Set(builder(theTag)->NamedShape()->Label(),aName.c_str());
178 void Model_ResultBody::generated(
179 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
181 TopoDS_Shape aShape = theNewShape->impl<TopoDS_Shape>();
182 builder(theTag)->Generated(aShape);
184 buildName(theTag, theName);
187 void Model_ResultBody::generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
188 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
190 TopoDS_Shape anOldShape = theOldShape->impl<TopoDS_Shape>();
191 TopoDS_Shape aNewShape = theNewShape->impl<TopoDS_Shape>();
192 builder(theTag)->Generated(anOldShape, aNewShape);
194 buildName(theTag, theName);
198 void Model_ResultBody::modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
199 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag)
201 TopoDS_Shape anOldShape = theOldShape->impl<TopoDS_Shape>();
202 TopoDS_Shape aNewShape = theNewShape->impl<TopoDS_Shape>();
203 builder(theTag)->Modify(anOldShape, aNewShape);
205 buildName(theTag, theName);
208 void Model_ResultBody::deleted(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
211 TopoDS_Shape aShape = theOldShape->impl<TopoDS_Shape>();
212 builder(theTag)->Delete(aShape);
215 void Model_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
216 std::shared_ptr<GeomAPI_Shape> theShapeIn,
217 const int theKindOfShape,
220 TopoDS_Shape aShapeIn = theShapeIn->impl<TopoDS_Shape>();
221 TopTools_MapOfShape aView;
222 TopExp_Explorer ShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape);
223 for (; ShapeExplorer.More(); ShapeExplorer.Next ()) {
224 const TopoDS_Shape& aRoot = ShapeExplorer.Current ();
225 if (!aView.Add(aRoot)) continue;
226 std::shared_ptr<GeomAPI_Shape> aRShape(new GeomAPI_Shape());
227 aRShape->setImpl((new TopoDS_Shape(aRoot)));
228 if (theMS->isDeleted (aRShape)) {
229 builder(theTag)->Delete(aRoot);
234 void Model_ResultBody::loadAndOrientModifiedShapes (
235 GeomAlgoAPI_MakeShape* theMS,
236 std::shared_ptr<GeomAPI_Shape> theShapeIn,
237 const int theKindOfShape,
239 const std::string& theName,
240 GeomAPI_DataMapOfShapeShape& theSubShapes)
242 TopoDS_Shape aShapeIn = theShapeIn->impl<TopoDS_Shape>();
243 TopTools_MapOfShape aView;
244 bool isBuilt = theName.empty();
245 TopExp_Explorer aShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape);
246 for (; aShapeExplorer.More(); aShapeExplorer.Next ()) {
247 const TopoDS_Shape& aRoot = aShapeExplorer.Current ();
248 if (!aView.Add(aRoot)) continue;
250 std::shared_ptr<GeomAPI_Shape> aRShape(new GeomAPI_Shape());
251 aRShape->setImpl((new TopoDS_Shape(aRoot)));
252 theMS->modified(aRShape, aList);
253 std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator anIt = aList.begin(), aLast = aList.end();
254 for (; anIt != aLast; anIt++) {
255 TopoDS_Shape aNewShape = (*anIt)->impl<TopoDS_Shape>();
256 if (theSubShapes.isBound(*anIt)) {
257 std::shared_ptr<GeomAPI_Shape> aMapShape(theSubShapes.find(*anIt));
258 aNewShape.Orientation(aMapShape->impl<TopoDS_Shape>().Orientation());
260 if (!aRoot.IsSame (aNewShape)) {
261 builder(theTag)->Modify(aRoot,aNewShape);
263 buildName(theTag, theName);
269 void Model_ResultBody::loadAndOrientGeneratedShapes (
270 GeomAlgoAPI_MakeShape* theMS,
271 std::shared_ptr<GeomAPI_Shape> theShapeIn,
272 const int theKindOfShape,
274 const std::string& theName,
275 GeomAPI_DataMapOfShapeShape& theSubShapes)
277 TopoDS_Shape aShapeIn = theShapeIn->impl<TopoDS_Shape>();
278 TopTools_MapOfShape aView;
279 bool isBuilt = theName.empty();
280 TopExp_Explorer aShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape);
281 for (; aShapeExplorer.More(); aShapeExplorer.Next ()) {
282 const TopoDS_Shape& aRoot = aShapeExplorer.Current ();
283 if (!aView.Add(aRoot)) continue;
285 std::shared_ptr<GeomAPI_Shape> aRShape(new GeomAPI_Shape());
286 aRShape->setImpl((new TopoDS_Shape(aRoot)));
287 theMS->generated(aRShape, aList);
288 std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator anIt = aList.begin(), aLast = aList.end();
289 for (; anIt != aLast; anIt++) {
290 TopoDS_Shape aNewShape = (*anIt)->impl<TopoDS_Shape>();
291 if (theSubShapes.isBound(*anIt)) {
292 std::shared_ptr<GeomAPI_Shape> aMapShape(theSubShapes.find(*anIt));
293 aNewShape.Orientation(aMapShape->impl<TopoDS_Shape>().Orientation());
295 if (!aRoot.IsSame (aNewShape)) {
296 builder(theTag)->Generated(aRoot,aNewShape);
298 buildName(theTag, theName);
304 //=======================================================================
305 int getDangleShapes(const TopoDS_Shape& theShapeIn,
306 const TopAbs_ShapeEnum theGeneratedFrom,
307 TopTools_DataMapOfShapeShape& theDangles)
310 TopTools_IndexedDataMapOfShapeListOfShape subShapeAndAncestors;
311 TopAbs_ShapeEnum GeneratedTo;
312 if (theGeneratedFrom == TopAbs_FACE) GeneratedTo = TopAbs_EDGE;
313 else if (theGeneratedFrom == TopAbs_EDGE) GeneratedTo = TopAbs_VERTEX;
314 else return Standard_False;
315 TopExp::MapShapesAndAncestors(theShapeIn, GeneratedTo, theGeneratedFrom, subShapeAndAncestors);
316 for (Standard_Integer i = 1; i <= subShapeAndAncestors.Extent(); i++) {
317 const TopoDS_Shape& mayBeDangle = subShapeAndAncestors.FindKey(i);
318 const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i);
319 if (ancestors.Extent() == 1) theDangles.Bind(ancestors.First(), mayBeDangle);
321 return theDangles.Extent();
324 //=======================================================================
325 void loadGeneratedDangleShapes(
326 const TopoDS_Shape& theShapeIn,
327 const TopAbs_ShapeEnum theGeneratedFrom,
328 TNaming_Builder * theBuilder)
330 TopTools_DataMapOfShapeShape dangles;
331 if (!getDangleShapes(theShapeIn, theGeneratedFrom, dangles)) return;
332 TopTools_DataMapIteratorOfDataMapOfShapeShape itr(dangles);
333 for (; itr.More(); itr.Next())
334 theBuilder->Generated(itr.Key(), itr.Value());
337 //=======================================================================
338 void Model_ResultBody::loadNextLevels(std::shared_ptr<GeomAPI_Shape> theShape,
339 const std::string& theName, int& theTag)
341 if(theShape->isNull()) return;
342 TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
344 if (aShape.ShapeType() == TopAbs_SOLID) {
345 TopExp_Explorer expl(aShape, TopAbs_FACE);
346 for (; expl.More(); expl.Next()) {
347 builder(theTag)->Generated(expl.Current());
348 TCollection_AsciiString aStr(theTag);
349 aName = theName + aStr.ToCString();
350 buildName(theTag, aName);
354 else if (aShape.ShapeType() == TopAbs_SHELL || aShape.ShapeType() == TopAbs_FACE) {
355 // load faces and all the free edges
356 TopTools_IndexedMapOfShape Faces;
357 TopExp::MapShapes(aShape, TopAbs_FACE, Faces);
358 if (Faces.Extent() > 1 || (aShape.ShapeType() == TopAbs_SHELL && Faces.Extent() == 1)) {
359 TopExp_Explorer expl(aShape, TopAbs_FACE);
360 for (; expl.More(); expl.Next()) {
361 builder(theTag)->Generated(expl.Current());
362 TCollection_AsciiString aStr(theTag);
363 aName = theName + aStr.ToCString();
364 buildName(theTag, aName);
368 TopTools_IndexedDataMapOfShapeListOfShape anEdgeAndNeighbourFaces;
369 TopExp::MapShapesAndAncestors(aShape, TopAbs_EDGE, TopAbs_FACE, anEdgeAndNeighbourFaces);
370 for (Standard_Integer i = 1; i <= anEdgeAndNeighbourFaces.Extent(); i++)
372 const TopTools_ListOfShape& aLL = anEdgeAndNeighbourFaces.FindFromIndex(i);
373 if (aLL.Extent() < 2) {
374 builder(theTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
375 TCollection_AsciiString aStr(theTag);
376 aName = theName + aStr.ToCString();
377 buildName(theTag, aName);
380 TopTools_ListIteratorOfListOfShape anIter(aLL);
381 const TopoDS_Face& aFace = TopoDS::Face(anIter.Value());
383 if(aFace.IsEqual(anIter.Value())) {
384 builder(theTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
385 TCollection_AsciiString aStr(theTag);
386 aName = theName + aStr.ToCString();
387 buildName(theTag, aName);
392 } else if (aShape.ShapeType() == TopAbs_WIRE) {
393 TopTools_IndexedMapOfShape Edges;
394 BRepTools::Map3DEdges(aShape, Edges);
395 if (Edges.Extent() == 1) {
396 builder(++theTag)->Generated(Edges.FindKey(1));
397 TopExp_Explorer expl(aShape, TopAbs_VERTEX);
398 for (; expl.More(); expl.Next()) {
399 builder(theTag)->Generated(expl.Current());
400 TCollection_AsciiString aStr(theTag);
401 aName = theName + aStr.ToCString();
402 buildName(theTag, aName);
406 TopExp_Explorer expl(aShape, TopAbs_EDGE);
407 for (; expl.More(); expl.Next()) {
408 builder(theTag)->Generated(expl.Current());
409 TCollection_AsciiString aStr(theTag);
410 aName = theName + aStr.ToCString();
411 buildName(theTag, aName);
414 // and load generated vertices.
415 TopTools_DataMapOfShapeShape generated;
416 if (getDangleShapes(aShape, TopAbs_EDGE, generated))
418 TNaming_Builder* pBuilder = builder(theTag++);
419 loadGeneratedDangleShapes(aShape, TopAbs_EDGE, pBuilder);
422 } else if (aShape.ShapeType() == TopAbs_EDGE) {
423 TopExp_Explorer expl(aShape, TopAbs_VERTEX);
424 for (; expl.More(); expl.Next()) {
425 builder(theTag)->Generated(expl.Current());
426 TCollection_AsciiString aStr(theTag);
427 aName = theName + aStr.ToCString();
428 buildName(theTag, aName);
433 //=======================================================================
434 void Model_ResultBody::loadFirstLevel(
435 std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag)
437 if(theShape->isNull()) return;
438 TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
440 if (aShape.ShapeType() == TopAbs_COMPOUND || aShape.ShapeType() == TopAbs_COMPSOLID) {
441 TopoDS_Iterator itr(aShape);
442 for (; itr.More(); itr.Next(),theTag++) {
443 builder(theTag)->Generated(itr.Value());
444 TCollection_AsciiString aStr(theTag);
445 aName = theName + aStr.ToCString();
446 buildName(theTag, aName);
447 if(!theName.empty()) buildName(theTag, aName);
448 if (itr.Value().ShapeType() == TopAbs_COMPOUND ||
449 itr.Value().ShapeType() == TopAbs_COMPSOLID)
451 std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
452 itrShape->setImpl(new TopoDS_Shape(itr.Value()));
453 loadFirstLevel(itrShape, theName, theTag);
455 std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
456 itrShape->setImpl(new TopoDS_Shape(itr.Value()));
457 loadNextLevels(itrShape, theName, theTag);
461 std::shared_ptr<GeomAPI_Shape> itrShape(new GeomAPI_Shape());
462 itrShape->setImpl(new TopoDS_Shape(aShape));
463 loadNextLevels(itrShape, theName, theTag);
467 //=======================================================================
468 void Model_ResultBody::loadDisconnectedEdges(
469 std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag)
471 if(theShape->isNull()) return;
472 TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
473 TopTools_DataMapOfShapeListOfShape edgeNaborFaces;
474 TopTools_ListOfShape empty;
475 TopExp_Explorer explF(aShape, TopAbs_FACE);
476 for (; explF.More(); explF.Next()) {
477 const TopoDS_Shape& aFace = explF.Current();
478 TopExp_Explorer explV(aFace, TopAbs_EDGE);
479 for (; explV.More(); explV.Next()) {
480 const TopoDS_Shape& anEdge = explV.Current();
481 if (!edgeNaborFaces.IsBound(anEdge)) edgeNaborFaces.Bind(anEdge, empty);
482 Standard_Boolean faceIsNew = Standard_True;
483 TopTools_ListIteratorOfListOfShape itrF(edgeNaborFaces.Find(anEdge));
484 for (; itrF.More(); itrF.Next()) {
485 if (itrF.Value().IsSame(aFace)) {
486 faceIsNew = Standard_False;
491 edgeNaborFaces.ChangeFind(anEdge).Append(aFace);
495 TopTools_MapOfShape anEdgesToDelete;
496 TopExp_Explorer anEx(aShape,TopAbs_EDGE);
498 for(;anEx.More();anEx.Next()) {
499 Standard_Boolean aC0 = Standard_False;
500 TopoDS_Shape anEdge1 = anEx.Current();
501 if (edgeNaborFaces.IsBound(anEdge1)) {
502 const TopTools_ListOfShape& aList1 = edgeNaborFaces.Find(anEdge1);
503 if (aList1.Extent()<2) continue;
504 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itr(edgeNaborFaces);
505 for (; itr.More(); itr.Next()) {
506 TopoDS_Shape anEdge2 = itr.Key();
507 if(anEdgesToDelete.Contains(anEdge2)) continue;
508 if (anEdge1.IsSame(anEdge2)) continue;
509 const TopTools_ListOfShape& aList2 = itr.Value();
510 // compare lists of the neighbour faces of edge1 and edge2
511 if (aList1.Extent() == aList2.Extent()) {
512 Standard_Integer aMatches = 0;
513 for(TopTools_ListIteratorOfListOfShape aLIter1(aList1);aLIter1.More();aLIter1.Next())
514 for(TopTools_ListIteratorOfListOfShape aLIter2(aList2);aLIter2.More();aLIter2.Next())
515 if (aLIter1.Value().IsSame(aLIter2.Value())) aMatches++;
516 if (aMatches == aList1.Extent()) {
518 builder(theTag)->Generated(anEdge2);
519 anEdgesToDelete.Add(anEdge2);
520 TCollection_AsciiString aStr(theTag);
521 aName = theName + aStr.ToCString();
522 buildName(theTag, aName);
527 TopTools_MapIteratorOfMapOfShape itDelete(anEdgesToDelete);
528 for(;itDelete.More();itDelete.Next())
529 edgeNaborFaces.UnBind(itDelete.Key());
530 edgeNaborFaces.UnBind(anEdge1);
533 builder(theTag)->Generated(anEdge1);
534 TCollection_AsciiString aStr(theTag);
535 aName = theName + aStr.ToCString();
536 buildName(theTag, aName);
542 void Model_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag)
544 if(theShape->isNull()) return;
545 TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
546 TopTools_DataMapOfShapeListOfShape vertexNaborEdges;
547 TopTools_ListOfShape empty;
548 TopExp_Explorer explF(aShape, TopAbs_EDGE);
549 for (; explF.More(); explF.Next()) {
550 const TopoDS_Shape& anEdge = explF.Current();
551 TopExp_Explorer explV(anEdge, TopAbs_VERTEX);
552 for (; explV.More(); explV.Next()) {
553 const TopoDS_Shape& aVertex = explV.Current();
554 if (!vertexNaborEdges.IsBound(aVertex)) vertexNaborEdges.Bind(aVertex, empty);
555 Standard_Boolean faceIsNew = Standard_True;
556 TopTools_ListIteratorOfListOfShape itrF(vertexNaborEdges.Find(aVertex));
557 for (; itrF.More(); itrF.Next()) {
558 if (itrF.Value().IsSame(anEdge)) {
559 faceIsNew = Standard_False;
564 vertexNaborEdges.ChangeFind(aVertex).Append(anEdge);
569 TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itr(vertexNaborEdges);
570 for (; itr.More(); itr.Next()) {
571 const TopTools_ListOfShape& naborEdges = itr.Value();
572 if (naborEdges.Extent() < 2) {
573 builder(theTag)->Generated(itr.Key());
574 TCollection_AsciiString aStr(theTag);
575 aName = theName + aStr.ToCString();
576 buildName(theTag, aName);