VTK  9.7.20260916
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
69
70#ifndef vtkScivisView_h
71#define vtkScivisView_h
72
73#include "vtkNew.h" // For ivars
74#include "vtkObject.h"
75#include "vtkSmartPointer.h" // For ivars
76#include "vtkViewsScivisModule.h" // For export macro
77#include "vtkWrappingHints.h" // For VTK_MARSHALEXCLUDE
78
79VTK_ABI_NAMESPACE_BEGIN
83class vtkLight;
84class vtkLightKit;
88class vtkRenderWindow;
90class vtkRenderer;
93
94class VTKVIEWSSCIVIS_EXPORT vtkScivisView : public vtkObject
95{
96public:
97 static vtkScivisView* New();
98 vtkTypeMacro(vtkScivisView, vtkObject);
99 void PrintSelf(ostream& os, vtkIndent indent) override;
100
109
111
127
129
137 void SetRenderer(vtkRenderer* renderer);
143
145
149 void SetBackground(double r, double g, double b);
151 void SetBackground2(double r, double g, double b);
153 void SetGradientBackground(bool val);
156
158
161 void SetWindowSize(int w, int h);
163 void SetWindowTitle(const char* title);
164 const char* GetWindowTitle();
166
168
176
182
184
193 void SetUseLightKit(bool val);
196
205
207
219 enum
220 {
224 };
225 void SetInteractionMode(int mode);
230
232
253
255
267
279
295
296 void Start();
297
302 virtual void Render();
303
307 virtual void ResetCamera();
308
312 virtual void Update();
313
314protected:
316 ~vtkScivisView() override;
317
321 virtual void PrepareForRendering();
322
328
332 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
333
335
339 virtual void AddRepresentationInternal(vtkScivisRepresentation* vtkNotUsed(rep)) {}
342
345
346private:
347 vtkScivisView(const vtkScivisView&) = delete;
348 void operator=(const vtkScivisView&) = delete;
349
350 class Command;
351 friend class Command;
352 Command* Observer;
353
354 class Internals;
355 Internals* Implementation;
356
357 vtkNew<vtkOrientationMarkerWidget> OrientationWidget;
358 vtkNew<vtkLightKit> LightKit;
361 // The headlight that lights the scene while the light kit is off. Owning one
362 // is what keeps vtkRenderer from inventing its own -- see the constructor.
363 vtkNew<vtkLight> DefaultLight;
365
366 // One instance of each built-in style, so switching modes preserves whatever
367 // the application configured on them.
371 bool UseLightKitFlag;
372 bool FirstRender;
373 int InteractionMode;
374};
375
376VTK_ABI_NAMESPACE_END
377#endif
superclass for callback/observer methods
Definition vtkCommand.h:387
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
Keeps one lookup table per array name.
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.
The scalar bars a view keeps for what it is drawing.
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.
void SetLookupTableManager(vtkLookupTableManager *manager)
The lookup tables the view colors through, keyed by array name.
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.
vtkLookupTableManager * GetLookupTableManager()
The lookup tables the view colors through, keyed by array name.
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.
vtkScivisScalarBars * GetScalarBars()
The scalar bars kept for what the representations are drawing: whether they are maintained at all,...
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)