diff options
Diffstat (limited to 'source/blender/freestyle/intern/geometry/Grid.h')
-rwxr-xr-x | source/blender/freestyle/intern/geometry/Grid.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/geometry/Grid.h b/source/blender/freestyle/intern/geometry/Grid.h index e54b7b4d381..a490646ff51 100755 --- a/source/blender/freestyle/intern/geometry/Grid.h +++ b/source/blender/freestyle/intern/geometry/Grid.h @@ -253,6 +253,10 @@ public: const Vec3r& end, OccludersSet& occluders, unsigned timestamp); + // Prepares to cast ray without generating OccludersSet + void initAcceleratedRay(const Vec3r& orig, + const Vec3r& end, + unsigned timestamp); /*! Casts an infinite ray (still finishing at the end of the grid) from a starting point and in a given direction. * Returns the list of occluders contained @@ -263,6 +267,10 @@ public: const Vec3r& dir, OccludersSet& occluders, unsigned timestamp); + // Prepares to cast ray without generating OccludersSet. + bool initAcceleratedInfiniteRay(const Vec3r& orig, + const Vec3r& dir, + unsigned timestamp); /*! Casts an infinite ray (still finishing at the end of the grid) from a starting point and in a given direction. * Returns the first intersection (occluder,t,u,v) or null. @@ -303,6 +311,10 @@ public: inline Vec3r getCellSize() const { return _cell_size; } +//ARB profiling only: + inline OccludersSet* getOccluders() { + return &_occluders; + } void displayDebug() { cerr << "Cells nb : " << _cells_nb << endl; @@ -360,4 +372,21 @@ public: OccludersSet _occluders; // List of all occluders inserted in the grid }; +// +// Class to walk through occluders in grid without building intermediate data structures +// +/////////////////////////////////////////////////////////////////////////////// + +class VirtualOccludersSet { + public: + VirtualOccludersSet(Grid& _grid) : grid (_grid) {}; + Polygon3r* begin(); + Polygon3r* next(); + Polygon3r* next(bool stopOnNewCell); + private: + Polygon3r* firstOccluderFromNextCell(); + Grid& grid; + OccludersSet::iterator it, end; +}; + #endif // GRID_H |