Integration of OCCT 6.5.0 from SVN
[occt.git] / src / Aspect / Aspect_AspectFillArea.cxx
CommitLineData
7fd59977 1
2// File Aspect_AspectFillArea.cxx
3// Created Mars 1992
4// Author NW,JPB,CAL
5// Modified: 15/01/98 ; FMN : Ajout Hidden Line
6
7//-Copyright MatraDatavision 1991,1992
8
9//-Version
10
11//-Design Declaration des variables specifiques au contexte
12// de trace des facettes
13
14//-Warning Un contexte de trace de facette est defini par :
15// - le style de l'interieur de la facette
16// - le style du bord de la facette
17// - la couleur
18
19//-References
20
21//-Language C++ 2.0
22
23//-Declarations
24
25// for the class
26#include <Aspect_AspectFillArea.ixx>
27
28//-Aliases
29
30//-Global data definitions
31
32// -- l'interieur
33// MyInteriorStyle : InteriorStyle;
34// MyInteriorColor : Color;
35
36// -- le bord
37// MyEdgeColor : Color;
38// MyEdgeType : TypeOfLine;
39// MyEdgeWidth : Standard_Real;
40
41// -- les hachures
42// MyHatchStyle : HatchStyle;
43
44
45#define OCC1174 // SAV : 08/01/03 Added back face interior color
46
47//-Constructors
48
49//-Destructors
50
51//-Methods, in order
52
53Aspect_AspectFillArea::Aspect_AspectFillArea () {
54
55 MyInteriorStyle = Aspect_IS_EMPTY;
56 MyInteriorColor = Quantity_NOC_CYAN1;
57#ifdef OCC1174
58 MyBackInteriorColor = Quantity_NOC_CYAN1;
59#endif
60 MyEdgeColor = Quantity_NOC_WHITE;
61 MyEdgeType = Aspect_TOL_SOLID;
62 MyEdgeWidth = 1.0;
63 MyHatchStyle = Aspect_HS_VERTICAL;
64
65}
66
67Aspect_AspectFillArea::Aspect_AspectFillArea (const Aspect_InteriorStyle InteriorStyle, const Quantity_Color& InteriorColor, const Quantity_Color& EdgeColor, const Aspect_TypeOfLine EdgeLineType, const Standard_Real EdgeLineWidth) {
68
69 if (EdgeLineWidth <= 0.0)
70 Aspect_AspectFillAreaDefinitionError::Raise
71 ("Bad value for EdgeLineWidth");
72
73 MyInteriorStyle = InteriorStyle;
74 MyInteriorColor = InteriorColor;
75 MyEdgeColor = EdgeColor;
76 MyEdgeType = EdgeLineType;
77 MyEdgeWidth = EdgeLineWidth;
78 MyHatchStyle = Aspect_HS_VERTICAL;
79
80}
81
82void Aspect_AspectFillArea::SetInteriorStyle (const Aspect_InteriorStyle AStyle) {
83
84 MyInteriorStyle = AStyle;
85
86}
87
88void Aspect_AspectFillArea::SetInteriorColor (const Quantity_Color& AColor) {
89
90 MyInteriorColor = AColor;
91
92}
93
94void Aspect_AspectFillArea::SetBackInteriorColor( const Quantity_Color& color )
95{
96#ifdef OCC1174
97 MyBackInteriorColor = color;
98#endif
99}
100
101void Aspect_AspectFillArea::SetEdgeColor (const Quantity_Color& AColor) {
102
103 MyEdgeColor = AColor;
104
105}
106
107void Aspect_AspectFillArea::SetEdgeLineType (const Aspect_TypeOfLine AType) {
108
109 MyEdgeType = AType;
110
111}
112
113void Aspect_AspectFillArea::SetEdgeWidth (const Standard_Real AWidth) {
114
115 if (AWidth <= 0.0)
116 Aspect_AspectFillAreaDefinitionError::Raise
117 ("Bad value for EdgeLineWidth");
118
119 MyEdgeWidth = AWidth;
120
121}
122
123void Aspect_AspectFillArea::SetHatchStyle (const Aspect_HatchStyle AStyle) {
124
125 MyHatchStyle = AStyle;
126
127}
128
129Aspect_HatchStyle Aspect_AspectFillArea::HatchStyle () const {
130
131 return (MyHatchStyle);
132
133}
134
135void Aspect_AspectFillArea::Values (Aspect_InteriorStyle& AStyle, Quantity_Color& AIntColor, Quantity_Color& AEdgeColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const {
136
137 AStyle = MyInteriorStyle;
138 AIntColor = MyInteriorColor;
139 AEdgeColor = MyEdgeColor;
140 AType = MyEdgeType;
141 AWidth = MyEdgeWidth;
142
143}
144
145void Aspect_AspectFillArea::Values (Aspect_InteriorStyle& AStyle, Quantity_Color& AIntColor, Quantity_Color& BackIntColor, Quantity_Color& AEdgeColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const {
146
147 AStyle = MyInteriorStyle;
148 AIntColor = MyInteriorColor;
149#ifdef OCC1174
150 BackIntColor = MyBackInteriorColor;
151#endif
152 AEdgeColor = MyEdgeColor;
153 AType = MyEdgeType;
154 AWidth = MyEdgeWidth;
155
156}