0023663: Removing 2D viewer library
[occt.git] / src / Aspect / Aspect_Driver.cxx
CommitLineData
b311480e 1// Copyright (c) 1995-1999 Matra Datavision
2// Copyright (c) 1999-2012 OPEN CASCADE SAS
3//
4// The content of this file is subject to the Open CASCADE Technology Public
5// License Version 6.5 (the "License"). You may not use the content of this file
6// except in compliance with the License. Please obtain a copy of the License
7// at http://www.opencascade.org and read it completely before using this file.
8//
9// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11//
12// The Original Code and all software distributed under the License is
13// distributed on an "AS IS" basis, without warranty of any kind, and the
14// Initial Developer hereby disclaims all such warranties, including without
15// limitation, any warranties of merchantability, fitness for a particular
16// purpose or non-infringement. Please see the License for the specific terms
17// and conditions governing the rights and limitations under the License.
18
7fd59977 19/***********************************************************************
20
0d969553 21 FUNCTION :
7fd59977 22 ----------
0d969553 23 Class Aspect_Driver :
7fd59977 24
0d969553 25 HISTORY OF MODIFICATIONS :
7fd59977 26 --------------------------------
27
28 14-05-98 : GG ; Disable using MFT when the symbol
29 CSF_MDTVFontDirectory is not defined.
30 See dirMFTisDefined changes.
31
32 30-01-98 : GG ; SPEC_MFT
0d969553
Y
33 Use of polices MFT becomes parameterized.
34 The driver should use method UseMFT() to
35 know if it is necessary or not to use MDTV policies
36 instead of system policies.
7fd59977 37
0d969553
Y
38 -> Modifications in SetFontMap()
39 -> New method UseMFT()
7fd59977 40
41***********************************************************************/
42
43#include <Aspect_Driver.ixx>
44#include <OSD_Environment.hxx>
45
7fd59977 46
47Aspect_Driver::Aspect_Driver () {
48
7fd59977 49 myColorMapIsDefined = Standard_False;
50 myWidthMapIsDefined = Standard_False;
51 myTypeMapIsDefined = Standard_False;
52 myFontMapIsDefined = Standard_False;
53}
54
55
56void Aspect_Driver::SetColorMap (const Handle(Aspect_ColorMap)& aColorMap)
57 {
58 myColorMap = aColorMap;
59 this->InitializeColorMap(aColorMap);
60 myColorMapIsDefined = Standard_True;
61}
62Handle(Aspect_ColorMap) Aspect_Driver::ColorMap () const {
63
64 Aspect_UndefinedMap_Raise_if(!myColorMapIsDefined,"ColorMap");
65 return myColorMap;
66}
67
68
69void Aspect_Driver::SetTypeMap (const Handle(Aspect_TypeMap)& aTypeMap)
70 {
71 myTypeMap = aTypeMap;
72 this->InitializeTypeMap(aTypeMap);
73 myTypeMapIsDefined = Standard_True;
74}
75Handle(Aspect_TypeMap) Aspect_Driver::TypeMap () const {
76
77 Aspect_UndefinedMap_Raise_if(!myTypeMapIsDefined,"TypeMap");
78 return myTypeMap;
79}
80
81void Aspect_Driver::SetWidthMap (const Handle(Aspect_WidthMap)& aWidthMap)
82 {
83 myWidthMap = aWidthMap;
84 this->InitializeWidthMap(aWidthMap);
85 myWidthMapIsDefined = Standard_True;
86}
87Handle(Aspect_WidthMap) Aspect_Driver::WidthMap () const {
88
89 Aspect_UndefinedMap_Raise_if(!myWidthMapIsDefined,"WidthMap");
90 return myWidthMap;
91}
92
128cc8df 93void Aspect_Driver::SetFontMap (const Handle(Aspect_FontMap)& aFontMap)
7fd59977 94 {
7fd59977 95 myFontMap = aFontMap;
96 this->InitializeFontMap(aFontMap);
97 myFontMapIsDefined = Standard_True;
98}
99Handle(Aspect_FontMap) Aspect_Driver::FontMap () const {
100
101 Aspect_UndefinedMap_Raise_if(!myFontMapIsDefined,"FontMap");
102 return myFontMap;
103}
104
105void Aspect_Driver::SetMarkMap (const Handle(Aspect_MarkMap)& aMarkMap)
106 {
107 myMarkMap = aMarkMap;
108 this->InitializeMarkMap(aMarkMap);
109 myMarkMapIsDefined = Standard_True;
110}
111Handle(Aspect_MarkMap) Aspect_Driver::MarkMap () const {
112
113 Aspect_UndefinedMap_Raise_if(!myMarkMapIsDefined,"MarkMap");
114 return myMarkMap;
115}
116