Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

vtkKWEPaintbrushRepresentation2D Class Reference

A widget representation that represents 2D paintbrushes. More...

#include <vtkKWEPaintbrushRepresentation2D.h>

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

List of all members.

Public Member Functions

virtual void WidgetInteraction (double eventPos[2])
virtual int RenderTranslucentGeometry (vtkViewport *viewport)
virtual int ActivateShapeOutline (int x, int y)
virtual void CreateShapeOutline (double *pos)
virtual void SetPaintbrushOperation (vtkKWEPaintbrushOperation *)
virtual void DeepCopy (vtkWidgetRepresentation *r)
virtual void AddShapeToCurrentStroke (double p[3])

 vtkTypeRevisionMacro (vtkKWEPaintbrushRepresentation2D, vtkKWEPaintbrushRepresentation)
void PrintSelf (ostream &os, vtkIndent indent)

virtual void BuildRepresentation ()
virtual int ComputeInteractionState (int X, int Y, int modified=0)
virtual void StartWidgetInteraction (double e[2])

virtual void ReleaseGraphicsResources (vtkWindow *w)
virtual int RenderOverlay (vtkViewport *viewport)
virtual int RenderOpaqueGeometry (vtkViewport *viewport)

void SetShapeOutlinePropertyInteract (vtkProperty *)
virtual vtkPropertyGetShapeOutlinePropertyInteract ()
void SetShapeOutlinePropertyDraw (vtkProperty *)
virtual vtkPropertyGetShapeOutlinePropertyDraw ()
void SetShapeOutlinePropertyErase (vtkProperty *)
virtual vtkPropertyGetShapeOutlinePropertyErase ()

virtual void GetActors (vtkPropCollection *)
virtual void GetActors2D (vtkPropCollection *)

virtual void SetStateToDraw ()
virtual void SetStateToErase ()
virtual void SetStateToInteract ()
virtual void SetStateToDisabled ()

virtual void SetImageActor (vtkImageActor *)
virtual vtkImageActorGetImageActor ()

virtual void SetImageData (vtkImageData *)
virtual vtkImageDataGetImageData ()

virtual int ResizeShape (double d[3], int resizeType)
virtual void SetPaintbrushDrawing (vtkKWEPaintbrushDrawing *)
virtual void SetShapeOutlineVisibility (int)
virtual int GetShapeOutlineVisibility ()

virtual int IncreaseOpacity ()
virtual int DecreaseOpacity ()

virtual void InstallPipeline ()
virtual void UnInstallPipeline ()

virtual void SetUseOverlay (int)
virtual int GetUseOverlay ()
virtual void UseOverlayOn ()
virtual void UseOverlayOff ()

virtual void SetSingleSliceThickBrush (int)
virtual int GetSingleSliceThickBrush ()
virtual void SingleSliceThickBrushOn ()
virtual void SingleSliceThickBrushOff ()

virtual int CopySketchToNextSlice (vtkKWEPaintbrushSketch *s)
virtual int CopySketchToPreviousSlice (vtkKWEPaintbrushSketch *s)

Static Public Member Functions

static
vtkKWEPaintbrushRepresentation2D
New ()

Protected Member Functions

 vtkKWEPaintbrushRepresentation2D ()
 ~vtkKWEPaintbrushRepresentation2D ()
virtual void CreateDefaultRepresentation ()
virtual void GetEtchExtents (int extent[6])

Protected Attributes

vtkPolyDataShapeOutline
vtkPolyDataMapperShapeOutlineMapper
vtkActorShapeOutlineActor
vtkPropertyShapeOutlinePropertyInteract
vtkPropertyShapeOutlinePropertyDraw
vtkPropertyShapeOutlinePropertyErase
vtkImageActorImageActor
vtkImageDataImageData
vtkKWEPaintbrushHighlightActorsHighlightActors
double LastEventPosition [2]
int SingleSliceThickBrush

Detailed Description

A widget representation that represents 2D paintbrushes.

This is a concrete implementation of the abstract vtkKWEPaintbrushRepresentation class for paintbrush effects on a 2D scene.

A typical use will be as follows:

 vtkKWEPaintbrushWidget * widget = vtkKWEPaintbrushWidget::New();
 widget->SetInteractor( RenderWindowInteractor );
 vtkKWEPaintbrushRepresentation2D * rep2D = vtkKWEPaintbrushRepresentation2D::
    SafeDownCast( widget->GetRepresentation() );
Behaviour:
The paintbrush should behave like GIMP paintbrushes do. When you select a paintbrush, you will have the template outline along with an alpha transparency of the template moving with the cursor. You can click-drag-release to draw/erase
Behaviour:
The vtkKWEPaintbrushWidget will set this representation into one of three states: Draw, Erase or Interact. During the Interact state the brush outline just hovers around with the template. During the Draw / Erase state, the representation uses the stroke manager to add a stroke / erase a stroke.
ShapePlacer:
The default template uses a shape placer to validate the "validity" of the shape at a given point. The default shape placer is a vtkKWEVoxelAlignedImageActorPointPlacer. This placer snaps the tempate to a position on the image grid. See the vtkPointPlacer architecture for details. You can use this to restrict the shape to a given set of bounding planes.

Definition at line 79 of file vtkKWEPaintbrushRepresentation2D.h.


Constructor & Destructor Documentation

vtkKWEPaintbrushRepresentation2D::vtkKWEPaintbrushRepresentation2D (  )  [protected]
vtkKWEPaintbrushRepresentation2D::~vtkKWEPaintbrushRepresentation2D (  )  [protected]

Member Function Documentation

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

Instantiate this class.

Reimplemented from vtkObject.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

vtkKWEPaintbrushRepresentation2D::vtkTypeRevisionMacro ( vtkKWEPaintbrushRepresentation2D  ,
vtkKWEPaintbrushRepresentation   
)

Standard VTK methods.

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

Standard VTK methods.

Reimplemented from vtkKWEPaintbrushRepresentation.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

virtual void vtkKWEPaintbrushRepresentation2D::BuildRepresentation (  )  [virtual]

These are methods that satisfy vtkWidgetRepresentation's API.

Implements vtkKWEPaintbrushRepresentation.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

virtual int vtkKWEPaintbrushRepresentation2D::ComputeInteractionState ( int  X,
int  Y,
int  modified = 0 
) [virtual]

These are methods that satisfy vtkWidgetRepresentation's API.

Implements vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::StartWidgetInteraction ( double  e[2]  )  [virtual]

These are methods that satisfy vtkWidgetRepresentation's API.

Implements vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::WidgetInteraction ( double  eventPos[2]  )  [virtual]

Must be present to satisfy the vtkWidgetRepresentation's API. This method will check the state of the representation. If the state is "Draw" (states are set by the vtkKWEPaintbrushWidget); the representation will enter this state during click-drags, the DrawFromLastEventPositionTo method is invoked.

Implements vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::ReleaseGraphicsResources ( vtkWindow w  )  [virtual]

Methods required by vtkProp superclass.

Reimplemented from vtkWidgetRepresentation.

virtual int vtkKWEPaintbrushRepresentation2D::RenderOverlay ( vtkViewport viewport  )  [virtual]

Methods required by vtkProp superclass.

Reimplemented from vtkProp.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

virtual int vtkKWEPaintbrushRepresentation2D::RenderOpaqueGeometry ( vtkViewport viewport  )  [virtual]

Methods required by vtkProp superclass.

Reimplemented from vtkProp.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

virtual int vtkKWEPaintbrushRepresentation2D::RenderTranslucentGeometry ( vtkViewport viewport  )  [virtual]
void vtkKWEPaintbrushRepresentation2D::SetShapeOutlinePropertyInteract ( vtkProperty  ) 

Set/Get the properties of the template outline. This should behave like the GIMP paintbrushes do. When you select a paintbrush, you will have the template outline along with an alpha transparency at the cursor location. You can move around, place it somewhere, or drag with the mouse button to create a stroke.

virtual vtkProperty* vtkKWEPaintbrushRepresentation2D::GetShapeOutlinePropertyInteract (  )  [virtual]

Set/Get the properties of the template outline. This should behave like the GIMP paintbrushes do. When you select a paintbrush, you will have the template outline along with an alpha transparency at the cursor location. You can move around, place it somewhere, or drag with the mouse button to create a stroke.

void vtkKWEPaintbrushRepresentation2D::SetShapeOutlinePropertyDraw ( vtkProperty  ) 

Set/Get the properties of the template outline. This should behave like the GIMP paintbrushes do. When you select a paintbrush, you will have the template outline along with an alpha transparency at the cursor location. You can move around, place it somewhere, or drag with the mouse button to create a stroke.

virtual vtkProperty* vtkKWEPaintbrushRepresentation2D::GetShapeOutlinePropertyDraw (  )  [virtual]

Set/Get the properties of the template outline. This should behave like the GIMP paintbrushes do. When you select a paintbrush, you will have the template outline along with an alpha transparency at the cursor location. You can move around, place it somewhere, or drag with the mouse button to create a stroke.

void vtkKWEPaintbrushRepresentation2D::SetShapeOutlinePropertyErase ( vtkProperty  ) 

Set/Get the properties of the template outline. This should behave like the GIMP paintbrushes do. When you select a paintbrush, you will have the template outline along with an alpha transparency at the cursor location. You can move around, place it somewhere, or drag with the mouse button to create a stroke.

virtual vtkProperty* vtkKWEPaintbrushRepresentation2D::GetShapeOutlinePropertyErase (  )  [virtual]

Set/Get the properties of the template outline. This should behave like the GIMP paintbrushes do. When you select a paintbrush, you will have the template outline along with an alpha transparency at the cursor location. You can move around, place it somewhere, or drag with the mouse button to create a stroke.

virtual int vtkKWEPaintbrushRepresentation2D::ActivateShapeOutline ( int  X,
int  Y 
) [virtual]

INTERNAL - Do not use Invoked by the widget in response to user interaction Activate the template outline and the supplied coordinate according to the constraints of the placer ?

Implements vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::CreateShapeOutline ( double *  pos  )  [virtual]

Create the template outline at location pos[3] (world coords)

Implements vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::GetActors ( vtkPropCollection  )  [virtual]

Get the actors maintained by the representation, that need to be rendered.

Reimplemented from vtkWidgetRepresentation.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

virtual void vtkKWEPaintbrushRepresentation2D::GetActors2D ( vtkPropCollection  )  [virtual]

Get the actors maintained by the representation, that need to be rendered.

Reimplemented from vtkWidgetRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::SetStateToDraw (  )  [virtual]

Set the Paintbrush representation state

Reimplemented from vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::SetStateToErase (  )  [virtual]

Set the Paintbrush representation state

Reimplemented from vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::SetStateToInteract (  )  [virtual]

Set the Paintbrush representation state

Reimplemented from vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::SetStateToDisabled (  )  [virtual]

Set the Paintbrush representation state

Reimplemented from vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::SetPaintbrushOperation ( vtkKWEPaintbrushOperation  )  [virtual]

Set the paintbrush operation. Here we override the superclass methodm so that we can set some defaults of the operation based on the imageactor's input.

Reimplemented from vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::SetImageActor ( vtkImageActor  )  [virtual]

Set the image actor on which the paintbrush is drawn. We will need to update the actor with the stencil's output etc..

virtual vtkImageActor* vtkKWEPaintbrushRepresentation2D::GetImageActor (  )  [virtual]

Set the image actor on which the paintbrush is drawn. We will need to update the actor with the stencil's output etc..

virtual void vtkKWEPaintbrushRepresentation2D::SetImageData ( vtkImageData  )  [virtual]

Set the underlying image data. While this is not always necessary, it is required by some variants of the paintbrush widget such as region growing widgets, etc that use features from the underlying image data. At best, just specify the underlying image data always.. (In most cases, its just the ImageActor->GetInput()) NOTE: The canvas (PaintbrushDrawing) gets allocated when you invoke this method. You would do well to set the representation on the drawing prior to calling this method, so as to avoid unnecessary re-allocation later on.

virtual vtkImageData* vtkKWEPaintbrushRepresentation2D::GetImageData (  )  [virtual]

Set the underlying image data. While this is not always necessary, it is required by some variants of the paintbrush widget such as region growing widgets, etc that use features from the underlying image data. At best, just specify the underlying image data always.. (In most cases, its just the ImageActor->GetInput()) NOTE: The canvas (PaintbrushDrawing) gets allocated when you invoke this method. You would do well to set the representation on the drawing prior to calling this method, so as to avoid unnecessary re-allocation later on.

virtual void vtkKWEPaintbrushRepresentation2D::DeepCopy ( vtkWidgetRepresentation r  )  [virtual]
virtual int vtkKWEPaintbrushRepresentation2D::ResizeShape ( double  d[3],
int  resizeType 
) [virtual]

See superclass documentation

Implements vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::SetPaintbrushDrawing ( vtkKWEPaintbrushDrawing  )  [virtual]

See superclass documentation

Reimplemented from vtkKWEPaintbrushRepresentation.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

virtual void vtkKWEPaintbrushRepresentation2D::SetShapeOutlineVisibility ( int   )  [virtual]

See superclass documentation

Implements vtkKWEPaintbrushRepresentation.

virtual int vtkKWEPaintbrushRepresentation2D::GetShapeOutlineVisibility (  )  [virtual]

See superclass documentation

Implements vtkKWEPaintbrushRepresentation.

virtual int vtkKWEPaintbrushRepresentation2D::IncreaseOpacity (  )  [virtual]

INTERNAL - Do not use. Invoked by the widget in response to user interaction Increase / Decrease the opacity of the drawing.

Reimplemented from vtkKWEPaintbrushRepresentation.

virtual int vtkKWEPaintbrushRepresentation2D::DecreaseOpacity (  )  [virtual]

INTERNAL - Do not use. Invoked by the widget in response to user interaction Increase / Decrease the opacity of the drawing.

Reimplemented from vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::InstallPipeline (  )  [virtual]

INTERNAL - Do not use Sticks the stencil into the pipeline. (between the ImageActor and its original input).

Reimplemented from vtkKWEPaintbrushRepresentation.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

virtual void vtkKWEPaintbrushRepresentation2D::UnInstallPipeline (  )  [virtual]

INTERNAL - Do not use Sticks the stencil into the pipeline. (between the ImageActor and its original input).

Reimplemented from vtkKWEPaintbrushRepresentation.

Reimplemented in vtkKWEPaintbrushRepresentationGrayscale2D.

virtual void vtkKWEPaintbrushRepresentation2D::SetUseOverlay ( int   )  [virtual]

See docuementation of vtkKWEPaintbrushBlend::SetUseOverlay

virtual int vtkKWEPaintbrushRepresentation2D::GetUseOverlay (  )  [virtual]

See docuementation of vtkKWEPaintbrushBlend::SetUseOverlay

virtual void vtkKWEPaintbrushRepresentation2D::UseOverlayOn (  )  [virtual]

See docuementation of vtkKWEPaintbrushBlend::SetUseOverlay

virtual void vtkKWEPaintbrushRepresentation2D::UseOverlayOff (  )  [virtual]

See docuementation of vtkKWEPaintbrushBlend::SetUseOverlay

virtual void vtkKWEPaintbrushRepresentation2D::SetSingleSliceThickBrush ( int   )  [virtual]

Do a slice by slice painting, or paint in 3D using a 3D shape. If we do a Single slice painting, the dimension of the shape orthogonal to the currently displayed slice will be flattened implicitly. Default is 3D painting.

virtual int vtkKWEPaintbrushRepresentation2D::GetSingleSliceThickBrush (  )  [virtual]

Do a slice by slice painting, or paint in 3D using a 3D shape. If we do a Single slice painting, the dimension of the shape orthogonal to the currently displayed slice will be flattened implicitly. Default is 3D painting.

virtual void vtkKWEPaintbrushRepresentation2D::SingleSliceThickBrushOn (  )  [virtual]

Do a slice by slice painting, or paint in 3D using a 3D shape. If we do a Single slice painting, the dimension of the shape orthogonal to the currently displayed slice will be flattened implicitly. Default is 3D painting.

virtual void vtkKWEPaintbrushRepresentation2D::SingleSliceThickBrushOff (  )  [virtual]

Do a slice by slice painting, or paint in 3D using a 3D shape. If we do a Single slice painting, the dimension of the shape orthogonal to the currently displayed slice will be flattened implicitly. Default is 3D painting.

virtual int vtkKWEPaintbrushRepresentation2D::CopySketchToNextSlice ( vtkKWEPaintbrushSketch s  )  [virtual]

Copy a sketch from the currently displayed slice to the next/previous slice. Returns 1 on success / 0 on failure.

virtual int vtkKWEPaintbrushRepresentation2D::CopySketchToPreviousSlice ( vtkKWEPaintbrushSketch s  )  [virtual]

Copy a sketch from the currently displayed slice to the next/previous slice. Returns 1 on success / 0 on failure.

virtual void vtkKWEPaintbrushRepresentation2D::AddShapeToCurrentStroke ( double  p[3]  )  [virtual]

INTERNAL - Do not use This method is called from vtkKWEPaintbrushWidget whenever we draw using a shape centered at the location "p". Here we override the superclass method.

Reimplemented from vtkKWEPaintbrushRepresentation.

virtual void vtkKWEPaintbrushRepresentation2D::CreateDefaultRepresentation (  )  [protected, virtual]

Create default representation. The default representation instantiates a new sequencer, if one hasn't been set. It also sets default properties for the ShapeOutline etc.

virtual void vtkKWEPaintbrushRepresentation2D::GetEtchExtents ( int  extent[6]  )  [protected, virtual]

Get the extents of the current etch.

Reimplemented from vtkKWEPaintbrushRepresentation.


Member Data Documentation

Definition at line 245 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 246 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 247 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 248 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 249 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 250 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 251 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 252 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 253 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 254 of file vtkKWEPaintbrushRepresentation2D.h.

Definition at line 255 of file vtkKWEPaintbrushRepresentation2D.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines