OpenWalnut  1.5.0dev
WDataCreatorFiberParallel.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 WDATACREATORFIBERPARALLEL_H
26 #define WDATACREATORFIBERPARALLEL_H
27 
28 #include "WDataSetFibersCreatorInterface.h"
29 #include "core/common/WObjectNDIP.h"
30 
31 /**
32  * Create parallel fibers
33  */
34 class WDataCreatorFiberParallel: public WObjectNDIP< WDataSetFibersCreatorInterface >
35 {
36 public:
37  /**
38  * Abbreviate shared_ptr
39  */
40  typedef std::shared_ptr< WDataCreatorFiberParallel > SPtr;
41 
42  /**
43  * Abbreviate const shared_ptr
44  */
45  typedef std::shared_ptr< const WDataCreatorFiberParallel > ConstSPtr;
46 
47  /**
48  * Default constructor.
49  */
51 
52  /**
53  * Destructor.
54  */
56 
57  /**
58  * Create the dataset. This needs to be implemented by all the creators you write.
59  *
60  * \param seed the seed for the random values.
61  * \param progress progress indicator
62  * \param color color of all fibers
63  * \param numFibers number of fibers
64  * \param numVertsPerFiber number of vertices per fiber
65  * \param origin origin of the bbox
66  * \param size size of the bounding box
67  * \param vertices the vertex array. Fill this.
68  * \param fibIdx the fiber index array. Fill this.
69  * \param lengths the lengths array. Fill this.
70  * \param fibIdxVertexMap inverse map. Fill this.
71  * \param colors the color array. Fill this.
72  */
73  virtual void operator()( int seed,
74  WProgress::SPtr progress,
75  const WColor& color,
76  size_t numFibers,
77  size_t numVertsPerFiber,
78  const WPosition& origin,
79  const WPosition& size,
83  WDataSetFibers::IndexArray fibIdxVertexMap,
85 protected:
86 private:
87  /**
88  * The direction of the parallel lines
89  */
90  WPropPosition m_direction;
91 };
92 
93 #endif // WDATACREATORFIBERPARALLEL_H
WPropPosition m_direction
The direction of the parallel lines.
std::shared_ptr< const WDataCreatorFiberParallel > ConstSPtr
Abbreviate const shared_ptr.
std::shared_ptr< WDataCreatorFiberParallel > SPtr
Abbreviate shared_ptr.
WDataCreatorFiberParallel()
Default constructor.
virtual void operator()(int seed, WProgress::SPtr progress, const WColor &color, size_t numFibers, size_t numVertsPerFiber, const WPosition &origin, const WPosition &size, WDataSetFibers::VertexArray vertices, WDataSetFibers::IndexArray fibIdx, WDataSetFibers::LengthArray lengths, WDataSetFibers::IndexArray fibIdxVertexMap, WDataSetFibers::ColorArray colors)
Create the dataset.
virtual ~WDataCreatorFiberParallel()
Destructor.
std::shared_ptr< std::vector< size_t > > IndexArray
Index list indexing fibers in VertexArray in terms of vertex numbers.
std::shared_ptr< std::vector< float > > ColorArray
Colors for each vertex in VertexArray.
std::shared_ptr< std::vector< size_t > > LengthArray
Lengths of fibers in terms of vertices.
std::shared_ptr< std::vector< float > > VertexArray
List of vertex coordinates in term of components of vertices.
This is a base class for everything which has a Name,Description,Icon and Properties (=NDIP).
Definition: WObjectNDIP.h:42
This only is a 3d double vector.
std::shared_ptr< WProgress > SPtr
Shared pointer on a WProgress.
Definition: WProgress.h:48