VTK
vtkBox.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBox.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
33 #ifndef vtkBox_h
34 #define vtkBox_h
35 
36 #include "vtkCommonDataModelModule.h" // For export macro
37 #include "vtkImplicitFunction.h"
38 class vtkBoundingBox;
39 
41 {
42 public:
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
47  static vtkBox *New();
48 
50 
51  double EvaluateFunction(double x[3]);
52  double EvaluateFunction(double x, double y, double z)
53  {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); }
55 
57  void EvaluateGradient(double x[3], double n[3]);
58 
60 
61  void SetXMin(double p[3]);
62  void SetXMin(double x, double y, double z);
63  void GetXMin(double p[3]);
64  void GetXMin(double &x, double &y, double &z);
66 
67  void SetXMax(double p[3]);
68  void SetXMax(double x, double y, double z);
69  void GetXMax(double p[3]);
70  void GetXMax(double &x, double &y, double &z);
71 
72  void SetBounds(double xMin, double xMax,
73  double yMin, double yMax,
74  double zMin, double zMax);
75  void SetBounds(const double bounds[6]);
76  void GetBounds(double &xMin, double &xMax,
77  double &yMin, double &yMax,
78  double &zMin, double &zMax);
79  void GetBounds(double bounds[6]);
80  double *GetBounds();
81 
86  void AddBounds(const double bounds[6]);
87 
89 
96  static char IntersectBox(double bounds[6], double origin[3], double dir[3],
97  double coord[3], double& t);
99 
101 
111  static int IntersectWithLine(const double bounds[6],
112  const double p1[3], const double p2[3],
113  double &t1, double &t2,
114  double x1[3], double x2[3],
115  int &plane1, int &plane2);
117 
118 protected:
121 
123  double Bounds[6]; //supports the GetBounds() method
124 
125 private:
126  vtkBox(const vtkBox&); // Not implemented.
127  void operator=(const vtkBox&); // Not implemented.
128 };
129 
130 
131 
132 inline void vtkBox::SetXMin(double p[3])
133 {
134  this->SetXMin(p[0], p[1], p[2]);
135 }
136 
137 inline void vtkBox::SetXMax(double p[3])
138 {
139  this->SetXMax(p[0], p[1], p[2]);
140 }
141 
142 
143 #endif
144 
145 
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkBox::SetBounds
void SetBounds(const double bounds[6])
vtkCommonDataModelModule.h
vtkBox::SetXMin
void SetXMin(double p[3])
Definition: vtkBox.h:132
vtkBox::SetXMin
void SetXMin(double x, double y, double z)
vtkImplicitFunction::EvaluateFunction
virtual double EvaluateFunction(double x[3])=0
vtkBox::GetXMax
void GetXMax(double &x, double &y, double &z)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
vtkBox::GetXMax
void GetXMax(double p[3])
vtkX3D::dir
@ dir
Definition: vtkX3D.h:324
vtkBox::GetBounds
void GetBounds(double &xMin, double &xMax, double &yMin, double &yMax, double &zMin, double &zMax)
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkgl::coord
GLuint coord
Definition: vtkgl.h:16713
vtkBox::IntersectWithLine
static int IntersectWithLine(const double bounds[6], const double p1[3], const double p2[3], double &t1, double &t2, double x1[3], double x2[3], int &plane1, int &plane2)
vtkBox::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkBox::GetXMin
void GetXMin(double p[3])
vtkBox::SetXMax
void SetXMax(double p[3])
Definition: vtkBox.h:137
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:58
vtkBox::vtkBox
vtkBox()
vtkBoundingBox
Fast Simple Class for dealing with 3D bounds.
Definition: vtkBoundingBox.h:35
vtkBox::BBox
vtkBoundingBox * BBox
Definition: vtkBox.h:122
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkBox::GetBounds
double * GetBounds()
vtkBox::EvaluateFunction
double EvaluateFunction(double x[3])
vtkBox::New
static vtkBox * New()
vtkBox::EvaluateGradient
void EvaluateGradient(double x[3], double n[3])
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:41
vtkBox::~vtkBox
~vtkBox()
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkBox::EvaluateFunction
double EvaluateFunction(double x, double y, double z)
Definition: vtkBox.h:52
vtkImplicitFunction.h
vtkBox::SetXMax
void SetXMax(double x, double y, double z)
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkBox::IntersectBox
static char IntersectBox(double bounds[6], double origin[3], double dir[3], double coord[3], double &t)
vtkBox::SetBounds
void SetBounds(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
vtkBox::GetXMin
void GetXMin(double &x, double &y, double &z)
vtkBox::AddBounds
void AddBounds(const double bounds[6])
vtkBox::GetBounds
void GetBounds(double bounds[6])