0022751: Issues around Prs3d_TextAspect::Print()
[occt.git] / src / Visual3d / Visual3d_ViewManager.cxx
CommitLineData
7fd59977 1
2/***********************************************************************
3
4 FONCTION :
5 ----------
6 Classe Visual3d_ViewManager.cxx :
7
81bba717 8 Declaration of variables specific to visualisers
7fd59977 9
10 HISTORIQUE DES MODIFICATIONS :
11 --------------------------------
12 Mars 1992 : NW,JPB,CAL ; Creation.
13 19-06-96 : FMN ; Suppression variables inutiles
14 04-02-97 : FMN ; Suppression de PSOutput, XWDOutput ...
15 06-05-97 : CAL ; Ajout du Clear sur les TOS_COMPUTED.
16 19-09-97 : CAL ; Remplacement de Window->Position par Window->Size;
17 24-10-97 : CAL ; Retrait de DownCast.
18 20-11-97 : CAL ; Disparition de la dependance avec math
19 01-12-97 : CAL ; Retrait du test IsActive sur l'Update et le Redraw
20 31-12-97 : CAL ; Disparition de MathGra
21 16-01-98 : CAL ; Ajout du SetTransform sur une TOS_COMPUTED
22 11-03-98 : CAL ; Visual3d_ViewManager::Remove ()
23 20-05-98 : CAL ; Perfs. Connection entre structures COMPUTED.
24 10-06-98 : CAL ; Modification des signatures de xxProjectRaster.
25 10-06-98 : CAL ; Modification de la signature de ViewExists.
26 01-12-98 : CAL ; S4062. Ajout des layers.
27 02-12-98 : CAL ; Remove () ne detruit plus les vues.
28
29************************************************************************/
30
31/*----------------------------------------------------------------------*/
32/*
81bba717 33 * Constants
7fd59977 34 */
35
36#define NO_DOWNCAST
37#define NO_DESTROY
38
39/*----------------------------------------------------------------------*/
40/*
41 * Includes
42 */
43
44// for the class
45#include <Visual3d_ViewManager.ixx>
46#include <Visual3d_ViewManager.pxx>
47
48#include <Standard_ErrorHandler.hxx>
49
50#include <Aspect.hxx>
59f45b7c 51#include <Aspect_IdentDefinitionError.hxx>
7fd59977 52
53#include <Graphic3d_GraphicDriver.hxx>
54#include <Graphic3d_MapOfStructure.hxx>
55#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
56
57#include <Visual3d_PickPath.hxx>
58#include <Visual3d_SetIteratorOfSetOfView.hxx>
59
60#ifndef WNT
61# include <Xw_Window.hxx>
62#else
63# include <WNT_Window.hxx>
64#endif // WNT
65
66//-Aliases
67
68//-Global data definitions
69
70// -- les vues definies
71// MyDefinedView : SetOfView;
72
73// -- le generateur d'identificateurs de vues
74// MyViewGenId : GenId;
75
76//-Constructors
77
78Visual3d_ViewManager::Visual3d_ViewManager (const Handle(Aspect_GraphicDevice)& aDevice):
79Graphic3d_StructureManager (aDevice),
80MyDefinedView (),
81MyViewGenId (View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*(Visual3d_ViewManager::CurrentId ()-1),View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*Visual3d_ViewManager::CurrentId ()-1),
82MyZBufferAuto (Standard_False),
83MyTransparency (Standard_False)
84{
59f45b7c 85 // default layer is always presented in display layer sequence
86 // it can not be removed
87 myLayerIds.Add (0);
88 myLayerSeq.Append (0);
7fd59977 89
59f45b7c 90 Handle(Aspect_GraphicDriver) agd = aDevice->GraphicDriver ();
7fd59977 91
59f45b7c 92 MyGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;
7fd59977 93}
94
95//-Destructors
96
97void Visual3d_ViewManager::Destroy () {
98
99#ifdef DESTROY
100 cout << "Visual3d_ViewManager::Destroy (" << MyId << ")\n" << flush;
101#endif
102
103 Remove ();
104}
105
106//-Methods, in order
107
108void Visual3d_ViewManager::Remove () {
109
110#ifdef DESTROY
111 cout << "Visual3d_ViewManager::Remove (" << MyId << ")\n" << flush;
112#endif
113
114 //
115 // Destroy all defined views
116 //
117#ifdef DEB
118 Standard_Integer Length = MyDefinedView.Extent ();
119#else
120 MyDefinedView.Extent ();
121#endif
122
123#ifdef DESTROY
124 cout << "The Manager " << MyId << " have " << Length << " defined views\n";
125 cout << flush;
126#endif
127
128 MyDefinedView.Clear ();
129
130}
131
132void Visual3d_ViewManager::ChangeDisplayPriority (const Handle(Graphic3d_Structure)& AStructure, const Standard_Integer OldPriority, const Standard_Integer NewPriority) {
133
134#ifdef TRACE
135 cout << "Visual3d_ViewManager::ChangeDisplayPriority ("
136 << AStructure->Identification ()
137 << ", " << OldPriority << ", " << NewPriority << ")\n";
138 cout << flush;
139#endif
140
141 //
142 // Change structure priority in all defined views
143 //
144#ifdef DEB
145 Standard_Integer Length = MyDefinedView.Extent ();
146#else
147 MyDefinedView.Extent ();
148#endif
149 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
150
151 while (MyIterator.More ()) {
152 (MyIterator.Value ())->ChangeDisplayPriority
153 (AStructure, OldPriority, NewPriority);
154
81bba717 155 // MyIterator.Next () is located on the next view
7fd59977 156 MyIterator.Next ();
157 }
158
159}
160
161void Visual3d_ViewManager::ReCompute (const Handle(Graphic3d_Structure)& AStructure) {
162
163 //Standard_Integer LengthD = MyDisplayedStructure.Extent() ();
164
81bba717 165 // Even if physically the structure cannot
166 // be displayed (pb of visualisation type)
167 // it has status Displayed.
7fd59977 168
169 if (!MyDisplayedStructure.Contains(AStructure))
170 return;
171
172 //
173 // Recompute structure in all activated views
174 //
175 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
176
177 while (MyIterator.More ()) {
178 (MyIterator.Value ())->ReCompute (AStructure);
179
81bba717 180 // MyIterator.Next () is located on the next view
7fd59977 181 MyIterator.Next ();
182 }
183
184}
185
186void Visual3d_ViewManager::ReCompute (const Handle(Graphic3d_Structure)& AStructure,
187 const Handle(Graphic3d_DataStructureManager)& AProjector)
188{
189
190 if (! AProjector->IsKind (STANDARD_TYPE (Visual3d_View))) return;
191
192#ifdef DOWNCAST
193 Handle(Visual3d_View) theView = Handle(Visual3d_View)::DownCast (AProjector);
194#else
195 Handle(Visual3d_View) theView = *(Handle(Visual3d_View) *) &AProjector;
196#endif
197 Standard_Integer ViewId = theView->Identification ();
198
199 Standard_Integer indexD = 0;
200
81bba717 201 // Even if physically the structure cannot
202 // be displayed (pb of visualisation type)
203 // it has status Displayed.
7fd59977 204 if (!MyDisplayedStructure.Contains(AStructure))
205 return;
206
207 //
81bba717 208 // Recompute structure in all activated views
7fd59977 209 //
210 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
211
212 while (MyIterator.More ()) {
213 if ((MyIterator.Value ())->Identification () == ViewId)
214 theView->ReCompute (AStructure);
215
81bba717 216 // MyIterator.Next () is located on the next view
7fd59977 217 MyIterator.Next ();
218 }
219
220}
221
222void Visual3d_ViewManager::Clear (const Handle(Graphic3d_Structure)& AStructure, const Standard_Boolean WithDestruction) {
223
224#ifdef DEB
225 Standard_Integer Length = MyDefinedView.Extent ();
226#else
227 MyDefinedView.Extent ();
228#endif
229 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
230
231 while (MyIterator.More ()) {
232 (MyIterator.Value ())->Clear (AStructure, WithDestruction);
233
81bba717 234 // MyIterator.Next () is located on the next view
7fd59977 235 MyIterator.Next ();
236 }
237
238}
239
240void Visual3d_ViewManager::Connect (const Handle(Graphic3d_Structure)& AMother, const Handle(Graphic3d_Structure)& ADaughter) {
241
242#ifdef DEB
243 Standard_Integer Length = MyDefinedView.Extent ();
244#else
245 MyDefinedView.Extent ();
246#endif
247 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
248
249 while (MyIterator.More ()) {
250 (MyIterator.Value ())->Connect (AMother, ADaughter);
251
81bba717 252 // MyIterator.Next () is located on the next view
7fd59977 253 MyIterator.Next ();
254 }
255
256}
257
258void Visual3d_ViewManager::Disconnect (const Handle(Graphic3d_Structure)& AMother, const Handle(Graphic3d_Structure)& ADaughter) {
259
260#ifdef DEB
261 Standard_Integer Length = MyDefinedView.Extent ();
262#else
263 MyDefinedView.Extent ();
264#endif
265 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
266
267 while (MyIterator.More ()) {
268 (MyIterator.Value ())->Disconnect (AMother, ADaughter);
269
81bba717 270 // MyIterator.Next () is located on the next view
7fd59977 271 MyIterator.Next ();
272 }
273
274}
275
276void Visual3d_ViewManager::Display (const Handle(Graphic3d_Structure)& AStructure) {
277
278
81bba717 279 // Even if physically the structure cannot
280 // be displayed (pb of visualisation type)
281 // it has status Displayed.
7fd59977 282
283 MyDisplayedStructure.Add(AStructure);
284
285 //
286 // Display structure in all activated views
287 //
288 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
289
290 while (MyIterator.More ()) {
291 (MyIterator.Value ())->Display (AStructure);
292
81bba717 293 // MyIterator.Next () is located on the next view
7fd59977 294 MyIterator.Next ();
295 }
296
297}
298
299void Visual3d_ViewManager::Erase (const Handle(Graphic3d_Structure)& AStructure) {
300
301
81bba717 302// Even if physically the structure cannot
303 // be displayed (pb of visualisation type)
304 // it has status Displayed.
7fd59977 305
306 MyDisplayedStructure.Remove(AStructure);
307
308
309
310 //
311 // Erase structure in all defined views
312 //
313#ifdef DEB
314 Standard_Integer Length = MyDefinedView.Extent ();
315#else
316 MyDefinedView.Extent ();
317#endif
318 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
319
320 while (MyIterator.More ()) {
321 (MyIterator.Value ())->Erase (AStructure);
322
81bba717 323 // MyIterator.Next () is located on the next view
7fd59977 324 MyIterator.Next ();
325 }
326
327 MyHighlightedStructure.Remove (AStructure);
328 MyVisibleStructure.Remove (AStructure);
329 MyPickStructure.Remove (AStructure);
330
331}
332
333void Visual3d_ViewManager::Erase () {
334
335 Graphic3d_MapIteratorOfMapOfStructure it( MyDisplayedStructure);
336
337 for (; it.More(); it.Next()) {
338 Handle(Graphic3d_Structure) SG = it.Key();
339 SG->Erase();
340 }
341
342}
343
344void Visual3d_ViewManager::Highlight (const Handle(Graphic3d_Structure)& AStructure, const Aspect_TypeOfHighlightMethod AMethod) {
345
346 MyHighlightedStructure.Add(AStructure);
347
348 //
349 // Highlight in all activated views
350 //
351#ifdef DEB
352 Standard_Integer Length = MyDefinedView.Extent ();
353#else
354 MyDefinedView.Extent ();
355#endif
356 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
357
358 while (MyIterator.More ()) {
359 (MyIterator.Value ())->Highlight (AStructure, AMethod);
360
81bba717 361 // MyIterator.Next () is located on the next view
7fd59977 362 MyIterator.Next ();
363 }
364
365}
366
367void Visual3d_ViewManager::SetTransform (const Handle(Graphic3d_Structure)& AStructure, const TColStd_Array2OfReal& ATrsf) {
368
369#ifdef DEB
370 Standard_Integer Length = MyDefinedView.Extent ();
371#else
372 MyDefinedView.Extent ();
373#endif
374 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
375
376 while (MyIterator.More ()) {
377 (MyIterator.Value ())->SetTransform (AStructure, ATrsf);
378
81bba717 379 // MyIterator.Next () is located on the next view
7fd59977 380 MyIterator.Next ();
381 }
382
383}
384
385void Visual3d_ViewManager::UnHighlight () {
386
387 Graphic3d_MapIteratorOfMapOfStructure it(MyHighlightedStructure);
388
389 for (; it.More(); it.Next()) {
390 Handle(Graphic3d_Structure) SG = it.Key();
391 SG->UnHighlight ();
392 }
393
394
395}
396
397void Visual3d_ViewManager::UnHighlight (const Handle(Graphic3d_Structure)& AStructure) {
398
399 MyHighlightedStructure.Remove(AStructure);
400
401
402 //
403 // UnHighlight in all activated views
404 //
405#ifdef DEB
406 Standard_Integer Length = MyDefinedView.Extent ();
407#else
408 MyDefinedView.Extent ();
409#endif
410 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
411
412 while (MyIterator.More ()) {
413 (MyIterator.Value ())->UnHighlight (AStructure);
414
81bba717 415 // MyIterator.Next () is located on the next view
7fd59977 416 MyIterator.Next ();
417 }
418
419}
420
421void Visual3d_ViewManager::Redraw () const {
422
423Standard_Integer MaxDx, MaxDy;
424Standard_Integer Dx, Dy;
425 MaxDx = MaxDy = IntegerFirst ();
426
427 //
428 // Redraw all activated views
429 //
430 Standard_Integer j = MyDefinedView.Extent ();
431 if (j == 0) return;
432 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
433
434 if (! MyUnderLayer.IsNull () || ! MyOverLayer.IsNull ()) {
435 while (MyIterator.More ()) {
436 (MyIterator.Value ())->Window ()->Size (Dx, Dy);
437 if (Dx > MaxDx) MaxDx = Dx;
438 if (Dy > MaxDy) MaxDy = Dy;
439
81bba717 440 // MyIterator.Next () is located on the next view
7fd59977 441 MyIterator.Next ();
442 }
443 if (! MyUnderLayer.IsNull ())
444 MyUnderLayer->SetViewport (MaxDx, MaxDy);
445 if (! MyOverLayer.IsNull ())
446 MyOverLayer->SetViewport (MaxDx, MaxDy);
447 }
448
449 if (! MyUnderLayer.IsNull () || ! MyOverLayer.IsNull ())
450 MyIterator.Initialize (MyDefinedView);
451 while (MyIterator.More ()) {
452 (MyIterator.Value ())->Redraw (MyUnderLayer, MyOverLayer);
453
81bba717 454 // MyIterator.Next () is located on the next view
7fd59977 455 MyIterator.Next ();
456 }
457
458}
459
460void Visual3d_ViewManager::Update () const {
461
462 //
463 // Update all activated views
464 //
465 Standard_Integer j = MyDefinedView.Extent ();
466 if (j == 0) return;
467 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
468
469 while (MyIterator.More ()) {
470 (MyIterator.Value ())->Update (MyUnderLayer, MyOverLayer);
471
81bba717 472 // MyIterator.Next () is located on the next view
7fd59977 473 MyIterator.Next ();
474 }
475
476}
477
478Handle(Visual3d_HSetOfView) Visual3d_ViewManager::ActivatedView () const {
479
480Handle (Visual3d_HSetOfView) SG = new Visual3d_HSetOfView ();
481
482#ifdef DEB
483 Standard_Integer Length = MyDefinedView.Extent ();
484#else
485 MyDefinedView.Extent ();
486#endif
487Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
488
489 while (MyIterator.More ()) {
490 if ((MyIterator.Value ())->IsActive ())
491 SG->Add (MyIterator.Value ());
492
81bba717 493 // MyIterator.Next () is located on the next view
7fd59977 494 MyIterator.Next ();
495 }
496
497 return (SG);
498
499}
500
501#ifdef IMPLEMENTED
502Standard_Boolean Visual3d_ViewManager::ContainsComputedStructure () const {
503
504Standard_Boolean Result = Standard_False;
505
506 //
507 // Check all activated views
508 //
509 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
510
511 Standard_Integer i = MyDefinedView.Extent ();
512
513 while ((! Result) && (MyIterator.More ())) {
514 if ((MyIterator.Value ())->IsActive ())
515 Result =
516 (MyIterator.Value ())->ContainsComputedStructure ();
517
81bba717 518 // MyIterator.Next () is located on the next view
7fd59977 519 MyIterator.Next ();
520 }
521
522 return Result;
523}
524#endif
525
526Handle(Visual3d_HSetOfView) Visual3d_ViewManager::DefinedView () const {
527
528Handle (Visual3d_HSetOfView) SG = new Visual3d_HSetOfView ();
529
530Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
531
532 while (MyIterator.More ()) {
533 SG->Add (MyIterator.Value ());
534
81bba717 535 // MyIterator.Next () is located on the next view
7fd59977 536 MyIterator.Next ();
537 }
538
539 return (SG);
540
541}
542
543void Visual3d_ViewManager::ConvertCoord (const Handle(Aspect_Window)& AWindow, const Graphic3d_Vertex& AVertex, Standard_Integer& AU, Standard_Integer& AV) const {
544
81bba717 545// Convert only if the data is correct
7fd59977 546Standard_Boolean Exist;
547Graphic3d_CView TheCView;
548//Graphic3d_Vertex Point;
549
550TColStd_Array2OfReal Ori_Matrix (0,3,0,3);
551TColStd_Array2OfReal Map_Matrix (0,3,0,3);
552
553Standard_Integer Width, Height;
554Standard_Real AX, AY, AZ;
555Standard_Real Dx, Dy, Ratio;
556
557 Exist = ViewExists (AWindow, TheCView);
558
559 if (! Exist) {
560 AU = AV = IntegerLast ();
561 }
562 else {
563 // NKV - 11.02.08 - Use graphic driver functions
564 Standard_Boolean Result;
565
566 AVertex.Coord (AX, AY, AZ);
567
568 Result = MyGraphicDriver->ProjectRaster (TheCView,
569 Standard_ShortReal (AX), Standard_ShortReal (AY), Standard_ShortReal (AZ),
570 AU, AV);
571
572 // the old code
573 if (!Result) {
574
575 Standard_Real PtX, PtY, PtZ, PtT;
576 Standard_Real APX, APY, APZ;
577 Standard_Real APT;
578
579 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
580#ifdef DEB
581 Standard_Integer Length = MyDefinedView.Extent ();
582#else
583 MyDefinedView.Extent ();
584#endif
585
586 Standard_Integer stop = 0;
587
588 while ((! stop) && (MyIterator.More ())) {
589 if (TheCView.ViewId ==
590 (MyIterator.Value ())->Identification ()) {
591 Ori_Matrix =
592 (MyIterator.Value ())->MatrixOfOrientation ();
593 Map_Matrix =
594 (MyIterator.Value ())->MatrixOfMapping ();
595 stop = 1;
596 }
597
81bba717 598 // MyIterator.Next () is located on the next view
7fd59977 599 MyIterator.Next ();
600 }
601
602
603 // WCS -> View Reference Coordinate Space
604 PtX = Ori_Matrix (0, 0) * AX
605 + Ori_Matrix (0, 1) * AY
606 + Ori_Matrix (0, 2) * AZ
607 + Ori_Matrix (0, 3);
608 PtY = Ori_Matrix (1, 0) * AX
609 + Ori_Matrix (1, 1) * AY
610 + Ori_Matrix (1, 2) * AZ
611 + Ori_Matrix (1, 3);
612 PtZ = Ori_Matrix (2, 0) * AX
613 + Ori_Matrix (2, 1) * AY
614 + Ori_Matrix (2, 2) * AZ
615 + Ori_Matrix (2, 3);
616 PtT = Ori_Matrix (3, 0) * AX
617 + Ori_Matrix (3, 1) * AY
618 + Ori_Matrix (3, 2) * AZ
619 + Ori_Matrix (3, 3);
620
621 // VRCS -> Normalized Projection Coordinate Space
622 APX = Map_Matrix (0, 0) * PtX
623 + Map_Matrix (0, 1) * PtY
624 + Map_Matrix (0, 2) * PtZ
625 + Map_Matrix (0, 3) * PtT;
626 APY = Map_Matrix (1, 0) * PtX
627 + Map_Matrix (1, 1) * PtY
628 + Map_Matrix (1, 2) * PtZ
629 + Map_Matrix (1, 3) * PtT;
630 APZ = Map_Matrix (2, 0) * PtX
631 + Map_Matrix (2, 1) * PtY
632 + Map_Matrix (2, 2) * PtZ
633 + Map_Matrix (2, 3) * PtT;
634 APT = Map_Matrix (3, 0) * PtX
635 + Map_Matrix (3, 1) * PtY
636 + Map_Matrix (3, 2) * PtZ
637 + Map_Matrix (3, 3) * PtT;
638
639 if (APT == 0. || stop == 0) {
640 AU = AV = IntegerLast ();
641 }
642 else {
643 APX /= APT;
644 APY /= APT;
645 APZ /= APT;
646
647 // NPCS -> Device Coordinate Space
648 AWindow->Size (Width, Height);
649 Dx = Standard_Real (Width);
650 Dy = Standard_Real (Height);
651 Ratio = Dx / Dy;
652 if (Ratio >= 1.) {
653 AU = Standard_Integer (APX * Dx);
654 AV = Standard_Integer (Dy - APY * Dy * Ratio);
655 }
656 else {
657 AU = Standard_Integer (APX * Dx / Ratio);
658 AV = Standard_Integer (Dy - APY * Dy);
659 }
660 }
661 }
662 }
663
664}
665
666Graphic3d_Vertex Visual3d_ViewManager::ConvertCoord (const Handle(Aspect_Window)& AWindow, const Standard_Integer AU, const Standard_Integer AV) const {
667
81bba717 668// Convert only if the data is correct
7fd59977 669Graphic3d_CView TheCView;
670Graphic3d_Vertex Point;
671
672 if (! ViewExists (AWindow, TheCView))
673 Point.SetCoord (RealLast (), RealLast (), RealLast ());
674 else {
675Standard_Integer Width, Height;
676Standard_ShortReal x, y, z;
677Standard_Boolean Result;
678
679 AWindow->Size (Width, Height);
680
681 Result = MyGraphicDriver->UnProjectRaster (TheCView,
682 0, 0, Width, Height,
683 AU, AV, x, y, z);
684
81bba717 685 // unproject is done by UnProjectRaster
7fd59977 686 if (Result) {
687 Point.SetCoord
688 (Standard_Real (x), Standard_Real (y), Standard_Real (z));
689 }
81bba717 690 // unproject cannot be done by UnProjectRaster
691 // Code suspended since drivers Phigs and Pex are abandoned.
7fd59977 692 else {
693
694Standard_Real NPCX, NPCY, NPCZ;
695Standard_Real VRCX, VRCY, VRCZ, VRCT;
696Standard_Real WCX, WCY, WCZ, WCT;
697
698TColStd_Array2OfReal TOri_Matrix (0,3,0,3);
699TColStd_Array2OfReal TMap_Matrix (0,3,0,3);
700TColStd_Array2OfReal TOri_Matrix_Inv (0,3,0,3);
701TColStd_Array2OfReal TMap_Matrix_Inv (0,3,0,3);
702
703Standard_Real Dx, Dy, Ratio;
704Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
705Standard_Integer j;
706
707Standard_Integer stop = 0;
708
709Standard_Boolean BResult;
710
711 j = MyDefinedView.Extent ();
712
713 while ((! stop) && (MyIterator.More ())) {
714 if (TheCView.ViewId ==
715 (MyIterator.Value ())->Identification ()) {
716 TOri_Matrix =
717 (MyIterator.Value ())->MatrixOfOrientation ();
718 TMap_Matrix =
719 (MyIterator.Value ())->MatrixOfMapping ();
720 stop = 1;
721 }
722
81bba717 723 // MyIterator.Next () is located on the next view
7fd59977 724 MyIterator.Next ();
725 }
726
727 // View Mapping Transformation and View Clip, inversion
728 BResult = Aspect::Inverse (TMap_Matrix, TMap_Matrix_Inv);
729
730 // View Orientation Transformation, inversion
731 BResult = Aspect::Inverse (TOri_Matrix, TOri_Matrix_Inv);
732
733 // (AU, AV) : Device Coordinate Space
734 // DCS -> NPCS Normalized Projection Coordinate Space
735 Dx = Standard_Real (Width);
736 Dy = Standard_Real (Height);
737 Ratio = Dx / Dy;
738
739 if (Ratio >= 1.) {
740 NPCX = Standard_Real (AU) / Dx;
741 NPCY = (Dy - Standard_Real (AV)) / Dx;
742 }
743 else {
744 NPCX = Standard_Real (AU) / Dy;
745 NPCY = (Dy - Standard_Real (AV)) / Dy;
746 }
747 NPCZ = 0.0;
748
749 // NPCS -> VRCS View Reference Coordinate Space
750 // PtVRC = Map_Matrix_Inv.Multiplied (PtNPC);
751
752 VRCX = TMap_Matrix_Inv (0, 0) * NPCX
753 + TMap_Matrix_Inv (0, 1) * NPCY
754 + TMap_Matrix_Inv (0, 2) * NPCZ
755 + TMap_Matrix_Inv (0, 3);
756 VRCY = TMap_Matrix_Inv (1, 0) * NPCX
757 + TMap_Matrix_Inv (1, 1) * NPCY
758 + TMap_Matrix_Inv (1, 2) * NPCZ
759 + TMap_Matrix_Inv (1, 3);
760 VRCZ = TMap_Matrix_Inv (2, 0) * NPCX
761 + TMap_Matrix_Inv (2, 1) * NPCY
762 + TMap_Matrix_Inv (2, 2) * NPCZ
763 + TMap_Matrix_Inv (2, 3);
764 VRCT = TMap_Matrix_Inv (3, 0) * NPCX
765 + TMap_Matrix_Inv (3, 1) * NPCY
766 + TMap_Matrix_Inv (3, 2) * NPCZ
767 + TMap_Matrix_Inv (3, 3);
768
769 // VRCS -> WCS World Coordinate Space
770 // PtWC = Ori_Matrix_Inv.Multiplied (PtVRC);
771
772 WCX = TOri_Matrix_Inv (0, 0) * VRCX
773 + TOri_Matrix_Inv (0, 1) * VRCY
774 + TOri_Matrix_Inv (0, 2) * VRCZ
775 + TOri_Matrix_Inv (0, 3) * VRCT;
776 WCY = TOri_Matrix_Inv (1, 0) * VRCX
777 + TOri_Matrix_Inv (1, 1) * VRCY
778 + TOri_Matrix_Inv (1, 2) * VRCZ
779 + TOri_Matrix_Inv (1, 3) * VRCT;
780 WCZ = TOri_Matrix_Inv (2, 0) * VRCX
781 + TOri_Matrix_Inv (2, 1) * VRCY
782 + TOri_Matrix_Inv (2, 2) * VRCZ
783 + TOri_Matrix_Inv (2, 3) * VRCT;
784 WCT = TOri_Matrix_Inv (3, 0) * VRCX
785 + TOri_Matrix_Inv (3, 1) * VRCY
786 + TOri_Matrix_Inv (3, 2) * VRCZ
787 + TOri_Matrix_Inv (3, 3) * VRCT;
788
789 if (WCT != 0.)
790 Point.SetCoord (WCX/WCT, WCY/WCT, WCZ/WCT);
791 else
792 Point.SetCoord (RealLast (), RealLast (), RealLast ());
793 }
794 }
795
796 return (Point);
797
798}
799
800void Visual3d_ViewManager::ConvertCoordWithProj (const Handle(Aspect_Window)& AWindow, const Standard_Integer AU, const Standard_Integer AV, Graphic3d_Vertex& Point, Graphic3d_Vector& Proj) const {
801
81bba717 802// Conversion only if the data is correct
7fd59977 803Graphic3d_CView TheCView;
804
805 if (! ViewExists (AWindow, TheCView)) {
806 Point.SetCoord (RealLast (), RealLast (), RealLast ());
807 Proj.SetCoord (0., 0., 0.);
808 }
809 else {
810Standard_Integer Width, Height;
811Standard_ShortReal x, y, z;
812Standard_ShortReal dx, dy, dz;
813Standard_Boolean Result;
814
815 AWindow->Size (Width, Height);
816
817 Result = MyGraphicDriver->UnProjectRasterWithRay (TheCView,
818 0, 0, Width, Height,
819 AU, AV, x, y, z, dx, dy, dz);
820
81bba717 821 // unproject is done by UnProjectRaster
7fd59977 822 if (Result) {
823 Point.SetCoord
824 (Standard_Real (x), Standard_Real (y), Standard_Real (z));
825 Proj.SetCoord
826 (Standard_Real (dx), Standard_Real (dy), Standard_Real (dz));
827 Proj.Normalize();
828 }
81bba717 829 // unproject cannot be done by UnProjectRaster
830 // Code is suspended since drivers Phigs are Pex abandoned.
7fd59977 831 else {
832
833Standard_Real NPCX, NPCY, NPCZ;
834Standard_Real VRCX, VRCY, VRCZ, VRCT;
835Standard_Real WCX, WCY, WCZ, WCT;
836
837TColStd_Array2OfReal TOri_Matrix (0,3,0,3);
838TColStd_Array2OfReal TMap_Matrix (0,3,0,3);
839TColStd_Array2OfReal TOri_Matrix_Inv (0,3,0,3);
840TColStd_Array2OfReal TMap_Matrix_Inv (0,3,0,3);
841
842Standard_Real Dx, Dy, Ratio;
843Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
844Standard_Integer j;
845
846Standard_Integer stop = 0;
847
848Standard_Boolean BResult;
849
850 j = MyDefinedView.Extent ();
851
852 while ((! stop) && (MyIterator.More ())) {
853 if (TheCView.ViewId ==
854 (MyIterator.Value ())->Identification ()) {
855 TOri_Matrix =
856 (MyIterator.Value ())->MatrixOfOrientation ();
857 TMap_Matrix =
858 (MyIterator.Value ())->MatrixOfMapping ();
859 stop = 1;
860 }
861
81bba717 862 // MyIterator.Next () is located on the next view
7fd59977 863 MyIterator.Next ();
864 }
865
866 // View Mapping Transformation and View Clip, inversion
867 BResult = Aspect::Inverse (TMap_Matrix, TMap_Matrix_Inv);
868
869 // View Orientation Transformation, inversion
870 BResult = Aspect::Inverse (TOri_Matrix, TOri_Matrix_Inv);
871
872 // (AU, AV) : Device Coordinate Space
873 // DCS -> NPCS Normalized Projection Coordinate Space
874 Dx = Standard_Real (Width);
875 Dy = Standard_Real (Height);
876 Ratio = Dx / Dy;
877
878 if (Ratio >= 1.) {
879 NPCX = Standard_Real (AU) / Dx;
880 NPCY = (Dy - Standard_Real (AV)) / Dx;
881 }
882 else {
883 NPCX = Standard_Real (AU) / Dy;
884 NPCY = (Dy - Standard_Real (AV)) / Dy;
885 }
886 NPCZ = 0.0;
887
888 // NPCS -> VRCS View Reference Coordinate Space
889 // PtVRC = Map_Matrix_Inv.Multiplied (PtNPC);
890
891 VRCX = TMap_Matrix_Inv (0, 0) * NPCX
892 + TMap_Matrix_Inv (0, 1) * NPCY
893 + TMap_Matrix_Inv (0, 2) * NPCZ
894 + TMap_Matrix_Inv (0, 3);
895 VRCY = TMap_Matrix_Inv (1, 0) * NPCX
896 + TMap_Matrix_Inv (1, 1) * NPCY
897 + TMap_Matrix_Inv (1, 2) * NPCZ
898 + TMap_Matrix_Inv (1, 3);
899 VRCZ = TMap_Matrix_Inv (2, 0) * NPCX
900 + TMap_Matrix_Inv (2, 1) * NPCY
901 + TMap_Matrix_Inv (2, 2) * NPCZ
902 + TMap_Matrix_Inv (2, 3);
903 VRCT = TMap_Matrix_Inv (3, 0) * NPCX
904 + TMap_Matrix_Inv (3, 1) * NPCY
905 + TMap_Matrix_Inv (3, 2) * NPCZ
906 + TMap_Matrix_Inv (3, 3);
907
908 // VRCS -> WCS World Coordinate Space
909 // PtWC = Ori_Matrix_Inv.Multiplied (PtVRC);
910
911 WCX = TOri_Matrix_Inv (0, 0) * VRCX
912 + TOri_Matrix_Inv (0, 1) * VRCY
913 + TOri_Matrix_Inv (0, 2) * VRCZ
914 + TOri_Matrix_Inv (0, 3) * VRCT;
915 WCY = TOri_Matrix_Inv (1, 0) * VRCX
916 + TOri_Matrix_Inv (1, 1) * VRCY
917 + TOri_Matrix_Inv (1, 2) * VRCZ
918 + TOri_Matrix_Inv (1, 3) * VRCT;
919 WCZ = TOri_Matrix_Inv (2, 0) * VRCX
920 + TOri_Matrix_Inv (2, 1) * VRCY
921 + TOri_Matrix_Inv (2, 2) * VRCZ
922 + TOri_Matrix_Inv (2, 3) * VRCT;
923 WCT = TOri_Matrix_Inv (3, 0) * VRCX
924 + TOri_Matrix_Inv (3, 1) * VRCY
925 + TOri_Matrix_Inv (3, 2) * VRCZ
926 + TOri_Matrix_Inv (3, 3) * VRCT;
927
928 if (WCT != 0.)
929 Point.SetCoord (WCX/WCT, WCY/WCT, WCZ/WCT);
930 else
931 Point.SetCoord (RealLast (), RealLast (), RealLast ());
932
933 // Define projection ray
934 NPCZ = 10.0;
935
936 // NPCS -> VRCS View Reference Coordinate Space
937 // PtVRC = Map_Matrix_Inv.Multiplied (PtNPC);
938
939 VRCX = TMap_Matrix_Inv (0, 0) * NPCX
940 + TMap_Matrix_Inv (0, 1) * NPCY
941 + TMap_Matrix_Inv (0, 2) * NPCZ
942 + TMap_Matrix_Inv (0, 3);
943 VRCY = TMap_Matrix_Inv (1, 0) * NPCX
944 + TMap_Matrix_Inv (1, 1) * NPCY
945 + TMap_Matrix_Inv (1, 2) * NPCZ
946 + TMap_Matrix_Inv (1, 3);
947 VRCZ = TMap_Matrix_Inv (2, 0) * NPCX
948 + TMap_Matrix_Inv (2, 1) * NPCY
949 + TMap_Matrix_Inv (2, 2) * NPCZ
950 + TMap_Matrix_Inv (2, 3);
951 VRCT = TMap_Matrix_Inv (3, 0) * NPCX
952 + TMap_Matrix_Inv (3, 1) * NPCY
953 + TMap_Matrix_Inv (3, 2) * NPCZ
954 + TMap_Matrix_Inv (3, 3);
955
956 // VRCS -> WCS World Coordinate Space
957 // PtWC = Ori_Matrix_Inv.Multiplied (PtVRC);
958
959 WCX = TOri_Matrix_Inv (0, 0) * VRCX
960 + TOri_Matrix_Inv (0, 1) * VRCY
961 + TOri_Matrix_Inv (0, 2) * VRCZ
962 + TOri_Matrix_Inv (0, 3) * VRCT;
963 WCY = TOri_Matrix_Inv (1, 0) * VRCX
964 + TOri_Matrix_Inv (1, 1) * VRCY
965 + TOri_Matrix_Inv (1, 2) * VRCZ
966 + TOri_Matrix_Inv (1, 3) * VRCT;
967 WCZ = TOri_Matrix_Inv (2, 0) * VRCX
968 + TOri_Matrix_Inv (2, 1) * VRCY
969 + TOri_Matrix_Inv (2, 2) * VRCZ
970 + TOri_Matrix_Inv (2, 3) * VRCT;
971 WCT = TOri_Matrix_Inv (3, 0) * VRCX
972 + TOri_Matrix_Inv (3, 1) * VRCY
973 + TOri_Matrix_Inv (3, 2) * VRCZ
974 + TOri_Matrix_Inv (3, 3) * VRCT;
975
976 if (WCT != 0.) {
977 Proj.SetCoord (WCX/WCT, WCY/WCT, WCZ/WCT);
978 Proj.Normalize();
979 }
980 else
981 Proj.SetCoord (0., 0., 0.);
982 }
983 }
984
985}
986
7fd59977 987
988Standard_Boolean Visual3d_ViewManager::ViewExists (const Handle(Aspect_Window)& AWindow, Graphic3d_CView& TheCView) const {
989
990Standard_Boolean Exist = Standard_False;
991
81bba717 992 // Parse the list of views to find
993 // a view with the specified window
7fd59977 994 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
995 int TheWindowIdOfView;
996
997#ifndef WNT
998const Handle(Xw_Window) THEWindow = *(Handle(Xw_Window) *) &AWindow;
999 int TheSpecifiedWindowId = int (THEWindow->XWindow ());
1000#else
1001const Handle(WNT_Window) THEWindow = *(Handle(WNT_Window) *) &AWindow;
1002 int TheSpecifiedWindowId = int (THEWindow->HWindow ());
1003#endif // WNT
1004
1005 while ((! Exist) && (MyIterator.More ())) {
1006
1007 if ( ((MyIterator.Value ())->IsDefined ()) &&
1008 ((MyIterator.Value ())->IsActive ()) ) {
1009
1010const Handle(Aspect_Window) AspectWindow = (MyIterator.Value ())->Window ();
1011#ifndef WNT
1012const Handle(Xw_Window) theWindow = *(Handle(Xw_Window) *) &AspectWindow;
1013 TheWindowIdOfView = int (theWindow->XWindow ());
1014#else
1015const Handle(WNT_Window) theWindow = *(Handle(WNT_Window) *) &AspectWindow;
1016 TheWindowIdOfView = int (theWindow->HWindow ());
1017#endif // WNT
81bba717 1018 // Comparaison on window IDs
7fd59977 1019 if (TheWindowIdOfView == TheSpecifiedWindowId) {
1020 Exist = Standard_True;
1021 TheCView = *(CALL_DEF_VIEW *)(MyIterator.Value ())->CView ();
1022 }
1023 } /* if ((MyIterator.Value ())->IsDefined ()) */
1024
81bba717 1025 // MyIterator.Next () is located on the next view
7fd59977 1026 MyIterator.Next ();
1027 }
1028
1029 return (Exist);
1030
1031}
1032
1033void Visual3d_ViewManager::Activate () {
1034
1035 //
1036 // Activates all deactivated views
1037 //
1038 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
1039
1040#ifdef DEB
1041 Standard_Integer Length = MyDefinedView.Extent ();
1042#else
1043 MyDefinedView.Extent ();
1044#endif
1045
1046 while (MyIterator.More ()) {
1047 if (! (MyIterator.Value ())->IsActive ())
1048 (MyIterator.Value ())->Activate ();
1049
81bba717 1050 // MyIterator.Next () is located on the next view
7fd59977 1051 MyIterator.Next ();
1052 }
1053
1054}
1055
1056void Visual3d_ViewManager::Deactivate () {
1057
1058 //
1059 // Deactivates all activated views
1060 //
1061#ifdef DEB
1062 Standard_Integer Length = MyDefinedView.Extent ();
1063#else
1064 MyDefinedView.Extent ();
1065#endif
1066 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
1067
1068 while (MyIterator.More ()) {
1069 if ((MyIterator.Value ())->IsActive ())
1070 (MyIterator.Value ())->Deactivate ();
1071
81bba717 1072 // MyIterator.Next () is located on the next view
7fd59977 1073 MyIterator.Next ();
1074 }
1075
1076}
1077
1078Standard_Integer Visual3d_ViewManager::MaxNumOfViews () const {
1079
81bba717 1080 // Retourne the planned of definable views for the current
1081 // Visual3d_ViewManager.
7fd59977 1082 return
1083(Standard_Integer ((View_IDMAX-View_IDMIN+1)/Visual3d_ViewManager::Limit ()));
1084
1085}
1086
1087Handle(Graphic3d_Structure) Visual3d_ViewManager::Identification (const Standard_Integer AId) const {
1088
1089 return (Graphic3d_StructureManager::Identification (AId));
1090
1091}
1092
1093Standard_Integer Visual3d_ViewManager::Identification () const {
1094
1095 return (Graphic3d_StructureManager::Identification ());
1096
1097}
1098
1099Standard_Integer Visual3d_ViewManager::Identification (const Handle(Visual3d_View)& AView) {
1100
1101 MyDefinedView.Add (AView);
1102 return (MyViewGenId.Next ());
1103
1104}
1105
1106void Visual3d_ViewManager::UnIdentification (const Standard_Integer aViewId)
1107{
1108 MyViewGenId.Free(aViewId);
1109}
1110
1111void Visual3d_ViewManager::SetTransparency (const Standard_Boolean AFlag) {
1112
1113 if (MyTransparency && AFlag) return;
1114 if (! MyTransparency && ! AFlag) return;
1115
1116 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
1117 while (MyIterator.More ()) {
1118 (MyIterator.Value ())->SetTransparency (AFlag);
81bba717 1119 // MyIterator.Next () is located on the next view
7fd59977 1120 MyIterator.Next ();
1121 }
1122
1123 MyTransparency = AFlag;
1124
1125}
1126
1127Standard_Boolean Visual3d_ViewManager::Transparency () const {
1128
1129 return (MyTransparency);
1130
1131}
1132
1133void Visual3d_ViewManager::SetZBufferAuto (const Standard_Boolean AFlag) {
1134
1135 if (MyZBufferAuto && AFlag) return;
1136 if (! MyZBufferAuto && ! AFlag) return;
1137
81bba717 1138 // if pass from False to True :
1139 // no problem, at the next view update, it
1140 // will properly ask questions to answer (SetVisualisation)
1141 // if pass from True to False :
1142 // it is necessary to modify ZBufferActivity at each view so that
1143 // zbuffer could be active only if required by context.
1144 // In this case -1 is passed so that the view ask itself the question
1145 // Note : 0 forces the desactivation, 1 forces the activation
7fd59977 1146 if (! AFlag) {
1147 Visual3d_SetIteratorOfSetOfView MyIterator(MyDefinedView);
1148 while (MyIterator.More ()) {
1149 (MyIterator.Value ())->SetZBufferActivity (-1);
81bba717 1150 // MyIterator.Next () is located on the next view
7fd59977 1151 MyIterator.Next ();
1152 }
1153 }
1154 MyZBufferAuto = AFlag;
1155
1156}
1157
1158Standard_Boolean Visual3d_ViewManager::ZBufferAuto () const {
1159
1160 return (MyZBufferAuto);
1161
1162}
1163
1164void Visual3d_ViewManager::SetLayer (const Handle(Visual3d_Layer)& ALayer) {
1165
1166#ifdef TRACE_LAYER
1167 cout << "Visual3d_ViewManager::SetLayer\n" << flush;
1168#endif
1169
1170 if (ALayer->Type () == Aspect_TOL_OVERLAY) {
1171#ifdef TRACE_LAYER
1172 if (MyOverLayer.IsNull ())
1173 cout << "MyOverLayer is defined" << endl;
1174 else
1175 cout << "MyOverLayer is redefined" << endl;
1176#endif
1177 MyOverLayer = ALayer;
1178 }
1179 else {
1180#ifdef TRACE_LAYER
1181 if (MyUnderLayer.IsNull ())
1182 cout << "MyUnderLayer is defined" << endl;
1183 else
1184 cout << "MyUnderLayer is redefined" << endl;
1185#endif
1186 MyUnderLayer = ALayer;
1187 }
1188
1189}
1190
1191const Handle(Visual3d_Layer)& Visual3d_ViewManager::UnderLayer () const {
1192
1193 return (MyUnderLayer);
1194
1195}
1196
1197const Handle(Visual3d_Layer)& Visual3d_ViewManager::OverLayer () const {
1198
1199 return (MyOverLayer);
1200
1201}
59f45b7c 1202
1203//=======================================================================
1204//function : ChangeZLayer
1205//purpose :
1206//=======================================================================
1207
1208void Visual3d_ViewManager::ChangeZLayer (const Handle(Graphic3d_Structure)& theStructure,
1209 const Standard_Integer theLayerId)
1210{
1211 if (!myLayerIds.Contains (theLayerId))
1212 return;
1213
1214 // change display layer for structure in all views
1215 if (MyDisplayedStructure.Contains (theStructure))
1216 {
1217 Visual3d_SetIteratorOfSetOfView aViewIt(MyDefinedView);
1218 for ( ; aViewIt.More (); aViewIt.Next ())
1219 (aViewIt.Value ())->ChangeZLayer (theStructure, theLayerId);
1220 }
1221
1222 // tell graphic driver to update the structure's display layer
1223 MyGraphicDriver->ChangeZLayer (
1224 (*(Graphic3d_CStructure*)theStructure->CStructure ()), theLayerId);
1225}
1226
1227//=======================================================================
1228//function : GetZLayer
1229//purpose :
1230//=======================================================================
1231
1232Standard_Integer Visual3d_ViewManager::GetZLayer (const Handle(Graphic3d_Structure)& theStructure) const
1233{
1234 Graphic3d_CStructure& aStructure =
1235 (*(Graphic3d_CStructure*)theStructure->CStructure ());
1236
1237 return MyGraphicDriver->GetZLayer (aStructure);
1238}
1239
1240//=======================================================================
1241//function : AddZLayer
1242//purpose :
1243//=======================================================================
1244
1245Standard_Boolean Visual3d_ViewManager::AddZLayer (Standard_Integer& theLayerId)
1246{
1247 try
1248 {
1249 OCC_CATCH_SIGNALS
1250 theLayerId = getZLayerGenId ().Next ();
1251 myLayerIds.Add (theLayerId);
1252 myLayerSeq.Append (theLayerId);
1253 }
1254 catch (Aspect_IdentDefinitionError)
1255 {
1256 // new index can't be generated
1257 return Standard_False;
1258 }
1259
1260 // tell all managed views to remove display layers
1261 Visual3d_SetIteratorOfSetOfView aViewIt(MyDefinedView);
1262 for ( ; aViewIt.More (); aViewIt.Next ())
1263 (aViewIt.Value ())->AddZLayer (theLayerId);
1264
1265 return Standard_True;
1266}
1267
1268//=======================================================================
1269//function : RemoveZLayer
1270//purpose :
1271//=======================================================================
1272
1273Standard_Boolean Visual3d_ViewManager::RemoveZLayer (const Standard_Integer theLayerId)
1274{
1275 if (!myLayerIds.Contains (theLayerId) || theLayerId == 0)
1276 return Standard_False;
1277
1278 // tell all managed views to remove display layers
1279 Visual3d_SetIteratorOfSetOfView aViewIt(MyDefinedView);
1280 for ( ; aViewIt.More (); aViewIt.Next ())
1281 (aViewIt.Value ())->RemoveZLayer (theLayerId);
1282
1283 MyGraphicDriver->UnsetZLayer (theLayerId);
1284
1285 // remove index
1286 for (int aIdx = 1; aIdx <= myLayerSeq.Length (); aIdx++)
1287 if (myLayerSeq(aIdx) == theLayerId)
1288 {
1289 myLayerSeq.Remove (aIdx);
1290 break;
1291 }
1292
1293 myLayerIds.Remove (theLayerId);
1294 getZLayerGenId ().Free (theLayerId);
1295
1296 return Standard_True;
1297}
1298
1299//=======================================================================
1300//function : GetAllZLayers
1301//purpose :
1302//=======================================================================
1303
1304void Visual3d_ViewManager::GetAllZLayers (TColStd_SequenceOfInteger& theLayerSeq) const
1305{
1306 theLayerSeq.Assign (myLayerSeq);
1307}
1308
1309//=======================================================================
1310//function : getZLayerGenId
1311//purpose :
1312//=======================================================================
1313
1314Aspect_GenId& Visual3d_ViewManager::getZLayerGenId ()
1315{
1316 static Aspect_GenId aGenId (1, IntegerLast());
1317 return aGenId;
1318}