KrisLibrary
1.0.0
|
A class that stores any kind of geometry we've defined. More...
#include <AnyGeometry.h>
Public Types | |
enum | Type { Primitive, TriangleMesh, PointCloud, ImplicitSurface, ConvexHull, Group } |
Public Member Functions | |
AnyGeometry3D (const GeometricPrimitive3D &primitive) | |
AnyGeometry3D (const Meshing::VolumeGrid &grid) | |
AnyGeometry3D (const Meshing::TriMesh &mesh) | |
AnyGeometry3D (const Meshing::PointCloud3D &pc) | |
AnyGeometry3D (const vector< AnyGeometry3D > &items) | |
AnyGeometry3D (const ConvexHull3D &cvxhull) | |
AnyGeometry3D (const AnyGeometry3D &geom)=default | |
AnyGeometry3D (AnyGeometry3D &&geom)=default | |
AnyGeometry3D & | operator= (const AnyGeometry3D &rhs)=default |
AnyGeometry3D & | operator= (AnyGeometry3D &&rhs)=default |
const char * | TypeName () const |
const GeometricPrimitive3D & | AsPrimitive () const |
const Meshing::TriMesh & | AsTriangleMesh () const |
const Meshing::PointCloud3D & | AsPointCloud () const |
const Meshing::VolumeGrid & | AsImplicitSurface () const |
const ConvexHull3D & | AsConvexHull () const |
const vector< AnyGeometry3D > & | AsGroup () const |
GeometricPrimitive3D & | AsPrimitive () |
Meshing::TriMesh & | AsTriangleMesh () |
Meshing::PointCloud3D & | AsPointCloud () |
Meshing::VolumeGrid & | AsImplicitSurface () |
ConvexHull3D & | AsConvexHull () |
vector< AnyGeometry3D > & | AsGroup () |
GLDraw::GeometryAppearance * | TriangleMeshAppearanceData () |
const GLDraw::GeometryAppearance * | TriangleMeshAppearanceData () const |
bool | Load (const char *fn) |
bool | Save (const char *fn) const |
bool | Load (istream &in) |
bool | Save (ostream &out) const |
bool | Load (TiXmlElement *in) |
bool | Save (TiXmlElement *out) const |
bool | Empty () const |
size_t | NumElements () const |
GeometricPrimitive3D | GetElement (int elem) const |
AABB3D | GetAABB () const |
void | Transform (const RigidTransform &T) |
void | Transform (const Matrix4 &mat) |
void | Merge (const vector< AnyGeometry3D > &geoms) |
bool | Convert (Type restype, AnyGeometry3D &res, double param=0) const |
Static Public Member Functions | |
static const char * | TypeName (Type type) |
static bool | CanLoadExt (const char *ext) |
static bool | CanSaveExt (const char *ext) |
Public Attributes | |
Type | type |
AnyValue | data |
The data, according to the type. | |
AnyValue | appearanceData |
Optional appearance data, according to the type. | |
A class that stores any kind of geometry we've defined.
To get the data, first check the "type" member. Then call the appropriate AsX method to retrieve the data in the underlying format.
Some types may also store auxiliary appearance data. Right now the only thing that's supported is the GLDraw::GeometryAppearance data for TriangleMesh data. This may also be NULL, for geometries that don't store appearance information. You can get these using the XAppearanceData functions.
Map of types to classes in the value member