1
//---------------------------------------------------------------------------
3
// Project: OpenWalnut ( http://www.openwalnut.org )
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
8
// This file is part of OpenWalnut.
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.
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.
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/>.
23
//---------------------------------------------------------------------------
25
#ifndef WINTEGRATIONPARAMETERIZATION_H
26
#define WINTEGRATIONPARAMETERIZATION_H
30
#include "WRasterParameterization.h"
33
* Stores the direction if a line in a separate dataset for each voxel.
35
class WIntegrationParameterization: public WRasterParameterization
40
* Default constructor.
42
* \param grid the grid used for the new dataset.
44
explicit WIntegrationParameterization( boost::shared_ptr< WGridRegular3D > grid );
49
virtual ~WIntegrationParameterization();
52
* This method allows this parameterization to update. It gets called for every voxel which is rasterized by the WRasterAlgorithm.
54
* \param voxel the voxel to parameterize
55
* \param voxelIdx the voxel index in the common grid calculated using "voxel" (this is for convenience)
56
* \param axis Along which axis the traversal takes place. Since when walking in e.g. X-direction there are not supporting voxels in the
57
* \param value the new voxel value
58
* \param start Start point of the line segment (used to computed the distance)
59
* \param end End point of the line segment (used to computed the distance)
61
virtual void parameterizeVoxel( const WValue< int >& voxel, size_t voxelIdx, const int axis, const double value,
62
const WPosition& start,
63
const WPosition& end );
66
* Gets the dataset representing the parameterization.
68
* \return the dataset.
70
virtual boost::shared_ptr< WDataSetScalar > getDataSet();
73
* Gets called for each new line getting rasterized. Here, it is used to reset the internal length integrator
75
* \param line the new line.
77
virtual void newLine( const WLine& line );
80
* Gets called for each new line segment getting rasterized, as one segment can have multiple voxels.
82
* \param start start point of the new line segment
83
* \param end end point of the new line segment
85
virtual void newSegment( const WPosition& start, const WPosition& end );
90
* Stores the current length of the fiber at each voxel.
92
std::vector< double > m_lengthValues;
95
* The current length of a line.
102
#endif // WINTEGRATIONPARAMETERIZATION_H