VTK  9.7.20260824
vtkScivisView.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
68
69#ifndef vtkScivisView_h
70#define vtkScivisView_h
71
72#include "vtkNew.h" // For ivars
73#include "vtkObject.h"
74#include "vtkSmartPointer.h" // For ivars
75#include "vtkViewsScivisModule.h" // For export macro
76#include "vtkWrappingHints.h" // For VTK_MARSHALEXCLUDE
77
78VTK_ABI_NAMESPACE_BEGIN
82class vtkLight;
83class vtkLightKit;
86class vtkRenderWindow;
88class vtkRenderer;
90
91class VTKVIEWSSCIVIS_EXPORT vtkScivisView : public vtkObject
92{
93public:
94 static vtkScivisView* New();
95 vtkTypeMacro(vtkScivisView, vtkObject);
96 void PrintSelf(ostream& os, vtkIndent indent) override;
97
106
108
124
126
134 void SetRenderer(vtkRenderer* renderer);
140
142
146 void SetBackground(double r, double g, double b);
148 void SetBackground2(double r, double g, double b);
150 void SetGradientBackground(bool val);
153
155
158 void SetWindowSize(int w, int h);
160 void SetWindowTitle(const char* title);
161 const char* GetWindowTitle();
163
165
173
179
181
190 void SetUseLightKit(bool val);
193
202
204
216 enum
217 {
221 };
222 void SetInteractionMode(int mode);
227
229
250
266
267 void Start();
268
273 virtual void Render();
274
278 virtual void ResetCamera();
279
283 virtual void Update();
284
285protected:
287 ~vtkScivisView() override;
288
292 virtual void PrepareForRendering();
293
299
303 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
304
306
310 virtual void AddRepresentationInternal(vtkScivisRepresentation* vtkNotUsed(rep)) {}
313
316
317private:
318 vtkScivisView(const vtkScivisView&) = delete;
319 void operator=(const vtkScivisView&) = delete;
320
321 class Command;
322 friend class Command;
323 Command* Observer;
324
325 class Internals;
326 Internals* Implementation;
327
328 vtkNew<vtkOrientationMarkerWidget> OrientationWidget;
329 vtkNew<vtkLightKit> LightKit;
330 // The headlight that lights the scene while the light kit is off. Owning one
331 // is what keeps vtkRenderer from inventing its own -- see the constructor.
332 vtkNew<vtkLight> DefaultLight;
334
335 // One instance of each built-in style, so switching modes preserves whatever
336 // the application configured on them.
340 bool UseLightKitFlag;
341 bool FirstRender;
342 int InteractionMode;
343};
344
345VTK_ABI_NAMESPACE_END
346#endif
superclass for callback/observer methods
Definition vtkCommand.h:386
a simple class to control print indentation
Definition vtkIndent.h:108
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
A rubber band interactor for a 3D view.
interactive manipulation of the camera
a simple but quality lighting kit
a virtual light for 3D rendering
Definition vtkLight.h:159
Allocate and hold a VTK object.
Definition vtkNew.h:168
2D widget for manipulating a marker prop
platform-independent render window interaction including picking and frame rate control.
create a window for renderers to draw into
abstract specification for renderers
Something a view shows.
Selection for a vtkScivisView.
void SetRepresentation(vtkScivisRepresentation *rep)
The representations this view shows.
void SetBackground(double r, double g, double b)
Set/Get the background color of the renderer.
vtkRenderWindow * GetRenderWindow()
The renderer, render window and interactor this view draws with.
double * GetBackground2()
Set/Get the background color of the renderer.
virtual void ResetCamera()
Frame the camera on everything the representations are drawing.
void SetWindowTitle(const char *title)
Set/Get the render window size and title.
vtkCommand * GetObserver()
The observer this view listens through.
vtkRenderer * GetRenderer()
The renderer, render window and interactor this view draws with.
vtkOrientationMarkerWidget * GetOrientationMarkerWidget()
The orientation marker widget itself, for its viewport, its marker, and whether the user can move and...
void SetInteractionMode(int mode)
Interaction mode constants.
void SetInteractorStyle(vtkInteractorObserver *style)
Install an interactor style of your own, for interaction the built-in modes do not cover – a 2D or te...
void SetRenderer(vtkRenderer *renderer)
The renderer, render window and interactor this view draws with.
vtkMTimeType GetMTime() override
The view stores its configuration on the renderer, render window, light kit and orientation marker wi...
bool GetGradientBackground()
Set/Get the background color of the renderer.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool GetUseLightKit()
Enable or disable the light kit: a five light rig – key, fill, headlight and two back lights – manage...
vtkLightKit * GetLightKit()
The light kit itself, for its intensity, warmth, angle and ratio parameters.
virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData)
Called for every event the view is observing.
void SetOrientationAxesVisibility(bool val)
Show or hide the orientation axes marker in the lower-left corner of the render window.
void AddRepresentation(vtkScivisRepresentation *rep)
The representations this view shows.
void RemoveAllRepresentations()
The representations this view shows.
friend class Command
void SetGradientBackground(bool val)
Set/Get the background color of the renderer.
int GetNumberOfRepresentations()
The representations this view shows.
vtkScivisSelector * GetSelector()
Selection: how a screen region becomes a selection, whether points or cells come back,...
void SetInteractionModeTo3D()
Interaction mode constants.
bool IsRepresentationPresent(vtkScivisRepresentation *rep)
The representations this view shows.
static vtkScivisView * New()
void SetInteractor(vtkRenderWindowInteractor *interactor)
The renderer, render window and interactor this view draws with.
vtkSmartPointer< vtkRenderer > Renderer
virtual void PrepareForRendering()
Called before every render, once the representations are up to date.
void SetInteractionModeToSelection()
Interaction mode constants.
bool GetOrientationAxesVisibility()
Show or hide the orientation axes marker in the lower-left corner of the render window.
virtual void RemoveRepresentationInternal(vtkScivisRepresentation *rep)
Hooks for subclasses, called after a representation has been accepted or before one is dropped.
int * GetWindowSize()
Set/Get the render window size and title.
void SetUseLightKit(bool val)
Enable or disable the light kit: a five light rig – key, fill, headlight and two back lights – manage...
void SetRenderWindow(vtkRenderWindow *window)
The renderer, render window and interactor this view draws with.
vtkRenderWindowInteractor * GetInteractor()
The renderer, render window and interactor this view draws with.
vtkScivisRepresentation * GetRepresentation(int index=0)
The representations this view shows.
void SetBackground2(double r, double g, double b)
Set/Get the background color of the renderer.
double * GetBackground()
Set/Get the background color of the renderer.
void SetWindowSize(int w, int h)
Set/Get the render window size and title.
const char * GetWindowTitle()
Set/Get the render window size and title.
virtual void Render()
Bring every representation up to date and draw.
int GetInteractionMode()
Interaction mode constants.
vtkInteractorObserver * GetInteractorStyle()
Install an interactor style of your own, for interaction the built-in modes do not cover – a 2D or te...
virtual void AddRepresentationInternal(vtkScivisRepresentation *rep)
Hooks for subclasses, called after a representation has been accepted or before one is dropped.
vtkSmartPointer< vtkRenderWindow > RenderWindow
void RemoveRepresentation(vtkScivisRepresentation *rep)
The representations this view shows.
virtual void Update()
Bring every representation up to date without drawing.
Computes the portion of a dataset which is inside a selection.
Hold a reference to a vtkObjectBase instance.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_SIZEHINT(...)
#define VTK_MARSHAL_EXCLUDE_REASON_NOT_SUPPORTED
#define VTK_MARSHALEXCLUDE(reason)