1 // Created on: 1995-08-04
2 // Created by: Modelistation
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _StdPrs_Curve_HeaderFile
18 #define _StdPrs_Curve_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Prs3d_Root.hxx>
25 #include <Prs3d_Drawer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Real.hxx>
28 #include <TColgp_SequenceOfPnt.hxx>
29 #include <Standard_Integer.hxx>
30 class Prs3d_Presentation;
31 class Adaptor3d_Curve;
34 //! A framework to define display of lines, arcs of circles
35 //! and conic sections.
36 //! This is done with a fixed number of points, which can be modified.
37 class StdPrs_Curve : public Prs3d_Root
44 //! Adds to the presentation aPresentation the drawing of the curve aCurve.
45 //! The aspect is defined by LineAspect in aDrawer.
46 //! If drawCurve equals Standard_False the curve will not be displayed,
47 //! it is used if the curve is a part of some shape and PrimitiveArray
48 //! visualization approach is activated (it is activated by default).
49 Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& aPresentation, const Adaptor3d_Curve& aCurve, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Boolean drawCurve = Standard_True);
51 //! Adds to the presentation aPresentation the drawing of the curve aCurve.
52 //! The aspect is defined by LineAspect in aDrawer.
53 //! The drawing will be limited between the points of parameter U1 and U2.
54 //! If drawCurve equals Standard_False the curve will not be displayed,
55 //! it is used if the curve is a part of some shape and PrimitiveArray
56 //! visualization approach is activated (it is activated by default).
57 Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& aPresentation, const Adaptor3d_Curve& aCurve, const Standard_Real U1, const Standard_Real U2, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Boolean drawCurve = Standard_True);
59 //! adds to the presentation aPresentation the drawing of the curve aCurve.
60 //! The aspect is the current aspect.
61 //! aDeflection is used in the circle case.
62 //! Points give a sequence of curve points.
63 //! If drawCurve equals Standard_False the curve will not be displayed,
64 //! it is used if the curve is a part of some shape and PrimitiveArray
65 //! visualization approach is activated (it is activated by default).
66 Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& aPresentation, const Adaptor3d_Curve& aCurve, const Handle(Prs3d_Drawer)& aDrawer, TColgp_SequenceOfPnt& Points, const Standard_Boolean drawCurve = Standard_True);
68 //! adds to the presentation aPresentation the drawing of the curve
70 //! The aspect is the current aspect.
71 //! The drawing will be limited between the points of parameter
73 //! aDeflection is used in the circle case.
74 //! Points give a sequence of curve points.
75 //! If drawCurve equals Standard_False the curve will not be displayed,
76 //! it is used if the curve is a part of some shape and PrimitiveArray
77 //! visualization approach is activated (it is activated by default).
78 Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& aPresentation, const Adaptor3d_Curve& aCurve, const Standard_Real U1, const Standard_Real U2, TColgp_SequenceOfPnt& Points, const Standard_Integer aNbPoints = 30, const Standard_Boolean drawCurve = Standard_True);
80 //! returns true if the distance between the point (X,Y,Z) and the
81 //! drawing of the curve is less than aDistance.
82 Standard_EXPORT static Standard_Boolean Match (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real aDistance, const Adaptor3d_Curve& aCurve, const Handle(Prs3d_Drawer)& aDrawer);
84 //! returns true if the distance between the point (X,Y,Z) and the
85 //! drawing of the curve is less than aDistance.
86 Standard_EXPORT static Standard_Boolean Match (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real aDistance, const Adaptor3d_Curve& aCurve, const Standard_Real aDeflection, const Standard_Real aLimit, const Standard_Integer aNbPoints);
88 //! returns true if the distance between the point (X,Y,Z) and the
89 //! drawing of the curve aCurve is less than aDistance.
90 //! The drawing is considered between the points
91 //! of parameter U1 and U2;
92 Standard_EXPORT static Standard_Boolean Match (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real aDistance, const Adaptor3d_Curve& aCurve, const Standard_Real U1, const Standard_Real U2, const Handle(Prs3d_Drawer)& aDrawer);
94 //! returns true if the distance between the point (X,Y,Z) and the
95 //! drawing of the curve aCurve is less than aDistance.
96 //! The drawing is considered between the points
97 //! of parameter U1 and U2;
98 Standard_EXPORT static Standard_Boolean Match (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real aDistance, const Adaptor3d_Curve& aCurve, const Standard_Real U1, const Standard_Real U2, const Standard_Real aDeflection, const Standard_Integer aNbPoints);
102 #endif // _StdPrs_Curve_HeaderFile