VTK  9.7.20261007
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
70
71#ifndef vtkScivisView_h
72#define vtkScivisView_h
73
74#include "vtkCommand.h" // For the event id
75#include "vtkNew.h" // For ivars
76#include "vtkObject.h"
77#include "vtkSmartPointer.h" // For ivars
78#include "vtkViewsScivisModule.h" // For export macro
79#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
80
81VTK_ABI_NAMESPACE_BEGIN
85class vtkLight;
86class vtkCamera;
87class vtkLightKit;
92class vtkRenderWindow;
94class vtkRenderer;
97
98class VTKVIEWSSCIVIS_EXPORT VTK_MARSHALAUTO vtkScivisView : public vtkObject
99{
100public:
102 vtkTypeMacro(vtkScivisView, vtkObject);
103 void PrintSelf(ostream& os, vtkIndent indent) override;
104
113
115
131
133
141 void SetRenderer(vtkRenderer* renderer);
147
149
153 void SetBackground(double r, double g, double b);
155 void GetBackground(double rgb[3]);
156 void SetBackground2(double r, double g, double b);
158 void GetBackground2(double rgb[3]);
159 void SetGradientBackground(bool val);
162
164
167 void SetWindowSize(int w, int h);
169 void GetWindowSize(int size[2]);
170 void SetWindowTitle(const char* title);
171 const char* GetWindowTitle();
173
175
183
189
191
200 void SetUseLightKit(bool val);
203
212
214
226 enum
227 {
231 };
232 void SetInteractionMode(int mode);
237
239
260
262
274
287
303
317
324
326
354
360 void SetViewDirection(double look[3], double up[3]);
362 double lookX, double lookY, double lookZ, double upX, double upY, double upZ);
363
374 enum
375 {
377 };
378
387 bool GetSceneBounds(double bounds[6]);
388
389 void Start();
390
395 virtual void Render();
396
400 virtual void ResetCamera();
401
405 virtual void Update();
406
407protected:
409 ~vtkScivisView() override;
410
414 virtual void PrepareForRendering();
415
421
425 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
426
428
432 virtual void AddRepresentationInternal(vtkScivisRepresentation* vtkNotUsed(rep)) {}
435
438
439private:
440 vtkScivisView(const vtkScivisView&) = delete;
441 void operator=(const vtkScivisView&) = delete;
442
443 class Command;
444 friend class Command;
445 Command* Observer;
446
447 class Internals;
448 Internals* Implementation;
449
450 vtkNew<vtkOrientationMarkerWidget> OrientationMarkerWidget;
451 vtkNew<vtkLightKit> LightKit;
454
455 // The scene bounds last reported, so that the event fires on a change
456 // rather than on every render.
457 double SceneBounds[6];
458 bool HasSceneBounds;
459 // The headlight that lights the scene while the light kit is off. Owning one
460 // is what keeps vtkRenderer from inventing its own -- see the constructor.
461 vtkNew<vtkLight> DefaultLight;
464
465 // One instance of each built-in style, so switching modes preserves whatever
466 // the application configured on them.
470 bool UseLightKitFlag;
471 bool FirstRender;
472 int InteractionMode;
473};
474
475VTK_ABI_NAMESPACE_END
476#endif
a virtual camera for 3D rendering
Definition vtkCamera.h:151
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
Getting a scene out of a view, as an image or as geometry.
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.
~vtkScivisView() override
void ViewNegativeZ()
Look at the scene from a standard direction and frame it.
void ViewPositiveZ()
Look at the scene from a standard direction and frame it.
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...
vtkScivisExporter * GetExporter()
Getting the scene out: a picture of it, or the geometry in it.
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.
vtkCamera * GetCamera()
The camera the scene is viewed with, for anything finer than the framing and the standard directions ...
void AddRepresentation(vtkScivisRepresentation *rep)
The representations this view shows.
void RemoveAllRepresentations()
The representations this view shows.
friend class Command
void ViewPositiveX()
Look at the scene from a standard direction and frame it.
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.
void ViewPositiveY()
Look at the scene from a standard direction and frame it.
vtkScivisScalarBars * GetScalarBars()
The scalar bars kept for what the representations are drawing: whether they are maintained at all,...
void ViewNegativeY()
Look at the scene from a standard direction and frame it.
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 ViewNegativeX()
Look at the scene from a standard direction and frame it.
void ViewIsometric()
Look at the scene from a standard direction and frame it.
bool GetSceneBounds(double bounds[6])
The extent of what the visible representations are drawing, which is not the same as what the rendere...
void SetUseLightKit(bool val)
Enable or disable the light kit: a five light rig – key, fill, headlight and two back lights – manage...
void SetViewDirection(double look[3], double up[3])
Look along look with up pointing up, and frame the scene.
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_IS_INTERNAL
#define VTK_MARSHAL_EXCLUDE_REASON_NOT_SUPPORTED
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)