OpenWalnut  1.5.0dev
WResampling_I.cpp
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2014 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 #include <core/dataHandler/WDataSetFiberVector.h>
26 
27 #include "WResampling_I.h"
28 
30 {
31 }
32 
34 {
35  wlog::debug( "WResampling_I" ) << "Start resampling: " << fibers->getLineStartIndexes()->size() << " fibers";
36 
38 
39  for( size_t fidx = 0; fidx < fibers->getLineStartIndexes()->size() && !shutdown; ++fidx )
40  {
41  newDS->push_back( resample( (*fibers)[ fidx ] ) );
42  ++*progress;
43  }
44 
45  return newDS->toWDataSetFibers();
46 }
47 
Represents a simple set of WFibers.
std::shared_ptr< WDataSetFiberVector > SPtr
Short hand for a std::shared_ptr on such classes.
std::shared_ptr< WDataSetFibers > SPtr
Pointer to dataset.
std::shared_ptr< WProgress > SPtr
Shared pointer on a WProgress.
Definition: WProgress.h:48
virtual WDataSetFibers::SPtr operator()(WProgress::SPtr progress, WBoolFlag const &shutdown, WDataSetFibers::SPtr fibers)
Resample each fiber within the given fiber dataset according to the given implementation of virtual r...
virtual WFiber resample(WFiber fib) const =0
All overrided methods should resample the fiber in their specific way.
virtual ~WResampling_I()
Destructor.
WStreamedLogger debug(const std::string &source)
Logging a debug message.
Definition: WLogger.h:331