~ubuntu-branches/ubuntu/precise/openwalnut/precise

« back to all changes in this revision

Viewing changes to src/modules/exportGeometry/WMExportGeometry.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Eichelbaum
  • Date: 2011-06-21 10:26:54 UTC
  • Revision ID: james.westby@ubuntu.com-20110621102654-rq0zf436q949biih
Tags: upstream-1.2.5
ImportĀ upstreamĀ versionĀ 1.2.5

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-Leipzig and CNCF-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 WMEXPORTGEOMETRY_H
 
26
#define WMEXPORTGEOMETRY_H
 
27
 
 
28
#include <string>
 
29
 
 
30
#include <osg/Geode>
 
31
 
 
32
#include "core/kernel/WModule.h"
 
33
#include "core/kernel/WModuleInputData.h"
 
34
#include "core/kernel/WModuleOutputData.h"
 
35
 
 
36
class WTriangleMesh;
 
37
 
 
38
/**
 
39
 * Someone should add some documentation here.
 
40
 * Probably the best person would be the module's
 
41
 * creator, i.e. "wiebel".
 
42
 *
 
43
 * This is only an empty template for a new module. For
 
44
 * an example module containing many interesting concepts
 
45
 * and extensive documentation have a look at "src/modules/template"
 
46
 *
 
47
 * \ingroup modules
 
48
 */
 
49
class WMExportGeometry: public WModule
 
50
{
 
51
public:
 
52
 
 
53
    /**
 
54
     *
 
55
     */
 
56
    WMExportGeometry();
 
57
 
 
58
    /**
 
59
     *
 
60
     */
 
61
    virtual ~WMExportGeometry();
 
62
 
 
63
    /**
 
64
     * Gives back the name of this module.
 
65
     * \return the module's name.
 
66
     */
 
67
    virtual const std::string getName() const;
 
68
 
 
69
    /**
 
70
     * Gives back a description of this module.
 
71
     * \return description to module.
 
72
     */
 
73
    virtual const std::string getDescription() const;
 
74
 
 
75
    /**
 
76
     * Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
 
77
     * should never be initialized or modified in some other way. A simple new instance is required.
 
78
     *
 
79
     * \return the prototype used to create every module in OpenWalnut.
 
80
     */
 
81
    virtual boost::shared_ptr< WModule > factory() const;
 
82
 
 
83
    /**
 
84
     * Get the icon for this module in XPM format.
 
85
     * \return The icon.
 
86
     */
 
87
    virtual const char** getXPMIcon() const;
 
88
 
 
89
protected:
 
90
 
 
91
    /**
 
92
     * Entry point after loading the module. Runs in separate thread.
 
93
     */
 
94
    virtual void moduleMain();
 
95
 
 
96
    /**
 
97
     * Initialize the connectors this module is using.
 
98
     */
 
99
    virtual void connectors();
 
100
 
 
101
    /**
 
102
     * Initialize the properties for this module.
 
103
     */
 
104
    virtual void properties();
 
105
 
 
106
 
 
107
private:
 
108
    /**
 
109
     * Routine that acutally writes the file.
 
110
     */
 
111
    void writeFile();
 
112
 
 
113
    /**
 
114
     * An input connector used to get mehses from other modules.
 
115
     */
 
116
    boost::shared_ptr< WModuleInputData< WTriangleMesh > > m_input;
 
117
 
 
118
    WPropFilename m_savePath; //!< Path where geometry should be stored
 
119
};
 
120
 
 
121
#endif  // WMEXPORTGEOMETRY_H