Lightmetrica  0.0.1.50dbee3 (yosakoi)
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
Primitives Class Referenceabstract

#include <primitives.h>

Public Member Functions

 LM_COMPONENT_INTERFACE_DEF ("primitives")
 
virtual bool Load (const ConfigNode &node, const Assets &assets)=0
 
virtual bool PostConfigure (const Scene &scene)=0
 
virtual bool IntersectEmitterShapes (Ray &ray, Intersection &isect) const =0
 
virtual AABB GetAABBEmitterShapes () const =0
 
virtual void Reset ()=0
 
virtual int NumPrimitives () const =0
 
virtual const PrimitivePrimitiveByIndex (int index) const =0
 
virtual const PrimitivePrimitiveByID (const std::string &id) const =0
 
virtual const CameraMainCamera () const =0
 
virtual int NumLights () const =0
 
virtual const LightLightByIndex (int index) const =0
 
- Public Member Functions inherited from Component
virtual std::string ComponentInterfaceTypeName () const =0
 
virtual std::string ComponentImplTypeName () const =0
 
- Public Member Functions inherited from SIMDAlignedType
void * operator new (std::size_t size) throw (std::bad_alloc)
 
void operator delete (void *p)
 

Detailed Description

Primitives. A set of primitives for scene description.

Inheritance diagram for Primitives:
Component SIMDAlignedType PrimitivesImpl StubPrimitives

Member Function Documentation

virtual bool Primitives::IntersectEmitterShapes ( Ray ray,
Intersection isect 
) const
pure virtual

Intersection query with emitter shapes. When intersected, information on the hit point is stored in the intersection data.

Parameters
rayRay.
isectIntersection data.
Return values
trueIntersected with the scene.
falseNot intersected with the scene.

Implemented in StubPrimitives, and PrimitivesImpl.

virtual const Light* Primitives::LightByIndex ( int  index) const
pure virtual

Get a light by index.

Parameters
indexIndex of a light.
Returns
Light.

Implemented in PrimitivesImpl, and StubPrimitives.

virtual bool Primitives::Load ( const ConfigNode node,
const Assets assets 
)
pure virtual

Load primitives from XML element. Parse the element #node and load the scene. Any reference to the assets are resolved with #assets. The function is not reentrant. If the function fails, the state of #assets may be in the unstable state.

Parameters
nodeA XML element which consists of scene element.
Return values
trueSucceeded to load the scene.
falseFailed to load the scene.

Implemented in StubPrimitives, and PrimitivesImpl.

virtual const Camera* Primitives::MainCamera ( ) const
pure virtual

Get a main camera.

Returns
Main camera.

Implemented in PrimitivesImpl, and StubPrimitives.

virtual int Primitives::NumLights ( ) const
pure virtual

Get the number of lights.

Returns
Number of lights.

Implemented in PrimitivesImpl, and StubPrimitives.

virtual int Primitives::NumPrimitives ( ) const
pure virtual

Get the number of primitives.

Returns
Number of primitives.

Implemented in PrimitivesImpl, and StubPrimitives.

virtual bool Primitives::PostConfigure ( const Scene scene)
pure virtual

Post configuration of the primitive.

Parameters
sceneScene.
Return values
trueSucceeded to configure the scene.
falseFailed to configure the scene.

Implemented in StubPrimitives, and PrimitivesImpl.

virtual const Primitive* Primitives::PrimitiveByID ( const std::string &  id) const
pure virtual

Get a primitive by ID. Note that ID for a primitive is optional.

Parameters
idID of a primitive.
Returns
Primitive.

Implemented in PrimitivesImpl, and StubPrimitives.

virtual const Primitive* Primitives::PrimitiveByIndex ( int  index) const
pure virtual

Get a primitive by index.

Parameters
indexIndex of a primitive.
Returns
Primitive.

Implemented in PrimitivesImpl, and StubPrimitives.

virtual void Primitives::Reset ( )
pure virtual

Reset the scene. Get the scene back to the initial state.

Implemented in PrimitivesImpl, and StubPrimitives.


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