0023024: Update headers of OCCT files
[occt.git] / src / Aspect / Aspect_MarkerStyle.cxx
CommitLineData
b311480e 1// Created on: 1995-01-14
2// Created by: GG
3// Copyright (c) 1995-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
7fd59977 22// Modified 23/02/98 : FMN ; Remplacement PI par Standard_PI
23// JR 02.01.100 : Implicit conversions
24
7fd59977 25
26//-Version
27
28//-Design Declaration des variables specifiques aux Type de markers
29
30//-Warning Un style est definie, soit par son type predefini TOM_...
31// soit par sa description dans l'espace -1,+1
32
33//-References
34
35//-Language C++ 2.0
36
37//-Declarations
38
39// for the class
40#include <Aspect_MarkerStyle.ixx>
41
42//-Aliases
43
44//-Global data definitions
45
46// MyMarkerType : TypeOfMarker from Aspect;
47// MyXpoint : Array1OfShortReal from TShort;
48// MyYpoint : Array1OfShortReal from TShort;
49// MySpoint : Array1OfBoolean from TColStd;
50
51//-Constructors
52
53//-Destructors
54
55//-Methods, in order
56
57Aspect_MarkerStyle::Aspect_MarkerStyle () : MyMarkerType(Aspect_TOM_POINT) {
58 SetPredefinedStyle();
59}
60
61Aspect_MarkerStyle::Aspect_MarkerStyle (
62 const Aspect_TypeOfMarker aType) : MyMarkerType(aType) {
63 SetPredefinedStyle();
64}
65
66Aspect_MarkerStyle::Aspect_MarkerStyle (const TColStd_Array1OfReal& aXpoint,
67 const TColStd_Array1OfReal& aYpoint)
68 : MyMarkerType(Aspect_TOM_USERDEFINED) {
69Standard_Integer i,j=1;
70
71 MyXpoint = new TShort_HArray1OfShortReal(1,aXpoint.Length());
72 MyYpoint = new TShort_HArray1OfShortReal(1,aXpoint.Length());
73 MySpoint = new TColStd_HArray1OfBoolean(1,aXpoint.Length());
74
75 if( aXpoint.Length() != aYpoint.Length() ) {
76 Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor length") ;
77 }
78
79 for( i=aXpoint.Lower() ; i<=aXpoint.Upper() ; i++,j++ ) {
80 Standard_ShortReal X = (Standard_ShortReal ) aXpoint(i);
81 Standard_ShortReal Y = (Standard_ShortReal ) aYpoint(i);
82 if( X < -1. || X > 1. || Y < -1. || Y > 1. ) {
83 Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor value") ;
84 }
85 MyXpoint->SetValue(j,X);
86 MyYpoint->SetValue(j,Y);
87 MySpoint->SetValue(j,(j > 1) ? Standard_True : Standard_False);
88 }
89}
90
91Aspect_MarkerStyle::Aspect_MarkerStyle (const TColStd_Array1OfReal& aXpoint,
92 const TColStd_Array1OfReal& aYpoint,
93 const TColStd_Array1OfBoolean& aSpoint)
94 : MyMarkerType(Aspect_TOM_USERDEFINED) {
95Standard_Integer i,j=1;
96
97 MyXpoint = new TShort_HArray1OfShortReal(1,aXpoint.Length());
98 MyYpoint = new TShort_HArray1OfShortReal(1,aXpoint.Length());
99 MySpoint = new TColStd_HArray1OfBoolean(1,aXpoint.Length());
100
101 if( (aXpoint.Length() != aYpoint.Length()) ||
102 (aXpoint.Length() != aSpoint.Length()) ) {
103 Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor length") ;
104 }
105
106 for( i=aXpoint.Lower() ; i<=aXpoint.Upper() ; i++,j++ ) {
107 Standard_ShortReal X = (Standard_ShortReal ) aXpoint(i);
108 Standard_ShortReal Y = (Standard_ShortReal ) aYpoint(i);
109 Standard_Boolean S = aSpoint(i);
110 if( X < -1. || X > 1. || Y < -1. || Y > 1. ) {
111 Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor value") ;
112 }
113 MyXpoint->SetValue(j,X);
114 MyYpoint->SetValue(j,Y);
115 MySpoint->SetValue(j,S);
116 MySpoint->SetValue(j,(j > 1) ? S : Standard_False);
117 }
118}
119
120Aspect_MarkerStyle& Aspect_MarkerStyle::Assign (const Aspect_MarkerStyle& Other) {
121
122 MyMarkerType = Other.MyMarkerType ;
123 MyXpoint = Other.MyXpoint ;
124 MyYpoint = Other.MyYpoint ;
125 MySpoint = Other.MySpoint ;
126
127 return (*this);
128
129}
130
131Aspect_TypeOfMarker Aspect_MarkerStyle::Type () const {
132
133 return MyMarkerType;
134}
135
136Standard_Integer Aspect_MarkerStyle::Length () const {
137
138 return MyXpoint->Length();
139}
140
141Standard_Boolean Aspect_MarkerStyle::Values (const Standard_Integer aRank,
142 Standard_Real &X,Standard_Real &Y) const {
143
144 if( aRank < 1 || aRank > Length() ) {
145 Aspect_MarkerStyleDefinitionError::Raise ("Bad Descriptor rank") ;
146 }
147
148 X = MyXpoint->Value(aRank);
149 Y = MyYpoint->Value(aRank);
150 return MySpoint->Value(aRank);
151}
152
153const TShort_Array1OfShortReal& Aspect_MarkerStyle::XValues () const {
154
155 return MyXpoint->Array1();
156}
157
158const TShort_Array1OfShortReal& Aspect_MarkerStyle::YValues () const {
159
160 return MyYpoint->Array1();
161}
162
163const TColStd_Array1OfBoolean& Aspect_MarkerStyle::SValues () const {
164
165 return MySpoint->Array1();
166}
167
168#define MAX_O_POINT 12
169#define MAX_BALL_LINE 12
170#ifndef AIX
171#define FALSE Standard_False
172#define TRUE Standard_True
173#endif
174
175void Aspect_MarkerStyle::SetPredefinedStyle() {
176
177 switch ( MyMarkerType ) {
178 case Aspect_TOM_USERDEFINED :
179 Aspect_MarkerStyleDefinitionError::Raise
180 ("Bad Marker Type Style");
181 break;
182 case Aspect_TOM_POINT :
183 MyXpoint = new TShort_HArray1OfShortReal(1,5) ;
184 MyYpoint = new TShort_HArray1OfShortReal(1,5) ;
185 MySpoint = new TColStd_HArray1OfBoolean(1,5) ;
186
187 MyXpoint->SetValue(1,-1.);
188 MyYpoint->SetValue(1,-1.);
189 MySpoint->SetValue(1,FALSE);
190
191 MyXpoint->SetValue(2,-1.);
192 MyYpoint->SetValue(2,1.);
193 MySpoint->SetValue(2,TRUE);
194
195 MyXpoint->SetValue(3,1.);
196 MyYpoint->SetValue(3,1.);
197 MySpoint->SetValue(3,TRUE);
198
199 MyXpoint->SetValue(4,1.);
200 MyYpoint->SetValue(4,-1.);
201 MySpoint->SetValue(4,TRUE);
202
203 MyXpoint->SetValue(5,-1.);
204 MyYpoint->SetValue(5,-1.);
205 MySpoint->SetValue(5,TRUE);
206 break ;
207 case Aspect_TOM_PLUS :
208 MyXpoint = new TShort_HArray1OfShortReal(1,4) ;
209 MyYpoint = new TShort_HArray1OfShortReal(1,4) ;
210 MySpoint = new TColStd_HArray1OfBoolean(1,4) ;
211
212 MyXpoint->SetValue(1, 0.);
213 MyYpoint->SetValue(1,-1.);
214 MySpoint->SetValue(1,FALSE);
215
216 MyXpoint->SetValue(2, 0.);
217 MyYpoint->SetValue(2, 1.);
218 MySpoint->SetValue(2,TRUE);
219
220 MyXpoint->SetValue(3,-1.);
221 MyYpoint->SetValue(3, 0.);
222 MySpoint->SetValue(3,FALSE);
223
224 MyXpoint->SetValue(4, 1.);
225 MyYpoint->SetValue(4, 0.);
226 MySpoint->SetValue(4,TRUE);
227 break ;
228 case Aspect_TOM_STAR :
229 MyXpoint = new TShort_HArray1OfShortReal(1,8) ;
230 MyYpoint = new TShort_HArray1OfShortReal(1,8) ;
231 MySpoint = new TColStd_HArray1OfBoolean(1,8) ;
232
233 MyXpoint->SetValue(1, 0.);
234 MyYpoint->SetValue(1,-1.);
235 MySpoint->SetValue(1,FALSE);
236
237 MyXpoint->SetValue(2, 0.);
238 MyYpoint->SetValue(2, 1.);
239 MySpoint->SetValue(2,TRUE);
240
241 MyXpoint->SetValue(3,-1.);
242 MyYpoint->SetValue(3, 0.);
243 MySpoint->SetValue(3,FALSE);
244
245 MyXpoint->SetValue(4, 1.);
246 MyYpoint->SetValue(4, 0.);
247 MySpoint->SetValue(4,TRUE);
248
249 MyXpoint->SetValue(5,(float ) -0.7);
250 MyYpoint->SetValue(5,(float ) -0.7);
251 MySpoint->SetValue(5,FALSE);
252
253 MyXpoint->SetValue(6,(float ) 0.7);
254 MyYpoint->SetValue(6,(float ) 0.7);
255 MySpoint->SetValue(6,TRUE);
256
257 MyXpoint->SetValue(7,(float ) 0.7);
258 MyYpoint->SetValue(7,(float ) -0.7);
259 MySpoint->SetValue(7,FALSE);
260
261 MyXpoint->SetValue(8,(float ) -0.7);
262 MyYpoint->SetValue(8,(float ) 0.7);
263 MySpoint->SetValue(8,TRUE);
264 break ;
265 case Aspect_TOM_O :
266 MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+1) ;
267 MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+1) ;
268 MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+1) ;
269
270 { Standard_Integer i;
c6541a0c 271 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 272 Standard_Real a = 0.;
273 for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
274 MyXpoint->SetValue(i,(float ) Cos(a));
275 MyYpoint->SetValue(i,(float ) Sin(a));
276 MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
277 }
278 i = MAX_O_POINT+1;
279 MyXpoint->SetValue(i,1.);
280 MyYpoint->SetValue(i,0.);
281 }
282 break ;
283 case Aspect_TOM_X :
284 MyXpoint = new TShort_HArray1OfShortReal(1,4) ;
285 MyYpoint = new TShort_HArray1OfShortReal(1,4) ;
286 MySpoint = new TColStd_HArray1OfBoolean(1,4) ;
287
288 MyXpoint->SetValue(1,(float ) -0.7);
289 MyYpoint->SetValue(1,(float ) -0.7);
290 MySpoint->SetValue(1,FALSE);
291
292 MyXpoint->SetValue(2,(float ) 0.7);
293 MyYpoint->SetValue(2,(float ) 0.7);
294 MySpoint->SetValue(2,TRUE);
295
296 MyXpoint->SetValue(3,(float ) 0.7);
297 MyYpoint->SetValue(3,(float ) -0.7);
298 MySpoint->SetValue(3,FALSE);
299
300 MyXpoint->SetValue(4,(float ) -0.7);
301 MyYpoint->SetValue(4,(float ) 0.7);
302 MySpoint->SetValue(4,TRUE);
303 break ;
304 case Aspect_TOM_O_POINT :
305 MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+6) ;
306 MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+6) ;
307 MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+6) ;
308 { Standard_Integer i;
c6541a0c 309 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 310 Standard_Real a = 0.;
311 for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
312 MyXpoint->SetValue(i,(float ) Cos(a));
313 MyYpoint->SetValue(i,(float ) Sin(a));
314 MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
315 }
316 i = MAX_O_POINT+1;
317 MyXpoint->SetValue(i,1.);
318 MyYpoint->SetValue(i,0.);
319
320 MyXpoint->SetValue(i+1,-0.25);
321 MyYpoint->SetValue(i+1,-0.25);
322 MySpoint->SetValue(i+1,FALSE);
323
324 MyXpoint->SetValue(i+2,-0.25);
325 MyYpoint->SetValue(i+2,0.25);
326 MySpoint->SetValue(i+2,TRUE);
327
328 MyXpoint->SetValue(i+3,0.25);
329 MyYpoint->SetValue(i+3,0.25);
330 MySpoint->SetValue(i+3,TRUE);
331
332 MyXpoint->SetValue(i+4,0.25);
333 MyYpoint->SetValue(i+4,-0.25);
334 MySpoint->SetValue(i+4,TRUE);
335
336 MyXpoint->SetValue(i+5,-0.25);
337 MyYpoint->SetValue(i+5,-0.25);
338 MySpoint->SetValue(i+5,TRUE);
339 }
340 break ;
341 case Aspect_TOM_O_PLUS :
342 MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+5) ;
343 MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+5) ;
344 MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ;
345
346 { Standard_Integer i;
c6541a0c 347 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 348 Standard_Real a = 0.;
349 for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
350 MyXpoint->SetValue(i,(float ) Cos(a));
351 MyYpoint->SetValue(i,(float ) Sin(a));
352 MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
353 }
354 i = MAX_O_POINT+1;
355 MyXpoint->SetValue(i,1.);
356 MyYpoint->SetValue(i,0.);
357
358 MyXpoint->SetValue(i+1,0.);
359 MyYpoint->SetValue(i+1,-0.5);
360 MySpoint->SetValue(i+1,FALSE);
361
362 MyXpoint->SetValue(i+2,0.);
363 MyYpoint->SetValue(i+2,0.5);
364 MySpoint->SetValue(i+2,TRUE);
365
366 MyXpoint->SetValue(i+3,-0.5);
367 MyYpoint->SetValue(i+3,0.);
368 MySpoint->SetValue(i+3,FALSE);
369
370 MyXpoint->SetValue(i+4,0.5);
371 MyYpoint->SetValue(i+4,0.);
372 MySpoint->SetValue(i+4,TRUE);
373 }
374 break ;
375 case Aspect_TOM_O_STAR :
376 MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+9) ;
377 MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+9) ;
378 MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+9) ;
379
380 { Standard_Integer i;
c6541a0c 381 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 382 Standard_Real a = 0.;
383 for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
384 MyXpoint->SetValue(i,(float ) Cos(a));
385 MyYpoint->SetValue(i,(float ) Sin(a));
386 MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
387 }
388 i = MAX_O_POINT+1;
389 MyXpoint->SetValue(i,1.);
390 MyYpoint->SetValue(i,0.);
391
392 MyXpoint->SetValue(i+1, 0.);
393 MyYpoint->SetValue(i+1,-0.5);
394 MySpoint->SetValue(i+1,FALSE);
395
396 MyXpoint->SetValue(i+2, 0.);
397 MyYpoint->SetValue(i+2,0.5);
398 MySpoint->SetValue(i+2,TRUE);
399
400 MyXpoint->SetValue(i+3,-0.5);
401 MyYpoint->SetValue(i+3, 0.);
402 MySpoint->SetValue(i+3,FALSE);
403
404 MyXpoint->SetValue(i+4,0.5);
405 MyYpoint->SetValue(i+4, 0.);
406 MySpoint->SetValue(i+4,TRUE);
407
408 MyXpoint->SetValue(i+5,(float ) -0.35);
409 MyYpoint->SetValue(i+5,(float ) -0.35);
410 MySpoint->SetValue(i+5,FALSE);
411
412 MyXpoint->SetValue(i+6,(float ) 0.35);
413 MyYpoint->SetValue(i+6,(float ) 0.35);
414 MySpoint->SetValue(i+6,TRUE);
415
416 MyXpoint->SetValue(i+7,(float ) 0.35);
417 MyYpoint->SetValue(i+7,(float ) -0.35);
418 MySpoint->SetValue(i+7,FALSE);
419
420 MyXpoint->SetValue(i+8,(float ) -0.35);
421 MyYpoint->SetValue(i+8,(float ) 0.35);
422 MySpoint->SetValue(i+8,TRUE);
423 }
424 break ;
425 case Aspect_TOM_O_X :
426 MyXpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+5) ;
427 MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+5) ;
428 MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ;
429
430 { Standard_Integer i;
c6541a0c 431 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 432 Standard_Real a = 0.;
433 for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) {
434 MyXpoint->SetValue(i,(float ) Cos(a));
435 MyYpoint->SetValue(i,(float ) Sin(a));
436 MySpoint->SetValue(i,(i > 1) ? TRUE : FALSE);
437 }
438 i = MAX_O_POINT+1;
439 MyXpoint->SetValue(i,1.);
440 MyYpoint->SetValue(i,0.);
441
442 MyXpoint->SetValue(i+1,(float ) -0.35);
443 MyYpoint->SetValue(i+1,(float ) -0.35);
444 MySpoint->SetValue(i+1,FALSE);
445
446 MyXpoint->SetValue(i+2,(float ) 0.35);
447 MyYpoint->SetValue(i+2,(float ) 0.35);
448 MySpoint->SetValue(i+2,TRUE);
449
450 MyXpoint->SetValue(i+3,(float ) 0.35);
451 MyYpoint->SetValue(i+3,(float ) -0.35);
452 MySpoint->SetValue(i+3,FALSE);
453
454 MyXpoint->SetValue(i+4,(float ) -0.35);
455 MyYpoint->SetValue(i+4,(float ) 0.35);
456 MySpoint->SetValue(i+4,TRUE);
457 }
458 break ;
459 case Aspect_TOM_BALL :
460 MyXpoint = new TShort_HArray1OfShortReal(1,
461 MAX_BALL_LINE*(MAX_O_POINT+1)) ;
462 MyYpoint = new TShort_HArray1OfShortReal(1,
463 MAX_BALL_LINE*(MAX_O_POINT+1)) ;
464 MySpoint = new TColStd_HArray1OfBoolean(1,
465 MAX_BALL_LINE*(MAX_O_POINT+1)) ;
466
467 { Standard_Integer i,j,n = 0;
c6541a0c 468 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 469 Standard_Real dr = 1./MAX_BALL_LINE;
470 Standard_Real a,r = 1.;
471
472 for( i=1 ; i<= MAX_BALL_LINE ; i++ ) {
473 a = 0.;
474 for( j=1 ; j<= MAX_O_POINT+1 ; j++,a += da ) {
475 n++;
476 MyXpoint->SetValue(n,(float )( r*Cos(a)));
477 MyYpoint->SetValue(n,(float )( r*Sin(a)));
478 MySpoint->SetValue(n,(j > 1) ? TRUE : FALSE);
479 }
480 MyXpoint->SetValue(n,(float ) r);
481 MyYpoint->SetValue(n,0.);
482 r -= dr;
483 }
484 }
485 break ;
486 case Aspect_TOM_RING1 :
487 MyXpoint = new TShort_HArray1OfShortReal(1,
488 (MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
489 MyYpoint = new TShort_HArray1OfShortReal(1,
490 (MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
491 MySpoint = new TColStd_HArray1OfBoolean(1,
492 (MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ;
493
494 { Standard_Integer i,j,n = 0;
c6541a0c 495 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 496 Standard_Real dr = 1./MAX_BALL_LINE;
497 Standard_Real a,r = 1.;
498
499 for( i=1 ; i<= MAX_BALL_LINE/4 ; i++ ) {
500 a = 0.;
501 for( j=1 ; j<= MAX_O_POINT+1 ; j++,a += da ) {
502 n++;
503 MyXpoint->SetValue(n,(float )( r*Cos(a)));
504 MyYpoint->SetValue(n,(float )( r*Sin(a)));
505 MySpoint->SetValue(n,(j > 1) ? TRUE : FALSE);
506 }
507 MyXpoint->SetValue(n,(float ) r);
508 MyYpoint->SetValue(n,0.);
509 r -= dr;
510 }
511 }
512 break ;
513 case Aspect_TOM_RING2 :
514 MyXpoint = new TShort_HArray1OfShortReal(1,
515 (MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ;
516 MyYpoint = new TShort_HArray1OfShortReal(1,
517 (MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ;
518 MySpoint = new TColStd_HArray1OfBoolean(1,
519 (MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ;
520
521 { Standard_Integer i,j,n = 0;
c6541a0c 522 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 523 Standard_Real dr = 1./MAX_BALL_LINE;
524 Standard_Real a,r = 1.;
525
526 for( i=1 ; i<= MAX_BALL_LINE/3 ; i++ ) {
527 a = 0.;
528 for( j=1 ; j<= MAX_O_POINT+1 ; j++,a += da ) {
529 n++;
530 MyXpoint->SetValue(n,(float )( r*Cos(a)));
531 MyYpoint->SetValue(n,(float )( r*Sin(a)));
532 MySpoint->SetValue(n,(j > 1) ? TRUE : FALSE);
533 }
534 MyXpoint->SetValue(n,(float ) r);
535 MyYpoint->SetValue(n,0.);
536 r -= dr;
537 }
538 }
539 break ;
540 case Aspect_TOM_RING3 :
541 MyXpoint = new TShort_HArray1OfShortReal(1,
542 (MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ;
543 MyYpoint = new TShort_HArray1OfShortReal(1,
544 (MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ;
545 MySpoint = new TColStd_HArray1OfBoolean(1,
546 (MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ;
547
548 { Standard_Integer i,j,n = 0;
c6541a0c 549 Standard_Real da = 2. * M_PI / MAX_O_POINT;
7fd59977 550 Standard_Real dr = 1./MAX_BALL_LINE;
551 Standard_Real a,r = 1.;
552
553 for( i=1 ; i<= MAX_BALL_LINE/2 ; i++ ) {
554 a = 0.;
555 for( j=1 ; j<= MAX_O_POINT+1 ; j++,a += da ) {
556 n++;
557 MyXpoint->SetValue(n,(float )( r*Cos(a)));
558 MyYpoint->SetValue(n,(float )( r*Sin(a)));
559 MySpoint->SetValue(n,(j > 1) ? TRUE : FALSE);
560 }
561 MyXpoint->SetValue(n,(float ) r);
562 MyYpoint->SetValue(n,0.);
563 r -= dr;
564 }
565 }
566 break ;
567 }
568
569}
570
571Standard_Boolean Aspect_MarkerStyle::IsEqual(const Aspect_MarkerStyle& Other) const
572{
573 return (
574 (MyMarkerType == Other.MyMarkerType) &&
575 (MyXpoint == Other.MyXpoint) &&
576 (MyYpoint == Other.MyYpoint) &&
577 (MySpoint == Other.MySpoint));
578}
579
580Standard_Boolean Aspect_MarkerStyle::IsNotEqual(const Aspect_MarkerStyle& Other) const
581{
582 return !IsEqual(Other);
583}