1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Modified: 15/01/98 ; FMN : Ajout Hidden Line
18 //-Design Declaration of variables specific to the context
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
29 #include <Aspect_AspectFillArea.hxx>
30 #include <Aspect_AspectFillAreaDefinitionError.hxx>
31 #include <Quantity_Color.hxx>
32 #include <Standard_Type.hxx>
34 IMPLEMENT_STANDARD_RTTIEXT(Aspect_AspectFillArea,MMgt_TShared)
37 //-Global data definitions
39 // MyInteriorStyle : InteriorStyle;
40 // MyInteriorColor : Color;
42 // MyEdgeColor : Color;
43 // MyEdgeType : TypeOfLine;
44 // MyEdgeWidth : Standard_Real;
46 // MyHatchStyle : HatchStyle;
50 Aspect_AspectFillArea::Aspect_AspectFillArea () {
52 MyInteriorStyle = Aspect_IS_EMPTY;
53 MyInteriorColor = Quantity_NOC_CYAN1;
54 MyBackInteriorColor = Quantity_NOC_CYAN1;
55 MyEdgeColor = Quantity_NOC_WHITE;
56 MyEdgeType = Aspect_TOL_SOLID;
58 MyHatchStyle = Aspect_HS_VERTICAL;
62 Aspect_AspectFillArea::Aspect_AspectFillArea (const Aspect_InteriorStyle InteriorStyle, const Quantity_Color& InteriorColor, const Quantity_Color& EdgeColor, const Aspect_TypeOfLine EdgeLineType, const Standard_Real EdgeLineWidth) {
64 if (EdgeLineWidth <= 0.0)
65 Aspect_AspectFillAreaDefinitionError::Raise
66 ("Bad value for EdgeLineWidth");
68 MyInteriorStyle = InteriorStyle;
69 MyInteriorColor = InteriorColor;
70 MyEdgeColor = EdgeColor;
71 MyEdgeType = EdgeLineType;
72 MyEdgeWidth = EdgeLineWidth;
73 MyHatchStyle = Aspect_HS_VERTICAL;
77 void Aspect_AspectFillArea::SetInteriorStyle (const Aspect_InteriorStyle AStyle) {
79 MyInteriorStyle = AStyle;
83 void Aspect_AspectFillArea::SetInteriorColor (const Quantity_Color& AColor) {
85 MyInteriorColor = AColor;
89 void Aspect_AspectFillArea::SetBackInteriorColor( const Quantity_Color& color )
91 MyBackInteriorColor = color;
94 void Aspect_AspectFillArea::SetEdgeColor (const Quantity_Color& AColor) {
100 void Aspect_AspectFillArea::SetEdgeLineType (const Aspect_TypeOfLine AType) {
106 void Aspect_AspectFillArea::SetEdgeWidth (const Standard_Real AWidth) {
109 Aspect_AspectFillAreaDefinitionError::Raise
110 ("Bad value for EdgeLineWidth");
112 MyEdgeWidth = AWidth;
116 void Aspect_AspectFillArea::SetHatchStyle (const Aspect_HatchStyle AStyle) {
118 MyHatchStyle = AStyle;
122 Aspect_HatchStyle Aspect_AspectFillArea::HatchStyle () const {
124 return (MyHatchStyle);
128 void Aspect_AspectFillArea::Values (Aspect_InteriorStyle& AStyle, Quantity_Color& AIntColor, Quantity_Color& AEdgeColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const {
130 AStyle = MyInteriorStyle;
131 AIntColor = MyInteriorColor;
132 AEdgeColor = MyEdgeColor;
134 AWidth = MyEdgeWidth;
138 void Aspect_AspectFillArea::Values (Aspect_InteriorStyle& AStyle, Quantity_Color& AIntColor, Quantity_Color& BackIntColor, Quantity_Color& AEdgeColor, Aspect_TypeOfLine& AType, Standard_Real& AWidth) const {
140 AStyle = MyInteriorStyle;
141 AIntColor = MyInteriorColor;
142 BackIntColor = MyBackInteriorColor;
143 AEdgeColor = MyEdgeColor;
145 AWidth = MyEdgeWidth;