if( update )
myV3dViewer->Update();
}
+
+//****************************************************************
+void OCCViewer_Viewer::toggleTrihedron()
+{
+ if (myTrihedron.IsNull()) return;
+ if (myAISContext->IsDisplayed(myTrihedron)) {
+ myAISContext->Erase(myTrihedron);
+ } else {
+ myAISContext->Display(myTrihedron);
+ }
+}
virtual void updateViewAspects( const viewAspectList& );
virtual void clearViewAspects();
+ //! returns true if 3d Trihedron in viewer was created
+ bool trihedronActivated() const { return !myTrihedron.IsNull(); }
+ virtual void toggleTrihedron();
+
public slots:
void onClearViewAspects();
aAction->setStatusTip(tr("DSC_PRESETS_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onRestoreView()));
myActionsMap[ RestoreId ] = aAction;
+
+ if (myModel->trihedronActivated()) {
+ aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRE"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_TRIHEDRON" ) ),
+ tr( "MNU_SHOW_TRIHEDRE" ), 0, this);
+ aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRE"));
+ connect(aAction, SIGNAL(activated()), this, SLOT(onTrihedronShow()));
+ myActionsMap[ TrihedronShowId ] = aAction;
+ }
}
//****************************************************************
void OCCViewer_ViewWindow::createToolBar()
{
myActionsMap[DumpId]->addTo(myToolBar);
+ myActionsMap[TrihedronShowId]->addTo(myToolBar);
SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar, "scale");
aScaleBtn->AddAction(myActionsMap[FitAllId]);
myRestoreFlag = 1;
}
+//****************************************************************
+void OCCViewer_ViewWindow::onTrihedronShow()
+{
+ myModel->toggleTrihedron();
+}
void onCloneView();
void onMemorizeView();
void onRestoreView();
+ void onTrihedronShow();
void setRestoreFlag();
signals:
protected:
enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId,
- FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, MemId, RestoreId };
+ FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, CloneId, MemId, RestoreId,
+ TrihedronShowId };
+
typedef QMap<int, QtxAction*> ActionsMap;
msgid "OCCViewer_CreateRestoreViewDlg::CAPTION"
msgstr "Restore view"
+
+msgid "MNU_SHOW_TRIHEDRE"
+msgstr "Show/Hide trihedron"
+
+msgid "DSC_SHOW_TRIHEDRE"
+msgstr "Show/Hide trihedron in the current view"
myActionsMap[ ResetId ] = aAction;
// onViewTrihedron: Shows - Hides Trihedron
- aAction = new QtxAction(tr("MNU_VIEW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
- tr( "MNU_VIEW_TRIHEDRON" ), 0, this);
- aAction->setStatusTip(tr("DSC_VIEW_TRIHEDRON"));
+ aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
+ tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
+ aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
connect(aAction, SIGNAL(activated()), this, SLOT(onViewTrihedron()));
myActionsMap[ ViewTrihedronId ] = aAction;
}
aAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(aAction, SIGNAL(activated()), this, SLOT(onResetView()));
myActionsMap[ ResetId ] = aAction;
+
+ aAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"), aResMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
+ tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
+ aAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
+ connect(aAction, SIGNAL(activated()), this, SLOT(onTrihedronShow()));
+ myActionsMap[ TrihedronShowId ] = aAction;
}
//****************************************************************
void VTKViewer_ViewWindow::createToolBar()
{
myActionsMap[DumpId]->addTo(myToolBar);
+ myActionsMap[TrihedronShowId]->addTo(myToolBar);
SUIT_ToolButton* aScaleBtn = new SUIT_ToolButton(myToolBar);
aScaleBtn->AddAction(myActionsMap[FitAllId]);
RemoveActor(theActor);
InsertActor(theActor,true);
}
+
+//****************************************************************
+void VTKViewer_ViewWindow::onTrihedronShow()
+{
+ if (isTrihedronDisplayed())
+ myTrihedron->VisibilityOff();
+ else
+ myTrihedron->VisibilityOn();
+ myRenderWindow->update();
+}
void activateRotation();
void activatePanning();
void activateGlobalPanning();
+ void onTrihedronShow();
protected slots:
void onKeyPressed(QKeyEvent* event);
private:
enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, RotationId,
- FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId };
+ FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId, TrihedronShowId };
typedef QMap<int, QtxAction*> ActionsMap;
void createActions();
msgid "MNU_RESET_VIEW"
msgstr "Reset"
-msgid "DSC_VIEW_TRIHEDRON"
-msgstr "Shows - Hides Trihedron"
-
-msgid "MNU_VIEW_TRIHEDRON"
-msgstr "Shows - Hides Trihedron"
-
msgid "DSC_FITALL"
msgstr "Fit all objects inside the view frame"
msgid "VTKViewer_ViewManager::VTK_VIEW_TITLE"
msgstr "VTK scene:%1 - viewer:%2"
+
+msgid "MNU_SHOW_TRIHEDRON"
+msgstr "Show/Hide trihedron"
+
+msgid "DSC_SHOW_TRIHEDRON"
+msgstr "Show/Hide trihedron in the current view"