~ubuntu-branches/ubuntu/raring/openwalnut/raring

« back to all changes in this revision

Viewing changes to src/modules/dataCreator/WDataCreatorFiberSpiral.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Eichelbaum
  • Date: 2012-12-12 11:26:32 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20121212112632-xhiuwkxuz5h0idkh
Tags: 1.3.1+hg5849-1
* Minor changes compared to 1.3.0 but included several bug fixes.
* See http://www.openwalnut.org/versions/4

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 WDATACREATORFIBERSPIRAL_H
 
26
#define WDATACREATORFIBERSPIRAL_H
 
27
 
 
28
#include <boost/shared_ptr.hpp>
 
29
 
 
30
#include "core/common/WObjectNDIP.h"
 
31
 
 
32
#include "WDataSetFibersCreatorInterface.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 boost::shared_ptr< WDataCreatorFiberSpiral > SPtr;
 
44
 
 
45
    /**
 
46
     * Abbreviate const shared_ptr
 
47
     */
 
48
    typedef boost::shared_ptr< const WDataCreatorFiberSpiral > ConstSPtr;
 
49
 
 
50
    /**
 
51
     * Default constructor.
 
52
     */
 
53
    WDataCreatorFiberSpiral();
 
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 progress progress indicator
 
64
     * \param color color of all fibers
 
65
     * \param numFibers number of fibers
 
66
     * \param numVertsPerFiber number of vertices per fiber
 
67
     * \param origin origin of the bbox
 
68
     * \param size size of the bounding box
 
69
     * \param vertices the vertex array. Fill this.
 
70
     * \param fibIdx the fiber index array. Fill this.
 
71
     * \param lengths the lengths array. Fill this.
 
72
     * \param fibIdxVertexMap inverse map. Fill this.
 
73
     * \param colors the color array. Fill this.
 
74
     *
 
75
     * \return fiber data
 
76
     */
 
77
    virtual void operator()( WProgress::SPtr progress,
 
78
                             const WColor& color,
 
79
                             size_t numFibers,
 
80
                             size_t numVertsPerFiber,
 
81
                             const WPosition& origin,
 
82
                             const WPosition& size,
 
83
                             WDataSetFibers::VertexArray vertices,
 
84
                             WDataSetFibers::IndexArray fibIdx,
 
85
                             WDataSetFibers::LengthArray lengths,
 
86
                             WDataSetFibers::IndexArray fibIdxVertexMap,
 
87
                             WDataSetFibers::ColorArray colors );
 
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