Commit | Line | Data |
---|---|---|
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 | ||
0d969553 Y |
11 | //-Design Declaration of variables specific to the context |
12 | // of tracing facets | |
7fd59977 | 13 | |
0d969553 Y |
14 | //-Warning Context of tracing facets id defined by: |
15 | // - the style of the interior of the facet | |
16 | // - the style of the border of the facet | |
17 | // - the color | |
7fd59977 | 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 | ||
0d969553 | 32 | // -- interior |
7fd59977 | 33 | // MyInteriorStyle : InteriorStyle; |
34 | // MyInteriorColor : Color; | |
35 | ||
0d969553 | 36 | // -- border |
7fd59977 | 37 | // MyEdgeColor : Color; |
38 | // MyEdgeType : TypeOfLine; | |
39 | // MyEdgeWidth : Standard_Real; | |
40 | ||
0d969553 | 41 | // -- shading |
7fd59977 | 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 | ||
53 | Aspect_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 | ||
67 | Aspect_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 | ||
82 | void Aspect_AspectFillArea::SetInteriorStyle (const Aspect_InteriorStyle AStyle) { | |
83 | ||
84 | MyInteriorStyle = AStyle; | |
85 | ||
86 | } | |
87 | ||
88 | void Aspect_AspectFillArea::SetInteriorColor (const Quantity_Color& AColor) { | |
89 | ||
90 | MyInteriorColor = AColor; | |
91 | ||
92 | } | |
93 | ||
94 | void Aspect_AspectFillArea::SetBackInteriorColor( const Quantity_Color& color ) | |
95 | { | |
96 | #ifdef OCC1174 | |
97 | MyBackInteriorColor = color; | |
98 | #endif | |
99 | } | |
100 | ||
101 | void Aspect_AspectFillArea::SetEdgeColor (const Quantity_Color& AColor) { | |
102 | ||
103 | MyEdgeColor = AColor; | |
104 | ||
105 | } | |
106 | ||
107 | void Aspect_AspectFillArea::SetEdgeLineType (const Aspect_TypeOfLine AType) { | |
108 | ||
109 | MyEdgeType = AType; | |
110 | ||
111 | } | |
112 | ||
113 | void 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 | ||
123 | void Aspect_AspectFillArea::SetHatchStyle (const Aspect_HatchStyle AStyle) { | |
124 | ||
125 | MyHatchStyle = AStyle; | |
126 | ||
127 | } | |
128 | ||
129 | Aspect_HatchStyle Aspect_AspectFillArea::HatchStyle () const { | |
130 | ||
131 | return (MyHatchStyle); | |
132 | ||
133 | } | |
134 | ||
135 | void 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 | ||
145 | void 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 | } |