Blender V5.0
Freestyle::FastGrid Class Reference

#include <FastGrid.h>

Inherits Freestyle::Grid.

Public Member Functions

 FastGrid ()
virtual ~FastGrid ()
virtual void clear ()
virtual void configure (const Vec3r &orig, const Vec3r &size, uint nb)
CellgetCell (const Vec3u &p)
virtual void fillCell (const Vec3u &p, Cell &cell)
Public Member Functions inherited from Freestyle::Grid
 Grid ()
virtual ~Grid ()
void getCellCoordinates (const Vec3r &p, Vec3u &res)
CellgetCell (const Vec3r &p)
void getCellOrigin (const Vec3u &cell_coord, Vec3r &orig)
void getCellBox (const Vec3u &cell_coord, Vec3r &min_out, Vec3r &max_out)
void insertOccluder (Polygon3r *occluder)
void addOccluder (Polygon3r *occluder)
void castRay (const Vec3r &orig, const Vec3r &end, OccludersSet &occluders, uint timestamp)
void initAcceleratedRay (const Vec3r &orig, const Vec3r &end, uint timestamp)
void castInfiniteRay (const Vec3r &orig, const Vec3r &dir, OccludersSet &occluders, uint timestamp)
bool initAcceleratedInfiniteRay (const Vec3r &orig, const Vec3r &dir, uint timestamp)
Polygon3rcastRayToFindFirstIntersection (const Vec3r &orig, const Vec3r &dir, double &t, double &u, double &v, uint timestamp)
void initRay (const Vec3r &orig, const Vec3r &end, uint timestamp)
bool initInfiniteRay (const Vec3r &orig, const Vec3r &dir, uint timestamp)
const Vec3rgetOrigin () const
Vec3r gridSize () const
Vec3r getCellSize () const
OccludersSetgetOccluders ()
void displayDebug ()

Protected Attributes

Cell ** _cells
uint _cells_size
Protected Attributes inherited from Freestyle::Grid
uint _timestamp
Vec3u _cells_nb
Vec3r _cell_size
Vec3r _size
Vec3r _orig
Vec3r _ray_dir
Vec3u _current_cell
Vec3r _pt
real _t_end
real _t
OccludersSet _occluders

Additional Inherited Members

Protected Member Functions inherited from Freestyle::Grid
void castRayInternal (GridVisitor &visitor)
bool nextRayCell (Vec3u &current_cell, Vec3u &next_cell)

Detailed Description

Class to define a regular grid used for ray casting computations We don't use a hash-table here. The grid is explicitly stored for faster computations. However, this might result in significant increase in memory usage (compared to the regular grid).

Definition at line 21 of file FastGrid.h.

Constructor & Destructor Documentation

◆ FastGrid()

Freestyle::FastGrid::FastGrid ( )
inline

Definition at line 23 of file FastGrid.h.

References _cells, _cells_size, and Freestyle::Grid::Grid().

◆ ~FastGrid()

virtual Freestyle::FastGrid::~FastGrid ( )
inlinevirtual

Definition at line 29 of file FastGrid.h.

References clear().

Member Function Documentation

◆ clear()

void Freestyle::FastGrid::clear ( )
virtual

clears the grid Deletes all the cells, clears the hash-table, resets size, size of cell, number of cells.

Reimplemented from Freestyle::Grid.

Definition at line 19 of file FastGrid.cpp.

References _cells, _cells_size, Freestyle::Grid::clear(), and i.

Referenced by ~FastGrid().

◆ configure()

void Freestyle::FastGrid::configure ( const Vec3r & orig,
const Vec3r & size,
uint nb )
virtual

Sets the different parameters of the grid orig The grid origin size The grid's dimensions nb The number of cells of the grid

Reimplemented from Freestyle::Grid.

Definition at line 37 of file FastGrid.cpp.

References _cells, Freestyle::Grid::_cells_nb, _cells_size, Freestyle::Grid::configure(), and size().

◆ fillCell()

void Freestyle::FastGrid::fillCell ( const Vec3u & p,
Cell & cell )
virtual

Fills the case p with the cell iCell

Implements Freestyle::Grid.

Definition at line 61 of file FastGrid.cpp.

References _cells, Freestyle::Grid::_cells_nb, _cells_size, BLI_assert, and BLI_assert_msg.

◆ getCell()

Cell * Freestyle::FastGrid::getCell ( const Vec3u & p)
virtual

returns the cell whose coordinates are passed as argument

Implements Freestyle::Grid.

Definition at line 45 of file FastGrid.cpp.

References _cells, Freestyle::Grid::_cells_nb, _cells_size, BLI_assert, BLI_assert_msg, G, and G_DEBUG_FREESTYLE.

Member Data Documentation

◆ _cells

Cell** Freestyle::FastGrid::_cells
protected

Definition at line 57 of file FastGrid.h.

Referenced by clear(), configure(), FastGrid(), fillCell(), and getCell().

◆ _cells_size

uint Freestyle::FastGrid::_cells_size
protected

Definition at line 58 of file FastGrid.h.

Referenced by clear(), configure(), FastGrid(), fillCell(), and getCell().


The documentation for this class was generated from the following files: