Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# vtkScalarBarWidget Class Reference

`#include <vtkScalarBarWidget.h>`

Inheritance diagram for vtkScalarBarWidget:

[legend]
Collaboration diagram for vtkScalarBarWidget:

[legend]
List of all members.

## Detailed Description

2D widget for manipulating a scalar bar

Date:
  2003/01/07 16:16:56

Revision:
  1.4

This class provides support for interactively manipulating the position, size, and orientation of a scalar bar. It listens to Left mouse events and mouse movement. It also listens to Right mouse events and notifies any observers of Right mouse events on this object when they occur. It will change the cursor shape based on its location. If the cursor is over an edge of the scalar bar it will change the cursor shape to a resize edge shape. If the position of a scalar bar is moved to be close to the center of one of the four edges of the viewport, then the scalar bar will change its orientation to align with that edge. This orientation is sticky in that it will stay that orientation until the position is moved close to another edge.

See also:
  vtkInteractorObserver

Events:
  vtkCommand::EnableEvent vtkCommand::RightButtonReleaseEvent vtkCommand::RightButtonPressEvent vtkCommand::EndInteractionEvent vtkCommand::DisableEvent vtkCommand::StartInteractionEvent

Created by:
  - Martin, Ken

CVS contributions (if > 5%):
  - Martin, Ken (85%)
  - Lee, Jeff (8%)

CVS logs (CVSweb):
  - .`cxx` (`/Hybrid/vtkScalarBarWidget.cxx)`
  - .`h` (`/Hybrid/vtkScalarBarWidget.h)`

Tests:
  vtkScalarBarWidget (Tests)

Definition at line 61 of file vtkScalarBarWidget.h.

## Public Types

typedef vtkInteractorObserver | Superclass

## Public Methods

virtual const char * | GetClassName ()
virtual int | IsA (const char *type)
void | PrintSelf (ostream &os, vtkIndent indent)
virtual void | SetEnabled (int)
void | SetScalarBarActor (vtkScalarBarActor *scalarbar)
virtual vtkScalarBarActor * | GetScalarBarActor ()

## Static Public Methods

vtkScalarBarWidget * | New ()
int | IsTypeOf (const char *type)
vtkScalarBarWidget * | SafeDownCast (vtkObject *o)

## Protected Types

enum | WidgetState { Moving = 0, AdjustingP1, AdjustingP2, AdjustingP3, AdjustingP4, AdjustingE1, AdjustingE2, AdjustingE3, AdjustingE4, Inside, Outside }

## Protected Methods

| vtkScalarBarWidget ()
| ~vtkScalarBarWidget ()
void | OnLeftButtonDown ()
void | OnLeftButtonUp ()
void | OnRightButtonDown ()
void | OnRightButtonUp ()
void | OnMouseMove ()
int | ComputeStateBasedOnPosition (int X, int Y, int *pos1, int *pos2)
void | SetCursor (int State)

## Static Protected Methods

void | ProcessEvents (vtkObject *object, unsigned long event, void *clientdata, void *calldata)

## Protected Attributes

vtkScalarBarActor * | ScalarBarActor
float | StartPosition [2]
int | State
int | LeftButtonDown
int | RightButtonDown

## Member Typedef Documentation

typedef vtkInteractorObserver vtkScalarBarWidget::Superclass

| Reimplemented from vtkInteractorObserver. Definition at line 65 of file vtkScalarBarWidget.h.

## Member Enumeration Documentation

enum vtkScalarBarWidget::WidgetState`[protected]`

Enumeration values:

  Moving |
  AdjustingP1 |
  AdjustingP2 |
  AdjustingP3 |
  AdjustingP4 |
  AdjustingE1 |
  AdjustingE2 |
  AdjustingE3 |
  AdjustingE4 |
  Inside |
  Outside |

Definition at line 106 of file vtkScalarBarWidget.h.

## Constructor & Destructor Documentation

vtkScalarBarWidget::vtkScalarBarWidget | ( |  | ) | `[protected]`

vtkScalarBarWidget::~vtkScalarBarWidget | ( |  | ) | `[protected]`

## Member Function Documentation

vtkScalarBarWidget* vtkScalarBarWidget::New | ( |  | ) | `[static]`

| Create an object with Debug turned off, modified time initialized to zero, and reference counting on. Reimplemented from vtkObject.

virtual const char* vtkScalarBarWidget::GetClassName | ( |  | ) | `[virtual]`

| Reimplemented from vtkInteractorObserver.

int vtkScalarBarWidget::IsTypeOf | ( | const char * | type | ) | `[static]`

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

virtual int vtkScalarBarWidget::IsA | ( | const char * | type | ) | `[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 vtkTypeRevisionMacro found in vtkSetGet.h. Reimplemented from vtkInteractorObserver.

vtkScalarBarWidget* vtkScalarBarWidget::SafeDownCast | ( | vtkObject * | o | ) | `[static]`

| Reimplemented from vtkInteractorObserver.

void vtkScalarBarWidget::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 vtkInteractorObserver.

void vtkScalarBarWidget::SetScalarBarActor | ( | vtkScalarBarActor * | scalarbar | ) |

| Get the ScalarBar used by this Widget. One is created automatically.

virtual vtkScalarBarActor* vtkScalarBarWidget::GetScalarBarActor | ( |  | ) | `[virtual]`

| Get the ScalarBar used by this Widget. One is created automatically.

virtual void vtkScalarBarWidget::SetEnabled | ( | int |  | ) | `[virtual]`

| Methods for turning the interactor observer on and off. Implements vtkInteractorObserver.

void vtkScalarBarWidget::ProcessEvents | ( | vtkObject * | object,
|  | unsigned long | event,
|  | void * | clientdata,
|  | void * | calldata
| ) | `[static, protected]`

| Handles the char widget activation event. Also handles the delete event. Reimplemented from vtkInteractorObserver.

void vtkScalarBarWidget::OnLeftButtonDown | ( |  | ) | `[protected]`

void vtkScalarBarWidget::OnLeftButtonUp | ( |  | ) | `[protected]`

void vtkScalarBarWidget::OnRightButtonDown | ( |  | ) | `[protected]`

void vtkScalarBarWidget::OnRightButtonUp | ( |  | ) | `[protected]`

void vtkScalarBarWidget::OnMouseMove | ( |  | ) | `[protected]`

int vtkScalarBarWidget::ComputeStateBasedOnPosition | ( | int | X,
|  | int | Y,
|  | int * | pos1,
|  | int * | pos2
| ) | `[protected]`

void vtkScalarBarWidget::SetCursor | ( | int | State | ) | `[protected]`

## Member Data Documentation

vtkScalarBarActor* vtkScalarBarWidget::ScalarBarActor`[protected]`

| Definition at line 82 of file vtkScalarBarWidget.h.

float vtkScalarBarWidget::StartPosition[2]`[protected]`

| Definition at line 98 of file vtkScalarBarWidget.h.

int vtkScalarBarWidget::State`[protected]`

| Definition at line 101 of file vtkScalarBarWidget.h.

int vtkScalarBarWidget::LeftButtonDown`[protected]`

| Definition at line 104 of file vtkScalarBarWidget.h.

int vtkScalarBarWidget::RightButtonDown`[protected]`

| Definition at line 105 of file vtkScalarBarWidget.h.

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

- Hybrid/vtkScalarBarWidget.h