#include <miniply.h>
|
| PLYReader (const char *filename) |
|
| ~PLYReader () |
|
bool | valid () const |
|
bool | has_element () const |
|
const PLYElement * | element () const |
|
bool | load_element () |
|
void | next_element () |
|
PLYFileType | file_type () const |
|
int | version_major () const |
|
int | version_minor () const |
|
uint32_t | num_elements () const |
|
uint32_t | find_element (const char *name) const |
|
PLYElement * | get_element (uint32_t idx) |
|
bool | element_is (const char *name) const |
| Check whether the current element has the given name.
|
|
uint32_t | num_rows () const |
| Number of rows in the current element.
|
|
uint32_t | find_property (const char *name) const |
|
bool | find_properties (uint32_t propIdxs[], uint32_t numIdxs,...) const |
| Equivalent to calling find_properties on the current element.
|
|
bool | extract_properties (const uint32_t propIdxs[], uint32_t numProps, PLYPropertyType destType, void *dest) const |
|
bool | extract_properties_with_stride (const uint32_t propIdxs[], uint32_t numProps, PLYPropertyType destType, void *dest, uint32_t destStride) const |
|
const uint32_t * | get_list_counts (uint32_t propIdx) const |
|
uint32_t | sum_of_list_counts (uint32_t propIdx) const |
|
const uint8_t * | get_list_data (uint32_t propIdx) const |
|
bool | extract_list_property (uint32_t propIdx, PLYPropertyType destType, void *dest) const |
|
uint32_t | num_triangles (uint32_t propIdx) const |
|
bool | requires_triangulation (uint32_t propIdx) const |
|
bool | extract_triangles (uint32_t propIdx, const float pos[], uint32_t numVerts, PLYPropertyType destType, void *dest) const |
|
bool | find_pos (uint32_t propIdxs[3]) const |
|
bool | find_normal (uint32_t propIdxs[3]) const |
|
bool | find_texcoord (uint32_t propIdxs[2]) const |
|
bool | find_color (uint32_t propIdxs[3]) const |
|
bool | find_indices (uint32_t propIdxs[1]) const |
|
◆ PLYReader()
miniply::PLYReader::PLYReader |
( |
const char * |
filename | ) |
|
◆ ~PLYReader()
miniply::PLYReader::~PLYReader |
( |
| ) |
|
◆ element()
const PLYElement * miniply::PLYReader::element |
( |
| ) |
const |
◆ element_is()
bool miniply::PLYReader::element_is |
( |
const char * |
name | ) |
const |
Check whether the current element has the given name.
◆ extract_list_property()
bool miniply::PLYReader::extract_list_property |
( |
uint32_t |
propIdx, |
|
|
PLYPropertyType |
destType, |
|
|
void * |
dest |
|
) |
| const |
◆ extract_properties()
bool miniply::PLYReader::extract_properties |
( |
const uint32_t |
propIdxs[], |
|
|
uint32_t |
numProps, |
|
|
PLYPropertyType |
destType, |
|
|
void * |
dest |
|
) |
| const |
Copy the data for the specified properties into dest
, which must be an array with at least enough space to hold all of the extracted column data. propIdxs
is an array containing the indexes of the properties to copy; it has numProps
elements.
destType
specifies the data type for values stored in dest
. All property values will be converted to this type if necessary.
This function does some checks up front to pick the most efficient code path for extracting the data. It considers: (a) whether any data conversion is required. (b) whether all property values to be extracted are in contiguous memory locations for any given item. (c) whether the data for all rows is contiguous in memory. In the best case it reduces to a single memcpy call. In the worst case we must iterate over all values to be copied, applying type conversions as we go.
Note that this function does not handle list-valued properties. Use extract_list_column()
for those instead.
◆ extract_properties_with_stride()
bool miniply::PLYReader::extract_properties_with_stride |
( |
const uint32_t |
propIdxs[], |
|
|
uint32_t |
numProps, |
|
|
PLYPropertyType |
destType, |
|
|
void * |
dest, |
|
|
uint32_t |
destStride |
|
) |
| const |
The same as extract_properties
, but does not require rows in the destination to be contiguous: destStride
is the number of bytes between the start of one row and the start of the next row in the destination memory.
This is useful for when your destination is an array of structs where you cannot extract all of the properties with a single extract_properties
call, e.g. when not all of the struct members have the same type, or when the data you're extracting is only a subset of the columns in each destination row.
This is a tiny bit slower than extract_properties
. Wherever possible you should use extract_properties
in preference to this method.
◆ extract_triangles()
bool miniply::PLYReader::extract_triangles |
( |
uint32_t |
propIdx, |
|
|
const float |
pos[], |
|
|
uint32_t |
numVerts, |
|
|
PLYPropertyType |
destType, |
|
|
void * |
dest |
|
) |
| const |
◆ file_type()
◆ find_color()
bool miniply::PLYReader::find_color |
( |
uint32_t |
propIdxs[3] | ) |
const |
◆ find_element()
uint32_t miniply::PLYReader::find_element |
( |
const char * |
name | ) |
const |
◆ find_indices()
bool miniply::PLYReader::find_indices |
( |
uint32_t |
propIdxs[1] | ) |
const |
◆ find_normal()
bool miniply::PLYReader::find_normal |
( |
uint32_t |
propIdxs[3] | ) |
const |
◆ find_pos()
bool miniply::PLYReader::find_pos |
( |
uint32_t |
propIdxs[3] | ) |
const |
◆ find_properties()
bool miniply::PLYReader::find_properties |
( |
uint32_t |
propIdxs[], |
|
|
uint32_t |
numIdxs, |
|
|
|
... |
|
) |
| const |
Equivalent to calling find_properties
on the current element.
◆ find_property()
uint32_t miniply::PLYReader::find_property |
( |
const char * |
name | ) |
const |
Returns the index for the named property in the current element, or kInvalidIndex
if it can't be found.
◆ find_texcoord()
bool miniply::PLYReader::find_texcoord |
( |
uint32_t |
propIdxs[2] | ) |
const |
◆ get_element()
PLYElement * miniply::PLYReader::get_element |
( |
uint32_t |
idx | ) |
|
◆ get_list_counts()
const uint32_t * miniply::PLYReader::get_list_counts |
( |
uint32_t |
propIdx | ) |
const |
Get the array of item counts for a list property. Entry i
in this array is the number of items in the i
th list.
◆ get_list_data()
const uint8_t * miniply::PLYReader::get_list_data |
( |
uint32_t |
propIdx | ) |
const |
◆ has_element()
bool miniply::PLYReader::has_element |
( |
| ) |
const |
◆ load_element()
bool miniply::PLYReader::load_element |
( |
| ) |
|
◆ next_element()
void miniply::PLYReader::next_element |
( |
| ) |
|
◆ num_elements()
uint32_t miniply::PLYReader::num_elements |
( |
| ) |
const |
◆ num_rows()
uint32_t miniply::PLYReader::num_rows |
( |
| ) |
const |
Number of rows in the current element.
◆ num_triangles()
uint32_t miniply::PLYReader::num_triangles |
( |
uint32_t |
propIdx | ) |
const |
◆ requires_triangulation()
bool miniply::PLYReader::requires_triangulation |
( |
uint32_t |
propIdx | ) |
const |
◆ sum_of_list_counts()
uint32_t miniply::PLYReader::sum_of_list_counts |
( |
uint32_t |
propIdx | ) |
const |
Get the sum of all item counts for a list property. This can be useful to determine how big a destination array you'll need for a call to extract_list_property
. It's equivalent to summing up all the values in the array returned by get_list_counts
, but faster.
◆ valid()
bool miniply::PLYReader::valid |
( |
| ) |
const |
◆ version_major()
int miniply::PLYReader::version_major |
( |
| ) |
const |
◆ version_minor()
int miniply::PLYReader::version_minor |
( |
| ) |
const |
The documentation for this class was generated from the following files: