Assignments Assignments

cone.h
Go to the documentation of this file.
1#ifndef CONE_INCLUDED
2#define CONE_INCLUDED
3#include <Util/geometry.h>
4#include <Util/polynomial.h>
5#include "shape.h"
6
7 namespace Ray
8{
12 class Cone : public Shape
13 {
15 GLuint _vertexBufferID = 0;
16
18 GLuint _elementBufferID = 0;
19
21 int _materialIndex;
22
24 const class Material *_material;
25 public:
27 Util::Point3D center;
28
30 double height;
31
33 double radius;
34
36 static std::string Directive( void ){ return "shape_cone"; }
37
39 Cone( void );
40
42 // Shape methods //
44 private:
45 void _write( std::ostream &stream ) const;
46 void _read( std::istream &stream );
47 public:
48 std::string name( void ) const { return "cone"; }
49 void init( const class LocalSceneData &data );
50 void initOpenGL( void );
51 void updateBoundingBox( void );
52 bool processFirstIntersection( const Util::Ray3D &ray , const Util::BoundingBox1D &range , const RayIntersectionFilter &rFilter , const RayIntersectionKernel &rKernel , ShapeProcessingInfo spInfo , unsigned int tIdx ) const;
53 int processAllIntersections( const Util::Ray3D &ray , const Util::BoundingBox1D &range , const RayIntersectionFilter &rFilter , const RayIntersectionKernel &rKernel , ShapeProcessingInfo spInfo , unsigned int tIdx ) const;
54 bool isInside( Util::Point3D p ) const;
55 void drawOpenGL( GLSLProgram *glslProgram ) const;
56 };
57}
58#endif // CONE_INCLUDED
GLSLProgram
Definition GLSLProgram.h:33
Ray::Cone::drawOpenGL
void drawOpenGL(GLSLProgram *glslProgram) const
Definition cone.todo.cpp:79
Ray::Cone::name
std::string name(void) const
Definition cone.h:48
Ray::Cone::center
Util::Point3D center
Definition cone.h:27
Ray::Cone::_materialIndex
int _materialIndex
Definition cone.h:21
Ray::Cone::radius
double radius
Definition cone.h:33
Ray::Cone::_write
void _write(std::ostream &stream) const
Definition cone.cpp:20
Ray::Cone::Directive
static std::string Directive(void)
Definition cone.h:36
Ray::Cone::_elementBufferID
GLuint _elementBufferID
Definition cone.h:18
Ray::Cone::init
void init(const class LocalSceneData &data)
Definition cone.todo.cpp:14
Ray::Cone::_read
void _read(std::istream &stream)
Definition cone.cpp:15
Ray::Cone::isInside
bool isInside(Util::Point3D p) const
Definition cone.todo.cpp:70
Ray::Cone::_vertexBufferID
GLuint _vertexBufferID
Definition cone.h:15
Ray::Cone::Cone
Cone(void)
Definition cone.cpp:13
Ray::Cone::updateBoundingBox
void updateBoundingBox(void)
Definition cone.todo.cpp:28
Ray::Cone::height
double height
Definition cone.h:30
Ray::Cone::_material
const class Material * _material
Definition cone.h:24
Ray::Cone::processFirstIntersection
bool processFirstIntersection(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
Definition cone.todo.cpp:47
Ray::Cone::processAllIntersections
int processAllIntersections(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
Definition cone.todo.cpp:59
Ray::Cone::initOpenGL
void initOpenGL(void)
Definition cone.todo.cpp:36
Ray::LocalSceneData
Definition scene.h:62
Ray::Material
Definition scene.h:249
Ray::Shape
Definition shape.h:90
Ray::Shape::RayIntersectionFilter
std::function< bool(double) > RayIntersectionFilter
Definition shape.h:164
Ray::Shape::RayIntersectionKernel
std::function< bool(const ShapeProcessingInfo &, const class RayShapeIntersectionInfo &) > RayIntersectionKernel
Definition shape.h:165
geometry.h
GLuint
unsigned int GLuint
Definition glew.h:280
data
JSAMPIMAGE data
Definition jpeglib.h:945
Ray
Definition box.h:7
Util::Point3D
Point< 3 > Point3D
Definition geometry.h:526
Util::BoundingBox1D
BoundingBox< 1 > BoundingBox1D
Definition geometry.h:568
Util::Ray3D
Ray< 3 > Ray3D
Definition geometry.h:562
polynomial.h
shape.h