0025180: Visualization - Homogeneous transformation API in TKV3d
[occt.git] / src / Prs3d / Prs3d_TextAspect.cxx
CommitLineData
b311480e 1// Created on: 1993-09-14
2// Created by: Jean-Louis FRENKEL
3// Copyright (c) 1993-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
42cf5bc1 17
aff395a3 18#include <Font_NameOfFont.hxx>
42cf5bc1 19#include <Graphic3d_AspectText3d.hxx>
20#include <Prs3d_TextAspect.hxx>
21#include <Quantity_Color.hxx>
22#include <Standard_Type.hxx>
7fd59977 23
92efcf78 24IMPLEMENT_STANDARD_RTTIEXT(Prs3d_TextAspect,Prs3d_BasicAspect)
25
7fd59977 26Prs3d_TextAspect::Prs3d_TextAspect ()
27: myAngle(0.),
28 myHeight(16.),
29 myHorizontalJustification(Graphic3d_HTA_LEFT),
30 myVerticalJustification(Graphic3d_VTA_BOTTOM),
31 myOrientation(Graphic3d_TP_RIGHT) {
32
33 myTextAspect = new Graphic3d_AspectText3d (
34 Quantity_Color(Quantity_NOC_YELLOW),
aff395a3 35 Font_NOF_ASCII_TRIPLEX,
7fd59977 36 1.,
37 0.);
38}
39
1a75746e 40Prs3d_TextAspect::Prs3d_TextAspect( const Handle( Graphic3d_AspectText3d )& theAspect )
41: myAngle(0.),
42 myHeight(16.),
43 myHorizontalJustification(Graphic3d_HTA_LEFT),
44 myVerticalJustification(Graphic3d_VTA_BOTTOM),
45 myOrientation(Graphic3d_TP_RIGHT)
46{
47 myTextAspect = theAspect;
48}
49
50
7fd59977 51void Prs3d_TextAspect::SetColor(const Quantity_Color &aColor) {
52 myTextAspect->SetColor(aColor);
53}
7fd59977 54
55void Prs3d_TextAspect::SetColor(const Quantity_NameOfColor aColor) {
56 myTextAspect->SetColor(Quantity_Color(aColor));
57}
58
59void Prs3d_TextAspect::SetFont(const Standard_CString aFont) {
60 myTextAspect->SetFont(aFont);
61}
62
63void Prs3d_TextAspect::SetHeightWidthRatio(const Standard_Real aRatio) {
64 myTextAspect->SetExpansionFactor(aRatio);
65}
66
67void Prs3d_TextAspect::SetSpace(const Quantity_Length aSpace) {
68 myTextAspect->SetSpace(aSpace);
69}
70
71void Prs3d_TextAspect::SetHeight(const Standard_Real aHeight) {
72 myHeight = aHeight;
73}
74
75void Prs3d_TextAspect::SetAngle(const Quantity_PlaneAngle anAngle) {
76 myAngle = anAngle;
77}
78
79void Prs3d_TextAspect::SetHorizontalJustification(const Graphic3d_HorizontalTextAlignment aJustification) {
80 myHorizontalJustification = aJustification;
81}
82
83
84void Prs3d_TextAspect::SetVerticalJustification(const Graphic3d_VerticalTextAlignment aJustification) {
85 myVerticalJustification = aJustification;
86}
87
88void Prs3d_TextAspect::SetOrientation(const Graphic3d_TextPath anOrientation) {
89
90 myOrientation = anOrientation;
91}
92
93Standard_Real Prs3d_TextAspect::Height () const {return myHeight;}
94
95Quantity_PlaneAngle Prs3d_TextAspect::Angle () const {return myAngle;}
96
97Graphic3d_HorizontalTextAlignment Prs3d_TextAspect::HorizontalJustification () const { return myHorizontalJustification;}
98
99Graphic3d_VerticalTextAlignment Prs3d_TextAspect::VerticalJustification () const { return myVerticalJustification;}
100
101Graphic3d_TextPath Prs3d_TextAspect::Orientation () const {return myOrientation;}
102
103Handle(Graphic3d_AspectText3d) Prs3d_TextAspect::Aspect() const {
104 return myTextAspect;
105}
1a75746e 106
107void Prs3d_TextAspect::SetAspect( const Handle( Graphic3d_AspectText3d )& theAspect )
108{
109 myTextAspect = theAspect;
110}