Assignments Assignments

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

`#include <shapeList.h>`

Inheritance diagram for Ray::TriangleList:

## Public Member Functions
| TriangleList (void)
std::string | name (void) const
void | init (const class LocalSceneData &data)
void | initOpenGL (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
void | drawOpenGL (GLSLProgram *glslProgram) const
Public Member Functions inherited from Ray::ShapeList
void | updateBoundingBox (void)
bool | isInside (Util::Point3D p) 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::ShapeList
static std::string | Directive (void)
Static Public Member Functions inherited from Ray::Shape
static void | WriteInset (std::ostream &stream)

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

## Private Attributes
GLuint | _vertexBufferID = 0
GLuint | _elementBufferID = 0
unsigned int | _tNum
unsigned int | _vNum
const class Vertex * | _vertices
int | _materialIndex
const class Material * | _material

## 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
Public Attributes inherited from Ray::ShapeList
std::vector< Shape * > | shapes
Static Public Attributes inherited from Ray::ShapeList
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 Attributes inherited from Ray::Shape
ShapeBoundingBox | _bBox
size_t | _primitiveNum

## Detailed Description

This class represents a node which stores a triangle list. It's children can only be Triangles or TrivialShapeLists.

## Constructor & Destructor Documentation

## ◆ TriangleList()

TriangleList::TriangleList | ( | void |  | ) |

The default constructor

## Member Function Documentation

## ◆ _read()

void TriangleList::_read | ( | std::istream & | stream | ) |
| private virtual

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

Reimplemented from Ray::ShapeList.

## ◆ _write()

void TriangleList::_write | ( | std::ostream & | stream | ) | const
| private virtual

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

Reimplemented from Ray::ShapeList.

## ◆ Directive()

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

This static method returns the directive header describing the shape.

## ◆ drawOpenGL()

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

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

Reimplemented from Ray::ShapeList.

## ◆ init()

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

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

Reimplemented from Ray::ShapeList.

## ◆ initOpenGL()

void TriangleList::initOpenGL | ( | void |  | ) |
| virtual

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

Reimplemented from Ray::ShapeList.

## ◆ name()

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

This method returns the name of the shape

Reimplemented from Ray::ShapeList.

## ◆ processAllIntersections()

int TriangleList::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.

Reimplemented from Ray::ShapeList.

## ◆ processFirstIntersection()

bool TriangleList::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.

Reimplemented from Ray::ShapeList.

## ◆ processOverlapping()

void TriangleList::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::ShapeList.

## Member Data Documentation

## ◆ _elementBufferID

GLuint Ray::TriangleList::_elementBufferID = 0
| private

The OpenGL element buffer identifier

## ◆ _material

const class Material* Ray::TriangleList::_material
| private

The material associated to all triangles within the list

## ◆ _materialIndex

int Ray::TriangleList::_materialIndex
| private

The index of the material associated with the box

## ◆ _tNum

unsigned int Ray::TriangleList::_tNum
| private

The number of triangles in the list

## ◆ _vertexBufferID

GLuint Ray::TriangleList::_vertexBufferID = 0
| private

The OpenGL vertex buffer identifier

## ◆ _vertices

const class Vertex* Ray::TriangleList::_vertices
| private

The list of vertices

## ◆ _vNum

unsigned int Ray::TriangleList::_vNum
| private

The number of vertices in the list

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

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