int aTag(1);
std::string aNameMS = "Shape";
theResultBody->loadFirstLevel(theGeomShape, aNameMS, aTag);
- std::string aNameDE = "DiscEdges";
- theResultBody->loadDisconnectedEdges(theGeomShape, aNameDE, aTag);
- std::string aNameDV = "DiscVertexes";
- theResultBody->loadDisconnectedVertexes(theGeomShape, aNameDV, aTag);
+ //std::string aNameDE = "DiscEdges";
+ //theResultBody->loadDisconnectedEdges(theGeomShape, aNameDE, aTag);
+ //std::string aNameDV = "DiscVertexes";
+ //theResultBody->loadDisconnectedVertexes(theGeomShape, aNameDV, aTag);
}
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Iterator.hxx>
using namespace std;
+//#define DEB_NAMING 1
+#ifdef DEB_NAMING
+#include <BRepTools.hxx>
+#endif
/// adeed to the index in the packed map to signalize that the vertex of edge is seleted
/// (multiplied by the index of the edge)
static const int kSTART_VERTEX_DELTA = 1000000;
if(!aSubSh.get() || aSubSh->isNull() || !aCont.get() || aCont->shape()->isNull())
return aName;
TopoDS_Shape aSubShape = aSubSh->impl<TopoDS_Shape>();
+#ifdef DEB_NAMING
+ BRepTools::Write(aSubShape, "Selection.brep");
+#endif
TopoDS_Shape aContext = aCont->shape()->impl<TopoDS_Shape>();
std::shared_ptr<Model_Document> aDoc =
std::dynamic_pointer_cast<Model_Document>(aCont->document());
#include <TopTools_DataMapOfShapeShape.hxx>
#include <TopExp.hxx>
#include <BRepTools.hxx>
+#include <BRep_Tool.hxx>
#include <GeomAPI_Shape.h>
#include <GeomAlgoAPI_MakeShape.h>
// DEB
//#include <TCollection_AsciiString.hxx>
//#include <TDF_Tool.hxx>
+#define DEB_IMPORT 1
+
Model_ResultBody::Model_ResultBody()
{
setIsConcealed(false);
{
const TopTools_ListOfShape& aLL = anEdgeAndNeighbourFaces.FindFromIndex(i);
if (aLL.Extent() < 2) {
+ if (BRep_Tool::Degenerated(TopoDS::Edge(anEdgeAndNeighbourFaces.FindKey(i))))
+ continue;
builder(theTag)->Generated(anEdgeAndNeighbourFaces.FindKey(i));
TCollection_AsciiString aStr(theTag);
aName = theName + aStr.ToCString();
edgeNaborFaces.ChangeFind(anEdge).Append(aFace);
}
}
-
+
+/* TopTools_IndexedDataMapOfShapeListOfShape aDM;
+ TopExp::MapShapesAndAncestors(aShape, TopAbs_EDGE, TopAbs_FACE, aDM);
+ for(int i=1; i <= aDM.Extent(); i++) {
+ if(aDM.FindFromIndex(i).Extent() > 1) continue;
+ if (BRep_Tool::Degenerated(TopoDS::Edge(aDM.FindKey(i))))
+ continue;
+ builder(theTag)->Generated(aDM.FindKey(i));
+ TCollection_AsciiString aStr(theTag);
+ std::string aName = theName + aStr.ToCString();
+ buildName(theTag, aName);
+#ifdef DEB_IMPORT
+ aName += + ".brep";
+ BRepTools::Write(aDM.FindKey(i), aName.c_str());
+#endif
+ theTag++;
+ }
+*/
TopTools_MapOfShape anEdgesToDelete;
TopExp_Explorer anEx(aShape,TopAbs_EDGE);
std::string aName;
buildName(theTag, aName);
theTag++;
}
- }
+ }
}
void Model_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag)