#include <OCCViewer_ViewModel.h>
Public Types | |
enum | { HorizontalGradient, VerticalGradient, Diagonal1Gradient, Diagonal2Gradient, Corner1Gradient, Corner2Gradient, Corner3Gradient, Corner4Gradient, LastGradient = Corner4Gradient } |
enum | { QuadBufferType, AnaglyphType, RowInterlacedType, ColumnInterlacedType, ChessBoardType, SideBySideType, OverUnderType } |
Public Types inherited from SUIT_ViewModel | |
enum | HotOperation { PAN, ZOOM, ROTATE, FIT_AREA } |
enum | InteractionStyle { STANDARD, KEY_FREE } |
typedef QMap< HotOperation, Qt::KeyboardModifiers > | StatesMap |
typedef QMap< HotOperation, Qt::MouseButtons > | ButtonsMap |
typedef QMap< InteractionStyle, StatesMap > | InteractionStyle2StatesMap |
typedef QMap< InteractionStyle, ButtonsMap > | InteractionStyle2ButtonsMap |
Signals | |
void | selectionChanged () |
void | deselection () |
Static Public Member Functions | |
static QString | Type () |
static QString | backgroundData (QStringList &, QIntList &, QIntList &) |
static void | stereoData (QStringList &, QIntList &) |
Static Public Member Functions inherited from SUIT_ViewModel | |
static void | setHotButton (InteractionStyle theInteractionStyle, HotOperation theOper, Qt::KeyboardModifiers theState, Qt::MouseButtons theButton) |
static void | getHotButton (InteractionStyle theInteractionStyle, HotOperation theOper, Qt::KeyboardModifiers &theState, Qt::MouseButtons &theButton) |
Public Attributes | |
const Standard_Boolean | theIsOn |
Protected Slots | |
virtual void | onMousePress (SUIT_ViewWindow *, QMouseEvent *) |
virtual void | onMouseMove (SUIT_ViewWindow *, QMouseEvent *) |
virtual void | onMouseRelease (SUIT_ViewWindow *, QMouseEvent *) |
virtual void | onKeyPress (SUIT_ViewWindow *, QKeyEvent *) |
virtual void | onViewClosed (OCCViewer_ViewPort3d *) |
virtual void | onViewMapped (OCCViewer_ViewPort3d *) |
void | onDumpView () |
void | onChangeBackground () |
Protected Member Functions | |
Handle (V3d_Viewer) myV3dViewer | |
Handle (AIS_Trihedron) myTrihedron | |
Handle (AIS_InteractiveContext) myAISContext | |
Protected Attributes | |
int | myInteractionStyle |
int | myZoomingStyle |
int | myProjectionType |
int | myStereoType |
int | myAnaglyphFilter |
int | myStereographicFocusType |
int | myInterocularDistanceType |
double | myStereographicFocusValue |
double | myInterocularDistanceValue |
bool | myPreselectionEnabled |
bool | mySelectionEnabled |
bool | myMultiSelectionEnabled |
bool | myIsRelative |
bool | myToReverseStereo |
bool | myVSyncMode |
bool | myQuadBufferSupport |
int | myTopLayerId |
QPoint | myStartPnt |
QPoint | myEndPnt |
QPoint | myCurPnt |
double | myTrihedronSize |
QVector< Qtx::BackgroundData > | myBackgrounds |
OCCViewer_ClippingDlg * | myClippingDlg |
ClipPlanesList | myClipPlanes |
Graphic3d_SequenceOfHClipPlane | myInternalClipPlanes |
QColor | myClippingColor |
bool | myDefaultTextureUsed |
QString | myClippingTexture |
bool | myTextureModulated |
double | myClippingTextureScale |
Protected Attributes inherited from SUIT_ViewModel | |
SUIT_ViewManager * | myViewManager |
Additional Inherited Members | |
Static Public Attributes inherited from SUIT_ViewModel | |
static InteractionStyle2StatesMap | myStateMap |
static InteractionStyle2ButtonsMap | myButtonMap |
anonymous enum |
anonymous enum |
OCCViewer_Viewer::OCCViewer_Viewer | ( | bool | DisplayTrihedron = true | ) |
Constructor
DisplayTrihedron | - is trihedron displayed |
References Handle(), myAnaglyphFilter, myClippingColor, myClippingTexture, myClippingTextureScale, myDefaultTextureUsed, myInteractionStyle, myInterocularDistanceType, myInterocularDistanceValue, myMultiSelectionEnabled, myPreselectionEnabled, myProjectionType, myQuadBufferSupport, mySelectionEnabled, myStereographicFocusType, myStereographicFocusValue, myStereoType, myTextureModulated, myToReverseStereo, myVSyncMode, myZoomingStyle, and setDefaultLights().
|
virtual |
Destructor
int OCCViewer_Viewer::anaglyphFilter | ( | ) | const |
References myAnaglyphFilter.
void OCCViewer_Viewer::applyExistingClipPlanesToObject | ( | const Handle(AIS_InteractiveObject)& | theObject | ) |
Applies clipping planes to given object objects
References Handle(), and myInternalClipPlanes.
Qtx::BackgroundData OCCViewer_Viewer::background | ( | ) | const |
Qtx::BackgroundData OCCViewer_Viewer::background | ( | int | theViewId | ) | const |
References myBackgrounds.
QColor OCCViewer_Viewer::backgroundColor | ( | ) | const |
[obsolete]
QColor OCCViewer_Viewer::backgroundColor | ( | int | theViewId | ) | const |
References background(), and Qtx::BackgroundData::color().
|
static |
Get data for supported background modes: gradient types, identifiers and supported image formats
References Qtx::CenterTexture, Corner1Gradient, Corner2Gradient, Corner3Gradient, Corner4Gradient, Diagonal1Gradient, Diagonal2Gradient, HorizontalGradient, Qtx::StretchTexture, Qtx::TileTexture, and VerticalGradient.
QColor OCCViewer_Viewer::clippingColor | ( | ) | const |
References myClippingColor.
QString OCCViewer_Viewer::clippingTexture | ( | ) | const |
References myClippingTexture.
double OCCViewer_Viewer::clippingTextureScale | ( | ) | const |
References myClippingTextureScale.
Compute scene size
bool OCCViewer_Viewer::computeTrihedronSize | ( | double & | theNewSize, |
double & | theSize | ||
) |
Get new and current trihedron size corresponding to the current model size
References computeSceneSize(), QtxResourceMgr::doubleValue(), EPS, Handle(), SUIT_Session::resourceMgr(), SUIT_Session::session(), and viewer.
|
virtual |
Builds popup for occ viewer
Reimplemented from SUIT_ViewModel.
References SUIT_ViewManager::getActiveView(), SUIT_ViewModel::myViewManager, onChangeBackground(), and onDumpView().
|
virtual |
Reimplemented in SOCC_Viewer.
|
virtual |
Creates new view window
theDesktop | - main window of application |
Reimplemented from SUIT_ViewModel.
References background(), OCCViewer_ViewFrame::getView(), initView(), OCCViewer_ViewFrame::MAIN_VIEW, and OCCViewer_ViewWindow::setBackground().
|
signal |
bool OCCViewer_Viewer::enableDrawMode | ( | bool | on | ) |
! To be done for view windows
References OCCViewer_ViewWindow::enableDrawMode(), SUIT_ViewManager::getViews(), and SUIT_ViewModel::myViewManager.
void OCCViewer_Viewer::enableMultiselection | ( | bool | isEnable | ) |
Sets multiselection enabled status
isEnabled | - new status |
! To be done for view windows
References SUIT_ViewManager::getViews(), myMultiSelectionEnabled, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::updateEnabledDrawMode().
void OCCViewer_Viewer::enablePreselection | ( | bool | isEnabled | ) |
Enables/disables preselection
isEnabled | - new status |
References OCCViewer_ViewWindow::enablePreselection(), SUIT_ViewManager::getViews(), myPreselectionEnabled, and SUIT_ViewModel::myViewManager.
void OCCViewer_Viewer::enableSelection | ( | bool | isEnabled | ) |
Enables/disables selection
isEnabled | - new status |
! To be done for view windows
References OCCViewer_ViewWindow::enableSelection(), SUIT_ViewManager::getViews(), mySelectionEnabled, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::updateEnabledDrawMode().
OCCViewer_ClippingDlg * OCCViewer_Viewer::getClippingDlg | ( | ) | const |
Returns the pointer to the clipping dialog box.
References myClippingDlg.
ClipPlanesList OCCViewer_Viewer::getClipPlanes | ( | ) | const |
Returns the clipping planes applied to the displayed objects.
References myClipPlanes.
void OCCViewer_Viewer::getSelectedObjects | ( | AIS_ListOfInteractive & | theList | ) |
theList | - list to be filled with selected objects |
|
inline |
int OCCViewer_Viewer::getTopLayerId | ( | ) |
References myTopLayerId.
|
inlinevirtual |
Reimplemented from SUIT_ViewModel.
|
inline |
|
inline |
|
inline |
OCCViewer_Viewer::Handle | ( | Graphic3d_ClipPlane | ) | const |
|
protected |
|
protected |
|
protected |
bool OCCViewer_Viewer::highlight | ( | const Handle(AIS_InteractiveObject)& | obj, |
bool | hilight, | ||
bool | update = true |
||
) |
Hilights/unhilights object in viewer
obj | - object to be updated |
hilight | - if it is true, object will be hilighted, otherwise it will be unhilighted |
update | - update current viewer |
void OCCViewer_Viewer::initView | ( | OCCViewer_ViewWindow * | view | ) |
Start initialization of view window
view | - view window to be initialized |
References anaglyphFilter(), OCCViewer_ViewWindow::enablePreselection(), OCCViewer_ViewWindow::enableSelection(), OCCViewer_ViewWindow::getViewPort(), OCCViewer_ViewWindow::initLayout(), OCCViewer_ViewWindow::initSketchers(), interactionStyle(), interocularDistanceType(), interocularDistanceValue(), isPreselectionEnabled(), isQuadBufferSupport(), isReverseStereo(), isSelectionEnabled(), isVSync(), onViewClosed(), onViewMapped(), projectionType(), OCCViewer_ViewWindow::setAnaglyphFilter(), OCCViewer_ViewWindow::setInteractionStyle(), OCCViewer_ViewWindow::setInterocularDistance(), OCCViewer_ViewWindow::setProjectionType(), OCCViewer_ViewWindow::setQuadBufferSupport(), OCCViewer_ViewWindow::setReverseStereo(), OCCViewer_ViewWindow::setStereographicFocus(), OCCViewer_ViewWindow::setStereoType(), OCCViewer_ViewWindow::setVSync(), OCCViewer_ViewWindow::setZoomingStyle(), stereographicFocusType(), stereographicFocusValue(), stereoType(), and zoomingStyle().
int OCCViewer_Viewer::interactionStyle | ( | ) | const |
References myInteractionStyle.
int OCCViewer_Viewer::interocularDistanceType | ( | ) | const |
References myInterocularDistanceType.
double OCCViewer_Viewer::interocularDistanceValue | ( | ) | const |
References myInterocularDistanceValue.
bool OCCViewer_Viewer::isDefaultTextureUsed | ( | ) | const |
References myDefaultTextureUsed.
bool OCCViewer_Viewer::isInViewer | ( | const Handle(AIS_InteractiveObject)& | obj, |
bool | onlyInViewer = false |
||
) |
obj | - object to be checked |
onlyInViewer | - search object only in viewer (so object must be displayed) |
References obj.
|
inline |
void OCCViewer_Viewer::isos | ( | int & | u, |
int & | v | ||
) | const |
u | - to return u-isolines (first parametric co-ordinate) |
v | - to return v-isolines (second parametric co-ordinate) |
References Handle().
bool OCCViewer_Viewer::isPreselectionEnabled | ( | ) | const |
References myPreselectionEnabled.
bool OCCViewer_Viewer::isQuadBufferSupport | ( | ) | const |
References myQuadBufferSupport.
bool OCCViewer_Viewer::isReverseStereo | ( | ) | const |
References myToReverseStereo.
bool OCCViewer_Viewer::isSelectionEnabled | ( | ) | const |
References mySelectionEnabled.
bool OCCViewer_Viewer::isTextureModulated | ( | ) | const |
References myTextureModulated.
bool OCCViewer_Viewer::isTrihedronVisible | ( | ) | const |
bool OCCViewer_Viewer::isVisible | ( | const Handle(AIS_InteractiveObject)& | obj | ) |
obj | - object to be checked |
bool OCCViewer_Viewer::isVSync | ( | ) | const |
References myVSyncMode.
|
protectedslot |
SLOT: called if background color is to be changed changed, passes new color to view port
References OCCViewer_ViewWindow::background(), backgroundData(), SUIT_ViewManager::getActiveView(), QtxBackgroundDialog::getBackground(), Qtx::BackgroundData::isValid(), SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::setBackground().
|
protectedslot |
SLOT: called on dump view operation is activated, stores scene to raster file
References SUIT_ViewManager::getActiveView(), SUIT_ViewModel::myViewManager, and SUIT_ViewWindow::onDumpView().
|
protectedvirtualslot |
SLOT: called on key press, processes selection in "key free" interaction style
References deselection(), OCCViewer_ViewWindow::getViewPort(), Handle(), isPreselectionEnabled(), myCurPnt, myMultiSelectionEnabled, mySelectionEnabled, and selectionChanged().
|
protectedvirtualslot |
SLOT: called on mouse move, processes transformation or hilighting
References OCCViewer_ViewWindow::getViewPort(), Handle(), OCCViewer_ViewPort3d::isBusy(), isPreselectionEnabled(), isSelectionEnabled(), myCurPnt, and mySelectionEnabled.
|
protectedvirtualslot |
SLOT: called on mouse button press, stores current mouse position as start point for transformations
References myStartPnt.
|
protectedvirtualslot |
SLOT: called on mouse button release, finishes transformation or selection
References deselection(), OCCViewer_ViewWindow::getViewPort(), Handle(), isPreselectionEnabled(), myEndPnt, myMultiSelectionEnabled, mySelectionEnabled, myStartPnt, and selectionChanged().
|
protectedvirtualslot |
|
protectedvirtualslot |
void OCCViewer_Viewer::performSelectionChanged | ( | ) |
Auxiliary method to emit signal selectionChanged()
References selectionChanged().
int OCCViewer_Viewer::projectionType | ( | ) | const |
References myProjectionType.
|
signal |
void OCCViewer_Viewer::setAnaglyphFilter | ( | const int | theType | ) |
Sets anaglyph filter
theType | - new anaglyph filter |
References SUIT_ViewManager::getViews(), myAnaglyphFilter, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::setAnaglyphFilter().
void OCCViewer_Viewer::setBackground | ( | const Qtx::BackgroundData & | theBackground | ) |
Sets background data
d | - new background data |
void OCCViewer_Viewer::setBackground | ( | int | theViewId, |
const Qtx::BackgroundData & | theBackground | ||
) |
References Qtx::BackgroundData::isValid(), and myBackgrounds.
void OCCViewer_Viewer::setBackgroundColor | ( | const QColor & | c | ) |
Sets background color [obsolete]
c | - new background color |
void OCCViewer_Viewer::setBackgroundColor | ( | int | theViewId, |
const QColor & | theColor | ||
) |
References background(), setBackground(), and Qtx::BackgroundData::setColor().
void OCCViewer_Viewer::setClippingColor | ( | const QColor & | theColor | ) |
Sets a color of the clipped region
theColor | - a new color of the clipped region |
References myClippingColor, myInternalClipPlanes, and update().
void OCCViewer_Viewer::setClippingDlg | ( | OCCViewer_ClippingDlg * | theDlg | ) |
Stores pointer to the clipping dialog box.
References myClippingDlg.
void OCCViewer_Viewer::setClippingTextureParams | ( | const bool | isDefault, |
const QString & | theTexture, | ||
const bool | isModulate, | ||
const double | theScale | ||
) |
Sets default texture parameters
isDefault | - use/non-use default texture |
theTexture | - new texture of the clipped region |
isModulate | - enable/disable texture modulate mode |
theScale | - scale factor. |
References aTexture, Handle(), isModulate, myClippingTexture, myClippingTextureScale, myDefaultTextureUsed, myInternalClipPlanes, myTextureModulated, theTexture, and update().
void OCCViewer_Viewer::setClipPlanes | ( | ClipPlanesList | theList | ) |
Applies clipping planes to clippable objects
References Handle(), OCCViewer_ClipPlane::IsOn, myClipPlanes, myInternalClipPlanes, OCCViewer_ClipPlane::OrientationToXYZ(), OCCViewer_ClipPlane::X, OCCViewer_ClipPlane::Y, and OCCViewer_ClipPlane::Z.
void OCCViewer_Viewer::setColor | ( | const Handle(AIS_InteractiveObject)& | obj, |
const QColor & | color, | ||
bool | update = true |
||
) |
Sets color of object
obj | - object to be updated |
color | - new color |
update | - update current viewer |
void OCCViewer_Viewer::setDefaultLights | ( | ) |
void OCCViewer_Viewer::setInteractionStyle | ( | const int | theStyle | ) |
Sets interaction style: 0 - standard, 1 - keyboard free interaction
theStyle | - new interaction style |
! To be done for view windows
References SUIT_ViewManager::getViews(), myInteractionStyle, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::setInteractionStyle().
Sets interocular distance parameters
theType | - new IOD type |
theValue | - new IOD value |
References SUIT_ViewManager::getViews(), myInterocularDistanceType, myInterocularDistanceValue, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::setInterocularDistance().
Set number of isolines
u | - u-isolines (first parametric co-ordinate) |
v | - v-isolines (second parametric co-ordinate) |
References Handle().
void OCCViewer_Viewer::setObjectsSelected | ( | const AIS_ListOfInteractive & | theList | ) |
Selects objects in 3D viewer. Other selected objects are left as selected
theList | - list objects to be selected |
void OCCViewer_Viewer::setProjectionType | ( | const int | theType | ) |
Sets projection type: 0 - orthographic, 1 - perspective
theType | - new projection type |
References SUIT_ViewManager::getViews(), myProjectionType, SUIT_ViewModel::myViewManager, OCCViewer_ViewWindow::setProjectionType(), and OCCViewer_ViewWindow::Stereo.
void OCCViewer_Viewer::setQuadBufferSupport | ( | const bool | theEnable | ) |
Set support quad-buffered stereo
theEnable | - enable/disable support quad-buffered stereo |
References SUIT_ViewManager::getViews(), myQuadBufferSupport, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::setQuadBufferSupport().
void OCCViewer_Viewer::setReverseStereo | ( | const bool | theReverse | ) |
Sets reverse stereo
theReverse | - enable/disable reverse mode |
References SUIT_ViewManager::getViews(), myToReverseStereo, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::setReverseStereo().
|
inline |
void OCCViewer_Viewer::setSelectionOptions | ( | bool | isPreselectionEnabled, |
bool | isSelectionEnabled | ||
) |
Set number of isolines
u | - u-isolines (first parametric co-ordinate) |
v | - v-isolines (second parametric co-ordinate) |
References isPreselectionEnabled(), isSelectionEnabled(), myPreselectionEnabled, and mySelectionEnabled.
void OCCViewer_Viewer::setStaticTrihedronDisplayed | ( | const bool | on | ) |
Set the show static trihedron flag
References SUIT_ViewManager::getActiveView(), SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::showStaticTrihedron().
Sets stereographic focus parameters
theType | - new stereographic focus type |
theValue | - new stereographic focus value |
References SUIT_ViewManager::getViews(), myStereographicFocusType, myStereographicFocusValue, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::setStereographicFocus().
void OCCViewer_Viewer::setStereoType | ( | const int | theType | ) |
Sets stereo type
theType | - new stereo type |
References SUIT_ViewManager::getViews(), myStereoType, SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::setStereoType().
void OCCViewer_Viewer::setTransparency | ( | const Handle(AIS_InteractiveObject)& | obj, |
float | trans, | ||
bool | update = true |
||
) |
Changes transparency of object
obj | - object to be processed |
trans | - new transparency |
update | - update current viewer |
|
virtual |
Sets visibility state of trihedron
on | - new state |
|
virtual |
Changes trihedron size
sz | - new size |
References myIsRelative, myTrihedronSize, and updateTrihedron().
|
virtual |
Sets new view manager
theViewManager | - new view manager |
Reimplemented from SUIT_ViewModel.
References onKeyPress(), onMouseMove(), onMousePress(), onMouseRelease(), and SUIT_ViewModel::setViewManager().
void OCCViewer_Viewer::setVSync | ( | const bool | theEnable | ) |
Set V-Sync mode
theEnable | - enable/disable V-Sync mode |
References SUIT_ViewManager::getViews(), SUIT_ViewModel::myViewManager, myVSyncMode, and OCCViewer_ViewWindow::setVSync().
void OCCViewer_Viewer::setZoomingStyle | ( | const int | theStyle | ) |
Sets zooming style: 0 - standard, 1 - advanced (at cursor)
theStyle | - new zooming style |
! To be done for view windows
References SUIT_ViewManager::getViews(), SUIT_ViewModel::myViewManager, myZoomingStyle, and OCCViewer_ViewWindow::setZoomingStyle().
|
static |
Get data for supported stereo pair modes: stereo types and identifiers
References AnaglyphType, ChessBoardType, ColumnInterlacedType, OverUnderType, QuadBufferType, RowInterlacedType, and SideBySideType.
int OCCViewer_Viewer::stereographicFocusType | ( | ) | const |
References myStereographicFocusType.
double OCCViewer_Viewer::stereographicFocusValue | ( | ) | const |
References myStereographicFocusValue.
int OCCViewer_Viewer::stereoType | ( | ) | const |
References myStereoType.
void OCCViewer_Viewer::switchRepresentation | ( | const Handle(AIS_InteractiveObject)& | obj, |
int | mode, | ||
bool | update = true |
||
) |
Changes display mode of object
obj | - object to be processed |
mode | - new display mode |
update | - update current viewer |
void OCCViewer_Viewer::toggleTrihedron | ( | ) |
Changes visibility of trihedron to opposite
References isTrihedronVisible(), and setTrihedronShown().
|
inline |
|
inline |
double OCCViewer_Viewer::trihedronSize | ( | ) | const |
|
inlinestatic |
bool OCCViewer_Viewer::unHighlightAll | ( | bool | updateviewer = true , |
bool | unselect = true |
||
) |
Unhilights all objects in viewer
updateviewer | - update current viewer |
void OCCViewer_Viewer::update | ( | ) |
Updates OCC 3D viewer
References SUIT_ViewManager::getActiveView(), SUIT_ViewModel::myViewManager, and OCCViewer_ViewWindow::updateGravityCoords().
void OCCViewer_Viewer::updateTrihedron | ( | ) |
Update the size of the trihedron
References computeTrihedronSize(), myIsRelative, and myTrihedronSize.
int OCCViewer_Viewer::zoomingStyle | ( | ) | const |
References myZoomingStyle.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const Standard_Boolean OCCViewer_Viewer::theIsOn |