VTK
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkContextArea Class Reference

Clipped, transformed area with axes for context items. More...

#include <vtkContextArea.h>

Inheritance diagram for vtkContextArea:
[legend]
Collaboration diagram for vtkContextArea:
[legend]

Public Types

enum  DrawAreaResizeBehaviorType { DARB_Expand, DARB_FixedAspect, DARB_FixedRect, DARB_FixedMargins }
 
typedef vtkTuple< int, 4 > Margins
 
typedef vtkAbstractContextItem Superclass
 
- Public Types inherited from vtkAbstractContextItem
typedef vtkObject Superclass
 
- Public Types inherited from vtkObject
typedef vtkObjectBase Superclass
 

Public Member Functions

virtual int IsA (const char *type)
 
vtkContextAreaNewInstance () const
 
virtual void PrintSelf (ostream &os, vtkIndent indent)
 
vtkAxisGetAxis (vtkAxis::Location location)
 
vtkAbstractContextItemGetDrawAreaItem ()
 
virtual bool Paint (vtkContext2D *painter)
 
virtual vtkRecti GetGeometry ()
 
virtual void SetGeometry (vtkRecti)
 
virtual vtkRectd GetDrawAreaBounds ()
 
virtual void SetDrawAreaBounds (vtkRectd)
 
virtual DrawAreaResizeBehaviorType GetDrawAreaResizeBehavior ()
 
virtual void SetDrawAreaResizeBehavior (DrawAreaResizeBehaviorType)
 
virtual float GetFixedAspect ()
 
virtual void SetFixedAspect (float aspect)
 
virtual vtkRecti GetFixedRect ()
 
virtual void SetFixedRect (vtkRecti rect)
 
virtual void SetFixedRect (int x, int y, int width, int height)
 
virtual const MarginsGetFixedMargins ()
 
virtual void GetFixedMarginsArray (int margins[4])
 
virtual const intGetFixedMarginsArray ()
 
virtual void SetFixedMargins (Margins margins)
 
virtual void SetFixedMargins (int margins[4])
 
virtual void SetFixedMargins (int left, int right, int bottom, int top)
 
virtual bool GetFillViewport ()
 
virtual void SetFillViewport (bool)
 
virtual void FillViewportOn ()
 
virtual void FillViewportOff ()
 
virtual void SetShowGrid (bool show)
 
virtual bool GetShowGrid ()
 
virtual void ShowGridOn ()
 
virtual void ShowGridOff ()
 
- Public Member Functions inherited from vtkAbstractContextItem
vtkAbstractContextItemNewInstance () const
 
virtual void Update ()
 
virtual bool PaintChildren (vtkContext2D *painter)
 
virtual void ReleaseGraphicsResources ()
 
unsigned int AddItem (vtkAbstractContextItem *item)
 
bool RemoveItem (vtkAbstractContextItem *item)
 
bool RemoveItem (unsigned int index)
 
vtkAbstractContextItemGetItem (unsigned int index)
 
unsigned int GetItemIndex (vtkAbstractContextItem *item)
 
unsigned int GetNumberOfItems ()
 
void ClearItems ()
 
unsigned int Raise (unsigned int index)
 
unsigned int Lower (unsigned int index)
 
virtual bool Hit (const vtkContextMouseEvent &mouse)
 
virtual vtkAbstractContextItemGetPickedItem (const vtkContextMouseEvent &mouse)
 
virtual bool MouseEnterEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseMoveEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseLeaveEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseButtonPressEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseButtonReleaseEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseDoubleClickEvent (const vtkContextMouseEvent &mouse)
 
virtual bool MouseWheelEvent (const vtkContextMouseEvent &mouse, int delta)
 
virtual bool KeyPressEvent (const vtkContextKeyEvent &key)
 
virtual void SetScene (vtkContextScene *scene)
 
virtual void SetParent (vtkAbstractContextItem *parent)
 
virtual vtkVector2f MapToParent (const vtkVector2f &point)
 
virtual vtkVector2f MapFromParent (const vtkVector2f &point)
 
virtual vtkVector2f MapToScene (const vtkVector2f &point)
 
virtual vtkVector2f MapFromScene (const vtkVector2f &point)
 
virtual unsigned int StackAbove (unsigned int index, unsigned int under)
 
virtual unsigned int StackUnder (unsigned int child, unsigned int above)
 
virtual bool KeyReleaseEvent (const vtkContextKeyEvent &key)
 
vtkContextSceneGetScene ()
 
vtkAbstractContextItemGetParent ()
 
virtual bool GetVisible ()
 
virtual void SetVisible (bool)
 
virtual bool GetInteractive ()
 
virtual void SetInteractive (bool)
 
- Public Member Functions inherited from vtkObject
vtkObjectNewInstance () const
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkContextAreaSafeDownCast (vtkObjectBase *o)
 
static vtkContextAreaNew ()
 
- Static Public Member Functions inherited from vtkAbstractContextItem
static int IsTypeOf (const char *type)
 
static vtkAbstractContextItemSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static int IsTypeOf (const char *type)
 
static vtkObjectSafeDownCast (vtkObjectBase *o)
 
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static int IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkContextArea ()
 
 ~vtkContextArea ()
 
void LayoutAxes (vtkContext2D *painter)
 
vtkRecti ComputeDrawAreaGeometry (vtkContext2D *painter)
 
void UpdateDrawArea ()
 
vtkRecti ComputeExpandedDrawAreaGeometry (vtkContext2D *painter)
 
vtkRecti ComputeFixedAspectDrawAreaGeometry (vtkContext2D *painter)
 
vtkRecti ComputeFixedRectDrawAreaGeometry (vtkContext2D *painter)
 
vtkRecti ComputeFixedMarginsDrawAreaGeometry (vtkContext2D *painter)
 
- Protected Member Functions inherited from vtkAbstractContextItem
 vtkAbstractContextItem ()
 
 ~vtkAbstractContextItem ()
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
virtual void RegisterInternal (vtkObjectBase *, int check)
 
virtual void UnRegisterInternal (vtkObjectBase *, int check)
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkTuple< vtkAxis *, 4 > Axes
 
vtkNew< vtkPlotGridGrid
 
vtkNew< vtkContextClipClip
 
vtkNew< vtkContextTransformTransform
 
vtkRecti Geometry
 
vtkRectd DrawAreaBounds
 
vtkRecti DrawAreaGeometry
 
DrawAreaResizeBehaviorType DrawAreaResizeBehavior
 
float FixedAspect
 
vtkRecti FixedRect
 
Margins FixedMargins
 
bool FillViewport
 
- Protected Attributes inherited from vtkAbstractContextItem
vtkContextSceneScene
 
vtkAbstractContextItemParent
 
vtkContextScenePrivateChildren
 
bool Visible
 
bool Interactive
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Clipped, transformed area with axes for context items.

vtkContextArea provides an clipped drawing area surrounded by four axes. The drawing area is transformed to map the 2D area described by DrawAreaBounds into pixel coordinates. DrawAreaBounds is also used to configure the axes. Item to be rendered in the draw area should be added to the context item returned by GetDrawAreaItem().

The size and shape of the draw area is configured by the following member variables:

Definition at line 56 of file vtkContextArea.h.

Member Typedef Documentation

Definition at line 59 of file vtkContextArea.h.

Definition at line 60 of file vtkContextArea.h.

Member Enumeration Documentation

Enumerator
DARB_Expand 
DARB_FixedAspect 
DARB_FixedRect 
DARB_FixedMargins 

Definition at line 91 of file vtkContextArea.h.

Constructor & Destructor Documentation

vtkContextArea::vtkContextArea ( )
protected
vtkContextArea::~vtkContextArea ( )
protected

Member Function Documentation

static int vtkContextArea::IsTypeOf ( const char *  type)
static
virtual int vtkContextArea::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkAbstractContextItem.

static vtkContextArea* vtkContextArea::SafeDownCast ( vtkObjectBase o)
static
virtual vtkObjectBase* vtkContextArea::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkAbstractContextItem.

vtkContextArea* vtkContextArea::NewInstance ( ) const
virtual void vtkContextArea::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
virtual

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkAbstractContextItem.

static vtkContextArea* vtkContextArea::New ( )
static
vtkAxis* vtkContextArea::GetAxis ( vtkAxis::Location  location)

Get the vtkAxis associated with the specified location.

vtkAbstractContextItem* vtkContextArea::GetDrawAreaItem ( )

Returns the vtkAbstractContextItem that will draw in the clipped, transformed space. This is the item to add children for.

virtual bool vtkContextArea::Paint ( vtkContext2D painter)
virtual

Paint event for the item, called whenever the item needs to be drawn.

Reimplemented from vtkAbstractContextItem.

virtual vtkRecti vtkContextArea::GetGeometry ( )
virtual

The rect defining the pixel location and size of the entire vtkContextArea, including axis labels, title, etc. Note that this will be updated to the window geometry if FillWindow is true.

virtual void vtkContextArea::SetGeometry ( vtkRecti  )
virtual

The rect defining the pixel location and size of the entire vtkContextArea, including axis labels, title, etc. Note that this will be updated to the window geometry if FillWindow is true.

virtual vtkRectd vtkContextArea::GetDrawAreaBounds ( )
virtual

The data bounds of the clipped and transformed area inside of the axes. This is used to configure the axes labels and setup the transform.

virtual void vtkContextArea::SetDrawAreaBounds ( vtkRectd  )
virtual

The data bounds of the clipped and transformed area inside of the axes. This is used to configure the axes labels and setup the transform.

virtual DrawAreaResizeBehaviorType vtkContextArea::GetDrawAreaResizeBehavior ( )
virtual

Set the resize behavior for the draw area: - Expand: The default behavior. The draw area will automatically resize to take up as much of Geometry as possible. Margin sizes are minimized based on the space required for axis labels/tick marks. - FixedAspect: Same as Expand, but a fixed aspected ratio is enforced. See SetFixedAspect. - FixedRect: Draw area is always constrained to a fixed rectangle. See SetFixedRect. - FixMargins: The draw area expands to fill Geometry, but margins (axis labels, etc) are fixed, rather than dynamically sized. See SetFixedMargins.

virtual void vtkContextArea::SetDrawAreaResizeBehavior ( DrawAreaResizeBehaviorType  )
virtual

Set the resize behavior for the draw area: - Expand: The default behavior. The draw area will automatically resize to take up as much of Geometry as possible. Margin sizes are minimized based on the space required for axis labels/tick marks. - FixedAspect: Same as Expand, but a fixed aspected ratio is enforced. See SetFixedAspect. - FixedRect: Draw area is always constrained to a fixed rectangle. See SetFixedRect. - FixMargins: The draw area expands to fill Geometry, but margins (axis labels, etc) are fixed, rather than dynamically sized. See SetFixedMargins.

virtual float vtkContextArea::GetFixedAspect ( )
virtual

The fixed aspect ratio, if DrawAreaResizeBehavior is FixedAspect. Defined as width/height. Default is 1. Setting the aspect ratio will also set DrawAreaResizeBehavior to FixedAspect.

virtual void vtkContextArea::SetFixedAspect ( float  aspect)
virtual

The fixed aspect ratio, if DrawAreaResizeBehavior is FixedAspect. Defined as width/height. Default is 1. Setting the aspect ratio will also set DrawAreaResizeBehavior to FixedAspect.

virtual vtkRecti vtkContextArea::GetFixedRect ( )
virtual

The fixed rect to use for the draw area, if DrawAreaResizeBehavior is FixedRect. Units are in pixels, default is 300x300+0+0. Setting the fixed rect will also set DrawAreaResizeBehavior to FixedRect.

virtual void vtkContextArea::SetFixedRect ( vtkRecti  rect)
virtual

The fixed rect to use for the draw area, if DrawAreaResizeBehavior is FixedRect. Units are in pixels, default is 300x300+0+0. Setting the fixed rect will also set DrawAreaResizeBehavior to FixedRect.

virtual void vtkContextArea::SetFixedRect ( int  x,
int  y,
int  width,
int  height 
)
virtual

The fixed rect to use for the draw area, if DrawAreaResizeBehavior is FixedRect. Units are in pixels, default is 300x300+0+0. Setting the fixed rect will also set DrawAreaResizeBehavior to FixedRect.

virtual const Margins& vtkContextArea::GetFixedMargins ( )
inlinevirtual

The left, right, bottom, and top margins for the draw area, if DrawAreaResizeBehavior is FixedMargins. Units are in pixels, default is { 0, 0, 0, 0 }. Setting the fixed margins will also set DrawAreaResizeBehavior to FixedMargins.

Definition at line 134 of file vtkContextArea.h.

virtual void vtkContextArea::GetFixedMarginsArray ( int  margins[4])
virtual

The left, right, bottom, and top margins for the draw area, if DrawAreaResizeBehavior is FixedMargins. Units are in pixels, default is { 0, 0, 0, 0 }. Setting the fixed margins will also set DrawAreaResizeBehavior to FixedMargins.

virtual const int* vtkContextArea::GetFixedMarginsArray ( )
virtual

The left, right, bottom, and top margins for the draw area, if DrawAreaResizeBehavior is FixedMargins. Units are in pixels, default is { 0, 0, 0, 0 }. Setting the fixed margins will also set DrawAreaResizeBehavior to FixedMargins.

virtual void vtkContextArea::SetFixedMargins ( Margins  margins)
virtual

The left, right, bottom, and top margins for the draw area, if DrawAreaResizeBehavior is FixedMargins. Units are in pixels, default is { 0, 0, 0, 0 }. Setting the fixed margins will also set DrawAreaResizeBehavior to FixedMargins.

virtual void vtkContextArea::SetFixedMargins ( int  margins[4])
virtual

The left, right, bottom, and top margins for the draw area, if DrawAreaResizeBehavior is FixedMargins. Units are in pixels, default is { 0, 0, 0, 0 }. Setting the fixed margins will also set DrawAreaResizeBehavior to FixedMargins.

virtual void vtkContextArea::SetFixedMargins ( int  left,
int  right,
int  bottom,
int  top 
)
virtual

The left, right, bottom, and top margins for the draw area, if DrawAreaResizeBehavior is FixedMargins. Units are in pixels, default is { 0, 0, 0, 0 }. Setting the fixed margins will also set DrawAreaResizeBehavior to FixedMargins.

virtual bool vtkContextArea::GetFillViewport ( )
virtual

If true, Geometry is set to (0, 0, vpSize[0], vpSize[1]) at the start of each Paint call. vpSize is vtkContextDevice2D::GetViewportSize. Default is true.

virtual void vtkContextArea::SetFillViewport ( bool  )
virtual

If true, Geometry is set to (0, 0, vpSize[0], vpSize[1]) at the start of each Paint call. vpSize is vtkContextDevice2D::GetViewportSize. Default is true.

virtual void vtkContextArea::FillViewportOn ( )
virtual

If true, Geometry is set to (0, 0, vpSize[0], vpSize[1]) at the start of each Paint call. vpSize is vtkContextDevice2D::GetViewportSize. Default is true.

virtual void vtkContextArea::FillViewportOff ( )
virtual

If true, Geometry is set to (0, 0, vpSize[0], vpSize[1]) at the start of each Paint call. vpSize is vtkContextDevice2D::GetViewportSize. Default is true.

virtual void vtkContextArea::SetShowGrid ( bool  show)
virtual

Turn on/off grid visibility.

virtual bool vtkContextArea::GetShowGrid ( )
virtual

Turn on/off grid visibility.

virtual void vtkContextArea::ShowGridOn ( )
inlinevirtual

Turn on/off grid visibility.

Definition at line 155 of file vtkContextArea.h.

virtual void vtkContextArea::ShowGridOff ( )
inlinevirtual

Turn on/off grid visibility.

Definition at line 156 of file vtkContextArea.h.

void vtkContextArea::LayoutAxes ( vtkContext2D painter)
protected

Sync the Axes locations with Geometry, and update the DrawAreaGeometry to account for Axes size (margins). Must be called while the painter is active.

vtkRecti vtkContextArea::ComputeDrawAreaGeometry ( vtkContext2D painter)
protected

Return the draw area's geometry.

vtkRecti vtkContextArea::ComputeExpandedDrawAreaGeometry ( vtkContext2D painter)
protected

Working implementations for ComputeDrawAreaGeometry.

vtkRecti vtkContextArea::ComputeFixedAspectDrawAreaGeometry ( vtkContext2D painter)
protected

Working implementations for ComputeDrawAreaGeometry.

vtkRecti vtkContextArea::ComputeFixedRectDrawAreaGeometry ( vtkContext2D painter)
protected

Working implementations for ComputeDrawAreaGeometry.

vtkRecti vtkContextArea::ComputeFixedMarginsDrawAreaGeometry ( vtkContext2D painter)
protected

Working implementations for ComputeDrawAreaGeometry.

void vtkContextArea::UpdateDrawArea ( )
protected

Set the transform to map DrawAreaBounds to DrawAreaGeometry. Should be called after LayoutAxes to ensure that DrawAreaGeometry is up to date.

Member Data Documentation

vtkTuple<vtkAxis*, 4> vtkContextArea::Axes
protected

vtkAxis objects that surround the draw area, indexed by vtkAxis::Location.

Definition at line 186 of file vtkContextArea.h.

vtkNew<vtkPlotGrid> vtkContextArea::Grid
protected

The vtkPlotGrid that renders a grid atop the data in the draw area.

Definition at line 189 of file vtkContextArea.h.

vtkNew<vtkContextClip> vtkContextArea::Clip
protected

The context item that clips rendered data.

Definition at line 192 of file vtkContextArea.h.

vtkNew<vtkContextTransform> vtkContextArea::Transform
protected

The context item that clips rendered data.

Definition at line 195 of file vtkContextArea.h.

vtkRecti vtkContextArea::Geometry
protected

The rect defining the pixel location and size of the entire vtkContextArea, including axis label, title, etc.

Definition at line 199 of file vtkContextArea.h.

vtkRectd vtkContextArea::DrawAreaBounds
protected

The data bounds of the clipped and transformed area inside of the axes. This is used to configure the axes labels and setup the transform.

Definition at line 204 of file vtkContextArea.h.

vtkRecti vtkContextArea::DrawAreaGeometry
protected

The rect defining the pixel location and size of the clipped and transformed area inside the axes. Relative to Geometry.

Definition at line 208 of file vtkContextArea.h.

DrawAreaResizeBehaviorType vtkContextArea::DrawAreaResizeBehavior
protected

Controls how the draw area size is determined.

Definition at line 211 of file vtkContextArea.h.

float vtkContextArea::FixedAspect
protected

The fixed aspect ratio, if DrawAreaResizeBehavior is FixedAspect. Defined as width/height. Default is 1.

Definition at line 215 of file vtkContextArea.h.

vtkRecti vtkContextArea::FixedRect
protected

The fixed rect to use for the draw area, if DrawAreaResizeBehavior is FixedRect. Units are in pixels, default is 300x300+0+0.

Definition at line 219 of file vtkContextArea.h.

Margins vtkContextArea::FixedMargins
protected

The left, right, bottom, and top margins for the draw area, if DrawAreaResizeBehavior is FixedMargins. Units are in pixels, default is { 0, 0, 0, 0 }

Definition at line 224 of file vtkContextArea.h.

bool vtkContextArea::FillViewport
protected

If true, Geometry is set to (0, 0, vpSize[0], vpSize[1]) at the start of each Paint call. vpSize is vtkContextDevice2D::GetViewportSize. Default is true.

Definition at line 229 of file vtkContextArea.h.


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