VTK  9.5.2
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
30
31#ifndef vtkView_h
32#define vtkView_h
33
34#include "vtkObject.h"
35#include "vtkViewsCoreModule.h" // For export macro
36#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
37
38VTK_ABI_NAMESPACE_BEGIN
40class vtkCommand;
41class vtkDataObject;
43class vtkSelection;
44class vtkViewTheme;
45
46class VTKVIEWSCORE_EXPORT VTK_MARSHALAUTO vtkView : public vtkObject
47{
48public:
49 static vtkView* New();
50 vtkTypeMacro(vtkView, vtkObject);
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
57
62
72
82
91
100
105
110
115
120
125
130
134 virtual void Update();
135
139 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) {}
140
147
149
154 {
155 const char* Message;
156 double Progress;
158
159 public:
160 ViewProgressEventCallData(const char* msg, double progress)
161 {
162 this->Message = msg;
163 this->Progress = progress;
164 }
165 ~ViewProgressEventCallData() { this->Message = nullptr; }
166
170 const char* GetProgressMessage() const { return this->Message; }
171
175 double GetProgress() const { return this->Progress; }
176 };
177
187 void RegisterProgress(vtkObject* algorithm, const char* message = nullptr);
188
193
194protected:
196 ~vtkView() override;
197
203 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
204
212
217 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
218 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
219
221
225 vtkSetMacro(ReuseSingleRepresentation, bool);
226 vtkGetMacro(ReuseSingleRepresentation, bool);
227 vtkBooleanMacro(ReuseSingleRepresentation, bool);
230
231private:
232 vtkView(const vtkView&) = delete;
233 void operator=(const vtkView&) = delete;
234
235 class vtkImplementation;
236 vtkImplementation* Implementation;
237
238 class Command;
239 friend class Command;
240 Command* Observer;
241
242 class vtkInternal;
243 vtkInternal* Internal;
244};
245
246VTK_ABI_NAMESPACE_END
247#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
data object that represents a "selection" in VTK.
Sets theme colors for a graphical view.
double GetProgress() const
Get the progress value in range [0.0, 1.0].
Definition vtkView.h:175
ViewProgressEventCallData(const char *msg, double progress)
Definition vtkView.h:160
const char * GetProgressMessage() const
Get the message.
Definition vtkView.h:170
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition vtkView.h:139
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:217
friend class Command
Definition vtkView.h:239
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:218
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:228
static vtkView * New()
#define VTK_MARSHALAUTO