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
7namespace Ray
8{
12 class Cylinder : public Shape
13 {
15 GLuint _vertexBufferID = 0;
16
18 GLuint _elementBufferID = 0;
19
22
24 const class Material *_material;
25 public:
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
Definition: GLSLProgram.h:33
Definition: cylinder.h:13
void updateBoundingBox(void)
Definition: cylinder.todo.cpp:27
int _materialIndex
Definition: cylinder.h:21
Cylinder(void)
Definition: cylinder.cpp:13
void init(const class LocalSceneData &data)
Definition: cylinder.todo.cpp:13
bool isInside(Util::Point3D p) const
Definition: cylinder.todo.cpp:69
GLuint _vertexBufferID
Definition: cylinder.h:15
Util::Point3D center
Definition: cylinder.h:27
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
GLuint _elementBufferID
Definition: cylinder.h:18
void drawOpenGL(GLSLProgram *glslProgram) const
Definition: cylinder.todo.cpp:78
const class Material * _material
Definition: cylinder.h:24
double height
Definition: cylinder.h:30
static std::string Directive(void)
Definition: cylinder.h:36
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
std::string name(void) const
Definition: cylinder.h:48
void initOpenGL(void)
Definition: cylinder.todo.cpp:35
double radius
Definition: cylinder.h:33
void _write(std::ostream &stream) const
Definition: cylinder.cpp:20
void _read(std::istream &stream)
Definition: cylinder.cpp:15
Definition: scene.h:62
Definition: scene.h:249
Definition: shape.h:89
std::function< bool(double) > RayIntersectionFilter
Definition: shape.h:163
std::function< void(const ShapeProcessingInfo &, const class RayShapeIntersectionInfo &) > RayIntersectionKernel
Definition: shape.h:164
Definition: geometry.h:345
Definition: geometry.h:299
Definition: box.h:7