4#ifndef vtkImplicitFrustumRepresentation_h
5#define vtkImplicitFrustumRepresentation_h
9#include "vtkInteractionWidgetsModule.h"
13VTK_ABI_NAMESPACE_BEGIN
125 vtkGetMacro(AlongXAxis,
bool);
126 vtkBooleanMacro(AlongXAxis,
bool);
128 vtkGetMacro(AlongYAxis,
bool);
129 vtkBooleanMacro(AlongYAxis,
bool);
131 vtkGetMacro(AlongZAxis,
bool);
132 vtkBooleanMacro(AlongZAxis,
bool);
142 vtkGetMacro(DrawFrustum,
bool);
143 vtkBooleanMacro(DrawFrustum,
bool);
243 enum class FrustumFace
264 vtkNew<vtkPolyData> PolyData;
265 vtkNew<vtkTubeFilter> Tuber;
266 vtkNew<vtkPolyDataMapper> Mapper;
267 vtkNew<vtkActor> Actor;
274 vtkNew<vtkEllipseArcSource> Source;
275 vtkNew<vtkTubeFilter> Tuber;
276 vtkNew<vtkPolyDataMapper> Mapper;
277 vtkNew<vtkActor> Actor;
282 vtkImplicitFrustumRepresentation(
const vtkImplicitFrustumRepresentation&) =
delete;
283 void operator=(
const vtkImplicitFrustumRepresentation&) =
delete;
286 vtkVector3d GetForwardAxis();
287 vtkVector3d GetUpAxis();
288 vtkVector3d GetRightAxis();
290 void HighlightOriginHandle(
bool highlight);
291 void HighlightFarPlaneVerticalHandle(
bool highlight);
292 void HighlightFarPlaneHorizontalHandle(
bool highlight);
293 void HighlightNearPlaneHandle(
bool highlight);
294 void HighlightRollHandle(
bool highlight);
295 void HighlightYawHandle(
bool highlight);
296 void HighlightPitchHandle(
bool highlight);
299 void TranslateOrigin(
const vtkVector3d& p1,
const vtkVector3d& p2);
300 void TranslateOriginOnAxis(
const vtkVector3d& p1,
const vtkVector3d& p2);
301 void AdjustHorizontalAngle(
const vtkVector3d& p1,
const vtkVector3d& p2);
302 void AdjustVerticalAngle(
const vtkVector3d& p1,
const vtkVector3d& p2);
303 void AdjustNearPlaneDistance(
304 const vtkVector2d& eventPosition,
const vtkVector3d& p1,
const vtkVector3d& p2);
306 const vtkVector3d& prevPickPoint,
const vtkVector3d& pickPoint,
const vtkVector3d& axis);
309 void UpdateFrustumTransform();
318 vtkNew<vtkFrustum> Frustum;
320 InteractionStateType RepresentationState = InteractionStateType::Outside;
323 vtkVector3d LastEventPosition = { 0., 0., 0. };
325 bool AlongXAxis =
false;
326 bool AlongYAxis =
false;
327 bool AlongZAxis =
false;
331 vtkVector3d Origin = { 0, 0, 0 };
332 vtkNew<vtkTransform> OrientationTransform;
334 vtkNew<vtkPolyData> FrustumPD;
335 vtkNew<vtkPolyDataMapper> FrustumMapper;
336 vtkNew<vtkActor> FrustumActor;
337 bool DrawFrustum =
true;
339 std::array<EdgeHandle, 4> FarPlaneHandles;
340 EdgeHandle NearPlaneEdgesHandle;
341 SphereHandle NearPlaneCenterHandle;
342 EllipseHandle RollHandle;
343 EllipseHandle YawHandle;
344 EllipseHandle PitchHandle;
345 SphereHandle OriginHandle;
347 FrustumFace ActiveEdgeHandle = FrustumFace::None;
349 vtkNew<vtkCellPicker> Picker;
350 vtkNew<vtkCellPicker> FrustumPicker;
353 vtkNew<vtkProperty> FrustumProperty;
354 vtkNew<vtkProperty> EdgeHandleProperty;
355 vtkNew<vtkProperty> SelectedEdgeHandleProperty;
356 vtkNew<vtkProperty> OriginHandleProperty;
357 vtkNew<vtkProperty> SelectedOriginHandleProperty;
359 vtkNew<vtkBox> BoundingBox;
represents an object (geometry & properties) in a rendered scene
implicit function for a bounding box
ray-cast cell picker for all kinds of Prop3Ds
implicit function for a frustum
virtual void SetRepresentationState(InteractionStateType)
Sets the visual appearance of the representation based on the state it is in.
void SetVerticalAngle(double angle)
Get/Set the vertical angle of the frustum in degrees.
void SetHandleColor(double, double, double)
Set the color of all the widgets handles (origin, orientations, near plane and angles) and their colo...
void GetActors(vtkPropCollection *pc) override
Methods supporting the rendering process.
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting the rendering process.
int ComputeInteractionState(int X, int Y, int modify=0) override
Methods to interface with the vtkImplicitFrustumWidget.
void SetNearPlaneDistance(double angle)
Get/Set the near plane distance of the frustum, i.e.
~vtkImplicitFrustumRepresentation() override
void SetForegroundColor(double, double, double)
Set the color of all the widgets handles (origin, orientations, near plane and angles) and their colo...
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Methods supporting the rendering process.
void SetOrigin(double x, double y, double z)
Get the origin of the frustum representation.
void GetFrustum(vtkFrustum *frustum) const
Get the concrete represented frustum.
void EndWidgetInteraction(double newEventPos[2]) override
Methods to interface with the vtkImplicitFrustumWidget.
static vtkImplicitFrustumRepresentation * New()
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkImplicitFrustumWidget.
double GetVerticalAngle() const
Get/Set the vertical angle of the frustum in degrees.
void GetPolyData(vtkPolyData *pd)
Grab the polydata that defines the frustum.
void SetAlongZAxis(bool)
Force the frustum widget to be aligned with one of the x-y-z axes.
void SetOrigin(double x[3])
Get the origin of the frustum representation.
double * GetOrigin()
Get the origin of the frustum representation.
void SetAlongYAxis(bool)
Force the frustum widget to be aligned with one of the x-y-z axes.
void SetOrientation(double x, double y, double z)
Get/Set the orientation of the frustum.
void WidgetInteraction(double newEventPos[2]) override
Methods to interface with the vtkImplicitFrustumWidget.
double * GetOrientation()
Get/Set the orientation of the frustum.
vtkImplicitFrustumRepresentation()
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods supporting the rendering process.
void StartWidgetInteraction(double eventPos[2]) override
Methods to interface with the vtkImplicitFrustumWidget.
void SetInteractionColor(double, double, double)
Set the color of all the widgets handles (origin, orientations, near plane and angles) and their colo...
double GetNearPlaneDistance() const
Get/Set the near plane distance of the frustum, i.e.
void SetInteractionColor(double c[3])
Set the color of all the widgets handles (origin, orientations, near plane and angles) and their colo...
void SetDrawFrustum(bool draw)
Enable/disable the drawing of the frustum.
@ AdjustingHorizontalAngle
@ AdjustingNearPlaneDistance
@ TranslatingOriginOnAxis
void BuildRepresentation() override
Methods to interface with the vtkImplicitFrustumWidget.
double * GetBounds() override
Methods supporting the rendering process.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
void SetForegroundColor(double c[3])
Set the color of all the widgets handles (origin, orientations, near plane and angles) and their colo...
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
double GetHorizontalAngle() const
Get/Set the horizontal angle of the frustum in degrees.
void UpdatePlacement()
Satisfies the superclass API.
void SetHorizontalAngle(double angle)
Get/Set the horizontal angle of the frustum in degrees.
void SetOrigin(const vtkVector3d &xyz)
Get the origin of the frustum representation.
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting the rendering process.
void SetHandleColor(double c[3])
Set the color of all the widgets handles (origin, orientations, near plane and angles) and their colo...
void SetAlongXAxis(bool)
Force the frustum widget to be aligned with one of the x-y-z axes.
a simple class to control print indentation
create a line defined by two end points
Allocate and hold a VTK object.
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
represent surface properties of a geometric object
create a polygonal sphere centered at the origin
filter that generates tubes around lines
abstract specification for Viewports
window superclass for vtkRenderWindow
#define VTK_SIZEHINT(...)