Rhino C++ API  8.6
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
ON_DepthImage Class Reference

#include <opennurbs_plus_idimage.h>

Public Types

enum  CLIP_STATUS : unsigned int {
  unset = 0, unset = 0, xmin_clip = 0x01, xmax_clip = 0x02,
  ymin_clip = 0x04, ymax_clip = 0x08, zfar_clip = 0x10, znear_clip = 0x20,
  zbehind_clip = 0x40, xyz_mask = 0x7F, degenerate = 0x80, xyzd_mask = 0xFF,
  infrus = 0x100, liminal = 0x200, ignored = 0x400, frustum_clip_mask = 0x1FF,
  visibility_status_mask = 0x700, tridir_unset = 0x1000, tridir_none = 0x2000, tridir_ccw = 0x4000,
  tridir_cw = 0x8000, tridir_status_mask = 0xF000, custom_clip_1 = 0x00010000, custom_clip_2 = 0x00020000,
  custom_clip_3 = 0x00040000, custom_clip_4 = 0x00080000, custom_clip_5 = 0x00100000, custom_clip_6 = 0x00200000,
  custom_clip_7 = 0x00400000, custom_clip_8 = 0x00800000, custom_clip_9 = 0x01000000, custom_clip_10 = 0x02000000,
  custom_clip_11 = 0x04000000, custom_clip_12 = 0x08000000, custom_clip_13 = 0x10000000, custom_clip_14 = 0x20000000,
  custom_clip_15 = 0x40000000, custom_clip_16 = 0x80000000, custom_clip_mask = 0xFFFF0000, not_custom_clip_mask = 0x0000FFFF,
  all_bits_mask = 0xFFFFFFFF
}
 
enum  DEPTH_TEST : unsigned int {
  unset = 0, DEPTH_TEST::never_passes, DEPTH_TEST::always_passes, DEPTH_TEST::less_passes,
  DEPTH_TEST::less_or_equal_passes, DEPTH_TEST::equal_passes, DEPTH_TEST::notequal_passes, DEPTH_TEST::greater_or_equal_passes,
  DEPTH_TEST::greater_passes
}
 
enum  VISIBILITY : unsigned int {
  VISIBILITY::unset = 0, VISIBILITY::all_visible = 1, VISIBILITY::partially_visible = 2, VISIBILITY::not_visible = 3,
  VISIBILITY::unknown = 4
}
 

Public Member Functions

 ON_DepthImage ()
 
 ~ON_DepthImage ()
 
bool AddCustomClippingConvexRegion (const ON_PlaneEquation *plane_equations, size_t plane_equation_count)
 
unsigned int BoundingBoxClipStatus (const class ON_BoundingBox *bbox) const
 
const class ON_DepthImageCustomClippingRegion * ClipCoordinateCustomClippingRegion () const
 
unsigned int ConvexHullClipStatus (size_t point_count, size_t point_stride, const double *points) const
 
unsigned int CustomClippingConvexRegionCount () const
 
unsigned int CustomClippingPlaneCount () const
 
void DeleteCustomClippingRegions ()
 
void DestroyImage ()
 
bool Draw3dBezierCurve (bool bIsRational, int order, size_t cv_stride, const double *cv, ON__UINT_PTR id, const class ON_DepthImagePointShader *shader)
 
bool Draw3dLineSegment (const double *world_point0, const double *world_point1, ON__UINT_PTR id, const class ON_DepthImagePointShader *shader)
 
bool Draw3dPoint (const double *world_point, ON__UINT_PTR id, const class ON_DepthImagePointShader *shader)
 
bool DrawBezierCurve (const ON_BezierCurve &bezier_curve, ON__UINT_PTR id, const class ON_DepthImagePointShader *shader)
 
bool DrawBrep (const class ON_Brep &brep, class ON_DepthImageTriangleMesh *triangle_mesh, ON::mesh_type mesh_type, ON__UINT_PTR id, const class ON_DepthImageTriangleShader *shader)
 
bool DrawCurve (const ON_Curve *curve, ON__UINT_PTR id, const class ON_DepthImagePointShader *shader)
 
bool DrawExtrusion (const class ON_Extrusion &extrusion, class ON_DepthImageTriangleMesh *triangle_mesh, ON::mesh_type mesh_type, ON__UINT_PTR id, const class ON_DepthImageTriangleShader *shader)
 
bool DrawMesh (const class ON_Mesh &mesh, class ON_DepthImageTriangleMesh *triangle_mesh, ON__UINT_PTR id, const class ON_DepthImageTriangleShader *shader)
 
bool DrawNurbsCurve (const ON_NurbsCurve &nurbs_curve, ON__UINT_PTR id, const class ON_DepthImagePointShader *shader)
 
bool DrawTriangle (const double *world_point1, const double *world_point2, const double *world_point3, ON__UINT_PTR id, const class ON_DepthImageTriangleShader *shader)
 
bool DrawTriangle (const float *world_point1, const float *world_point2, const float *world_point3, ON__UINT_PTR id, const class ON_DepthImageTriangleShader *shader)
 
bool DrawTriangleMesh (const class ON_DepthImageTriangleMesh &triangle_mesh, ON__UINT_PTR id, const class ON_DepthImageTriangleShader *shader)
 
double ErasedDepthValue () const
 
ON__UINT_PTR ErasedIdValue () const
 
void EraseImageDepth (double erased_depth)
 
void EraseImageId (ON__UINT_PTR erased_id)
 
bool GetPixel (int x, int y, ON__UINT_PTR *id, double *depth) const
 
bool GetPixel (unsigned int x, unsigned int y, ON__UINT_PTR *id, double *depth) const
 
unsigned int GetPointDepth (const double point[3], double *image_depth) const
 
bool GetWorldPoint (double image_x, double image_y, double depth, double *world_point) const
 
unsigned int GetWorldPoints (ON__UINT_PTR id_filter, ON_Interval depth_filter, ON_SimpleArray< ON_3dPoint > &points) const
 
unsigned int GetWorldPoints (ON_SimpleArray< ON_3dPoint > &points) const
 
unsigned int Height () const
 
bool IsVisibleBoundingBox (ON_BoundingBox bbox, double expansion_distance, const ON_DepthImage::DEPTH_TEST depth_test, double depth_bias)
 
bool IsVisibleTriangleMesh (class ON_DepthImageTriangleMesh &triangle_mesh, unsigned int triangle_status_mask, const ON_DepthImage::DEPTH_TEST depth_test, double depth_bias, class ON_DepthImagePixel *pixel, class ON_DepthImageTriangle *visible_triangle, double *visible_triangle_depth)
 
ON_Xform ModelTransformation () const
 
ON_Xform ModelTransformationInverse () const
 
unsigned int ModelTransformationStackCount () const
 
const class ON_DepthImageCustomClippingRegion * ObjCoordinateCustomClippingRegion () const
 GBA 12/19/16 RH-32565 Added cached Object coordinate version of custom clipping region. More...
 
void PopAllModelTransformations ()
 
unsigned int PopModelTransformation ()
 
ON_UUID ProjectionId () const
 
const ON_ViewportProjectionViewport () const
 
unsigned int ProjectPoint (const double point[3], double image_point[3]) const
 
unsigned int PushModelTransformation ()
 
unsigned int PushModelTransformation (ON_Xform cumulative_model_transformation)
 
bool SetCustomClippingConvexRegion (const ON_PlaneEquation *plane_equations, size_t plane_equation_count)
 
unsigned int SetModelTransformation (ON_Xform cumulative_model_transformation)
 
bool SetPixel (int x, int y, ON__UINT_PTR id, double depth)
 
bool SetPixel (unsigned int x, unsigned int y, ON__UINT_PTR id, double depth)
 
bool SetProjection (const ON_Viewport &vp, unsigned int image_width, unsigned int image_height, ON_UUID projection_id)
 
unsigned int Width () const
 
const class ON_DepthImageCustomClippingRegion * WorldCoordinateCustomClippingRegion () const
 

Static Public Member Functions

static ON_DepthImage::VISIBILITY CustomClippingRegionVisibility (const class ON_DepthImageCustomClippingRegion *ccr, unsigned int bitwise_and_point_set_clip_status, unsigned int bitwise_or_point_set_clip_status)
 
static ON_DepthImage::VISIBILITY FrustumVisibility (unsigned int bitwise_and_point_set_clip_status, unsigned int bitwise_or_point_set_clip_status)
 
static unsigned int MaximumCustomClippingPlaneCount ()
 
static bool PassesDepthTest (ON_DepthImage::DEPTH_TEST depth_test, double incoming_depth, double current_image_depth)
 
static ON_DepthImage::VISIBILITY Visibility (const class ON_DepthImageCustomClippingRegion *ccr, unsigned int bitwise_and_point_set_clip_status, unsigned int bitwise_or_point_set_clip_status)
 

Friends

struct INTERP_LINE_SEGMENT
 

Member Enumeration Documentation

◆ CLIP_STATUS

enum ON_DepthImage::CLIP_STATUS : unsigned int

Clipping status bits. (Not an enum class because these values are used to initize bits in unsigned ints.)

Enumerator
unset 
unset 
xmin_clip 

view frustum clipping status.

x < frustum left plane

xmax_clip 

x > frustum right plane

ymin_clip 

y < frustum bottom plane

ymax_clip 

y > frustum top plane

zfar_clip 

depth > frustum far distance

znear_clip 

depth < frustum near distance

zbehind_clip 

depth <= 0 (on or behind camera plane)

xyz_mask 
degenerate 

unable to project or clip - generally a calculation failed

xyzd_mask 

(degenerate | xyz_mask)

infrus 

view frustum visibility

completely inside view frustum

liminal 

may be partially inside frustum - more testing and clipping is required

ignored 

outside frustum, outside custom clip region, not visible, calculation failed, degenerate, ...

frustum_clip_mask 

(degenerate | infrus | xyz_mask )

visibility_status_mask 

(infrus | liminal | ignored)

tridir_unset 

Triangle vertex order.

cannot compute triangle dir because a portion is behind the perspective viewpoint

tridir_none 

after clipping, triangles with this status have the direction calculated when needed.

projected triangle has negligible area (side facing or degenerate)

tridir_ccw 

projected triangle vertices run counterclockwise (front facing)

tridir_cw 

projected triangle vertices run clockwise (back facing)

tridir_status_mask 
custom_clip_1 

a maximum of 16 custom clipping planes can be use to define up to 16 convex regions. The union of the regions is the active space. This permits non-convex section views.

custom_clip_2 
custom_clip_3 
custom_clip_4 
custom_clip_5 
custom_clip_6 
custom_clip_7 
custom_clip_8 
custom_clip_9 
custom_clip_10 
custom_clip_11 
custom_clip_12 
custom_clip_13 
custom_clip_14 
custom_clip_15 
custom_clip_16 
custom_clip_mask 
not_custom_clip_mask 
all_bits_mask 

◆ DEPTH_TEST

enum ON_DepthImage::DEPTH_TEST : unsigned int
strong
Enumerator
unset 
never_passes 

pass = false

always_passes 

pass = true

less_passes 

pass = (incoming depth < current depth)

less_or_equal_passes 

pass = (incoming depth <= current depth)

equal_passes 

pass = (incoming depth == current depth)

notequal_passes 

pass = (incoming depth != current depth)

greater_or_equal_passes 

pass = (incoming depth > current depth)

greater_passes 

pass = (incoming depth >= current depth)

◆ VISIBILITY

enum ON_DepthImage::VISIBILITY : unsigned int
strong
Enumerator
unset 
all_visible 
partially_visible 

known to be partially visible

not_visible 
unknown 

more testing is required

Constructor & Destructor Documentation

◆ ON_DepthImage()

ON_DepthImage::ON_DepthImage ( )

◆ ~ON_DepthImage()

ON_DepthImage::~ON_DepthImage ( )

Member Function Documentation

◆ AddCustomClippingConvexRegion()

bool ON_DepthImage::AddCustomClippingConvexRegion ( const ON_PlaneEquation plane_equations,
size_t  plane_equation_count 
)

Parameters: plane_equations - [in] world coordinate custom clipping planes. A point is in the visible portion of the region if and only if the value of every plane equation is >= 0.0 at the point. plane_equation_count - [in] <= MaximumCustomClippingPlaneCount() - CustomClippingPlaneCount()

◆ BoundingBoxClipStatus()

unsigned int ON_DepthImage::BoundingBoxClipStatus ( const class ON_BoundingBox bbox) const

◆ ClipCoordinateCustomClippingRegion()

const class ON_DepthImageCustomClippingRegion* ON_DepthImage::ClipCoordinateCustomClippingRegion ( ) const

◆ ConvexHullClipStatus()

unsigned int ON_DepthImage::ConvexHullClipStatus ( size_t  point_count,
size_t  point_stride,
const double *  points 
) const

◆ CustomClippingConvexRegionCount()

unsigned int ON_DepthImage::CustomClippingConvexRegionCount ( ) const

Returns: Number of convex clipping regions. Remarks: The entire custom clipping region is the union of the convex clipping regions.

◆ CustomClippingPlaneCount()

unsigned int ON_DepthImage::CustomClippingPlaneCount ( ) const

Returns: Total number of planes in the custom clipping region. Remarks: These planes are grouped into subsets that bound convex subsets. The entire custom clipping region is the union of the convex subsets.

◆ CustomClippingRegionVisibility()

static ON_DepthImage::VISIBILITY ON_DepthImage::CustomClippingRegionVisibility ( const class ON_DepthImageCustomClippingRegion *  ccr,
unsigned int  bitwise_and_point_set_clip_status,
unsigned int  bitwise_or_point_set_clip_status 
)
static

◆ DeleteCustomClippingRegions()

void ON_DepthImage::DeleteCustomClippingRegions ( )

◆ DestroyImage()

void ON_DepthImage::DestroyImage ( )

◆ Draw3dBezierCurve()

bool ON_DepthImage::Draw3dBezierCurve ( bool  bIsRational,
int  order,
size_t  cv_stride,
const double *  cv,
ON__UINT_PTR  id,
const class ON_DepthImagePointShader shader 
)

◆ Draw3dLineSegment()

bool ON_DepthImage::Draw3dLineSegment ( const double *  world_point0,
const double *  world_point1,
ON__UINT_PTR  id,
const class ON_DepthImagePointShader shader 
)

Description: Draw world_point into the current image. Parameters: world_point0 - [in] world_point1 - [in] world coordinate points to draw id - [in] id passed to shader. shader - [in] null or a custom shader. Returns: false The image is not ready for drawing or the shader intentionally terminated rendering by returning false. true Otherwise.

◆ Draw3dPoint()

bool ON_DepthImage::Draw3dPoint ( const double *  world_point,
ON__UINT_PTR  id,
const class ON_DepthImagePointShader shader 
)

Description: Draw world_point into the current image. Parameters: world_point - [in] world coordinate point to draw id - [in] id passed to shader. shader - [in] null or a custom shader. Returns: false The image is not ready for drawing or the shader intentionally terminated rendering by returning false. true Otherwise.

◆ DrawBezierCurve()

bool ON_DepthImage::DrawBezierCurve ( const ON_BezierCurve bezier_curve,
ON__UINT_PTR  id,
const class ON_DepthImagePointShader shader 
)

◆ DrawBrep()

bool ON_DepthImage::DrawBrep ( const class ON_Brep brep,
class ON_DepthImageTriangleMesh triangle_mesh,
ON::mesh_type  mesh_type,
ON__UINT_PTR  id,
const class ON_DepthImageTriangleShader shader 
)

Description: Draw brep into the current image. Parameters: brep - [in] brep to draw triangle_mesh - [in] null or the triangle_mesh that will be used to draw brep. This parameter is useful when many objects are being drawn to minimize calls to heap functions. id - [in] id passed to shader. shader - [in] null or a custom shader. Returns: false The image is not ready for drawing or the shader intentionall terminated rendering by returning false. true Otherwise.

◆ DrawCurve()

bool ON_DepthImage::DrawCurve ( const ON_Curve curve,
ON__UINT_PTR  id,
const class ON_DepthImagePointShader shader 
)

◆ DrawExtrusion()

bool ON_DepthImage::DrawExtrusion ( const class ON_Extrusion extrusion,
class ON_DepthImageTriangleMesh triangle_mesh,
ON::mesh_type  mesh_type,
ON__UINT_PTR  id,
const class ON_DepthImageTriangleShader shader 
)

Description: Draw extrusion into the current image. Parameters: extrusion - [in] extrusion to draw triangle_mesh - [in] null or the triangle_mesh that will be used to draw extrusion. This parameter is useful when many objects are being drawn to minimize calls to heap functions. id - [in] id passed to shader. shader - [in] null or a custom shader. Returns: false The image is not ready for drawing or the shader intentionally terminated rendering by returning false. true Otherwise.

◆ DrawMesh()

bool ON_DepthImage::DrawMesh ( const class ON_Mesh mesh,
class ON_DepthImageTriangleMesh triangle_mesh,
ON__UINT_PTR  id,
const class ON_DepthImageTriangleShader shader 
)

Description: Draw mesh into the current image. Parameters: mesh - [in] mesh to draw triangle_mesh - [in] null or the triangle_mesh that will be used to draw mesh. This parameter is useful when many objects are being drawn to minimize calls to heap functions. id - [in] id passed to shader. shader - [in] null or a custom shader. Returns: false The image is not ready for drawing or the shader intentionally terminated rendering by returning false. true Otherwise.

◆ DrawNurbsCurve()

bool ON_DepthImage::DrawNurbsCurve ( const ON_NurbsCurve nurbs_curve,
ON__UINT_PTR  id,
const class ON_DepthImagePointShader shader 
)

◆ DrawTriangle() [1/2]

bool ON_DepthImage::DrawTriangle ( const double *  world_point1,
const double *  world_point2,
const double *  world_point3,
ON__UINT_PTR  id,
const class ON_DepthImageTriangleShader shader 
)

Description: Draw triangle_mesh into the current image. Parameters: world_point1 - [in] world_point2 - [in] world_point3 - [in] corners of the triangle id - [in] id passed to shader. shader - [in] null or a custom shader. Returns: false The image is not ready for drawing or the shader intentionally terminated rendering by returning false. true Otherwise.

◆ DrawTriangle() [2/2]

bool ON_DepthImage::DrawTriangle ( const float *  world_point1,
const float *  world_point2,
const float *  world_point3,
ON__UINT_PTR  id,
const class ON_DepthImageTriangleShader shader 
)

◆ DrawTriangleMesh()

bool ON_DepthImage::DrawTriangleMesh ( const class ON_DepthImageTriangleMesh triangle_mesh,
ON__UINT_PTR  id,
const class ON_DepthImageTriangleShader shader 
)

Description: Draw triangle_mesh into the current image. Parameters: triangle_mesh - [in] triangle mesh to draw. id - [in] id passed to shader. shader - [in] null or a custom shader. Returns: false The image is not ready for drawing or the shader intentionally terminated rendering by returning false. true Otherwise.

◆ ErasedDepthValue()

double ON_DepthImage::ErasedDepthValue ( ) const

◆ ErasedIdValue()

ON__UINT_PTR ON_DepthImage::ErasedIdValue ( ) const

◆ EraseImageDepth()

void ON_DepthImage::EraseImageDepth ( double  erased_depth)

◆ EraseImageId()

void ON_DepthImage::EraseImageId ( ON__UINT_PTR  erased_id)

◆ FrustumVisibility()

static ON_DepthImage::VISIBILITY ON_DepthImage::FrustumVisibility ( unsigned int  bitwise_and_point_set_clip_status,
unsigned int  bitwise_or_point_set_clip_status 
)
static

◆ GetPixel() [1/2]

bool ON_DepthImage::GetPixel ( int  x,
int  y,
ON__UINT_PTR *  id,
double *  depth 
) const

◆ GetPixel() [2/2]

bool ON_DepthImage::GetPixel ( unsigned int  x,
unsigned int  y,
ON__UINT_PTR *  id,
double *  depth 
) const

◆ GetPointDepth()

unsigned int ON_DepthImage::GetPointDepth ( const double  point[3],
double *  image_depth 
) const

Parameters: point - [in] world coordinate 3d point image_depth - [out] signed distance from the point to the image plane through the camera location.
Returns: ON_DepthImage::CLIP_STATUS::zfar_clip depth > frustum far depth ON_DepthImage::CLIP_STATUS::infrus depth >= frustum near depth and depth <= frustum far depth ON_DepthImage::CLIP_STATUS::znear_clip depth < frustum near depth ON_DepthImage::CLIP_STATUS::degenerate depth cannot be calculated A value set by bitwise or of ON_DepthImage::CLIP_STATUS values.

◆ GetWorldPoint()

bool ON_DepthImage::GetWorldPoint ( double  image_x,
double  image_y,
double  depth,
double *  world_point 
) const

Parameters: image_x - [in] >= 0.0 and <= image.Width(). image_y - [in] >= 0.0 and <= image.Height(). Remarks: The lower left corner of the image has image coordinates (0,0) The upper right corner of the image has image coordinates (Width(),Height())

◆ GetWorldPoints() [1/2]

unsigned int ON_DepthImage::GetWorldPoints ( ON__UINT_PTR  id_filter,
ON_Interval  depth_filter,
ON_SimpleArray< ON_3dPoint > &  points 
) const

Description: Gets a world point at the center of each pixel whose id equals id depth is greater than zero and less than ON_DBL_MAX and not equal to ErasedDepthValue(). Parameters: id_filter - [in] All pixels whose id value is not equal to id_filter are skipped. depth_filter - [in] All pixels whos depth value does not satisfy depth >= depth_filter.m_min and depth <= depth_filter.m_max are skipped. points - [out] Output world coordinate points are appended to this array. Returns: number of points appened to points[].

◆ GetWorldPoints() [2/2]

unsigned int ON_DepthImage::GetWorldPoints ( ON_SimpleArray< ON_3dPoint > &  points) const

Description: Gets a world point at the center of each pixel whose depth is greater than zero and less than ON_DBL_MAX and not equal to ErasedDepthValue(). Parameters: points - [out] Output world coordinate points are appended to this array. Returns: number of points appened to points[].

◆ Height()

unsigned int ON_DepthImage::Height ( ) const

◆ IsVisibleBoundingBox()

bool ON_DepthImage::IsVisibleBoundingBox ( ON_BoundingBox  bbox,
double  expansion_distance,
const ON_DepthImage::DEPTH_TEST  depth_test,
double  depth_bias 
)

Description: Test a bounding box to see if some portion is visible. Parameters: bbox - [in] expansion_distance - [in] Before testing, expand the bounding box by adding this distance to each of the bbox.m_max coordinates and subtracting this distance from each of the bbox.m_min coordinates. depth_test - [in] depth_bias - [in] Before testing, move the bounding box a distance of depth_bias parallel to the view direction.
A positive depth_bias moves the deeper (away from the camera). A a negative depth_bias moves the box nearer (towards the camera).

◆ IsVisibleTriangleMesh()

bool ON_DepthImage::IsVisibleTriangleMesh ( class ON_DepthImageTriangleMesh triangle_mesh,
unsigned int  triangle_status_mask,
const ON_DepthImage::DEPTH_TEST  depth_test,
double  depth_bias,
class ON_DepthImagePixel pixel,
class ON_DepthImageTriangle visible_triangle,
double *  visible_triangle_depth 
)

Description: Test a triangle mesh to see if some portion is visible.

Parameters: triangle_mesh - [in]

triangle_status_mask - [in] If triangle_status_mask is not zero, then only triangles satisfying 0 != (triangle_status & triangle_status_mask) will be tested. Specifically, setting triangle_status_mask to ON_DepthImage::tridir_ccw or ON_DepthImage::tridir_cw can be used to limit testing to front or back facing triangles.

depth_test - [in] To test for ordinary visibility, set depth_test to the same value used to create the image, typically ON_DepthImage::DEPTH_TEST::less_passes or ON_DepthImage::less_or_equal_passes. You can use other values to test if some portion of triangle_mesh is in the frustum and "behind" a set pixel by using ON_DepthImage::greater_passes.

depth_bias - [in] Before testing, move the bounding box a distance of depth_bias parallel to the view direction.
A positive depth_bias moves the deeper (away from the camera). A a negative depth_bias moves the box nearer (towards the camera).

pixel - [out] If not null, image pixel information for the first pixel discoverered where the triangle_mesh is visible.

visible_triangle - [out] If not null, the triangle where the visible point was discovered.

triangle_depth - [out] If not null, the depth of the point on the visible triangle.

◆ MaximumCustomClippingPlaneCount()

static unsigned int ON_DepthImage::MaximumCustomClippingPlaneCount ( )
static

◆ ModelTransformation()

ON_Xform ON_DepthImage::ModelTransformation ( ) const

Returns: Cumulative model transformation.

◆ ModelTransformationInverse()

ON_Xform ON_DepthImage::ModelTransformationInverse ( ) const

Returns: Inverse of the cumulative model transformation.

◆ ModelTransformationStackCount()

unsigned int ON_DepthImage::ModelTransformationStackCount ( ) const

Returns: The number of transformations in model transformation stack. If no transformations have been pushed, then zero is returned.

◆ ObjCoordinateCustomClippingRegion()

const class ON_DepthImageCustomClippingRegion* ON_DepthImage::ObjCoordinateCustomClippingRegion ( ) const

GBA 12/19/16 RH-32565 Added cached Object coordinate version of custom clipping region.

◆ PassesDepthTest()

static bool ON_DepthImage::PassesDepthTest ( ON_DepthImage::DEPTH_TEST  depth_test,
double  incoming_depth,
double  current_image_depth 
)
static

Parameters: depth_test - [in] specifies the type of depth test. incoming_depth - [in] depth value to test. current_image_depth - [in] deth value in the current image. Returns: true: incoming_depth passes the depth test when compared with current_image_depth. false: incoming_depth fails the depth test when compared with current_image_depth.

◆ PopAllModelTransformations()

void ON_DepthImage::PopAllModelTransformations ( )

Description: Empty the model transformation stack. This leaves the model transformation as the identity.

◆ PopModelTransformation()

unsigned int ON_DepthImage::PopModelTransformation ( )

Description: Remove the most recently pushed model transformation from the model transformation stack. Returns:

0:

The returned value is the number of transformations that were in the stack before the pop. 0: The model transformation stack was empty and nothing was changed.

◆ ProjectionId()

ON_UUID ON_DepthImage::ProjectionId ( ) const

◆ ProjectionViewport()

const ON_Viewport& ON_DepthImage::ProjectionViewport ( ) const

◆ ProjectPoint()

unsigned int ON_DepthImage::ProjectPoint ( const double  point[3],
double  image_point[3] 
) const

Parameters: point - [in] world coordinate 3d point image_point - [out] x,y = image point z = signed distance from the point to the image plane through the camera location.
Returns: A value set by bitwise or of ON_DepthImage::CLIP_STATUS values.

◆ PushModelTransformation() [1/2]

unsigned int ON_DepthImage::PushModelTransformation ( )

Description: Push a copy of the current model transformation onto the model transformation stack. Returns:

0:

The returned value is the number of transformations that are in the stack after the push.

◆ PushModelTransformation() [2/2]

unsigned int ON_DepthImage::PushModelTransformation ( ON_Xform  cumulative_model_transformation)

Description: Push a copy of the current model transformation onto the model transformation stack and set the cumulative transformation. Example: Add a translation to the cumulative model transformation. ON_Xform translation = ...; PushModelTransformation(ModelTransformation()*translation); Returns:

0:

The returned value is the number of transformations that are in the stack after the push.

◆ SetCustomClippingConvexRegion()

bool ON_DepthImage::SetCustomClippingConvexRegion ( const ON_PlaneEquation plane_equations,
size_t  plane_equation_count 
)

Parameters: plane_equations - [in] world coordinate custom clipping planes. A point is in the visible portion of the region if and only if the value of every plane equation is >= 0.0 at the point. plane_equation_count - [in] <= MaximumCustomClippingPlaneCount()

◆ SetModelTransformation()

unsigned int ON_DepthImage::SetModelTransformation ( ON_Xform  cumulative_model_transformation)

Parameters: cumulative_model_transformation - [in] The cumulative model transformation that will be applied to world coordinate objects. Model transformations act on the left. Returns:

0:

The returned value is the number of transformations one the stack. 0: Invalid input.

◆ SetPixel() [1/2]

bool ON_DepthImage::SetPixel ( int  x,
int  y,
ON__UINT_PTR  id,
double  depth 
)

◆ SetPixel() [2/2]

bool ON_DepthImage::SetPixel ( unsigned int  x,
unsigned int  y,
ON__UINT_PTR  id,
double  depth 
)

◆ SetProjection()

bool ON_DepthImage::SetProjection ( const ON_Viewport vp,
unsigned int  image_width,
unsigned int  image_height,
ON_UUID  projection_id 
)

Parameters: vp - [in] A valid view projection.

  • The frustum near and far distances must satisfy frust_left != frus_right frust_bottom != frus_top frus_near > 0 frus_far > frus_near

image_width - [in] number of horizontal elements in the image's id and depth planes. > 0 Commonly set to vp.ScreenPortWidth()

image_height - [in] number of vertical elements in the image's id and depth planes. > 0 Commonly set to vp.ScreenPortHeight()

projection_id - [in] When not nil, the projection id is used by drawing functions to eliminate duplicating calculations during mult-pass rendering algorithms. When the projection is changed, either change the projection id or set it to nil. Remarks: The image's lower left corner has coordinates (0,0). The image's upper right corner has coordinates (image_width,image_height). The indices of the image's upper right id and depth elements are [image_width-1][image_height-1].

◆ Visibility()

static ON_DepthImage::VISIBILITY ON_DepthImage::Visibility ( const class ON_DepthImageCustomClippingRegion *  ccr,
unsigned int  bitwise_and_point_set_clip_status,
unsigned int  bitwise_or_point_set_clip_status 
)
static

Description: Determine visibility of the convex hull of a point set based on the clip status bits of a collection of points in the set. The clip status bits for a point are set by bitwise | of ON_DepthImage::CLIP_STATUS enum values. For a mesh, the set of vertices works. For a bezier or NURBS curve or surface with positive weights, the set of control points works. Parameters: ccr - [in] nullptr or a pointer to the custom clipping region used to set the clip status bits. bitwise_and_point_set_clip_status - [in] a bitwise & of the individual point statuses. bitwise_or_point_set_clip_status - [in] a bitwise | of the individual point statuses. Returns: ON_DepthImage::VISIBILITY::unset Invalid input ON_DepthImage::VISIBILITY::all_visible The entire convex hull is in a visible region ON_DepthImage::VISIBILITY::not_visible The entire convex hull is outside all visible regions. ON_DepthImage::VISIBILITY::partially_visible The convext hull has portions that are visible and not visible. Note the object (mesh, curve, surface) could be completely visible or completely hidden in this case. ON_DepthImage::VISIBILITY::unknown Unable to determine visibility based on simple plane tests. At least one point is degenerate or is not visible, but the chord from this point to another in the set has the potential for being visible.

◆ Width()

unsigned int ON_DepthImage::Width ( ) const

◆ WorldCoordinateCustomClippingRegion()

const class ON_DepthImageCustomClippingRegion* ON_DepthImage::WorldCoordinateCustomClippingRegion ( ) const

Friends And Related Function Documentation

◆ INTERP_LINE_SEGMENT

friend struct INTERP_LINE_SEGMENT
friend