FreeMat

- Main Page
- Related Pages

vtkAffineRepresentation2D

Section: Visualization Toolkit Widget Classes

# Usage

This class is used to represent a vtkAffineWidget. This representation consists of three parts: a box, a circle, and a cross. The box is used for scaling and shearing, the circle for rotation, and the cross for translation. These parts are drawn in the overlay plane and maintain a constant size (width and height) specified in terms of normalized viewport coordinates.

The representation maintains an internal transformation matrix (see superclass' GetTransform() method). The transformations generated by this widget assume that the representation lies in the x-y plane. If this is not the case, the user is responsible for transforming this representation's matrix into the correct coordinate space (by judicious matrix multiplication). Note that the transformation matrix returned by GetTransform() is relative to the last PlaceWidget() invocation. (The PlaceWidget() sets the origin around which rotation and scaling occurs; the origin is the center point of the bounding box provided.)

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

      obj = vtkAffineRepresentation2D

# Methods

The class vtkAffineRepresentation2D 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 vtkAffineRepresentation2D class.

- `string = obj.GetClassName ()` - Standard methods for instances of this class.
- `int = obj.IsA (string name)` - Standard methods for instances of this class.
- `vtkAffineRepresentation2D = obj.NewInstance ()` - Standard methods for instances of this class.
- `vtkAffineRepresentation2D = obj.SafeDownCast (vtkObject o)` - Standard methods for instances of this class.
- `obj.SetBoxWidth (int )` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetBoxWidthMinValue ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetBoxWidthMaxValue ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetBoxWidth ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `obj.SetCircleWidth (int )` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetCircleWidthMinValue ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetCircleWidthMaxValue ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetCircleWidth ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `obj.SetAxesWidth (int )` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetAxesWidthMinValue ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetAxesWidthMaxValue ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `int = obj.GetAxesWidth ()` - Specify the width of the various parts of the representation (in pixels). The three parts are of the representation are the translation axes, the rotation circle, and the scale/shear box. Note that since the widget resizes itself so that the width and height are always the same, only the width needs to be specified.
- `obj.SetOrigin (double o[3])` - Specify the origin of the widget (in world coordinates). The origin is the point where the widget places itself. Note that rotations and scaling occurs around the origin.
- `obj.SetOrigin (double ox, double oy, double oz)` - Specify the origin of the widget (in world coordinates). The origin is the point where the widget places itself. Note that rotations and scaling occurs around the origin.
- `double = obj. GetOrigin ()` - Specify the origin of the widget (in world coordinates). The origin is the point where the widget places itself. Note that rotations and scaling occurs around the origin.
- `obj.GetTransform (vtkTransform t)` - Retrieve a linear transform characterizing the affine transformation generated by this widget. This method copies its internal transform into the transform provided. Note that the PlaceWidget() method initializes the internal matrix to identity. All subsequent widget operations (i.e., scale, translate, rotate, shear) are concatenated with the internal transform.
- `obj.SetProperty (vtkProperty2D )` - Set/Get the properties when unselected and selected.
- `obj.SetSelectedProperty (vtkProperty2D )` - Set/Get the properties when unselected and selected.
- `obj.SetTextProperty (vtkTextProperty )` - Set/Get the properties when unselected and selected.
- `vtkProperty2D = obj.GetProperty ()` - Set/Get the properties when unselected and selected.
- `vtkProperty2D = obj.GetSelectedProperty ()` - Set/Get the properties when unselected and selected.
- `vtkTextProperty = obj.GetTextProperty ()` - Set/Get the properties when unselected and selected.
- `obj.SetDisplayText (int )` - Enable the display of text with numeric values characterizing the transformation. Rotation and shear are expressed in degrees; translation the distance in world coordinates; and scale normalized (sx,sy) values.
- `int = obj.GetDisplayText ()` - Enable the display of text with numeric values characterizing the transformation. Rotation and shear are expressed in degrees; translation the distance in world coordinates; and scale normalized (sx,sy) values.
- `obj.DisplayTextOn ()` - Enable the display of text with numeric values characterizing the transformation. Rotation and shear are expressed in degrees; translation the distance in world coordinates; and scale normalized (sx,sy) values.
- `obj.DisplayTextOff ()` - Enable the display of text with numeric values characterizing the transformation. Rotation and shear are expressed in degrees; translation the distance in world coordinates; and scale normalized (sx,sy) values.
- `obj.PlaceWidget (double bounds[6])` - Subclasses of vtkAffineRepresentation2D must implement these methods. These are the methods that the widget and its representation use to communicate with each other. Note: PlaceWidget() reinitializes the transformation matrix (i.e., sets it to identity). It also sets the origin for scaling and rotation.
- `obj.StartWidgetInteraction (double eventPos[2])` - Subclasses of vtkAffineRepresentation2D must implement these methods. These are the methods that the widget and its representation use to communicate with each other. Note: PlaceWidget() reinitializes the transformation matrix (i.e., sets it to identity). It also sets the origin for scaling and rotation.
- `obj.WidgetInteraction (double eventPos[2])` - Subclasses of vtkAffineRepresentation2D must implement these methods. These are the methods that the widget and its representation use to communicate with each other. Note: PlaceWidget() reinitializes the transformation matrix (i.e., sets it to identity). It also sets the origin for scaling and rotation.
- `obj.EndWidgetInteraction (double eventPos[2])` - Subclasses of vtkAffineRepresentation2D must implement these methods. These are the methods that the widget and its representation use to communicate with each other. Note: PlaceWidget() reinitializes the transformation matrix (i.e., sets it to identity). It also sets the origin for scaling and rotation.
- `int = obj.ComputeInteractionState (int X, int Y, int modify)` - Subclasses of vtkAffineRepresentation2D must implement these methods. These are the methods that the widget and its representation use to communicate with each other. Note: PlaceWidget() reinitializes the transformation matrix (i.e., sets it to identity). It also sets the origin for scaling and rotation.
- `obj.BuildRepresentation ()` - Subclasses of vtkAffineRepresentation2D must implement these methods. These are the methods that the widget and its representation use to communicate with each other. Note: PlaceWidget() reinitializes the transformation matrix (i.e., sets it to identity). It also sets the origin for scaling and rotation.
- `obj.ShallowCopy (vtkProp prop)` - Methods to make this class behave as a vtkProp.
- `obj.GetActors2D (vtkPropCollection )` - Methods to make this class behave as a vtkProp.
- `obj.ReleaseGraphicsResources (vtkWindow )` - Methods to make this class behave as a vtkProp.
- `int = obj.RenderOverlay (vtkViewport viewport)` - Methods to make this class behave as a vtkProp.