IPointCloud_KC Interface
- GetAxisAlignedBoundingBox
- GetOrientedBoundingBox
- FitOrientedBoundingBoxAveragesMethod
- GetMinimumOrientedBoundingBox
- GetMeanPoint
- ReduceData
Operations with point sets. IPointCloud_KC can be queried from
ISection interface implemented by
Point Set entities
See also: Cloud sample
HRESULT GetAxisAlignedBoundingBox(VARIANT_BOOL localAxes, IBox** box)
Parameters
localAxes - [in] If true the ranges in the returned box
will be related to the local axes of the entity, which implements this
interface. Otherwise the ranges are related to the global axes
box - [out, retval] Interface
implemented by new box
- Remarks:
Use this method to obtain Axis Aligned Bounding box of the entity. If
localAxes is true the box will be aligned to locan axes of the
point set entity
HRESULT GetOrientedBoundingBox(IBox* box)
box - [in, out] Interface implemented by
a box created by the caller
- Remarks:
This interface calculates dimensions of minimal Oriented Bounding Box of the
point set. The method does not change its orientation, which is expected to be
set by the caller.
To use this method:
-
Ccreate a new box using DG Kernel > GetModel() > IModel > IDIObjGenerator >
IDIObjGenerator.Create(EObjectType.eObjTypeBox) > IBox.
-
Query I3DObject and
IFrame2 from IBox.
-
Use I3DObject and
IFrame2 to set location and orientation of the box
-
Call GetOrientedBoundingBox(IBox* box) to calculate dimensions of the box
-
Use methods of IBox to acces the dimensions
See also: Cloud sample
HRESULT FitOrientedBoundingBoxAveragesMethod( int* result, IBox** box)
Parameters
result - [out] The return code: -1 if
the set was empty; 0 if there was an internal error. Use
IError_KC to obtain textual
description of an error
box - [out, retval] Interface
implemented by new box
Remarks:
The method calculates orientation and dimension of a "good fit" bounding box,
volume of which is close to minimal. The returned box if not guaranteed to be
optimal, but it is much faster than the exact method below
HRESULT GetMinimumOrientedBoundingBox( float tolerance, int
performanceVsPrecision, int* result, IBox** box)
Parameters
tolerance - Precision of the calculation. It affects
performance. Valid range: 1e-5 to 0,3
performanceVsPrecision - Precision of the calculation.
Valid values are 0, 1 or 2. Choose 0 for best performance. Choose 2 for best
precision.
result - [out] The return code: -1 if
the set was empty; 0 if there was an internal error. Use
IError_KC to obtain textual
description of an error
box - [out, retval] Interface
implemented by new box
Remarks:
The method calculates orientation and dimension of the minimal volume bounding
box. The method is computationally expensive. Use
FitOrientedBoundingBoxAveragesMethod() above if fast estimation is sufficient.
It is recommended to tune in the parameters experimenting with the application
for best performance.
HRESULT GetMeanPoint(DIPoint* mean)
Parameters
mean - The returned mean point of the point set
- Remarks:
The method calculates the mean point (center of weight) of the set.
HRESULT ReduceData(VARIANT_BOOL leave, int start, int step, int end)
Parameters
leave - If true all points except ones specified in the start, step, end parameters will be deleted.
If false only the specified points are deleted
start - The first index of the specified subset of points.
Must be less then or equal to end.
step - Only each step-th point is included in the specified subset.
Must be greater than zero. when step is 1 no points are skipped
end - The last index of the specified subset of points.
Must be greater then or equal to start
- Remarks:
The method removes points as specified by the parameters from the point set. Use
step = 1 to remove or leave all points from the start, end
range.
|