VTK: Views/Core/vtkView.h Source File

| VTK 9.3.1

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
40 VTK_ABI_NAMESPACE_BEGIN
41 class vtkAlgorithmOutput;
42 class vtkCommand;
43 class vtkDataObject;
44 class vtkDataRepresentation;
45 class vtkSelection;
46 class vtkViewTheme;
47
48 class VTKVIEWSCORE_EXPORT vtkView : public vtkObject
49 {
50 public:
51 static vtkView* New();
52 vtkTypeMacro(vtkView, vtkObject);
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
58 void AddRepresentation(vtkDataRepresentation* rep);
59
63 void SetRepresentation(vtkDataRepresentation* rep);
64
73 vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
74
83 vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
84
92 vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input);
93
101 vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input);
102
106 void RemoveRepresentation(vtkDataRepresentation* rep);
107
111 void RemoveRepresentation(vtkAlgorithmOutput* rep);
112
116 void RemoveAllRepresentations();
117
121 int GetNumberOfRepresentations();
122
126 vtkDataRepresentation* GetRepresentation(int index = 0);
127
131 bool IsRepresentationPresent(vtkDataRepresentation* rep);
132
136 virtual void Update();
137
141 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) {}
142
148 vtkCommand* GetObserver();
149
151
155 class ViewProgressEventCallData
156 {
157 const char* Message;
158 double Progress;
160
161 public:
162 ViewProgressEventCallData(const char* msg, double progress)
163 {
164 this->Message = msg;
165 this->Progress = progress;
166 }
167 ~ViewProgressEventCallData() { this->Message = nullptr; }
168
172 const char* GetProgressMessage() const { return this->Message; }
173
177 double GetProgress() const { return this->Progress; }
178 };
179
189 void RegisterProgress(vtkObject* algorithm, const char* message = nullptr);
190
194 void UnRegisterProgress(vtkObject* algorithm);
195
196 protected:
197 vtkView();
198 ~vtkView() override;
199
205 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
206
213 virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
214
219 virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
220 virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
221
223
227 vtkSetMacro(ReuseSingleRepresentation, bool);
228 vtkGetMacro(ReuseSingleRepresentation, bool);
229 vtkBooleanMacro(ReuseSingleRepresentation, bool);
230 bool ReuseSingleRepresentation;
232
233 private:
234 vtkView(const vtkView&) = delete;
235 void operator=(const vtkView&) = delete;
236
237 class vtkImplementation;
238 vtkImplementation* Implementation;
239
240 class Command;
241 friend class Command;
242 Command* Observer;
243
244 class vtkInternal;
245 vtkInternal* Internal;
246 };
247
248 VTK_ABI_NAMESPACE_END
249 #endif
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:41
vtkCommand
superclass for callback/observer methods
Definition: vtkCommand.h:384
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkDataRepresentation
The superclass for all representations.
Definition: vtkDataRepresentation.h:58
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkSelection
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:59
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:43
vtkView::ViewProgressEventCallData
A ptr to an instance of ViewProgressEventCallData is provided in the call data when vtkCommand::ViewP...
Definition: vtkView.h:156
vtkView::ViewProgressEventCallData::GetProgress
double GetProgress() const
Get the progress value in range [0.0, 1.0].
Definition: vtkView.h:177
vtkView::ViewProgressEventCallData::~ViewProgressEventCallData
~ViewProgressEventCallData()
Definition: vtkView.h:167
vtkView::ViewProgressEventCallData::ViewProgressEventCallData
ViewProgressEventCallData(const char *msg, double progress)
Definition: vtkView.h:162
vtkView::ViewProgressEventCallData::GetProgressMessage
const char * GetProgressMessage() const
Get the message.
Definition: vtkView.h:172
vtkView
The superclass for all views.
Definition: vtkView.h:49
vtkView::ApplyViewTheme
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition: vtkView.h:141
vtkView::AddRepresentationFromInputConnection
vtkDataRepresentation * AddRepresentationFromInputConnection(vtkAlgorithmOutput *conn)
Convenience method which creates a simple representation with the connection and adds it to the view.
vtkView::New
static vtkView * New()
vtkView::RemoveRepresentation
void RemoveRepresentation(vtkAlgorithmOutput *rep)
Removes any representation with this connection from the view.
vtkView::UnRegisterProgress
void UnRegisterProgress(vtkObject *algorithm)
Unregister objects previously registered with RegisterProgress.
vtkView::AddRepresentationFromInput
vtkDataRepresentation * AddRepresentationFromInput(vtkDataObject *input)
Convenience method which creates a simple representation with the specified input and adds it to the ...
vtkView::Update
virtual void Update()
Update the view.
vtkView::CreateDefaultRepresentation
virtual vtkDataRepresentation * CreateDefaultRepresentation(vtkAlgorithmOutput *conn)
Create a default vtkDataRepresentation for the given vtkAlgorithmOutput.
vtkView::SetRepresentationFromInputConnection
vtkDataRepresentation * SetRepresentationFromInputConnection(vtkAlgorithmOutput *conn)
Convenience method which sets the representation with the connection and adds it to the view.
vtkView::AddRepresentationInternal
virtual void AddRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Subclass "hooks" for notifying subclasses of vtkView when representations are added or removed.
Definition: vtkView.h:219
vtkView::GetRepresentation
vtkDataRepresentation * GetRepresentation(int index=0)
The representation at a specified index.
vtkView::ProcessEvents
virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData)
Called to process events.
vtkView::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkView::RegisterProgress
void RegisterProgress(vtkObject *algorithm, const char *message=nullptr)
Meant for use by subclasses and vtkRepresentation subclasses.
vtkView::~vtkView
~vtkView() override
Meant for use by subclasses and vtkRepresentation subclasses.
vtkView::GetNumberOfRepresentations
int GetNumberOfRepresentations()
Returns the number of representations from first port(0) in this view.
vtkView::RemoveAllRepresentations
void RemoveAllRepresentations()
Removes all representations from the view.
vtkView::SetRepresentationFromInput
vtkDataRepresentation * SetRepresentationFromInput(vtkDataObject *input)
Convenience method which sets the representation to the specified input and adds it to the view.
vtkView::vtkView
vtkView()
Meant for use by subclasses and vtkRepresentation subclasses.
vtkView::RemoveRepresentationInternal
virtual void RemoveRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Meant for use by subclasses and vtkRepresentation subclasses.
Definition: vtkView.h:220
vtkView::SetRepresentation
void SetRepresentation(vtkDataRepresentation *rep)
Set the representation to the view.
vtkView::RemoveRepresentation
void RemoveRepresentation(vtkDataRepresentation *rep)
Removes the representation from the view.
vtkView::IsRepresentationPresent
bool IsRepresentationPresent(vtkDataRepresentation *rep)
Check to see if a representation is present in the view.
vtkView::GetObserver
vtkCommand * GetObserver()
Returns the observer that the subclasses can use to listen to additional events.
vtkView::AddRepresentation
void AddRepresentation(vtkDataRepresentation *rep)
Adds the representation to the view.
vtkView::ReuseSingleRepresentation
bool ReuseSingleRepresentation
Meant for use by subclasses and vtkRepresentation subclasses.
Definition: vtkView.h:229
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkX3D::progress
@ progress
Definition: vtkX3D.h:452
vtkObject.h