Assignments
Assignments
|
#include <shape.h>
Classes | |
struct | ShapeProcessingInfo |
Public Types | |
typedef std::function< ShapeProcessingInfo::ProcessingType(const ShapeProcessingInfo &, const Shape &) > | Filter |
typedef std::function< void(const ShapeProcessingInfo &, const Shape &) > | Kernel |
typedef std::function< bool(double) > | RayIntersectionFilter |
typedef std::function< void(const ShapeProcessingInfo &, const class RayShapeIntersectionInfo &) > | RayIntersectionKernel |
Public Member Functions | |
virtual | ~Shape (void) |
ShapeBoundingBox | boundingBox (void) const |
virtual void | init (const class LocalSceneData &data)=0 |
virtual void | initOpenGL (void)=0 |
virtual void | updateBoundingBox (void)=0 |
virtual std::string | name (void) const =0 |
virtual bool | isInside (Util::Point3D p) const =0 |
virtual void | drawOpenGL (GLSLProgram *glslProgram) const =0 |
virtual void | addTrianglesOpenGL (std::vector< class TriangleIndex > &triangles) |
size_t | primitiveNum (void) const |
virtual void | processOverlapping (const Filter &filter, const Kernel &kernel, ShapeProcessingInfo spInfo) const |
virtual bool | processFirstIntersection (const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const =0 |
virtual int | processAllIntersections (const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const =0 |
Static Public Member Functions | |
static void | WriteInset (std::ostream &stream) |
Static Public Attributes | |
static unsigned int | OpenGLTessellationComplexity |
static unsigned int | WriteInsetSize = 0 |
Protected Attributes | |
ShapeBoundingBox | _bBox |
size_t | _primitiveNum |
Private Member Functions | |
virtual void | _write (std::ostream &stream) const =0 |
virtual void | _read (std::istream &stream)=0 |
This is the abstract class that all ray-traceable objects must implement.
typedef std::function< ShapeProcessingInfo::ProcessingType ( const ShapeProcessingInfo & , const Shape & ) > Ray::Shape::Filter |
typedef std::function< void ( const ShapeProcessingInfo & , const Shape & ) > Ray::Shape::Kernel |
typedef std::function< bool ( double ) > Ray::Shape::RayIntersectionFilter |
typedef std::function< void ( const ShapeProcessingInfo & , const class RayShapeIntersectionInfo & ) > Ray::Shape::RayIntersectionKernel |
|
inlinevirtual |
The destructor
|
privatepure virtual |
This method reads the Shape from the stream (excluding the starting directive)
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::StaticAffineShape, Ray::DynamicAffineShape, Ray::Difference, Ray::ShapeList, Ray::TriangleList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
privatepure virtual |
This method writes the Shape into the stream (including the starting directive)
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::StaticAffineShape, Ray::DynamicAffineShape, Ray::Difference, Ray::ShapeList, Ray::TriangleList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
inlinevirtual |
This method adds a triangle to the list of triangles (if the object is of type RayTriangle).
Reimplemented in Ray::ShapeList, and Ray::Triangle.
ShapeBoundingBox Shape::boundingBox | ( | void | ) | const |
The method returns the bounding box of the shape
|
pure virtual |
This method calls the necessary OpenGL commands to render the primitive.
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::AffineShape, Ray::Difference, Ray::ShapeList, Ray::TriangleList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
pure virtual |
This method should be called (once) immediately after setting up the scene graph
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::StaticAffineShape, Ray::DynamicAffineShape, Ray::Difference, Ray::ShapeList, Ray::TriangleList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
pure virtual |
This method should be called (once) after an OpenGL context has been created
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::Scene, Ray::AffineShape, Ray::StaticAffineShape, Ray::Difference, Ray::ShapeList, Ray::TriangleList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
pure virtual |
This method determines if a point is inside a shape. It is assumed that if the shape is not water-tight, the method returns false.
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::AffineShape, Ray::Difference, Ray::ShapeList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
pure virtual |
This method returns the name of the shape
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::StaticAffineShape, Ray::DynamicAffineShape, Ray::Difference, Ray::ShapeList, Ray::TriangleList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
size_t Shape::primitiveNum | ( | void | ) | const |
This method returns the count of basic shapes contained within the Shape.
|
pure virtual |
This method processes all shapes which intersect the ray within the prescribed range and passing the rFilter test, invoking the rKernel kernel with the intersection information. The processing terminates early if the kernel returns false. The function returns the number of valid intersections.
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::Scene, Ray::AffineShape, Ray::Difference, Ray::ShapeList, Ray::TriangleList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
pure virtual |
This method processes the first shape which intersect the ray within the prescribed range and passing the rFilter test, invoking the rKernel kernel with the intersection information. The function returns true if there was an intersection.
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::Scene, Ray::AffineShape, Ray::Difference, Ray::ShapeList, Ray::TriangleList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
virtual |
This method process Shapes by calling the "kernel" function on every shape whose bounding box passes the "filter" test. The tInfo parameter stores the accumulation of transformations encountered when traversing the scene-graph. Note that the bounding box is in the coordinate frame of the node.
Reimplemented in Ray::FileInstance, Ray::SceneGeometry, Ray::AffineShape, Ray::ShapeList, and Ray::TriangleList.
|
pure virtual |
This method should be called to update the bounding boxes in the scene
Implemented in Ray::Box, Ray::Cone, Ray::Cylinder, Ray::FileInstance, Ray::SceneGeometry, Ray::AffineShape, Ray::Difference, Ray::ShapeList, Ray::Union, Ray::Intersection, Ray::Sphere, Ray::Torus, and Ray::Triangle.
|
static |
This static method insets for writing.
|
protected |
This member represents the bounding box of the shape.
|
protected |
This member represents the number of primitives describing the shape.
|
static |
A global variable representing how finely shapes should be tessellated for rendering as triangle meshes.
|
static |
A global variable representing how inset the next shape should be when writing to a stream.