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