|
MorphoGraphX
2.0-1-227
|
#include <PlyFile.hpp>
Public Member Functions | |
| Element (const QString &name, PlyFile *parent=0) | |
| Element constructor. More... | |
| ~Element () | |
| The destructor takes care of detaching the element from the PLY file that contains it. More... | |
| void | allocate () |
| Allocate the memory for all the properties attached to the element. More... | |
| void | clear () |
| Remove any property attached to this element. More... | |
| size_t | nbProperties () const |
| Number of properties in the element. More... | |
| size_t | size () const |
| Number of items in the element. More... | |
| void | resize (size_t n) |
| Change the number of items in the element. More... | |
| QStringList | properties () const |
| Get the list of property names. More... | |
| Property * | property (size_t pos) |
| Access a property by index number. More... | |
| const Property * | property (size_t pos) const |
| Access a property by index number. More... | |
| Property * | property (const QString &name) |
| Access a property by name. More... | |
| const Property * | property (const QString &name) const |
| Access a property by name. More... | |
| Property * | createValue (const QString &name, TYPE file, TYPE mem=INVALID_TYPE) |
| Create a new value property if the name doesn't already exist. More... | |
| Property * | createList (const QString &name, TYPE size, TYPE file, TYPE mem=INVALID_TYPE) |
| Create a new value property if the name doesn't already exist. More... | |
| bool | error (const QString &str) const |
| Write the error in the standard out and return false. More... | |
| bool | hasProperty (const QString &name) const |
Returns true if the element has a property names name. More... | |
| bool | attach (Property *prop) |
| Attach a property to the element. More... | |
| bool | detach (Property *prop) |
| Remove a property from the element. More... | |
| Property * | detach (const QString &name) |
| Remove a property from the element, and return the removed property. More... | |
| const QString & | name () const |
| Name of the element. More... | |
| bool | rename (const QString &n) |
| Rename the element, only if the containing PLY file doesn't already contain an element with the new name. More... | |
| bool | allocated () const |
| Return true if the element has been allocated. More... | |
| bool | setParent (PlyFile *p) |
| Change the parent of the element, only if the new parent doesn't have an element with the same name. More... | |
| PlyFile * | parent () |
| Get the parent of the element. More... | |
| const PlyFile * | parent () const |
| Get the parent of the element. More... | |
| void | _rename_prop (Property *prop, const QString &new_name) |
| void | _attach (Property *prop) |
| void | _detach (Property *prop) |
Protected Attributes | |
| QString | _name |
| size_t | _nbElements |
| QList< Property * > | _properties |
| QHash< QString, int > | _property_map |
| PlyFile * | _parent |
| bool | _allocated |
Class representing an element
Definition at line 332 of file PlyFile.hpp.
| mgx::PlyFile::Element::Element | ( | const QString & | name, |
| PlyFile * | parent = 0 |
||
| ) |
Element constructor.
| name | Name of the lement |
| parent | PLY file holding the element |
The name must be unique in the PLY file. If this is not the case, the element won't be attached to the PLY file and the parent won't be set.
| mgx::PlyFile::Element::~Element | ( | ) |
The destructor takes care of detaching the element from the PLY file that contains it.
| void mgx::PlyFile::Element::_attach | ( | Property * | prop | ) |
| void mgx::PlyFile::Element::_detach | ( | Property * | prop | ) |
| void mgx::PlyFile::Element::_rename_prop | ( | Property * | prop, |
| const QString & | new_name | ||
| ) |
| void mgx::PlyFile::Element::allocate | ( | ) |
Allocate the memory for all the properties attached to the element.
|
inline |
Return true if the element has been allocated.
Definition at line 465 of file PlyFile.hpp.
| bool mgx::PlyFile::Element::attach | ( | Property * | prop | ) |
Attach a property to the element.
| void mgx::PlyFile::Element::clear | ( | ) |
Remove any property attached to this element.
The properties will be deleted.
| Property* mgx::PlyFile::Element::createList | ( | const QString & | name, |
| TYPE | size, | ||
| TYPE | file, | ||
| TYPE | mem = INVALID_TYPE |
||
| ) |
Create a new value property if the name doesn't already exist.
| name | Name of the new property |
| size | File type for the size of the list |
| file | File type of the property |
| mem | Memory type. If INVALID_TYPE is specified here, the memory type will be equal to the file type |
| Property* mgx::PlyFile::Element::createValue | ( | const QString & | name, |
| TYPE | file, | ||
| TYPE | mem = INVALID_TYPE |
||
| ) |
Create a new value property if the name doesn't already exist.
| name | Name of the new property |
| file | File type of the property |
| mem | Memory type. If INVALID_TYPE is specified here, the memory type will be equal to the file type |
| Property* mgx::PlyFile::Element::detach | ( | const QString & | name | ) |
Remove a property from the element, and return the removed property.
| bool mgx::PlyFile::Element::detach | ( | Property * | prop | ) |
Remove a property from the element.
| bool mgx::PlyFile::Element::error | ( | const QString & | str | ) | const |
Write the error in the standard out and return false.
| bool mgx::PlyFile::Element::hasProperty | ( | const QString & | name | ) | const |
Returns true if the element has a property names name.
|
inline |
Name of the element.
Definition at line 453 of file PlyFile.hpp.
|
inline |
Number of properties in the element.
Definition at line 367 of file PlyFile.hpp.
|
inline |
Get the parent of the element.
Definition at line 476 of file PlyFile.hpp.
|
inline |
Get the parent of the element.
Definition at line 482 of file PlyFile.hpp.
| QStringList mgx::PlyFile::Element::properties | ( | ) | const |
Get the list of property names.
| Property* mgx::PlyFile::Element::property | ( | const QString & | name | ) |
Access a property by name.
| const Property* mgx::PlyFile::Element::property | ( | const QString & | name | ) | const |
Access a property by name.
| Property* mgx::PlyFile::Element::property | ( | size_t | pos | ) |
Access a property by index number.
| const Property* mgx::PlyFile::Element::property | ( | size_t | pos | ) | const |
Access a property by index number.
| bool mgx::PlyFile::Element::rename | ( | const QString & | n | ) |
Rename the element, only if the containing PLY file doesn't already contain an element with the new name.
| void mgx::PlyFile::Element::resize | ( | size_t | n | ) |
Change the number of items in the element.
This will call Property::resize on all the properties of the element.
| bool mgx::PlyFile::Element::setParent | ( | PlyFile * | p | ) |
Change the parent of the element, only if the new parent doesn't have an element with the same name.
|
inline |
Number of items in the element.
Definition at line 374 of file PlyFile.hpp.
|
protected |
Definition at line 508 of file PlyFile.hpp.
|
protected |
Definition at line 503 of file PlyFile.hpp.
|
protected |
Definition at line 504 of file PlyFile.hpp.
|
protected |
Definition at line 507 of file PlyFile.hpp.
|
protected |
Definition at line 505 of file PlyFile.hpp.
|
protected |
Definition at line 506 of file PlyFile.hpp.
1.8.17