VTK  9.4.20250201
vtkLightRepresentation.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
19#ifndef vtkLightRepresentation_h
20#define vtkLightRepresentation_h
21
22#include "vtkInteractionWidgetsModule.h" // For export macro
23#include "vtkNew.h" // Needed for vtkNew
25#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkActor;
29class vtkBox;
30class vtkCellPicker;
31class vtkConeSource;
32class vtkLineSource;
35class vtkProperty;
36class vtkSphereSource;
37
38class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkLightRepresentation
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
47
50 vtkSetMacro(Positional, bool);
51 vtkGetMacro(Positional, bool);
52 vtkBooleanMacro(Positional, bool);
54
56
59 void SetLightPosition(double pos[3]);
60 vtkGetVector3Macro(LightPosition, double);
62
64
67 void SetFocalPoint(double pos[3]);
68 vtkGetVector3Macro(FocalPoint, double);
70
72
76 void SetConeAngle(double angle);
77 vtkGetMacro(ConeAngle, double);
79
81
84 void SetLightColor(double* color);
87
91 enum
92 {
93 Outside = 0,
97 ScalingConeAngle
98 };
99
101
110 vtkSetClampMacro(InteractionState, int, Outside, ScalingConeAngle);
112
114
117 vtkGetObjectMacro(Property, vtkProperty);
119
121
124 void BuildRepresentation() override;
125 int ComputeInteractionState(int X, int Y, int modify = 0) override;
126 void StartWidgetInteraction(double eventPosition[2]) override;
127 void WidgetInteraction(double eventPosition[2]) override;
128 double* GetBounds() override;
130
132
136 int RenderOpaqueGeometry(vtkViewport* viewport) override;
139
146
147protected:
150
151 virtual void SizeHandles();
152 virtual void UpdateSources();
153 virtual void ScaleConeAngle(double* pickPoint, double* lastPickPoint);
154
158 double LastScalingDistance2 = -1;
159 double LastEventPosition[3] = { 0, 0, 0 };
160
161 // the Sphere
166
167 // the Cone
172
173 // the Line
178
179 double LightPosition[3] = { 0, 0, 1 };
180 double FocalPoint[3] = { 0, 0, 0 };
181 double ConeAngle = 30;
182 bool Positional = false;
183
184private:
186 void operator=(const vtkLightRepresentation&) = delete;
187};
188
189VTK_ABI_NAMESPACE_END
190#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
implicit function for a bounding box
Definition vtkBox.h:110
ray-cast cell picker for all kinds of Prop3Ds
generate polygonal cone
a simple class to control print indentation
Definition vtkIndent.h:108
virtual void ScaleConeAngle(double *pickPoint, double *lastPickPoint)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetLightColor()
Set/Get the light color.
int ComputeInteractionState(int X, int Y, int modify=0) override
Method to satisfy superclasses' API.
vtkNew< vtkPolyDataMapper > ConeMapper
vtkNew< vtkPolyDataMapper > SphereMapper
void BuildRepresentation() override
Method to satisfy superclasses' API.
void SetConeAngle(double angle)
Set/Get the cone angle, in degrees, for the light.
void SetFocalPoint(double pos[3])
Set/Get the coordinates of the focal point of the light representation.
vtkNew< vtkCellPicker > LinePicker
vtkNew< vtkCellPicker > SpherePicker
vtkNew< vtkCellPicker > ConePicker
static vtkLightRepresentation * New()
void SetLightPosition(double pos[3])
Set/Get the coordinates of the position of the light representation.
void ReleaseGraphicsResources(vtkWindow *w) override
Methods required by vtkProp superclass.
vtkNew< vtkConeSource > Cone
void SetLightColor(double *color)
Set/Get the light color.
virtual void SizeHandles()
double * GetBounds() override
Method to satisfy superclasses' API.
void WidgetInteraction(double eventPosition[2]) override
Method to satisfy superclasses' API.
vtkNew< vtkPolyDataMapper > LineMapper
void StartWidgetInteraction(double eventPosition[2]) override
Method to satisfy superclasses' API.
virtual void UpdateSources()
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
vtkNew< vtkLineSource > Line
vtkNew< vtkProperty > Property
~vtkLightRepresentation() override
vtkNew< vtkSphereSource > Sphere
void GetActors(vtkPropCollection *) override
These methods are necessary to make this representation behave as a vtkProp (i.e.,...
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods required by vtkProp superclass.
create a line defined by two end points
Allocate and hold a VTK object.
Definition vtkNew.h:167
represent the position of a point in 3D space
map vtkPolyData to graphics primitives
an ordered list of Props
represent surface properties of a geometric object
create a polygonal sphere centered at the origin
abstract specification for Viewports
Definition vtkViewport.h:65
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO