VTK  9.7.1
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 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkImplicitBoolean;
32 class vtkPlane;
33 
34 class VTKCOMMONDATAMODEL_EXPORT vtkFrustum : public vtkImplicitFunction
35 {
36 public:
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 
87 protected:
88  vtkFrustum();
89  ~vtkFrustum() override;
90 
91 private:
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 
115  vtkNew<vtkImplicitBoolean> BooleanOp;
116 };
117 
118 VTK_ABI_NAMESPACE_END
119 #endif
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkPlane * GetBottomPlane()
Get individual planes that make up the frustum.
Definition: vtkFrustum.h:81
implicit function consisting of boolean combinations of implicit functions
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
implicit function for a frustum
Definition: vtkFrustum.h:34
a simple class to control print indentation
Definition: vtkIndent.h:28
perform various plane computations
Definition: vtkPlane.h:31
vtkPlane * GetNearPlane()
Get individual planes that make up the frustum.
Definition: vtkFrustum.h:84
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkPlane * GetRightPlane()
Get individual planes that make up the frustum.
Definition: vtkFrustum.h:82
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.