summaryrefslogtreecommitdiff
path: root/src/Prs2d/Prs2d_AspectLine.cxx
blob: 495d1e0ab78a61d14ca1d082cd688b360504f161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#include <Prs2d_AspectLine.ixx>
#include <Aspect_LineStyle.hxx>
#include <Aspect_GenericColorMap.hxx> 
#include <Aspect_TypeMap.hxx>
#include <Aspect_WidthMap.hxx>

Prs2d_AspectLine::Prs2d_AspectLine()
  :
   Prs2d_AspectRoot( Prs2d_AN_LINE ),

   myColor( Quantity_Color(Quantity_NOC_YELLOW) ),
   myType( Aspect_TOL_SOLID ),
   myWidth( Aspect_WOL_THIN ),
   myInterColor( Quantity_Color(Quantity_NOC_YELLOW) ),
   myFillType( Graphic2d_TOPF_EMPTY ),
   myTile( 0 ),
   myDrawEdge( Standard_True ),
   myColorIndex( 0 ),
   myTypeIndex( 0 ),
   myWidthIndex( 0 ),
   myIntColorInd( 0 )

{
}

Prs2d_AspectLine::Prs2d_AspectLine( 
				const Quantity_NameOfColor aColor, 
     			const Aspect_TypeOfLine aType,
				const Aspect_WidthOfLine aWidth,
                const Quantity_NameOfColor aIntColor,
                const Graphic2d_TypeOfPolygonFilling aTypeFill,
         	    const Standard_Integer aTile,
                const Standard_Boolean aDrawEdge ) 
 :
   Prs2d_AspectRoot( Prs2d_AN_LINE ),

   myColor( Quantity_Color(aColor) ),
   myType( aType ),
   myWidth( aWidth ),
   myInterColor( Quantity_Color(aIntColor) ),
   myFillType( aTypeFill ),
   myTile( aTile ),
   myDrawEdge( aDrawEdge ),
   myColorIndex( 0 ),
   myTypeIndex( 0 ),
   myWidthIndex( 0 ),
   myIntColorInd( 0 )
{
}

Prs2d_AspectLine::Prs2d_AspectLine( 
				const Quantity_Color& aColor, 
     			const Aspect_TypeOfLine aType,
				const Aspect_WidthOfLine aWidth,
                const Quantity_Color& aIntColor,
                const Graphic2d_TypeOfPolygonFilling aTypeFill,
         	    const Standard_Integer aTile,
                const Standard_Boolean aDrawEdge )
 :
   Prs2d_AspectRoot( Prs2d_AN_LINE ),

   myColor( aColor ),
   myType( aType ),
   myWidth( aWidth ),
   myInterColor( aIntColor ),
   myFillType( aTypeFill ),
   myTile( aTile ),
   myDrawEdge( aDrawEdge ),
   myColorIndex(0),
   myTypeIndex(0),
   myWidthIndex(0),
   myIntColorInd( 0 )
{
}

void Prs2d_AspectLine::SetColor(const Quantity_NameOfColor aColor) {

	 SetColor( Quantity_Color(aColor) );
}

void Prs2d_AspectLine::SetColor(const Quantity_Color& aColor) {

	if ( myColor != aColor ) {
       myColor = aColor;
       myColorIndex = 0;
    }
}

void Prs2d_AspectLine::SetType(const Aspect_TypeOfLine aType) {

	if ( myType != aType ) {
       myType = aType;
       myTypeIndex = 0;
    }
}

void Prs2d_AspectLine::SetWidth(const Aspect_WidthOfLine aWidth) {

	if ( myWidth != aWidth ) {
       myWidth = aWidth;
       myWidthIndex = 0;
    }
}

void Prs2d_AspectLine::SetInterColor(const Quantity_NameOfColor aColor) {

	 SetInterColor( Quantity_Color(aColor) );
}

void Prs2d_AspectLine::SetInterColor(const Quantity_Color& aColor) {

	if ( myInterColor != aColor ) {
       myInterColor = aColor;
       myIntColorInd = 0;
    }
}

void Prs2d_AspectLine::SetTypeOfFill( const Graphic2d_TypeOfPolygonFilling aType ) {
    myFillType = aType;
}

void Prs2d_AspectLine::SetTile( const Standard_Integer aTile ) {
	 myTile = aTile;
}

void Prs2d_AspectLine::SetDrawEdge( const Standard_Boolean aDrawEdge ) {
	  myDrawEdge = aDrawEdge;
}

void Prs2d_AspectLine::ValuesOfLine( Quantity_Color& aColor,
	                                 Aspect_TypeOfLine& aType,
	                                 Aspect_WidthOfLine& aWidth) const{
	aColor = myColor;
	aType  = myType;
	aWidth = myWidth;

}

void Prs2d_AspectLine::ValuesOfPoly( Quantity_Color& aColor,
                                     Graphic2d_TypeOfPolygonFilling& aType,
	                                 Standard_Integer& aTile,
	                                 Standard_Boolean& aDrawEdge ) const {
    aColor    = myInterColor;
    aType     = myFillType;
	aTile     = myTile;
	aDrawEdge = myDrawEdge;
}

Standard_Integer Prs2d_AspectLine::ColorIndex() const {

  return myColorIndex;
}

Standard_Integer Prs2d_AspectLine::TypeIndex() const {

  return myTypeIndex;
}

Standard_Integer Prs2d_AspectLine::WidthIndex() const {

   return myWidthIndex;
}

Standard_Integer Prs2d_AspectLine::InterColorIndex() const {

  return myIntColorInd;
}

void Prs2d_AspectLine::SetColorIndex( const Standard_Integer anInd )  {
  
	myColorIndex = anInd;
}

void Prs2d_AspectLine::SetTypeIndex( const Standard_Integer anInd )  {

    myTypeIndex = anInd;
}

void Prs2d_AspectLine::SetWidthIndex( const Standard_Integer anInd )  {
 
	myWidthIndex = anInd;
}

void Prs2d_AspectLine::SetIntColorInd( const Standard_Integer anInd )  {
  
	myIntColorInd = anInd;
}