OpenWalnut  1.5.0dev
WBresenhamDBL.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WBRESENHAMDBL_H
26 #define WBRESENHAMDBL_H
27 
28 #include <memory>
29 
30 
31 #include "WBresenham.h"
32 #include "core/common/math/WLine.h"
33 #include "core/common/math/linearAlgebra/WPosition.h"
34 #include "core/dataHandler/WGridRegular3D.h"
35 
36 /**
37  * This is a modified version the Bresenham algorithm.
38  */
39 class WBresenhamDBL : public WBresenham
40 {
41 /**
42 * Only UnitTests may be friends.
43 */
44 friend class WBresenhamDBLTest;
45 public:
46  /**
47  * Initializes new raster algo.
48  *
49  * \param grid The grid which defines the voxels which should be marked.
50  * \param antialiased If true then all voxels of a line are supported with
51  * anti-aliasing voxels around
52  */
53  WBresenhamDBL( std::shared_ptr< WGridRegular3D > grid, bool antialiased = true );
54 
55  /**
56  * Finishes this raster algo.
57  */
58  virtual ~WBresenhamDBL();
59 
60 protected:
61  /**
62  * Scans a line segment for voxels which are hit.
63  *
64  * \warning Not every voxel which is hit by the segment will be marked
65  * but at least so many voxels so that the segment is represented by those
66  * voxels.
67  *
68  * \note This algorithm may be slow since using double operations.
69  * \param start Start point of the line segment
70  * \param stop End point of the line segment
71  */
72  void rasterSegment( const WPosition& start, const WPosition& stop );
73 
74 private:
75 };
76 
77 #endif // WBRESENHAMDBL_H
Unit tests the Bresenham algorithm.
This is a modified version the Bresenham algorithm.
Definition: WBresenhamDBL.h:40
virtual ~WBresenhamDBL()
Finishes this raster algo.
WBresenhamDBL(std::shared_ptr< WGridRegular3D > grid, bool antialiased=true)
Initializes new raster algo.
void rasterSegment(const WPosition &start, const WPosition &stop)
Scans a line segment for voxels which are hit.
Implements basic Bresenham algorithm for rasterization.
Definition: WBresenham.h:43
This only is a 3d double vector.