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
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 #include <Prs3d_Text.hxx>
20 #include <Graphic3d_Group.hxx>
21 #include <Graphic3d_Vertex.hxx>
22 #include <Prs3d_Presentation.hxx>
23 #include <Prs3d_TextAspect.hxx>
24 #include <TCollection_AsciiString.hxx>
25 #include <TCollection_ExtendedString.hxx>
27 // =======================================================================
30 // =======================================================================
31 void Prs3d_Text::Draw (const Handle(Graphic3d_Group)& theGroup,
32 const Handle(Prs3d_TextAspect)& theAspect,
33 const TCollection_ExtendedString& theText,
34 const gp_Pnt& theAttachmentPoint)
36 Standard_Real x, y, z;
37 theAttachmentPoint.Coord(x,y,z);
39 theGroup->SetPrimitivesAspect (theAspect->Aspect());
40 theGroup->Text (theText,
41 Graphic3d_Vertex(x,y,z),
44 theAspect->Orientation(),
45 theAspect->HorizontalJustification(),
46 theAspect->VerticalJustification());
49 // =======================================================================
52 // =======================================================================
53 void Prs3d_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)
59 theGroup->SetPrimitivesAspect (theAspect->Aspect());
60 theGroup->Text (theText,
64 theAspect->Orientation(),
65 theAspect->HorizontalJustification(),
66 theAspect->VerticalJustification(),