GeomAPI_Pln.h
GeomAPI_Shape.h
GeomAPI_Edge.h
- GeomAPI_Wire.h
+ GeomAPI_PlanarEdges.h
GeomAPI_AISObject.h
GeomAPI_IPresentable.h
GeomAPI_Curve.h
GeomAPI_Pln.cpp
GeomAPI_Shape.cpp
GeomAPI_Edge.cpp
- GeomAPI_Wire.cpp
+ GeomAPI_PlanarEdges.cpp
GeomAPI_AISObject.cpp
GeomAPI_Curve.cpp
)
--- /dev/null
+// File: GeomAPI_PlanarEdges.cpp
+// Created: 06 Oct 2014
+// Author: Sergey BELASH
+
+#include <GeomAPI_Interface.h>
+#include <GeomAPI_PlanarEdges.h>
+
+#include <Standard_TypeDef.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepTools_WireExplorer.hxx>
+#include <TopExp_Explorer.hxx>
+
+#include <list>
+
+GeomAPI_PlanarEdges::GeomAPI_PlanarEdges() : GeomAPI_Shape()
+{
+ TopoDS_Compound aBigWireImpl;
+ BRep_Builder aBuilder;
+ aBuilder.MakeCompound(aBigWireImpl);
+ this->setImpl(new TopoDS_Shape(aBigWireImpl));
+}
+
+void GeomAPI_PlanarEdges::addEdge(boost::shared_ptr<GeomAPI_Shape> theEdge)
+{
+ const TopoDS_Edge& anEdge = theEdge->impl<TopoDS_Edge>();
+ if (anEdge.ShapeType() != TopAbs_EDGE)
+ return;
+ TopoDS_Shape& aWire = const_cast<TopoDS_Shape&>(impl<TopoDS_Shape>());
+ BRep_Builder aBuilder;
+ aBuilder.Add(aWire, anEdge);
+}
+
+std::list<boost::shared_ptr<GeomAPI_Shape> > GeomAPI_PlanarEdges::getEdges()
+{
+ TopoDS_Shape& aShape = const_cast<TopoDS_Shape&>(impl<TopoDS_Shape>());
+ //BRepTools_WireExplorer aWireExp(TopoDS::Wire(aShape));
+ TopExp_Explorer aWireExp(aShape, TopAbs_EDGE);
+ std::list<boost::shared_ptr<GeomAPI_Shape> > aResult;
+ for (; aWireExp.More(); aWireExp.Next()) {
+ boost::shared_ptr<GeomAPI_Shape> anEdge(new GeomAPI_Shape);
+ anEdge->setImpl(new TopoDS_Shape(aWireExp.Current()));
+ aResult.push_back(anEdge);
+ }
+ return aResult;
+}
--- /dev/null
+// File: GeomAPI_PlanarEdges.hxx
+// Created: 24 Jul 2014
+// Author: Artem ZHIDKOV
+
+#ifndef GEOMAPI_WIRE_H_
+#define GEOMAPI_WIRE_H_
+
+#include "GeomAPI.h"
+#include "GeomAPI_Edge.h"
+#include "GeomAPI_Pnt.h"
+#include "GeomAPI_Dir.h"
+
+#include <boost/smart_ptr/shared_ptr.hpp>
+
+#include <list>
+
+/**\class GeomAPI_PlanarEdges
+ * \ingroup DataModel
+ * \brief Interface to the edge object
+ */
+
+class GeomAPI_PlanarEdges : public GeomAPI_Shape
+{
+ public:
+ /// Creation of empty (null) shape
+ GEOMAPI_EXPORT GeomAPI_PlanarEdges();
+
+ GEOMAPI_EXPORT virtual bool isVertex() const
+ {
+ return false;
+ }
+
+ /// Returns whether the shape is an edge
+ GEOMAPI_EXPORT virtual bool isEdge() const
+ {
+ return false;
+ }
+
+ GEOMAPI_EXPORT void addEdge(boost::shared_ptr<GeomAPI_Shape> theEdge);
+ GEOMAPI_EXPORT std::list<boost::shared_ptr<GeomAPI_Shape> > getEdges();
+
+ /// Returns True if the wire is defined in a plane
+ GEOMAPI_EXPORT bool hasPlane() const { return myOrigin && myNorm && myDirX && myDirY; }
+
+ /// Set/Get origin point
+ GEOMAPI_EXPORT void setOrigin(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin)
+ { myOrigin = theOrigin; }
+ GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Pnt> origin() const { return myOrigin; }
+
+ /// Set/Get X direction vector
+ GEOMAPI_EXPORT void setDirX(const boost::shared_ptr<GeomAPI_Dir>& theDirX) { myDirX = theDirX; }
+ GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> dirX() const { return myDirX; }
+
+ /// Set/Get Y direction vector
+ GEOMAPI_EXPORT void setDirY(const boost::shared_ptr<GeomAPI_Dir>& theDirY) { myDirY = theDirY; }
+ GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> dirY() const { return myDirY; }
+
+ /// Set/Get Normal direction vector
+ GEOMAPI_EXPORT void setNorm(const boost::shared_ptr<GeomAPI_Dir>& theNorm) { myNorm = theNorm; }
+ GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> norm() const { return myNorm; }
+
+private:
+ boost::shared_ptr<GeomAPI_Pnt> myOrigin;
+ boost::shared_ptr<GeomAPI_Dir> myDirX;
+ boost::shared_ptr<GeomAPI_Dir> myDirY;
+ boost::shared_ptr<GeomAPI_Dir> myNorm;
+};
+
+#endif
+
+++ /dev/null
-// File: GeomAPI_Wire.cpp
-// Created: 06 Oct 2014
-// Author: Sergey BELASH
-
-#include <GeomAPI_Interface.h>
-#include <GeomAPI_Wire.h>
-
-#include <Standard_TypeDef.hxx>
-#include <TopAbs_ShapeEnum.hxx>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Wire.hxx>
-#include <BRep_Builder.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <TopExp_Explorer.hxx>
-
-#include <list>
-
-GeomAPI_Wire::GeomAPI_Wire() : GeomAPI_Shape()
-{
- TopoDS_Compound aBigWireImpl;
- BRep_Builder aBuilder;
- aBuilder.MakeCompound(aBigWireImpl);
- this->setImpl(new TopoDS_Shape(aBigWireImpl));
-}
-
-void GeomAPI_Wire::addEdge(boost::shared_ptr<GeomAPI_Shape> theEdge)
-{
- const TopoDS_Edge& anEdge = theEdge->impl<TopoDS_Edge>();
- if (anEdge.ShapeType() != TopAbs_EDGE)
- return;
- TopoDS_Shape& aWire = const_cast<TopoDS_Shape&>(impl<TopoDS_Shape>());
- BRep_Builder aBuilder;
- aBuilder.Add(aWire, anEdge);
-}
-
-std::list<boost::shared_ptr<GeomAPI_Shape> > GeomAPI_Wire::getEdges()
-{
- TopoDS_Shape& aShape = const_cast<TopoDS_Shape&>(impl<TopoDS_Shape>());
- //BRepTools_WireExplorer aWireExp(TopoDS::Wire(aShape));
- TopExp_Explorer aWireExp(aShape, TopAbs_EDGE);
- std::list<boost::shared_ptr<GeomAPI_Shape> > aResult;
- for (; aWireExp.More(); aWireExp.Next()) {
- boost::shared_ptr<GeomAPI_Shape> anEdge(new GeomAPI_Shape);
- anEdge->setImpl(new TopoDS_Shape(aWireExp.Current()));
- aResult.push_back(anEdge);
- }
- return aResult;
-}
+++ /dev/null
-// File: GeomAPI_Wire.hxx
-// Created: 24 Jul 2014
-// Author: Artem ZHIDKOV
-
-#ifndef GEOMAPI_WIRE_H_
-#define GEOMAPI_WIRE_H_
-
-#include "GeomAPI.h"
-#include "GeomAPI_Edge.h"
-#include "GeomAPI_Pnt.h"
-#include "GeomAPI_Dir.h"
-
-#include <boost/smart_ptr/shared_ptr.hpp>
-
-#include <list>
-
-/**\class GeomAPI_Wire
- * \ingroup DataModel
- * \brief Interface to the edge object
- */
-
-class GeomAPI_Wire : public GeomAPI_Shape
-{
- public:
- /// Creation of empty (null) shape
- GEOMAPI_EXPORT GeomAPI_Wire();
-
- GEOMAPI_EXPORT virtual bool isVertex() const
- {
- return false;
- }
-
- /// Returns whether the shape is an edge
- GEOMAPI_EXPORT virtual bool isEdge() const
- {
- return false;
- }
-
- GEOMAPI_EXPORT void addEdge(boost::shared_ptr<GeomAPI_Shape> theEdge);
- GEOMAPI_EXPORT std::list<boost::shared_ptr<GeomAPI_Shape> > getEdges();
-
- /// Returns True if the wire is defined in a plane
- GEOMAPI_EXPORT bool hasPlane() const { return myOrigin && myNorm && myDirX && myDirY; }
-
- /// Set/Get origin point
- GEOMAPI_EXPORT void setOrigin(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin)
- { myOrigin = theOrigin; }
- GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Pnt> origin() const { return myOrigin; }
-
- /// Set/Get X direction vector
- GEOMAPI_EXPORT void setDirX(const boost::shared_ptr<GeomAPI_Dir>& theDirX) { myDirX = theDirX; }
- GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> dirX() const { return myDirX; }
-
- /// Set/Get Y direction vector
- GEOMAPI_EXPORT void setDirY(const boost::shared_ptr<GeomAPI_Dir>& theDirY) { myDirY = theDirY; }
- GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> dirY() const { return myDirY; }
-
- /// Set/Get Normal direction vector
- GEOMAPI_EXPORT void setNorm(const boost::shared_ptr<GeomAPI_Dir>& theNorm) { myNorm = theNorm; }
- GEOMAPI_EXPORT boost::shared_ptr<GeomAPI_Dir> norm() const { return myNorm; }
-
-private:
- boost::shared_ptr<GeomAPI_Pnt> myOrigin;
- boost::shared_ptr<GeomAPI_Dir> myDirX;
- boost::shared_ptr<GeomAPI_Dir> myDirY;
- boost::shared_ptr<GeomAPI_Dir> myNorm;
-};
-
-#endif
-
// Author: Artem ZHIDKOV
#include <GeomAlgoAPI_SketchBuilder.h>
-#include <GeomAPI_Wire.h>
+#include <GeomAPI_PlanarEdges.h>
#include <set>
const boost::shared_ptr<GeomAPI_Shape>& theWire,
std::list<boost::shared_ptr<GeomAPI_Shape> >& theResultFaces)
{
- boost::shared_ptr<GeomAPI_Wire> aWire = boost::dynamic_pointer_cast<GeomAPI_Wire>(theWire);
+ boost::shared_ptr<GeomAPI_PlanarEdges> aWire = boost::dynamic_pointer_cast<GeomAPI_PlanarEdges>(theWire);
if(!aWire)
return;
// Filter wires, return only faces.
#include <ModelAPI_ResultConstruction.h>
#include <ModelAPI_CompositeFeature.h>
#include <GeomAPI_Shape.h>
-#include <GeomAPI_Wire.h>
+#include <GeomAPI_PlanarEdges.h>
#include <GeomAlgoAPI_SketchBuilder.h>
#include <Events_Error.h>
} else if (aContext->groupName() == ModelAPI_ResultConstruction::group()) {
// construction: identification by the results indexes, recompute faces and
// take the face that more close by the indexes
- boost::shared_ptr<GeomAPI_Wire> aWirePtr = boost::dynamic_pointer_cast<GeomAPI_Wire>(
+ boost::shared_ptr<GeomAPI_PlanarEdges> aWirePtr = boost::dynamic_pointer_cast<GeomAPI_PlanarEdges>(
boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext)->shape());
if (aWirePtr && aWirePtr->hasPlane()) {
// If this is a wire with plane defined thin it is a sketch-like object
#include "ModuleBase_ResultPrs.h"
#include <ModelAPI_Tools.h>
-#include <GeomAPI_Wire.h>
+#include <GeomAPI_PlanarEdges.h>
#include <GeomAlgoAPI_SketchBuilder.h>
#include <BRep_Builder.hxx>
: AIS_Shape(TopoDS_Shape()), myResult(theResult), myIsSketchMode(false)
{
boost::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(theResult);
- boost::shared_ptr<GeomAPI_Wire> aWirePtr =
- boost::dynamic_pointer_cast<GeomAPI_Wire>(aShapePtr);
+ boost::shared_ptr<GeomAPI_PlanarEdges> aWirePtr =
+ boost::dynamic_pointer_cast<GeomAPI_PlanarEdges>(aShapePtr);
if (aWirePtr) {
if (aWirePtr->hasPlane() ) {
// If this is a wire with plane defined thin it is a sketch-like object
#include <GeomAPI_AISObject.h>
#include <GeomAPI_Dir.h>
-#include <GeomAPI_Wire.h>
+#include <GeomAPI_PlanarEdges.h>
#include <GeomAPI_XYZ.h>
#include <GeomDataAPI_Dir.h>
return;
// Collect all edges as one big wire
- boost::shared_ptr<GeomAPI_Wire> aBigWire(new GeomAPI_Wire);
+ boost::shared_ptr<GeomAPI_PlanarEdges> aBigWire(new GeomAPI_PlanarEdges);
std::list<boost::shared_ptr<GeomAPI_Shape> >::const_iterator aShapeIt = aFeaturesPreview.begin();
for (; aShapeIt != aFeaturesPreview.end(); ++aShapeIt) {
aBigWire->addEdge(*aShapeIt);