![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
#include <Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.h>
Public Types | |
typedef QWidget | Superclass |
Public Slots | |
virtual void | forceRender () |
virtual bool | isRenderPaused () const |
virtual int | pauseRender () |
virtual int | resumeRender () |
virtual void | scheduleRender () |
virtual void | setBackgroundColor (const QColor &newBackgroundColor) |
Set the background color of the rendering screen. More... | |
virtual void | setBackgroundColor2 (const QColor &newBackgroundColor) |
virtual void | setCornerAnnotationText (const QString &text) |
Set corner annotation text. More... | |
void | setFPSVisible (bool show) |
Show/Hide the FPS annotation. More... | |
virtual void | setGradientBackground (bool enable) |
void | setMaximumUpdateRate (double fps) |
void | setRenderEnabled (bool value) |
Enable/Disable rendering. More... | |
virtual int | setRenderPaused (bool pause) |
void | setUseDepthPeeling (bool use) |
Public Member Functions | |
virtual QColor | backgroundColor () const |
Get background color. More... | |
virtual QColor | backgroundColor2 () const |
Get the second background color. More... | |
Q_INVOKABLE vtkCornerAnnotation * | cornerAnnotation () const |
QString | cornerAnnotationText () const |
Get corner annotation text. More... | |
ctkVTKAbstractView (QWidget *parent=0) | |
double | fps () const |
Return the current FPS. More... | |
virtual bool | gradientBackground () const |
Is the background a gradient. More... | |
virtual bool | hasHeightForWidth () const |
virtual int | heightForWidth (int width) const |
Q_INVOKABLE vtkRenderWindowInteractor * | interactor () const |
Set/Get window interactor. More... | |
Q_INVOKABLE vtkInteractorObserver * | interactorStyle () const |
Get current interactor style. More... | |
bool | isFPSVisible () const |
Return true if the FPS annotation is visible, false otherwise. More... | |
double | maximumUpdateRate () const |
virtual QSize | minimumSizeHint () const |
bool | renderEnabled () const |
Return if rendering is enabled. More... | |
Q_INVOKABLE vtkRenderWindow * | renderWindow () const |
Get underlying RenderWindow. More... | |
virtual void | setInteractor (vtkRenderWindowInteractor *interactor) |
virtual QSize | sizeHint () const |
bool | useDepthPeeling () const |
Q_INVOKABLE ctkVTKOpenGLNativeWidget * | VTKWidget () const |
Get the underlying QVTKWidget. More... | |
virtual | ~ctkVTKAbstractView () |
Static Public Member Functions | |
static int | multiSamples () |
static void | setMultiSamples (int) |
Protected Slots | |
void | onRender () |
virtual void | requestRender () |
void | updateFPS () |
Protected Member Functions | |
ctkVTKAbstractView (ctkVTKAbstractViewPrivate *pimpl, QWidget *parent) | |
Protected Attributes | |
QScopedPointer< ctkVTKAbstractViewPrivate > | d_ptr |
Properties | |
QColor | backgroundColor |
QColor | backgroundColor2 |
QVTK_OBJECTQString | cornerAnnotationText |
bool | fpsVisible |
bool | gradientBackground |
double | maximumUpdateRate |
Set a maximum rate (in frames per second) for rendering. More... | |
bool | renderEnabled |
bool | useDepthPeeling |
Definition at line 39 of file ctkVTKAbstractView.h.
typedef QWidget ctkVTKAbstractView::Superclass |
Definition at line 61 of file ctkVTKAbstractView.h.
|
explicit |
|
virtual |
|
protected |
|
virtual |
Get background color.
Reimplemented in ctkVTKSliceView.
|
virtual |
Get the second background color.
Q_INVOKABLE vtkCornerAnnotation* ctkVTKAbstractView::cornerAnnotation | ( | ) | const |
QString ctkVTKAbstractView::cornerAnnotationText | ( | ) | const |
Get corner annotation text.
|
virtualslot |
Force a render even if a render is already ocurring Be careful when calling forceRender() as it can slow down your application. It is preferable to use scheduleRender() instead.
double ctkVTKAbstractView::fps | ( | ) | const |
Return the current FPS.
|
virtual |
Is the background a gradient.
|
virtual |
|
virtual |
Q_INVOKABLE vtkRenderWindowInteractor* ctkVTKAbstractView::interactor | ( | ) | const |
Set/Get window interactor.
Q_INVOKABLE vtkInteractorObserver* ctkVTKAbstractView::interactorStyle | ( | ) | const |
Get current interactor style.
bool ctkVTKAbstractView::isFPSVisible | ( | ) | const |
Return true if the FPS annotation is visible, false otherwise.
|
virtualslot |
Returns true if the current pause render count is greater than 0
double ctkVTKAbstractView::maximumUpdateRate | ( | ) | const |
Returns maximum rate for rendering (in frames per second). \sa setMaximumUpdateRate
|
virtual |
|
static |
Return the current multisamples default
|
protectedslot |
|
virtualslot |
Increments the pause render count
bool ctkVTKAbstractView::renderEnabled | ( | ) | const |
Return if rendering is enabled.
Q_INVOKABLE vtkRenderWindow* ctkVTKAbstractView::renderWindow | ( | ) | const |
Get underlying RenderWindow.
|
protectedvirtualslot |
Calls forceRender if the rendering has not been paused from pauseRender()
|
virtualslot |
De-increments the pause render count and calls scheduleRender() if one is currently pending
|
virtualslot |
Notify QVTKWidget that the view needs to be rendered. scheduleRender() respects the maximum update rate of the view, it won't render the window more frequently than what the maximum update rate is.
|
virtualslot |
Set the background color of the rendering screen.
Reimplemented in ctkVTKSliceView.
|
virtualslot |
Set the second background color of the rendering screen for gradient backgrounds.
|
virtualslot |
Set corner annotation text.
|
slot |
Show/Hide the FPS annotation.
|
virtualslot |
Set whether this view should have a gradient background using the Background (top) and Background2 (bottom) colors. Default is off.
|
virtual |
QVTKWidget catches all render requests, and ensure the desired framerate is respected. The interactor never calls Render() on the render window. TBD: can we only set a QVTKRenderWindowInteractor ?
Reimplemented in ctkVTKRenderView.
|
slot |
Set maximum rate for rendering (in frames per second). If rendering is requested more frequently than this rate using scheduleRender, actual rendering will happen at this rate. This mechanism prevents repeated rendering caused by cluster of rendering requests.
If maximum update rate is set to 0 then it indicates that rendering is done next time the application is idle, i.e., pending timer events are processed. This option should be used with caution, as policy of timer event processing may differ between operating systems. Specifically, on macOS, timer events may be indefinitely delayed if user interface continuously generates events.
RenderWindow's DesiredUpdateRate property is intended for determining rendering quality settings, and is not suitable to be used as maximum update rate. The main reason is that VTK usually makes the rendering much faster and lower quality than DesiredUpdateRate would dictate, and so it would unnecessarily decrease the actual refresh rate.
By default maximum update rate is set to 60FPS, which allows smooth updates, while effectively suppressing repeated update requests (after a rendering has been completed, repeated rendering requests will be ignored for 17 milliseconds).
|
static |
Set the default number of multisamples to use. Note that a negative value means "auto", which means the renderer will attempt to select the maximum number (but is not guaranteed to work).
WARNING: Multisampling should be set before creation of the OpenGL context (e.g., initializing the rendering window) in order to have an effect. Consider using setMultisamples before instantiating ctkVTKAbstractView objects.
|
slot |
Enable/Disable rendering.
|
virtualslot |
Calls pauseRender() if pause is true or resumeRender() if pause is false When pause render count is greater than 0, prevents requestRender() from calling forceRender() Callers are responsible for calling both setPauseRender(true) and setPauseRender(false) Ex.
If the pause render count reaches zero when calling resumeRender(), scheduleRender() will be called if a scheduleRender() was invoked while rendering was paused. Rendering can still be triggered while the paused with forceRender()
This behaviour is different from renderEnabled(), which will prevent all rendering calls from both scheduleRender() and forceRender(), and will not invoke either when re-enabled.
|
slot |
Set the useDepthPeeling property value.
|
virtual |
|
protectedslot |
bool ctkVTKAbstractView::useDepthPeeling | ( | ) | const |
Returns true if depth peeling is enabled.
Q_INVOKABLE ctkVTKOpenGLNativeWidget* ctkVTKAbstractView::VTKWidget | ( | ) | const |
Get the underlying QVTKWidget.
|
protected |
Definition at line 234 of file ctkVTKAbstractView.h.
|
readwrite |
Definition at line 42 of file ctkVTKAbstractView.h.
|
readwrite |
Definition at line 42 of file ctkVTKAbstractView.h.
|
readwrite |
Definition at line 42 of file ctkVTKAbstractView.h.
|
readwrite |
This property controls whether a corner annotation is visible with the last frames per second (FPS) value. false by default.
Definition at line 42 of file ctkVTKAbstractView.h.
|
readwrite |
Definition at line 42 of file ctkVTKAbstractView.h.
|
readwrite |
Set a maximum rate (in frames per second) for rendering.
Definition at line 42 of file ctkVTKAbstractView.h.
|
readwrite |
Definition at line 42 of file ctkVTKAbstractView.h.
|
readwrite |
This property controls whether the render window uses depth peeling or not. false by default.
Definition at line 42 of file ctkVTKAbstractView.h.