ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
QVTKWidgetCustom Class Reference

Container widget for vtk. More...

#include <QVTKWidgetCustom.h>

Inheritance diagram for QVTKWidgetCustom:
Collaboration diagram for QVTKWidgetCustom:

Public Member Functions

 QVTKWidgetCustom (QMainWindow *parentWindow, ecvDisplayTools *tools, bool stereoMode=false)
 
virtual ~QVTKWidgetCustom ()
 
vtkRenderer * getVtkRender ()
 
vtkRenderWindowInteractor * getVtkInteractor ()
 
void initVtk (vtkSmartPointer< vtkRenderWindowInteractor > interactor, bool useVBO=false)
 
void setMultiViewports (bool multi=true)
 
bool multiViewports () const
 
void addActor (vtkProp *actor, const QColor &clr=Qt::black)
 
void addViewProp (vtkProp *prop)
 
QList< vtkProp * > actors () const
 
void setActorsVisible (bool visible)
 
void setActorVisible (vtkProp *actor, bool visible)
 
bool actorVisible (vtkProp *actor)
 
void setBackgroundColor (const QColor &clr)
 
QColor backgroundColor () const
 
vtkRenderer * defaultRenderer ()
 
bool defaultRendererTaken () const
 
void transformCameraView (const double *viewMat)
 
void transformCameraProjection (const double *projMat)
 
void updateScene ()
 
vtkRenderWindow * GetRenderWindow ()
 
void SetRenderWindow (vtkRenderWindow *win)
 
QVTKInteractor * GetInteractor ()
 
void toWorldPoint (const CCVector3d &input2D, CCVector3d &output3D)
 
void toWorldPoint (const CCVector3 &input2D, CCVector3d &output3D)
 
void toDisplayPoint (const CCVector3d &worldPos, CCVector3d &displayPos)
 
void toDisplayPoint (const CCVector3 &worldPos, CCVector3d &displayPos)
 
void setCameraPosition (const CCVector3d &pos)
 
void setCameraFocalPoint (const CCVector3d &pos)
 
void setCameraViewUp (const CCVector3d &pos)
 
void setBackgroundColor (const ecvColor::Rgbf &bkg1, const ecvColor::Rgbf &bkg2, bool gradient)
 
vtkSmartPointer< vtkLookupTable > createLookupTable (double min, double max)
 
QMainWindow * getWin ()
 
void setScaleBarVisible (bool visible)
 

Protected Member Functions

void setBounds (double *bounds)
 
double xMin () const
 
double xMax () const
 
double yMin () const
 
double yMax () const
 
double zMin () const
 
double zMax () const
 
virtual bool event (QEvent *evt) override
 
virtual void wheelEvent (QWheelEvent *event) override
 
virtual void keyPressEvent (QKeyEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 
virtual void mouseDoubleClickEvent (QMouseEvent *event) override
 
virtual void dragEnterEvent (QDragEnterEvent *event) override
 
virtual void dropEvent (QDropEvent *event) override
 
virtual void updateActivateditems (int x, int y, int dx, int dy, bool updatePosition=false)
 

Protected Attributes

bool m_unclosable = true
 
bool m_useVBO = false
 
vtkRenderer * m_render
 
QMainWindow * m_win
 
ecvDisplayToolsm_tools
 
vtkDataObject * m_dataObject
 
vtkActor * m_modelActor = nullptr
 
vtkLODActor * m_filterActor = nullptr
 
QColor m_color1 = Qt::blue
 
QColor m_color2 = Qt::red
 
vtkSmartPointer< vtkPlanes > m_planes
 
vtkSmartPointer< vtkCamera > m_camera
 
vtkSmartPointer< vtkRendererCollection > m_renders
 
vtkSmartPointer< vtkRenderWindowInteractor > m_interactor
 
vtkSmartPointer< vtkLogoWidget > m_logoWidget
 Internal pointer to widget which contains a logo_Widget_. More...
 
vtkSmartPointer< vtkScalarBarWidget > m_scalarbarWidget
 Internal pointer to widget which contains a scalarbar_Widget_. More...
 
vtkSmartPointer< vtkOrientationMarkerWidget > m_axesWidget
 Internal pointer to widget which contains a set of axes. More...
 
ScaleBarWidgetm_scaleBar = nullptr
 
VtkWidgetPrivate * d_ptr
 
QTimer * m_wheelZoomUpdateTimer = nullptr
 

Detailed Description

Container widget for vtk.

Definition at line 62 of file QVTKWidgetCustom.h.

Constructor & Destructor Documentation

◆ QVTKWidgetCustom()

QVTKWidgetCustom::QVTKWidgetCustom ( QMainWindow *  parentWindow,
ecvDisplayTools tools,
bool  stereoMode = false 
)
explicit

◆ ~QVTKWidgetCustom()

QVTKWidgetCustom::~QVTKWidgetCustom ( )
virtual

Definition at line 220 of file QVTKWidgetCustom.cpp.

References d_ptr, m_scaleBar, and m_wheelZoomUpdateTimer.

Member Function Documentation

◆ actors()

QList< vtkProp * > QVTKWidgetCustom::actors ( ) const

Definition at line 435 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ actorVisible()

bool QVTKWidgetCustom::actorVisible ( vtkProp *  actor)

Definition at line 445 of file QVTKWidgetCustom.cpp.

◆ addActor()

void QVTKWidgetCustom::addActor ( vtkProp *  actor,
const QColor &  clr = Qt::black 
)

◆ addViewProp()

void QVTKWidgetCustom::addViewProp ( vtkProp *  prop)

◆ backgroundColor()

QColor QVTKWidgetCustom::backgroundColor ( ) const

Definition at line 467 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ createLookupTable()

vtkSmartPointer< vtkLookupTable > QVTKWidgetCustom::createLookupTable ( double  min,
double  max 
)

Definition at line 233 of file QVTKWidgetCustom.cpp.

References m_color1, m_color2, Utils::qColor2HSV(), and VTK_CREATE.

◆ defaultRenderer()

vtkRenderer * QVTKWidgetCustom::defaultRenderer ( )

Definition at line 471 of file QVTKWidgetCustom.cpp.

References d_ptr, GetRenderWindow(), and VtkUtils::vtkInitOnce().

Referenced by addActor(), and addViewProp().

◆ defaultRendererTaken()

bool QVTKWidgetCustom::defaultRendererTaken ( ) const

Definition at line 479 of file QVTKWidgetCustom.cpp.

References d_ptr.

Referenced by addActor(), and addViewProp().

◆ dragEnterEvent()

void QVTKWidgetCustom::dragEnterEvent ( QDragEnterEvent *  event)
overrideprotectedvirtual

Definition at line 1323 of file QVTKWidgetCustom.cpp.

References event().

Referenced by event().

◆ dropEvent()

void QVTKWidgetCustom::dropEvent ( QDropEvent *  event)
overrideprotectedvirtual

Definition at line 1330 of file QVTKWidgetCustom.cpp.

References event(), ecvDisplayTools::filesDropped(), m_tools, and CVLog::Print().

Referenced by event().

◆ event()

◆ GetInteractor()

QVTKInteractor* QVTKWidgetCustom::GetInteractor ( )
inline

Definition at line 103 of file QVTKWidgetCustom.h.

◆ GetRenderWindow()

vtkRenderWindow* QVTKWidgetCustom::GetRenderWindow ( )
inline

◆ getVtkInteractor()

vtkRenderWindowInteractor* QVTKWidgetCustom::getVtkInteractor ( )
inline

Definition at line 72 of file QVTKWidgetCustom.h.

◆ getVtkRender()

vtkRenderer* QVTKWidgetCustom::getVtkRender ( )
inline

Definition at line 71 of file QVTKWidgetCustom.h.

◆ getWin()

QMainWindow* QVTKWidgetCustom::getWin ( )
inline

Definition at line 130 of file QVTKWidgetCustom.h.

◆ initVtk()

void QVTKWidgetCustom::initVtk ( vtkSmartPointer< vtkRenderWindowInteractor >  interactor,
bool  useVBO = false 
)

◆ keyPressEvent()

void QVTKWidgetCustom::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Definition at line 1450 of file QVTKWidgetCustom.cpp.

References event().

◆ mouseDoubleClickEvent()

void QVTKWidgetCustom::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprotectedvirtual

◆ mouseMoveEvent()

void QVTKWidgetCustom::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Definition at line 657 of file QVTKWidgetCustom.cpp.

References a, ccHObject::addChild(), cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::ReferenceCloud::addPointIndex(), ecvDisplayTools::AddToOwnDB(), ccGLMatrixTpl< T >::applyRotation(), ecvViewportParameters::cameraAspectRatio, ecvDisplayTools::cameraParamChanged(), ecvDisplayTools::ComputeActualPixelSize(), ecvDisplayTools::ConvertMousePositionToOrientation(), cloudViewer::DegreesToRadians(), ecvDisplayTools::Deprecate3DLayer(), ecvDisplayTools::DisplayNewMessage(), Vector3Tpl< Type >::dot(), ecvDisplayTools::ENTITY_PICKING, ecvDisplayTools::ENTITY_RECT_PICKING, event(), ecvDisplayTools::ExclusiveFullScreen(), ccGLMatrixTpl< double >::FromToRotation(), cloudViewer::ReferenceCloud::getAssociatedCloud(), ecvDisplayTools::GetClick3DPos(), ccGLMatrixTpl< T >::getColumnAsVec3D(), ecvDisplayTools::GetDevicePixelRatio(), ecvDisplayTools::GetGLCameraParameters(), ecvViewportParameters::getPivotPoint(), cloudViewer::GenericIndexedCloudPersist::getPointPersistentPtr(), ecvColor::green(), height, ccGLMatrixTpl< T >::initFromParameters(), ecvDisplayTools::INTERACT_2D_ITEMS, ecvDisplayTools::INTERACT_CLICKABLE_ITEMS, ecvDisplayTools::INTERACT_PAN, ecvDisplayTools::INTERACT_ROTATE, ecvDisplayTools::INTERACT_SIG_MOUSE_MOVED, ecvDisplayTools::INTERACT_TRANSFORM_ENTITIES, ecvDisplayTools::InvalidateViewport(), ecvDisplayTools::labelmove2D(), ecvDisplayTools::LOWER_LEFT_MESSAGE, ecvDisplayTools::m_activeItems, ecvDisplayTools::m_allowRectangularEntityPicking, ecvDisplayTools::m_bubbleViewFov_deg, ecvDisplayTools::m_bubbleViewModeEnabled, ecvDisplayTools::m_clickableItemsVisible, ecvDisplayTools::m_customLightEnabled, ecvDisplayTools::m_customLightPos, ecvDisplayTools::m_hotZone, ecvDisplayTools::m_interactionFlags, m_interactor, ecvDisplayTools::m_lastMouseMovePos, ecvDisplayTools::m_lastMousePos, ecvDisplayTools::m_lockedRotationAxis, ecvDisplayTools::m_mouseMoved, M_PI, ecvDisplayTools::m_pickingMode, ecvDisplayTools::m_rectPickingPoly, m_render, ecvDisplayTools::m_rotationAxisLocked, m_scaleBar, ecvDisplayTools::m_showCursorCoordinates, m_tools, ecvDisplayTools::m_viewportParams, ccGLCameraParameters::modelViewMat, ecvDisplayTools::mouseMoved(), ecvDisplayTools::mousePosChanged(), ecvDisplayTools::MoveCamera(), ecvDisplayTools::NO_PICKING, Vector3Tpl< Type >::norm(), Vector3Tpl< Type >::normalize(), ecvViewportParameters::objectCenteredView, ecvViewportParameters::perspectiveView, ccGLCameraParameters::project(), cloudViewer::RadiansToDegrees(), ecvDisplayTools::HotZone::rect(), ecvDisplayTools::RedrawDisplay(), ccPointCloud::reserve(), ecvDisplayTools::RotateWithAxis(), ecvDisplayTools::rotation(), ecvDisplayTools::scheduleFullRedraw(), ecvDisplayTools::SCREEN_SIZE_MESSAGE, ccPolyline::set2DMode(), cloudViewer::Polyline::setClosed(), ccPolyline::setColor(), ccPolyline::setForeground(), ccDrawableObject::setVisible(), ccDrawableObject::showColors(), ecvDisplayTools::ShowPivotSymbol(), ecvDisplayTools::HotZone::topCorner, ecvDisplayTools::ToVtkCoordinates(), ecvDisplayTools::TRANSFORM_CAMERA(), ecvDisplayTools::translation(), ccGLMatrixTpl< T >::transposed(), ScaleBarWidget::update(), updateActivateditems(), ecvDisplayTools::UpdateActiveItemsList(), ecvDisplayTools::UpdateDisplayParameters(), ecvDisplayTools::UpdateNamePoseRecursive(), ecvDisplayTools::USE_2D, ecvViewportParameters::viewMat, ecvDisplayTools::viewMatRotated(), CVLog::Warning(), width, Tuple3Tpl< Type >::x, x, Tuple3Tpl< Type >::y, y, Tuple3Tpl< Type >::z, and ecvViewportParameters::zFar.

◆ mousePressEvent()

◆ mouseReleaseEvent()

void QVTKWidgetCustom::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

◆ multiViewports()

bool QVTKWidgetCustom::multiViewports ( ) const

Definition at line 364 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ setActorsVisible()

void QVTKWidgetCustom::setActorsVisible ( bool  visible)

Definition at line 437 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ setActorVisible()

void QVTKWidgetCustom::setActorVisible ( vtkProp *  actor,
bool  visible 
)

Definition at line 441 of file QVTKWidgetCustom.cpp.

◆ setBackgroundColor() [1/2]

void QVTKWidgetCustom::setBackgroundColor ( const ecvColor::Rgbf bkg1,
const ecvColor::Rgbf bkg2,
bool  gradient 
)

◆ setBackgroundColor() [2/2]

void QVTKWidgetCustom::setBackgroundColor ( const QColor &  clr)

Definition at line 449 of file QVTKWidgetCustom.cpp.

References d_ptr, and GetRenderWindow().

◆ setBounds()

void QVTKWidgetCustom::setBounds ( double *  bounds)
protected

Definition at line 484 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ setCameraFocalPoint()

void QVTKWidgetCustom::setCameraFocalPoint ( const CCVector3d pos)

◆ setCameraPosition()

void QVTKWidgetCustom::setCameraPosition ( const CCVector3d pos)

◆ setCameraViewUp()

void QVTKWidgetCustom::setCameraViewUp ( const CCVector3d pos)

◆ setMultiViewports()

void QVTKWidgetCustom::setMultiViewports ( bool  multi = true)

Definition at line 358 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ SetRenderWindow()

void QVTKWidgetCustom::SetRenderWindow ( vtkRenderWindow *  win)
inline

Definition at line 100 of file QVTKWidgetCustom.h.

Referenced by PCLDisplayTools::registerVisualizer().

◆ setScaleBarVisible()

void QVTKWidgetCustom::setScaleBarVisible ( bool  visible)
inline

Definition at line 132 of file QVTKWidgetCustom.h.

◆ toDisplayPoint() [1/2]

void QVTKWidgetCustom::toDisplayPoint ( const CCVector3 worldPos,
CCVector3d displayPos 
)

◆ toDisplayPoint() [2/2]

void QVTKWidgetCustom::toDisplayPoint ( const CCVector3d worldPos,
CCVector3d displayPos 
)

◆ toWorldPoint() [1/2]

void QVTKWidgetCustom::toWorldPoint ( const CCVector3 input2D,
CCVector3d output3D 
)

◆ toWorldPoint() [2/2]

void QVTKWidgetCustom::toWorldPoint ( const CCVector3d input2D,
CCVector3d output3D 
)

◆ transformCameraProjection()

void QVTKWidgetCustom::transformCameraProjection ( const double *  projMat)

Definition at line 274 of file QVTKWidgetCustom.cpp.

References m_camera.

Referenced by PCLDisplayTools::transformCameraProjection().

◆ transformCameraView()

void QVTKWidgetCustom::transformCameraView ( const double *  viewMat)

Definition at line 264 of file QVTKWidgetCustom.cpp.

References m_render.

Referenced by PCLDisplayTools::transformCameraView().

◆ updateActivateditems()

◆ updateScene()

void QVTKWidgetCustom::updateScene ( )

◆ wheelEvent()

◆ xMax()

double QVTKWidgetCustom::xMax ( ) const
protected

Definition at line 491 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ xMin()

double QVTKWidgetCustom::xMin ( ) const
protected

Definition at line 489 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ yMax()

double QVTKWidgetCustom::yMax ( ) const
protected

Definition at line 495 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ yMin()

double QVTKWidgetCustom::yMin ( ) const
protected

Definition at line 493 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ zMax()

double QVTKWidgetCustom::zMax ( ) const
protected

Definition at line 499 of file QVTKWidgetCustom.cpp.

References d_ptr.

◆ zMin()

double QVTKWidgetCustom::zMin ( ) const
protected

Definition at line 497 of file QVTKWidgetCustom.cpp.

References d_ptr.

Member Data Documentation

◆ d_ptr

◆ m_axesWidget

vtkSmartPointer<vtkOrientationMarkerWidget> QVTKWidgetCustom::m_axesWidget
protected

Internal pointer to widget which contains a set of axes.

Definition at line 180 of file QVTKWidgetCustom.h.

◆ m_camera

vtkSmartPointer<vtkCamera> QVTKWidgetCustom::m_camera
protected

Definition at line 167 of file QVTKWidgetCustom.h.

Referenced by initVtk(), and transformCameraProjection().

◆ m_color1

QColor QVTKWidgetCustom::m_color1 = Qt::blue
protected

Definition at line 162 of file QVTKWidgetCustom.h.

Referenced by createLookupTable().

◆ m_color2

QColor QVTKWidgetCustom::m_color2 = Qt::red
protected

Definition at line 163 of file QVTKWidgetCustom.h.

Referenced by createLookupTable().

◆ m_dataObject

vtkDataObject* QVTKWidgetCustom::m_dataObject
protected

Definition at line 158 of file QVTKWidgetCustom.h.

◆ m_filterActor

vtkLODActor* QVTKWidgetCustom::m_filterActor = nullptr
protected

Definition at line 160 of file QVTKWidgetCustom.h.

◆ m_interactor

vtkSmartPointer<vtkRenderWindowInteractor> QVTKWidgetCustom::m_interactor
protected

Definition at line 171 of file QVTKWidgetCustom.h.

Referenced by event(), initVtk(), mouseMoveEvent(), and updateScene().

◆ m_logoWidget

vtkSmartPointer<vtkLogoWidget> QVTKWidgetCustom::m_logoWidget
protected

Internal pointer to widget which contains a logo_Widget_.

Definition at line 174 of file QVTKWidgetCustom.h.

◆ m_modelActor

vtkActor* QVTKWidgetCustom::m_modelActor = nullptr
protected

Definition at line 159 of file QVTKWidgetCustom.h.

◆ m_planes

vtkSmartPointer<vtkPlanes> QVTKWidgetCustom::m_planes
protected

Definition at line 165 of file QVTKWidgetCustom.h.

◆ m_render

◆ m_renders

vtkSmartPointer<vtkRendererCollection> QVTKWidgetCustom::m_renders
protected

Definition at line 169 of file QVTKWidgetCustom.h.

Referenced by initVtk().

◆ m_scalarbarWidget

vtkSmartPointer<vtkScalarBarWidget> QVTKWidgetCustom::m_scalarbarWidget
protected

Internal pointer to widget which contains a scalarbar_Widget_.

Definition at line 177 of file QVTKWidgetCustom.h.

◆ m_scaleBar

ScaleBarWidget* QVTKWidgetCustom::m_scaleBar = nullptr
protected

Definition at line 182 of file QVTKWidgetCustom.h.

Referenced by event(), initVtk(), mouseMoveEvent(), updateScene(), and ~QVTKWidgetCustom().

◆ m_tools

◆ m_unclosable

bool QVTKWidgetCustom::m_unclosable = true
protected

Definition at line 152 of file QVTKWidgetCustom.h.

Referenced by event().

◆ m_useVBO

bool QVTKWidgetCustom::m_useVBO = false
protected

Definition at line 153 of file QVTKWidgetCustom.h.

Referenced by initVtk().

◆ m_wheelZoomUpdateTimer

QTimer* QVTKWidgetCustom::m_wheelZoomUpdateTimer = nullptr
protected

Definition at line 187 of file QVTKWidgetCustom.h.

Referenced by QVTKWidgetCustom(), wheelEvent(), and ~QVTKWidgetCustom().

◆ m_win

QMainWindow* QVTKWidgetCustom::m_win
protected

Definition at line 155 of file QVTKWidgetCustom.h.

Referenced by event().


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