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

# vtkButtonSource Class Reference

`#include <vtkButtonSource.h>`

Inheritance diagram for vtkButtonSource:

[legend]
Collaboration diagram for vtkButtonSource:

[legend]
List of all members.

## Detailed Description

create a ellipsoidal-shaped button

Date:
  2002/09/03 12:52:22

Revision:
  1.2

vtkButtonSource creates a ellipsoidal shaped button with texture coordinates suitable for application of a texture map. This provides a way to make nice looking 3D buttons. The buttons are represented as vtkPolyData that includes texture coordinates and normals. The button lies in the x-y plane.

To use this class you must define the major and minor axes lengths of an ellipsoid (expressed as width (x), height (y) and depth (z)). The button has a rectangular mesh region in the center with texture coordinates that range smoothly from (0,1). (This flat region is called the texture region.) The outer, curved portion of the button (called the shoulder) has texture coordinates set to a user specified value (by default (0,0). (This results in coloring the button curve the same color as the (s,t) location of the texture map.) The resolution in the radial direction, the texture region, and the shoulder region must also be set. The button can be moved by specifying an origin.

Created by:
  - Schroeder, Will

CVS contributions (if > 5%):
  - Schroeder, Will (94%)
  - Cedilnik, Andy (5%)

CVS logs (CVSweb):
  - .`h` (`/Graphics/vtkButtonSource.h)`
  - .`cxx` (`/Graphics/vtkButtonSource.cxx)`

Tests:
  vtkButtonSource (Tests)

Definition at line 66 of file vtkButtonSource.h.

## Public Types

typedef vtkPolyDataSource | Superclass

## Public Methods

void | PrintSelf (ostream &os, vtkIndent indent)
virtual const char * | GetClassName ()
virtual int | IsA (const char *type)
virtual void | SetWidth (float)
virtual float | GetWidth ()
virtual void | SetHeight (float)
virtual float | GetHeight ()
virtual void | SetDepth (float)
virtual float | GetDepth ()
virtual void | SetRadialRatio (float)
virtual float | GetRadialRatio ()
virtual void | SetCircumferentialResolution (int)
virtual int | GetCircumferentialResolution ()
virtual void | SetTextureResolution (int)
virtual int | GetTextureResolution ()
virtual void | SetShoulderResolution (int)
virtual int | GetShoulderResolution ()
virtual void | SetOrigin (float, float, float)
virtual void | SetOrigin (float[3])
virtual float * | GetOrigin ()
virtual void | GetOrigin (float data[3])
virtual void | SetTextureStyle (int)
virtual int | GetTextureStyle ()
void | SetTextureStyleToFitImage ()
void | SetTextureStyleToProportional ()
virtual void | SetTextureDimensions (int, int)
void | SetTextureDimensions (int[2])
virtual int * | GetTextureDimensions ()
virtual void | GetTextureDimensions (int &, int &)
virtual void | GetTextureDimensions (int[2])
virtual void | SetShoulderTextureCoordinate (float, float)
void | SetShoulderTextureCoordinate (float[2])
virtual float * | GetShoulderTextureCoordinate ()
virtual void | GetShoulderTextureCoordinate (float &, float &)
virtual void | GetShoulderTextureCoordinate (float[2])
virtual void | SetTwoSided (int)
virtual int | GetTwoSided ()
virtual void | TwoSidedOn ()
virtual void | TwoSidedOff ()

## Static Public Methods

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

## Protected Methods

| vtkButtonSource ()
| ~vtkButtonSource ()
void | Execute ()

## Protected Attributes

float | Width
float | Height
float | Depth
int | CircumferentialResolution
int | TextureResolution
int | ShoulderResolution
float | Origin [3]
float | ShoulderTextureCoordinate [2]
float | RadialRatio
int | TextureStyle
int | TextureDimensions [2]
int | TwoSided

## Member Typedef Documentation

typedef vtkPolyDataSource vtkButtonSource::Superclass

| Reimplemented from vtkPolyDataSource. Definition at line 70 of file vtkButtonSource.h.

## Constructor & Destructor Documentation

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

vtkButtonSource::~vtkButtonSource | ( |  | ) | `[inline, protected]`

| Definition at line 173 of file vtkButtonSource.h.

## Member Function Documentation

void vtkButtonSource::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 vtkPolyDataSource.

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

| Reimplemented from vtkPolyDataSource.

int vtkButtonSource::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 vtkPolyDataSource.

virtual int vtkButtonSource::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 vtkPolyDataSource.

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

| Reimplemented from vtkPolyDataSource.

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

| Construct a circular button with depth 10% of its height. Reimplemented from vtkObject.

virtual void vtkButtonSource::SetWidth | ( | float |  | ) | `[virtual]`

| Set/Get the width of the button (the x-ellipsoid axis length * 2).

virtual float vtkButtonSource::GetWidth | ( |  | ) | `[virtual]`

| Set/Get the width of the button (the x-ellipsoid axis length * 2).

virtual void vtkButtonSource::SetHeight | ( | float |  | ) | `[virtual]`

| Set/Get the height of the button (the y-ellipsoid axis length * 2).

virtual float vtkButtonSource::GetHeight | ( |  | ) | `[virtual]`

| Set/Get the height of the button (the y-ellipsoid axis length * 2).

virtual void vtkButtonSource::SetDepth | ( | float |  | ) | `[virtual]`

| Set/Get the depth of the button (the z-eliipsoid axis length).

virtual float vtkButtonSource::GetDepth | ( |  | ) | `[virtual]`

| Set/Get the depth of the button (the z-eliipsoid axis length).

virtual void vtkButtonSource::SetRadialRatio | ( | float |  | ) | `[virtual]`

Set/Get the radial ratio. This is the measure of the radius of the outer ellipsoid to the inner ellipsoid of the button. The outer ellipsoid is the boundary of the button defined by the height and width. The inner ellipsoid circumscribes the texture region. Larger RadialRatio's cause the button to be more rounded (and the texture region to be smaller); smaller ratios produce sharply curved shoulders with a larger texture region.

virtual float vtkButtonSource::GetRadialRatio | ( |  | ) | `[virtual]`

Set/Get the radial ratio. This is the measure of the radius of the outer ellipsoid to the inner ellipsoid of the button. The outer ellipsoid is the boundary of the button defined by the height and width. The inner ellipsoid circumscribes the texture region. Larger RadialRatio's cause the button to be more rounded (and the texture region to be smaller); smaller ratios produce sharply curved shoulders with a larger texture region.

virtual void vtkButtonSource::SetCircumferentialResolution | ( | int |  | ) | `[virtual]`

| Specify the resolution of the button in the circumferential direction.

virtual int vtkButtonSource::GetCircumferentialResolution | ( |  | ) | `[virtual]`

| Specify the resolution of the button in the circumferential direction.

virtual void vtkButtonSource::SetTextureResolution | ( | int |  | ) | `[virtual]`

| Specify the resolution of the texture in the radial direction in the texture region.

virtual int vtkButtonSource::GetTextureResolution | ( |  | ) | `[virtual]`

| Specify the resolution of the texture in the radial direction in the texture region.

virtual void vtkButtonSource::SetShoulderResolution | ( | int |  | ) | `[virtual]`

| Specify the resolution of the texture in the radial direction in the shoulder region.

virtual int vtkButtonSource::GetShoulderResolution | ( |  | ) | `[virtual]`

| Specify the resolution of the texture in the radial direction in the shoulder region.

virtual void vtkButtonSource::SetOrigin | ( | float | ,
|  | float | ,
|  | float |
| ) | `[virtual]`

| Specify a point defining the origin of the button.

virtual void vtkButtonSource::SetOrigin | ( | float | [3] | ) | `[virtual]`

| Specify a point defining the origin of the button.

virtual float* vtkButtonSource::GetOrigin | ( |  | ) | `[virtual]`

| Specify a point defining the origin of the button.

virtual void vtkButtonSource::GetOrigin | ( | float | data[3] | ) | `[virtual]`

| Specify a point defining the origin of the button.

virtual void vtkButtonSource::SetTextureStyle | ( | int |  | ) | `[virtual]`

| Set/Get the style of the texture region: whether to size it according to the x-y dimensions of the texture, or whether to make the texture region proportional to the width/height of the button. When using the texture dimensions, the texture region is adjusted to be circumscribed by the elliptical, inner shape of the button. (The inner elliptical radius is controled by the RadiusRatio.)

virtual int vtkButtonSource::GetTextureStyle | ( |  | ) | `[virtual]`

| Set/Get the style of the texture region: whether to size it according to the x-y dimensions of the texture, or whether to make the texture region proportional to the width/height of the button. When using the texture dimensions, the texture region is adjusted to be circumscribed by the elliptical, inner shape of the button. (The inner elliptical radius is controled by the RadiusRatio.)

void vtkButtonSource::SetTextureStyleToFitImage | ( |  | ) | `[inline]`

Set/Get the style of the texture region: whether to size it according to the x-y dimensions of the texture, or whether to make the texture region proportional to the width/height of the button. When using the texture dimensions, the texture region is adjusted to be circumscribed by the elliptical, inner shape of the button. (The inner elliptical radius is controled by the RadiusRatio.)

Definition at line 142 of file vtkButtonSource.h.

References VTK_TEXTURE_STYLE_FIT_IMAGE.

void vtkButtonSource::SetTextureStyleToProportional | ( |  | ) | `[inline]`

Set/Get the style of the texture region: whether to size it according to the x-y dimensions of the texture, or whether to make the texture region proportional to the width/height of the button. When using the texture dimensions, the texture region is adjusted to be circumscribed by the elliptical, inner shape of the button. (The inner elliptical radius is controled by the RadiusRatio.)

Definition at line 144 of file vtkButtonSource.h.

References VTK_TEXTURE_STYLE_PROPORTIONAL.

virtual void vtkButtonSource::SetTextureDimensions | ( | int | ,
|  | int |
| ) | `[virtual]`

| Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.

void vtkButtonSource::SetTextureDimensions | ( | int | [2] | ) |

| Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.

virtual int* vtkButtonSource::GetTextureDimensions | ( |  | ) | `[virtual]`

| Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.

virtual void vtkButtonSource::GetTextureDimensions | ( | int & | ,
|  | int & |
| ) | `[virtual]`

| Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.

virtual void vtkButtonSource::GetTextureDimensions | ( | int | [2] | ) | `[virtual]`

| Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.

virtual void vtkButtonSource::SetShoulderTextureCoordinate | ( | float | ,
|  | float |
| ) | `[virtual]`

| Set/Get the default texture coordinate to set the shoulder region to.

void vtkButtonSource::SetShoulderTextureCoordinate | ( | float | [2] | ) |

| Set/Get the default texture coordinate to set the shoulder region to.

virtual float* vtkButtonSource::GetShoulderTextureCoordinate | ( |  | ) | `[virtual]`

| Set/Get the default texture coordinate to set the shoulder region to.

virtual void vtkButtonSource::GetShoulderTextureCoordinate | ( | float & | ,
|  | float & |
| ) | `[virtual]`

| Set/Get the default texture coordinate to set the shoulder region to.

virtual void vtkButtonSource::GetShoulderTextureCoordinate | ( | float | [2] | ) | `[virtual]`

| Set/Get the default texture coordinate to set the shoulder region to.

virtual void vtkButtonSource::SetTwoSided | ( | int |  | ) | `[virtual]`

| Indicate whether the button is single or double sided. A double sided button can be viewed from two sides...it looks sort of like a "pill." A single-sided button is meant to viewed from a single side; it looks like a "clam-shell."

virtual int vtkButtonSource::GetTwoSided | ( |  | ) | `[virtual]`

| Indicate whether the button is single or double sided. A double sided button can be viewed from two sides...it looks sort of like a "pill." A single-sided button is meant to viewed from a single side; it looks like a "clam-shell."

virtual void vtkButtonSource::TwoSidedOn | ( |  | ) | `[virtual]`

| Indicate whether the button is single or double sided. A double sided button can be viewed from two sides...it looks sort of like a "pill." A single-sided button is meant to viewed from a single side; it looks like a "clam-shell."

virtual void vtkButtonSource::TwoSidedOff | ( |  | ) | `[virtual]`

| Indicate whether the button is single or double sided. A double sided button can be viewed from two sides...it looks sort of like a "pill." A single-sided button is meant to viewed from a single side; it looks like a "clam-shell."

void vtkButtonSource::Execute | ( |  | ) | `[protected, virtual]`

| This method is the old style execute method Reimplemented from vtkSource.

## Member Data Documentation

float vtkButtonSource::Width`[protected]`

| Definition at line 177 of file vtkButtonSource.h.

float vtkButtonSource::Height`[protected]`

| Definition at line 178 of file vtkButtonSource.h.

float vtkButtonSource::Depth`[protected]`

| Definition at line 179 of file vtkButtonSource.h.

int vtkButtonSource::CircumferentialResolution`[protected]`

| Definition at line 181 of file vtkButtonSource.h.

int vtkButtonSource::TextureResolution`[protected]`

| Definition at line 182 of file vtkButtonSource.h.

int vtkButtonSource::ShoulderResolution`[protected]`

| Definition at line 183 of file vtkButtonSource.h.

float vtkButtonSource::Origin[3]`[protected]`

| Definition at line 185 of file vtkButtonSource.h.

float vtkButtonSource::ShoulderTextureCoordinate[2]`[protected]`

| Definition at line 186 of file vtkButtonSource.h.

float vtkButtonSource::RadialRatio`[protected]`

| Definition at line 188 of file vtkButtonSource.h.

int vtkButtonSource::TextureStyle`[protected]`

| Definition at line 189 of file vtkButtonSource.h.

int vtkButtonSource::TextureDimensions[2]`[protected]`

| Definition at line 190 of file vtkButtonSource.h.

int vtkButtonSource::TwoSided`[protected]`

| Definition at line 191 of file vtkButtonSource.h.

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

- Graphics/vtkButtonSource.h