FreeMat

- Main Page
- Related Pages

vtkView

Section: Visualization Toolkit View Classes

# Usage

vtkView is the superclass for views. A view is generally an area of an application's canvas devoted to displaying one or more VTK data objects. Associated representations (subclasses of vtkDataRepresentation) are responsible for converting the data into a displayable format. These representations are then added to the view.

For views which display only one data object at a time you may set a data object or pipeline connection directly on the view itself (e.g. vtkGraphLayoutView, vtkLandscapeView, vtkTreeMapView). The view will internally create a vtkDataRepresentation for the data.

A view has the concept of linked selection. If the same data is displayed in multiple views, their selections may be linked by setting the same vtkAnnotationLink on their representations (see vtkDataRepresentation).

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

      obj = vtkView

# Methods

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

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkView = obj.NewInstance ()`
- `vtkView = obj.SafeDownCast (vtkObject o)`
- `obj.AddRepresentation (vtkDataRepresentation rep)` - Adds the representation to the view.
- `obj.SetRepresentation (vtkDataRepresentation rep)` - Set the representation to the view.
- `vtkDataRepresentation = obj.AddRepresentationFromInputConnection (vtkAlgorithmOutput conn)` - Convenience method which creates a simple representation with the connection and adds it to the view. Returns the representation internally created. NOTE: The returned representation pointer is not reference-counted, so you MUST call Register() on the representation if you want to keep a reference to it.
- `vtkDataRepresentation = obj.SetRepresentationFromInputConnection (vtkAlgorithmOutput conn)` - Convenience method which sets the representation with the connection and adds it to the view. Returns the representation internally created. NOTE: The returned representation pointer is not reference-counted, so you MUST call Register() on the representation if you want to keep a reference to it.
- `vtkDataRepresentation = obj.AddRepresentationFromInput (vtkDataObject input)` - Convenience method which creates a simple representation with the specified input and adds it to the view. NOTE: The returned representation pointer is not reference-counted, so you MUST call Register() on the representation if you want to keep a reference to it.
- `vtkDataRepresentation = obj.SetRepresentationFromInput (vtkDataObject input)` - Convenience method which sets the representation to the specified input and adds it to the view. NOTE: The returned representation pointer is not reference-counted, so you MUST call Register() on the representation if you want to keep a reference to it.
- `obj.RemoveRepresentation (vtkDataRepresentation rep)` - Removes the representation from the view.
- `obj.RemoveRepresentation (vtkAlgorithmOutput rep)` - Removes any representation with this connection from the view.
- `obj.RemoveAllRepresentations ()` - Removes all representations from the view.
- `int = obj.GetNumberOfRepresentations ()` - Returns the number of representations from first port(0) in this view.
- `vtkDataRepresentation = obj.GetRepresentation (int index)` - The representation at a specified index.
- `bool = obj.IsRepresentationPresent (vtkDataRepresentation rep)` - Check to see if a representation is present in the view.
- `obj.Update ()` - Update the view.
- `obj.ApplyViewTheme (vtkViewTheme )` - Meant for use by subclasses and vtkRepresentation subclasses. Call this method to register vtkObjects (generally vtkAlgorithm subclasses) which fire vtkCommand::ProgressEvent with the view. The view listens to vtkCommand::ProgressEvent and fires ViewProgressEvent with ViewProgressEventCallData containing the message and the progress amount. If message is not provided, then the class name for the algorithm is used.
- `obj.RegisterProgress (vtkObject algorithm, string messageNULL)` - Meant for use by subclasses and vtkRepresentation subclasses. Call this method to register vtkObjects (generally vtkAlgorithm subclasses) which fire vtkCommand::ProgressEvent with the view. The view listens to vtkCommand::ProgressEvent and fires ViewProgressEvent with ViewProgressEventCallData containing the message and the progress amount. If message is not provided, then the class name for the algorithm is used.
- `obj.UnRegisterProgress (vtkObject algorithm)` - Unregister objects previously registered with RegisterProgress.