0023024: Update headers of OCCT files
[occt.git] / src / Aspect / Aspect_AspectFillArea.cxx
1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20
21 // Modified:    15/01/98 ; FMN : Ajout Hidden Line
22
23
24 //-Version      
25
26 //-Design       Declaration of variables specific to the context
27 //              of tracing facets
28
29 //-Warning      Context of tracing facets id defined by:
30 //              - the style of the interior of the facet
31 //              - the style of the border of the facet
32 //              - the color
33
34 //-References   
35
36 //-Language     C++ 2.0
37
38 //-Declarations
39
40 // for the class
41 #include <Aspect_AspectFillArea.ixx>
42
43 //-Aliases
44
45 //-Global data definitions
46
47 //      -- interior
48 //      MyInteriorStyle :       InteriorStyle;
49 //      MyInteriorColor :       Color;
50
51 //      -- border
52 //      MyEdgeColor     :       Color;
53 //      MyEdgeType      :       TypeOfLine;
54 //      MyEdgeWidth     :       Standard_Real;
55
56 //      -- shading
57 //      MyHatchStyle    :       HatchStyle;
58
59
60 #define OCC1174  // SAV : 08/01/03 Added back face interior color
61
62 //-Constructors
63
64 //-Destructors
65
66 //-Methods, in order
67
68 Aspect_AspectFillArea::Aspect_AspectFillArea () {
69
70         MyInteriorStyle = Aspect_IS_EMPTY;
71         MyInteriorColor = Quantity_NOC_CYAN1;
72 #ifdef OCC1174
73         MyBackInteriorColor = Quantity_NOC_CYAN1;
74 #endif
75         MyEdgeColor     = Quantity_NOC_WHITE;
76         MyEdgeType      = Aspect_TOL_SOLID;
77         MyEdgeWidth     = 1.0;
78         MyHatchStyle    = Aspect_HS_VERTICAL;
79
80 }
81
82 Aspect_AspectFillArea::Aspect_AspectFillArea (const Aspect_InteriorStyle InteriorStyle, const Quantity_Color& InteriorColor, const Quantity_Color& EdgeColor, const Aspect_TypeOfLine EdgeLineType, const Standard_Real EdgeLineWidth) {
83
84         if (EdgeLineWidth <= 0.0)
85                 Aspect_AspectFillAreaDefinitionError::Raise
86                         ("Bad value for EdgeLineWidth");
87
88         MyInteriorStyle = InteriorStyle;
89         MyInteriorColor = InteriorColor;
90         MyEdgeColor     = EdgeColor;
91         MyEdgeType      = EdgeLineType;
92         MyEdgeWidth     = EdgeLineWidth;
93         MyHatchStyle    = Aspect_HS_VERTICAL;
94
95 }
96
97 void Aspect_AspectFillArea::SetInteriorStyle (const Aspect_InteriorStyle AStyle) {
98
99         MyInteriorStyle = AStyle;
100
101 }
102
103 void Aspect_AspectFillArea::SetInteriorColor (const Quantity_Color& AColor) {
104
105         MyInteriorColor = AColor;
106
107 }
108
109 void Aspect_AspectFillArea::SetBackInteriorColor( const Quantity_Color& color )
110 {
111 #ifdef OCC1174
112   MyBackInteriorColor = color;
113 #endif
114 }
115
116 void Aspect_AspectFillArea::SetEdgeColor (const Quantity_Color& AColor) {
117
118         MyEdgeColor     = AColor;
119
120 }
121
122 void Aspect_AspectFillArea::SetEdgeLineType (const Aspect_TypeOfLine AType) {
123
124         MyEdgeType      = AType;
125
126 }
127
128 void Aspect_AspectFillArea::SetEdgeWidth (const Standard_Real AWidth) {
129
130         if (AWidth <= 0.0)
131                 Aspect_AspectFillAreaDefinitionError::Raise
132                         ("Bad value for EdgeLineWidth");
133
134         MyEdgeWidth     = AWidth;
135
136 }
137
138 void Aspect_AspectFillArea::SetHatchStyle (const Aspect_HatchStyle AStyle) {
139
140         MyHatchStyle    = AStyle;
141
142 }
143
144 Aspect_HatchStyle Aspect_AspectFillArea::HatchStyle () const {
145
146         return (MyHatchStyle);
147
148 }
149
150 void Aspect_AspectFillArea::Values (Aspect_InteriorStyle& AStyle, Quantity_Color& AIntColor, Quantity_Color& AEdgeColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const {
151
152         AStyle          = MyInteriorStyle;
153         AIntColor       = MyInteriorColor;
154         AEdgeColor      = MyEdgeColor;
155         AType           = MyEdgeType;
156         AWidth          = MyEdgeWidth;
157
158 }
159
160 void Aspect_AspectFillArea::Values (Aspect_InteriorStyle& AStyle, Quantity_Color& AIntColor, Quantity_Color& BackIntColor, Quantity_Color& AEdgeColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const {
161
162         AStyle          = MyInteriorStyle;
163         AIntColor       = MyInteriorColor;
164 #ifdef OCC1174
165         BackIntColor    = MyBackInteriorColor;
166 #endif
167         AEdgeColor      = MyEdgeColor;
168         AType           = MyEdgeType;
169         AWidth          = MyEdgeWidth;
170
171 }