20 #ifndef CURVECREATOR_UTILS_H
21 #define CURVECREATOR_UTILS_H
26 #include <AIS_InteractiveContext.hxx>
27 #include <AIS_InteractiveObject.hxx>
28 #include <V3d_View.hxx>
30 #include <Geom_Curve.hxx>
31 #include <TopoDS_Shape.hxx>
32 #include <TopoDS_Wire.hxx>
33 #include <TColgp_HArray1OfPnt.hxx>
34 #include <Geom_BSplineCurve.hxx>
39 #include <NCollection_IndexedDataMap.hxx>
84 Handle(V3d_View) theView );
93 TopoDS_Shape& theShape,
94 NCollection_IndexedDataMap<int, TopoDS_Shape>* Sect2Shape = NULL);
105 (
const TopoDS_Shape theShape,
125 Handle(AIS_InteractiveContext) theContext,
138 Handle(AIS_InteractiveContext) theContext,
139 const bool theOpen );
152 const int theX,
const int theY,
153 gp_Pnt& thePoint, gp_Pnt& thePoint1,
167 const Standard_Boolean theIsClosed,
168 Handle(Geom_BSplineCurve)& theBSpline );
174 Handle(TColgp_HArray1OfPnt) thePoints,
175 const bool theIsPolyline,
176 const bool theIsClosed);
188 const int theX,
const int theY,
189 const Handle(Geom_Curve)& theCurve,
190 Standard_Real& theParameter,
204 const int theOtherX,
const int theOtherY,
205 const double theTolerance,
int& theDelta );
215 const gp_Pnt& theOtherPoint );
227 static Handle(TColgp_HArray1OfPnt) getPoints
228 (
const TopoDS_Shape &theShape,
250 Standard_Integer &thePlnStatus);
#define CURVECREATOR_EXPORT
Definition: CurveCreator_Macro.hxx:41
The CurveCreator_Curve object is represented as one or more sets of connected points; thus CurveCreat...
Definition: CurveCreator_Curve.hxx:51
The CurveCreator_ICurve object is represented as one or more sets of connected points; thus CurveCrea...
Definition: CurveCreator_ICurve.hxx:73
std::deque< SectionToPoint > SectionToPointList
Definition: CurveCreator_ICurve.hxx:76
Definition: CurveCreator_Utils.hxx:45
static void setLocalPointContext(const CurveCreator_ICurve *theCurve, Handle(AIS_InteractiveContext) theContext, const bool theOpen)
Sets the local point context for the 3D viewer.
Definition: CurveCreator_Utils.cxx:700
static void constructShape(const CurveCreator_ICurve *theCurve, TopoDS_Shape &theShape, NCollection_IndexedDataMap< int, TopoDS_Shape > *Sect2Shape=NULL)
Generates shape on the curve.
Definition: CurveCreator_Utils.cxx:297
static void setSelectedPoints(Handle(AIS_InteractiveContext) theContext, const CurveCreator_ICurve *theCurve, const CurveCreator_ICurve::SectionToPointList &thePoints=CurveCreator_ICurve::SectionToPointList())
Set selected points to the context.
Definition: CurveCreator_Utils.cxx:628
static bool constructCurve(const TopoDS_Shape theShape, CurveCreator_Curve *theCurve, gp_Ax3 &theLocalCS)
Generates a curve from a shape.
Definition: CurveCreator_Utils.cxx:395
static Quantity_Color colorConv(QColor color)
Convert QColor to Quantity_Color.
Definition: CurveCreator_Utils.cxx:379
static void FindPlane(const Handle(TColgp_HArray1OfPnt) &thePoints, gp_Pln &thePlane, Standard_Integer &thePlnStatus)
This method computes a plane using the input points.
Definition: CurveCreator_Utils.cxx:1027
static void getSelectedPoints(Handle(AIS_InteractiveContext) theContext, const CurveCreator_ICurve *theCurve, CurveCreator_ICurve::SectionToPointList &thePoints)
Find selected points in the context.
Definition: CurveCreator_Utils.cxx:592
static bool & IsClosed
Definition: CurveCreator_Utils.hxx:229
static Handle(TColgp_HArray1OfPnt) getPoints(const TopoDS_Shape &theShape
Returns the array of points of a shape to construct a curve section.
static Quantity_Color getRandColor()
Generates a random color.
Definition: CurveCreator_Utils.cxx:363
static bool pointOnObject(Handle(V3d_View) theView, Handle(AIS_InteractiveObject) theObject, const int theX, const int theY, gp_Pnt &thePoint, gp_Pnt &thePoint1, gp_Pnt &thePoint2)
Checks whether the point belongs to the OCC object.
Definition: CurveCreator_Utils.cxx:726
static bool bool & IsBSpline
Definition: CurveCreator_Utils.hxx:230
static bool constructBSpline(const Handle(TColgp_HArray1OfPnt)&thePoints, const Standard_Boolean theIsClosed, Handle(Geom_BSplineCurve)&theBSpline)
The algorithm builds the cubic B-spline passing through the points that the tangent vector in each gi...
Definition: CurveCreator_Utils.cxx:190
static TopoDS_Wire ConstructWire(Handle(TColgp_HArray1OfPnt) thePoints, const bool theIsPolyline, const bool theIsClosed)
Constructs the wire corresponding to the section.
Definition: CurveCreator_Utils.cxx:256
static bool hasProjectPointOnCurve(Handle(V3d_View) theView, const int theX, const int theY, const Handle(Geom_Curve)&theCurve, Standard_Real &theParameter, int &theDelta)
Definition: CurveCreator_Utils.cxx:819
static gp_Pnt ConvertClickToPoint(int x, int y, Handle(V3d_View) theView)
Returns the point clicked in 3D view.
Definition: CurveCreator_Utils.cxx:140
static bool isEqualPixels(const int theX, const int theY, const int theOtherX, const int theOtherY, const double theTolerance, int &theDelta)
Definition: CurveCreator_Utils.cxx:847
static void ConvertPointToClick(const gp_Pnt &thePoint, Handle(V3d_View) theView, int &x, int &y)
Returns the point clicked in 3D view.
Definition: CurveCreator_Utils.cxx:128
static bool isEqualPoints(const gp_Pnt &thePoint, const gp_Pnt &theOtherPoint)
Definition: CurveCreator_Utils.cxx:858