6a26365d3c7e7ec226417cc454f0b4c556e6e55f
[occt.git] / src / Prs3d / Prs3d_Text.hxx
1 // Created on: 1993-09-14
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_Text_HeaderFile
18 #define _Prs3d_Text_HeaderFile
19
20 #include <gp_Ax2.hxx>
21 #include <Prs3d_Drawer.hxx>
22 #include <Prs3d_Presentation.hxx>
23 #include <Prs3d_TextAspect.hxx>
24
25 class TCollection_ExtendedString;
26 class gp_Pnt;
27
28 //! A framework to define the display of texts.
29 class Prs3d_Text
30 {
31 public:
32
33   DEFINE_STANDARD_ALLOC
34
35   //! Defines the display of the text.
36   //! @param theGroup  group to add primitives
37   //! @param theAspect presentation attributes
38   //! @param theText   text to draw
39   //! @param theAttachmentPoint attachment point
40   Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)& theGroup,
41                                     const Handle(Prs3d_TextAspect)& theAspect,
42                                     const TCollection_ExtendedString& theText,
43                                     const gp_Pnt& theAttachmentPoint);
44
45   //! Draws the text label.
46   //! @param theGroup       group to add primitives
47   //! @param theAspect      presentation attributes
48   //! @param theText        text to draw
49   //! @param theOrientation location and orientation specified in the model 3D space
50   //! @param theHasOwnAnchor 
51   Standard_EXPORT static void Draw (const Handle(Graphic3d_Group)&    theGroup,
52                                     const Handle(Prs3d_TextAspect)&   theAspect,
53                                     const TCollection_ExtendedString& theText,
54                                     const gp_Ax2&                     theOrientation,
55                                     const Standard_Boolean            theHasOwnAnchor = Standard_True);
56
57 public:
58
59   //! Alias to another method Draw() for backward compatibility.
60   Standard_DEPRECATED("Prs3d_Text::Draw() taking Graphic3d_Group should be used instead")
61   static void Draw (const Handle(Prs3d_Presentation)& thePrs,
62                     const Handle(Prs3d_Drawer)& theDrawer,
63                     const TCollection_ExtendedString& theText,
64                     const gp_Pnt& theAttachmentPoint)
65   {
66     Draw (thePrs->CurrentGroup(), theDrawer->TextAspect(), theText, theAttachmentPoint);
67   }
68
69   //! Alias to another method Draw() for backward compatibility.
70   Standard_DEPRECATED("Prs3d_Text::Draw() taking Graphic3d_Group should be used instead")
71   static void Draw (const Handle(Prs3d_Presentation)& thePrs,
72                     const Handle(Prs3d_TextAspect)&   theAspect,
73                     const TCollection_ExtendedString& theText,
74                     const gp_Ax2&                     theOrientation,
75                     const Standard_Boolean            theHasOwnAnchor = Standard_True)
76   {
77     Draw (thePrs->CurrentGroup(), theAspect, theText, theOrientation, theHasOwnAnchor);
78   }
79
80   //! Alias to another method Draw() for backward compatibility.
81   Standard_DEPRECATED("Prs3d_Text::Draw() taking Graphic3d_Group should be used instead")
82   static void Draw (const Handle(Prs3d_Presentation)& thePrs,
83                     const Handle(Prs3d_TextAspect)& theAspect,
84                     const TCollection_ExtendedString& theText,
85                     const gp_Pnt& theAttachmentPoint)
86   {
87     Draw (thePrs->CurrentGroup(), theAspect, theText, theAttachmentPoint);
88   }
89
90 };
91
92 #endif // _Prs3d_Text_HeaderFile