VTK  9.4.20250309
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
34#ifndef vtkView_h
35#define vtkView_h
36
37#include "vtkObject.h"
38#include "vtkViewsCoreModule.h" // For export macro
39#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
40
41VTK_ABI_NAMESPACE_BEGIN
43class vtkCommand;
44class vtkDataObject;
46class vtkSelection;
47class vtkViewTheme;
48
49class VTKVIEWSCORE_EXPORT VTK_MARSHALAUTO vtkView : public vtkObject
50{
51public:
52 static vtkView* New();
53 vtkTypeMacro(vtkView, vtkObject);
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
60
65
75
85
94
103
108
113
118
123
128
133
137 virtual void Update();
138
142 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) {}
143
150
152
157 {
158 const char* Message;
159 double Progress;
161
162 public:
163 ViewProgressEventCallData(const char* msg, double progress)
164 {
165 this->Message = msg;
166 this->Progress = progress;
167 }
168 ~ViewProgressEventCallData() { this->Message = nullptr; }
169
173 const char* GetProgressMessage() const { return this->Message; }
174
178 double GetProgress() const { return this->Progress; }
179 };
180
190 void RegisterProgress(vtkObject* algorithm, const char* message = nullptr);
191
196
197protected:
199 ~vtkView() override;
200
206 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
207
215
220 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
221 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
222
224
228 vtkSetMacro(ReuseSingleRepresentation, bool);
229 vtkGetMacro(ReuseSingleRepresentation, bool);
230 vtkBooleanMacro(ReuseSingleRepresentation, bool);
233
234private:
235 vtkView(const vtkView&) = delete;
236 void operator=(const vtkView&) = delete;
237
238 class vtkImplementation;
239 vtkImplementation* Implementation;
240
241 class Command;
242 friend class Command;
243 Command* Observer;
244
245 class vtkInternal;
246 vtkInternal* Internal;
247};
248
249VTK_ABI_NAMESPACE_END
250#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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
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:157
double GetProgress() const
Get the progress value in range [0.0, 1.0].
Definition vtkView.h:178
ViewProgressEventCallData(const char *msg, double progress)
Definition vtkView.h:163
const char * GetProgressMessage() const
Get the message.
Definition vtkView.h:173
The superclass for all views.
Definition vtkView.h:50
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition vtkView.h:142
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:220
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:221
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:231
static vtkView * New()
#define VTK_MARSHALAUTO