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