OpenWalnut  1.5.0dev
WDataCreatorFiberSpiral.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 WDATACREATORFIBERSPIRAL_H
26 #define WDATACREATORFIBERSPIRAL_H
27 
28 #include <memory>
29 
30 
31 #include "WDataSetFibersCreatorInterface.h"
32 #include "core/common/WObjectNDIP.h"
33 
34 /**
35  * Create a fiber spiral
36  */
37 class WDataCreatorFiberSpiral: public WObjectNDIP< WDataSetFibersCreatorInterface >
38 {
39 public:
40  /**
41  * Abbreviate shared_ptr
42  */
43  typedef std::shared_ptr< WDataCreatorFiberSpiral > SPtr;
44 
45  /**
46  * Abbreviate const shared_ptr
47  */
48  typedef std::shared_ptr< const WDataCreatorFiberSpiral > ConstSPtr;
49 
50  /**
51  * Default constructor.
52  */
54 
55  /**
56  * Destructor.
57  */
58  virtual ~WDataCreatorFiberSpiral();
59 
60  /**
61  * Create the dataset. This needs to be implemented by all the creators you write.
62  *
63  * \param seed the seed for the random values.
64  * \param progress progress indicator
65  * \param color color of all fibers
66  * \param numFibers number of fibers
67  * \param numVertsPerFiber number of vertices per fiber
68  * \param origin origin of the bbox
69  * \param size size of the bounding box
70  * \param vertices the vertex array. Fill this.
71  * \param fibIdx the fiber index array. Fill this.
72  * \param lengths the lengths array. Fill this.
73  * \param fibIdxVertexMap inverse map. Fill this.
74  * \param colors the color array. Fill this.
75  */
76  virtual void operator()( int seed,
77  WProgress::SPtr progress,
78  const WColor& color,
79  size_t numFibers,
80  size_t numVertsPerFiber,
81  const WPosition& origin,
82  const WPosition& size,
86  WDataSetFibers::IndexArray fibIdxVertexMap,
88 protected:
89 private:
90  /**
91  * Number of rotations to do.
92  */
93  WPropInt m_numRotations;
94 
95  /**
96  * The radius of a tube (consisting of multiple fibers
97  */
98  WPropDouble m_tubeRadius;
99 };
100 
101 #endif // WDATACREATORFIBERSPIRAL_H
102 
Create a fiber spiral.
WPropDouble m_tubeRadius
The radius of a tube (consisting of multiple fibers.
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.
std::shared_ptr< const WDataCreatorFiberSpiral > ConstSPtr
Abbreviate const shared_ptr.
WDataCreatorFiberSpiral()
Default constructor.
std::shared_ptr< WDataCreatorFiberSpiral > SPtr
Abbreviate shared_ptr.
virtual ~WDataCreatorFiberSpiral()
Destructor.
WPropInt m_numRotations
Number of rotations to do.
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