1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 #include <Prs2d_AspectLine.ixx>
19 #include <Aspect_LineStyle.hxx>
20 #include <Aspect_GenericColorMap.hxx>
21 #include <Aspect_TypeMap.hxx>
22 #include <Aspect_WidthMap.hxx>
24 Prs2d_AspectLine::Prs2d_AspectLine()
26 Prs2d_AspectRoot( Prs2d_AN_LINE ),
28 myColor( Quantity_Color(Quantity_NOC_YELLOW) ),
29 myType( Aspect_TOL_SOLID ),
30 myWidth( Aspect_WOL_THIN ),
31 myInterColor( Quantity_Color(Quantity_NOC_YELLOW) ),
32 myFillType( Graphic2d_TOPF_EMPTY ),
34 myDrawEdge( Standard_True ),
43 Prs2d_AspectLine::Prs2d_AspectLine(
44 const Quantity_NameOfColor aColor,
45 const Aspect_TypeOfLine aType,
46 const Aspect_WidthOfLine aWidth,
47 const Quantity_NameOfColor aIntColor,
48 const Graphic2d_TypeOfPolygonFilling aTypeFill,
49 const Standard_Integer aTile,
50 const Standard_Boolean aDrawEdge )
52 Prs2d_AspectRoot( Prs2d_AN_LINE ),
54 myColor( Quantity_Color(aColor) ),
57 myInterColor( Quantity_Color(aIntColor) ),
58 myFillType( aTypeFill ),
60 myDrawEdge( aDrawEdge ),
68 Prs2d_AspectLine::Prs2d_AspectLine(
69 const Quantity_Color& aColor,
70 const Aspect_TypeOfLine aType,
71 const Aspect_WidthOfLine aWidth,
72 const Quantity_Color& aIntColor,
73 const Graphic2d_TypeOfPolygonFilling aTypeFill,
74 const Standard_Integer aTile,
75 const Standard_Boolean aDrawEdge )
77 Prs2d_AspectRoot( Prs2d_AN_LINE ),
82 myInterColor( aIntColor ),
83 myFillType( aTypeFill ),
85 myDrawEdge( aDrawEdge ),
93 void Prs2d_AspectLine::SetColor(const Quantity_NameOfColor aColor) {
95 SetColor( Quantity_Color(aColor) );
98 void Prs2d_AspectLine::SetColor(const Quantity_Color& aColor) {
100 if ( myColor != aColor ) {
106 void Prs2d_AspectLine::SetType(const Aspect_TypeOfLine aType) {
108 if ( myType != aType ) {
114 void Prs2d_AspectLine::SetWidth(const Aspect_WidthOfLine aWidth) {
116 if ( myWidth != aWidth ) {
122 void Prs2d_AspectLine::SetInterColor(const Quantity_NameOfColor aColor) {
124 SetInterColor( Quantity_Color(aColor) );
127 void Prs2d_AspectLine::SetInterColor(const Quantity_Color& aColor) {
129 if ( myInterColor != aColor ) {
130 myInterColor = aColor;
135 void Prs2d_AspectLine::SetTypeOfFill( const Graphic2d_TypeOfPolygonFilling aType ) {
139 void Prs2d_AspectLine::SetTile( const Standard_Integer aTile ) {
143 void Prs2d_AspectLine::SetDrawEdge( const Standard_Boolean aDrawEdge ) {
144 myDrawEdge = aDrawEdge;
147 void Prs2d_AspectLine::ValuesOfLine( Quantity_Color& aColor,
148 Aspect_TypeOfLine& aType,
149 Aspect_WidthOfLine& aWidth) const{
156 void Prs2d_AspectLine::ValuesOfPoly( Quantity_Color& aColor,
157 Graphic2d_TypeOfPolygonFilling& aType,
158 Standard_Integer& aTile,
159 Standard_Boolean& aDrawEdge ) const {
160 aColor = myInterColor;
163 aDrawEdge = myDrawEdge;
166 Standard_Integer Prs2d_AspectLine::ColorIndex() const {
171 Standard_Integer Prs2d_AspectLine::TypeIndex() const {
176 Standard_Integer Prs2d_AspectLine::WidthIndex() const {
181 Standard_Integer Prs2d_AspectLine::InterColorIndex() const {
183 return myIntColorInd;
186 void Prs2d_AspectLine::SetColorIndex( const Standard_Integer anInd ) {
188 myColorIndex = anInd;
191 void Prs2d_AspectLine::SetTypeIndex( const Standard_Integer anInd ) {
196 void Prs2d_AspectLine::SetWidthIndex( const Standard_Integer anInd ) {
198 myWidthIndex = anInd;
201 void Prs2d_AspectLine::SetIntColorInd( const Standard_Integer anInd ) {
203 myIntColorInd = anInd;