ParaView
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
pqMultiViewWidget Class Reference

pqMultiViewWidget is a widget that manages layout of multiple views. More...

#include <pqMultiViewWidget.h>

Inherits QWidget.

Public Slots

void reload ()
 This forces the pqMultiViewWidget to reload its layout from the vtkSMViewLayoutProxy instance. More...
 
void assignToFrame (pqView *)
 Assigns a frame to the view. More...
 
void makeFrameActive ()
 In a tabbed setup, when pqMultiViewWidget becomes active, this method should be called to ensure that the first view/frame in this widget is indeed made active, as the user would expect. More...
 
void setDecorationsVisible (bool)
 Set the visibility for frame decorations and splitter handles. More...
 
void showDecorations ()
 
void hideDecorations ()
 
void lockViewSize (const QSize &)
 Locks the maximum size for each view-frame to the given size. More...
 
void reset ()
 cleans up the layout. More...
 
void destroyAllViews ()
 destroys each of the views present in this layout. More...
 

Signals

void frameActivated ()
 fired when a frame in this widget becomes active. More...
 

Public Member Functions

 pqMultiViewWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 
virtual ~pqMultiViewWidget ()
 
void setLayoutManager (vtkSMViewLayoutProxy *)
 Get/Set the vtkSMViewLayoutProxy instance this widget is using as the layout manager. More...
 
vtkSMViewLayoutProxylayoutManager () const
 
bool isDecorationsVisible () const
 Returns whether window decorations and splitter handles are visible. More...
 
vtkImageData * captureImage (int width, int height)
 Captures an image for the views in the layout. More...
 
int prepareForCapture (int width, int height)
 setups up the environment for capture. More...
 
void cleanupAfterCapture ()
 cleans up the environment after image capture. More...
 
bool writeImage (const QString &filename, int width, int height, int quality=-1)
 Capture an image and saves it out to a file. More...
 
QList< vtkSMViewProxy * > viewProxies () const
 Returns list of views assigned to frames in this widget. More...
 
bool isViewAssigned (pqView *) const
 Returns true if the view has been assigned to this layout. More...
 
bool togglePopout ()
 pqMultiViewWidget supports popout mode i.e. More...
 

Protected Slots

void standardButtonPressed (int)
 Slots called on different signals fired by the nested frames or splitters. More...
 
void splitterMoved ()
 
void makeActive (pqViewFrame *frame)
 Makes a frame active. More...
 
void markActive (pqView *view)
 Marks the frame corresponding to the view, if present in the widget, as active. More...
 
void markActive (pqViewFrame *frame)
 
void swapPositions (const QString &)
 swap frame positions. More...
 
void proxyRemoved (pqProxy *)
 when a view proxy is unregistered, we ensure that the frame is marked as empty. More...
 
void viewAdded (pqView *)
 called when a new view is added. More...
 

Protected Member Functions

virtual pqViewFramenewFrame (vtkSMProxy *view)
 Called whenever a new frame needs to be created for a view. More...
 
virtual bool eventFilter (QObject *caller, QEvent *evt)
 Event filter callback to detect when a sub-frame becomes active, so that we can mark it as such. More...
 

Detailed Description

pqMultiViewWidget is a widget that manages layout of multiple views.

It works together with a vtkSMViewLayoutProxy instance to keep track of the layout for the views. It's acceptable to create multiple instances of pqMultiViewWidget in the same application.

Definition at line 53 of file pqMultiViewWidget.h.

Constructor & Destructor Documentation

◆ pqMultiViewWidget()

pqMultiViewWidget::pqMultiViewWidget ( QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

◆ ~pqMultiViewWidget()

virtual pqMultiViewWidget::~pqMultiViewWidget ( )
virtual

Member Function Documentation

◆ setLayoutManager()

void pqMultiViewWidget::setLayoutManager ( vtkSMViewLayoutProxy )

Get/Set the vtkSMViewLayoutProxy instance this widget is using as the layout manager.

◆ layoutManager()

vtkSMViewLayoutProxy* pqMultiViewWidget::layoutManager ( ) const

◆ isDecorationsVisible()

bool pqMultiViewWidget::isDecorationsVisible ( ) const
inline

Returns whether window decorations and splitter handles are visible.

Definition at line 72 of file pqMultiViewWidget.h.

◆ captureImage()

vtkImageData* pqMultiViewWidget::captureImage ( int  width,
int  height 
)

Captures an image for the views in the layout.

Note that there must be at least one valid view in the widget, otherwise returns NULL.

◆ prepareForCapture()

int pqMultiViewWidget::prepareForCapture ( int  width,
int  height 
)

setups up the environment for capture.

Returns the magnification that can be used to capture the image for required size.

◆ cleanupAfterCapture()

void pqMultiViewWidget::cleanupAfterCapture ( )

cleans up the environment after image capture.

◆ writeImage()

bool pqMultiViewWidget::writeImage ( const QString &  filename,
int  width,
int  height,
int  quality = -1 
)

Capture an image and saves it out to a file.

◆ viewProxies()

QList<vtkSMViewProxy*> pqMultiViewWidget::viewProxies ( ) const

Returns list of views assigned to frames in this widget.

◆ isViewAssigned()

bool pqMultiViewWidget::isViewAssigned ( pqView ) const

Returns true if the view has been assigned to this layout.

◆ togglePopout()

bool pqMultiViewWidget::togglePopout ( )

pqMultiViewWidget supports popout mode i.e.

the views could be laid out in separate popup widget rather than simply placing them under this pqMultiViewWidget frame. Use this method to toggle that. Returns true if the view is popped out at the end of this call, false otherwise.

◆ frameActivated

void pqMultiViewWidget::frameActivated ( )
signal

fired when a frame in this widget becomes active.

◆ reload

void pqMultiViewWidget::reload ( )
slot

This forces the pqMultiViewWidget to reload its layout from the vtkSMViewLayoutProxy instance.

One does not need to call this method explicitly, it is called automatically when the layoutManager is modified.

◆ assignToFrame

void pqMultiViewWidget::assignToFrame ( pqView )
slot

Assigns a frame to the view.

This assumes that the view not already been placed in a frame. This will try to locate an empty frame, if possible. If no empty frames are available, it will split the active frame along its longest dimension and place the view in the newly created child-frame.

◆ makeFrameActive

void pqMultiViewWidget::makeFrameActive ( )
slot

In a tabbed setup, when pqMultiViewWidget becomes active, this method should be called to ensure that the first view/frame in this widget is indeed made active, as the user would expect.

◆ setDecorationsVisible

void pqMultiViewWidget::setDecorationsVisible ( bool  )
slot

Set the visibility for frame decorations and splitter handles.

◆ showDecorations

void pqMultiViewWidget::showDecorations ( )
inlineslot

Definition at line 147 of file pqMultiViewWidget.h.

◆ hideDecorations

void pqMultiViewWidget::hideDecorations ( )
inlineslot

Definition at line 148 of file pqMultiViewWidget.h.

◆ lockViewSize

void pqMultiViewWidget::lockViewSize ( const QSize &  )
slot

Locks the maximum size for each view-frame to the given size.

Use empty QSize() instance to indicate no limits.

◆ reset

void pqMultiViewWidget::reset ( )
slot

cleans up the layout.

◆ destroyAllViews

void pqMultiViewWidget::destroyAllViews ( )
slot

destroys each of the views present in this layout.

Useful when user closes the frame expecting that all containing views are destroyed.

◆ standardButtonPressed

void pqMultiViewWidget::standardButtonPressed ( int  )
protectedslot

Slots called on different signals fired by the nested frames or splitters.

Note that these slots use this->sender(), hence these should not be called directly. These result in updating the layoutManager.

◆ splitterMoved

void pqMultiViewWidget::splitterMoved ( )
protectedslot

◆ makeActive

void pqMultiViewWidget::makeActive ( pqViewFrame frame)
protectedslot

Makes a frame active.

This also call pqActiveObjects::setActiveView() to make the corresponding view active.

◆ markActive [1/2]

void pqMultiViewWidget::markActive ( pqView view)
protectedslot

Marks the frame corresponding to the view, if present in the widget, as active.

Note that this method does not fire the activeChanged() signal.

◆ markActive [2/2]

void pqMultiViewWidget::markActive ( pqViewFrame frame)
protectedslot

◆ swapPositions

void pqMultiViewWidget::swapPositions ( const QString &  )
protectedslot

swap frame positions.

◆ proxyRemoved

void pqMultiViewWidget::proxyRemoved ( pqProxy )
protectedslot

when a view proxy is unregistered, we ensure that the frame is marked as empty.

◆ viewAdded

void pqMultiViewWidget::viewAdded ( pqView )
protectedslot

called when a new view is added.

we update the layout if the view added belongs to this layout.

◆ newFrame()

virtual pqViewFrame* pqMultiViewWidget::newFrame ( vtkSMProxy view)
protectedvirtual

Called whenever a new frame needs to be created for a view.

Note that view may be null, in which case a place-holder frame is expected. The caller takes over the ownership of the created frame and will delete/re-parent it as and when appropriate.

◆ eventFilter()

virtual bool pqMultiViewWidget::eventFilter ( QObject *  caller,
QEvent *  evt 
)
protectedvirtual

Event filter callback to detect when a sub-frame becomes active, so that we can mark it as such.


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