VTK  9.3.0
vtkView.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
31#ifndef vtkView_h
32#define vtkView_h
33
34#include "vtkObject.h"
35#include "vtkViewsCoreModule.h" // For export macro
36
37VTK_ABI_NAMESPACE_BEGIN
39class vtkCommand;
40class vtkDataObject;
42class vtkSelection;
43class vtkViewTheme;
44
45class VTKVIEWSCORE_EXPORT vtkView : public vtkObject
46{
47public:
48 static vtkView* New();
49 vtkTypeMacro(vtkView, vtkObject);
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
56
61
71
81
90
99
104
109
114
119
124
129
133 virtual void Update();
134
138 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) {}
139
146
148
153 {
154 const char* Message;
155 double Progress;
157
158 public:
159 ViewProgressEventCallData(const char* msg, double progress)
160 {
161 this->Message = msg;
162 this->Progress = progress;
163 }
164 ~ViewProgressEventCallData() { this->Message = nullptr; }
165
169 const char* GetProgressMessage() const { return this->Message; }
170
174 double GetProgress() const { return this->Progress; }
175 };
176
186 void RegisterProgress(vtkObject* algorithm, const char* message = nullptr);
187
192
193protected:
195 ~vtkView() override;
196
202 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
203
211
216 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
217 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
218
220
224 vtkSetMacro(ReuseSingleRepresentation, bool);
225 vtkGetMacro(ReuseSingleRepresentation, bool);
226 vtkBooleanMacro(ReuseSingleRepresentation, bool);
229
230private:
231 vtkView(const vtkView&) = delete;
232 void operator=(const vtkView&) = delete;
233
234 class vtkImplementation;
235 vtkImplementation* Implementation;
236
237 class Command;
238 friend class Command;
239 Command* Observer;
240
241 class vtkInternal;
242 vtkInternal* Internal;
243};
244
245VTK_ABI_NAMESPACE_END
246#endif
Proxy object to connect input/output ports.
superclass for callback/observer methods
Definition vtkCommand.h:384
general representation of visualization data
The superclass for all representations.
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:49
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:153
double GetProgress() const
Get the progress value in range [0.0, 1.0].
Definition vtkView.h:174
ViewProgressEventCallData(const char *msg, double progress)
Definition vtkView.h:159
const char * GetProgressMessage() const
Get the message.
Definition vtkView.h:169
The superclass for all views.
Definition vtkView.h:46
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition vtkView.h:138
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:216
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:217
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:227
static vtkView * New()