1 // Created by: CKY / Contract Toubro-Larsen
2 // Copyright (c) 1993-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 //--------------------------------------------------------------------
17 //--------------------------------------------------------------------
19 #include <gp_GTrsf.hxx>
22 #include <IGESGraph_TextDisplayTemplate.hxx>
23 #include <IGESGraph_TextFontDef.hxx>
24 #include <Standard_Type.hxx>
26 IMPLEMENT_STANDARD_RTTIEXT(IGESGraph_TextDisplayTemplate,IGESData_IGESEntity)
28 IGESGraph_TextDisplayTemplate::IGESGraph_TextDisplayTemplate () { }
31 void IGESGraph_TextDisplayTemplate::Init
32 (const Standard_Real aWidth,
33 const Standard_Real aHeight,
34 const Standard_Integer aFontCode,
35 const Handle(IGESGraph_TextFontDef)& aFontEntity,
36 const Standard_Real aSlantAngle,
37 const Standard_Real aRotationAngle,
38 const Standard_Integer aMirrorFlag,
39 const Standard_Integer aRotationFlag,
40 const gp_XYZ& aCorner)
43 theBoxHeight = aHeight;
44 theFontCode = aFontCode;
45 theFontEntity = aFontEntity;
46 theSlantAngle = aSlantAngle;
47 theRotationAngle = aRotationAngle;
48 theMirrorFlag = aMirrorFlag;
49 theRotateFlag = aRotationFlag;
51 InitTypeAndForm(312,FormNumber()); // FormNumber 0-1 : Incremental status
54 void IGESGraph_TextDisplayTemplate::SetIncremental (const Standard_Boolean F)
56 InitTypeAndForm(312, (F ? 1 : 0));
60 Standard_Real IGESGraph_TextDisplayTemplate::BoxWidth () const
65 Standard_Real IGESGraph_TextDisplayTemplate::BoxHeight () const
70 Standard_Boolean IGESGraph_TextDisplayTemplate::IsFontEntity () const
72 return (! theFontEntity.IsNull());
75 Standard_Integer IGESGraph_TextDisplayTemplate::FontCode () const
80 Handle(IGESGraph_TextFontDef) IGESGraph_TextDisplayTemplate::FontEntity () const
85 Standard_Real IGESGraph_TextDisplayTemplate::SlantAngle () const
90 Standard_Real IGESGraph_TextDisplayTemplate::RotationAngle () const
92 return theRotationAngle;
95 Standard_Integer IGESGraph_TextDisplayTemplate::MirrorFlag () const
100 Standard_Integer IGESGraph_TextDisplayTemplate::RotateFlag () const
102 return theRotateFlag;
105 Standard_Boolean IGESGraph_TextDisplayTemplate::IsIncremental () const
107 return ( FormNumber() == 1 );
110 gp_Pnt IGESGraph_TextDisplayTemplate::StartingCorner () const
112 return ( gp_Pnt(theCorner) );
115 gp_Pnt IGESGraph_TextDisplayTemplate::TransformedStartingCorner () const
117 gp_XYZ TempXYZ = theCorner;
118 if (HasTransf()) Location().Transforms(TempXYZ);
119 return ( gp_Pnt(TempXYZ) );