ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
vtkSMViewLayoutProxy Class Reference

vtkSMViewLayoutProxy is used by ParaView to layout multiple views in a 2D KD-Tree layout. More...

#include <vtkSMViewLayoutProxy.h>

Inheritance diagram for vtkSMViewLayoutProxy:
Inheritance graph
[legend]
Collaboration diagram for vtkSMViewLayoutProxy:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Direction { NONE, VERTICAL, HORIZONTAL }

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
bool AssignView (int location, vtkSMViewProxy *view)
int AssignViewToAnyCell (vtkSMViewProxy *view, int location_hint)
bool Collapse (int location)
bool SwapCells (int location1, int location2)
bool SetSplitFraction (int location, double fraction)
bool MaximizeCell (int location)
void RestoreMaximizedState ()
bool IsSplitCell (int location)
Direction GetSplitDirection (int location)
double GetSplitFraction (int location)
vtkSMViewProxyGetView (int location)
int GetViewLocation (vtkSMViewProxy *)
void UpdateViewPositions ()
void ShowViewsOnTileDisplay ()
vtkImageDataCaptureWindow (int magnification)
virtual int LoadXMLState (vtkPVXMLElement *element, vtkSMProxyLocator *locator)
void Reset ()
int Split (int location, int direction, double fraction)
int SplitVertical (int location, double fraction)
int SplitHorizontal (int location, double fraction)
int RemoveView (vtkSMViewProxy *view)
bool RemoveView (int index)
virtual int GetMaximizedCell ()
virtual vtkPVXMLElementSaveXMLState (vtkPVXMLElement *root)
virtual vtkPVXMLElementSaveXMLState (vtkPVXMLElement *root, vtkSMPropertyIterator *iter)

Static Public Member Functions

static vtkSMViewLayoutProxyNew ()
static int IsTypeOf (const char *type)
static vtkSMViewLayoutProxySafeDownCast (vtkObject *o)
static int GetFirstChild (int location)
static int GetSecondChild (int location)
static int GetParent (int location)

Protected Member Functions

 vtkSMViewLayoutProxy ()
 ~vtkSMViewLayoutProxy ()
virtual void UpdateState ()
int GetEmptyCell (int root)
int GetSplittableCell (int root, Direction &suggested_direction)
virtual void LoadState (const vtkSMMessage *message, vtkSMProxyLocator *locator)

Protected Attributes

int MaximizedCell

Detailed Description

vtkSMViewLayoutProxy is used by ParaView to layout multiple views in a 2D KD-Tree layout.

vtkSMViewLayoutProxy is used by ParaView to layout multiple views in a 2D KD-Tree layout. This is proxy, hence can be registered with the proxy manager just like other regular proxies; participates in xml state saving/restoring, undo-redo, etc. Users can affects the GUI layout using this proxy instance from Python as well.

Every time the vtkSMViewLayoutProxy changes so that it would affect the UI, this class fires vtkCommand::ConfigureEvent.

View proxies that are to laid out in an layout should be "assigned" to a particular cell in a vtkSMViewLayoutProxy instance. vtkSMViewLayoutProxy takes over the responsibility of updating the view's Position property correctly.

Although, currently, there are no safe guards against assigning a view to more than one layout, this is strictly prohibited and can cause unexpected problems at run-time.

Definition at line 47 of file vtkSMViewLayoutProxy.h.


Member Enumeration Documentation

Enumerator:
NONE 
VERTICAL 
HORIZONTAL 

Definition at line 54 of file vtkSMViewLayoutProxy.h.


Constructor & Destructor Documentation

vtkSMViewLayoutProxy::vtkSMViewLayoutProxy ( ) [protected]
vtkSMViewLayoutProxy::~vtkSMViewLayoutProxy ( ) [protected]

Member Function Documentation

static vtkSMViewLayoutProxy* vtkSMViewLayoutProxy::New ( ) [static]

Reimplemented from vtkSMProxy.

virtual const char* vtkSMViewLayoutProxy::GetClassName ( ) [virtual]

Reimplemented from vtkSMProxy.

static int vtkSMViewLayoutProxy::IsTypeOf ( const char *  type) [static]

Reimplemented from vtkSMProxy.

virtual int vtkSMViewLayoutProxy::IsA ( const char *  type) [virtual]

Reimplemented from vtkSMProxy.

static vtkSMViewLayoutProxy* vtkSMViewLayoutProxy::SafeDownCast ( vtkObject o) [static]

Reimplemented from vtkSMProxy.

void vtkSMViewLayoutProxy::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Reimplemented from vtkSMProxy.

int vtkSMViewLayoutProxy::Split ( int  location,
int  direction,
double  fraction 
)

Split a frame at the given location. Location must point to an existing cell that's not split. If the location does not exist or is already split, then returns -1, to indicate failure. Otherwise returns the index of the left (or top) child node. The index for the sibling can be computed as (ret_val + 1). fraction indicates a value in the range [0.0, 1.0] at which the cell is split. If a View is set at the given location, it will be moved to the left (or top) child after the split.

int vtkSMViewLayoutProxy::SplitVertical ( int  location,
double  fraction 
) [inline]

Split a frame at the given location. Location must point to an existing cell that's not split. If the location does not exist or is already split, then returns -1, to indicate failure. Otherwise returns the index of the left (or top) child node. The index for the sibling can be computed as (ret_val + 1). fraction indicates a value in the range [0.0, 1.0] at which the cell is split. If a View is set at the given location, it will be moved to the left (or top) child after the split.

Definition at line 71 of file vtkSMViewLayoutProxy.h.

int vtkSMViewLayoutProxy::SplitHorizontal ( int  location,
double  fraction 
) [inline]

Split a frame at the given location. Location must point to an existing cell that's not split. If the location does not exist or is already split, then returns -1, to indicate failure. Otherwise returns the index of the left (or top) child node. The index for the sibling can be computed as (ret_val + 1). fraction indicates a value in the range [0.0, 1.0] at which the cell is split. If a View is set at the given location, it will be moved to the left (or top) child after the split.

Definition at line 73 of file vtkSMViewLayoutProxy.h.

bool vtkSMViewLayoutProxy::AssignView ( int  location,
vtkSMViewProxy view 
)

Assign a view at a particular location. Note that the view's position may be changed by Split() calls. Returns true on success.

int vtkSMViewLayoutProxy::AssignViewToAnyCell ( vtkSMViewProxy view,
int  location_hint 
)

Similar to AssignView() except that is location specified is not available, then this method treats the location merely as a hint and tries to find a suitable place. First, if any empty cell is available, then that is used. Second, if no empty cell is available and location is a valid cell, then we either split the cell or traverse down the sub-tree from the cell and split a cell to make room for the view. Thus, this method will always assign the view to a frame. Returns the assigned location.

int vtkSMViewLayoutProxy::RemoveView ( vtkSMViewProxy view)

Removes a view. Returns the location of the cell emptied by the view, if any, otherwise -1.

bool vtkSMViewLayoutProxy::RemoveView ( int  index)

Removes a view. Returns the location of the cell emptied by the view, if any, otherwise -1.

bool vtkSMViewLayoutProxy::Collapse ( int  location)

Collapses a cell. Only leaf cells without any assigned views can be collapsed. If the cell has a sibling, then that sibling is assigned to the parent node and the sibling cell is destroyed as well. Returns true on success, else false.

bool vtkSMViewLayoutProxy::SwapCells ( int  location1,
int  location2 
)

Swaps the cells at the two locations. Both locations must be leaf locations i.e. cannot be split-cells.

bool vtkSMViewLayoutProxy::SetSplitFraction ( int  location,
double  fraction 
)

Update the split fraction for a split cell. If IsSplitCell(location) returns false, this method does not update the fraction.

bool vtkSMViewLayoutProxy::MaximizeCell ( int  location)

One can maximize a particular (non-split) cell. Note the maximized state is restored as soon as the layout is changed or when RestoreMaximizedState() is called. Returns false if the cell at the location cannot be maximized since it's a split cell or invalid cell, true otherwise.

void vtkSMViewLayoutProxy::RestoreMaximizedState ( )

Restores the maximized state.

virtual int vtkSMViewLayoutProxy::GetMaximizedCell ( ) [virtual]

Returns the maximized cell, if any. Returns -1 if no cell is currently maximized.

bool vtkSMViewLayoutProxy::IsSplitCell ( int  location)

Returns true if the cell identified by the location is a split cell.

Direction vtkSMViewLayoutProxy::GetSplitDirection ( int  location)

Returns the split direction for a split cell at the given location.

double vtkSMViewLayoutProxy::GetSplitFraction ( int  location)

Returns the split-fraction for a split cell at the given location.

static int vtkSMViewLayoutProxy::GetFirstChild ( int  location) [inline, static]

Returns the index for the first child of the given location. This does not do any validity checks for the location, nor that of the child.

Definition at line 141 of file vtkSMViewLayoutProxy.h.

static int vtkSMViewLayoutProxy::GetSecondChild ( int  location) [inline, static]

Returns the index for the second child of the given location. This does not do any validity checks for the location, nor that of the child.

Definition at line 149 of file vtkSMViewLayoutProxy.h.

static int vtkSMViewLayoutProxy::GetParent ( int  location) [inline, static]

Returns the parent index.

Definition at line 155 of file vtkSMViewLayoutProxy.h.

vtkSMViewProxy* vtkSMViewLayoutProxy::GetView ( int  location)

Returns the view, if any, assigned to the given cell location.

int vtkSMViewLayoutProxy::GetViewLocation ( vtkSMViewProxy )

Returns the location for the view, of any. Returns -1 if the view is not found.

void vtkSMViewLayoutProxy::UpdateViewPositions ( )

Updates positions for all views using the layout and current sizes. This method is called automatically when the layout changes or the "ViewSize" property on the assigned views changes.

void vtkSMViewLayoutProxy::ShowViewsOnTileDisplay ( )

When in tile-display configuration, only 1 view-layout is shown on the tile-display (for obvious reasons). To show any particular layout on the tile display, simply call this method.

vtkImageData* vtkSMViewLayoutProxy::CaptureWindow ( int  magnification)

Captures an image from the layout (including all the views in the layout.

virtual vtkPVXMLElement* vtkSMViewLayoutProxy::SaveXMLState ( vtkPVXMLElement root) [inline, virtual]

Overridden to save custom XML state.

Reimplemented from vtkSMProxy.

Definition at line 182 of file vtkSMViewLayoutProxy.h.

virtual vtkPVXMLElement* vtkSMViewLayoutProxy::SaveXMLState ( vtkPVXMLElement root,
vtkSMPropertyIterator iter 
) [virtual]

Overridden to save custom XML state.

Reimplemented from vtkSMProxy.

virtual int vtkSMViewLayoutProxy::LoadXMLState ( vtkPVXMLElement element,
vtkSMProxyLocator locator 
) [virtual]

Overridden to load custom XML state.

Reimplemented from vtkSMProxy.

void vtkSMViewLayoutProxy::Reset ( )

Resets the layout.

virtual void vtkSMViewLayoutProxy::LoadState ( const vtkSMMessage message,
vtkSMProxyLocator locator 
) [protected, virtual]

Called to load state from protobuf message.

Reimplemented from vtkSMProxy.

virtual void vtkSMViewLayoutProxy::UpdateState ( ) [protected, virtual]

Although this class is a proxy, it's not really a proxy in the traditional sense. So instead of using UpdateVTKObjects() to push state changes to the server (or undo-redo stack), this new method is provided.

int vtkSMViewLayoutProxy::GetEmptyCell ( int  root) [protected]

Starting with the cell-index, tries to find an empty cell in the sub-tree. Returns -1 if none found. May return root, if root is indeed an empty cell. Note this assumes that root is valid.

int vtkSMViewLayoutProxy::GetSplittableCell ( int  root,
Direction suggested_direction 
) [protected]

Starting with the root, finds a splittable cell. Assumes root is valid.


Member Data Documentation

Definition at line 220 of file vtkSMViewLayoutProxy.h.


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