25#ifndef _SpVolume_h_Included_
26#define _SpVolume_h_Included_
47 PlaneImpl(
const PlaneImpl &pl2) : m_origin(pl2.m_origin), m_normal(pl2.m_normal), m_dist(pl2.m_dist) { }
50 m_origin = pl2.m_origin; m_normal = pl2.m_normal; m_dist = pl2.m_dist;
69 a = m_normal.
x; b = m_normal.
y; c = m_normal.
z; d = m_dist;
82 if (
source.m_planeValid[npl])
88 double xFov,
double yFov,
bool xFovAsAspect =
false,
bool yFovAsAspect =
false,
89 bool bNearPlane =
false,
double fNearPlane = 0.01,
90 bool bFarPlane =
false,
double fFarPlane = 1.0 );
114 return 2.0 * (len * tan(fov * 0.5));
118 return atan(plane / len * .5) * 2.0;
142 pt[0] = (pl[0] > 0.0) ? max.x : min.x;
143 pt[1] = (pl[1] > 0.0) ? max.y : min.y;
144 pt[2] = (pl[2] > 0.0) ? max.z : min.z;
145 return pl[0] * pt[0] + pl[1] * pt[1] + pl[2] * pt[2] + pl[3] >= -
tol.equalVector();
151 double xFov,
double yFov,
bool xFovAsAspect,
bool yFovAsAspect,
152 bool bNearPlane,
double fNearPlane,
153 bool bFarPlane,
double fFarPlane )
157 double nearPlane_ =
odmax(fNearPlane, 1.0);
158 double planeWidth = 1., planeHeight = 1.;
164 planeWidth = xFov * planeHeight;
166 planeHeight = planeWidth / yFov;
171 OdGePoint3d nearPlane = origin + basisZ * nearPlane_;
174 nearPlane - deltaX - deltaY,
175 nearPlane + deltaX - deltaY,
176 nearPlane + deltaX + deltaY,
177 nearPlane - deltaX + deltaY
183 if (bNearPlane || bFarPlane)
187 m_plane[4].
set(origin + basisZ * fNearPlane, basisZ);
191 m_plane[5].
set(origin + basisZ * fFarPlane, -basisZ);
const OdGePoint3d & maxPoint() const
const OdGePoint3d & minPoint() const
OdGePoint3d & transformBy(const OdGeMatrix3d &xfm)
const OdGeVector3d & asVector() const
bool isZeroLength(const OdGeTol &tol=OdGeContext::gTol) const
OdGeVector3d normal(const OdGeTol &tol=OdGeContext::gTol) const
double dotProduct(const OdGeVector3d &vect) const
OdGeVector3d crossProduct(const OdGeVector3d &vect) const
OdGeVector3d & normalize(const OdGeTol &tol=OdGeContext::gTol)
OdGeVector3d & transformBy(const OdGeMatrix3d &xfm)
void set(const OdGePoint3d &origin, const OdGeVector3d &normal)
PlaneImpl & operator=(const PlaneImpl &pl2)
void transformBy(const OdGeMatrix3d &xfm)
void getCoefficients(double &a, double &b, double &c, double &d) const
PlaneImpl(const PlaneImpl &pl2)
virtual bool contains(const OdGeExtents3d &extents, bool planar=false, const OdGeTol &tol=OdGeContext::gTol) const
static double fovToPlane(double fov, double len)
virtual OdSiShape * clone() const
static double fovFromPlane(double plane, double len)
Volume(const Volume &source)
virtual bool intersects(const OdGeExtents3d &extents, bool planar=false, const OdGeTol &tol=OdGeContext::gTol) const
virtual void transform(const OdGeMatrix3d &mtx)
static bool aabbInsidePlane(const OdGePoint3d &min, const OdGePoint3d &max, const PlaneImpl &plane, const OdGeTol &tol)
static bool planeFromTri(const OdGePoint3d &A, const OdGePoint3d &B, const OdGePoint3d &C, PlaneImpl &pl)
GLsizei GLsizei GLchar * source
static GE_STATIC_EXPORT OdGeTol gTol