Changeset View
Changeset View
Standalone View
Standalone View
source/blender/freestyle/intern/view_map/BoxGrid.cpp
| Show All 32 Lines | |||||
| // Helper Classes | // Helper Classes | ||||
| // OccluderData | // OccluderData | ||||
| /////////////// | /////////////// | ||||
| // Cell | // Cell | ||||
| ///////// | ///////// | ||||
| BoxGrid::Cell::Cell() | |||||
| { | |||||
| } | |||||
| BoxGrid::Cell::~Cell() | |||||
| { | |||||
| } | |||||
| void BoxGrid::Cell::setDimensions(real x, real y, real sizeX, real sizeY) | void BoxGrid::Cell::setDimensions(real x, real y, real sizeX, real sizeY) | ||||
| { | { | ||||
| const real epsilon = 1.0e-06; | const real epsilon = 1.0e-06; | ||||
| boundary[0] = x - epsilon; | boundary[0] = x - epsilon; | ||||
| boundary[1] = x + sizeX + epsilon; | boundary[1] = x + sizeX + epsilon; | ||||
| boundary[2] = y - epsilon; | boundary[2] = y - epsilon; | ||||
| boundary[3] = y + sizeY + epsilon; | boundary[3] = y + sizeY + epsilon; | ||||
| } | } | ||||
| Show All 25 Lines | cout << "Searching for occluders of edge centered at " << _target << " in cell [" | ||||
| << _cell->boundary[3] << "] (" << _cell->faces.size() << " occluders)" << endl; | << _cell->boundary[3] << "] (" << _cell->faces.size() << " occluders)" << endl; | ||||
| } | } | ||||
| #endif | #endif | ||||
| // Set iterator | // Set iterator | ||||
| _current = _cell->faces.begin(); | _current = _cell->faces.begin(); | ||||
| } | } | ||||
| BoxGrid::Iterator::~Iterator() | |||||
| { | |||||
| } | |||||
| // BoxGrid | // BoxGrid | ||||
| ///////////////// | ///////////////// | ||||
| BoxGrid::BoxGrid(OccluderSource &source, | BoxGrid::BoxGrid(OccluderSource &source, | ||||
| GridDensityProvider &density, | GridDensityProvider &density, | ||||
| ViewMap *viewMap, | ViewMap *viewMap, | ||||
| Vec3r &viewpoint, | Vec3r &viewpoint, | ||||
| bool enableQI) | bool enableQI) | ||||
| Show All 17 Lines | BoxGrid::BoxGrid(OccluderSource &source, | ||||
| } | } | ||||
| reorganizeCells(); | reorganizeCells(); | ||||
| if (G.debug & G_DEBUG_FREESTYLE) { | if (G.debug & G_DEBUG_FREESTYLE) { | ||||
| cout << "Ready to use BoxGrid" << endl; | cout << "Ready to use BoxGrid" << endl; | ||||
| } | } | ||||
| } | } | ||||
| BoxGrid::~BoxGrid() | BoxGrid::~BoxGrid() = default; | ||||
| { | |||||
| } | |||||
| void BoxGrid::assignCells(OccluderSource & /*source*/, | void BoxGrid::assignCells(OccluderSource & /*source*/, | ||||
| GridDensityProvider &density, | GridDensityProvider &density, | ||||
| ViewMap *viewMap) | ViewMap *viewMap) | ||||
| { | { | ||||
| _cellSize = density.cellSize(); | _cellSize = density.cellSize(); | ||||
| _cellsX = density.cellsX(); | _cellsX = density.cellsX(); | ||||
| _cellsY = density.cellsY(); | _cellsY = density.cellsY(); | ||||
| ▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | const Vec3r &BoxGrid::viewpoint() const | ||||
| return _viewpoint; | return _viewpoint; | ||||
| } | } | ||||
| bool BoxGrid::enableQI() const | bool BoxGrid::enableQI() const | ||||
| { | { | ||||
| return _enableQI; | return _enableQI; | ||||
| } | } | ||||
| BoxGrid::Transform::Transform() | |||||
| { | |||||
| } | |||||
| Vec3r BoxGrid::Transform::operator()(const Vec3r &point) const | Vec3r BoxGrid::Transform::operator()(const Vec3r &point) const | ||||
| { | { | ||||
| return Vec3r(point[0], point[1], -point[2]); | return Vec3r(point[0], point[1], -point[2]); | ||||
| } | } | ||||
| } /* namespace Freestyle */ | } /* namespace Freestyle */ | ||||