FreeMat: vtkSplineRepresentation

FreeMat

- Main Page
- Related Pages

vtkSplineRepresentation

Section: Visualization Toolkit Widget Classes

# Usage

vtkSplineRepresentation is a vtkWidgetRepresentation for a spline. This 3D widget defines a spline that can be interactively placed in a scene. The spline has handles, the number of which can be changed, plus it can be picked on the spline itself to translate or rotate it in the scene. This is based on vtkSplineWidget.

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

      obj = vtkSplineRepresentation

# Methods

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

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkSplineRepresentation = obj.NewInstance ()`
- `vtkSplineRepresentation = obj.SafeDownCast (vtkObject o)`
- `obj.SetInteractionState (int )`
- `obj.SetProjectToPlane (int )` - Force the spline widget to be projected onto one of the orthogonal planes. Remember that when the InteractionState changes, a ModifiedEvent is invoked. This can be used to snap the spline to the plane if it is orginally not aligned. The normal in SetProjectionNormal is 0,1,2 for YZ,XZ,XY planes respectively and 3 for arbitrary oblique planes when the widget is tied to a vtkPlaneSource.
- `int = obj.GetProjectToPlane ()` - Force the spline widget to be projected onto one of the orthogonal planes. Remember that when the InteractionState changes, a ModifiedEvent is invoked. This can be used to snap the spline to the plane if it is orginally not aligned. The normal in SetProjectionNormal is 0,1,2 for YZ,XZ,XY planes respectively and 3 for arbitrary oblique planes when the widget is tied to a vtkPlaneSource.
- `obj.ProjectToPlaneOn ()` - Force the spline widget to be projected onto one of the orthogonal planes. Remember that when the InteractionState changes, a ModifiedEvent is invoked. This can be used to snap the spline to the plane if it is orginally not aligned. The normal in SetProjectionNormal is 0,1,2 for YZ,XZ,XY planes respectively and 3 for arbitrary oblique planes when the widget is tied to a vtkPlaneSource.
- `obj.ProjectToPlaneOff ()` - Force the spline widget to be projected onto one of the orthogonal planes. Remember that when the InteractionState changes, a ModifiedEvent is invoked. This can be used to snap the spline to the plane if it is orginally not aligned. The normal in SetProjectionNormal is 0,1,2 for YZ,XZ,XY planes respectively and 3 for arbitrary oblique planes when the widget is tied to a vtkPlaneSource.
- `obj.SetPlaneSource (vtkPlaneSource plane)` - Set up a reference to a vtkPlaneSource that could be from another widget object, e.g. a vtkPolyDataSourceWidget.
- `obj.SetProjectionNormal (int )`
- `int = obj.GetProjectionNormalMinValue ()`
- `int = obj.GetProjectionNormalMaxValue ()`
- `int = obj.GetProjectionNormal ()`
- `obj.SetProjectionNormalToXAxes ()`
- `obj.SetProjectionNormalToYAxes ()`
- `obj.SetProjectionNormalToZAxes ()`
- `obj.SetProjectionNormalToOblique ()` - Set the position of spline handles and points in terms of a plane's position. i.e., if ProjectionNormal is 0, all of the x-coordinate values of the points are set to position. Any value can be passed (and is ignored) to update the spline points when Projection normal is set to 3 for arbritrary plane orientations.
- `obj.SetProjectionPosition (double position)` - Set the position of spline handles and points in terms of a plane's position. i.e., if ProjectionNormal is 0, all of the x-coordinate values of the points are set to position. Any value can be passed (and is ignored) to update the spline points when Projection normal is set to 3 for arbritrary plane orientations.
- `double = obj.GetProjectionPosition ()` - Set the position of spline handles and points in terms of a plane's position. i.e., if ProjectionNormal is 0, all of the x-coordinate values of the points are set to position. Any value can be passed (and is ignored) to update the spline points when Projection normal is set to 3 for arbritrary plane orientations.
- `obj.GetPolyData (vtkPolyData pd)` - Grab the polydata (including points) that defines the spline. The polydata consists of points and line segments numbering Resolution + 1 and Resoltuion, respectively. Points are guaranteed to be up-to-date when either the InteractionEvent or EndInteraction events are invoked. The user provides the vtkPolyData and the points and polyline are added to it.
- `vtkProperty = obj.GetHandleProperty ()` - Set/Get the handle properties (the spheres are the handles). The properties of the handles when selected and unselected can be manipulated.
- `vtkProperty = obj.GetSelectedHandleProperty ()` - Set/Get the handle properties (the spheres are the handles). The properties of the handles when selected and unselected can be manipulated.
- `vtkProperty = obj.GetLineProperty ()` - Set/Get the line properties. The properties of the line when selected and unselected can be manipulated.
- `vtkProperty = obj.GetSelectedLineProperty ()` - Set/Get the line properties. The properties of the line when selected and unselected can be manipulated.
- `obj.SetNumberOfHandles (int npts)` - Set/Get the number of handles for this widget.
- `int = obj.GetNumberOfHandles ()` - Set/Get the number of handles for this widget.
- `obj.SetResolution (int resolution)` - Set/Get the number of line segments representing the spline for this widget.
- `int = obj.GetResolution ()` - Set/Get the number of line segments representing the spline for this widget.
- `obj.SetParametricSpline (vtkParametricSpline )` - Set the parametric spline object. Through vtkParametricSpline's API, the user can supply and configure one of currently two types of spline: vtkCardinalSpline, vtkKochanekSpline. The widget controls the open or closed configuration of the spline. WARNING: The widget does not enforce internal consistency so that all three are of the same type.
- `vtkParametricSpline = obj.GetParametricSpline ()` - Set the parametric spline object. Through vtkParametricSpline's API, the user can supply and configure one of currently two types of spline: vtkCardinalSpline, vtkKochanekSpline. The widget controls the open or closed configuration of the spline. WARNING: The widget does not enforce internal consistency so that all three are of the same type.
- `obj.SetHandlePosition (int handle, double x, double y, double z)` - Set/Get the position of the spline handles. Call GetNumberOfHandles to determine the valid range of handle indices.
- `obj.SetHandlePosition (int handle, double xyz[3])` - Set/Get the position of the spline handles. Call GetNumberOfHandles to determine the valid range of handle indices.
- `obj.GetHandlePosition (int handle, double xyz[3])` - Set/Get the position of the spline handles. Call GetNumberOfHandles to determine the valid range of handle indices.
- `vtkDoubleArray = obj.GetHandlePositions ()` - Set/Get the position of the spline handles. Call GetNumberOfHandles to determine the valid range of handle indices.
- `obj.SetClosed (int closed)` - Control whether the spline is open or closed. A closed spline forms a continuous loop: the first and last points are the same, and derivatives are continuous. A minimum of 3 handles are required to form a closed loop. This method enforces consistency with user supplied subclasses of vtkSpline.
- `int = obj.GetClosed ()` - Control whether the spline is open or closed. A closed spline forms a continuous loop: the first and last points are the same, and derivatives are continuous. A minimum of 3 handles are required to form a closed loop. This method enforces consistency with user supplied subclasses of vtkSpline.
- `obj.ClosedOn ()` - Control whether the spline is open or closed. A closed spline forms a continuous loop: the first and last points are the same, and derivatives are continuous. A minimum of 3 handles are required to form a closed loop. This method enforces consistency with user supplied subclasses of vtkSpline.
- `obj.ClosedOff ()` - Control whether the spline is open or closed. A closed spline forms a continuous loop: the first and last points are the same, and derivatives are continuous. A minimum of 3 handles are required to form a closed loop. This method enforces consistency with user supplied subclasses of vtkSpline.
- `int = obj.IsClosed ()` - Convenience method to determine whether the spline is closed in a geometric sense. The widget may be set "closed" but still be geometrically open (e.g., a straight line).
- `double = obj.GetSummedLength ()` - Get the approximate vs. the true arc length of the spline. Calculated as the summed lengths of the individual straight line segments. Use SetResolution to control the accuracy.
- `obj.InitializeHandles (vtkPoints points)` - Convenience method to allocate and set the handles from a vtkPoints instance. If the first and last points are the same, the spline sets Closed to the on InteractionState and disregards the last point, otherwise Closed remains unchanged.
- `obj.BuildRepresentation ()` - These are methods that satisfy vtkWidgetRepresentation's API. Note that a version of place widget is available where the center and handle position are specified.
- `int = obj.ComputeInteractionState (int X, int Y, int modify)` - These are methods that satisfy vtkWidgetRepresentation's API. Note that a version of place widget is available where the center and handle position are specified.
- `obj.StartWidgetInteraction (double e[2])` - These are methods that satisfy vtkWidgetRepresentation's API. Note that a version of place widget is available where the center and handle position are specified.
- `obj.WidgetInteraction (double e[2])` - These are methods that satisfy vtkWidgetRepresentation's API. Note that a version of place widget is available where the center and handle position are specified.
- `obj.EndWidgetInteraction (double e[2])` - These are methods that satisfy vtkWidgetRepresentation's API. Note that a version of place widget is available where the center and handle position are specified.
- `obj.ReleaseGraphicsResources (vtkWindow )` - Methods supporting, and required by, the rendering process.
- `int = obj.RenderOpaqueGeometry (vtkViewport )` - Methods supporting, and required by, the rendering process.
- `int = obj.RenderTranslucentPolygonalGeometry (vtkViewport )` - Methods supporting, and required by, the rendering process.
- `int = obj.RenderOverlay (vtkViewport )` - Methods supporting, and required by, the rendering process.
- `int = obj.HasTranslucentPolygonalGeometry ()` - Methods supporting, and required by, the rendering process.
- `obj.SetLineColor (double r, double g, double b)` - Convenience method to set the line color. Ideally one should use GetLineProperty()->SetColor().