Assignments Assignments

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Private Member Functions | List of all members
Ray::ShapeList Class Reference

`#include <shapeList.h>`

Inheritance diagram for Ray::ShapeList:

## Public Member Functions
std::string | name (void) const
void | init (const class LocalSceneData &data)
void | initOpenGL (void)
void | updateBoundingBox (void)
bool | processFirstIntersection (const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
int | processAllIntersections (const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
void | processOverlapping (const Filter &filter, const Kernel &kernel, ShapeProcessingInfo tInfo) const
bool | isInside (Util::Point3D p) const
void | drawOpenGL (GLSLProgram *glslProgram) const
void | addTrianglesOpenGL (std::vector< class TriangleIndex > &triangles)
Public Member Functions inherited from Ray::Shape
virtual | ~Shape (void)
ShapeBoundingBox | boundingBox (void) const
size_t | primitiveNum (void) const

## Static Public Member Functions
static std::string | Directive (void)
Static Public Member Functions inherited from Ray::Shape
static void | WriteInset (std::ostream &stream)

## Public Attributes
std::vector< Shape * > | shapes

## Static Public Attributes
static std::unordered_map< std::string, Util::BaseFactory< Shape > * > | ShapeFactories
Static Public Attributes inherited from Ray::Shape
static unsigned int | OpenGLTessellationComplexity
static unsigned int | WriteInsetSize = 0

## Protected Member Functions
void | _write (std::ostream &stream) const
void | _read (std::istream &stream)

## Static Private Member Functions
static std::string | _DirectiveHeader (void)

## Additional Inherited Members
Public Types inherited from Ray::Shape
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< bool(const ShapeProcessingInfo &, const class RayShapeIntersectionInfo &) > | RayIntersectionKernel
Protected Attributes inherited from Ray::Shape
ShapeBoundingBox | _bBox
size_t | _primitiveNum

## Detailed Description

This class represents a node in the scene graph containing one or more shapes

## Member Function Documentation

## ◆ _DirectiveHeader()

static std::string Ray::ShapeList::_DirectiveHeader | ( | void |  | ) |
| inline static private

This static method returns the directive header describing the shape.

## ◆ _read()

void ShapeList::_read | ( | std::istream & | stream | ) |
| protected virtual

This method reads the Shape from the stream (excluding the starting directive)

Implements Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ _write()

void ShapeList::_write | ( | std::ostream & | stream | ) | const
| protected virtual

This method writes the Shape into the stream (including the starting directive)

Implements Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ addTrianglesOpenGL()

void ShapeList::addTrianglesOpenGL | ( | std::vector< class TriangleIndex > & | triangles | ) |
| virtual

This method adds a triangle to the list of triangles (if the object is of type RayTriangle).

Reimplemented from Ray::Shape.

## ◆ Directive()

static std::string Ray::ShapeList::Directive | ( | void |  | ) |
| inline static

This static method returns the directive describing the shape.

## ◆ drawOpenGL()

void ShapeList::drawOpenGL | ( | GLSLProgram * | glslProgram | ) | const
| virtual

This method calls the necessary OpenGL commands to render the primitive.

Implements Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ init()

void ShapeList::init | ( | const class LocalSceneData & | data | ) |
| virtual

This method should be called (once) immediately after setting up the scene graph

Implements Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ initOpenGL()

void ShapeList::initOpenGL | ( | void |  | ) |
| virtual

This method should be called (once) after an OpenGL context has been created

Implements Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ isInside()

bool ShapeList::isInside | ( | Util::Point3D | p | ) | const
| 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.

Implements Ray::Shape.

## ◆ name()

std::string Ray::ShapeList::name | ( | void |  | ) | const
| inline virtual

This method returns the name of the shape

Implements Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ processAllIntersections()

int ShapeList::processAllIntersections | ( | const Util::Ray3D & | ray,
|  | const Util::BoundingBox1D & | range,
|  | const RayIntersectionFilter & | rFilter,
|  | const RayIntersectionKernel & | rKernel,
|  | ShapeProcessingInfo | spInfo,
|  | unsigned int | tIdx ) const
| 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.

Implements Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ processFirstIntersection()

bool ShapeList::processFirstIntersection | ( | const Util::Ray3D & | ray,
|  | const Util::BoundingBox1D & | range,
|  | const RayIntersectionFilter & | rFilter,
|  | const RayIntersectionKernel & | rKernel,
|  | ShapeProcessingInfo | spInfo,
|  | unsigned int | tIdx ) const
| 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.

Implements Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ processOverlapping()

void ShapeList::processOverlapping | ( | const Filter & | filter,
|  | const Kernel & | kernel,
|  | ShapeProcessingInfo | spInfo ) const
| 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 from Ray::Shape.

Reimplemented in Ray::TriangleList.

## ◆ updateBoundingBox()

void ShapeList::updateBoundingBox | ( | void |  | ) |
| virtual

This method should be called to update the bounding boxes in the scene

Implements Ray::Shape.

## Member Data Documentation

## ◆ ShapeFactories

std::unordered_map< std::string, BaseFactory< Shape > * > ShapeList::ShapeFactories
| static

The set of shape factoendDirectiveries

## ◆ shapes

std::vector< Shape* > Ray::ShapeList::shapes

The shapes that are associated to the node

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

- Assignments/Ray/shapeList.h
- Assignments/Ray/shapeList.cpp
- Assignments/Ray/shapeList.todo.cpp