/opencascade-6.5.1/ros/src/Aspect/Aspect_MarkerStyle.cxx

https://github.com/jehc/MondocosmOS · C++ · 567 lines · 442 code · 102 blank · 23 comment · 35 complexity · 8f2708c5ba90d50145dd24f74a917b9c MD5 · raw file

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