CVB.Net 14.0
PointCloud Class Reference

Base class for point clouds. More...

Inherits INativeHandle, and ICloneable.

Inherited by DensePointCloud, and SparsePointCloud.

Public Member Functions

void Dispose ()
 IDisposable implementation.
 
PointCloud Clone ()
 Creates a new point cloud which is a copy of this point cloud. More...
 
IEnumerable< T > TryEnumeratePointsAs< T > ()
 Tries to get the points of this point cloud. More...
 

Static Public Member Functions

static PointCloud FromFile (string fileName)
 Loads a point cloud from the given fileName . More...
 
static PointCloud FromFile (string fileName, PointCloudFlags flags)
 Loads a point cloud from the given fileName with the specified flags . More...
 
static PointCloud FromComposite (Composite obj)
 Create a point cloud from the given Composite obj . More...
 
static PointCloud FromHandle (IntPtr handle, ShareObject doShare)
 Creates a point cloud from the given handle . More...
 
static PointCloud FromMemory< T > (byte[] buffer, FileFormat fileFormat)
 Creates a point cloud from the given buffer buffer. More...
 
static PointCloud FromMemory (byte[] buffer, PointCloudFlags flags, FileFormat fileFormat)
 Creates a point cloud from the given buffer buffer. More...
 
static PointCloud FromMemory< T > (IntPtr buffer, long bufferSize, FileFormat fileFormat)
 Creates a point cloud from the given buffer buffer. More...
 
static PointCloud FromMemory (IntPtr buffer, long bufferSize, PointCloudFlags flags, FileFormat fileFormat)
 Creates a point cloud from the given buffer buffer. More...
 

Protected Member Functions

 PointCloud (IntPtr handle)
 Constructor. More...
 
 PointCloud (IntPtr handle, UseMemoryPressure useMemoryPressure)
 Constructor. More...
 
virtual void Dispose (bool disposing)
 IDisposable helper function. More...
 

Static Package Functions

static PointCloudFlags PointTypeToFlags< T > ()
 Converts the point type to flags. More...
 
static PointCloud CreateTypedPointCloud (IntPtr handle)
 Creates a typed point cloud determined by the given handle . More...
 
static bool IsDense (IntPtr handle)
 Gets if the given handle is a DensePointCloud handle by checking the lattice size can be read. More...
 

Properties

IntPtr Handle [get]
 Native handle of the PointCloud.
 
bool IsDisposed [get]
 Gets if the native handle has been disposed.
 
long MemoryPressure [get]
 Info how much memory pressure this point cloud provides.
 
PointCloudLayout Layout [get]
 The layout of the buffer / planes.
 
DataType DataType [get]
 The data type.
 
long NumPoints [get]
 Number of points.
 
ComponentsPointer3D PointComponents [get]
 The pointer components for the points.
 
PlaneEnumerator Planes [get]
 Gets all the component planes of this point cloud.
 
- Properties inherited from INativeHandle
IntPtr Handle [get]
 The native handle of the object.
 
bool IsDisposed [get]
 Possibility to check whether the object has already been disposed of.
 

Events

NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method. More...
 
- Events inherited from INativeHandle
NativeHandleEventDelegate ObjectDisposing
 Raised when this object is about to be disposed via the IDisposable.Dispose method.
More...
 

Detailed Description

Base class for point clouds.

Constructor & Destructor Documentation

◆ PointCloud() [1/2]

PointCloud ( IntPtr  handle)
protected

Constructor.

Parameters
handleNative handle to the PointCloud.
Exceptions
ArgumentExceptionWhen handle is IntPtr.Zero.

◆ PointCloud() [2/2]

PointCloud ( IntPtr  handle,
UseMemoryPressure  useMemoryPressure 
)
protected

Constructor.

Parameters
handleNative handle to the PointCloud.
useMemoryPressureGuesses memory pressure if UseMemoryPressure.Yes is set.
Exceptions
ArgumentExceptionWhen handle is IntPtr.Zero.

Member Function Documentation

◆ Clone()

PointCloud Clone ( )

Creates a new point cloud which is a copy of this point cloud.

Attention: The duplicated point cloud may have a different point cloud layout.

Returns
Copy of this point cloud.
Exceptions
CvbExceptionWhen duplicating the point cloud failed.

◆ CreateTypedPointCloud()

static PointCloud CreateTypedPointCloud ( IntPtr  handle)
staticpackage

Creates a typed point cloud determined by the given handle .

Parameters
handlePoint cloud handle to create typed point cloud for.
Returns
Typed point cloud.

◆ Dispose()

virtual void Dispose ( bool  disposing)
protectedvirtual

IDisposable helper function.

Parameters
disposing

◆ FromComposite()

static PointCloud FromComposite ( Composite  obj)
static

Create a point cloud from the given Composite obj .

Parameters
objComposite from which a point cloud is to be created.
Returns
New PointCloud object.

◆ FromFile() [1/2]

static PointCloud FromFile ( string  fileName)
static

Loads a point cloud from the given fileName .

Parameters
fileNameFile to load the point cloud from.
Returns
Loaded point cloud.
Exceptions
CvbExceptionWhen loading the point cloud failed.

◆ FromFile() [2/2]

static PointCloud FromFile ( string  fileName,
PointCloudFlags  flags 
)
static

Loads a point cloud from the given fileName with the specified flags .

Parameters
fileNameFile to load the point cloud from.
flagsFlags to load the point cloud with.
Returns
Loaded point cloud.
Exceptions
CvbExceptionWhen loading the point cloud failed.

◆ FromHandle()

static PointCloud FromHandle ( IntPtr  handle,
ShareObject  doShare 
)
static

Creates a point cloud from the given handle .

Parameters
handleHandle to create point cloud with.
doShareShare ownership or adopt it.
Returns
Created point cloud.
Exceptions
ArgumentExceptionWhen handle is IntPtr.Zero.

◆ FromMemory() [1/2]

static PointCloud FromMemory ( byte[]  buffer,
PointCloudFlags  flags,
FileFormat  fileFormat 
)
static

Creates a point cloud from the given buffer buffer.

Parameters
bufferBuffer containing the point cloud data.
flagsFlags of the point cloud to create.
fileFormatFile format of the buffer data.
Returns
Created point cloud.
Exceptions
ArgumentNullExceptionWhen buffer is null.
ArgumentExceptionWhen buffer is empty.
CvbExceptionWhen an error during point cloud creation occurs.

◆ FromMemory() [2/2]

static PointCloud FromMemory ( IntPtr  buffer,
long  bufferSize,
PointCloudFlags  flags,
FileFormat  fileFormat 
)
static

Creates a point cloud from the given buffer buffer.

Parameters
bufferBuffer containing the point cloud data.
bufferSizeSize of the buffer .
flagsFlags of the point cloud to create.
fileFormatFile format of the buffer data.
Returns
Created point cloud.
Exceptions
CvbExceptionWhen an error during point cloud creation occurs.

◆ FromMemory< T >() [1/2]

static PointCloud FromMemory< T > ( byte[]  buffer,
FileFormat  fileFormat 
)
static

Creates a point cloud from the given buffer buffer.

Template Parameters
TPoint type used by the cloud.
Parameters
bufferBuffer containing the point cloud data.
fileFormatFile format of the buffer data.
Returns
Created point cloud.
Exceptions
ArgumentNullExceptionWhen buffer is null.
ArgumentExceptionWhen buffer is empty.
CvbExceptionWhen an error during point cloud creation occurs.
Type Constraints
T :struct 

◆ FromMemory< T >() [2/2]

static PointCloud FromMemory< T > ( IntPtr  buffer,
long  bufferSize,
FileFormat  fileFormat 
)
static

Creates a point cloud from the given buffer buffer.

Template Parameters
TPoint type used by the cloud.
Parameters
bufferBuffer containing the point cloud data.
bufferSizeSize of the buffer .
fileFormatFile format of the buffer data.
Returns
Created point cloud.
Exceptions
CvbExceptionWhen an error during point cloud creation occurs.
Type Constraints
T :struct 

◆ IsDense()

static bool IsDense ( IntPtr  handle)
staticpackage

Gets if the given handle is a DensePointCloud handle by checking the lattice size can be read.

Parameters
handlePoint cloud handle to check.
Returns
True if the given handle is a DensePointCloud handle, false if not.

◆ PointTypeToFlags< T >()

static PointCloudFlags PointTypeToFlags< T > ( )
staticpackage

Converts the point type to flags.

Template Parameters
TOne of the Stemmer.Cvb.Point3D types.
Returns
Flags identifying this type.
Type Constraints
T :struct 

◆ TryEnumeratePointsAs< T >()

IEnumerable< T > TryEnumeratePointsAs< T > ( )

Tries to get the points of this point cloud.

Template Parameters
TType to try to get the points in.
Returns
The points (or empty IEnumerable<T>, when the points could not be gotten).
Type Constraints
T :struct 

Event Documentation

◆ ObjectDisposing

NativeHandleEventDelegate ObjectDisposing

Raised when this object is about to be disposed via the IDisposable.Dispose method.

This event is raised right before this object is disposed. The dispose itself cannot be canceled.