This class holds the "heavy" geometry information.
Things like vertices, normals, parameter values, etc.
#include <GeometryData.h>
Public Types |
|
enum | LoadState { NotLoaded, Loading, Loaded } |
Public Member Functions |
|
GeometryData () | |
virtual const awString::IString & | getOwnedObjectType () const |
GeometryData::LoadState | getLoadState () const |
void | setLoadState (GeometryData::LoadState state) |
void | getBoundingBox (awSupport::BoundingBox &bb) const |
Compute and store a bounding box. |
|
int | getMeshCount () const |
int | getPolygonCount () const |
int | getVertexCount () const |
int | addCompactMesh (awGeom::CompactMesh_H compactMesh) |
int | removeCompactMesh (awGeom::CompactMesh_H compactMesh) |
awGeom::CompactMesh_H | getCompactMesh (int index) |
void | addVertex (const double vertex[3]) |
void | createMesh (double *vertices, int count) |
void | updateMesh (double *vertices, int count) |
void | addStripInfo (awSupport::StripInfo::StripType type, int start, int size) |
Adds a strip to the last mesh in the
collection, adding one if there are none. |
|
void | createTriStrips () |
bool | saveAttribute (const awString::CString &attributeName, const awString::IString &attributeFilename) |
Sometimes attribute values are computed at
run time from the incoming meshes (e.g. |
|
bool | reloadAttribute (const awString::CString &attributeName) |
Attribute values that were saved by the
saveAttribute method can use this method to reload these values and
re-apply them as an attribute to the set of meshes. |
|
bool | reloadSavedAttributes () |
void | setPersistId (const awString::IString &) |
const awString::IString & | getPersistId () const |
GeometryData & | operator= (GeometryData &other) |
Public Attributes |
|
aw::vector< awGeom::CompactMesh_H > | myMeshes |
aw::vector< awGeom::CompactMesh_H > | myDisplayMeshes |
enum LoadState |
GeometryData | ( | ) |
virtual const awString::IString& getOwnedObjectType | ( | ) | const [virtual] |
Implements OwnedObject.
GeometryData::LoadState getLoadState | ( | ) | const |
void setLoadState | ( | GeometryData::LoadState | state | ) |
void getBoundingBox | ( | awSupport::BoundingBox & | bb | ) | const |
Compute and store a bounding box.
int getMeshCount | ( | ) | const |
int getPolygonCount | ( | ) | const |
int getVertexCount | ( | ) | const |
int addCompactMesh | ( | awGeom::CompactMesh_H | compactMesh | ) |
int removeCompactMesh | ( | awGeom::CompactMesh_H | compactMesh | ) |
awGeom::CompactMesh_H getCompactMesh | ( | int | index | ) |
void addVertex | ( | const double | vertex[3] | ) |
void createMesh | ( | double * | vertices, |
int | count | ||
) |
void updateMesh | ( | double * | vertices, |
int | count | ||
) |
void addStripInfo | ( | awSupport::StripInfo::StripType | type, |
int | start, | ||
int | size | ||
) |
Adds a strip to the last mesh in the collection, adding one if there are none.
Used only by the API. Might be nice to design this away.
void createTriStrips | ( | ) |
bool saveAttribute | ( | const awString::CString & | attributeName, |
const awString::IString & | attributeFilename | ||
) |
Sometimes attribute values are computed at run time from the incoming meshes (e.g.
ambient occlusion values) and since they're expensive to compute we want to be able to save and reload them. Since the meshes are loaded from their original files (usually apf) without these new attributes, we need to store these separately. This method saves the given attribute values from each mesh in this object to an external file. You can then use the loadAttribute method to reload these values and apply them as an attribute to the set of meshes. Note that upon reloading, the ordering of the meshes must be the same as it was when saved.
bool reloadAttribute | ( | const awString::CString & | attributeName | ) |
Attribute values that were saved by the saveAttribute method can use this method to reload these values and re-apply them as an attribute to the set of meshes.
Note that upon reloading, the ordering of the meshes must be the same as it was when saved. If the number of meshes or attribute values in the file does not match the number in this GeometryData the load will fail. If the current meshes already have the specified attribute their values will be overwritten with the values from the file.
bool reloadSavedAttributes | ( | ) |
void setPersistId | ( | const awString::IString & | ) |
const awString::IString& getPersistId | ( | ) | const |
GeometryData& operator= | ( | GeometryData & | other | ) |
aw::vector<awGeom::CompactMesh_H> myMeshes |
aw::vector<awGeom::CompactMesh_H> myDisplayMeshes |