33 #include "WRasterAlgorithm.h"
34 #include "core/common/math/WLine.h"
35 #include "core/common/math/linearAlgebra/WPosition.h"
36 #include "core/common/math/linearAlgebra/WVectorFixed.h"
37 #include "core/dataHandler/WGridRegular3D.h"
56 WBresenham( std::shared_ptr< WGridRegular3D > grid,
bool antialiased =
true );
114 virtual double filter(
const double distance )
const;
138 double composeValue(
double newValue,
double existingValue )
const;
Unit tests the Bresenham algorithm.
Implements basic Bresenham algorithm for rasterization.
virtual void raster(const WLine &line)
Rasterize the given line into the grid of dataset.
WBresenham(std::shared_ptr< WGridRegular3D > grid, bool antialiased=true)
Initializes new raster algo.
virtual double filter(const double distance) const
Returns the value to mark the hit voxels with, depending on their distance to the line.
bool m_antialiased
If true also some supporting voxels are marked.
virtual void markVoxel(const WVector3i &voxel, const int axis, const WPosition &start, const WPosition &end)
Marks the given voxel as a hit.
double composeValue(double newValue, double existingValue) const
Compose the new value for a voxel out of a new computed value and the already existing marking.
virtual ~WBresenham()
Finishes this raster algo.
std::vector< double > computeDistances(const size_t voxelNum, const WPosition &start, const WPosition &end) const
Computes the distances for a voxel to the real line segment and also for its supporting voxels.
virtual void rasterSegment(const WPosition &start, const WPosition &end)
Scans a line segment for voxels which are hit.
A line is an ordered sequence of WPositions.
A fixed size matrix class.
This only is a 3d double vector.
Base class for all rasterization algorithms.