Rhino C++ API
8.10
|
#include <opennurbs_plus_idimage.h>
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_Viewport & | ProjectionViewport () 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 |
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.)
|
strong |
|
strong |
ON_DepthImage::ON_DepthImage | ( | ) |
ON_DepthImage::~ON_DepthImage | ( | ) |
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()
unsigned int ON_DepthImage::BoundingBoxClipStatus | ( | const class ON_BoundingBox * | bbox | ) | const |
const class ON_DepthImageCustomClippingRegion* ON_DepthImage::ClipCoordinateCustomClippingRegion | ( | ) | const |
unsigned int ON_DepthImage::ConvexHullClipStatus | ( | size_t | point_count, |
size_t | point_stride, | ||
const double * | points | ||
) | const |
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.
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.
|
static |
void ON_DepthImage::DeleteCustomClippingRegions | ( | ) |
void ON_DepthImage::DestroyImage | ( | ) |
bool ON_DepthImage::Draw3dBezierCurve | ( | bool | bIsRational, |
int | order, | ||
size_t | cv_stride, | ||
const double * | cv, | ||
ON__UINT_PTR | id, | ||
const class ON_DepthImagePointShader * | shader | ||
) |
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.
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.
bool ON_DepthImage::DrawBezierCurve | ( | const ON_BezierCurve & | bezier_curve, |
ON__UINT_PTR | id, | ||
const class ON_DepthImagePointShader * | shader | ||
) |
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 intentional terminated rendering by returning false. true Otherwise.
bool ON_DepthImage::DrawCurve | ( | const ON_Curve * | curve, |
ON__UINT_PTR | id, | ||
const class ON_DepthImagePointShader * | shader | ||
) |
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.
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.
bool ON_DepthImage::DrawNurbsCurve | ( | const ON_NurbsCurve & | nurbs_curve, |
ON__UINT_PTR | id, | ||
const class ON_DepthImagePointShader * | shader | ||
) |
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.
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 | ||
) |
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.
double ON_DepthImage::ErasedDepthValue | ( | ) | const |
ON__UINT_PTR ON_DepthImage::ErasedIdValue | ( | ) | const |
void ON_DepthImage::EraseImageDepth | ( | double | erased_depth | ) |
void ON_DepthImage::EraseImageId | ( | ON__UINT_PTR | erased_id | ) |
|
static |
bool ON_DepthImage::GetPixel | ( | int | x, |
int | y, | ||
ON__UINT_PTR * | id, | ||
double * | depth | ||
) | const |
bool ON_DepthImage::GetPixel | ( | unsigned int | x, |
unsigned int | y, | ||
ON__UINT_PTR * | id, | ||
double * | depth | ||
) | const |
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.
bool ON_DepthImage::GetWorldPoint | ( | double | image_x, |
double | image_y, | ||
double | depth, | ||
double * | world_point | ||
) | const |
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 append to points[].
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 append to points[].
unsigned int ON_DepthImage::Height | ( | ) | const |
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).
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 discovered 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.
|
static |
ON_Xform ON_DepthImage::ModelTransformation | ( | ) | const |
Returns: Cumulative model transformation.
ON_Xform ON_DepthImage::ModelTransformationInverse | ( | ) | const |
Returns: Inverse of the cumulative model transformation.
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.
const class ON_DepthImageCustomClippingRegion* ON_DepthImage::ObjCoordinateCustomClippingRegion | ( | ) | const |
GBA 12/19/16 RH-32565 Added cached Object coordinate version of custom clipping region.
|
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.
void ON_DepthImage::PopAllModelTransformations | ( | ) |
Description: Empty the model transformation stack. This leaves the model transformation as the identity.
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.
ON_UUID ON_DepthImage::ProjectionId | ( | ) | const |
const ON_Viewport& ON_DepthImage::ProjectionViewport | ( | ) | const |
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.
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.
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.
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()
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.
bool ON_DepthImage::SetPixel | ( | int | x, |
int | y, | ||
ON__UINT_PTR | id, | ||
double | depth | ||
) |
bool ON_DepthImage::SetPixel | ( | unsigned int | x, |
unsigned int | y, | ||
ON__UINT_PTR | id, | ||
double | depth | ||
) |
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.
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].
|
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 convex 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.
unsigned int ON_DepthImage::Width | ( | ) | const |
const class ON_DepthImageCustomClippingRegion* ON_DepthImage::WorldCoordinateCustomClippingRegion | ( | ) | const |
|
friend |