VTK  9.4.20241221
vtkFrustum.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
23#ifndef vtkFrustum_h
24#define vtkFrustum_h
25
26#include "vtkCommonDataModelModule.h" // For export macro
27#include "vtkImplicitFunction.h"
28#include "vtkNew.h" // For vtkNew
29
30VTK_ABI_NAMESPACE_BEGIN
32class vtkPlane;
33
34class VTKCOMMONDATAMODEL_EXPORT vtkFrustum : public vtkImplicitFunction
35{
36public:
37 static vtkFrustum* New();
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42 double EvaluateFunction(double x[3]) override;
43
45 void EvaluateGradient(double x[3], double g[3]) override;
46
48
52 vtkGetMacro(NearPlaneDistance, double)
53 void SetNearPlaneDistance(double distance);
55
57
61 vtkGetMacro(HorizontalAngle, double)
62 void SetHorizontalAngle(double angleInDegrees);
64
66
70 vtkGetMacro(VerticalAngle, double)
71 void SetVerticalAngle(double angleInDegrees);
73
75
80 vtkPlane* GetTopPlane() { return this->TopPlane; }
81 vtkPlane* GetBottomPlane() { return this->BottomPlane; }
82 vtkPlane* GetRightPlane() { return this->RightPlane; }
83 vtkPlane* GetLeftPlane() { return this->LeftPlane; }
84 vtkPlane* GetNearPlane() { return this->NearPlane; }
86
87protected:
89 ~vtkFrustum() override;
90
91private:
92 vtkFrustum(const vtkFrustum&) = delete;
93 void operator=(const vtkFrustum&) = delete;
94
96
101 void CalculateHorizontalPlanesNormal();
102 void CalculateVerticalPlanesNormal();
104
105 double NearPlaneDistance = 0.5;
106 double VerticalAngle = 30;
107 double HorizontalAngle = 30;
108
109 vtkNew<vtkPlane> NearPlane;
110 vtkNew<vtkPlane> BottomPlane;
111 vtkNew<vtkPlane> TopPlane;
112 vtkNew<vtkPlane> RightPlane;
113 vtkNew<vtkPlane> LeftPlane;
114
116};
117
118VTK_ABI_NAMESPACE_END
119#endif
implicit function for a frustum
Definition vtkFrustum.h:35
static vtkFrustum * New()
vtkPlane * GetBottomPlane()
Get individual planes that make up the frustum.
Definition vtkFrustum.h:81
vtkPlane * GetNearPlane()
Get individual planes that make up the frustum.
Definition vtkFrustum.h:84
vtkPlane * GetLeftPlane()
Get individual planes that make up the frustum.
Definition vtkFrustum.h:83
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double EvaluateFunction(double x[3]) override
Evaluate function at position x-y-z and return value.
vtkPlane * GetRightPlane()
Get individual planes that make up the frustum.
Definition vtkFrustum.h:82
void EvaluateGradient(double x[3], double g[3]) override
Evaluate function gradient at position x-y-z and pass back vector.
~vtkFrustum() override
implicit function consisting of boolean combinations of implicit functions
abstract interface for implicit functions
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
a simple class to control print indentation
Definition vtkIndent.h:108
Allocate and hold a VTK object.
Definition vtkNew.h:167
perform various plane computations
Definition vtkPlane.h:138