20 #include <BRep_Builder.hxx>
21 #include <Handle_ShapeExtend_WireData.hxx>
22 #include <TopAbs_ShapeEnum.hxx>
23 #include <TopExp_Explorer.hxx>
24 #include <TopoDS_Compound.hxx>
25 #include <TopoDS_Face.hxx>
26 #include <TopoDS_Wire.hxx>
37 template<
typename FWD_ITERATOR>
38 static TopoDS_Compound makeCompoundFromShapeRange(
39 FWD_ITERATOR iBegin, FWD_ITERATOR iEnd);
41 template<
typename CONTAINER>
42 static TopoDS_Compound makeCompoundFromShapeContainer(CONTAINER cnter);
44 template<
typename FWD_ITERATOR>
45 static TopoDS_Wire makeWireFromEdgeRange(
46 FWD_ITERATOR iBegin, FWD_ITERATOR iEnd);
49 static std::string shapeToString(
const TopoDS_Shape& shape);
50 static TopoDS_Shape shapeFromString(
const std::string& str);
53 template<
typename FUNC>
55 const TopoDS_Shape& shape, TopAbs_ShapeEnum shapeType, FUNC fn);
57 template<
typename FUNC>
58 static void forEach(TopExp_Explorer& explorer, FUNC fn);
60 template<
typename FUNC>
61 static void forEachVertex(
const TopoDS_Shape& shape, FUNC fn);
63 template<
typename FUNC>
64 static void forEachEdge(
const TopoDS_Shape& shape, FUNC fn);
66 template<
typename FUNC>
67 static void forEachWire(
const TopoDS_Shape& shape, FUNC fn);
69 template<
typename FUNC>
70 static void forEachFace(
const TopoDS_Shape& shape, FUNC fn);
73 static gp_Vec normalToFaceAtUV(
74 const TopoDS_Face& face, Standard_Real u, Standard_Real v);
77 static Handle_ShapeExtend_WireData createShapeExtendWireData();
79 const Handle_ShapeExtend_WireData& wireData,
80 const TopoDS_Edge& edge);
81 static TopoDS_Wire fixedWire(
const Handle_ShapeExtend_WireData& wireData);
96 template<
typename FWD_ITERATOR>
98 FWD_ITERATOR iBegin, FWD_ITERATOR iEnd)
100 TopoDS_Compound cmpd;
101 BRep_Builder builder;
102 builder.MakeCompound(cmpd);
104 while (iBegin != iEnd) {
105 builder.Add(cmpd, *iBegin);
113 template<
typename CONTAINER>
125 template<
typename FWD_ITERATOR>
127 FWD_ITERATOR iBegin, FWD_ITERATOR iEnd)
129 Handle_ShapeExtend_WireData wireData =
130 TopoDsUtils::createShapeExtendWireData();
131 while (iBegin != iEnd) {
132 TopoDsUtils::addEdge(wireData, *iBegin);
135 return TopoDsUtils::fixedWire(wireData);
139 template<
typename FUNC>
141 const TopoDS_Shape &shape, TopAbs_ShapeEnum shapeType, FUNC fn)
147 template<
typename FUNC>
150 while (explorer.More()) {
151 fn(explorer.Current());
156 template<
typename FUNC>
162 template<
typename FUNC>
168 template<
typename FUNC>
174 template<
typename FUNC>
static TopoDS_Compound makeCompoundFromShapeRange(FWD_ITERATOR iBegin, FWD_ITERATOR iEnd)
Definition: topods_utils.h:97
static void forEach(const TopoDS_Shape &shape, TopAbs_ShapeEnum shapeType, FUNC fn)
Definition: topods_utils.h:140
static void forEachVertex(const TopoDS_Shape &shape, FUNC fn)
Definition: topods_utils.h:157
static void forEachWire(const TopoDS_Shape &shape, FUNC fn)
Definition: topods_utils.h:169
static void forEachEdge(const TopoDS_Shape &shape, FUNC fn)
Definition: topods_utils.h:163
static TopoDS_Wire makeWireFromEdgeRange(FWD_ITERATOR iBegin, FWD_ITERATOR iEnd)
Definition: topods_utils.h:126
Definition: ais_text.cpp:31
static void forEachFace(const TopoDS_Shape &shape, FUNC fn)
Definition: topods_utils.h:175
static TopoDS_Compound makeCompoundFromShapeContainer(CONTAINER cnter)
Same as occ::makeCompoundFromShapeRange(cnter.begin(), cnter.end())
Definition: topods_utils.h:114
Collection of tools for the TopoDS package.
Definition: topods_utils.h:33