Assignments
Assignments
Ray::Cone Class Reference

#include <cone.h>

Inheritance diagram for Ray::Cone:
Ray::Shape

Public Member Functions

 Cone (void)
 
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
 
bool isInside (Util::Point3D p) const
 
void drawOpenGL (GLSLProgram *glslProgram) const
 
- Public Member Functions inherited from Ray::Shape
virtual ~Shape (void)
 
ShapeBoundingBox boundingBox (void) const
 
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
 

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

Util::Point3D center
 
double height
 
double radius
 

Private Member Functions

void _write (std::ostream &stream) const
 
void _read (std::istream &stream)
 

Private Attributes

GLuint _vertexBufferID = 0
 
GLuint _elementBufferID = 0
 
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< void(const ShapeProcessingInfo &, const class RayShapeIntersectionInfo &) > RayIntersectionKernel
 
- 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 cone whose central axis is parallel to the y-axis, and is defined by the center of the cone, the height from the tip to the base and the base of the cone.

Constructor & Destructor Documentation

◆ Cone()

Cone::Cone ( void  )

The default constructor

Member Function Documentation

◆ _read()

void Cone::_read ( std::istream &  stream)
privatevirtual

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

Implements Ray::Shape.

◆ _write()

void Cone::_write ( std::ostream &  stream) const
privatevirtual

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

Implements Ray::Shape.

◆ Directive()

static std::string Ray::Cone::Directive ( void  )
inlinestatic

This static method returns the directive describing the shape.

◆ drawOpenGL()

void Cone::drawOpenGL ( GLSLProgram glslProgram) const
virtual

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

Implements Ray::Shape.

◆ init()

void Cone::init ( const class LocalSceneData data)
virtual

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

Implements Ray::Shape.

◆ initOpenGL()

void Cone::initOpenGL ( void  )
virtual

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

Implements Ray::Shape.

◆ isInside()

bool Cone::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::Cone::name ( void  ) const
inlinevirtual

This method returns the name of the shape

Implements Ray::Shape.

◆ processAllIntersections()

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

◆ updateBoundingBox()

void Cone::updateBoundingBox ( void  )
virtual

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

Implements Ray::Shape.

Member Data Documentation

◆ _elementBufferID

GLuint Ray::Cone::_elementBufferID = 0
private

The OpenGL element buffer identifier

◆ _material

const class Material* Ray::Cone::_material
private

The material associated with the cone

◆ _materialIndex

int Ray::Cone::_materialIndex
private

The index of the material associated with the box

◆ _vertexBufferID

GLuint Ray::Cone::_vertexBufferID = 0
private

The OpenGL vertex buffer identifier

◆ center

Util::Point3D Ray::Cone::center

The center of the cone

◆ height

double Ray::Cone::height

The height of the cone

◆ radius

double Ray::Cone::radius

The radius of the cone


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