1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkView.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*----------------------------------------------------------------------------
Copyright (c) Sandia Corporation
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
----------------------------------------------------------------------------*/
// .NAME vtkView - The superclass for all views.
//
// .SECTION Description
// 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, vtkTreeLayoutView, 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
// vtkSelectionLink on their representations (see vtkDataRepresentation).
#ifndef __vtkView_h
#define __vtkView_h
#include "vtkObject.h"
class vtkAlgorithmOutput;
class vtkCollection;
class vtkCommand;
class vtkDataObject;
class vtkDataRepresentation;
class vtkSelection;
class vtkSelectionLink;
class vtkViewTheme;
class VTK_VIEWS_EXPORT vtkView : public vtkObject
{
public:
static vtkView *New();
vtkTypeRevisionMacro(vtkView, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Adds the representation to the view.
void AddRepresentation(vtkDataRepresentation* rep);
// Description:
// 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* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
// Description:
// 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* AddRepresentationFromInput(vtkDataObject* input);
// Description:
// Removes the representation from the view.
void RemoveRepresentation(vtkDataRepresentation* rep);
// Description:
// Removes any representation with this connection from the view.
void RemoveRepresentation(vtkAlgorithmOutput* rep);
// Description:
// Removes all representations from the view.
void RemoveAllRepresentations();
// Description:
// The number of representations in this view.
int GetNumberOfRepresentations();
// Description:
// The representation at a specified index.
vtkDataRepresentation* GetRepresentation(int index = 0);
// Description:
// Update the view.
virtual void Update() { }
// Description:
// Apply a theme to the view.
virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { }
//BTX
// Description:
// Returns the observer that the subclasses can use to listen to additional
// events. Additionally these subclasses should override
// ProcessEvents() to handle these events.
vtkCommand* GetObserver();
//ETX
protected:
vtkView();
~vtkView();
// Description:
// Called to process events.
// The superclass processes selection changed events from its representations.
// This may be overridden by subclasses to process additional events.
virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
void* callData);
// Description:
// Connects to the internal pipeline.
// Subclasses that handle tight integration between view and
// representation should override this method.
virtual void AddInputConnection(vtkAlgorithmOutput* vtkNotUsed(conn)) { }
// Description:
// Disconnects the internal pipeline.
// Subclasses that handle tight integration between view and
// representation should override this method.
virtual void RemoveInputConnection(vtkAlgorithmOutput* vtkNotUsed(conn)) { }
// Description:
// Is called when the representation's selection link changes.
// Subclasses that handle tight integration between view and
// representation should override this method.
virtual void SetSelectionLink(vtkSelectionLink* vtkNotUsed(link)) { }
vtkCollection* Representations;
private:
vtkView(const vtkView&); // Not implemented.
void operator=(const vtkView&); // Not implemented.
//BTX
class Command;
friend class Command;
Command* Observer;
//ETX
};
#endif
|