Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created by: NW,JPB,CAL |
2 | // Copyright (c) 1991-1999 Matra Datavision | |
973c2be1 | 3 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e | 4 | // |
973c2be1 | 5 | // This file is part of Open CASCADE Technology software library. |
b311480e | 6 | // |
d5f74e42 | 7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
11 | // distribution for complete text of the license and disclaimer of any warranty. | |
b311480e | 12 | // |
973c2be1 | 13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. | |
7fd59977 | 15 | |
7fd59977 | 16 | // Modified: 15/01/98 ; FMN : Ajout Hidden Line |
7fd59977 | 17 | //-Version |
0d969553 Y |
18 | //-Design Declaration of variables specific to the context |
19 | // of tracing facets | |
0d969553 Y |
20 | //-Warning Context of tracing facets id defined by: |
21 | // - the style of the interior of the facet | |
22 | // - the style of the border of the facet | |
23 | // - the color | |
7fd59977 | 24 | //-References |
7fd59977 | 25 | //-Language C++ 2.0 |
7fd59977 | 26 | //-Declarations |
7fd59977 | 27 | // for the class |
7fd59977 | 28 | |
42cf5bc1 | 29 | #include <Aspect_AspectFillArea.hxx> |
30 | #include <Aspect_AspectFillAreaDefinitionError.hxx> | |
31 | #include <Quantity_Color.hxx> | |
32 | #include <Standard_Type.hxx> | |
7fd59977 | 33 | |
42cf5bc1 | 34 | //-Aliases |
7fd59977 | 35 | //-Global data definitions |
0d969553 | 36 | // -- interior |
7fd59977 | 37 | // MyInteriorStyle : InteriorStyle; |
38 | // MyInteriorColor : Color; | |
0d969553 | 39 | // -- border |
7fd59977 | 40 | // MyEdgeColor : Color; |
41 | // MyEdgeType : TypeOfLine; | |
42 | // MyEdgeWidth : Standard_Real; | |
0d969553 | 43 | // -- shading |
7fd59977 | 44 | // MyHatchStyle : HatchStyle; |
7fd59977 | 45 | //-Constructors |
7fd59977 | 46 | //-Destructors |
7fd59977 | 47 | //-Methods, in order |
7fd59977 | 48 | Aspect_AspectFillArea::Aspect_AspectFillArea () { |
49 | ||
50 | MyInteriorStyle = Aspect_IS_EMPTY; | |
51 | MyInteriorColor = Quantity_NOC_CYAN1; | |
7fd59977 | 52 | MyBackInteriorColor = Quantity_NOC_CYAN1; |
7fd59977 | 53 | MyEdgeColor = Quantity_NOC_WHITE; |
54 | MyEdgeType = Aspect_TOL_SOLID; | |
55 | MyEdgeWidth = 1.0; | |
56 | MyHatchStyle = Aspect_HS_VERTICAL; | |
57 | ||
58 | } | |
59 | ||
60 | Aspect_AspectFillArea::Aspect_AspectFillArea (const Aspect_InteriorStyle InteriorStyle, const Quantity_Color& InteriorColor, const Quantity_Color& EdgeColor, const Aspect_TypeOfLine EdgeLineType, const Standard_Real EdgeLineWidth) { | |
61 | ||
62 | if (EdgeLineWidth <= 0.0) | |
63 | Aspect_AspectFillAreaDefinitionError::Raise | |
64 | ("Bad value for EdgeLineWidth"); | |
65 | ||
66 | MyInteriorStyle = InteriorStyle; | |
67 | MyInteriorColor = InteriorColor; | |
68 | MyEdgeColor = EdgeColor; | |
69 | MyEdgeType = EdgeLineType; | |
70 | MyEdgeWidth = EdgeLineWidth; | |
71 | MyHatchStyle = Aspect_HS_VERTICAL; | |
72 | ||
73 | } | |
74 | ||
75 | void Aspect_AspectFillArea::SetInteriorStyle (const Aspect_InteriorStyle AStyle) { | |
76 | ||
77 | MyInteriorStyle = AStyle; | |
78 | ||
79 | } | |
80 | ||
81 | void Aspect_AspectFillArea::SetInteriorColor (const Quantity_Color& AColor) { | |
82 | ||
83 | MyInteriorColor = AColor; | |
84 | ||
85 | } | |
86 | ||
87 | void Aspect_AspectFillArea::SetBackInteriorColor( const Quantity_Color& color ) | |
88 | { | |
7fd59977 | 89 | MyBackInteriorColor = color; |
7fd59977 | 90 | } |
91 | ||
92 | void Aspect_AspectFillArea::SetEdgeColor (const Quantity_Color& AColor) { | |
93 | ||
94 | MyEdgeColor = AColor; | |
95 | ||
96 | } | |
97 | ||
98 | void Aspect_AspectFillArea::SetEdgeLineType (const Aspect_TypeOfLine AType) { | |
99 | ||
100 | MyEdgeType = AType; | |
101 | ||
102 | } | |
103 | ||
104 | void Aspect_AspectFillArea::SetEdgeWidth (const Standard_Real AWidth) { | |
105 | ||
106 | if (AWidth <= 0.0) | |
107 | Aspect_AspectFillAreaDefinitionError::Raise | |
108 | ("Bad value for EdgeLineWidth"); | |
109 | ||
110 | MyEdgeWidth = AWidth; | |
111 | ||
112 | } | |
113 | ||
114 | void Aspect_AspectFillArea::SetHatchStyle (const Aspect_HatchStyle AStyle) { | |
115 | ||
116 | MyHatchStyle = AStyle; | |
117 | ||
118 | } | |
119 | ||
120 | Aspect_HatchStyle Aspect_AspectFillArea::HatchStyle () const { | |
121 | ||
122 | return (MyHatchStyle); | |
123 | ||
124 | } | |
125 | ||
126 | void Aspect_AspectFillArea::Values (Aspect_InteriorStyle& AStyle, Quantity_Color& AIntColor, Quantity_Color& AEdgeColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const { | |
127 | ||
128 | AStyle = MyInteriorStyle; | |
129 | AIntColor = MyInteriorColor; | |
130 | AEdgeColor = MyEdgeColor; | |
131 | AType = MyEdgeType; | |
132 | AWidth = MyEdgeWidth; | |
133 | ||
134 | } | |
135 | ||
136 | void Aspect_AspectFillArea::Values (Aspect_InteriorStyle& AStyle, Quantity_Color& AIntColor, Quantity_Color& BackIntColor, Quantity_Color& AEdgeColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const { | |
137 | ||
138 | AStyle = MyInteriorStyle; | |
139 | AIntColor = MyInteriorColor; | |
7fd59977 | 140 | BackIntColor = MyBackInteriorColor; |
7fd59977 | 141 | AEdgeColor = MyEdgeColor; |
142 | AType = MyEdgeType; | |
143 | AWidth = MyEdgeWidth; | |
144 | ||
145 | } |