| 
    3es
    0.7
    
   | 
 
A MeshResource which defines a point cloud by its contained vertices.  
 More...
#include <3espointcloud.h>
  
 Public Member Functions | |
| PointCloud (uint32_t id) | |
Create a PointCloud resource with the given ID.  More... | |
| ~PointCloud () | |
| Destructor.  | |
| uint32_t | id () const override | 
| The resource ID.  More... | |
| PointCloud * | clone () const override | 
| Clone the cloud resource.  More... | |
| Matrix4f | transform () const override | 
| Always the identity matrix.  More... | |
| uint32_t | tint () const override | 
| Always returns white.  More... | |
| uint8_t | drawType (int stream=0) const override | 
Always returns DtPoints.  More... | |
| void | reserve (unsigned size) | 
Reserve sufficient vertex, normal and colour data for size points.  More... | |
| void | resize (unsigned count) | 
Resize the point cloud to contain count vertices, normals and colours.  More... | |
| void | squeeze () | 
| Reduce allocated memory to exactly match the number of points currently in the cloud.  | |
| unsigned | capacity () const | 
| Return the number of points allocated memory currently supports.  More... | |
| unsigned | vertexCount (int stream=0) const override | 
| Returns the number of vertices in the mesh.  More... | |
| const float * | vertices (unsigned &stride, int stream=0) const override | 
| Returns a pointer to the vertex stream.  More... | |
| const Vector3f * | vertices () const | 
Access vertices as a Vector3f array.  More... | |
| unsigned | indexCount (int stream=0) const override | 
| Not supported.  More... | |
| const uint8_t * | indices (unsigned &stride, unsigned &width, int stream=0) const override | 
| Not supported.  More... | |
| const float * | normals (unsigned &stride, int stream=0) const override | 
| Returns a pointer to the normal stream.  More... | |
| const Vector3f * | normals () const | 
Access normals as a Vector3f array.  More... | |
| const uint32_t * | colours (unsigned &stride, int stream=0) const override | 
| Returns a pointer to the colour stream.  More... | |
| const Colour * | colours () const | 
Access colours as a Colour array.  More... | |
| const float * | uvs (unsigned &, int) const override | 
| Not supported.  More... | |
| void | addPoint (const Vector3f &point) | 
| Add a single point to the cloud.  More... | |
| void | addPoint (const Vector3f &point, const Vector3f &normal) | 
| Add a single point to the cloud.  More... | |
| void | addPoint (const Vector3f &point, const Vector3f &normal, const Colour &colour) | 
| Add a single point to the cloud.  More... | |
| void | addPoints (const Vector3f *points, unsigned count) | 
| Add a set of points to the cloud.  More... | |
| void | addPoints (const Vector3f *points, const Vector3f *normals, unsigned count) | 
| Add a set of points to the cloud.  More... | |
| void | addPoints (const Vector3f *points, const Vector3f *normals, const Colour *colours, unsigned count) | 
| Add a set of points to the cloud.  More... | |
| void | setPoint (unsigned index, const Vector3f &point) | 
| Replace an existing point.  More... | |
| void | setPoint (unsigned index, const Vector3f &point, const Vector3f &normal) | 
| Replace an existing point.  More... | |
| void | setPoint (unsigned index, const Vector3f &point, const Vector3f &normal, const Colour &colour) | 
| Replace an existing point.  More... | |
| void | setNormal (unsigned index, const Vector3f &normal) | 
| Replace an existing point normal.  More... | |
| void | setColour (unsigned index, const Colour &colour) | 
| Replace an existing point colour.  More... | |
| void | setPoints (unsigned index, const Vector3f *points, unsigned count) | 
| Replace a set of existing points.  More... | |
| void | setPoints (unsigned index, const Vector3f *points, const Vector3f *normals, unsigned count) | 
| Replace a set of existing points.  More... | |
| void | setPoints (unsigned index, const Vector3f *points, const Vector3f *normals, const Colour *colours, unsigned count) | 
| Replace a set of existing points.  More... | |
  Public Member Functions inherited from tes::MeshResource | |
| virtual | ~MeshResource () | 
| Virtual destructor.  | |
| uint16_t | typeId () const override | 
Returns MtMesh.  | |
| int | create (PacketWriter &packet) const override | 
| Populate a mesh creation packet.  More... | |
| int | destroy (PacketWriter &packet) const override | 
| Populate a mesh destroy packet.  More... | |
| int | transfer (PacketWriter &packet, int byteLimit, TransferProgress &progress) const override | 
| Populate the next mesh data packet.  More... | |
| *tes::PacketWriter | packet () | 
Compose a mesh index component message in packet.  More... | |
| * | while (offset< mesh->indexCount()) * | 
  Public Member Functions inherited from tes::Resource | |
| virtual | ~Resource () | 
| Virtual destructor (empty).  | |
| uint64_t | uniqueKey () const | 
Returns a unique key for this resource, based on the typeId() and id().  | |
Protected Member Functions | |
| PointCloud (const PointCloud &other) | |
| A shallow copy constructor, supporting copy on write semantics.  More... | |
  Protected Member Functions inherited from tes::MeshResource | |
| virtual void | nextPhase (TransferProgress &progress) const | 
Additional Inherited Members | |
  Static Public Member Functions inherited from tes::MeshResource | |
| static int | estimateTransferCount (size_t elementSize, unsigned byteLimit, int overhead=0) | 
Estimate the number of elements which can be transferred at the given byteLimit.  More... | |
| *</code > **param packet Packet to write to *param meshId The mesh to which the data belong *param offset An index count offset to start writing from See remarks *param byteLimit A hard limit on the number of bytes to write *param dataSource Base pointer for the index data *param dataStride Number of bytes between indices *param indexByteWidth The byte size of a single index Generally equal to p dataStride *param componentCount The total number of indices *return The number of indices written *static unsigned | writeIndices (PacketWriter &packet, uint32_t meshId, uint32_t offset, unsigned byteLimit, const uint8_t *dataSource, unsigned dataStride, unsigned indexByteWidth, uint32_t componentCount) | 
| *</code > **param packet Packet to write to *param meshId The mesh to which the data belong *param offset An vertex count offset to start writing from See remarks *param byteLimit A hard limit on the number of bytes to write *param dataSource Base pointer for the vertex data *param dataStride Number of bytes between indices *param componentCount The total number of indices *return The number of indices written *static unsigned | writeVectors3 (PacketWriter &packet, uint32_t meshId, uint32_t offset, unsigned byteLimit, const uint8_t *dataSource, unsigned dataStride, uint32_t componentCount) | 
| static unsigned | writeVectors2 (PacketWriter &packet, uint32_t meshId, uint32_t offset, unsigned byteLimit, const uint8_t *dataSource, unsigned dataStride, uint32_t componentCount) | 
Compose a mesh float vector 2 component message in packet.  More... | |
| static unsigned | writeColours (PacketWriter &packet, uint32_t meshId, uint32_t offset, unsigned byteLimit, const uint8_t *dataSource, unsigned dataStride, uint32_t componentCount) | 
Compose a mesh component message for writing colour data in packet.  More... | |
  Public Attributes inherited from tes::MeshResource | |
| *const tes::MeshResource * | mesh = | 
| *uint32_t | offset = 0 | 
| *unsigned | dataStride | 
| *unsigned | indexByteWidth | 
| *const uint8_t * | indicesPtr = reinterpret_cast<const uint8_t *>(indices(dataStride, indexByteWidth)) | 
| * | offset | 
Compose a mesh float vector 3 component message in packet.  More... | |
A MeshResource which defines a point cloud by its contained vertices. 
The PointCloud supports a set of vertices, normals and colours only. Indices, UVs are not supported. 
      
  | 
  protected | 
A shallow copy constructor, supporting copy on write semantics.
| other | The cloud to copy. | 
| tes::PointCloud::PointCloud | ( | uint32_t | id | ) | 
Create a PointCloud resource with the given ID. 
| id | A user assigned, unique ID for the point cloud resource. | 
      
  | 
  inline | 
Add a single point to the cloud.
The normal is set to zero and the colour to white.
| point | The point to add. | 
Add a single point to the cloud.
The colour is set to white.
| point | The point to add. | 
| normal | The point normal. | 
      
  | 
  inline | 
Add a single point to the cloud.
| point | The point to add. | 
| normal | The point normal. | 
| colour | The point colour. | 
| void tes::PointCloud::addPoints | ( | const Vector3f * | points, | 
| unsigned | count | ||
| ) | 
Add a set of points to the cloud.
The normals are set to zero and the colours to white.
| points | The points to add. | 
| count | Number of points in points.  | 
| void tes::PointCloud::addPoints | ( | const Vector3f * | points, | 
| const Vector3f * | normals, | ||
| unsigned | count | ||
| ) | 
Add a set of points to the cloud.
The colours are set to white.
| points | The points to add. | 
| normals | The point normals. | 
| count | Number of points in points and normals.  | 
| void tes::PointCloud::addPoints | ( | const Vector3f * | points, | 
| const Vector3f * | normals, | ||
| const Colour * | colours, | ||
| unsigned | count | ||
| ) | 
Add a set of points to the cloud.
| points | The points to add. | 
| normals | The point normals. | 
| colours | The point colours. | 
| count | Number of points in points, normals and colours.  | 
| unsigned tes::PointCloud::capacity | ( | ) | const | 
Return the number of points allocated memory currently supports.
      
  | 
  overridevirtual | 
Clone the cloud resource.
This performs a shallow copy clone with copy on write semantics. That is to say, the copy becomes a deep copy if either the clone or the original are modified.
Implements tes::Resource.
      
  | 
  overridevirtual | 
Returns a pointer to the colour stream.
Each element is taken 32-bit integer. Expects vertexCount(stream) elements or null if no vertex colours.
| [out] | stride | The stride between colour elements (bytes). This would be 4 for a contiguous array of uint32_t colours.  | 
| stream | Reserved for future use. | 
Implements tes::MeshResource.
| const Colour* tes::PointCloud::colours | ( | ) | const | 
Access colours as a Colour array. 
Colour array. The number of elements matches vertexCount(). 
      
  | 
  overridevirtual | 
      
  | 
  overridevirtual | 
The resource ID.
Unique among resources of the same typeId(). 
Implements tes::Resource.
      
  | 
  overridevirtual | 
      
  | 
  overridevirtual | 
      
  | 
  overridevirtual | 
Returns a pointer to the normal stream.
Each element is taken as a triple of single precision floats: (x, y, z). Expects vertexColour(stream) elements or null if no normals. 
| [out] | stride | The stride between normal elements (bytes). This would be 12 for a contiguous array of float triples. | 
| stream | Reserved for future use. | 
Implements tes::MeshResource.
| const Vector3f* tes::PointCloud::normals | ( | ) | const | 
Access normals as a Vector3f array. 
Vector3f array. The number of elements matches vertexCount(). | void tes::PointCloud::reserve | ( | unsigned | size | ) | 
Reserve sufficient vertex, normal and colour data for size points. 
| size | The number of points to reserve space for. | 
| void tes::PointCloud::resize | ( | unsigned | count | ) | 
Resize the point cloud to contain count vertices, normals and colours. 
| count | The number of points to resize the cloud to. | 
| void tes::PointCloud::setColour | ( | unsigned | index, | 
| const Colour & | colour | ||
| ) | 
Replace an existing point colour.
Ignore if out of range.
| index | The point index. | 
| colour | The new point colour. | 
| void tes::PointCloud::setNormal | ( | unsigned | index, | 
| const Vector3f & | normal | ||
| ) | 
Replace an existing point normal.
Ignore if out of range.
| index | The point index. | 
| normal | The new point normal. | 
      
  | 
  inline | 
Replace an existing point.
Ignore if out of range.
| index | The point index. | 
| point | The new point coordinate. | 
      
  | 
  inline | 
Replace an existing point.
Ignore if out of range.
| index | The point index. | 
| point | The new point coordinate. | 
| normal | The new point normal. | 
      
  | 
  inline | 
Replace an existing point.
Ignore if out of range.
| index | The point index. | 
| point | The new point coordinate. | 
| normal | The new point normal. | 
| colour | The new point colour. | 
| void tes::PointCloud::setPoints | ( | unsigned | index, | 
| const Vector3f * | points, | ||
| unsigned | count | ||
| ) | 
Replace a set of existing points.
Normal and colour data are left as is.
Overrun points are ignored.
| index | The point index. | 
| points | The new point coordinates. | 
| count | The number of points in points.  | 
| void tes::PointCloud::setPoints | ( | unsigned | index, | 
| const Vector3f * | points, | ||
| const Vector3f * | normals, | ||
| unsigned | count | ||
| ) | 
Replace a set of existing points.
Colour data are left as is.
Overrun points are ignored.
| index | The point index. | 
| points | The new point coordinates. | 
| normals | The new point normals. | 
| count | The number of points in points and normals.  | 
| void tes::PointCloud::setPoints | ( | unsigned | index, | 
| const Vector3f * | points, | ||
| const Vector3f * | normals, | ||
| const Colour * | colours, | ||
| unsigned | count | ||
| ) | 
Replace a set of existing points.
Overrun points are ignored.
| index | The point index. | 
| points | The new point coordinates. | 
| normals | The new point normals. | 
| colours | The new point colours. | 
| count | The number of points in points, normals and colours.  | 
      
  | 
  overridevirtual | 
      
  | 
  overridevirtual | 
      
  | 
  overridevirtual | 
      
  | 
  overridevirtual | 
Returns the number of vertices in the mesh.
| stream | Reserved for future use. | 
Implements tes::MeshResource.
      
  | 
  overridevirtual | 
Returns a pointer to the vertex stream.
Each element is taken as a triple of single precision floats: (x, y, z).
| [out] | stride | The stride between vertex elements (bytes). This would be 12 for a contiguous array of float triples. | 
| stream | Reserved for future use. | 
Implements tes::MeshResource.
| const Vector3f* tes::PointCloud::vertices | ( | ) | const | 
Access vertices as a Vector3f array. 
Vector3f array. The number of elements matches vertexCount().