VTK  9.2.6
vtkView.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkView.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
44#ifndef vtkView_h
45#define vtkView_h
46
47#include "vtkObject.h"
48#include "vtkViewsCoreModule.h" // For export macro
49
51class vtkCommand;
52class vtkDataObject;
54class vtkSelection;
55class vtkViewTheme;
56
57class VTKVIEWSCORE_EXPORT vtkView : public vtkObject
58{
59public:
60 static vtkView* New();
61 vtkTypeMacro(vtkView, vtkObject);
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
68
73
83
93
102
111
116
121
126
131
136
141
145 virtual void Update();
146
150 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) {}
151
158
160
165 {
166 const char* Message;
167 double Progress;
169
170 public:
171 ViewProgressEventCallData(const char* msg, double progress)
172 {
173 this->Message = msg;
174 this->Progress = progress;
175 }
176 ~ViewProgressEventCallData() { this->Message = nullptr; }
177
181 const char* GetProgressMessage() const { return this->Message; }
182
186 double GetProgress() const { return this->Progress; }
187 };
188
198 void RegisterProgress(vtkObject* algorithm, const char* message = nullptr);
199
204
205protected:
207 ~vtkView() override;
208
214 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
215
223
228 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
229 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
230
232
236 vtkSetMacro(ReuseSingleRepresentation, bool);
237 vtkGetMacro(ReuseSingleRepresentation, bool);
238 vtkBooleanMacro(ReuseSingleRepresentation, bool);
241
242private:
243 vtkView(const vtkView&) = delete;
244 void operator=(const vtkView&) = delete;
245
246 class vtkImplementation;
247 vtkImplementation* Implementation;
248
249 class Command;
250 friend class Command;
251 Command* Observer;
252
253 class vtkInternal;
254 vtkInternal* Internal;
255};
256
257#endif
Proxy object to connect input/output ports.
superclass for callback/observer methods
Definition vtkCommand.h:395
general representation of visualization data
The superclass for all representations.
a simple class to control print indentation
Definition vtkIndent.h:34
abstract base class for most VTK objects
Definition vtkObject.h:57
data object that represents a "selection" in VTK.
Sets theme colors for a graphical view.
A ptr to an instance of ViewProgressEventCallData is provided in the call data when vtkCommand::ViewP...
Definition vtkView.h:165
double GetProgress() const
Get the progress value in range [0.0, 1.0].
Definition vtkView.h:186
ViewProgressEventCallData(const char *msg, double progress)
Definition vtkView.h:171
const char * GetProgressMessage() const
Get the message.
Definition vtkView.h:181
The superclass for all views.
Definition vtkView.h:58
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition vtkView.h:150
vtkDataRepresentation * SetRepresentationFromInput(vtkDataObject *input)
Convenience method which sets the representation to the specified input and adds it to the view.
vtkDataRepresentation * AddRepresentationFromInput(vtkDataObject *input)
Convenience method which creates a simple representation with the specified input and adds it to the ...
void RemoveRepresentation(vtkAlgorithmOutput *rep)
Removes any representation with this connection from the view.
void UnRegisterProgress(vtkObject *algorithm)
Unregister objects previously registered with RegisterProgress.
virtual void Update()
Update the view.
vtkCommand * GetObserver()
Returns the observer that the subclasses can use to listen to additional events.
vtkDataRepresentation * AddRepresentationFromInputConnection(vtkAlgorithmOutput *conn)
Convenience method which creates a simple representation with the connection and adds it to the view.
virtual void AddRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Subclass "hooks" for notifying subclasses of vtkView when representations are added or removed.
Definition vtkView.h:228
virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData)
Called to process events.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void RegisterProgress(vtkObject *algorithm, const char *message=nullptr)
Meant for use by subclasses and vtkRepresentation subclasses.
~vtkView() override
Meant for use by subclasses and vtkRepresentation subclasses.
int GetNumberOfRepresentations()
Returns the number of representations from first port(0) in this view.
void RemoveAllRepresentations()
Removes all representations from the view.
vtkDataRepresentation * GetRepresentation(int index=0)
The representation at a specified index.
vtkDataRepresentation * SetRepresentationFromInputConnection(vtkAlgorithmOutput *conn)
Convenience method which sets the representation with the connection and adds it to the view.
vtkView()
Meant for use by subclasses and vtkRepresentation subclasses.
virtual void RemoveRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Meant for use by subclasses and vtkRepresentation subclasses.
Definition vtkView.h:229
void SetRepresentation(vtkDataRepresentation *rep)
Set the representation to the view.
void RemoveRepresentation(vtkDataRepresentation *rep)
Removes the representation from the view.
bool IsRepresentationPresent(vtkDataRepresentation *rep)
Check to see if a representation is present in the view.
void AddRepresentation(vtkDataRepresentation *rep)
Adds the representation to the view.
virtual vtkDataRepresentation * CreateDefaultRepresentation(vtkAlgorithmOutput *conn)
Create a default vtkDataRepresentation for the given vtkAlgorithmOutput.
bool ReuseSingleRepresentation
Meant for use by subclasses and vtkRepresentation subclasses.
Definition vtkView.h:239
static vtkView * New()