SOCC_ViewWindow Class Reference

#include <SOCC_ViewWindow.h>

Inheritance diagram for SOCC_ViewWindow:

Inheritance graph

Public Types

enum  OperationType {
  NOTHING, PANVIEW, ZOOMVIEW, ROTATE,
  PANGLOBAL, WINDOWFIT, FITALLVIEW, RESETVIEW,
  FRONTVIEW, BACKVIEW, TOPVIEW, BOTTOMVIEW,
  LEFTVIEW, RIGHTVIEW
}

Public Slots

void onFrontView ()
void onViewFitAll ()
void onBackView ()
void onTopView ()
void onBottomView ()
void onLeftView ()
void onRightView ()
void onResetView ()
void onFitAll ()
void activateZoom ()
void activateWindowFit ()
void activateRotation ()
void activatePanning ()
void activateGlobalPanning ()
void onCloneView ()
void onClipping (bool on)
void onMemorizeView ()
void onRestoreView ()
void onTrihedronShow ()
void setRestoreFlag ()
virtual void onDumpView ()

Signals

void vpTransformationStarted (OCCViewer_ViewWindow::OperationType type)
void vpTransformationFinished (OCCViewer_ViewWindow::OperationType type)
void cloneView ()
void closing (SUIT_ViewWindow *)
void mousePressed (SUIT_ViewWindow *, QMouseEvent *)
void mouseReleased (SUIT_ViewWindow *, QMouseEvent *)
void mouseDoubleClicked (SUIT_ViewWindow *, QMouseEvent *)
void mouseMoving (SUIT_ViewWindow *, QMouseEvent *)
void wheeling (SUIT_ViewWindow *, QWheelEvent *)
void keyPressed (SUIT_ViewWindow *, QKeyEvent *)
void keyReleased (SUIT_ViewWindow *, QKeyEvent *)
void contextMenuRequested (QContextMenuEvent *e)

Public Member Functions

 SOCC_ViewWindow (SUIT_Desktop *, OCCViewer_Viewer *)
virtual ~SOCC_ViewWindow ()
OCCViewer_ViewPort3dgetViewPort ()
bool eventFilter (QObject *watched, QEvent *e)
QToolBargetToolBar ()
void performRestoring (const viewAspect &)
virtual void initLayout ()
void updateEnabledDrawMode ()
void setCuttingPlane (bool on, const double x=0, const double y=0, const double z=0, const double dx=0, const double dy=0, const double dz=1)
bool isCuttingPlane ()
virtual QString getVisualParameters ()
virtual void setVisualParameters (const QString &parameters)
void setViewManager (SUIT_ViewManager *)
SUIT_ViewManagergetViewManager () const
bool event (QEvent *)
bool dumpViewToFormat (const QString &fileName, const QString &format)
bool onAccelAction (int)

Protected Types

typedef QMap< int, QtxAction * > ActionsMap
enum  {
  DumpId, FitAllId, FitRectId, ZoomId,
  PanId, GlobalPanId, RotationId, FrontId,
  BackId, TopId, BottomId, LeftId,
  RightId, ResetId, CloneId, ClippingId,
  MemId, RestoreId, TrihedronShowId
}

Protected Member Functions

virtual bool action (const int)
QImage dumpView ()
bool transformRequested () const
void setTransformRequested (OperationType op)
bool transformInProcess () const
void setTransformInProcess (bool bOn)
void vpMousePressEvent (QMouseEvent *theEvent)
void vpMouseReleaseEvent (QMouseEvent *theEvent)
void vpMouseMoveEvent (QMouseEvent *theEvent)
void resetState ()
void drawRect ()
void createActions ()
void createToolBar ()
virtual OperationType getButtonState (QMouseEvent *theEvent)
viewAspect getViewParams () const
virtual bool dumpViewToFormat (const QImage &, const QString &fileName, const QString &format)
void closeEvent (QCloseEvent *)
virtual void contextMenuEvent (QContextMenuEvent *)
virtual QString filter () const

Protected Attributes

OperationType myOperation
OCCViewer_ViewermyModel
OCCViewer_ViewPort3dmyViewPort
int myRestoreFlag
int myStartX
int myStartY
int myCurrX
int myCurrY
bool myEventStarted
bool myCursorIsHand
bool myDrawRect
bool myEnableDrawMode
bool myPaintersRedrawing
QRect myRect
QCursor myCursor
QToolBarmyToolBar
ActionsMap myActionsMap
double myCurScale
SUIT_DesktopmyDesktop
SUIT_ViewManagermyManager

Member Typedef Documentation

typedef QMap<int, QtxAction*> OCCViewer_ViewWindow.ActionsMap [protected, inherited]
 


Member Enumeration Documentation

enum OCCViewer_ViewWindow::OperationType [inherited]
 

Enumerator:
NOTHING 
PANVIEW 
ZOOMVIEW 
ROTATE 
PANGLOBAL 
WINDOWFIT 
FITALLVIEW 
RESETVIEW 
FRONTVIEW 
BACKVIEW 
TOPVIEW 
BOTTOMVIEW 
LEFTVIEW 
RIGHTVIEW 

anonymous enum [protected, inherited]
 

Enumerator:
DumpId 
FitAllId 
FitRectId 
ZoomId 
PanId 
GlobalPanId 
RotationId 
FrontId 
BackId 
TopId 
BottomId 
LeftId 
RightId 
ResetId 
CloneId 
ClippingId 
MemId 
RestoreId 
TrihedronShowId 


Constructor & Destructor Documentation

SOCC_ViewWindow::SOCC_ViewWindow SUIT_Desktop theDesktop,
OCCViewer_Viewer theModel
 

Constructor

SOCC_ViewWindow::~SOCC_ViewWindow  )  [virtual]
 

Destructor


Member Function Documentation

bool SOCC_ViewWindow::action const   int  )  [protected, virtual]
 

Performs action

Parameters:
theAction - type of action

Reimplemented from SUIT_ViewWindow.

OCCViewer_ViewPort3d* OCCViewer_ViewWindow.getViewPort  )  [inherited]
 

bool OCCViewer_ViewWindow::eventFilter QObject watched,
QEvent *  e
[inherited]
 

Custom event handler

QToolBar* OCCViewer_ViewWindow.getToolBar  )  [inherited]
 

void OCCViewer_ViewWindow::performRestoring const viewAspect anItem  )  [inherited]
 

Restores view parameters from structure viewAspect

void OCCViewer_ViewWindow::initLayout  )  [virtual, inherited]
 

Initialization of view window

void OCCViewer_ViewWindow::updateEnabledDrawMode  )  [inherited]
 

Updates state of enable draw mode state

void OCCViewer_ViewWindow::setCuttingPlane bool  on,
const double  x = 0,
const double  y = 0,
const double  z = 0,
const double  dx = 0,
const double  dy = 0,
const double  dz = 1
[inherited]
 

Sets parameters of cutting plane

Parameters:
on - is cutting plane enabled
x - x-position of plane point
y - y-position of plane point
z - z-position of plane point
dx - x-coordinate of plane normal
dy - y-coordinate of plane normal
dz - z-coordinate of plane normal

bool OCCViewer_ViewWindow::isCuttingPlane  )  [inherited]
 

Returns:
true if there is at least one cutting plane

QString OCCViewer_ViewWindow::getVisualParameters  )  [virtual, inherited]
 

The method returns the visual parameters of this view as a formated string

Reimplemented from SUIT_ViewWindow.

void OCCViewer_ViewWindow::setVisualParameters const QString &  parameters  )  [virtual, inherited]
 

The method restors visual parameters of this view from a formated string

Reimplemented from SUIT_ViewWindow.

void OCCViewer_ViewWindow::onFrontView  )  [slot, inherited]
 

Processes transformation "front view"

void OCCViewer_ViewWindow::onViewFitAll  )  [slot, inherited]
 

Processes operation fit all

void OCCViewer_ViewWindow::onBackView  )  [slot, inherited]
 

Processes transformation "back view"

void OCCViewer_ViewWindow::onTopView  )  [slot, inherited]
 

Processes transformation "top view"

void OCCViewer_ViewWindow::onBottomView  )  [slot, inherited]
 

Processes transformation "bottom view"

void OCCViewer_ViewWindow::onLeftView  )  [slot, inherited]
 

Processes transformation "left view"

void OCCViewer_ViewWindow::onRightView  )  [slot, inherited]
 

Processes transformation "right view"

void OCCViewer_ViewWindow::onResetView  )  [slot, inherited]
 

Processes transformation "reset view": sets default orientation of viewport camera

void OCCViewer_ViewWindow::onFitAll  )  [slot, inherited]
 

Processes transformation "fit all"

void OCCViewer_ViewWindow::activateZoom  )  [slot, inherited]
 

Starts zoom operation, sets corresponding cursor

void OCCViewer_ViewWindow::activateWindowFit  )  [slot, inherited]
 

Starts fit operation, sets corresponding cursor

void OCCViewer_ViewWindow::activateRotation  )  [slot, inherited]
 

Starts rotation operation, sets corresponding cursor

void OCCViewer_ViewWindow::activatePanning  )  [slot, inherited]
 

Starts panning operation, sets corresponding cursor

void OCCViewer_ViewWindow::activateGlobalPanning  )  [slot, inherited]
 

Starts global panning operation, sets corresponding cursor

void OCCViewer_ViewWindow::onCloneView  )  [slot, inherited]
 

Creates one more window with same content

void OCCViewer_ViewWindow::onClipping bool  on  )  [slot, inherited]
 

SLOT: called if clipping operation is activated, enables/disables of clipping plane

void OCCViewer_ViewWindow::onMemorizeView  )  [slot, inherited]
 

Stores view parameters

void OCCViewer_ViewWindow::onRestoreView  )  [slot, inherited]
 

Restores view parameters

void OCCViewer_ViewWindow::onTrihedronShow  )  [slot, inherited]
 

SLOT: called when action "show/hide" trihedron is activated

void OCCViewer_ViewWindow::setRestoreFlag  )  [slot, inherited]
 

Sets restore flag

void OCCViewer_ViewWindow.vpTransformationStarted OCCViewer_ViewWindow::OperationType  type  )  [signal, inherited]
 

void OCCViewer_ViewWindow.vpTransformationFinished OCCViewer_ViewWindow::OperationType  type  )  [signal, inherited]
 

void OCCViewer_ViewWindow.cloneView  )  [signal, inherited]
 

QImage OCCViewer_ViewWindow::dumpView  )  [protected, virtual, inherited]
 

Returns:
QImage, containing all scene rendering in window

Reimplemented from SUIT_ViewWindow.

bool OCCViewer_ViewWindow.transformRequested  )  const [protected, inherited]
 

void OCCViewer_ViewWindow::setTransformRequested OperationType  op  )  [protected, inherited]
 

Stores which viewer operation is requesting

bool OCCViewer_ViewWindow.transformInProcess  )  const [protected, inherited]
 

void OCCViewer_ViewWindow.setTransformInProcess bool  bOn  )  [protected, inherited]
 

void OCCViewer_ViewWindow::vpMousePressEvent QMouseEvent *  theEvent  )  [protected, inherited]
 

Handler of mouse press event

void OCCViewer_ViewWindow::vpMouseReleaseEvent QMouseEvent *  theEvent  )  [protected, inherited]
 

Handler of mouse release event

void OCCViewer_ViewWindow::vpMouseMoveEvent QMouseEvent *  theEvent  )  [protected, inherited]
 

Handler of mouse move event

void OCCViewer_ViewWindow::resetState  )  [protected, inherited]
 

Sets the viewport to its initial state ( no transformations in process etc. )

void OCCViewer_ViewWindow::drawRect  )  [protected, inherited]
 

Draws rectangle by starting and current points

void OCCViewer_ViewWindow::createActions  )  [protected, inherited]
 

Creates actions of OCC view window

void OCCViewer_ViewWindow::createToolBar  )  [protected, inherited]
 

Creates toolbar of OCC view window

OCCViewer_ViewWindow::OperationType OCCViewer_ViewWindow::getButtonState QMouseEvent *  theEvent  )  [protected, virtual, inherited]
 

Returns:
type of operation by states of mouse and keyboard buttons
Parameters:
theEvent - mouse event

viewAspect OCCViewer_ViewWindow::getViewParams  )  const [protected, inherited]
 

The method returns the visual parameters of this view as a viewAspect object

void SUIT_ViewWindow::setViewManager SUIT_ViewManager theManager  )  [inherited]
 

Sets new view manager for window

Parameters:
theManager - new view manager

SUIT_ViewManager * SUIT_ViewWindow::getViewManager  )  const [inherited]
 

Returns:
view manager of window

bool SUIT_ViewWindow::event QEvent *  e  )  [inherited]
 

Reaction view window on event e.

bool SUIT_ViewWindow::dumpViewToFormat const QString &  fileName,
const QString &  format
[inherited]
 

Saves scene rendering in window to file

Parameters:
fileName - name of file
format - string contains name of format (for example, "BMP"(default) or "JPEG", "JPG")

bool SUIT_ViewWindow::dumpViewToFormat const QImage &  img,
const QString &  fileName,
const QString &  format
[protected, virtual, inherited]
 

Saves image to file according to the format

Parameters:
image - image
fileName - name of file
format - string contains name of format (for example, "BMP"(default) or "JPEG", "JPG")

Reimplemented in Plot2d_ViewWindow.

bool SUIT_ViewWindow::onAccelAction int  _action  )  [inherited]
 

Called by SUIT_Accel.onActivated() when a key accelerator was activated and this window was active

void SUIT_ViewWindow::onDumpView  )  [virtual, slot, inherited]
 

Post events on dump view.

Reimplemented in Plot2d_ViewWindow.

void SUIT_ViewWindow.closing SUIT_ViewWindow  )  [signal, inherited]
 

void SUIT_ViewWindow.mousePressed SUIT_ViewWindow ,
QMouseEvent * 
[signal, inherited]
 

void SUIT_ViewWindow.mouseReleased SUIT_ViewWindow ,
QMouseEvent * 
[signal, inherited]
 

void SUIT_ViewWindow.mouseDoubleClicked SUIT_ViewWindow ,
QMouseEvent * 
[signal, inherited]
 

void SUIT_ViewWindow.mouseMoving SUIT_ViewWindow ,
QMouseEvent * 
[signal, inherited]
 

void SUIT_ViewWindow.wheeling SUIT_ViewWindow ,
QWheelEvent * 
[signal, inherited]
 

void SUIT_ViewWindow.keyPressed SUIT_ViewWindow ,
QKeyEvent * 
[signal, inherited]
 

void SUIT_ViewWindow.keyReleased SUIT_ViewWindow ,
QKeyEvent * 
[signal, inherited]
 

void SUIT_ViewWindow.contextMenuRequested QContextMenuEvent *  e  )  [signal, inherited]
 

void SUIT_ViewWindow::closeEvent QCloseEvent *  theEvent  )  [protected, inherited]
 

Close event theEvent.

void SUIT_ViewWindow::contextMenuEvent QContextMenuEvent *  e  )  [protected, virtual, inherited]
 

Context menu requested for event e.

QString SUIT_ViewWindow::filter  )  const [protected, virtual, inherited]
 

Returns:
filters for image files

Reimplemented in Plot2d_ViewWindow.


Field Documentation

OperationType OCCViewer_ViewWindow.myOperation [protected, inherited]
 

OCCViewer_Viewer* OCCViewer_ViewWindow.myModel [protected, inherited]
 

OCCViewer_ViewPort3d* OCCViewer_ViewWindow.myViewPort [protected, inherited]
 

int OCCViewer_ViewWindow.myRestoreFlag [protected, inherited]
 

int OCCViewer_ViewWindow.myStartX [protected, inherited]
 

int OCCViewer_ViewWindow.myStartY [protected, inherited]
 

int OCCViewer_ViewWindow.myCurrX [protected, inherited]
 

int OCCViewer_ViewWindow.myCurrY [protected, inherited]
 

bool OCCViewer_ViewWindow.myEventStarted [protected, inherited]
 

bool OCCViewer_ViewWindow.myCursorIsHand [protected, inherited]
 

bool OCCViewer_ViewWindow.myDrawRect [protected, inherited]
 

bool OCCViewer_ViewWindow.myEnableDrawMode [protected, inherited]
 

bool OCCViewer_ViewWindow.myPaintersRedrawing [protected, inherited]
 

QRect OCCViewer_ViewWindow.myRect [protected, inherited]
 

QCursor OCCViewer_ViewWindow.myCursor [protected, inherited]
 

QToolBar* OCCViewer_ViewWindow.myToolBar [protected, inherited]
 

ActionsMap OCCViewer_ViewWindow.myActionsMap [protected, inherited]
 

double OCCViewer_ViewWindow.myCurScale [protected, inherited]