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
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 _Prs3d_Arrow_HeaderFile
18 #define _Prs3d_Arrow_HeaderFile
20 #include <Prs3d_Root.hxx>
22 #include <Graphic3d_ArrayOfTriangles.hxx>
23 #include <Quantity_PlaneAngle.hxx>
24 #include <Quantity_Length.hxx>
30 //! Provides class methods to draw an arrow at a given location, along a given direction and using a given angle.
31 class Prs3d_Arrow : public Prs3d_Root
35 //! Defines the representation of the arrow as shaded triangulation.
36 //! @param theAxis axis definition (arrow origin and direction)
37 //! @param theTubeRadius tube (cylinder) radius
38 //! @param theAxisLength overall arrow length (cylinder + cone)
39 //! @param theConeRadius cone radius (arrow tip)
40 //! @param theConeLength cone length (arrow tip)
41 //! @param theNbFacettes tessellation quality for each part
42 Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) DrawShaded (const gp_Ax1& theAxis,
43 const Standard_Real theTubeRadius,
44 const Standard_Real theAxisLength,
45 const Standard_Real theConeRadius,
46 const Standard_Real theConeLength,
47 const Standard_Integer theNbFacettes);
49 //! Defines the representation of the arrow.
50 //! Note that this method does NOT assign any presentation aspects to the primitives group!
51 //! @param theGroup presentation group to add primitives
52 //! @param theLocation location of the arrow tip
53 //! @param theDirection direction of the arrow
54 //! @param theAngle angle of opening of the arrow head
55 //! @param theLength length of the arrow (from the tip)
56 Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)& theGroup,
57 const gp_Pnt& theLocation,
58 const gp_Dir& theDirection,
59 const Quantity_PlaneAngle theAngle,
60 const Quantity_Length theLength);
62 //! Alias to another method Draw() for backward compatibility.
63 Standard_DEPRECATED("Prs3d_Arrow::Draw() taking Graphic3d_Group should be used instead")
64 static void Draw (const Handle(Prs3d_Presentation)& thePrs,
65 const gp_Pnt& theLocation,
66 const gp_Dir& theDirection,
67 const Quantity_PlaneAngle theAngle,
68 const Quantity_Length theLength)
70 Draw (Prs3d_Root::CurrentGroup (thePrs), theLocation, theDirection, theAngle, theLength);
75 #endif // _Prs3d_Arrow_HeaderFile