SVTK_Event.h \
SVTK_ViewModelBase.h \
SVTK_SetRotationPointDlg.h \
+ SVTK_ViewParameterDlg.h \
SVTK_Extension.h
dist_libSVTK_la_SOURCES= \
SVTK_SpaceMouse.cxx \
SVTK_Selector.cxx \
SVTK_SetRotationPointDlg.cxx \
+ SVTK_ViewParameterDlg.cxx \
SVTK_Extension.cxx
EXTRA_DIST+= SVTK_SelectorDef.h SVTK_Trihedron.h
SVTK_MainWindow_moc.cxx \
SVTK_ViewModel_moc.cxx \
SVTK_View_moc.cxx \
- SVTK_SetRotationPointDlg_moc.cxx
+ SVTK_SetRotationPointDlg_moc.cxx \
+ SVTK_ViewParameterDlg_moc.cxx
nodist_libSVTK_la_SOURCES= $(MOC_FILES)
dist_salomeres_DATA=\
resources/vtk_view_graduated_axes.png \
resources/vtk_view_scaling.png \
resources/vtk_view_update_rate.png \
- resources/vtk_view_rotation_point.png
+ resources/vtk_view_rotation_point.png \
+ resources/vtk_view_parallel.png \
+ resources/vtk_view_perspective.png \
+ resources/vtk_view_parameters.png
nodist_salomeres_DATA= \
SVTK_msg_en.qm \
StartFitArea,
SetRotateGravity,
- StartPointSelection,
SetRotateSelected,
+ StartPointSelection,
BBCenterChanged,
RotationPointChanged,
ChangeRotationPoint,
+
+ SetFocalPointGravity,
+ SetFocalPointSelected,
+ StartFocalPointSelection,
+ FocalPointChanged,
LastEvent
};
namespace
{
- inline
- void
- GetEventPosition(vtkRenderWindowInteractor* theInteractor,
- int& theX,
- int& theY)
+ inline void GetEventPosition(vtkRenderWindowInteractor* theInteractor,
+ int& theX,
+ int& theY)
{
theInteractor->GetEventPosition(theX,theY);
theY = theInteractor->GetSize()[1] - theY - 1;
/*!
Constructor
*/
-SVTK_InteractorStyle
-::SVTK_InteractorStyle():
+SVTK_InteractorStyle::SVTK_InteractorStyle():
mySelectionEvent(new SVTK_SelectionEvent()),
myPointPicker(vtkPointPicker::New()),
myLastHighlitedActor(NULL),
myLastPreHighlitedActor(NULL),
myControllerIncrement(SVTK_ControllerIncrement::New()),
myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()),
- myHighlightRotationPointActor(SVTK_Actor::New()),
+ myHighlightSelectionPointActor(SVTK_Actor::New()),
myRectBand(0)
{
myPointPicker->Delete();
myCurrRotationPointType = SVTK::SetRotateGravity;
myPrevRotationPointType = myCurrRotationPointType;
- myHighlightRotationPointActor->Delete();
- myHighlightRotationPointActor->Initialize();
- myHighlightRotationPointActor->PickableOff();
- myHighlightRotationPointActor->SetVisibility( false );
+ myCurrFocalPointType = SVTK::SetFocalPointSelected;
+ myPrevFocalPointType = myCurrFocalPointType;
+
+ myHighlightSelectionPointActor->Delete();
+ myHighlightSelectionPointActor->Initialize();
+ myHighlightSelectionPointActor->PickableOff();
+ myHighlightSelectionPointActor->SetVisibility( false );
- myHighlightRotationPointActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE+2);
- myHighlightRotationPointActor->GetProperty()->SetLineWidth(SALOME_LINE_WIDTH+2);
- myHighlightRotationPointActor->GetProperty()->SetRepresentationToPoints();
+ myHighlightSelectionPointActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE+2);
+ myHighlightSelectionPointActor->GetProperty()->SetLineWidth(SALOME_LINE_WIDTH+2);
+ myHighlightSelectionPointActor->GetProperty()->SetRepresentationToPoints();
myBBFirstCheck = true;
}
/*!
Destructor
*/
-SVTK_InteractorStyle
-::~SVTK_InteractorStyle()
+SVTK_InteractorStyle::~SVTK_InteractorStyle()
{
endDrawRect();
}
/*!
\return widget for rendering
*/
-QWidget*
-SVTK_InteractorStyle
-::GetRenderWidget()
+QWidget* SVTK_InteractorStyle::GetRenderWidget()
{
return myInteractor->GetRenderWidget();
}
/*!
\return selector
*/
-SVTK_Selector*
-SVTK_InteractorStyle
-::GetSelector()
+SVTK_Selector* SVTK_InteractorStyle::GetSelector()
{
return myInteractor->GetSelector();
}
/*!
Generate special SVTK_SelectionEvent
*/
-SVTK_SelectionEvent*
-SVTK_InteractorStyle
-::GetSelectionEvent()
+SVTK_SelectionEvent* SVTK_InteractorStyle::GetSelectionEvent()
{
mySelectionEvent->mySelectionMode = GetSelector()->SelectionMode();
/*!
Generate special SVTK_SelectionEvent with flipped Y coordinate
*/
-SVTK_SelectionEvent*
-SVTK_InteractorStyle
-::GetSelectionEventFlipY()
+SVTK_SelectionEvent* SVTK_InteractorStyle::GetSelectionEventFlipY()
{
mySelectionEvent->mySelectionMode = GetSelector()->SelectionMode();
return mySelectionEvent.get();
}
-void
-SVTK_InteractorStyle
-::RotateXY(int dx, int dy)
+void SVTK_InteractorStyle::RotateXY(int dx, int dy)
{
/* if(GetCurrentRenderer() == NULL)
return;
this->Render();
}
-void
-SVTK_InteractorStyle
-::PanXY(int x, int y, int oldX, int oldY)
+void SVTK_InteractorStyle::PanXY(int x, int y, int oldX, int oldY)
{
TranslateView(x, y, oldX, oldY);
this->Render();
}
-
-void
-SVTK_InteractorStyle
-::DollyXY(int dx, int dy)
+void SVTK_InteractorStyle::DollyXY(int dx, int dy)
{
if (GetCurrentRenderer() == NULL)
return;
if (aCam->GetParallelProjection())
aCam->SetParallelScale(aCam->GetParallelScale()/zoomFactor);
else{
- aCam->Dolly(zoomFactor);
+ aCam->Dolly(zoomFactor); // Move camera in/out along projection direction
GetCurrentRenderer()->ResetCameraClippingRange();
}
this->Render();
}
-void
-SVTK_InteractorStyle
-::SpinXY(int x, int y, int oldX, int oldY)
+void SVTK_InteractorStyle::SpinXY(int x, int y, int oldX, int oldY)
{
vtkCamera *cam;
/*!
To reset reset view
*/
-void
-SVTK_InteractorStyle
-::OnConfigure()
+void SVTK_InteractorStyle::OnConfigure()
{
this->FindPokedRenderer(0,0);
this->GetCurrentRenderer()->InvokeEvent(vtkCommand::ConfigureEvent,NULL);
/*!
To handle mouse move event
*/
-void
-SVTK_InteractorStyle
-::OnMouseMove()
+void SVTK_InteractorStyle::OnMouseMove()
{
int x, y;
GetEventPosition( this->Interactor, x, y );
/*!
To handle left mouse button down event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnLeftButtonDown()
+void SVTK_InteractorStyle::OnLeftButtonDown()
{
int x, y;
GetEventPosition( this->Interactor, x, y );
/*!
To handle left mouse button up event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnLeftButtonUp()
+void SVTK_InteractorStyle::OnLeftButtonUp()
{
int x, y;
GetEventPosition( this->Interactor, x, y );
/*!
To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnMiddleButtonDown()
+void SVTK_InteractorStyle::OnMiddleButtonDown()
{
int x, y;
GetEventPosition( this->Interactor, x, y );
/*!
To handle middle mouse button up event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnMiddleButtonUp()
+void SVTK_InteractorStyle::OnMiddleButtonUp()
{
int x, y;
GetEventPosition( this->Interactor, x, y );
/*!
To handle right mouse button down event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnRightButtonDown()
+void SVTK_InteractorStyle::OnRightButtonDown()
{
int x, y;
GetEventPosition( this->Interactor, x, y );
/*!
To handle right mouse button up event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnRightButtonUp()
+void SVTK_InteractorStyle::OnRightButtonUp()
{
int x, y;
GetEventPosition( this->Interactor, x, y );
/*!
To handle mouse move event
*/
-void
-SVTK_InteractorStyle
-::OnMouseMove(int vtkNotUsed(ctrl),
- int shift,
- int x, int y)
+void SVTK_InteractorStyle::OnMouseMove(int vtkNotUsed(ctrl),
+ int shift,
+ int x, int y)
{
myShiftState = shift;
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
/*!
To handle left mouse button down event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnLeftButtonDown(int ctrl, int shift,
- int x, int y)
+void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift,
+ int x, int y)
{
this->FindPokedRenderer(x, y);
if(GetCurrentRenderer() == NULL)
} else {
if (ctrl)
startOperation(VTK_INTERACTOR_STYLE_CAMERA_ZOOM);
- else if ( myCurrRotationPointType == SVTK::StartPointSelection )
+ else if ( myCurrRotationPointType == SVTK::StartPointSelection ||
+ myCurrFocalPointType == SVTK::StartFocalPointSelection )
{
SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
int anObjId = anActor->GetNodeObjId( aVtkId );
vtkFloatingPointType* aCoords = anActor->GetNodeCoord(anObjId);
- myCurrRotationPointType = SVTK::SetRotateSelected;
+ if (myCurrRotationPointType == SVTK::StartPointSelection) {
+ myCurrRotationPointType = SVTK::SetRotateSelected;
- // invoke event for update coordinates in SVTK_SetRotationPointDlg
- InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
+ // invoke event for update coordinates in SVTK_SetRotationPointDlg
+ InvokeEvent(SVTK::RotationPointChanged,(void*)aCoords);
+ }
+ else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+ myCurrFocalPointType = SVTK::SetFocalPointSelected;
+
+ // invoke event for update coordinates in SVTK_ViewParameterDlg
+ InvokeEvent(SVTK::FocalPointChanged,(void*)aCoords);
+ }
}
else
{
- // invoke event with no data (for SVTK_SetRotationPointDlg)
- InvokeEvent(SVTK::RotationPointChanged,0);
- myCurrRotationPointType = myPrevRotationPointType;
+ if (myCurrRotationPointType == SVTK::StartPointSelection) {
+ // invoke event with no data (for SVTK_SetRotationPointDlg)
+ InvokeEvent(SVTK::RotationPointChanged,0);
+ myCurrRotationPointType = myPrevRotationPointType;
+ }
+ else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+ // invoke event with no data (for SVTK_ViewParameterDlg)
+ InvokeEvent(SVTK::FocalPointChanged,0);
+ myCurrFocalPointType = myPrevFocalPointType;
+ }
}
}
else
{
- // invoke event with no data (for SVTK_SetRotationPointDlg)
- InvokeEvent(SVTK::RotationPointChanged,0);
- myCurrRotationPointType = myPrevRotationPointType;
+ if (myCurrRotationPointType == SVTK::StartPointSelection) {
+ // invoke event with no data (for SVTK_SetRotationPointDlg)
+ InvokeEvent(SVTK::RotationPointChanged,0);
+ myCurrRotationPointType = myPrevRotationPointType;
+ }
+ else if (myCurrFocalPointType == SVTK::StartFocalPointSelection) {
+ // invoke event with no data (for SVTK_ViewParameterDlg)
+ InvokeEvent(SVTK::FocalPointChanged,0);
+ myCurrFocalPointType = myPrevFocalPointType;
+ }
}
- myHighlightRotationPointActor->SetVisibility( false );
+ myHighlightSelectionPointActor->SetVisibility( false );
if(GetCurrentRenderer() != NULL)
- GetCurrentRenderer()->RemoveActor( myHighlightRotationPointActor.GetPointer() );
+ GetCurrentRenderer()->RemoveActor( myHighlightSelectionPointActor.GetPointer() );
GetRenderWidget()->setCursor(myDefCursor);
}
/*!
To handle left mouse button up event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnLeftButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+void SVTK_InteractorStyle::OnLeftButtonUp(int vtkNotUsed(ctrl),
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
/*!
To handle middle mouse button down event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnMiddleButtonDown(int ctrl,
- int shift,
- int x, int y)
+void SVTK_InteractorStyle::OnMiddleButtonDown(int ctrl,
+ int shift,
+ int x, int y)
{
this->FindPokedRenderer(x, y);
if(GetCurrentRenderer() == NULL)
/*!
To handle middle mouse button up event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnMiddleButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+void SVTK_InteractorStyle::OnMiddleButtonUp(int vtkNotUsed(ctrl),
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
/*!
To handle right mouse button down event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnRightButtonDown(int ctrl,
- int shift,
- int x, int y)
+void SVTK_InteractorStyle::OnRightButtonDown(int ctrl,
+ int shift,
+ int x, int y)
{
this->FindPokedRenderer(x, y);
if(GetCurrentRenderer() == NULL)
/*!
To handle right mouse button up event (reimplemented from vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::OnRightButtonUp(int vtkNotUsed(ctrl),
- int shift,
- int vtkNotUsed(x),
- int vtkNotUsed(y))
+void SVTK_InteractorStyle::OnRightButtonUp(int vtkNotUsed(ctrl),
+ int shift,
+ int vtkNotUsed(x),
+ int vtkNotUsed(y))
{
myShiftState = shift;
// finishing current viewer operation
/*!
loads cursors for viewer operations - zoom, pan, etc...
*/
-void
-SVTK_InteractorStyle
-::loadCursors()
+void SVTK_InteractorStyle::loadCursors()
{
myDefCursor = QCursor(Qt::ArrowCursor);
myHandCursor = QCursor(Qt::PointingHandCursor);
/*!
Starts Zoom operation (e.g. through menu command)
*/
-void
-SVTK_InteractorStyle
-::startZoom()
+void SVTK_InteractorStyle::startZoom()
{
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
{
/*!
Starts Pan operation (e.g. through menu command)
*/
-void
-SVTK_InteractorStyle
-::startPan()
+void SVTK_InteractorStyle::startPan()
{
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
{
/*!
Starts Rotate operation (e.g. through menu command)
*/
-void
-SVTK_InteractorStyle
-::startRotate()
+void SVTK_InteractorStyle::startRotate()
{
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
{
/*!
Set rotation point selected by user
*/
-void
-SVTK_InteractorStyle
-::startPointSelection()
+void SVTK_InteractorStyle::startPointSelection()
{
myCurrRotationPointType = SVTK::StartPointSelection;
if(GetCurrentRenderer() != NULL) {
- GetCurrentRenderer()->AddActor( myHighlightRotationPointActor.GetPointer() );
+ GetCurrentRenderer()->AddActor( myHighlightSelectionPointActor.GetPointer() );
vtkFloatingPointType aColor[3];
GetCurrentRenderer()->GetBackground( aColor );
- myHighlightRotationPointActor->GetProperty()->SetColor(1. - aColor[0],
- 1. - aColor[1],
- 1. - aColor[2]);
+ myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
+ 1. - aColor[1],
+ 1. - aColor[2]);
+ }
+
+ setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
+}
+
+/*!
+ Set focal point selected by user
+*/
+void SVTK_InteractorStyle::startFocalPointSelection()
+{
+ myCurrFocalPointType = SVTK::StartFocalPointSelection;
+
+ if(GetCurrentRenderer() != NULL) {
+ GetCurrentRenderer()->AddActor( myHighlightSelectionPointActor.GetPointer() );
+ vtkFloatingPointType aColor[3];
+ GetCurrentRenderer()->GetBackground( aColor );
+ myHighlightSelectionPointActor->GetProperty()->SetColor(1. - aColor[0],
+ 1. - aColor[1],
+ 1. - aColor[2]);
}
setCursor(VTK_INTERACTOR_STYLE_CAMERA_NONE);
/*!
Starts Spin operation (e.g. through menu command)
*/
-void
-SVTK_InteractorStyle
-::startSpin()
+void SVTK_InteractorStyle::startSpin()
{
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
{
/*!
Starts Fit Area operation (e.g. through menu command)
*/
-void
-SVTK_InteractorStyle
-::startFitArea()
+void SVTK_InteractorStyle::startFitArea()
{
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
{
/*!
Starts Global Panning operation (e.g. through menu command)
*/
-void
-SVTK_InteractorStyle
-::startGlobalPan()
+void SVTK_InteractorStyle::startGlobalPan()
{
if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE)
{
/*!
Fits viewer contents to rect
*/
-void
-SVTK_InteractorStyle
-::fitRect(const int left,
- const int top,
- const int right,
- const int bottom)
+void SVTK_InteractorStyle::fitRect(const int left,
+ const int top,
+ const int right,
+ const int bottom)
{
if (GetCurrentRenderer() == NULL)
return;
/*!
Starts viewer operation (!internal usage!)
*/
-void
-SVTK_InteractorStyle
-::startOperation(int operation)
+void SVTK_InteractorStyle::startOperation(int operation)
{
switch(operation)
{
/*!
Sets proper cursor for window when viewer operation is activated
*/
-void
-SVTK_InteractorStyle
-::setCursor(const int operation)
+void SVTK_InteractorStyle::setCursor(const int operation)
{
if (!GetRenderWidget()) return;
switch (operation)
break;
case VTK_INTERACTOR_STYLE_CAMERA_NONE:
default:
- if ( myCurrRotationPointType == SVTK::StartPointSelection )
+ if ( myCurrRotationPointType == SVTK::StartPointSelection ||
+ myCurrFocalPointType == SVTK::StartFocalPointSelection )
GetRenderWidget()->setCursor(myHandCursor);
else
GetRenderWidget()->setCursor(myDefCursor);
/*!
Called when viewer operation started (!put necessary initialization here!)
*/
-void
-SVTK_InteractorStyle
-::onStartOperation()
+void SVTK_InteractorStyle::onStartOperation()
{
if (!GetRenderWidget())
return;
/*!
Called when viewer operation finished (!put necessary post-processing here!)
*/
-void
-SVTK_InteractorStyle
-::onFinishOperation()
+void SVTK_InteractorStyle::onFinishOperation()
{
if (!GetRenderWidget())
return;
/*!
Called during viewer operation when user moves mouse (!put necessary processing here!)
*/
-void
-SVTK_InteractorStyle
-::onOperation(QPoint mousePos)
+void SVTK_InteractorStyle::onOperation(QPoint mousePos)
{
if (!GetRenderWidget())
return;
Called when user moves mouse inside viewer window and there is no active viewer operation
(!put necessary processing here!)
*/
-void
-SVTK_InteractorStyle
-::onCursorMove(QPoint mousePos)
+void SVTK_InteractorStyle::onCursorMove(QPoint mousePos)
{
// processing highlighting
SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
SALOME_Actor *anActor = GetSelector()->Pick(aSelectionEvent, GetCurrentRenderer());
- if ( myCurrRotationPointType == SVTK::StartPointSelection )
+ if ( myCurrRotationPointType == SVTK::StartPointSelection ||
+ myCurrFocalPointType == SVTK::StartFocalPointSelection )
{
- myHighlightRotationPointActor->SetVisibility( false );
+ myHighlightSelectionPointActor->SetVisibility( false );
if ( anActor )
{
TColStd_IndexedMapOfInteger aMapIndex;
aMapIndex.Add( anObjId );
- myHighlightRotationPointActor->MapPoints( anActor, aMapIndex );
+ myHighlightSelectionPointActor->MapPoints( anActor, aMapIndex );
- myHighlightRotationPointActor->SetVisibility( true );
+ myHighlightSelectionPointActor->SetVisibility( true );
anIsChanged = true;
}
}
/*!
Called on finsh GlobalPan operation
*/
-void
-SVTK_InteractorStyle
-::Place(const int theX, const int theY)
+void SVTK_InteractorStyle::Place(const int theX, const int theY)
{
if (GetCurrentRenderer() == NULL)
return;
/*!
Translates view from Point to Point
*/
-void
-SVTK_InteractorStyle
-::TranslateView(int toX, int toY, int fromX, int fromY)
+void SVTK_InteractorStyle::TranslateView(int toX, int toY, int fromX, int fromY)
{
vtkCamera *cam = GetCurrentRenderer()->GetActiveCamera();
double viewFocus[4], focalDepth, viewPoint[3];
motionVector[2] + viewPoint[2]);
}
-void
-SVTK_InteractorStyle
-::IncrementalPan( const int incrX, const int incrY )
+void SVTK_InteractorStyle::IncrementalPan( const int incrX, const int incrY )
{
this->PanXY( incrX, incrY, 0, 0 );
}
-void
-SVTK_InteractorStyle
-::IncrementalZoom( const int incr )
+void SVTK_InteractorStyle::IncrementalZoom( const int incr )
{
this->DollyXY( incr, incr );
}
-void
-SVTK_InteractorStyle
-::IncrementalRotate( const int incrX, const int incrY )
+void SVTK_InteractorStyle::IncrementalRotate( const int incrX, const int incrY )
{
this->RotateXY( incrX, -incrY );
}
/*!
Redefined in order to add an observer (callback) for custorm event (space mouse event)
*/
-void
-SVTK_InteractorStyle
-::SetInteractor( vtkRenderWindowInteractor* theInteractor )
+void SVTK_InteractorStyle::SetInteractor( vtkRenderWindowInteractor* theInteractor )
{
// register EventCallbackCommand as observer of standard events (keypress, mousemove, etc)
Superclass::SetInteractor( theInteractor );
theInteractor->AddObserver( SVTK::StartPointSelection, EventCallbackCommand, Priority );
theInteractor->AddObserver( SVTK::ChangeRotationPoint, EventCallbackCommand, Priority );
+
+ theInteractor->AddObserver( SVTK::SetFocalPointGravity, EventCallbackCommand, Priority );
+ theInteractor->AddObserver( SVTK::StartFocalPointSelection, EventCallbackCommand, Priority );
+ theInteractor->AddObserver( SVTK::SetFocalPointSelected, EventCallbackCommand, Priority );
}
}
/*!
To implement cached rendering
*/
-void
-SVTK_InteractorStyle
-::OnTimer()
+void SVTK_InteractorStyle::OnTimer()
{
//vtkInteractorStyle::OnTimer();
this->Interactor->Render();
/*!
To invoke #vtkRenderWindowInteractor::CreateTimer
*/
-void
-SVTK_InteractorStyle
-::Render()
+void SVTK_InteractorStyle::Render()
{
this->Interactor->CreateTimer(VTKI_TIMER_FIRST);
}
-void
-SVTK_InteractorStyle
-::onSpaceMouseMove( double* data )
+void SVTK_InteractorStyle::onSpaceMouseMove( double* data )
{
// general things, do SetCurrentRenderer() within FindPokedRenderer()
int x, y;
IncrementalRotate( (int)data[3], 0 ); // 5. tilt the control forward/backward = rotate around X axis (Z axis of local coordinate system of space mouse)
}
-void
-SVTK_InteractorStyle
-::onSpaceMouseButton( int button )
+void SVTK_InteractorStyle::onSpaceMouseButton( int button )
{
if( mySMDecreaseSpeedBtn == button ) {
ControllerIncrement()->Decrease();
DominantCombinedSwitch();
}
-void
-SVTK_InteractorStyle
-::DominantCombinedSwitch()
+void SVTK_InteractorStyle::DominantCombinedSwitch()
{
printf( "\n--DominantCombinedSwitch() NOT IMPLEMENTED--\n" );
}
/*!
Draws rectangle by starting and current points
*/
-void
-SVTK_InteractorStyle
-::drawRect()
+void SVTK_InteractorStyle::drawRect()
{
if ( !myRectBand ) {
myRectBand = new QRubberBand( QRubberBand::Rectangle, GetRenderWidget() );
/*!
\brief Delete rubber band on the end on the dragging operation.
*/
-void
-SVTK_InteractorStyle
-::endDrawRect()
+void SVTK_InteractorStyle::endDrawRect()
{
if ( myRectBand ) myRectBand->hide();
/*!
Main process event method (reimplemented from #vtkInteractorStyle)
*/
-void
-SVTK_InteractorStyle
-::ProcessEvents( vtkObject* object,
- unsigned long event,
- void* clientData,
- void* callData )
+void SVTK_InteractorStyle::ProcessEvents( vtkObject* object,
+ unsigned long event,
+ void* clientData,
+ void* callData )
{
if ( clientData ) {
vtkObject* anObject = reinterpret_cast<vtkObject*>( clientData );
case SVTK::SetRotateGravity:
if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
{
- self->myHighlightRotationPointActor->SetVisibility( false );
+ self->myHighlightSelectionPointActor->SetVisibility( false );
if( self->GetCurrentRenderer() != NULL )
- self->GetCurrentRenderer()->RemoveActor( self->myHighlightRotationPointActor.GetPointer() );
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
self->GetRenderWidget()->setCursor(self->myDefCursor);
}
self->myPrevRotationPointType = self->myCurrRotationPointType;
case SVTK::ChangeRotationPoint:
if ( self->myCurrRotationPointType == SVTK::StartPointSelection )
{
- self->myHighlightRotationPointActor->SetVisibility( false );
+ self->myHighlightSelectionPointActor->SetVisibility( false );
if( self->GetCurrentRenderer() != NULL )
- self->GetCurrentRenderer()->RemoveActor( self->myHighlightRotationPointActor.GetPointer() );
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
self->GetRenderWidget()->setCursor(self->myDefCursor);
}
self->myPrevRotationPointType = self->myCurrRotationPointType;
self->myRotationPointY = aSelectedPoint[1];
self->myRotationPointZ = aSelectedPoint[2];
return;
+
+ case SVTK::SetFocalPointGravity:
+ if ( self->myCurrFocalPointType == SVTK::StartPointSelection )
+ {
+ self->myHighlightSelectionPointActor->SetVisibility( false );
+ if( self->GetCurrentRenderer() != NULL )
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+ self->GetRenderWidget()->setCursor(self->myDefCursor);
+ }
+ self->myCurrFocalPointType = SVTK::SetFocalPointGravity;
+ if ( ComputeBBCenter(self->GetCurrentRenderer(),aCenter) ) {
+ // invoke event for update coordinates in SVTK_ViewParameterDlg
+ self->InvokeEvent(SVTK::BBCenterChanged,(void*)aCenter);
+ }
+ return;
+ case SVTK::StartFocalPointSelection:
+ self->startFocalPointSelection();
+ return;
+
+ case SVTK::SetFocalPointSelected:
+ if ( self->myCurrFocalPointType == SVTK::StartFocalPointSelection )
+ {
+ self->myHighlightSelectionPointActor->SetVisibility( false );
+ if( self->GetCurrentRenderer() != NULL )
+ self->GetCurrentRenderer()->RemoveActor( self->myHighlightSelectionPointActor.GetPointer() );
+ self->GetRenderWidget()->setCursor(self->myDefCursor);
+ }
+ self->myPrevFocalPointType = self->myCurrFocalPointType;
+ self->myCurrFocalPointType = SVTK::SetFocalPointSelected;
+ return;
}
}
}
void startSpin();
void startPointSelection();
+ void startFocalPointSelection();
protected:
void loadCursors();
unsigned long myCurrRotationPointType;
unsigned long myPrevRotationPointType;
+ unsigned long myCurrFocalPointType;
+ unsigned long myPrevFocalPointType;
+
double myRotationPointX;
double myRotationPointY;
double myRotationPointZ;
- vtkSmartPointer<SVTK_Actor> myHighlightRotationPointActor;
+ vtkSmartPointer<SVTK_Actor> myHighlightSelectionPointActor;
vtkSmartPointer<vtkPointPicker> myPointPicker;
vtkFloatingPointType myBBCenter[3];
#include "SVTK_UpdateRateDlg.h"
#include "SVTK_CubeAxesDlg.h"
#include "SVTK_SetRotationPointDlg.h"
+#include "SVTK_ViewParameterDlg.h"
#include "SVTK_MainWindow.h"
#include "SVTK_Event.h"
#include "SVTK_Renderer.h"
myCubeAxesDlg = new SVTK_CubeAxesDlg( action( GraduatedAxes ), this, "SVTK_CubeAxesDlg" );
mySetRotationPointDlg = new SVTK_SetRotationPointDlg
( action( ChangeRotationPointId ), this, "SVTK_SetRotationPointDlg" );
+ myViewParameterDlg = new SVTK_ViewParameterDlg
+ ( action( ViewParametersId ), this, "SVTK_ViewParameterDlg" );
}
/*!
connect(anAction, SIGNAL(activated()), this, SLOT(onRightView()));
mgr->registerAction( anAction, RightId );
+ // View Parameters
+ 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"));
+ anAction->setCheckable(true);
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onViewParameters(bool)));
+ mgr->registerAction( anAction, ViewParametersId );
+
// Reset
anAction = new QtxAction(tr("MNU_RESET_VIEW"),
theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_VTKVIEWER_VIEW_RESET" ) ),
mgr->append( ResetId, myToolBar );
+ mgr->append( ViewParametersId, myToolBar );
+
mgr->append( UpdateRate, myToolBar );
mgr->append( NonIsometric, myToolBar );
mgr->append( GraduatedAxes, myToolBar );
myEventDispatcher->InvokeEvent(SVTK::StartPointSelection,0);
}
+/*!
+ Modify view parameters
+*/
+void
+SVTK_MainWindow
+::onViewParameters(bool theIsActivate)
+{
+ if(theIsActivate){
+ myViewParameterDlg->addObserver();
+ myViewParameterDlg->show();
+ }else
+ myViewParameterDlg->hide();
+}
+
+/*!
+ Set the gravity center as a focal point
+*/
+void SVTK_MainWindow::activateSetFocalPointGravity()
+{
+ myEventDispatcher->InvokeEvent(SVTK::SetFocalPointGravity, 0);
+}
+
+/*!
+ Set the selected point as a focal point
+*/
+void SVTK_MainWindow::activateSetFocalPointSelected()
+{
+ myEventDispatcher->InvokeEvent(SVTK::SetFocalPointSelected, 0);
+}
+
+/*!
+ Set the point selected by user as a focal point
+*/
+void
+SVTK_MainWindow
+::activateStartFocalPointSelection()
+{
+ myEventDispatcher->InvokeEvent(SVTK::StartFocalPointSelection,0);
+}
+
/*!
Starts global panning transformation
*/
class SVTK_CubeAxesActor2D;
class SVTK_CubeAxesDlg;
class SVTK_SetRotationPointDlg;
+class SVTK_ViewParameterDlg;
class SVTK_Renderer;
class SVTK_Selector;
void onResetView();
void onFitAll();
+ void onViewParameters(bool theIsActivate);
+
+ void activateSetFocalPointGravity();
+ void activateSetFocalPointSelected();
+ void activateStartFocalPointSelection();
+
void onViewTrihedron();
void onViewCubeAxes();
enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId,
ChangeRotationPointId, RotationId,
FrontId, BackId, TopId, BottomId, LeftId, RightId, ResetId,
- ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate};
+ ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
+ ViewParametersId };
SUIT_ViewWindow* myViewWindow;
SVTK_UpdateRateDlg* myUpdateRateDlg;
SVTK_CubeAxesDlg* myCubeAxesDlg;
SVTK_SetRotationPointDlg* mySetRotationPointDlg;
+ SVTK_ViewParameterDlg* myViewParameterDlg;
vtkSmartPointer<vtkObject> myEventDispatcher;
int myToolBar;
--- /dev/null
+// SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File :
+// Author :
+// Module : SALOME
+// $Header:
+
+#include "SVTK_ViewParameterDlg.h"
+#include "SVTK_MainWindow.h"
+#include "SVTK_RenderWindowInteractor.h"
+#include "SVTK_Event.h"
+#include "SVTK_InteractorStyle.h"
+
+#include "VTKViewer_Utilities.h"
+
+#include "QtxAction.h"
+
+#include <QLineEdit>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QDoubleValidator>
+#include <QCheckBox>
+#include <QRadioButton>
+#include <QButtonGroup>
+
+#include <vtkCallbackCommand.h>
+#include <vtkRenderer.h>
+#include <vtkCamera.h>
+
+using namespace std;
+
+/*!
+ Constructor
+*/
+SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction,
+ SVTK_MainWindow* theParent,
+ const char* theName):
+ SVTK_DialogBase(theAction, theParent, theName),
+ myMainWindow(theParent),
+ myPriority(0.0),
+ myEventCallbackCommand(vtkCallbackCommand::New()),
+ myRWInteractor(theParent->GetInteractor())
+{
+ setWindowTitle(tr("DLG_TITLE"));
+ setSizeGripEnabled(TRUE);
+
+ // Top layout
+ QVBoxLayout* aTopLayout = new QVBoxLayout(this);
+ aTopLayout->setSpacing(6);
+ aTopLayout->setMargin(11);
+
+ // Projection mode
+ QGroupBox* aGroupBoxMode = new QGroupBox(tr("PROJECTION_MODE"), this);
+ QHBoxLayout* aLayout1 = new QHBoxLayout(aGroupBoxMode);
+
+ QRadioButton* aOrtho = new QRadioButton(tr("ORTHOGONAL_MODE"), aGroupBoxMode);
+ QRadioButton* aPersp = new QRadioButton(tr("PERSPECTIVE_MODE"), aGroupBoxMode);
+
+ aLayout1->addWidget(aOrtho);
+ aLayout1->addWidget(aPersp);
+
+ myProjectionMode = new QButtonGroup(aGroupBoxMode);
+ myProjectionMode->addButton(aOrtho, 0);
+ myProjectionMode->addButton(aPersp, 1);
+ connect(myProjectionMode, SIGNAL(buttonClicked(int)), SLOT(onProjectionModeChanged(int)));
+
+ // Focal point
+ QGroupBox* aGroupBoxFocal = new QGroupBox(tr("FOCAL_POINT"), this);
+ QVBoxLayout* aLayout2 = new QVBoxLayout(aGroupBoxFocal);
+
+ /*
+ myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"), aGroupBoxFocal);
+ aLayout2->addWidget(myIsBBCenter);
+ connect(myIsBBCenter, SIGNAL(stateChanged(int)), SLOT(onBBCenterChecked()));
+ */
+
+ myToBBCenter = new QPushButton(aGroupBoxFocal);
+ myToBBCenter->setText(tr("LBL_TOBBCENTER"));
+ aLayout2->addWidget(myToBBCenter);
+ connect(myToBBCenter, SIGNAL(clicked()), this, SLOT(onToBBCenter()));
+
+ myToOrigin = new QPushButton(aGroupBoxFocal);
+ myToOrigin->setText(tr("LBL_TOORIGIN"));
+ aLayout2->addWidget(myToOrigin);
+ connect(myToOrigin, SIGNAL(clicked()), this, SLOT(onToOrigin()));
+
+ mySelectPoint = new QPushButton(aGroupBoxFocal);
+ mySelectPoint->setText(tr("LBL_SELECTPOINT"));
+ mySelectPoint->setCheckable(true);
+ aLayout2->addWidget(mySelectPoint);
+ connect(mySelectPoint, SIGNAL(clicked()), this, SLOT(onSelectPoint()));
+
+ // Focal point coordinates
+ myFocalCoords = new QFrame(aGroupBoxFocal);
+ myFocalCoords->setObjectName("FocalPointCoordinates");
+
+ QHBoxLayout* aCoordLayout = new QHBoxLayout(myFocalCoords);
+ aCoordLayout->setSpacing(6);
+ aCoordLayout->setMargin(0);
+
+ QLabel* aLabelX = new QLabel(tr("LBL_X"), myFocalCoords);
+ aLabelX->setFixedWidth(25);
+ myFocalX = new QLineEdit(myFocalCoords);
+ myFocalX->setValidator(new QDoubleValidator(myFocalX));
+ myFocalX->setText(QString::number(0.0));
+ connect(myFocalX, SIGNAL(textChanged(const QString&)), SLOT(onFocalCoordChanged()));
+
+ QLabel* aLabelY = new QLabel(tr("LBL_Y"), myFocalCoords);
+ aLabelY->setFixedWidth(25);
+ myFocalY = new QLineEdit(myFocalCoords);
+ myFocalY->setValidator(new QDoubleValidator(myFocalY));
+ myFocalY->setText(QString::number(0.0));
+ connect(myFocalY, SIGNAL(textChanged(const QString&)), SLOT(onFocalCoordChanged()));
+
+ QLabel* aLabelZ = new QLabel(tr("LBL_Z"), myFocalCoords);
+ aLabelZ->setFixedWidth(25);
+ myFocalZ = new QLineEdit(myFocalCoords);
+ myFocalZ->setValidator(new QDoubleValidator(myFocalZ));
+ myFocalZ->setText(QString::number(0.0));
+ connect(myFocalZ, SIGNAL(textChanged(const QString&)), SLOT(onFocalCoordChanged()));
+
+ aCoordLayout->addWidget(aLabelX);
+ aCoordLayout->addWidget(myFocalX);
+ aCoordLayout->addWidget(aLabelY);
+ aCoordLayout->addWidget(myFocalY);
+ aCoordLayout->addWidget(aLabelZ);
+ aCoordLayout->addWidget(myFocalZ);
+ aLayout2->addWidget(myFocalCoords);
+
+ // Camera position
+ QGroupBox* aGroupBoxCamera = new QGroupBox(tr("CAMERA_POSITION"), this);
+ QVBoxLayout* aLayout3 = new QVBoxLayout(aGroupBoxCamera);
+
+ QRadioButton* aWorld = new QRadioButton(tr("WORLD_COORDINATES"), aGroupBoxCamera);
+ QRadioButton* aRelative = new QRadioButton(tr("FOCAL_RELATIVE"), aGroupBoxCamera);
+
+ QHBoxLayout* aHLayout = new QHBoxLayout;
+ aHLayout->addWidget(aWorld);
+ aHLayout->addWidget(aRelative);
+ aLayout3->addLayout(aHLayout);
+
+ myCameraPositionMode = new QButtonGroup(aGroupBoxCamera);
+ myCameraPositionMode->addButton(aWorld, 0);
+ myCameraPositionMode->addButton(aRelative, 1);
+ connect(myCameraPositionMode, SIGNAL(buttonClicked(int)), SLOT(onPositionModeChanged(int)));
+
+ // Camera coordinates
+ myCameraCoords = new QFrame(aGroupBoxCamera);
+ myCameraCoords->setObjectName("CameraCoordinates");
+
+ aCoordLayout = new QHBoxLayout(myCameraCoords);
+ aCoordLayout->setSpacing(6);
+ aCoordLayout->setMargin(0);
+
+ aLabelX = new QLabel(tr("LBL_X"), myCameraCoords);
+ aLabelX->setFixedWidth(25);
+ myCameraX = new QLineEdit(myCameraCoords);
+ myCameraX->setValidator(new QDoubleValidator(myCameraX));
+ myCameraX->setText(QString::number(0.0));
+ connect(myCameraX, SIGNAL(textChanged(const QString&)), SLOT(onCameraCoordChanged()));
+
+ aLabelY = new QLabel(tr("LBL_Y"), myCameraCoords);
+ aLabelY->setFixedWidth(25);
+ myCameraY = new QLineEdit(myCameraCoords);
+ myCameraY->setValidator(new QDoubleValidator(myCameraY));
+ myCameraY->setText(QString::number(0.0));
+ connect(myCameraY, SIGNAL(textChanged(const QString&)), SLOT(onCameraCoordChanged()));
+
+ aLabelZ = new QLabel(tr("LBL_Z"), myCameraCoords);
+ aLabelZ->setFixedWidth(25);
+ myCameraZ = new QLineEdit(myCameraCoords);
+ myCameraZ->setValidator(new QDoubleValidator(myCameraZ));
+ myCameraZ->setText(QString::number(1.0));
+ connect(myCameraZ, SIGNAL(textChanged(const QString&)), SLOT(onCameraCoordChanged()));
+
+ aCoordLayout->addWidget(aLabelX);
+ aCoordLayout->addWidget(myCameraX);
+ aCoordLayout->addWidget(aLabelY);
+ aCoordLayout->addWidget(myCameraY);
+ aCoordLayout->addWidget(aLabelZ);
+ aCoordLayout->addWidget(myCameraZ);
+ aLayout3->addWidget(myCameraCoords);
+
+ // Projection direction
+ QFrame* line1 = new QFrame(aGroupBoxCamera);
+ line1->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ aLayout3->addWidget(line1);
+
+ QLabel* aLabel = new QLabel(tr("PROJECTION_DIRECTION"), aGroupBoxCamera);
+ aLayout3->addWidget(aLabel);
+
+ myProjDirection = new QFrame(aGroupBoxCamera);
+ myProjDirection->setObjectName("ProjectionDirection");
+
+ aCoordLayout = new QHBoxLayout(myProjDirection);
+ aCoordLayout->setSpacing(6);
+ aCoordLayout->setMargin(0);
+
+ aLabelX = new QLabel(tr("LBL_DX"), myProjDirection);
+ aLabelX->setFixedWidth(25);
+ myProjDirX = new QLineEdit(myProjDirection);
+ myProjDirX->setValidator(new QDoubleValidator(myProjDirX));
+ myProjDirX->setText(QString::number(0.0));
+ connect(myProjDirX, SIGNAL(textChanged(const QString&)), SLOT(onDirectionChanged()));
+
+ aLabelY = new QLabel(tr("LBL_DY"), myProjDirection);
+ aLabelY->setFixedWidth(25);
+ myProjDirY = new QLineEdit(myProjDirection);
+ myProjDirY->setValidator(new QDoubleValidator(myProjDirY));
+ myProjDirY->setText(QString::number(0.0));
+ connect(myProjDirY, SIGNAL(textChanged(const QString&)), SLOT(onDirectionChanged()));
+
+ aLabelZ = new QLabel(tr("LBL_DZ"), myProjDirection);
+ aLabelZ->setFixedWidth(25);
+ myProjDirZ = new QLineEdit(myProjDirection);
+ myProjDirZ->setValidator(new QDoubleValidator(myProjDirZ));
+ myProjDirZ->setText(QString::number(-1.0));
+ connect(myProjDirZ, SIGNAL(textChanged(const QString&)), SLOT(onDirectionChanged()));
+
+ aCoordLayout->addWidget(aLabelX);
+ aCoordLayout->addWidget(myProjDirX);
+ aCoordLayout->addWidget(aLabelY);
+ aCoordLayout->addWidget(myProjDirY);
+ aCoordLayout->addWidget(aLabelZ);
+ aCoordLayout->addWidget(myProjDirZ);
+ aLayout3->addWidget(myProjDirection);
+
+ // Distance to focal point
+ QHBoxLayout* aHorLayout = new QHBoxLayout;
+ aHorLayout->setSpacing(6);
+
+ aLabel = new QLabel(tr("FOCAL_DISTANCE"), aGroupBoxCamera);
+ myDistance = new QLineEdit(aGroupBoxCamera);
+ QDoubleValidator* aVal = new QDoubleValidator(myDistance);
+ aVal->setBottom(0.0002); // VTK minimal distance
+ myDistance->setValidator(aVal);
+ myDistance->setText(QString::number(1.0));
+ connect(myDistance, SIGNAL(textChanged(const QString&)), SLOT(onDistanceChanged()));
+
+ aHorLayout->addWidget(aLabel);
+ aHorLayout->addWidget(myDistance);
+ aLayout3->addLayout(aHorLayout);
+
+ // View Up direction
+ QFrame* line2 = new QFrame(aGroupBoxCamera);
+ line2->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ aLayout3->addWidget(line2);
+
+ aLabel = new QLabel(tr("VIEW_UP_DIRECTION"), aGroupBoxCamera);
+ aLayout3->addWidget(aLabel);
+
+ myViewDirection = new QFrame(aGroupBoxCamera);
+ myViewDirection->setObjectName("ViewUpDirection");
+ aLayout3->addWidget(myViewDirection);
+
+ aCoordLayout = new QHBoxLayout(myViewDirection);
+ aCoordLayout->setSpacing(6);
+ aCoordLayout->setMargin(0);
+
+ aLabelX = new QLabel(tr("LBL_DX"), myViewDirection);
+ aLabelX->setFixedWidth(25);
+ myViewDirX = new QLineEdit(myViewDirection);
+ myViewDirX->setValidator(new QDoubleValidator(myViewDirX));
+ myViewDirX->setText(QString::number(0.0));
+ connect(myViewDirX, SIGNAL(textChanged(const QString&)), SLOT(onViewDirectionChanged()));
+
+ aLabelY = new QLabel(tr("LBL_DY"), myViewDirection);
+ aLabelY->setFixedWidth(25);
+ myViewDirY = new QLineEdit(myViewDirection);
+ myViewDirY->setValidator(new QDoubleValidator(myViewDirY));
+ myViewDirY->setText(QString::number(1.0));
+ connect(myViewDirY, SIGNAL(textChanged(const QString&)), SLOT(onViewDirectionChanged()));
+
+ aLabelZ = new QLabel(tr("LBL_DZ"), myViewDirection);
+ aLabelZ->setFixedWidth(25);
+ myViewDirZ = new QLineEdit(myViewDirection);
+ myViewDirZ->setValidator(new QDoubleValidator(myViewDirZ));
+ myViewDirZ->setText(QString::number(0.0));
+ connect(myViewDirZ, SIGNAL(textChanged(const QString&)), SLOT(onViewDirectionChanged()));
+
+ aCoordLayout->addWidget(aLabelX);
+ aCoordLayout->addWidget(myViewDirX);
+ aCoordLayout->addWidget(aLabelY);
+ aCoordLayout->addWidget(myViewDirY);
+ aCoordLayout->addWidget(aLabelZ);
+ aCoordLayout->addWidget(myViewDirZ);
+
+ // Zooming
+ QGroupBox* aGroupBoxZoom = new QGroupBox(tr("ZOOMING"), this);
+ QVBoxLayout* aLayout4 = new QVBoxLayout(aGroupBoxZoom);
+
+ // Parallel scale
+ myScaleBox = new QFrame(aGroupBoxZoom);
+ myScaleBox->setObjectName("ScaleValue");
+
+ aHorLayout = new QHBoxLayout(myScaleBox);
+ aHorLayout->setSpacing(6);
+ aHorLayout->setMargin(0);
+
+ aLabel = new QLabel(tr("LBL_SCALE"), myScaleBox);
+ myScale = new QLineEdit(myScaleBox);
+ QDoubleValidator* aVal2 = new QDoubleValidator(myScale);
+ aVal2->setBottom(0.000001); // VTK minimal scale
+ myScale->setValidator(aVal2);
+ myScale->setText(QString::number(1.0));
+ connect(myScale, SIGNAL(textChanged(const QString&)), SLOT(onZoomChanged()));
+
+ aHorLayout->addWidget(aLabel);
+ aHorLayout->addWidget(myScale);
+ aLayout4->addWidget(myScaleBox);
+
+ // View Angle
+ myViewAngleBox = new QFrame(aGroupBoxZoom);
+ myViewAngleBox->setObjectName("ViewAngle");
+
+ aHorLayout = new QHBoxLayout(myViewAngleBox);
+ aHorLayout->setSpacing(6);
+ aHorLayout->setMargin(0);
+
+ aLabel = new QLabel(tr("LBL_VIEW_ANGLE"), myViewAngleBox);
+ myViewAngle = new QLineEdit(myViewAngleBox);
+ QDoubleValidator* aVal3 = new QDoubleValidator(myViewAngle);
+ aVal3->setBottom(0.000001); // VTK minimal scale
+ aVal3->setTop(179); // VTK minimal scale
+ myViewAngle->setValidator(aVal3);
+ myViewAngle->setText(QString::number(30.0));
+ connect(myViewAngle, SIGNAL(textChanged(const QString&)), SLOT(onZoomChanged()));
+
+ aHorLayout->addWidget(aLabel);
+ aHorLayout->addWidget(myViewAngle);
+ aLayout4->addWidget(myViewAngleBox);
+
+ // "Close" button
+ QGroupBox* aGroupBox = new QGroupBox(this);
+ QHBoxLayout* aHBoxLayout2 = new QHBoxLayout(aGroupBox);
+ aHBoxLayout2->setMargin(11);
+ aHBoxLayout2->setSpacing(6);
+
+ QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
+ m_bClose->setObjectName("m_bClose");
+ m_bClose->setAutoDefault(TRUE);
+ m_bClose->setFixedSize(m_bClose->sizeHint());
+ connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
+
+ // Layout buttons
+ aHBoxLayout2->addWidget(m_bClose);
+
+ // Layout top level widgets
+ aTopLayout->addWidget(aGroupBoxMode);
+ aTopLayout->addWidget(aGroupBoxFocal);
+ aTopLayout->addWidget(aGroupBoxCamera);
+ aTopLayout->addWidget(aGroupBoxZoom);
+ aTopLayout->addWidget(aGroupBox);
+ aTopLayout->addStretch();
+
+ // initial state
+ myProjectionMode->button(0)->setChecked(true);
+ myCameraPositionMode->button(0)->setChecked(true);
+
+ setEnabled(myCameraCoords, myCameraPositionMode->checkedId() == 0);
+
+ myScaleBox->setVisible(myProjectionMode->checkedId() == 0);
+ myViewAngleBox->setVisible(myProjectionMode->checkedId() == 1);
+
+ updateData();
+
+ this->resize(400, this->sizeHint().height());
+
+ myEventCallbackCommand->Delete();
+ myEventCallbackCommand->SetClientData(this);
+ myEventCallbackCommand->SetCallback(SVTK_ViewParameterDlg::ProcessEvents);
+ myIsObserverAdded = false;
+ myBusy = false;
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+SVTK_ViewParameterDlg::~SVTK_ViewParameterDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+void SVTK_ViewParameterDlg::addObserver()
+{
+ if ( !myIsObserverAdded ) {
+ vtkInteractorStyle* aIStyle = myRWInteractor->GetInteractorStyle();
+ aIStyle->AddObserver(SVTK::BBCenterChanged, myEventCallbackCommand.GetPointer(), myPriority);
+ aIStyle->AddObserver(SVTK::FocalPointChanged, myEventCallbackCommand.GetPointer(), myPriority);
+
+ vtkRenderer *aRenderer = myRWInteractor->getRenderer();
+ aRenderer->AddObserver(vtkCommand::EndEvent, myEventCallbackCommand.GetPointer(), myPriority);
+
+ myIsObserverAdded = true;
+ }
+}
+
+/*!
+ Processes events
+*/
+void SVTK_ViewParameterDlg::ProcessEvents(vtkObject* vtkNotUsed(theObject),
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData)
+{
+ SVTK_ViewParameterDlg* self = reinterpret_cast<SVTK_ViewParameterDlg*>(theClientData);
+ vtkFloatingPointType* aCoord;
+ switch ( theEvent ) {
+ case SVTK::BBCenterChanged:
+ if ( theCallData )
+ {
+ aCoord = (vtkFloatingPointType*)theCallData;
+ self->myBusy = true;
+ self->myFocalX->setText( QString::number(aCoord[0]) );
+ self->myFocalY->setText( QString::number(aCoord[1]) );
+ self->myFocalZ->setText( QString::number(aCoord[2]) );
+ self->myBusy = false;
+ self->onFocalCoordChanged();
+ }
+ break;
+ case SVTK::FocalPointChanged:
+ if ( theCallData )
+ {
+ aCoord = (vtkFloatingPointType*)theCallData;
+ self->myBusy = true;
+ self->myFocalX->setText( QString::number(aCoord[0]) );
+ self->myFocalY->setText( QString::number(aCoord[1]) );
+ self->myFocalZ->setText( QString::number(aCoord[2]) );
+ self->myBusy = false;
+ self->onFocalCoordChanged();
+ }
+ break;
+ case vtkCommand::EndEvent:
+ if ( self->myRWInteractor->getRenderer()->GetActiveCamera()->GetMTime() > self->myCameraMTime )
+ self->updateData();
+ break;
+ }
+}
+
+void SVTK_ViewParameterDlg::updateData()
+{
+ myBusy = true;
+ vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+
+ int aParallel = aCamera->GetParallelProjection();
+ myProjectionMode->button(aParallel?0:1)->setChecked(true);
+
+ double focal[3], pos[3], vup[3], proj[3], dist, scale, angle;
+
+ aCamera->GetFocalPoint(focal);
+ myFocalX->setText(QString::number(focal[0]));
+ myFocalY->setText(QString::number(focal[1]));
+ myFocalZ->setText(QString::number(focal[2]));
+
+ aCamera->GetPosition(pos);
+ myCameraX->setText(QString::number(pos[0]));
+ myCameraY->setText(QString::number(pos[1]));
+ myCameraZ->setText(QString::number(pos[2]));
+
+ aCamera->GetDirectionOfProjection(proj);
+ myProjDirX->setText(QString::number(proj[0]));
+ myProjDirY->setText(QString::number(proj[1]));
+ myProjDirZ->setText(QString::number(proj[2]));
+
+ aCamera->GetViewUp(vup);
+ myViewDirX->setText(QString::number(vup[0]));
+ myViewDirY->setText(QString::number(vup[1]));
+ myViewDirZ->setText(QString::number(vup[2]));
+
+ dist = aCamera->GetDistance();
+ myDistance->setText(QString::number(dist));
+
+ scale = aCamera->GetParallelScale();
+ myScale->setText(QString::number(scale));
+
+ angle = aCamera->GetViewAngle();
+ myViewAngle->setText(QString::number(angle));
+
+ myCameraMTime.Modified();
+ myBusy = false;
+}
+
+void SVTK_ViewParameterDlg::setEnabled(QFrame* theWidget, const bool theState)
+{
+ QObjectList aChildren(theWidget->children());
+ QObject* anObj;
+ for(int i = 0; i < aChildren.size(); i++)
+ {
+ anObj = aChildren.at(i);
+ if (anObj !=0 && anObj->inherits("QLineEdit"))
+ ((QLineEdit*)anObj)->setReadOnly(!theState);
+ if (anObj !=0 && anObj->inherits("QPushButton"))
+ ((QLineEdit*)anObj)->setEnabled(theState);
+ }
+
+}
+
+void SVTK_ViewParameterDlg::onProjectionModeChanged(int mode)
+{
+ int aBtn = myProjectionMode->checkedId();
+
+ vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+ aCamera->SetParallelProjection(aBtn == 0);
+ myRWInteractor->getRenderer()->Render();
+
+ myScaleBox->setVisible(aBtn == 0);
+ myViewAngleBox->setVisible(aBtn == 1);
+}
+
+void SVTK_ViewParameterDlg::onPositionModeChanged(int mode)
+{
+ setEnabled(myCameraCoords, myCameraPositionMode->checkedId() == 0);
+}
+
+void SVTK_ViewParameterDlg::onToBBCenter()
+{
+ if ( mySelectPoint->isChecked() )
+ mySelectPoint->toggle();
+
+ myMainWindow->activateSetFocalPointGravity();
+}
+
+void SVTK_ViewParameterDlg::onToOrigin()
+{
+ if ( mySelectPoint->isChecked() )
+ mySelectPoint->toggle();
+
+ myBusy = true;
+ myFocalX->setText(QString::number(0.0));
+ myFocalY->setText(QString::number(0.0));
+ myFocalZ->setText(QString::number(0.0));
+ myBusy = false;
+
+ onFocalCoordChanged();
+}
+
+void SVTK_ViewParameterDlg::onSelectPoint()
+{
+ if ( mySelectPoint->isChecked() )
+ myMainWindow->activateStartFocalPointSelection();
+ else
+ mySelectPoint->toggle();
+}
+
+void SVTK_ViewParameterDlg::onFocalCoordChanged()
+{
+ if ( myBusy ) return;
+
+ if ( mySelectPoint->isChecked() )
+ mySelectPoint->toggle();
+
+ vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+ aCamera->SetFocalPoint(myFocalX->text().toDouble(),
+ myFocalY->text().toDouble(),
+ myFocalZ->text().toDouble());
+ myRWInteractor->getRenderer()->Render();
+
+ myMainWindow->activateSetFocalPointSelected();
+
+ //updateProjection();
+}
+
+void SVTK_ViewParameterDlg::onCameraCoordChanged()
+{
+ if ( myBusy ) return;
+
+ vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+ aCamera->SetPosition(myCameraX->text().toDouble(),
+ myCameraY->text().toDouble(),
+ myCameraZ->text().toDouble());
+
+ //updateProjection();
+}
+
+void SVTK_ViewParameterDlg::onDirectionChanged()
+{
+ if ( myBusy ) return;
+
+ updateCoordinates();
+}
+
+void SVTK_ViewParameterDlg::onDistanceChanged()
+{
+ if ( myBusy ) return;
+
+ updateCoordinates();
+}
+
+void SVTK_ViewParameterDlg::onViewDirectionChanged()
+{
+ if ( myBusy ) return;
+
+ vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+ aCamera->SetViewUp(myViewDirX->text().toDouble(),
+ myViewDirY->text().toDouble(),
+ myViewDirZ->text().toDouble());
+ myRWInteractor->getRenderer()->Render();
+}
+
+void SVTK_ViewParameterDlg::onZoomChanged()
+{
+ if ( myBusy ) return;
+
+ vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
+
+ switch( myProjectionMode->checkedId() ) {
+ case 0:
+ aCamera->SetParallelScale(myScale->text().toDouble());
+ break;
+ case 1:
+ aCamera->SetViewAngle(myViewAngle->text().toDouble());
+ break;
+ }
+ myRWInteractor->getRenderer()->Render();
+}
+
+void SVTK_ViewParameterDlg::onClickClose()
+{
+ reject();
+}
+
+void SVTK_ViewParameterDlg::updateProjection()
+{
+ double pnt[3], pos[3], dir[3], dist;
+
+ pnt[0] = myFocalX->text().toDouble();
+ pnt[1] = myFocalY->text().toDouble();
+ pnt[2] = myFocalZ->text().toDouble();
+
+ pos[0] = myCameraX->text().toDouble();
+ pos[1] = myCameraY->text().toDouble();
+ pos[2] = myCameraZ->text().toDouble();
+
+ dir[0] = pnt[0] - pos[0];
+ dir[1] = pnt[1] - pos[1];
+ dir[2] = pnt[2] - pos[2];
+
+ dist = sqrt( dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2] );
+
+ if ( dist > 0.0002 ) {
+ dir[0] = dir[0] / dist;
+ dir[1] = dir[1] / dist;
+ dir[2] = dir[2] / dist;
+ }
+
+ myBusy = true;
+ myProjDirX->setText(QString::number(dir[0]));
+ myProjDirY->setText(QString::number(dir[1]));
+ myProjDirZ->setText(QString::number(dir[2]));
+
+ myDistance->setText(QString::number(dist));
+ myBusy = false;
+}
+
+void SVTK_ViewParameterDlg::updateCoordinates()
+{
+ double pnt[3], pos[3], dir[3], dist;
+
+ pnt[0] = myFocalX->text().toDouble();
+ pnt[1] = myFocalY->text().toDouble();
+ pnt[2] = myFocalZ->text().toDouble();
+
+ pos[0] = myCameraX->text().toDouble();
+ pos[1] = myCameraY->text().toDouble();
+ pos[2] = myCameraZ->text().toDouble();
+
+ dir[0] = myProjDirX->text().toDouble();
+ dir[1] = myProjDirY->text().toDouble();
+ dir[2] = myProjDirZ->text().toDouble();
+
+ dist = myDistance->text().toDouble();
+
+ if (myCameraPositionMode->checkedId() == 1) {
+ // recompute camera position
+ dir[0] = -dir[0]; dir[1] = -dir[1]; dir[2] = -dir[2];
+ if (computePoint(pnt, dir, dist, pos)) {
+ myBusy = true;
+ myCameraX->setText(QString::number(pos[0]));
+ myCameraY->setText(QString::number(pos[1]));
+ myCameraZ->setText(QString::number(pos[2]));
+ myBusy = false;
+ onCameraCoordChanged();
+ }
+ }
+ else {
+ // recompute focal point
+ if (computePoint(pos, dir, dist, pnt)) {
+ if (mySelectPoint->isChecked())
+ mySelectPoint->toggle();
+ myBusy = true;
+ myFocalX->setText(QString::number(pnt[0]));
+ myFocalY->setText(QString::number(pnt[1]));
+ myFocalZ->setText(QString::number(pnt[2]));
+ myBusy = false;
+ onFocalCoordChanged();
+ }
+ }
+}
+
+bool SVTK_ViewParameterDlg::computePoint(const double start[3],
+ const double dir[3],
+ const double dist,
+ double result[3])
+{
+ double d = sqrt(dir[0]*dir[0]+dir[1]*dir[1]+dir[2]*dir[2]);
+ if ( d < 0.0002 ) return false;
+
+ for (int i = 0; i < 3; i++)
+ result[i] = start[i] + dir[i] * dist / d;
+
+ return true;
+}
--- /dev/null
+// SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File :
+// Author :
+// Module : SALOME
+// $Header:
+
+#ifndef SVTK_VIEWPARAMETERDLG_H
+#define SVTK_VIEWPARAMETERDLG_H
+
+#include "SVTK.h"
+
+#include "SVTK_DialogBase.h"
+
+#include <vtkSmartPointer.h>
+#include <vtkTimeStamp.h>
+
+class SVTK_MainWindow;
+class SVTK_RenderWindowInteractor;
+
+class QtxAction;
+
+class QLineEdit;
+class QPushButton;
+class QFrame;
+class QCheckBox;
+class QButtonGroup;
+
+class vtkCallbackCommand;
+class vtkObject;
+
+class SVTK_EXPORT SVTK_ViewParameterDlg : public SVTK_DialogBase
+{
+ Q_OBJECT;
+
+public:
+ SVTK_ViewParameterDlg(QtxAction* theAction,
+ SVTK_MainWindow* theParent,
+ const char* theName);
+
+ ~SVTK_ViewParameterDlg();
+
+ void addObserver();
+
+protected:
+ SVTK_MainWindow *myMainWindow;
+ SVTK_RenderWindowInteractor* myRWInteractor;
+ bool myIsObserverAdded;
+ bool myBusy;
+
+ QButtonGroup* myProjectionMode;
+
+ QPushButton* myToBBCenter;
+ QPushButton* myToOrigin;
+ QPushButton* mySelectPoint;
+
+ QFrame* myFocalCoords;
+ QLineEdit* myFocalX;
+ QLineEdit* myFocalY;
+ QLineEdit* myFocalZ;
+
+ QButtonGroup* myCameraPositionMode;
+
+ QFrame* myCameraCoords;
+ QLineEdit* myCameraX;
+ QLineEdit* myCameraY;
+ QLineEdit* myCameraZ;
+
+ QFrame* myProjDirection;
+ QLineEdit* myProjDirX;
+ QLineEdit* myProjDirY;
+ QLineEdit* myProjDirZ;
+
+ QLineEdit* myDistance;
+
+ QFrame* myViewDirection;
+ QLineEdit* myViewDirX;
+ QLineEdit* myViewDirY;
+ QLineEdit* myViewDirZ;
+
+ QFrame* myScaleBox;
+ QLineEdit* myScale;
+
+ QFrame* myViewAngleBox;
+ QLineEdit* myViewAngle;
+
+ void setEnabled(QFrame* theWidget, const bool theState);
+ bool computePoint(const double start[3], const double dir[3],
+ const double dist, double result[3]);
+ void updateProjection();
+ void updateCoordinates();
+
+ void updateData();
+
+ //----------------------------------------------------------------------------
+ // Priority at which events are processed
+ vtkFloatingPointType myPriority;
+
+ // Used to process events
+ vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
+
+ // Used to update camera
+ vtkTimeStamp myCameraMTime;
+
+ // Description:
+ // Main process event method
+ static void ProcessEvents(vtkObject* object,
+ unsigned long event,
+ void* clientdata,
+ void* calldata);
+
+protected slots:
+ void onProjectionModeChanged(int);
+ void onPositionModeChanged(int);
+
+ void onToBBCenter();
+ void onToOrigin();
+ void onSelectPoint();
+
+ void onFocalCoordChanged();
+ void onCameraCoordChanged();
+ void onDirectionChanged();
+ void onDistanceChanged();
+ void onViewDirectionChanged();
+
+ void onZoomChanged();
+
+ void onClickClose();
+
+};
+
+#endif // SVTK_VIEWPARAMETERDLG_H
<source>ICON_SVTK_UPDATE_RATE</source>
<translation>vtk_view_update_rate.png</translation>
</message>
+ <message>
+ <source>ICON_SVTK_VIEW_PARAMETERS</source>
+ <translation>vtk_view_parameters.png</translation>
+ </message>
+ <message>
+ <source>ICON_SVTK_VIEW_PARALLEL</source>
+ <translation>vtk_view_parallel.png</translation>
+ </message>
+ <message>
+ <source>ICON_SVTK_VIEW_PERSPECTIVE</source>
+ <translation>vtk_view_perspective.png</translation>
+ </message>
</context>
</TS>
<source>SVTK_IMAGE_FILES</source>
<translation>Images Files (*.bmp *.png *.jpg *.jpeg *.pdf *.ps *.eps)</translation>
</message>
+ <message>
+ <source>MNU_VIEWPARAMETERS_VIEW</source>
+ <translation>Change View Parameters</translation>
+ </message>
+ <message>
+ <source>DSC_VIEWPARAMETERS_VIEW</source>
+ <translation>Change the parameters of the view</translation>
+ </message>
</context>
<context>
<name>SVTK_AxisWidget</name>
<translation>Set Rotation Point</translation>
</message>
</context>
+<context>
+ <name>SVTK_ViewParameterDlg</name>
+ <message>
+ <source>LBL_X</source>
+ <translation>X :</translation>
+ </message>
+ <message>
+ <source>LBL_Y</source>
+ <translation>Y :</translation>
+ </message>
+ <message>
+ <source>LBL_Z</source>
+ <translation>Z :</translation>
+ </message>
+ <message>
+ <source>LBL_DX</source>
+ <translation>DX :</translation>
+ </message>
+ <message>
+ <source>LBL_DY</source>
+ <translation>DY :</translation>
+ </message>
+ <message>
+ <source>LBL_DZ</source>
+ <translation>DZ :</translation>
+ </message>
+ <message>
+ <source>PROJECTION_MODE</source>
+ <translation>Projection Mode</translation>
+ </message>
+ <message>
+ <source>ORTHOGONAL_MODE</source>
+ <translation>Orthogonal</translation>
+ </message>
+ <message>
+ <source>PERSPECTIVE_MODE</source>
+ <translation>Perspective</translation>
+ </message>
+ <message>
+ <source>USE_BBCENTER</source>
+ <translation>Use Bounding Box Center</translation>
+ </message>
+ <message>
+ <source>LBL_TOBBCENTER</source>
+ <translation>Set to Bounding Box Center</translation>
+ </message>
+ <message>
+ <source>LBL_TOORIGIN</source>
+ <translation>Set to Origin</translation>
+ </message>
+ <message>
+ <source>LBL_SELECTPOINT</source>
+ <translation>Select Point from View</translation>
+ </message>
+ <message>
+ <source>FOCAL_POINT</source>
+ <translation>Focal Point</translation>
+ </message>
+ <message>
+ <source>CAMERA_POSITION</source>
+ <translation>Camera Position</translation>
+ </message>
+ <message>
+ <source>WORLD_COORDINATES</source>
+ <translation>World Coordinates</translation>
+ </message>
+ <message>
+ <source>FOCAL_RELATIVE</source>
+ <translation>Relative to Focal Point</translation>
+ </message>
+ <message>
+ <source>PROJECTION_DIRECTION</source>
+ <translation>Projection Direction :</translation>
+ </message>
+ <message>
+ <source>FOCAL_DISTANCE</source>
+ <translation>Focal Distance :</translation>
+ </message>
+ <message>
+ <source>VIEW_UP_DIRECTION</source>
+ <translation>View Up Direction :</translation>
+ </message>
+ <message>
+ <source>ZOOMING</source>
+ <translation>Zooming</translation>
+ </message>
+ <message>
+ <source>LBL_SCALE</source>
+ <translation>Scale</translation>
+ </message>
+ <message>
+ <source>LBL_VIEW_ANGLE</source>
+ <translation>View Angle</translation>
+ </message>
+ <message>
+ <source>DLG_TITLE</source>
+ <translation>View Parameters</translation>
+ </message>
+</context>
<context>
<name>SVTK_UpdateRateDlg</name>
<message>