Assignments Assignments

torus.h
Go to the documentation of this file.
1#ifndef TORUS_INCLUDED
2#define TORUS_INCLUDED
3#include <Util/geometry.h>
4#include <Util/polynomial.h>
5#include "shape.h"
6
7 namespace Ray
8{
10 class Torus : public Shape
11 {
13 GLuint _vertexBufferID = 0;
14
16 GLuint _elementBufferID = 0;
17
19 int _materialIndex;
20
22 const class Material *_material;
23
24 public:
26 static std::string Directive( void ){ return "shape_torus"; }
27
29 Util::Point3D center;
30
32 double iRadius;
33
35 double oRadius;
36
38 Torus( void );
39
41 // Shape methods //
43 private:
44 void _write( std::ostream &stream ) const;
45 void _read( std::istream &stream );
46 public:
47 std::string name( void ) const { return "torus"; }
48 void init( const class LocalSceneData &data );
49 void initOpenGL( void );
50 void updateBoundingBox( void );
51 bool processFirstIntersection( const Util::Ray3D &ray , const Util::BoundingBox1D &range , const RayIntersectionFilter &rFilter , const RayIntersectionKernel &rKernel , ShapeProcessingInfo spInfo , unsigned int tIdx ) const;
52 int processAllIntersections( const Util::Ray3D &ray , const Util::BoundingBox1D &range , const RayIntersectionFilter &rFilter , const RayIntersectionKernel &rKernel , ShapeProcessingInfo spInfo , unsigned int tIdx ) const;
53 bool isInside( Util::Point3D p ) const;
54 void drawOpenGL( GLSLProgram * glslProgram ) const;
55 };
56}
57#endif // TORUS_INCLUDED
58
GLSLProgram
Definition GLSLProgram.h:33
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
Ray::Torus
Definition torus.h:11
Ray::Torus::Directive
static std::string Directive(void)
Definition torus.h:26
Ray::Torus::name
std::string name(void) const
Definition torus.h:47
Ray::Torus::processAllIntersections
int processAllIntersections(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
Definition torus.todo.cpp:56
Ray::Torus::Torus
Torus(void)
Definition torus.cpp:13
Ray::Torus::initOpenGL
void initOpenGL(void)
Definition torus.todo.cpp:33
Ray::Torus::drawOpenGL
void drawOpenGL(GLSLProgram *glslProgram) const
Definition torus.todo.cpp:77
Ray::Torus::_read
void _read(std::istream &stream)
Definition torus.cpp:15
Ray::Torus::iRadius
double iRadius
Definition torus.h:32
Ray::Torus::_materialIndex
int _materialIndex
Definition torus.h:19
Ray::Torus::processFirstIntersection
bool processFirstIntersection(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const
Definition torus.todo.cpp:44
Ray::Torus::_elementBufferID
GLuint _elementBufferID
Definition torus.h:16
Ray::Torus::_vertexBufferID
GLuint _vertexBufferID
Definition torus.h:13
Ray::Torus::center
Util::Point3D center
Definition torus.h:29
Ray::Torus::updateBoundingBox
void updateBoundingBox(void)
Definition torus.todo.cpp:26
Ray::Torus::oRadius
double oRadius
Definition torus.h:35
Ray::Torus::init
void init(const class LocalSceneData &data)
Definition torus.todo.cpp:13
Ray::Torus::_write
void _write(std::ostream &stream) const
Definition torus.cpp:20
Ray::Torus::isInside
bool isInside(Util::Point3D p) const
Definition torus.todo.cpp:68
Ray::Torus::_material
const class Material * _material
Definition torus.h:22
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