Version: 9.15.0
OCCViewer_ViewPort3d Class Reference

#include <OCCViewer_ViewPort3d.h>

Inheritance diagram for OCCViewer_ViewPort3d:
Inheritance graph

Public Slots

virtual bool synchronize (OCCViewer_ViewPort *)
 
- Public Slots inherited from OCCViewer_ViewPort
virtual bool synchronize (OCCViewer_ViewPort *)
 

Signals

void vpChangeBackground (const Qtx::BackgroundData &)
 
void vpClosed (OCCViewer_ViewPort3d *)
 
void vpMapped (OCCViewer_ViewPort3d *)
 
void vpResizeEvent (QResizeEvent *)
 
- Signals inherited from OCCViewer_ViewPort
void vpKeyEvent (QKeyEvent *)
 
void vpMouseEvent (QMouseEvent *)
 
void vpDrawExternal (QPainter *)
 
void vpChangeBGColor (QColor)
 
void vpTransformed (OCCViewer_ViewPort *)
 

Public Member Functions

 OCCViewer_ViewPort3d (QWidget *, const Handle(V3d_Viewer)&, V3d_TypeOfView=V3d_ORTHOGRAPHIC)
 
virtual ~OCCViewer_ViewPort3d ()
 
 Handle (V3d_View) getView() const
 
 Handle (V3d_View) setView(const Handle(V3d_View) &)
 
 Handle (V3d_Viewer) getViewer() const
 
virtual void setBackgroundColor (const QColor &color)
 
virtual QColor backgroundColor () const
 
void setBackground (const Qtx::BackgroundData &color)
 
Qtx::BackgroundData background () const
 
virtual int getBgImgHeight ()
 
virtual int getBgImgWidth ()
 
virtual bool syncronize (const OCCViewer_ViewPort3d *)
 
void getAxialScale (double &, double &, double &)
 
virtual void onUpdate ()
 
virtual void reset ()
 
virtual void pan (int, int)
 
virtual void setCenter (int, int)
 
virtual void fitRect (const QRect &)
 
virtual void startZoomAtPoint (int, int)
 
virtual void zoom (int, int, int, int)
 
virtual void fitAll (bool keepScale=false, bool withZ=true, bool upd=true)
 
virtual void rotateXY (double)
 
virtual void setAxialScale (double, double, double)
 
virtual void startRotation (int, int, int, const gp_Pnt &)
 
virtual void rotate (int, int, int, const gp_Pnt &)
 
virtual void endRotation ()
 
void setRotationAxis (const gp_Vec &theAxis, double theAngle, double theZAngle)
 
void stopRotation ()
 
bool isBusy ()
 
void setAdvancedZoomingEnabled (const bool theState)
 
bool isAdvancedZoomingEnabled () const
 
void showStaticTrihedron (bool)
 
void setStaticTrihedronTextFont ()
 
void setStaticTrihedronTextColor ()
 
void setDefaultCursor (Qt::CursorShape theCursorShape)
 
QCursor * getDefaultCursor () const
 
- Public Member Functions inherited from OCCViewer_ViewPort
 OCCViewer_ViewPort (QWidget *parent)
 
virtual ~OCCViewer_ViewPort ()
 
void setSketchingEnabled (bool)
 
bool isSketchingEnabled () const
 
void setTransformEnabled (bool)
 
bool isTransformEnabled () const
 
void redrawPainters ()
 
virtual QPaintEngine * paintEngine () const
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *)
 
virtual void resizeEvent (QResizeEvent *)
 
virtual void attachWindow (const Handle(V3d_View)&, const Handle(Aspect_Window)&)
 
- Protected Member Functions inherited from OCCViewer_ViewPort
void selectVisualId ()
 
virtual void mouseMoveEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 
virtual void keyPressEvent (QKeyEvent *)
 
virtual void keyReleaseEvent (QKeyEvent *)
 
 Handle (Aspect_Window) myWindow
 

Private Slots

void updateRotation ()
 
void repaintViewAfterMove ()
 

Private Member Functions

 Handle (V3d_View) activeView() const
 
 Handle (V3d_View) inactiveView() const
 
bool mapView (const Handle(V3d_View)&)
 
bool setWindow (const Handle(V3d_View)&)
 
bool mapped (const Handle(V3d_View)&) const
 
void updateBackground ()
 
void setDefaultParams ()
 
 Handle (V3d_View) myActiveView
 

Private Attributes

bool myBusy
 
double myScale
 
bool myIsAdvancedZoomingEnabled
 
Qtx::BackgroundData myBackground
 
int myBgImgHeight
 
int myBgImgWidth
 
QCursor * myCursor
 
gp_Ax1 myRotAxis
 
double myRotAngle
 
bool myIsRotating
 
qint64 myLastRender
 
QTimer * myRotTimer
 

Friends

class OCCViewer_ViewTransformer
 

Additional Inherited Members

- Protected Slots inherited from OCCViewer_ViewPort
virtual void onChangeBackground ()
 
- Protected Attributes inherited from OCCViewer_ViewPort
bool myEnableSketching
 
bool myEnableTransform
 
bool myPaintersRedrawing
 
QList< QtxAction * > myPopupActions
 

Constructor & Destructor Documentation

◆ OCCViewer_ViewPort3d()

OCCViewer_ViewPort3d::OCCViewer_ViewPort3d ( QWidget parent,
const Handle(V3d_Viewer)&  viewer,
V3d_TypeOfView  type = V3d_ORTHOGRAPHIC 
)

Constructor

References myCursor, myRotTimer, and setDefaultParams().

◆ ~OCCViewer_ViewPort3d()

OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d ( )
virtual

Destructor

References Handle(), myCursor, myRotTimer, and vpClosed().

Member Function Documentation

◆ attachWindow()

void OCCViewer_ViewPort3d::attachWindow ( const Handle(V3d_View)&  view,
const Handle(Aspect_Window)&  window 
)
protectedvirtual

◆ background()

Qtx::BackgroundData OCCViewer_ViewPort3d::background ( ) const

Returns the background data

References myBackground.

◆ backgroundColor()

QColor OCCViewer_ViewPort3d::backgroundColor ( ) const
virtual

Returns the background color [ virtual public ] [ obsolete ]

Reimplemented from OCCViewer_ViewPort.

References background(), and Qtx::BackgroundData::color().

◆ endRotation()

void OCCViewer_ViewPort3d::endRotation ( )
virtual

Resets the viewport after 'rotation'. [ protected ]

References OCCViewer_ViewPort::vpTransformed().

◆ fitAll()

void OCCViewer_ViewPort3d::fitAll ( bool  keepScale = false,
bool  withZ = true,
bool  upd = true 
)
virtual

Fits all objects in view. [ virtual protected ]

Implements OCCViewer_ViewPort.

References myIsRotating, myScale, stopRotation(), and OCCViewer_ViewPort::vpTransformed().

◆ fitRect()

void OCCViewer_ViewPort3d::fitRect ( const QRect &  rect)
virtual

Called at 'window fit' transformation. [ virtual protected ]

Implements OCCViewer_ViewPort.

References OCCViewer_ViewPort::vpTransformed().

◆ getAxialScale()

void OCCViewer_ViewPort3d::getAxialScale ( double &  xScale,
double &  yScale,
double &  zScale 
)

Get axial scale to the view

◆ getBgImgHeight()

virtual int OCCViewer_ViewPort3d::getBgImgHeight ( )
inlinevirtual

◆ getBgImgWidth()

virtual int OCCViewer_ViewPort3d::getBgImgWidth ( )
inlinevirtual

◆ getDefaultCursor()

QCursor * OCCViewer_ViewPort3d::getDefaultCursor ( ) const

References myCursor.

◆ Handle() [1/6]

OCCViewer_ViewPort3d::Handle ( V3d_View  ) const
private

◆ Handle() [2/6]

OCCViewer_ViewPort3d::Handle ( V3d_View  ) const

◆ Handle() [3/6]

OCCViewer_ViewPort3d::Handle ( V3d_View  ) const
private

◆ Handle() [4/6]

OCCViewer_ViewPort3d::Handle ( V3d_View  )
private

◆ Handle() [5/6]

OCCViewer_ViewPort3d::Handle ( V3d_View  ) const &

◆ Handle() [6/6]

OCCViewer_ViewPort3d::Handle ( V3d_Viewer  ) const

◆ isAdvancedZoomingEnabled()

bool OCCViewer_ViewPort3d::isAdvancedZoomingEnabled ( ) const
inline

◆ isBusy()

bool OCCViewer_ViewPort3d::isBusy ( )
inline

◆ mapped()

bool OCCViewer_ViewPort3d::mapped ( const Handle(V3d_View)&  ) const
private

◆ mapView()

bool OCCViewer_ViewPort3d::mapView ( const Handle(V3d_View)&  view)
private

Activates the desired 'type' of view in the viewer ( view of 'type' is created if it doesn't exist ). [ public ]

Maps CasCade 'view' to this viewport. [ private ]

References mapped(), setWindow(), and vpMapped().

◆ onUpdate()

void OCCViewer_ViewPort3d::onUpdate ( )
virtual

Updates the active viewport. [ virtual public ]

Reimplemented from OCCViewer_ViewPort.

◆ paintEvent()

void OCCViewer_ViewPort3d::paintEvent ( QPaintEvent *  e)
protectedvirtual

Repaints the viewport. [ virtual protected ]

Reimplemented from OCCViewer_ViewPort.

References mapped(), mapView(), myBusy, OCCViewer_ViewPort::myPaintersRedrawing, and OCCViewer_ViewPort::paintEvent().

◆ pan()

void OCCViewer_ViewPort3d::pan ( int  dx,
int  dy 
)
virtual

Called at 'pan' transformation. [ virtual protected ]

Implements OCCViewer_ViewPort.

References myIsRotating, stopRotation(), and OCCViewer_ViewPort::vpTransformed().

◆ repaintViewAfterMove

void OCCViewer_ViewPort3d::repaintViewAfterMove ( )
privateslot

Moved the viewport

◆ reset()

void OCCViewer_ViewPort3d::reset ( )
virtual

Resets the view. [ virtual protected ]

Implements OCCViewer_ViewPort.

References myIsRotating, stopRotation(), and OCCViewer_ViewPort::vpTransformed().

◆ resizeEvent()

void OCCViewer_ViewPort3d::resizeEvent ( QResizeEvent *  e)
protectedvirtual

Resizes the viewport. [ virtual protected ]

References mapped(), mapView(), repaintViewAfterMove(), and vpResizeEvent().

◆ rotate()

void OCCViewer_ViewPort3d::rotate ( int  x,
int  y,
int  theRotationPointType,
const gp_Pnt &  theSelectedPoint 
)
virtual

◆ rotateXY()

void OCCViewer_ViewPort3d::rotateXY ( double  degrees)
virtual

Rotate the view in the view plane (orthogonal to the view vector)

References myIsRotating, stopRotation(), and OCCViewer_ViewPort::vpTransformed().

◆ setAdvancedZoomingEnabled()

void OCCViewer_ViewPort3d::setAdvancedZoomingEnabled ( const bool  theState)
inline

◆ setAxialScale()

void OCCViewer_ViewPort3d::setAxialScale ( double  xScale,
double  yScale,
double  zScale 
)
virtual

Set axial scale to the view

References OCCViewer_ViewPort::vpTransformed().

◆ setBackground()

void OCCViewer_ViewPort3d::setBackground ( const Qtx::BackgroundData bgData)

◆ setBackgroundColor()

void OCCViewer_ViewPort3d::setBackgroundColor ( const QColor &  color)
virtual

Sets the background color [ virtual public ] [ obsolete ]

Reimplemented from OCCViewer_ViewPort.

References background(), OCCViewer::color(), setBackground(), and Qtx::BackgroundData::setColor().

◆ setCenter()

void OCCViewer_ViewPort3d::setCenter ( int  x,
int  y 
)
virtual

Centers the viewport. [ virtual protected ]

Implements OCCViewer_ViewPort.

References myIsRotating, myScale, stopRotation(), and OCCViewer_ViewPort::vpTransformed().

◆ setDefaultCursor()

void OCCViewer_ViewPort3d::setDefaultCursor ( Qt::CursorShape  theCursorShape)

References myCursor.

◆ setDefaultParams()

◆ setRotationAxis()

void OCCViewer_ViewPort3d::setRotationAxis ( const gp_Vec &  theAxis,
double  theAngle,
double  theZAngle 
)

Set the rotation axis and start automatic rotation

References Handle(), myIsRotating, myLastRender, myRotAngle, myRotAxis, myRotTimer, updateRotation(), and zRotation.

◆ setStaticTrihedronTextColor()

void OCCViewer_ViewPort3d::setStaticTrihedronTextColor ( )

Set the color for axes labels of static trihedron

References Handle(), and ViewerTools_TrihedronSetupBase::setTextColor().

◆ setStaticTrihedronTextFont()

void OCCViewer_ViewPort3d::setStaticTrihedronTextFont ( )

Set the font for axes labels of static trihedron

References Handle(), and ViewerTools_TrihedronSetupBase::setTextFont().

◆ setWindow()

bool OCCViewer_ViewPort3d::setWindow ( const Handle(V3d_View)&  view)
private

Passed the handle of native window of the component to CASCADE view. [ private ]

References attachWindow().

◆ showStaticTrihedron()

void OCCViewer_ViewPort3d::showStaticTrihedron ( bool  on)

◆ startRotation()

void OCCViewer_ViewPort3d::startRotation ( int  x,
int  y,
int  theRotationPointType,
const gp_Pnt &  theSelectedPoint 
)
virtual

Inits 'rotation' transformation. [ protected ]

References OCCViewer_ViewWindow::BBCENTER, myIsRotating, rx, ry, OCCViewer_ViewWindow::SELECTED, stopRotation(), sx, sy, and zRotation.

◆ startZoomAtPoint()

void OCCViewer_ViewPort3d::startZoomAtPoint ( int  x,
int  y 
)
virtual

Inits 'zoom' transformation. [ protected ]

References isAdvancedZoomingEnabled().

◆ stopRotation()

void OCCViewer_ViewPort3d::stopRotation ( )

Stop the automatic rotation

References myIsRotating, and myRotTimer.

◆ synchronize

virtual bool OCCViewer_ViewPort3d::synchronize ( OCCViewer_ViewPort )
virtualslot

◆ syncronize()

virtual bool OCCViewer_ViewPort3d::syncronize ( const OCCViewer_ViewPort3d )
virtual

◆ updateBackground()

◆ updateRotation

void OCCViewer_ViewPort3d::updateRotation ( )
privateslot

Update the automatic rotation animation

References Handle(), myIsRotating, myLastRender, myRotAngle, myRotAxis, and myRotTimer.

◆ vpChangeBackground

void OCCViewer_ViewPort3d::vpChangeBackground ( const Qtx::BackgroundData )
signal

◆ vpClosed

void OCCViewer_ViewPort3d::vpClosed ( OCCViewer_ViewPort3d )
signal

◆ vpMapped

void OCCViewer_ViewPort3d::vpMapped ( OCCViewer_ViewPort3d )
signal

◆ vpResizeEvent

void OCCViewer_ViewPort3d::vpResizeEvent ( QResizeEvent *  )
signal

◆ zoom()

void OCCViewer_ViewPort3d::zoom ( int  x0,
int  y0,
int  x,
int  y 
)
virtual

Called at 'zoom' transformation. [ virtual protected ]

Implements OCCViewer_ViewPort.

References isAdvancedZoomingEnabled(), and OCCViewer_ViewPort::vpTransformed().

Friends And Related Function Documentation

◆ OCCViewer_ViewTransformer

friend class OCCViewer_ViewTransformer
friend

Member Data Documentation

◆ myBackground

Qtx::BackgroundData OCCViewer_ViewPort3d::myBackground
private

◆ myBgImgHeight

int OCCViewer_ViewPort3d::myBgImgHeight
private

◆ myBgImgWidth

int OCCViewer_ViewPort3d::myBgImgWidth
private

◆ myBusy

bool OCCViewer_ViewPort3d::myBusy
private

◆ myCursor

QCursor* OCCViewer_ViewPort3d::myCursor
private

◆ myIsAdvancedZoomingEnabled

bool OCCViewer_ViewPort3d::myIsAdvancedZoomingEnabled
private

◆ myIsRotating

bool OCCViewer_ViewPort3d::myIsRotating
private

◆ myLastRender

qint64 OCCViewer_ViewPort3d::myLastRender
private

◆ myRotAngle

double OCCViewer_ViewPort3d::myRotAngle
private

◆ myRotAxis

gp_Ax1 OCCViewer_ViewPort3d::myRotAxis
private

◆ myRotTimer

QTimer* OCCViewer_ViewPort3d::myRotTimer
private

◆ myScale

double OCCViewer_ViewPort3d::myScale
private

The documentation for this class was generated from the following files: