|
MorphoGraphX
2.0-1-227
|
#include <PlyFile.hpp>
Public Types | |
| enum | KIND { VALUE, LIST } |
| Kind of a property. More... | |
Public Member Functions | |
| Property (const QString &name, Element *el=0) | |
| Constructor of a property. More... | |
| ~Property () | |
| The destructor takes charge to detach the property from any element that contains it. More... | |
| void | allocate (size_t size) |
Allocate the memory for the property, as long as memType is not INVALID_TYPE. More... | |
| void | deallocate () |
| Free the memory occupied by the property. More... | |
| template<typename T > | |
| std::vector< std::vector< T > > * | list () |
| Return a pointer to the list help by the property as long as the property is a list and the type is correct. More... | |
| template<typename T > | |
| std::vector< T > * | value () |
| Return a pointer to the values help by the property as long as the property is a value and the type is correct. More... | |
| template<typename T > | |
| const std::vector< std::vector< T > > * | list () const |
| Return a pointer to the list help by the property as long as the property is a list and the type is correct. More... | |
| template<typename T > | |
| const std::vector< T > * | value () const |
| Return a pointer to the values help by the property as long as the property is a value and the type is correct. More... | |
| bool | error (const QString &str) const |
| Print an error on the standard output and return false. More... | |
| const QString & | name () const |
| Name of the property. More... | |
| TYPE | fileType () const |
| File type of the property value. More... | |
| TYPE | memType () const |
| Memory type of the property value. More... | |
| TYPE | sizeType () const |
| File type of the size of the property list. More... | |
| KIND | kind () const |
| Kind of the property. More... | |
| size_t | size () const |
| Size of the property, that is the number of elements stored in it. More... | |
| bool | rename (const QString &n) |
| Change the name of the property, only if the new name doesn't conflict with one of the other properties in the parent element. More... | |
| void | setFileType (TYPE ft) |
| Change the file type of the property. More... | |
| void | setMemType (TYPE mt) |
| Change the memory type of the property. More... | |
| void | setSizeType (TYPE st) |
| Change the file type of the size of the property. More... | |
| void | setKind (KIND k) |
| Change the kind of the property. More... | |
| Element * | parent () |
| Get the element containing the property, if any. More... | |
| const Element * | parent () const |
| Get the element containing the property, if any. More... | |
| bool | setParent (Element *parent) |
| Change the parent, only if the new parent doesn't already have a property with the same name. More... | |
| void | resize (size_t s) |
| Resize the property. More... | |
Protected Attributes | |
| QString | _name |
| TYPE | _fileType |
| TYPE | _memType |
| TYPE | _sizeType |
| KIND | _kind |
| Element * | _parent |
| void * | _content |
| size_t | _size |
Class representing a property in an element
Definition at line 118 of file PlyFile.hpp.
Kind of a property.
| Enumerator | |
|---|---|
| VALUE | The property holds a single value per element. |
| LIST | The property holds a variable number of values per element. |
Definition at line 122 of file PlyFile.hpp.
| mgx::PlyFile::Property::Property | ( | const QString & | name, |
| Element * | el = 0 |
||
| ) |
Constructor of a property.
| name | Name of the property |
| el | Element containing the property |
The name of the property must be unique in the element. If this is not the case, the property won't be attached to the element.
| mgx::PlyFile::Property::~Property | ( | ) |
The destructor takes charge to detach the property from any element that contains it.
| void mgx::PlyFile::Property::allocate | ( | size_t | size | ) |
Allocate the memory for the property, as long as memType is not INVALID_TYPE.
All the vectors are initialized with default-constructed values.
| void mgx::PlyFile::Property::deallocate | ( | ) |
Free the memory occupied by the property.
| bool mgx::PlyFile::Property::error | ( | const QString & | str | ) | const |
Print an error on the standard output and return false.
|
inline |
File type of the property value.
Definition at line 221 of file PlyFile.hpp.
|
inline |
Kind of the property.
Definition at line 242 of file PlyFile.hpp.
|
inline |
Return a pointer to the list help by the property as long as the property is a list and the type is correct.
Definition at line 159 of file PlyFile.hpp.
|
inline |
Return a pointer to the list help by the property as long as the property is a list and the type is correct.
Definition at line 184 of file PlyFile.hpp.
|
inline |
Memory type of the property value.
Definition at line 228 of file PlyFile.hpp.
|
inline |
Name of the property.
Definition at line 214 of file PlyFile.hpp.
|
inline |
Get the element containing the property, if any.
Definition at line 291 of file PlyFile.hpp.
|
inline |
Get the element containing the property, if any.
Definition at line 298 of file PlyFile.hpp.
| bool mgx::PlyFile::Property::rename | ( | const QString & | n | ) |
Change the name of the property, only if the new name doesn't conflict with one of the other properties in the parent element.
| void mgx::PlyFile::Property::resize | ( | size_t | s | ) |
Resize the property.
If the property is already allocated, it should leep the min(size,s) first property values.
|
inline |
Change the file type of the property.
Definition at line 263 of file PlyFile.hpp.
| void mgx::PlyFile::Property::setKind | ( | KIND | k | ) |
Change the kind of the property.
| void mgx::PlyFile::Property::setMemType | ( | TYPE | mt | ) |
Change the memory type of the property.
If the property is already allocated, the existing values will be converted to the new type.
| bool mgx::PlyFile::Property::setParent | ( | Element * | parent | ) |
Change the parent, only if the new parent doesn't already have a property with the same name.
|
inline |
Change the file type of the size of the property.
Definition at line 277 of file PlyFile.hpp.
|
inline |
Size of the property, that is the number of elements stored in it.
Definition at line 249 of file PlyFile.hpp.
|
inline |
File type of the size of the property list.
Definition at line 235 of file PlyFile.hpp.
|
inline |
Return a pointer to the values help by the property as long as the property is a value and the type is correct.
Definition at line 172 of file PlyFile.hpp.
|
inline |
Return a pointer to the values help by the property as long as the property is a value and the type is correct.
Definition at line 197 of file PlyFile.hpp.
|
protected |
Definition at line 323 of file PlyFile.hpp.
|
protected |
Definition at line 318 of file PlyFile.hpp.
|
protected |
Definition at line 321 of file PlyFile.hpp.
|
protected |
Definition at line 319 of file PlyFile.hpp.
|
protected |
Definition at line 317 of file PlyFile.hpp.
|
protected |
Definition at line 322 of file PlyFile.hpp.
|
protected |
Definition at line 324 of file PlyFile.hpp.
|
protected |
Definition at line 320 of file PlyFile.hpp.
1.8.17