Assignments Assignments

Public Member Functions | Protected Attributes | List of all members
Ray::AffineShape Class Referenceabstract

`#include <shapeList.h>`

Inheritance diagram for Ray::AffineShape:

## Public Member Functions
| AffineShape (void)
virtual Util::Matrix4D | getMatrix (void) const =0
virtual Util::Matrix4D | getInverseMatrix (void) const =0
virtual Util::Matrix3D | getNormalMatrix (void) const =0
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
virtual bool | isInside (Util::Point3D p) const
virtual void | drawOpenGL (GLSLProgram *glslProgram) const
Public Member Functions inherited from Ray::Shape
virtual | ~Shape (void)
ShapeBoundingBox | boundingBox (void) const
virtual void | init (const class LocalSceneData &data)=0
virtual std::string | name (void) const =0
virtual void | addTrianglesOpenGL (std::vector< class TriangleIndex > &triangles)
size_t | primitiveNum (void) const

## Protected Attributes
Shape * | _shape
Protected Attributes inherited from Ray::Shape
ShapeBoundingBox | _bBox
size_t | _primitiveNum

## 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
Static Public Member Functions inherited from Ray::Shape
static void | WriteInset (std::ostream &stream)
Static Public Attributes inherited from Ray::Shape
static unsigned int | OpenGLTessellationComplexity
static unsigned int | WriteInsetSize = 0

## Detailed Description

This abstract class represents a Shape with an affine transformation associated to it

## Constructor & Destructor Documentation

## ◆ AffineShape()

AffineShape::AffineShape | ( | void |  | ) |

The default constructor

## Member Function Documentation

## ◆ drawOpenGL()

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

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

Implements Ray::Shape.

## ◆ getInverseMatrix()

virtual Util::Matrix4D Ray::AffineShape::getInverseMatrix | ( | void |  | ) | const
| pure virtual

This method returns the inverse of the transformation associated with the list.

Implemented in Ray::DynamicAffineShape, and Ray::StaticAffineShape.

## ◆ getMatrix()

virtual Util::Matrix4D Ray::AffineShape::getMatrix | ( | void |  | ) | const
| pure virtual

This method returns the transformation associated with the list.

Implemented in Ray::DynamicAffineShape, and Ray::StaticAffineShape.

## ◆ getNormalMatrix()

virtual Util::Matrix3D Ray::AffineShape::getNormalMatrix | ( | void |  | ) | const
| pure virtual

This method returns the transformation that acts on the surface normals.

Implemented in Ray::DynamicAffineShape, and Ray::StaticAffineShape.

## ◆ initOpenGL()

void AffineShape::initOpenGL | ( | void |  | ) |
| virtual

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

Implements Ray::Shape.

Reimplemented in Ray::StaticAffineShape.

## ◆ isInside()

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

## ◆ processAllIntersections()

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

## ◆ processFirstIntersection()

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

## ◆ processOverlapping()

void AffineShape::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.

## ◆ updateBoundingBox()

void AffineShape::updateBoundingBox | ( | void |  | ) |
| virtual

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

Implements Ray::Shape.

## Member Data Documentation

## ◆ _shape

Shape* Ray::AffineShape::_shape
| protected

The shape to be transformed

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

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