11#pragma warning( disable : 4290 )
20#ifdef VERBOSE_MESSAGING
21inline void AssertOpenGLState( std::string fileName ,
int line , std::string functionName )
26 std::cerr <<
Util::MakeMessageString(
"[OPEN_GL ERROR]" , fileName , line , functionName , gluErrorString( errorCode ) ,
" (" , errorCode ,
")" ) << std::endl;
30#ifndef ASSERT_OPEN_GL_STATE
31#define ASSERT_OPEN_GL_STATE( ... ) AssertOpenGLState( __FILE__ , __LINE__ , __FUNCTION__ )
39 std::cerr <<
Util::MakeMessageString(
"[OPEN_GL ERROR]" , functionName , gluErrorString( errorCode ) ,
" (" , errorCode ,
")" ) << std::endl;
43#ifndef ASSERT_OPEN_GL_STATE
44#define ASSERT_OPEN_GL_STATE( ... ) AssertOpenGLState( __FUNCTION__ )
66 static void Reset(
void );
71 static size_t RayNum(
void );
95 virtual void _write( std::ostream &stream )
const = 0;
98 virtual void _read( std::istream &stream ) = 0;
114 static void WriteInset( std::ostream &stream );
132 virtual std::string
name(
void )
const = 0;
183 inline std::ostream &
operator << ( std::ostream &stream ,
const Shape &shape ){ shape.
_write( stream ) ;
return stream; }
Definition GLSLProgram.h:33
std::function< void(const ShapeProcessingInfo &, const Shape &) > Kernel
Definition shape.h:163
size_t primitiveNum(void) const
Definition shape.cpp:32
ShapeBoundingBox boundingBox(void) const
Definition shape.cpp:30
ShapeBoundingBox _bBox
Definition shape.h:101
virtual void initOpenGL(void)=0
virtual void init(const class LocalSceneData &data)=0
std::function< bool(double) > RayIntersectionFilter
Definition shape.h:164
virtual std::string name(void) const =0
virtual void _write(std::ostream &stream) const =0
virtual int processAllIntersections(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const =0
virtual bool isInside(Util::Point3D p) const =0
static void WriteInset(std::ostream &stream)
Definition shape.cpp:28
static unsigned int WriteInsetSize
Definition shape.h:111
std::function< bool(const ShapeProcessingInfo &, const class RayShapeIntersectionInfo &) > RayIntersectionKernel
Definition shape.h:165
virtual void _read(std::istream &stream)=0
virtual void drawOpenGL(GLSLProgram *glslProgram) const =0
friend std::istream & operator>>(std::istream &, Shape &)
Definition shape.h:186
virtual void updateBoundingBox(void)=0
std::function< ShapeProcessingInfo::ProcessingType(const ShapeProcessingInfo &, const Shape &) > Filter
Definition shape.h:162
virtual bool processFirstIntersection(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const =0
friend std::ostream & operator<<(std::ostream &, const Shape &)
Definition shape.h:183
virtual void addTrianglesOpenGL(std::vector< class TriangleIndex > &triangles)
Definition shape.h:142
virtual ~Shape(void)
Definition shape.h:117
virtual void processOverlapping(const Filter &filter, const Kernel &kernel, ShapeProcessingInfo spInfo) const
Definition shape.cpp:41
size_t _primitiveNum
Definition shape.h:104
static unsigned int OpenGLTessellationComplexity
Definition shape.h:108
Definition geometry.h:345
Definition geometry.h:168
Definition geometry.h:299
unsigned int GLenum
Definition glew.h:278
#define GL_NO_ERROR
Definition glew.h:318
GLAPI GLenum GLAPIENTRY glGetError(void)
JSAMPIMAGE data
Definition jpeglib.h:945
std::istream & operator>>(std::istream &stream, Camera &camera)
Definition camera.cpp:15
std::ostream & operator<<(std::ostream &stream, const Camera &camera)
Definition camera.cpp:25
std::string MakeMessageString(std::string header, std::string fileName, int line, std::string functionName, Arguments ... arguments)
Definition exceptions.h:60
void AssertOpenGLState(std::string functionName)
Definition shape.h:34
static bool DebugFlag
Definition shape.h:54
static size_t RayNum(void)
Definition shape.cpp:60
static void Reset(void)
Definition shape.cpp:54
static std::atomic< size_t > _RayNum
Definition shape.h:60
static void IncrementRayNum(unsigned int count=1)
Definition shape.cpp:55
static std::atomic< size_t > _ConeBoundingBoxIntersectionNum
Definition shape.h:63
static size_t RayBoundingBoxIntersectionNum(void)
Definition shape.cpp:62
static void IncrementRayPrimitiveIntersectionNum(unsigned int count=1)
Definition shape.cpp:56
static void IncrementConeBoundingBoxIntersectionNum(unsigned int count=1)
Definition shape.cpp:58
static std::atomic< size_t > _RayPrimitiveIntersectionNum
Definition shape.h:61
static size_t RayPrimitiveIntersectionNum(void)
Definition shape.cpp:61
static std::atomic< size_t > _RayBoundingBoxIntersectionNum
Definition shape.h:62
static void IncrementRayBoundingBoxIntersectionNum(unsigned int count=1)
Definition shape.cpp:57
static size_t ConeBoundingBoxIntersectionNum(void)
Definition shape.cpp:63
Util::Matrix4D localToGlobal
Definition shape.h:150
ShapeProcessingInfo(void)
Definition shape.cpp:34
Util::Matrix4D globalToLocal
Definition shape.h:150
Util::Matrix3D normalLocalToGlobal
Definition shape.h:151
const class Material * material
Definition shape.h:152
ProcessingType
Definition shape.h:155
@ NONE
Definition shape.h:156
@ PROPAGATE
Definition shape.h:157
@ TERMINATE
Definition shape.h:158
Util::Matrix3D directionGlobalToLocal
Definition shape.h:151
ShapeBoundingBox(void)
Definition shape.h:80
Util::BoundingBox1D intersect(const Util::Ray3D &ray) const
Definition shape.cpp:15
ShapeBoundingBox(const ShapeBoundingBox &bBox)
Definition shape.h:81
ShapeBoundingBox & operator=(const ShapeBoundingBox &bBox)
Definition shape.h:83
ShapeBoundingBox(const Util::BoundingBox3D &bBox)
Definition shape.h:82