case SUIT_Accel::RotateLeft : return SVTK::RotateLeftEvent;
case SUIT_Accel::RotateRight : return SVTK::RotateRightEvent;
case SUIT_Accel::RotateUp : return SVTK::RotateUpEvent;
- case SUIT_Accel::RotateDown : return SVTK::RotateDownEvent;
+ case SUIT_Accel::RotateDown : return SVTK::RotateDownEvent;
}
return accelAction;
}
( getAction( ChangeRotationPointId ), this, "SVTK_SetRotationPointDlg" );
myViewParameterDlg = new SVTK_ViewParameterDlg
( getAction( ViewParametersId ), this, "SVTK_ViewParameterDlg" );
-
+
myDefaultInteractorStyle = SVTK_InteractorStyle::New();
myInteractor->PushInteractorStyle(myDefaultInteractorStyle);
myDefaultInteractorStyle->Delete();
-
+
myRecorder = SVTK_Recorder::New();
-
+
myRecorder->SetNbFPS( 17.3 );
myRecorder->SetQuality( 100 );
myRecorder->SetProgressiveMode( true );
myRecorder->SetUseSkippedFrames( true );
myRecorder->SetRenderWindow( myInteractor->getRenderWindow() );
-
+
setCentralWidget(myInteractor);
-
+
myAxesWidget = salomevtk::vtkPVAxesWidget::New();
myAxesWidget->SetParentRenderer(aRenderer->GetDevice());
myAxesWidget->SetViewport(0, 0, 0.25, 0.25);
/*!
\return corresponding view
*/
-SVTK_View* SVTK_ViewWindow::getView()
-{
- return myView;
+SVTK_View* SVTK_ViewWindow::getView()
+{
+ return myView;
}
/*!
\return corresponding vtk selector
*/
SVTK_Selector* SVTK_ViewWindow::GetSelector() const
-{
- return GetInteractor()->GetSelector();
+{
+ return GetInteractor()->GetSelector();
}
/*!
/*!
Unhilights all objects in viewer
*/
-void SVTK_ViewWindow::unHighlightAll()
+void SVTK_ViewWindow::unHighlightAll()
{
myView->unHighlightAll();
}
\param theIsHighlight - if it is true, object will be hilighted, otherwise it will be unhilighted
\param theIsUpdate - update current viewer
*/
-void SVTK_ViewWindow::highlight(const Handle(SALOME_InteractiveObject)& theIO,
- bool theIsHighlight,
- bool theIsUpdate )
+void SVTK_ViewWindow::highlight(const Handle(SALOME_InteractiveObject)& theIO,
+ bool theIsHighlight,
+ bool theIsUpdate )
{
myView->highlight( theIO, theIsHighlight, theIsUpdate );
}
\return true if object is in viewer or in collector
\param theIO - object to be checked
*/
-bool SVTK_ViewWindow::isInViewer( const Handle(SALOME_InteractiveObject)& theIO )
+bool SVTK_ViewWindow::isInViewer( const Handle(SALOME_InteractiveObject)& theIO )
{
return myView->isInViewer( theIO );
}
\return true if object is displayed in viewer
\param theIO - object to be checked
*/
-bool SVTK_ViewWindow::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
+bool SVTK_ViewWindow::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
{
return myView->isVisible( theIO );
}
Display object
\param theEntry - entry that corresponds to intractive objects
*/
-Handle(SALOME_InteractiveObject) SVTK_ViewWindow::FindIObject(const char* theEntry)
+Handle(SALOME_InteractiveObject) SVTK_ViewWindow::FindIObject(const char* theEntry)
{
return myView->FindIObject(theEntry);
}
\param theImmediatly - update viewer
*/
void SVTK_ViewWindow::Display(const Handle(SALOME_InteractiveObject)& theIO,
- bool theImmediatly)
+ bool theImmediatly)
{
myView->Display(theIO,theImmediatly);
}
\param theImmediatly - update viewer
*/
void SVTK_ViewWindow::Erase(const Handle(SALOME_InteractiveObject)& theIO,
- bool theImmediatly)
+ bool theImmediatly)
{
myView->Erase(theIO,theImmediatly);
}
Display only passed object
\param theIO - object
*/
-void SVTK_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO)
+void SVTK_ViewWindow::DisplayOnly(const Handle(SALOME_InteractiveObject)& theIO)
{
myView->DisplayOnly(theIO);
}
/*!
Display all objects in view
*/
-void SVTK_ViewWindow::DisplayAll()
+void SVTK_ViewWindow::DisplayAll()
{
myView->DisplayAll();
}
/*!
Erase all objects in view
*/
-void SVTK_ViewWindow::EraseAll()
+void SVTK_ViewWindow::EraseAll()
{
myView->EraseAll();
}
*/
void SVTK_ViewWindow::Repaint(bool theUpdateTrihedron)
{
- if(theUpdateTrihedron)
+ if(theUpdateTrihedron)
GetRenderer()->OnAdjustTrihedron();
GetInteractor()->update();
if( GetRenderer() ) {
aStyle->SetCurrentRenderer(GetRenderer()->GetDevice());
}
- }
+ }
#endif
aStyle->OnTimer();
}
/*!
Redirect the request to #SVTK_Renderer::GetScale
*/
-void SVTK_ViewWindow::GetScale( double theScale[3] )
+void SVTK_ViewWindow::GetScale( double theScale[3] )
{
GetRenderer()->GetScale( theScale );
}
/*!
Redirect the request to #SVTK_Renderer::SetScale
*/
-void SVTK_ViewWindow::SetScale( double theScale[3] )
+void SVTK_ViewWindow::SetScale( double theScale[3] )
{
GetRenderer()->SetScale( theScale );
Repaint();
QtxAction* a = getAction( EnableSelectionId );
if ( a->isChecked() != theEnable)
a->setChecked( theEnable );
- QtxActionGroup* aPreselectionGroup =
+ QtxActionGroup* aPreselectionGroup =
dynamic_cast<QtxActionGroup*>( getAction( PreselectionId ) );
if ( aPreselectionGroup )
aPreselectionGroup->setEnabled( theEnable );
{
SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
if(aViewer)
- aViewer->enableSelection(on);
+ aViewer->enableSelection(on);
}
/*!
\param theBtn2 - spacemouse button for the "increase speed increment"
\param theBtn3 - spacemouse button for the "dominant combined switch"
*/
-void SVTK_ViewWindow::SetSpacemouseButtons(const int theBtn1,
+void SVTK_ViewWindow::SetSpacemouseButtons(const int theBtn1,
const int theBtn2,
const int theBtn3)
{
Redirect the request to #SVTK_Renderer::OnAdjustTrihedron
*/
void SVTK_ViewWindow::onAdjustTrihedron()
-{
+{
GetRenderer()->OnAdjustTrihedron();
}
Redirect the request to #SVTK_Renderer::OnAdjustCubeAxes
*/
void SVTK_ViewWindow::onAdjustCubeAxes()
-{
+{
GetRenderer()->OnAdjustCubeAxes();
}
/*!
Redirect the request to #SVTK_Renderer::AddActor
*/
-void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor,
+void SVTK_ViewWindow::AddActor( VTKViewer_Actor* theActor,
bool theUpdate,
bool theIsAdjustActors )
{
GetRenderer()->AddActor(theActor, theIsAdjustActors);
- if(theUpdate)
+ if(theUpdate)
Repaint();
emit actorAdded(theActor);
}
/*!
Redirect the request to #SVTK_Renderer::RemoveActor
*/
-void SVTK_ViewWindow::RemoveActor( VTKViewer_Actor* theActor,
+void SVTK_ViewWindow::RemoveActor( VTKViewer_Actor* theActor,
bool theUpdate,
bool theIsAdjustActors )
{
myDefaultInteractorStyle->FreeActors();
if ( myKeyFreeInteractorStyle )
myKeyFreeInteractorStyle->FreeActors();
- if(theUpdate)
+ if(theUpdate)
Repaint();
emit actorRemoved(theActor);
}
int* aSize = aWindow->GetSize();
int aWidth = aSize[0];
int aHeight = aSize[1];
-
+
#ifndef DISABLE_GLVIEWER
OpenGLUtils_FrameBuffer aFrameBuffer;
if( aFrameBuffer.init( aWidth, aHeight ) )
// draw scene
aWindow->Render();
-
+
//aFrameBuffer.unbind();
glPopAttrib();
#endif
// if frame buffers are unsupported, use old functionality
- unsigned char *aData =
+ unsigned char *aData =
aWindow->GetRGBACharPixelData( 0, 0, aWidth-1, aHeight-1, 0 );
-
+
QImage anImage( aData, aWidth, aHeight, QImage::Format_ARGB32 );
anImage = anImage.rgbSwapped();
{
if( myDumpImage.isNull() )
return dumpViewContent();
-
+
RefreshDumpImage();
return myDumpImage;
}
anExporter->SetSort((vtkGL2PSExporter::SortScheme)optionsDlg->getSortType());
anExporter->SetWrite3DPropsAsRasterImage((int)optionsDlg->isRasterize3D());
anExporter->SetPS3Shading((int)optionsDlg->isPs3Shading());
-
+
if ( format == "PS" ) {
anExporter->SetFileFormatToPS();
anExporter->CompressOff();
}
-
+
if ( format == "EPS" ) {
anExporter->SetFileFormatToEPS();
anExporter->CompressOff();
if ( format == "PDF" ) {
anExporter->SetFileFormatToPDF();
}
-
+
QString aFilePrefix(fileName);
QString anExtension(SUIT_Tools::extension(fileName));
aFilePrefix.truncate(aFilePrefix.length() - 1 - anExtension.length());
anExporter->Delete();
}
delete optionsDlg;
- return true;
+ return true;
}
/*!
/*!
Redirect the request to #SVTK_Renderer::SetSelectionProp
*/
-void SVTK_ViewWindow::SetSelectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+void SVTK_ViewWindow::SetSelectionProp(const double& theRed,
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
myView->SetSelectionProp(theRed,theGreen,theBlue,theWidth);
}
/*!
Redirect the request to #SVTK_Renderer::SetSelectionProp
*/
-void SVTK_ViewWindow::SetPreselectionProp(const double& theRed,
- const double& theGreen,
- const double& theBlue,
- const int& theWidth)
+void SVTK_ViewWindow::SetPreselectionProp(const double& theRed,
+ const double& theGreen,
+ const double& theBlue,
+ const int& theWidth)
{
myView->SetPreselectionProp(theRed,theGreen,theBlue,theWidth);
}
/*!
Redirect the request to #SVTK_Renderer::SetSelectionTolerance
*/
-void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes,
+void SVTK_ViewWindow::SetSelectionTolerance(const double& theTolNodes,
const double& theTolItems,
const double& theTolObjects)
{
}
-// old visual parameters had 13 values. New format added additional
+// old visual parameters had 13 values. New format added additional
// 76 values for graduated axes, so both numbers are processed.
const int nNormalParams = 13; // number of view windows parameters excluding graduated axes params
const int nGradAxisParams = 25; // number of parameters of ONE graduated axis (X, Y, or Z)
writer.writeEndElement();
writer.writeEndElement();
- //params.sprintf( "* Graduated Axis: * Name *%u*%s*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible,
+ //params.sprintf( "* Graduated Axis: * Name *%u*%s*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible,
// title.toLatin1().data(), color[0], color[1], color[2], font, bold, italic, shadow );
// Labels
writer.writeAttribute("B", QString("%1").arg(color[2]));
writer.writeEndElement();
writer.writeEndElement();
- // params += QString().sprintf( "* Labels *%u*%u*%u*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, labels, offset,
+ // params += QString().sprintf( "* Labels *%u*%u*%u*%.2f*%.2f*%.2f*%u*%u*%u*%u", isVisible, labels, offset,
// color[0], color[1], color[2], font, bold, italic, shadow );
// Tick marks
writer.writeAttribute("isVisible", QString("%1").arg(isVisible));
writer.writeAttribute("Length", QString("%1").arg(length));
writer.writeEndElement();
-
+
//params += QString().sprintf( "* Tick marks *%u*%u", isVisible, length );
-
+
writer.writeEndElement();
//return params;
}
do {
reader.readNext();
} while (!reader.isStartElement());
-
+
// Read title color
aAttr = reader.attributes();
do {
reader.readNext();
- } while (!reader.isStartElement());
+ } while (!reader.isStartElement());
// Read labels
aAttr = reader.attributes();
isVisible = aAttr.value("isVisible").toString().toUShort();
do {
reader.readNext();
- } while (!reader.isStartElement());
+ } while (!reader.isStartElement());
// Read Color
aAttr = reader.attributes();
// Tick Marks
do {
reader.readNext();
- } while (!reader.isStartElement());
+ } while (!reader.isStartElement());
aAttr = reader.attributes();
// retrieve and set tick marks properties
isVisible = aAttr.value("isVisible").toString().toUShort();
int length = aAttr.value("Length").toString().toInt();
-
+
actor->SetTickVisibility( isVisible );
actor->SetTickLength( length );
}
QString SVTK_ViewWindow::getVisualParameters()
{
double pos[3], focalPnt[3], viewUp[3], parScale, scale[3];
-
+
// save position, focal point, viewUp, scale
vtkCamera* camera = getRenderer()->GetActiveCamera();
camera->GetPosition( pos );
GetScale( scale );
// Parameters are given in the following format:view position (3 digits), focal point position (3 digits)
- // view up values (3 digits), parallel scale (1 digit), scale (3 digits,
+ // view up values (3 digits), parallel scale (1 digit), scale (3 digits,
// Graduated axes parameters (X, Y, Z axes parameters)
QString retStr;
QXmlStreamWriter aWriter(&retStr);
/*!
The method restores visual parameters of this view or postpones it untill the view is shown
-*/
+*/
void SVTK_ViewWindow::setVisualParameters( const QString& parameters )
{
//printf("#### %s\n", qPrintable(parameters));
SVTK_RenderWindowInteractor* anInteractor = GetInteractor();
if ( anInteractor->isVisible() ) {
- doSetVisualParameters( parameters );
+ doSetVisualParameters( parameters );
}
else {
myVisualParams = parameters;
QtxActionToolMgr* mgr = toolMgr();
// Dump view
- anAction = new QtxAction(tr("MNU_DUMP_VIEW"),
+ anAction = new QtxAction(tr("MNU_DUMP_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_DUMP" ) ),
tr( "MNU_DUMP_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_DUMP_VIEW"));
mgr->registerAction( anAction, DumpId );
// FitAll
- anAction = new QtxAction(tr("MNU_FITALL"),
+ anAction = new QtxAction(tr("MNU_FITALL"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITALL" ) ),
tr( "MNU_FITALL" ), 0, this);
anAction->setStatusTip(tr("DSC_FITALL"));
mgr->registerAction( anAction, FitAllId );
// FitRect
- anAction = new QtxAction(tr("MNU_FITRECT"),
+ anAction = new QtxAction(tr("MNU_FITRECT"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FITAREA" ) ),
tr( "MNU_FITRECT" ), 0, this);
anAction->setStatusTip(tr("DSC_FITRECT"));
mgr->registerAction( anAction, FitSelectionId );
// Zoom
- anAction = new QtxAction(tr("MNU_ZOOM_VIEW"),
+ anAction = new QtxAction(tr("MNU_ZOOM_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ZOOM" ) ),
tr( "MNU_ZOOM_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_ZOOM_VIEW"));
mgr->registerAction( anAction, ZoomId );
// Panning
- anAction = new QtxAction(tr("MNU_PAN_VIEW"),
+ anAction = new QtxAction(tr("MNU_PAN_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_PAN" ) ),
tr( "MNU_PAN_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_PAN_VIEW"));
mgr->registerAction( anAction, PanId );
// Global Panning
- anAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"),
+ anAction = new QtxAction(tr("MNU_GLOBALPAN_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_GLOBALPAN" ) ),
tr( "MNU_GLOBALPAN_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_GLOBALPAN_VIEW"));
mgr->registerAction( anAction, GlobalPanId );
// Change rotation point
- anAction = new QtxAction(tr("MNU_CHANGINGROTATIONPOINT_VIEW"),
+ anAction = new QtxAction(tr("MNU_CHANGINGROTATIONPOINT_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ROTATION_POINT" ) ),
tr( "MNU_CHANGINGROTATIONPOINT_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_CHANGINGROTATIONPOINT_VIEW"));
mgr->registerAction( anAction, ChangeRotationPointId );
// Rotation
- anAction = new QtxAction(tr("MNU_ROTATE_VIEW"),
+ anAction = new QtxAction(tr("MNU_ROTATE_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ROTATE" ) ),
tr( "MNU_ROTATE_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_ROTATE_VIEW"));
mgr->registerAction( anAction, RotationId );
// Projections
- anAction = new QtxAction(tr("MNU_FRONT_VIEW"),
+ anAction = new QtxAction(tr("MNU_FRONT_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_FRONT" ) ),
- tr( "MNU_FRONT_VIEW" ), 0, this, false, "Viewers:Front view");
+ tr( "MNU_FRONT_VIEW" ), 0, this, false, "/#Viewers/View/Set X-");
anAction->setStatusTip(tr("DSC_FRONT_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onFrontView()));
this->addAction(anAction);
anAction = new QtxAction(tr("MNU_BACK_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BACK" ) ),
- tr( "MNU_BACK_VIEW" ), 0, this, false, "Viewers:Back view");
+ tr( "MNU_BACK_VIEW" ), 0, this, false, "/#Viewers/View/Set X+");
anAction->setStatusTip(tr("DSC_BACK_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onBackView()));
this->addAction(anAction);
anAction = new QtxAction(tr("MNU_TOP_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TOP" ) ),
- tr( "MNU_TOP_VIEW" ), 0, this, false, "Viewers:Top view");
+ tr( "MNU_TOP_VIEW" ), 0, this, false, "/#Viewers/View/Set Z-");
anAction->setStatusTip(tr("DSC_TOP_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onTopView()));
this->addAction(anAction);
anAction = new QtxAction(tr("MNU_BOTTOM_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_BOTTOM" ) ),
- tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "Viewers:Bottom view");
+ tr( "MNU_BOTTOM_VIEW" ), 0, this, false, "/#Viewers/View/Set Z+");
anAction->setStatusTip(tr("DSC_BOTTOM_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onBottomView()));
this->addAction(anAction);
anAction = new QtxAction(tr("MNU_LEFT_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_LEFT" ) ),
- tr( "MNU_LEFT_VIEW" ), 0, this, false, "Viewers:Left view");
+ tr( "MNU_LEFT_VIEW" ), 0, this, false, "/#Viewers/View/Set Y+");
anAction->setStatusTip(tr("DSC_LEFT_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onLeftView()));
this->addAction(anAction);
anAction = new QtxAction(tr("MNU_RIGHT_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RIGHT" ) ),
- tr( "MNU_RIGHT_VIEW" ), 0, this, false, "Viewers:Right view");
+ tr( "MNU_RIGHT_VIEW" ), 0, this, false, "/#Viewers/View/Set Y-");
anAction->setStatusTip(tr("DSC_RIGHT_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onRightView()));
this->addAction(anAction);
// rotate anticlockwise
anAction = new QtxAction(tr("MNU_ANTICLOCKWISE_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_ANTICLOCKWISE" ) ),
- tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate anticlockwise");
+ tr( "MNU_ANTICLOCKWISE_VIEW" ), 0, this, false, "/#Viewers/View/Rotate anticlockwise");
anAction->setStatusTip(tr("DSC_ANTICLOCKWISE_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onAntiClockWiseView()));
this->addAction(anAction);
// rotate clockwise
anAction = new QtxAction(tr("MNU_CLOCKWISE_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_CLOCKWISE" ) ),
- tr( "MNU_CLOCKWISE_VIEW" ), 0, this, false, "Viewers:Rotate clockwise");
+ tr( "MNU_CLOCKWISE_VIEW" ), 0, this, false, "/#Viewers/View/Rotate clockwise");
anAction->setStatusTip(tr("DSC_CLOCKWISE_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onClockWiseView()));
this->addAction(anAction);
mgr->registerAction( anAction, ClockWiseId );
// Reset
- anAction = new QtxAction(tr("MNU_RESET_VIEW"),
+ anAction = new QtxAction(tr("MNU_RESET_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
- tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
+ tr( "MNU_RESET_VIEW" ), 0, this, false, "/#Viewers/View/Reset");
anAction->setStatusTip(tr("DSC_RESET_VIEW"));
connect(anAction, SIGNAL(triggered()), this, SLOT(onResetView()));
this->addAction(anAction);
mgr->registerAction( anAction, ResetId );
// onViewTrihedron: Shows - Hides Trihedron
- anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"),
+ anAction = new QtxAction(tr("MNU_SHOW_TRIHEDRON"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_TRIHEDRON" ) ),
tr( "MNU_SHOW_TRIHEDRON" ), 0, this);
anAction->setCheckable( true );
anAction->setChecked( true );
-
+
anAction->setStatusTip(tr("DSC_SHOW_TRIHEDRON"));
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewTrihedron(bool)));
mgr->registerAction( anAction, ViewTrihedronId );
// onNonIsometric: Manage non-isometric params
- anAction = new QtxAction(tr("MNU_SVTK_SCALING"),
+ anAction = new QtxAction(tr("MNU_SVTK_SCALING"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SCALING" ) ),
tr( "MNU_SVTK_SCALING" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_SCALING"));
mgr->registerAction( anAction, NonIsometric );
// onGraduatedAxes: Manage graduated axes params
- anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"),
+ anAction = new QtxAction(tr("MNU_SVTK_GRADUATED_AXES"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_GRADUATED_AXES" ) ),
tr( "MNU_SVTK_GRADUATED_AXES" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_GRADUATED_AXES"));
mgr->registerAction( anAction, GraduatedAxes );
// onGraduatedAxes: Manage graduated axes params
- anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"),
+ anAction = new QtxAction(tr("MNU_SVTK_UPDATE_RATE"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_UPDATE_RATE" ) ),
tr( "MNU_SVTK_UPDATE_RATE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_UPDATE_RATE"));
mgr->registerAction( anAction, UpdateRate );
// Set perspective mode group
- anAction = new QtxAction(tr("MNU_SVTK_PARALLEL_MODE"),
+ anAction = new QtxAction(tr("MNU_SVTK_PARALLEL_MODE"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARALLEL" ) ),
tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
anAction->setCheckable(true);
mgr->registerAction( anAction, ParallelModeId );
- anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"),
+ anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PERSPECTIVE" ) ),
tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
connect(aPerspectiveGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionMode(QAction*)));
// View Parameters
- anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"),
+ anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_PARAMETERS" ) ),
tr( "MNU_VIEWPARAMETERS_VIEW" ), 0, this);
anAction->setStatusTip(tr("DSC_VIEWPARAMETERS_VIEW"));
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewParameters(bool)));
mgr->registerAction( anAction, ViewParametersId );
- // Synchronize View
+ // Synchronize View
mgr->registerAction( synchronizeAction(), SynchronizeId );
// Switch between interaction styles
- anAction = new QtxAction(tr("MNU_SVTK_STYLE_SWITCH"),
+ anAction = new QtxAction(tr("MNU_SVTK_STYLE_SWITCH"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_STYLE_SWITCH" ) ),
tr( "MNU_SVTK_STYLE_SWITCH" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_STYLE_SWITCH"));
mgr->registerAction( anAction, SwitchInteractionStyleId );
// Switch between zooming styles
- anAction = new QtxAction(tr("MNU_SVTK_ZOOMING_STYLE_SWITCH"),
+ anAction = new QtxAction(tr("MNU_SVTK_ZOOMING_STYLE_SWITCH"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_ZOOMING_STYLE_SWITCH" ) ),
tr( "MNU_SVTK_ZOOMING_STYLE_SWITCH" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_ZOOMING_STYLE_SWITCH"));
QSignalMapper* aSignalMapper = new QSignalMapper( this );
connect(aSignalMapper, SIGNAL(mapped(int)), this, SLOT(onSwitchPreSelectionMode(int)));
- anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_STANDARD"),
+ anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_STANDARD"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_PRESELECTION_STANDARD" ) ),
tr( "MNU_SVTK_PRESELECTION_STANDARD" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_STANDARD"));
connect(anAction, SIGNAL(triggered()), aSignalMapper, SLOT(map()));
aSignalMapper->setMapping( anAction, Standard_Preselection );
mgr->registerAction( anAction, StandardPreselectionId );
-
- anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_DYNAMIC"),
+
+ anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_DYNAMIC"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_PRESELECTION_DYNAMIC" ) ),
tr( "MNU_SVTK_PRESELECTION_DYNAMIC" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_DYNAMIC"));
aSignalMapper->setMapping( anAction, Dynamic_Preselection );
mgr->registerAction( anAction, DynamicPreselectionId );
- anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_DISABLED"),
+ anAction = new QtxAction(tr("MNU_SVTK_PRESELECTION_DISABLED"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_PRESELECTION_DISABLED" ) ),
tr( "MNU_SVTK_PRESELECTION_DISABLED" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_PRESELECTION_DISABLED"));
mgr->registerAction( aPreselectionAction, PreselectionId );
// Selection
- anAction = new QtxAction(tr("MNU_SVTK_ENABLE_SELECTION"),
+ anAction = new QtxAction(tr("MNU_SVTK_ENABLE_SELECTION"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_SELECTION" ) ),
tr( "MNU_SVTK_ENABLE_SELECTION" ), 0, this);
anAction->setStatusTip(tr("DSC_SVTK_ENABLE_SELECTION"));
mgr->registerAction( anAction, EnableSelectionId );
// Start recording
- myStartAction = new QtxAction(tr("MNU_SVTK_RECORDING_START"),
+ myStartAction = new QtxAction(tr("MNU_SVTK_RECORDING_START"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_START" ) ),
tr( "MNU_SVTK_RECORDING_START" ), 0, this);
myStartAction->setStatusTip(tr("DSC_SVTK_RECORDING_START"));
mgr->registerAction( myStartAction, StartRecordingId );
// Play recording
- myPlayAction = new QtxAction(tr("MNU_SVTK_RECORDING_PLAY"),
+ myPlayAction = new QtxAction(tr("MNU_SVTK_RECORDING_PLAY"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PLAY" ) ),
tr( "MNU_SVTK_RECORDING_PLAY" ), 0, this);
myPlayAction->setStatusTip(tr("DSC_SVTK_RECORDING_PLAY"));
mgr->registerAction( myPlayAction, PlayRecordingId );
// Pause recording
- myPauseAction = new QtxAction(tr("MNU_SVTK_RECORDING_PAUSE"),
+ myPauseAction = new QtxAction(tr("MNU_SVTK_RECORDING_PAUSE"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_PAUSE" ) ),
tr( "MNU_SVTK_RECORDING_PAUSE" ), 0, this);
myPauseAction->setStatusTip(tr("DSC_SVTK_RECORDING_PAUSE"));
mgr->registerAction( myPauseAction, PauseRecordingId );
// Stop recording
- myStopAction = new QtxAction(tr("MNU_SVTK_RECORDING_STOP"),
+ myStopAction = new QtxAction(tr("MNU_SVTK_RECORDING_STOP"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_RECORDING_STOP" ) ),
tr( "MNU_SVTK_RECORDING_STOP" ), 0, this);
myStopAction->setStatusTip(tr("DSC_SVTK_RECORDING_STOP"));
void SVTK_ViewWindow::createToolBar()
{
QtxActionToolMgr* mgr = toolMgr();
-
+
mgr->append( DumpId, myToolBar );
mgr->append( SwitchInteractionStyleId, myToolBar );
mgr->append( SwitchZoomingStyleId, myToolBar );
mgr->append( mgr->separator(), myToolBar );
-
+
mgr->append( PreselectionId, myToolBar );
mgr->append( EnableSelectionId, myToolBar );
/*!
Custom show event handler
*/
-void SVTK_ViewWindow::showEvent( QShowEvent * theEvent )
+void SVTK_ViewWindow::showEvent( QShowEvent * theEvent )
{
emit Show( theEvent );
}
/*!
Custom hide event handler
*/
-void SVTK_ViewWindow::hideEvent( QHideEvent * theEvent )
+void SVTK_ViewWindow::hideEvent( QHideEvent * theEvent )
{
emit Hide( theEvent );
}
vtkCamera* aCamera = getRenderer()->GetActiveCamera();
if ( !aCamera )
return aProps;
-
+
aProps.setDimension( SUIT_CameraProperties::Dim3D );
if ( toolMgr()->action( ParallelModeId ) ) {
if ( toolMgr()->action( ParallelModeId )->isChecked() )
aCamera->GetFocalPoint( aFocalPoint );
aCamera->GetPosition( aPosition );
aCamera->GetViewUp( aViewUp );
-
+
aProps.setFocalPoint( aFocalPoint[0], aFocalPoint[1], aFocalPoint[2] );
aProps.setPosition( aPosition[0], aPosition[1], aPosition[2] );
aProps.setViewUp( aViewUp[0], aViewUp[1], aViewUp[2] );
GetRenderer()->GetScale( anAxialScale );
aProps.setAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] );
-
+
return aProps;
}
// get camera
vtkCamera* aCamera = getRenderer()->GetActiveCamera();
-
+
double aFocalPoint[3];
double aPosition[3];
double aViewUp[3];
aProps.getPosition( aPosition[0], aPosition[1], aPosition[2] );
aProps.getFocalPoint( aFocalPoint[0], aFocalPoint[1], aFocalPoint[2] );
aProps.getAxialScale( anAxialScale[0], anAxialScale[1], anAxialScale[2] );
-
+
// restore properties to the camera
aCamera->SetViewUp( aViewUp );
aCamera->SetPosition( aPosition );