10#pragma warning( disable : 4290 )
19#ifdef VERBOSE_MESSAGING
20inline void AssertOpenGLState( std::string fileName ,
int line , std::string functionName )
23 if( ( errorCode=glGetError() )!=GL_NO_ERROR )
25 std::cerr <<
Util::MakeMessageString(
"[OPEN_GL ERROR]" , fileName , line , functionName , gluErrorString( errorCode ) ,
" (" , errorCode ,
")" ) << std::endl;
29#ifndef ASSERT_OPEN_GL_STATE
30#define ASSERT_OPEN_GL_STATE( ... ) AssertOpenGLState( __FILE__ , __LINE__ , __FUNCTION__ )
36 if( ( errorCode=glGetError() )!=GL_NO_ERROR )
38 std::cerr <<
Util::MakeMessageString(
"[OPEN_GL ERROR]" , functionName , gluErrorString( errorCode ) ,
" (" , errorCode ,
")" ) << std::endl;
42#ifndef ASSERT_OPEN_GL_STATE
43#define ASSERT_OPEN_GL_STATE( ... ) AssertOpenGLState( __FUNCTION__ )
65 static void Reset(
void );
70 static size_t RayNum(
void );
94 virtual void _write( std::ostream &stream )
const = 0;
97 virtual void _read( std::istream &stream ) = 0;
113 static void WriteInset( std::ostream &stream );
131 virtual std::string
name(
void )
const = 0;
182 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:162
size_t primitiveNum(void) const
Definition: shape.cpp:32
ShapeBoundingBox boundingBox(void) const
Definition: shape.cpp:30
ShapeBoundingBox _bBox
Definition: shape.h:100
virtual void initOpenGL(void)=0
virtual void init(const class LocalSceneData &data)=0
std::function< bool(double) > RayIntersectionFilter
Definition: shape.h:163
virtual std::string name(void) const =0
virtual void _write(std::ostream &stream) const =0
friend std::istream & operator>>(std::istream &, Shape &)
Definition: shape.h:185
friend std::ostream & operator<<(std::ostream &, const Shape &)
Definition: shape.h:182
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:110
virtual void _read(std::istream &stream)=0
virtual void drawOpenGL(GLSLProgram *glslProgram) const =0
virtual void updateBoundingBox(void)=0
std::function< ShapeProcessingInfo::ProcessingType(const ShapeProcessingInfo &, const Shape &) > Filter
Definition: shape.h:161
virtual bool processFirstIntersection(const Util::Ray3D &ray, const Util::BoundingBox1D &range, const RayIntersectionFilter &rFilter, const RayIntersectionKernel &rKernel, ShapeProcessingInfo spInfo, unsigned int tIdx) const =0
virtual void addTrianglesOpenGL(std::vector< class TriangleIndex > &triangles)
Definition: shape.h:141
std::function< void(const ShapeProcessingInfo &, const class RayShapeIntersectionInfo &) > RayIntersectionKernel
Definition: shape.h:164
virtual ~Shape(void)
Definition: shape.h:116
virtual void processOverlapping(const Filter &filter, const Kernel &kernel, ShapeProcessingInfo spInfo) const
Definition: shape.cpp:41
size_t _primitiveNum
Definition: shape.h:103
static unsigned int OpenGLTessellationComplexity
Definition: shape.h:107
Definition: geometry.h:345
Definition: geometry.h:168
Definition: geometry.h:299
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
BoundingBox< 3 > BoundingBox3D
Definition: geometry.h:577
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:33
static bool DebugFlag
Definition: shape.h:53
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:59
static void IncrementRayNum(unsigned int count=1)
Definition: shape.cpp:55
static std::atomic< size_t > _ConeBoundingBoxIntersectionNum
Definition: shape.h:62
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:60
static size_t RayPrimitiveIntersectionNum(void)
Definition: shape.cpp:61
static std::atomic< size_t > _RayBoundingBoxIntersectionNum
Definition: shape.h:61
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:149
ShapeProcessingInfo(void)
Definition: shape.cpp:34
Util::Matrix4D globalToLocal
Definition: shape.h:149
Util::Matrix3D normalLocalToGlobal
Definition: shape.h:150
const class Material * material
Definition: shape.h:151
ProcessingType
Definition: shape.h:154
@ NONE
Definition: shape.h:155
@ PROPAGATE
Definition: shape.h:156
@ TERMINATE
Definition: shape.h:157
Util::Matrix3D directionGlobalToLocal
Definition: shape.h:150
ShapeBoundingBox(void)
Definition: shape.h:79
Util::BoundingBox1D intersect(const Util::Ray3D &ray) const
Definition: shape.cpp:15
ShapeBoundingBox(const ShapeBoundingBox &bBox)
Definition: shape.h:80
ShapeBoundingBox & operator=(const ShapeBoundingBox &bBox)
Definition: shape.h:82
ShapeBoundingBox(const Util::BoundingBox3D &bBox)
Definition: shape.h:81