Assignments Assignments

cylinder.h
Go to the documentation of this file.
1#ifndef CYLINDER_INCLUDED
2#define CYLINDER_INCLUDED
3#include <Util/geometry.h>
4#include <Util/polynomial.h>
5#include "shape.h"
6
7 namespace Ray
8{
12 class Cylinder : 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_cylinder"; }
37
39 Cylinder( 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 "cylinder"; }
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 // CYLINDER_INCLUDED
GLSLProgram
Definition GLSLProgram.h:33
Ray::Cylinder
Definition cylinder.h:13
Ray::Cylinder::updateBoundingBox
void updateBoundingBox(void)
Definition cylinder.todo.cpp:27
Ray::Cylinder::_materialIndex
int _materialIndex
Definition cylinder.h:21
Ray::Cylinder::Cylinder
Cylinder(void)
Definition cylinder.cpp:13
Ray::Cylinder::init
void init(const class LocalSceneData &data)
Definition cylinder.todo.cpp:13
Ray::Cylinder::isInside
bool isInside(Util::Point3D p) const
Definition cylinder.todo.cpp:69
Ray::Cylinder::_vertexBufferID
GLuint _vertexBufferID
Definition cylinder.h:15
Ray::Cylinder::center
Util::Point3D center
Definition cylinder.h:27
Ray::Cylinder::processFirstIntersection
bool processFirstIntersection(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
Definition cylinder.todo.cpp:46
Ray::Cylinder::_elementBufferID
GLuint _elementBufferID
Definition cylinder.h:18
Ray::Cylinder::drawOpenGL
void drawOpenGL(GLSLProgram *glslProgram) const
Definition cylinder.todo.cpp:78
Ray::Cylinder::_material
const class Material * _material
Definition cylinder.h:24
Ray::Cylinder::height
double height
Definition cylinder.h:30
Ray::Cylinder::Directive
static std::string Directive(void)
Definition cylinder.h:36
Ray::Cylinder::processAllIntersections
int processAllIntersections(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
Definition cylinder.todo.cpp:58
Ray::Cylinder::name
std::string name(void) const
Definition cylinder.h:48
Ray::Cylinder::initOpenGL
void initOpenGL(void)
Definition cylinder.todo.cpp:35
Ray::Cylinder::radius
double radius
Definition cylinder.h:33
Ray::Cylinder::_write
void _write(std::ostream &stream) const
Definition cylinder.cpp:20
Ray::Cylinder::_read
void _read(std::istream &stream)
Definition cylinder.cpp:15
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
Util::BoundingBox
Definition geometry.h:345
Util::Point< 3 >
Util::Ray
Definition geometry.h:299
geometry.h
GLuint
unsigned int GLuint
Definition glew.h:280
data
JSAMPIMAGE data
Definition jpeglib.h:945
Ray
Definition box.h:7
polynomial.h
shape.h