0030537: Visualization - wrapping text in font text formatter
[occt.git] / src / Prs3d / Prs3d_Arrow.hxx
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
20 #include <Graphic3d_ArrayOfTriangles.hxx>
21 #include <Graphic3d_ArrayOfSegments.hxx>
22 #include <Prs3d_Presentation.hxx>
23
24 class gp_Ax1;
25 class gp_Pnt;
26 class gp_Dir;
27
28 //! Provides class methods to draw an arrow at a given location, along a given direction and using a given angle.
29 class Prs3d_Arrow
30 {
31 public:
32   DEFINE_STANDARD_ALLOC
33
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);
47
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,
56                                                                          const Standard_Real theAngle,
57                                                                          const Standard_Real theLength,
58                                                                          const Standard_Integer theNbSegments);
59
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,
70                                     const Standard_Real theAngle,
71                                     const Standard_Real theLength);
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,
78                     const Standard_Real theAngle,
79                     const Standard_Real theLength)
80   {
81     Draw (thePrs->CurrentGroup(), theLocation, theDirection, theAngle, theLength);
82   }
83
84 };
85
86 #endif // _Prs3d_Arrow_HeaderFile