~ubuntu-branches/ubuntu/precise/openwalnut/precise

« back to all changes in this revision

Viewing changes to src/modules/voxelizer/WIntegrationParameterization.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Eichelbaum
  • Date: 2011-06-21 10:26:54 UTC
  • Revision ID: james.westby@ubuntu.com-20110621102654-rq0zf436q949biih
Tags: upstream-1.2.5
ImportĀ upstreamĀ versionĀ 1.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 WINTEGRATIONPARAMETERIZATION_H
 
26
#define WINTEGRATIONPARAMETERIZATION_H
 
27
 
 
28
#include <vector>
 
29
 
 
30
#include "WRasterParameterization.h"
 
31
 
 
32
/**
 
33
 * Stores the direction if a line in a separate dataset for each voxel.
 
34
 */
 
35
class WIntegrationParameterization: public WRasterParameterization
 
36
{
 
37
public:
 
38
 
 
39
    /**
 
40
     * Default constructor.
 
41
     *
 
42
     * \param grid the grid used for the new dataset.
 
43
     */
 
44
    explicit WIntegrationParameterization( boost::shared_ptr< WGridRegular3D > grid );
 
45
 
 
46
    /**
 
47
     * Destructor.
 
48
     */
 
49
    virtual ~WIntegrationParameterization();
 
50
 
 
51
    /**
 
52
     * This method allows this parameterization to update. It gets called for every voxel which is rasterized by the WRasterAlgorithm.
 
53
     *
 
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)
 
60
     */
 
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 );
 
64
 
 
65
    /**
 
66
     * Gets the dataset representing the parameterization.
 
67
     *
 
68
     * \return the dataset.
 
69
     */
 
70
    virtual boost::shared_ptr< WDataSetScalar > getDataSet();
 
71
 
 
72
    /**
 
73
     * Gets called for each new line getting rasterized. Here, it is used to reset the internal length integrator
 
74
     *
 
75
     * \param line the new line.
 
76
     */
 
77
    virtual void newLine( const WLine& line );
 
78
 
 
79
    /**
 
80
     * Gets called for each new line segment getting rasterized, as one segment can have multiple voxels.
 
81
     *
 
82
     * \param start start point of the new line segment
 
83
     * \param end end point of the new line segment
 
84
     */
 
85
    virtual void newSegment( const WPosition& start, const WPosition& end );
 
86
 
 
87
protected:
 
88
 
 
89
    /**
 
90
     * Stores the current length of the fiber at each voxel.
 
91
     */
 
92
    std::vector< double > m_lengthValues;
 
93
 
 
94
    /**
 
95
     * The current length of a line.
 
96
     */
 
97
    double m_curLength;
 
98
 
 
99
private:
 
100
};
 
101
 
 
102
#endif  // WINTEGRATIONPARAMETERIZATION_H