1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <inspector/VInspector_Window.hxx>
18 #include <AIS_Shape.hxx>
20 #include <inspector/TreeModel_ColumnType.hxx>
21 #include <inspector/TreeModel_ContextMenu.hxx>
22 #include <inspector/TreeModel_Tools.hxx>
24 #include <inspector/ViewControl_MessageDialog.hxx>
25 #include <inspector/ViewControl_Tools.hxx>
27 #include <inspector/VInspector_ItemPresentableObject.hxx>
28 #include <inspector/VInspector_ToolBar.hxx>
29 #include <inspector/VInspector_Tools.hxx>
30 #include <inspector/VInspector_ViewModel.hxx>
31 #include <inspector/VInspector_CallBack.hxx>
32 #include <inspector/VInspector_Communicator.hxx>
33 #include <inspector/VInspector_ItemEntityOwner.hxx>
34 #include <inspector/VInspector_ItemPresentableObject.hxx>
35 #include <inspector/VInspector_ToolBar.hxx>
36 #include <inspector/VInspector_Tools.hxx>
37 #include <inspector/VInspector_ViewModel.hxx>
38 #include <inspector/VInspector_ViewModelHistory.hxx>
40 #include <inspector/ViewControl_TreeView.hxx>
42 #include <inspector/View_Widget.hxx>
43 #include <inspector/View_Window.hxx>
45 #include <Standard_WarningsDisable.hxx>
46 #include <QApplication>
47 #include <QDockWidget>
48 #include <QHeaderView>
49 #include <QGridLayout>
50 #include <QItemSelectionModel>
51 #include <QMainWindow>
53 #include <QMessageBox>
54 #include <QToolButton>
57 #include <Standard_WarningsRestore.hxx>
59 const int VINSPECTOR_DEFAULT_WIDTH = 1250;
60 const int VINSPECTOR_DEFAULT_HEIGHT = 800;
62 const int VINSPECTOR_DEFAULT_POSITION_X = 200;
63 const int VINSPECTOR_DEFAULT_POSITION_Y = 60;
65 const int VINSPECTOR_DEFAULT_VIEW_WIDTH = 400;
66 const int VINSPECTOR_DEFAULT_VIEW_HEIGHT = 1000;
68 const int VINSPECTOR_DEFAULT_HISTORY_VIEW_WIDTH = 400;
69 const int VINSPECTOR_DEFAULT_HISTORY_VIEW_HEIGHT = 50;
71 const int VINSPECTOR_DEFAULT_VIEW_POSITION_X = 200 + 900 + 100; // TINSPECTOR_DEFAULT_POSITION_X + TINSPECTOR_DEFAULT_WIDTH + 100
72 const int VINSPECTOR_DEFAULT_VIEW_POSITION_Y = 60; // TINSPECTOR_DEFAULT_POSITION_Y + 50
74 // =======================================================================
75 // function : Constructor
77 // =======================================================================
78 VInspector_Window::VInspector_Window()
79 : myParent (0), myExportToShapeViewDialog (0), myViewWindow (0)
81 myMainWindow = new QMainWindow (0);
83 QWidget* aCentralWidget = new QWidget (myMainWindow);
84 QGridLayout* aParentLay = new QGridLayout (aCentralWidget);
85 aParentLay->setContentsMargins (0, 0, 0, 0);
86 aParentLay->setSpacing(0);
88 // restore state of tool bar: on the bottom of the window
89 myToolBar = new VInspector_ToolBar(aCentralWidget);
90 connect (myToolBar, SIGNAL (actionClicked (int)), this, SLOT (onToolBarActionClicked (int)));
91 aParentLay->addWidget (myToolBar->GetControl(), 0, 0);
94 myTreeView = new QTreeView (aCentralWidget);
95 myTreeView->setSelectionBehavior (QAbstractItemView::SelectRows);
96 myTreeView->setSelectionMode (QAbstractItemView::ExtendedSelection);
97 myTreeView->header()->setStretchLastSection (true);
98 myTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
99 VInspector_ViewModel* aTreeModel = new VInspector_ViewModel (myTreeView);
100 myTreeView->setModel (aTreeModel);
101 // hide Visibility column
102 TreeModel_HeaderSection anItem = aTreeModel->GetHeaderItem ((int)TreeModel_ColumnType_Visibility);
103 anItem.SetIsHidden (true);
104 aTreeModel->SetHeaderItem ((int)TreeModel_ColumnType_Visibility, anItem);
106 connect (myTreeView, SIGNAL(customContextMenuRequested(const QPoint&)),
107 this, SLOT (onTreeViewContextMenuRequested(const QPoint&)));
108 new TreeModel_ContextMenu (myTreeView);
110 QItemSelectionModel* aSelModel = new QItemSelectionModel (myTreeView->model(), myTreeView);
111 myTreeView->setSelectionModel (aSelModel);
112 connect (aSelModel, SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)),
113 this, SLOT (onSelectionChanged (const QItemSelection&, const QItemSelection&)));
115 aParentLay->addWidget(myTreeView, 1, 0);
116 aParentLay->setRowStretch (1, 1);
117 myMainWindow->setCentralWidget (aCentralWidget);
119 myHistoryView = new ViewControl_TreeView (myMainWindow);
120 myHistoryView->setSelectionBehavior (QAbstractItemView::SelectRows);
121 ((ViewControl_TreeView*)myHistoryView)->SetPredefinedSize (QSize (VINSPECTOR_DEFAULT_HISTORY_VIEW_WIDTH,
122 VINSPECTOR_DEFAULT_HISTORY_VIEW_HEIGHT));
123 myHistoryView->setContextMenuPolicy (Qt::CustomContextMenu);
124 myHistoryView->header()->setStretchLastSection (true);
125 new TreeModel_ContextMenu (myHistoryView);
127 myHistoryView->setSelectionMode (QAbstractItemView::ExtendedSelection);
128 VInspector_ViewModelHistory* aHistoryModel = new VInspector_ViewModelHistory (myHistoryView);
129 myHistoryView->setModel (aHistoryModel);
131 QItemSelectionModel* aSelectionModel = new QItemSelectionModel (aHistoryModel);
132 myHistoryView->setSelectionModel (aSelectionModel);
133 connect (aSelectionModel, SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)),
134 this, SLOT (onHistoryViewSelectionChanged (const QItemSelection&, const QItemSelection&)));
136 anItem = aHistoryModel->GetHeaderItem (0);
137 TreeModel_Tools::UseVisibilityColumn (myHistoryView, false);
138 // hide Visibility column
139 anItem = aHistoryModel->GetHeaderItem ((int)TreeModel_ColumnType_Visibility);
140 anItem.SetIsHidden (true);
141 aHistoryModel->SetHeaderItem ((int)TreeModel_ColumnType_Visibility, anItem);
143 QModelIndex aParentIndex = myHistoryView->model()->index (0, 0);
144 myHistoryView->setExpanded (aParentIndex, true);
146 QDockWidget* aHistoryDockWidget = new QDockWidget (tr ("HistoryView"), myMainWindow);
147 aHistoryDockWidget->setObjectName (aHistoryDockWidget->windowTitle());
148 aHistoryDockWidget->setTitleBarWidget (new QWidget(myMainWindow));
149 aHistoryDockWidget->setWidget (myHistoryView);
150 myMainWindow->addDockWidget (Qt::BottomDockWidgetArea, aHistoryDockWidget);
152 myMainWindow->resize (450, 800);
153 myMainWindow->move (60, 20);
155 myMainWindow->resize (VINSPECTOR_DEFAULT_WIDTH, VINSPECTOR_DEFAULT_HEIGHT);
156 myMainWindow->move (VINSPECTOR_DEFAULT_POSITION_X, VINSPECTOR_DEFAULT_POSITION_Y);
159 // =======================================================================
160 // function : SetParent
162 // =======================================================================
163 void VInspector_Window::SetParent (void* theParent)
165 myParent = (QWidget*)theParent;
169 QLayout* aLayout = myParent->layout();
171 aLayout->addWidget (GetMainWindow());
174 // =======================================================================
175 // function : FillActionsMenu
177 // =======================================================================
178 void VInspector_Window::FillActionsMenu (void* theMenu)
180 QMenu* aMenu = (QMenu*)theMenu;
181 QList<QDockWidget*> aDockwidgets = myMainWindow->findChildren<QDockWidget*>();
182 for (QList<QDockWidget*>::iterator it = aDockwidgets.begin(); it != aDockwidgets.end(); ++it)
184 QDockWidget* aDockWidget = *it;
185 if (aDockWidget->parentWidget() == myMainWindow)
186 aMenu->addAction (aDockWidget->toggleViewAction());
190 // =======================================================================
191 // function : GetPreferences
193 // =======================================================================
194 void VInspector_Window::GetPreferences (TInspectorAPI_PreferencesDataMap& theItem)
196 theItem.Bind ("geometry", TreeModel_Tools::ToString (myMainWindow->saveState()).toStdString().c_str());
198 QMap<QString, QString> anItems;
199 TreeModel_Tools::SaveState (myTreeView, anItems);
200 for (QMap<QString, QString>::const_iterator anItemsIt = anItems.begin(); anItemsIt != anItems.end(); anItemsIt++)
202 theItem.Bind (anItemsIt.key().toStdString().c_str(), anItemsIt.value().toStdString().c_str());
206 TreeModel_Tools::SaveState (myHistoryView, anItems, "history_view_");
207 for (QMap<QString, QString>::const_iterator anItemsIt = anItems.begin(); anItemsIt != anItems.end(); anItemsIt++)
208 theItem.Bind (anItemsIt.key().toStdString().c_str(), anItemsIt.value().toStdString().c_str());
211 // =======================================================================
212 // function : SetPreferences
214 // =======================================================================
215 void VInspector_Window::SetPreferences (const TInspectorAPI_PreferencesDataMap& theItem)
217 if (theItem.IsEmpty())
219 TreeModel_Tools::SetDefaultHeaderSections (myTreeView);
220 TreeModel_Tools::SetDefaultHeaderSections (myHistoryView);
224 for (TInspectorAPI_IteratorOfPreferencesDataMap anItemIt (theItem); anItemIt.More(); anItemIt.Next())
226 if (anItemIt.Key().IsEqual ("geometry"))
227 myMainWindow->restoreState (TreeModel_Tools::ToByteArray (anItemIt.Value().ToCString()));
228 else if (TreeModel_Tools::RestoreState (myTreeView, anItemIt.Key().ToCString(), anItemIt.Value().ToCString()))
230 else if (TreeModel_Tools::RestoreState (myHistoryView, anItemIt.Key().ToCString(), anItemIt.Value().ToCString(),
236 // =======================================================================
237 // function : UpdateContent
239 // =======================================================================
240 void VInspector_Window::UpdateContent()
242 TCollection_AsciiString aName = "TKVInspector";
244 bool isModelUpdated = false;
245 if (myParameters->FindParameters (aName))
246 isModelUpdated = Init (myParameters->Parameters (aName));
247 if (myParameters->FindFileNames (aName))
249 for (NCollection_List<TCollection_AsciiString>::Iterator aFileNamesIt (myParameters->FileNames (aName));
250 aFileNamesIt.More(); aFileNamesIt.Next())
251 isModelUpdated = OpenFile (aFileNamesIt.Value()) || isModelUpdated;
253 NCollection_List<TCollection_AsciiString> aNames;
254 myParameters->SetFileNames (aName, aNames);
259 // make AIS_InteractiveObject selected selected if exist in select parameters
260 NCollection_List<Handle(Standard_Transient)> anObjects;
261 VInspector_ViewModel* aViewModel = dynamic_cast<VInspector_ViewModel*>(myTreeView->model());
262 if (aViewModel && myParameters->GetSelectedObjects(aName, anObjects))
264 QItemSelectionModel* aSelectionModel = myTreeView->selectionModel();
265 aSelectionModel->clear();
266 for (NCollection_List<Handle(Standard_Transient)>::Iterator aParamsIt (anObjects);
267 aParamsIt.More(); aParamsIt.Next())
269 Handle(Standard_Transient) anObject = aParamsIt.Value();
270 Handle(AIS_InteractiveObject) aPresentation = Handle(AIS_InteractiveObject)::DownCast (anObject);
271 if (aPresentation.IsNull())
274 QModelIndex aPresentationIndex = aViewModel->FindIndex (aPresentation);
275 if (!aPresentationIndex.isValid())
277 aSelectionModel->select (aPresentationIndex, QItemSelectionModel::Select);
278 myTreeView->scrollTo (aPresentationIndex);
283 // =======================================================================
286 // =======================================================================
287 bool VInspector_Window::Init (const NCollection_List<Handle(Standard_Transient)>& theParameters)
289 Handle(AIS_InteractiveContext) aContext;
290 Handle(VInspector_CallBack) aCallBack;
292 for (NCollection_List<Handle(Standard_Transient)>::Iterator aParamsIt (theParameters); aParamsIt.More(); aParamsIt.Next())
294 Handle(Standard_Transient) anObject = aParamsIt.Value();
295 if (aContext.IsNull())
296 aContext = Handle(AIS_InteractiveContext)::DownCast (anObject);
298 if (aCallBack.IsNull())
299 aCallBack = Handle(VInspector_CallBack)::DownCast (anObject);
301 if (aContext.IsNull())
303 VInspector_ViewModel* aViewModel = dynamic_cast<VInspector_ViewModel*> (myTreeView->model());
304 if (aViewModel && aViewModel->GetContext() == aContext)
307 SetContext (aContext);
309 if (!aCallBack.IsNull() && aCallBack != myCallBack)
311 myCallBack = aCallBack;
312 VInspector_ViewModelHistory* aHistoryModel = dynamic_cast<VInspector_ViewModelHistory*>
313 (myHistoryView->model());
314 myCallBack->SetContext(aContext);
315 myCallBack->SetHistoryModel(aHistoryModel);
320 // =======================================================================
321 // function : SetContext
323 // =======================================================================
324 void VInspector_Window::SetContext (const Handle(AIS_InteractiveContext)& theContext)
326 VInspector_ViewModel* aViewModel = dynamic_cast<VInspector_ViewModel*> (myTreeView->model());
327 aViewModel->SetContext (theContext);
328 myTreeView->setExpanded (aViewModel->index (0, 0), true);
330 if (!myCallBack.IsNull())
331 myCallBack->SetContext (theContext);
334 // =======================================================================
335 // function : OpenFile
337 // =======================================================================
338 bool VInspector_Window::OpenFile(const TCollection_AsciiString& theFileName)
340 VInspector_ViewModel* aViewModel = dynamic_cast<VInspector_ViewModel*> (myTreeView->model());
344 Handle(AIS_InteractiveContext) aContext = aViewModel->GetContext();
345 bool isModelUpdated = false;
346 if (aContext.IsNull())
348 aContext = createView();
349 SetContext (aContext);
350 isModelUpdated = true;
353 TopoDS_Shape aShape = VInspector_Tools::ReadShape (theFileName);
355 return isModelUpdated;
357 Handle(AIS_Shape) aPresentation = new AIS_Shape (aShape);
358 aContext->Display (aPresentation, false);
359 aContext->Load (aPresentation, -1/*selection mode*/);
360 aContext->UpdateCurrentViewer();
363 myTreeView->setExpanded (aViewModel->index (0, 0), true);
367 // =======================================================================
368 // function : onTreeViewContextMenuRequested
370 // =======================================================================
371 void VInspector_Window::onTreeViewContextMenuRequested(const QPoint& thePosition)
373 QMenu* aMenu = new QMenu (GetMainWindow());
374 aMenu->addAction (ViewControl_Tools::CreateAction (tr ("Export to ShapeView"), SLOT (onExportToShapeView()), GetMainWindow(), this));
375 aMenu->addAction (ViewControl_Tools::CreateAction (tr ("Show"), SLOT (onShow()), GetMainWindow(), this));
376 aMenu->addAction (ViewControl_Tools::CreateAction (tr ("Hide"), SLOT (onHide()), GetMainWindow(), this));
377 QPoint aPoint = myTreeView->mapToGlobal (thePosition);
381 // =======================================================================
382 // function : onToolBarActionClicked
384 // =======================================================================
385 void VInspector_Window::onToolBarActionClicked (const int theActionId)
387 VInspector_ViewModel* aViewModel = dynamic_cast<VInspector_ViewModel*> (myTreeView->model());
393 case VInspector_ToolActionType_UpdateId:
398 case VInspector_ToolActionType_SelectPresentationsId:
400 bool isChecked = myToolBar->GetToolButton((VInspector_ToolActionType)theActionId)->isChecked();
401 NCollection_List<Handle(AIS_InteractiveObject)> aPresentationsForViewer;
403 aPresentationsForViewer = VInspector_ItemPresentableObject::GetSelectedPresentations(myTreeView->selectionModel());
404 Handle(AIS_InteractiveContext) aContext = aViewModel->GetContext();
405 VInspector_Tools::AddOrRemovePresentations(aContext, aPresentationsForViewer);
409 case VInspector_ToolActionType_SelectOwnersId:
411 NCollection_List<Handle(SelectBasics_EntityOwner)> anOwnersForViewer;
412 if (myToolBar->GetToolButton((VInspector_ToolActionType)theActionId)->isChecked())
413 VInspector_ViewModel::GetSelectedOwners(myTreeView->selectionModel(), anOwnersForViewer);
414 VInspector_Tools::AddOrRemoveSelectedShapes(aViewModel->GetContext(), anOwnersForViewer);
423 // =======================================================================
424 // function : onSelectionChanged
426 // =======================================================================
427 void VInspector_Window::onSelectionChanged (const QItemSelection&,
428 const QItemSelection&)
430 QApplication::setOverrideCursor (Qt::WaitCursor);
432 if (myToolBar->GetToolButton(VInspector_ToolActionType_SelectPresentationsId)->isChecked())
433 onToolBarActionClicked(VInspector_ToolActionType_SelectPresentationsId);
434 else if (myToolBar->GetToolButton(VInspector_ToolActionType_SelectOwnersId)->isChecked())
435 onToolBarActionClicked(VInspector_ToolActionType_SelectOwnersId);
437 QApplication::restoreOverrideCursor();
440 // =======================================================================
441 // function : onHistoryViewSelectionChanged
443 // =======================================================================
444 void VInspector_Window::onHistoryViewSelectionChanged (const QItemSelection& theSelected,
445 const QItemSelection&)
447 VInspector_ViewModelHistory* aHistoryModel = dynamic_cast<VInspector_ViewModelHistory*> (myHistoryView->model());
451 if (theSelected.size() == 0)
454 QModelIndexList aSelectedIndices = theSelected.indexes();
455 QStringList aPointers = aHistoryModel->GetSelectedPointers(aSelectedIndices.first());
457 VInspector_ViewModel* aTreeModel = dynamic_cast<VInspector_ViewModel*> (myTreeView->model());
461 QModelIndexList anIndices = aTreeModel->FindPointers (aPointers);
462 QItemSelectionModel* aSelectionModel = myTreeView->selectionModel();
463 aSelectionModel->clear();
464 for (int anIndicesId = 0, aSize = anIndices.size(); anIndicesId < aSize; anIndicesId++)
466 QModelIndex anIndex = anIndices[anIndicesId];
467 myTreeView->setExpanded (aTreeModel->parent (anIndex), true);
468 aSelectionModel->select (anIndex, QItemSelectionModel::Select);
472 // =======================================================================
473 // function : onExportToShapeView
475 // =======================================================================
476 void VInspector_Window::onExportToShapeView()
478 NCollection_List<Handle(AIS_InteractiveObject)> aSelectedPresentations =
479 VInspector_ItemPresentableObject::GetSelectedPresentations(myTreeView->selectionModel());
480 if (aSelectedPresentations.Extent() <= 0)
483 TCollection_AsciiString aPluginName ("TKShapeView");
484 NCollection_List<Handle(Standard_Transient)> aParameters;
485 if (myParameters->FindParameters (aPluginName))
486 aParameters = myParameters->Parameters (aPluginName);
488 NCollection_List<TCollection_AsciiString> anItemNames;
489 if (myParameters->FindSelectedNames (aPluginName))
490 anItemNames = myParameters->GetSelectedNames (aPluginName);
492 QStringList anExportedPointers;
493 for (NCollection_List<Handle(AIS_InteractiveObject)>::Iterator anIOIt (aSelectedPresentations); anIOIt.More(); anIOIt.Next())
495 Handle(AIS_Shape) aShapePresentation = Handle(AIS_Shape)::DownCast (anIOIt.Value());
496 if (aShapePresentation.IsNull())
499 const TopoDS_Shape& aShape = aShapePresentation->Shape();
502 aParameters.Append (aShape.TShape());
503 anItemNames.Append (TInspectorAPI_PluginParameters::ParametersToString(aShape));
504 anExportedPointers.append (VInspector_Tools::GetPointerInfo (aShape.TShape(), true).ToCString());
506 if (anExportedPointers.empty())
509 TCollection_AsciiString aPluginShortName = aPluginName.SubString (3, aPluginName.Length());
510 QString aMessage = QString ("TShape %1 is sent to %2.")
511 .arg (anExportedPointers.join(", "))
512 .arg (aPluginShortName.ToCString());
513 QString aQuestion = QString ("Would you like to activate %1 immediately?\n")
514 .arg (aPluginShortName.ToCString()).toStdString().c_str();
515 if (!myExportToShapeViewDialog)
516 myExportToShapeViewDialog = new ViewControl_MessageDialog (myParent, aMessage, aQuestion);
518 myExportToShapeViewDialog->SetInformation (aMessage);
519 myExportToShapeViewDialog->Start();
521 myParameters->SetSelectedNames (aPluginName, anItemNames);
522 myParameters->SetParameters (aPluginName, aParameters, myExportToShapeViewDialog->IsAccepted());
525 // =======================================================================
528 // =======================================================================
529 void VInspector_Window::onShow()
531 displaySelectedPresentations (true);
534 // =======================================================================
537 // =======================================================================
538 void VInspector_Window::onHide()
540 displaySelectedPresentations (false);
543 // =======================================================================
544 // function : UpdateTreeModel
546 // =======================================================================
547 void VInspector_Window::UpdateTreeModel()
549 VInspector_ViewModel* aViewModel = dynamic_cast<VInspector_ViewModel*> (myTreeView->model());
551 aViewModel->UpdateTreeModel();
554 // =======================================================================
555 // function : displaySelectedPresentations
557 // =======================================================================
558 void VInspector_Window::displaySelectedPresentations(const bool theToDisplay)
560 VInspector_ViewModel* aViewModel = dynamic_cast<VInspector_ViewModel*> (myTreeView->model());
564 Handle(AIS_InteractiveContext) aContext = aViewModel->GetContext();
565 if (aContext.IsNull())
568 NCollection_List<Handle(AIS_InteractiveObject)> aSelectedPresentations =
569 VInspector_ItemPresentableObject::GetSelectedPresentations(myTreeView->selectionModel());
570 if (aSelectedPresentations.Extent() <= 0)
573 for (NCollection_List<Handle(AIS_InteractiveObject)>::Iterator anIOIt(aSelectedPresentations); anIOIt.More(); anIOIt.Next())
575 Handle(AIS_InteractiveObject) aPresentation = anIOIt.Value();
578 aContext->Display(aPresentation, false);
579 aContext->Load(aPresentation, -1);
582 aContext->Erase(aPresentation, false);
584 aContext->UpdateCurrentViewer();
586 // the order of objects returned by AIS_InteractiveContext is changed because the processed object is moved from
587 // Erased to Displayed container or back
588 QItemSelectionModel* aSelectionModel = myTreeView->selectionModel();
589 aSelectionModel->clear();
594 // =======================================================================
595 // function : createView
597 // =======================================================================
598 Handle(AIS_InteractiveContext) VInspector_Window::createView()
600 myViewWindow = new View_Window (0);
601 myViewWindow->GetView()->SetPredefinedSize (VINSPECTOR_DEFAULT_VIEW_WIDTH, VINSPECTOR_DEFAULT_VIEW_HEIGHT);
602 myViewWindow->move (VINSPECTOR_DEFAULT_VIEW_POSITION_X, VINSPECTOR_DEFAULT_VIEW_POSITION_Y);
603 myViewWindow->show();
605 return myViewWindow->GetView()->GetViewer()->GetContext();