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 WFIBERACCUMULATOR_H
26
#define WFIBERACCUMULATOR_H
30
#include <boost/shared_ptr.hpp>
31
#include <boost/thread.hpp>
33
#include "../common/math/linearAlgebra/WLinearAlgebra.h"
34
#include "WDataSetFiberVector.h"
35
#include "WDataSetFibers.h"
36
#include "WExportDataHandler.h"
39
* A class that encapsulates the data needed to construct a WDataSetFibers.
41
class OWDATAHANDLER_EXPORT WFiberAccumulator // NOLINT
53
virtual ~WFiberAccumulator();
56
* Add a fiber to the dataset.
58
* \param in The fiber to add, stored as a vector of Positions.
60
* This function is threadsafe.
62
void add( std::vector< WVector3d > const& in );
65
* Return the dataset that has been accumulated to this point
66
* and start a new dataset.
68
* \return A shared_ptr pointing to the WDataSetFibers that has been accumulated.
70
* The returned shared_ptr is the sole owner of the WDataSetFibers.
72
boost::shared_ptr< WDataSetFibers > buildDataSet();
83
* A mutex needed to guarantee thread-safety.
85
boost::mutex m_fiberMutex;
88
* One of the vectors needed to construct a WDataSetFibers.
89
* Stores the points in a vector of floats.
91
boost::shared_ptr< std::vector< float > > m_points;
94
* One of the vectors needed to construct a WDataSetFibers.
95
* Stores the starting indices (refering to the points vector) of the fibers.
97
boost::shared_ptr< std::vector< size_t > > m_fiberIndices;
100
* One of the vectors needed to construct a WDataSetFibers.
101
* Stores the length of the fibers.
103
boost::shared_ptr< std::vector< size_t > > m_fiberLengths;
106
* One of the vectors needed to construct a WDataSetFibers.
107
* Stores information about what fiber a point in the points vector refers to.
109
boost::shared_ptr< std::vector< size_t > > m_pointToFiber;
112
#endif // WFIBERACCUMULATOR_H