FreeMat: vtkButtonSource

FreeMat

- Main Page
- Related Pages

vtkButtonSource

Section: Visualization Toolkit Graphics Classes

# Usage

vtkButtonSource is an abstract class that defines an API for creating "button-like" objects in VTK. A button is a geometry with a rectangular region that can be textured. The button is divided into two regions: the texture region and the shoulder region. The points in both regions are assigned texture coordinates. The texture region has texture coordinates consistent with the image to be placed on it. All points in the shoulder regions are assigned a texture coordinate specified by the user. In this way the shoulder region can be colored by the texture.

Creating a vtkButtonSource requires specifying its center point. (Subclasses have other attributes that must be set to control the shape of the button.) You must also specify how to control the shape of the texture region; i.e., wheter to size the texture region proportional to the texture dimensions or whether to size the texture region proportional to the button. Also, buttons can be created single sided are mirrored to create two-sided buttons.

To create an instance of class vtkButtonSource, simply invoke its constructor as follows

      obj = vtkButtonSource

# Methods

The class vtkButtonSource has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkButtonSource class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkButtonSource = obj.NewInstance ()`
- `vtkButtonSource = obj.SafeDownCast (vtkObject o)`
- `obj.SetCenter (double , double , double )` - Specify a point defining the origin (center) of the button.
- `obj.SetCenter (double a[3])` - Specify a point defining the origin (center) of the button.
- `double = obj. GetCenter ()` - Specify a point defining the origin (center) of the button.
- `obj.SetTextureStyle (int )` - 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.
- `int = obj.GetTextureStyleMinValue ()` - 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.
- `int = obj.GetTextureStyleMaxValue ()` - 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.
- `int = obj.GetTextureStyle ()` - 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.
- `obj.SetTextureStyleToFitImage ()` - 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.
- `obj.SetTextureStyleToProportional ()` - Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.
- `obj.SetTextureDimensions (int , int )` - Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.
- `obj.SetTextureDimensions (int a[2])` - Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.
- `int = obj. GetTextureDimensions ()` - Set/get the texture dimension. This needs to be set if the texture style is set to fit the image.
- `obj.SetShoulderTextureCoordinate (double , double )` - Set/Get the default texture coordinate to set the shoulder region to.
- `obj.SetShoulderTextureCoordinate (double a[2])` - Set/Get the default texture coordinate to set the shoulder region to.
- `double = obj. GetShoulderTextureCoordinate ()` - Set/Get the default texture coordinate to set the shoulder region to.
- `obj.SetTwoSided (int )` - 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."
- `int = obj.GetTwoSided ()` - 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."
- `obj.TwoSidedOn ()` - 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."
- `obj.TwoSidedOff ()` - 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."