1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 /***********************************************************************
19 Classe Visual3d_ViewManager.cxx :
21 Declaration of variables specific to visualisers
23 HISTORIQUE DES MODIFICATIONS :
24 --------------------------------
25 Mars 1992 : NW,JPB,CAL ; Creation.
26 19-06-96 : FMN ; Suppression variables inutiles
27 04-02-97 : FMN ; Suppression de PSOutput, XWDOutput ...
28 06-05-97 : CAL ; Ajout du Clear sur les TOS_COMPUTED.
29 19-09-97 : CAL ; Remplacement de Window->Position par Window->Size;
30 24-10-97 : CAL ; Retrait de DownCast.
31 20-11-97 : CAL ; Disparition de la dependance avec math
32 01-12-97 : CAL ; Retrait du test IsActive sur l'Update et le Redraw
33 31-12-97 : CAL ; Disparition de MathGra
34 16-01-98 : CAL ; Ajout du SetTransform sur une TOS_COMPUTED
35 11-03-98 : CAL ; Visual3d_ViewManager::Remove ()
36 20-05-98 : CAL ; Perfs. Connection entre structures COMPUTED.
37 10-06-98 : CAL ; Modification des signatures de xxProjectRaster.
38 10-06-98 : CAL ; Modification de la signature de ViewExists.
39 01-12-98 : CAL ; S4062. Ajout des layers.
40 02-12-98 : CAL ; Remove () ne detruit plus les vues.
42 ************************************************************************/
44 /*----------------------------------------------------------------------*/
52 /*----------------------------------------------------------------------*/
58 #include <Visual3d_ViewManager.ixx>
60 #include <Standard_ErrorHandler.hxx>
62 #include <Aspect_IdentDefinitionError.hxx>
64 #include <Graphic3d_GraphicDriver.hxx>
65 #include <Graphic3d_MapOfStructure.hxx>
66 #include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
69 #if defined (_WIN32) || defined(__WIN32__)
70 # include <WNT_Window.hxx>
71 #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
72 # include <Cocoa_Window.hxx>
74 # include <Xw_Window.hxx>
77 // views identifiers : possible range
79 #define View_IDMAX 10000
81 Visual3d_ViewManager::Visual3d_ViewManager (const Handle(Graphic3d_GraphicDriver)& theDriver):
82 Graphic3d_StructureManager (theDriver),
84 MyViewGenId (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),
85 MyZBufferAuto (Standard_False),
86 myZLayerGenId (1, IntegerLast())
88 MyGraphicDriver = theDriver;
90 // default layers are always presented in display layer sequence it can not be removed
91 Graphic3d_ZLayerSettings aDefSettings;
92 aDefSettings.Flags = Graphic3d_ZLayerDepthTest
93 | Graphic3d_ZLayerDepthWrite;
94 aDefSettings.IsImmediate = false;
95 myLayerIds.Add (Graphic3d_ZLayerId_Default);
96 myLayerSeq.Append (Graphic3d_ZLayerId_Default);
97 myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_Default, aDefSettings);
99 Graphic3d_ZLayerSettings aTopSettings;
100 aTopSettings.Flags = Graphic3d_ZLayerDepthTest
101 | Graphic3d_ZLayerDepthWrite;
102 aTopSettings.IsImmediate = true;
103 myLayerIds.Add (Graphic3d_ZLayerId_Top);
104 myLayerSeq.Append (Graphic3d_ZLayerId_Top);
105 myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_Top, aTopSettings);
107 Graphic3d_ZLayerSettings aTopmostSettings;
108 aTopmostSettings.Flags = Graphic3d_ZLayerDepthTest
109 | Graphic3d_ZLayerDepthWrite
110 | Graphic3d_ZLayerDepthClear;
111 aTopmostSettings.IsImmediate = true;
112 myLayerIds.Add (Graphic3d_ZLayerId_Topmost);
113 myLayerSeq.Append (Graphic3d_ZLayerId_Topmost);
114 myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_Topmost, aTopmostSettings);
116 Graphic3d_ZLayerSettings anOsdSettings;
117 anOsdSettings.Flags = 0;
118 anOsdSettings.IsImmediate = true;
119 myLayerIds.Add (Graphic3d_ZLayerId_TopOSD);
120 myLayerSeq.Append (Graphic3d_ZLayerId_TopOSD);
121 myMapOfZLayerSettings.Bind (Graphic3d_ZLayerId_TopOSD, anOsdSettings);
126 void Visual3d_ViewManager::Destroy () {
129 cout << "Visual3d_ViewManager::Destroy (" << MyId << ")\n" << flush;
137 void Visual3d_ViewManager::Remove () {
140 cout << "Visual3d_ViewManager::Remove (" << MyId << ")\n" << flush;
144 // Destroy all defined views
148 cout << "The Manager " << MyId << " have " << Length << " defined views\n";
152 // clear all structures whilst views are alive for correct GPU memory management
153 MyDisplayedStructure.Clear();
154 MyHighlightedStructure.Clear();
156 // clear list of managed views
157 MyDefinedView.Clear();
160 void Visual3d_ViewManager::ChangeDisplayPriority (const Handle(Graphic3d_Structure)& AStructure, const Standard_Integer OldPriority, const Standard_Integer NewPriority)
164 cout << "Visual3d_ViewManager::ChangeDisplayPriority ("
165 << AStructure->Identification ()
166 << ", " << OldPriority << ", " << NewPriority << ")\n";
171 // Change structure priority in all defined views
173 for(int i=1; i<=MyDefinedView.Length(); i++)
175 (MyDefinedView.Value(i))->ChangeDisplayPriority(AStructure, OldPriority, NewPriority);
179 void Visual3d_ViewManager::ReCompute (const Handle(Graphic3d_Structure)& AStructure) {
181 //Standard_Integer LengthD = MyDisplayedStructure.Extent() ();
183 // Even if physically the structure cannot
184 // be displayed (pb of visualisation type)
185 // it has status Displayed.
187 if (!MyDisplayedStructure.Contains(AStructure))
191 // Recompute structure in all activated views
193 for(int i=1; i<=MyDefinedView.Length(); i++)
195 (MyDefinedView.Value(i))->ReCompute(AStructure);
199 void Visual3d_ViewManager::ReCompute (const Handle(Graphic3d_Structure)& AStructure,
200 const Handle(Graphic3d_DataStructureManager)& AProjector)
203 if (! AProjector->IsKind (STANDARD_TYPE (Visual3d_View))) return;
206 Handle(Visual3d_View) theView = Handle(Visual3d_View)::DownCast (AProjector);
208 Handle(Visual3d_View) theView = *(Handle(Visual3d_View) *) &AProjector;
210 Standard_Integer ViewId = theView->Identification ();
212 // Even if physically the structure cannot
213 // be displayed (pb of visualisation type)
214 // it has status Displayed.
215 if (!MyDisplayedStructure.Contains(AStructure))
219 // Recompute structure in all activated views
221 for(int i=1; i<=MyDefinedView.Length(); i++)
223 if ((MyDefinedView.Value(i))->Identification () == ViewId)
225 theView->ReCompute (AStructure);
230 void Visual3d_ViewManager::Clear (const Handle(Graphic3d_Structure)& AStructure, const Standard_Boolean WithDestruction)
232 for(int i=1; i<=MyDefinedView.Length(); i++)
234 (MyDefinedView.Value(i))->Clear(AStructure, WithDestruction);
238 void Visual3d_ViewManager::Connect (const Handle(Graphic3d_Structure)& AMother, const Handle(Graphic3d_Structure)& ADaughter)
240 for(int i=1; i<=MyDefinedView.Length(); i++)
242 (MyDefinedView.Value(i))->Connect (AMother, ADaughter);
246 void Visual3d_ViewManager::Disconnect (const Handle(Graphic3d_Structure)& AMother, const Handle(Graphic3d_Structure)& ADaughter)
248 for(int i=1; i<=MyDefinedView.Length(); i++)
250 (MyDefinedView.Value(i))->Disconnect (AMother, ADaughter);
254 void Visual3d_ViewManager::Display (const Handle(Graphic3d_Structure)& AStructure)
256 // Even if physically the structure cannot
257 // be displayed (pb of visualisation type)
258 // it has status Displayed.
260 MyDisplayedStructure.Add(AStructure);
262 for(int i=1; i<=MyDefinedView.Length(); i++)
264 (MyDefinedView.Value(i))->Display(AStructure);
268 void Visual3d_ViewManager::Erase (const Handle(Graphic3d_Structure)& AStructure)
270 // Even if physically the structure cannot
271 // be displayed (pb of visualisation type)
272 // it has status Displayed.
274 MyDisplayedStructure.Remove(AStructure);
277 // Erase structure in all defined views
279 for(int i=1; i<=MyDefinedView.Length(); i++)
281 (MyDefinedView.Value(i))->Erase (AStructure);
284 MyHighlightedStructure.Remove (AStructure);
287 void Visual3d_ViewManager::Erase () {
289 Graphic3d_MapIteratorOfMapOfStructure it( MyDisplayedStructure);
291 for (; it.More(); it.Next()) {
292 Handle(Graphic3d_Structure) SG = it.Key();
298 void Visual3d_ViewManager::Highlight (const Handle(Graphic3d_Structure)& AStructure, const Aspect_TypeOfHighlightMethod AMethod)
300 MyHighlightedStructure.Add(AStructure);
303 // Highlight in all activated views
306 for(int i=1; i<=MyDefinedView.Length(); i++)
308 (MyDefinedView.Value(i))->Highlight (AStructure, AMethod);
312 void Visual3d_ViewManager::SetTransform (const Handle(Graphic3d_Structure)& AStructure, const TColStd_Array2OfReal& ATrsf)
314 for(int i=1; i<=MyDefinedView.Length(); i++)
316 (MyDefinedView.Value(i))->SetTransform (AStructure, ATrsf);
320 void Visual3d_ViewManager::UnHighlight () {
322 Graphic3d_MapIteratorOfMapOfStructure it(MyHighlightedStructure);
324 for (; it.More(); it.Next()) {
325 Handle(Graphic3d_Structure) SG = it.Key();
332 void Visual3d_ViewManager::UnHighlight (const Handle(Graphic3d_Structure)& AStructure)
334 MyHighlightedStructure.Remove(AStructure);
337 // UnHighlight in all activated views
340 for(int i=1; i<=MyDefinedView.Length(); i++)
342 (MyDefinedView.Value(i))->UnHighlight (AStructure);
346 void Visual3d_ViewManager::Redraw() const
348 // redraw all activated views
349 if (MyDefinedView.Length() == 0)
354 if (!MyUnderLayer.IsNull() || !MyOverLayer.IsNull())
356 Standard_Integer aWidth = 0, aHeight = 0;
357 Standard_Integer aWidthMax = 0;
358 Standard_Integer aHeightMax = 0;
360 for(int i=1; i<=MyDefinedView.Length(); i++)
362 MyDefinedView.Value(i)->Window()->Size (aWidth, aHeight);
363 aWidthMax = Max (aWidthMax, aWidth);
364 aHeightMax = Max (aHeightMax, aHeight);
367 if (!MyUnderLayer.IsNull())
369 MyUnderLayer->SetViewport (aWidthMax, aHeightMax);
371 if (!MyOverLayer.IsNull())
373 MyOverLayer->SetViewport (aWidthMax, aHeightMax);
377 for(int i=1; i<=MyDefinedView.Length(); i++)
379 MyDefinedView.Value(i)->Redraw (MyUnderLayer, MyOverLayer);
383 void Visual3d_ViewManager::Update() const
388 void Visual3d_ViewManager::RedrawImmediate() const
390 if (MyDefinedView.Length() == 0)
395 // update all activated views
396 for(int i=1; i<=MyDefinedView.Length(); i++)
398 MyDefinedView.Value(i)->RedrawImmediate (MyUnderLayer, MyOverLayer);
402 void Visual3d_ViewManager::Invalidate() const
404 if (MyDefinedView.Length() == 0)
409 // update all activated views
410 for(int i=1; i<=MyDefinedView.Length(); i++)
412 MyDefinedView.Value(i)->Invalidate();
416 Handle(Visual3d_HSequenceOfView) Visual3d_ViewManager::ActivatedView () const
419 Handle(Visual3d_HSequenceOfView) SG = new Visual3d_HSequenceOfView();
421 for(int i=1; i<=MyDefinedView.Length(); i++)
423 if ((MyDefinedView.Value(i))->IsActive ())
425 SG->Append(MyDefinedView.Value(i));
433 Standard_Boolean Visual3d_ViewManager::ContainsComputedStructure () const
435 Standard_Boolean Result = Standard_False;
438 // Check all activated views
440 for(int i=1; (!Result) && i<=MyDefinedView.Length(); i++)
442 if ((MyDefinedView.Value(i))->IsActive())
444 Result = (MyDefinedView.Value(i))->ContainsComputedStructure();
452 const Visual3d_SequenceOfView& Visual3d_ViewManager::DefinedViews() const
454 return MyDefinedView;
457 Standard_Boolean Visual3d_ViewManager::ViewExists (const Handle(Aspect_Window)& AWindow, Graphic3d_CView& TheCView) const
459 Standard_Boolean Exist = Standard_False;
461 // Parse the list of views to find
462 // a view with the specified window
465 const Handle(WNT_Window) THEWindow = Handle(WNT_Window)::DownCast (AWindow);
466 Aspect_Handle TheSpecifiedWindowId = THEWindow->HWindow ();
467 #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
468 const Handle(Cocoa_Window) THEWindow = Handle(Cocoa_Window)::DownCast (AWindow);
469 NSView* TheSpecifiedWindowId = THEWindow->HView();
470 #elif defined(__ANDROID__)
471 int TheSpecifiedWindowId = -1;
473 const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow);
474 int TheSpecifiedWindowId = int (THEWindow->XWindow ());
477 for(int i=1; (!Exist) && i<=MyDefinedView.Length(); i++)
479 if ( ((MyDefinedView.Value(i))->IsDefined ()) && ((MyDefinedView.Value(i))->IsActive ()) )
481 const Handle(Aspect_Window) AspectWindow = (MyDefinedView.Value(i))->Window();
484 const Handle(WNT_Window) theWindow = Handle(WNT_Window)::DownCast (AspectWindow);
485 Aspect_Handle TheWindowIdOfView = theWindow->HWindow ();
486 #elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
487 const Handle(Cocoa_Window) theWindow = Handle(Cocoa_Window)::DownCast (AspectWindow);
488 NSView* TheWindowIdOfView = theWindow->HView();
489 #elif defined(__ANDROID__)
490 int TheWindowIdOfView = 0;
492 const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);
493 int TheWindowIdOfView = int (theWindow->XWindow ());
495 // Comparaison on window IDs
496 if (TheWindowIdOfView == TheSpecifiedWindowId)
498 Exist = Standard_True;
499 TheCView = *(Graphic3d_CView* )(MyDefinedView.Value(i))->CView();
507 void Visual3d_ViewManager::Activate ()
510 // Activates all deactivated views
512 for(int i=1; i<=MyDefinedView.Length(); i++)
514 if (! (MyDefinedView.Value(i))->IsActive())
516 (MyDefinedView.Value(i))->Activate();
521 void Visual3d_ViewManager::Deactivate ()
524 // Deactivates all activated views
526 for(int i=1; i<=MyDefinedView.Length(); i++)
528 if ((MyDefinedView.Value(i))->IsActive())
530 (MyDefinedView.Value(i))->Deactivate();
536 Standard_Integer Visual3d_ViewManager::MaxNumOfViews () const {
538 // Retourne the planned of definable views for the current
539 // Visual3d_ViewManager.
541 (Standard_Integer ((View_IDMAX-View_IDMIN+1)/Visual3d_ViewManager::Limit ()));
545 Handle(Graphic3d_Structure) Visual3d_ViewManager::Identification (const Standard_Integer AId) const {
547 return (Graphic3d_StructureManager::Identification (AId));
551 Standard_Integer Visual3d_ViewManager::Identification () const {
553 return (Graphic3d_StructureManager::Identification ());
557 Standard_Integer Visual3d_ViewManager::Identification (const Handle(Visual3d_View)& AView)
559 MyDefinedView.Append(AView);
560 return (MyViewGenId.Next ());
563 void Visual3d_ViewManager::UnIdentification (const Standard_Integer aViewId)
565 for(int i=1; i<=MyDefinedView.Length(); i++)
567 if ((MyDefinedView.Value(i))->Identification() == aViewId)
569 //remove the view from the list
570 MyDefinedView.Remove(i);
575 MyViewGenId.Free(aViewId);
578 void Visual3d_ViewManager::SetZBufferAuto (const Standard_Boolean AFlag)
580 if (MyZBufferAuto && AFlag) return;
581 if (! MyZBufferAuto && ! AFlag) return;
583 // if pass from False to True :
584 // no problem, at the next view update, it
585 // will properly ask questions to answer (SetVisualisation)
586 // if pass from True to False :
587 // it is necessary to modify ZBufferActivity at each view so that
588 // zbuffer could be active only if required by context.
589 // In this case -1 is passed so that the view ask itself the question
590 // Note : 0 forces the desactivation, 1 forces the activation
593 for(int i=1; i<=MyDefinedView.Length(); i++)
595 (MyDefinedView.Value(i))->SetZBufferActivity(-1);
598 MyZBufferAuto = AFlag;
601 Standard_Boolean Visual3d_ViewManager::ZBufferAuto () const
603 return (MyZBufferAuto);
606 void Visual3d_ViewManager::SetLayer (const Handle(Visual3d_Layer)& ALayer) {
609 cout << "Visual3d_ViewManager::SetLayer\n" << flush;
612 if (ALayer->Type () == Aspect_TOL_OVERLAY) {
614 if (MyOverLayer.IsNull ())
615 cout << "MyOverLayer is defined" << endl;
617 cout << "MyOverLayer is redefined" << endl;
619 MyOverLayer = ALayer;
623 if (MyUnderLayer.IsNull ())
624 cout << "MyUnderLayer is defined" << endl;
626 cout << "MyUnderLayer is redefined" << endl;
628 MyUnderLayer = ALayer;
633 const Handle(Visual3d_Layer)& Visual3d_ViewManager::UnderLayer () const {
635 return (MyUnderLayer);
639 const Handle(Visual3d_Layer)& Visual3d_ViewManager::OverLayer () const {
641 return (MyOverLayer);
645 //=======================================================================
646 //function : ChangeZLayer
648 //=======================================================================
650 void Visual3d_ViewManager::ChangeZLayer (const Handle(Graphic3d_Structure)& theStructure,
651 const Graphic3d_ZLayerId theLayerId)
653 if (!myLayerIds.Contains (theLayerId)
654 || !MyDisplayedStructure.Contains (theStructure))
659 // change display layer for structure in all views
660 for (int aViewIter = 1; aViewIter <= MyDefinedView.Length(); ++aViewIter)
662 MyDefinedView.Value (aViewIter)->ChangeZLayer (theStructure, theLayerId);
666 //=======================================================================
667 //function : SetZLayerSettings
669 //=======================================================================
670 void Visual3d_ViewManager::SetZLayerSettings (const Graphic3d_ZLayerId theLayerId,
671 const Graphic3d_ZLayerSettings& theSettings)
673 // tell all managed views to set zlayer settings
674 for(int i=1; i<=MyDefinedView.Length(); i++)
676 (MyDefinedView.Value(i))->SetZLayerSettings (theLayerId, theSettings);
679 if (myMapOfZLayerSettings.IsBound (theLayerId))
681 myMapOfZLayerSettings.ChangeFind (theLayerId) = theSettings;
685 myMapOfZLayerSettings.Bind (theLayerId, theSettings);
690 //=======================================================================
691 //function : ZLayerSettings
693 //=======================================================================
694 Graphic3d_ZLayerSettings Visual3d_ViewManager::ZLayerSettings (const Graphic3d_ZLayerId theLayerId)
696 if (!myLayerIds.Contains (theLayerId))
698 return Graphic3d_ZLayerSettings();
701 return myMapOfZLayerSettings.Find (theLayerId);
704 //=======================================================================
705 //function : AddZLayer
707 //=======================================================================
709 Standard_Boolean Visual3d_ViewManager::AddZLayer (Graphic3d_ZLayerId& theLayerId)
714 theLayerId = myZLayerGenId.Next();
715 myLayerIds.Add (theLayerId);
716 myLayerSeq.Append (theLayerId);
718 catch (Aspect_IdentDefinitionError)
720 // new index can't be generated
721 return Standard_False;
724 // default z-layer settings
725 myMapOfZLayerSettings.Bind (theLayerId, Graphic3d_ZLayerSettings());
727 // tell all managed views to remove display layers
728 for(int i=1; i<=MyDefinedView.Length(); i++)
730 (MyDefinedView.Value(i))->AddZLayer(theLayerId);
733 return Standard_True;
736 //=======================================================================
737 //function : RemoveZLayer
739 //=======================================================================
741 Standard_Boolean Visual3d_ViewManager::RemoveZLayer (const Graphic3d_ZLayerId theLayerId)
743 if (!myLayerIds.Contains (theLayerId)
744 || theLayerId < myZLayerGenId.Lower()
745 || theLayerId > myZLayerGenId.Upper())
747 return Standard_False;
750 // tell all managed views to remove display layers
751 for(int i=1; i<=MyDefinedView.Length(); i++)
753 (MyDefinedView.Value(i))->RemoveZLayer (theLayerId);
756 MyGraphicDriver->UnsetZLayer (theLayerId);
759 for (int aIdx = 1; aIdx <= myLayerSeq.Length (); aIdx++)
761 if (myLayerSeq (aIdx) == theLayerId)
763 myLayerSeq.Remove (aIdx);
768 myMapOfZLayerSettings.UnBind (theLayerId);
770 myLayerIds.Remove (theLayerId);
771 myZLayerGenId.Free (theLayerId);
773 return Standard_True;
776 //=======================================================================
777 //function : GetAllZLayers
779 //=======================================================================
781 void Visual3d_ViewManager::GetAllZLayers (TColStd_SequenceOfInteger& theLayerSeq) const
783 theLayerSeq.Assign (myLayerSeq);
786 //=======================================================================
787 //function : InstallZLayers
789 //=======================================================================
791 void Visual3d_ViewManager::InstallZLayers(const Handle(Visual3d_View)& theView) const
793 Standard_Boolean isContainsView = Standard_False;
794 for(int i=1; i<=MyDefinedView.Length(); i++)
796 if(MyDefinedView.Value(i) == theView)
798 isContainsView = Standard_True;
805 // erase and insert layers iteratively to provide the same layer order as
806 // in the view manager's sequence. This approach bases on the layer insertion
807 // order: the new layers are always appended to the end of the list
808 // inside of view, while layer remove operation doesn't affect the order.
809 // Starting from second layer : no need to change the default z layer.
810 for (Standard_Integer aSeqIdx = 1; aSeqIdx <= myLayerSeq.Length(); ++aSeqIdx)
812 const Graphic3d_ZLayerId aLayerID = myLayerSeq.Value (aSeqIdx);
813 const Graphic3d_ZLayerSettings& aSettings = myMapOfZLayerSettings.Find (aLayerID);
814 if (aLayerID < myZLayerGenId.Lower()
815 || aLayerID > myZLayerGenId.Upper())
817 theView->SetZLayerSettings (aLayerID, aSettings);
821 theView->RemoveZLayer (aLayerID);
822 theView->AddZLayer (aLayerID);
823 theView->SetZLayerSettings (aLayerID, aSettings);