42cf5bc1 |
1 | // Created on: 1993-04-15 |
2 | // Created by: Jean-Louis Frenkel |
3 | // Copyright (c) 1993-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Prs3d_Arrow_HeaderFile |
18 | #define _Prs3d_Arrow_HeaderFile |
19 | |
42cf5bc1 |
20 | #include <Prs3d_Root.hxx> |
62ef08df |
21 | |
22 | #include <Graphic3d_ArrayOfTriangles.hxx> |
bc001a40 |
23 | #include <Graphic3d_ArrayOfSegments.hxx> |
4ad142d9 |
24 | |
62ef08df |
25 | class gp_Ax1; |
42cf5bc1 |
26 | class gp_Pnt; |
27 | class gp_Dir; |
28 | |
4ad142d9 |
29 | //! Provides class methods to draw an arrow at a given location, along a given direction and using a given angle. |
30 | class Prs3d_Arrow : public Prs3d_Root |
42cf5bc1 |
31 | { |
32 | public: |
33 | |
62ef08df |
34 | //! Defines the representation of the arrow as shaded triangulation. |
35 | //! @param theAxis axis definition (arrow origin and direction) |
36 | //! @param theTubeRadius tube (cylinder) radius |
37 | //! @param theAxisLength overall arrow length (cylinder + cone) |
38 | //! @param theConeRadius cone radius (arrow tip) |
39 | //! @param theConeLength cone length (arrow tip) |
40 | //! @param theNbFacettes tessellation quality for each part |
41 | Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) DrawShaded (const gp_Ax1& theAxis, |
42 | const Standard_Real theTubeRadius, |
43 | const Standard_Real theAxisLength, |
44 | const Standard_Real theConeRadius, |
45 | const Standard_Real theConeLength, |
46 | const Standard_Integer theNbFacettes); |
42cf5bc1 |
47 | |
bc001a40 |
48 | //! Defines the representation of the arrow as a container of segments. |
49 | //! @param theLocation location of the arrow tip |
50 | //! @param theDir direction of the arrow |
51 | //! @param theAngle angle of opening of the arrow head |
52 | //! @param theLength length of the arrow (from the tip) |
53 | //! @param theNbSegments count of points on polyline where location is connected |
54 | Standard_EXPORT static Handle(Graphic3d_ArrayOfSegments) DrawSegments (const gp_Pnt& theLocation, |
55 | const gp_Dir& theDir, |
ee2be2a8 |
56 | const Standard_Real theAngle, |
57 | const Standard_Real theLength, |
bc001a40 |
58 | const Standard_Integer theNbSegments); |
59 | |
4ad142d9 |
60 | //! Defines the representation of the arrow. |
61 | //! Note that this method does NOT assign any presentation aspects to the primitives group! |
62 | //! @param theGroup presentation group to add primitives |
63 | //! @param theLocation location of the arrow tip |
64 | //! @param theDirection direction of the arrow |
65 | //! @param theAngle angle of opening of the arrow head |
66 | //! @param theLength length of the arrow (from the tip) |
67 | Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)& theGroup, |
68 | const gp_Pnt& theLocation, |
69 | const gp_Dir& theDirection, |
ee2be2a8 |
70 | const Standard_Real theAngle, |
71 | const Standard_Real theLength); |
4ad142d9 |
72 | |
73 | //! Alias to another method Draw() for backward compatibility. |
74 | Standard_DEPRECATED("Prs3d_Arrow::Draw() taking Graphic3d_Group should be used instead") |
75 | static void Draw (const Handle(Prs3d_Presentation)& thePrs, |
76 | const gp_Pnt& theLocation, |
77 | const gp_Dir& theDirection, |
ee2be2a8 |
78 | const Standard_Real theAngle, |
79 | const Standard_Real theLength) |
4ad142d9 |
80 | { |
81 | Draw (Prs3d_Root::CurrentGroup (thePrs), theLocation, theDirection, theAngle, theLength); |
82 | } |
42cf5bc1 |
83 | |
84 | }; |
85 | |
42cf5bc1 |
86 | #endif // _Prs3d_Arrow_HeaderFile |