#include <opennurbs_xform.h>
Public Types | |
enum | { max_clip_plane_count = 16, frustum_bitmask = 0x0000003F, near_plane_bitmask = 0x00000020, far_plane_bitmask = 0x00000010, clip_plane_bitmask = 0x7FFFFFC0, negw_bitmask = 0x80000000 } |
Public Member Functions | |
ON_ClippingRegion () | |
double | ClipPlaneTolerance () const |
bool | GetLineClipPlaneParamters (ON_4dPoint P0, ON_4dPoint P1, double *t0, double *t1) const |
Calculate the interval for the segment of a line that is in the clip plane region. More... | |
int | InClipPlaneRegion (ON_3dPoint P) const |
The "clip plane region" is the convex hull of the planes in the m_clip_plane[] array. These functions determine if some portion of the convex hull of the test points is inside the clip plane region. More... | |
int | InClipPlaneRegion (const ON_BoundingBox &bbox) const |
int | InClipPlaneRegion (int count, const ON_3fPoint *p) const |
int | InClipPlaneRegion (int count, const ON_3dPoint *p) const |
int | InClipPlaneRegion (int count, const ON_4dPoint *p) const |
ON_Xform | InverseObjectToClipTransformation () const |
int | InViewFrustum (ON_3dPoint P) const |
The "view frustum" is the frustum the m_xform transformation maps to clipping coordinate box (-1,+1)^3. These functions determine if some portion of the convex hull of the test points is inside the view frustum. More... | |
int | InViewFrustum (const ON_BoundingBox &bbox) const |
int | InViewFrustum (int count, const ON_3fPoint *p) const |
int | InViewFrustum (int count, const ON_3dPoint *p) const |
int | InViewFrustum (int count, const ON_4dPoint *p) const |
int | IsVisible (ON_3dPoint P) const |
The "visible area" is the intersection of the view frustum, defined by m_xform, and the clipping region, defined by the m_clip_plane[] array. These functions determing if some portion of the convex hull of the test points is visible. More... | |
int | IsVisible (const ON_BoundingBox &bbox) const |
int | IsVisible (int count, const ON_3fPoint *p) const |
int | IsVisible (int count, const ON_3dPoint *p) const |
int | IsVisible (int count, const ON_4dPoint *p) const |
ON_Xform | ObjectToClipTransformation () const |
void | SetClipPlaneTolerance (double clip_plane_tolerance) |
bool | SetObjectToClipTransformation (const class ON_Viewport &viewport) |
Sets the object to clip transformation to the viewport's workd to clip transformation. More... | |
bool | SetObjectToClipTransformation (const ON_Xform object_to_clip_transformation) |
unsigned int | TransformPoint (const ON_4dPoint &P, ON_4dPoint &Q) const |
Transform a pont and return the clipping information. More... | |
unsigned int | TransformPoint (const ON_3dPoint &P, ON_3dPoint &Q) const |
unsigned int | TransformPoint (const ON_3fPoint &P, ON_3dPoint &Q) const |
int | TransformPoints (int count, ON_4dPoint *p) const |
Transform a list of 4d homogenous points while testing for visibility. More... | |
int | TransformPoints (int count, ON_4dPoint *p, unsigned int *pflags) const |
Public Attributes | |
ON_PlaneEquation | m_clip_plane [max_clip_plane_count] |
int | m_clip_plane_count |
anonymous enum |
ON_ClippingRegion::ON_ClippingRegion | ( | ) |
double ON_ClippingRegion::ClipPlaneTolerance | ( | ) | const |
The constructor sets this value to zero. Rhino uses values around 1e-5.
bool ON_ClippingRegion::GetLineClipPlaneParamters | ( | ON_4dPoint | P0, |
ON_4dPoint | P1, | ||
double * | t0, | ||
double * | t1 | ||
) | const |
Calculate the interval for the segment of a line that is in the clip plane region.
P0 | [in] start point |
P1 | [in] end point |
t0 | [out] start parameter |
t1 | [out] end parameter |
int ON_ClippingRegion::InClipPlaneRegion | ( | ON_3dPoint | P | ) | const |
The "clip plane region" is the convex hull of the planes in the m_clip_plane[] array. These functions determine if some portion of the convex hull of the test points is inside the clip plane region.
P | [in] point |
box | [in] bounding box |
count | [in] number of points |
p | [in] array of points |
bEnableClippingPlanes | [in] If true, then the additional clipping planes are tested. If false, then the additional clipping planes are ignored. |
int ON_ClippingRegion::InClipPlaneRegion | ( | const ON_BoundingBox & | bbox | ) | const |
int ON_ClippingRegion::InClipPlaneRegion | ( | int | count, |
const ON_3fPoint * | p | ||
) | const |
int ON_ClippingRegion::InClipPlaneRegion | ( | int | count, |
const ON_3dPoint * | p | ||
) | const |
int ON_ClippingRegion::InClipPlaneRegion | ( | int | count, |
const ON_4dPoint * | p | ||
) | const |
ON_Xform ON_ClippingRegion::InverseObjectToClipTransformation | ( | ) | const |
int ON_ClippingRegion::InViewFrustum | ( | ON_3dPoint | P | ) | const |
The "view frustum" is the frustum the m_xform transformation maps to clipping coordinate box (-1,+1)^3. These functions determine if some portion of the convex hull of the test points is inside the view frustum.
P | [in] point |
box | [in] bounding box |
count | [in] number of points |
p | [in] array of points |
bEnableClippingPlanes | [in] If true, then the additional clipping planes are tested. If false, then the additional clipping planes are ignored. |
int ON_ClippingRegion::InViewFrustum | ( | const ON_BoundingBox & | bbox | ) | const |
int ON_ClippingRegion::InViewFrustum | ( | int | count, |
const ON_3fPoint * | p | ||
) | const |
int ON_ClippingRegion::InViewFrustum | ( | int | count, |
const ON_3dPoint * | p | ||
) | const |
int ON_ClippingRegion::InViewFrustum | ( | int | count, |
const ON_4dPoint * | p | ||
) | const |
int ON_ClippingRegion::IsVisible | ( | ON_3dPoint | P | ) | const |
The "visible area" is the intersection of the view frustum, defined by m_xform, and the clipping region, defined by the m_clip_plane[] array. These functions determing if some portion of the convex hull of the test points is visible.
P | [in] point |
box | [in] bounding box |
count | [in] number of points |
p | [in] array of points |
int ON_ClippingRegion::IsVisible | ( | const ON_BoundingBox & | bbox | ) | const |
int ON_ClippingRegion::IsVisible | ( | int | count, |
const ON_3fPoint * | p | ||
) | const |
int ON_ClippingRegion::IsVisible | ( | int | count, |
const ON_3dPoint * | p | ||
) | const |
int ON_ClippingRegion::IsVisible | ( | int | count, |
const ON_4dPoint * | p | ||
) | const |
ON_Xform ON_ClippingRegion::ObjectToClipTransformation | ( | ) | const |
void ON_ClippingRegion::SetClipPlaneTolerance | ( | double | clip_plane_tolerance | ) |
clip_plane_tolerance | [in] 3d world coordinates tolerance to use when testing objects to see if the planes in m_clip_plane[] hide the objects. |
The constructor sets this value to zero. Rhino uses values around 1e-5.
bool ON_ClippingRegion::SetObjectToClipTransformation | ( | const class ON_Viewport & | viewport | ) |
Sets the object to clip transformation to the viewport's workd to clip transformation.
bool ON_ClippingRegion::SetObjectToClipTransformation | ( | const ON_Xform | object_to_clip_transformation | ) |
unsigned int ON_ClippingRegion::TransformPoint | ( | const ON_4dPoint & | P, |
ON_4dPoint & | Q | ||
) | const |
Transform a pont and return the clipping information.
P | [in] point ot transform |
Q | [out] transformed point |
0 when the point is in the visible region. Otherwise the bits are set to indicate which planes clip the intput point. 0x01 left of the view frusturm 0x02 right of the view frustum 0x04 below the view frustum 0x08 above the view frustum 0x10 behind the view frustum (too far) 0x20 in front of the view frustum (too near)
0x10 below m_clip_plane[0] 0x20 below m_clip_plane[1] ... 0x40000000 below m_clip_plane[24]
0x80000000 transformation created a non-positive weight
unsigned int ON_ClippingRegion::TransformPoint | ( | const ON_3dPoint & | P, |
ON_3dPoint & | Q | ||
) | const |
unsigned int ON_ClippingRegion::TransformPoint | ( | const ON_3fPoint & | P, |
ON_3dPoint & | Q | ||
) | const |
int ON_ClippingRegion::TransformPoints | ( | int | count, |
ON_4dPoint * | p | ||
) | const |
Transform a list of 4d homogenous points while testing for visibility.
count | [in] number of points |
p | [in/out] array of points to test and transform If 0 is returned, some of the points may not be transformed. In all other cases, the output points are transformed by m_xform. |
pflags | [out] 0 when the point is in the visible region. Otherwise the bits are set to indicate which planes clip the intput point. 0x01 left of the view frusturm 0x02 right of the view frustum 0x04 below the view frustum 0x08 above the view frustum 0x10 behind the view frustum (too far) 0x20 in front of the view frustum (too near) |
0x10 below m_clip_plane[0] 0x20 below m_clip_plane[1] ... 0x40000000 below m_clip_plane[24]
0x80000000 transformation created a non-positive weight
int ON_ClippingRegion::TransformPoints | ( | int | count, |
ON_4dPoint * | p, | ||
unsigned int * | pflags | ||
) | const |
ON_PlaneEquation ON_ClippingRegion::m_clip_plane[max_clip_plane_count] |
int ON_ClippingRegion::m_clip_plane_count |