VRUT::Geometry Class Reference

Base class for geometry representation - abstract. More...

#include <geometry.h>

Inheritance diagram for VRUT::Geometry:

VRUT::GeometryTriangles

List of all members.

Public Types

enum  GEOMETRY_TYPE { GEOMETRY_UNKNOWN, GEOMETRY_TRIANGLE }
 Type of representation. More...

Public Member Functions

 Geometry (const wxString &_name)
 Class constructor.
 Geometry (const Geometry &g)
 Copy constructor.
virtual ~Geometry ()
 Class destructor.
const wxString GetName () const
 Get name.
const AABBGetAABB () const
 Get AABB.
virtual void BuildAABB ()=0
 Build AABB.
virtual bool Intersects (const Ray &ray, float *dist=(float *) NULL) const =0
virtual bool CastRay (const Ray &ray, RayIntersectionInfo &info) const
virtual std::vector< TriangleTriangulate () const =0
 Get geometry as list of triangles.
virtual void AddBox (const vector3 &position, const vector3 &size)=0
 Add Box to geometry.
virtual wxString ToString () const
 Get string with geometry properties.
virtual GeometryClone () const =0
 Get copy of instance.

Public Attributes

enum VRUT::Geometry::GEOMETRY_TYPE type

Protected Attributes

wxString name
 Name.
AABB aabb
 Model space axis aligned bounding box.

Friends

class Scene


Detailed Description

Base class for geometry representation - abstract.

Definition at line 41 of file geometry.h.


Member Enumeration Documentation

Type of representation.

Enumerator:
GEOMETRY_UNKNOWN  Unknown geometry type.
GEOMETRY_TRIANGLE  Triangulated geometry.

Definition at line 51 of file geometry.h.

00052               {
00053                      GEOMETRY_UNKNOWN,    
00054                      GEOMETRY_TRIANGLE    
00055               } type;


Constructor & Destructor Documentation

VRUT::Geometry::Geometry ( const wxString &  _name  )  [inline]

Class constructor.

Definition at line 58 of file geometry.h.

00058 : name(CloneWxString(_name)), type(GEOMETRY_UNKNOWN)   {}

VRUT::Geometry::Geometry ( const Geometry g  )  [inline]

Copy constructor.

Definition at line 60 of file geometry.h.

00060 : name(CloneWxString(g.name)), type(g.type), aabb(g.aabb)   {}

virtual VRUT::Geometry::~Geometry (  )  [inline, virtual]

Class destructor.

Definition at line 62 of file geometry.h.

00062 {}


Member Function Documentation

const wxString VRUT::Geometry::GetName (  )  const [inline]

Get name.

Definition at line 65 of file geometry.h.

00066               {
00067                      return name;
00068               }

const AABB& VRUT::Geometry::GetAABB (  )  const [inline]

Get AABB.

Definition at line 70 of file geometry.h.

00071               {
00072                      return aabb;
00073               }

virtual void VRUT::Geometry::BuildAABB (  )  [pure virtual]

Build AABB.

Implemented in VRUT::GeometryTriangles.

virtual bool VRUT::Geometry::Intersects ( const Ray ray,
float *  dist = (float *) NULL 
) const [pure virtual]

Check if ray intersects geometry, get intersection point distance from ray origin if it does NOTE: everything must be in one space (model space by default), dist will be in that space too!

Implemented in VRUT::GeometryTriangles.

virtual bool VRUT::Geometry::CastRay ( const Ray ray,
RayIntersectionInfo info 
) const [inline, virtual]

Cast ray towards the geometry, get intersection info if it does NOTE: everything must be in one space (model space by default), intersection info will be in that space too!

Reimplemented in VRUT::GeometryTriangles.

Definition at line 83 of file geometry.h.

00083                                                                                 {
00084               // not pure virtual for now !
00085               return false;
00086          }

virtual std::vector<Triangle> VRUT::Geometry::Triangulate (  )  const [pure virtual]

Get geometry as list of triangles.

Implemented in VRUT::GeometryTriangles.

virtual void VRUT::Geometry::AddBox ( const vector3 position,
const vector3 size 
) [pure virtual]

Add Box to geometry.

Implemented in VRUT::GeometryTriangles.

virtual wxString VRUT::Geometry::ToString (  )  const [inline, virtual]

Get string with geometry properties.

Reimplemented in VRUT::GeometryTriangles.

Definition at line 95 of file geometry.h.

00096               {
00097                      return wxString::Format(wxT("Geometry type: %i\n"),     unsigned(type));
00098               }

virtual Geometry* VRUT::Geometry::Clone (  )  const [pure virtual]

Get copy of instance.

Implemented in VRUT::GeometryTriangles.


Friends And Related Function Documentation

friend class Scene [friend]

Definition at line 102 of file geometry.h.


Member Data Documentation

wxString VRUT::Geometry::name [protected]

Name.

Definition at line 45 of file geometry.h.

Model space axis aligned bounding box.

Definition at line 47 of file geometry.h.


The documentation for this class was generated from the following file:

Generated on Tue Mar 10 14:41:42 2009 for VRUT by  doxygen 1.5.5