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

« back to all changes in this revision

Viewing changes to src/modules/fiberDisplaySimple/WMFiberDisplaySimple.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:
33
33
 
34
34
// forward declarations
35
35
class WDataSetFibers;
 
36
class WDataSetFiberClustering;
36
37
class WGEShader;
37
38
 
38
39
/**
43
44
class WMFiberDisplaySimple: public WModule
44
45
{
45
46
public:
46
 
 
47
47
    /**
48
48
     * Default constructor.
49
49
     */
81
81
    virtual const char** getXPMIcon() const;
82
82
 
83
83
protected:
84
 
 
85
84
    /**
86
85
     * Entry point after loading the module. Runs in separate thread.
87
86
     */
98
97
    virtual void properties();
99
98
 
100
99
private:
 
100
    /**
 
101
     * Geometry update callback. Handles fiber cluster filtering
 
102
     *
 
103
     * \param geometry the geometry instance to handle
 
104
     */
 
105
    void geometryUpdate( osg::Drawable* geometry );
 
106
 
 
107
    /**
 
108
     * If true, the geometryUpdate() callback will upload a new filter attribute array.
 
109
     */
 
110
    bool m_fiberClusteringUpdate;
101
111
 
102
112
    /**
103
113
     * The fiber dataset which is going to be filtered.
105
115
    boost::shared_ptr< WModuleInputData< WDataSetFibers > > m_fiberInput;
106
116
 
107
117
    /**
 
118
     * An optional fiber clustering can be specified to filter in m_fiberInput.
 
119
     */
 
120
    boost::shared_ptr< WModuleInputData< WDataSetFiberClustering > > m_fiberClusteringInput;
 
121
 
 
122
    /**
 
123
     * The current fiber data
 
124
     */
 
125
    WDataSetFibers::SPtr m_fibers;
 
126
 
 
127
    /**
 
128
     * The current fiber clustering
 
129
     */
 
130
    WDataSetFiberClustering::SPtr m_fiberClustering;
 
131
 
 
132
    /**
108
133
     * A condition used to notify about changes in several properties.
109
134
     */
110
135
    boost::shared_ptr< WCondition > m_propCondition;
115
140
    WProperties::SPtr m_fibProps;
116
141
 
117
142
    /**
118
 
     * The shader used for clipping of fibers using an arbitrary plane.
 
143
     * The shader used for actually drawing the fake tubes or lines.
119
144
     */
120
145
    osg::ref_ptr< WGEShader > m_shader;
121
146
 
122
147
    /**
 
148
     * The shader used for drawing end cap sprites if in tube mode.
 
149
     */
 
150
    osg::ref_ptr< WGEShader > m_endCapShader;
 
151
 
 
152
    /**
123
153
     * Illumination.
124
154
     */
125
155
    WPropBool m_illuminationEnable;
170
200
    WPropBool m_tubeEnable;
171
201
 
172
202
    /**
 
203
     * Property denoting whether to use end-caps on tubes
 
204
     */
 
205
    WPropBool m_tubeEndCapsEnable;
 
206
 
 
207
    /**
173
208
     * Prop denoting whether tubes can be zoomed or not.
174
209
     */
175
210
    WPropBool m_tubeZoomable;
191
226
    WPropGroup m_tubeGroup;
192
227
 
193
228
    /**
 
229
     * Group containing line specific properties
 
230
     */
 
231
    WPropGroup m_lineGroup;
 
232
 
 
233
    /**
 
234
     * Line width.
 
235
     */
 
236
    WPropDouble m_lineWidth;
 
237
 
 
238
    /**
 
239
     * Line smoothing.
 
240
     */
 
241
    WPropBool m_lineSmooth;
 
242
 
 
243
    /**
194
244
     * Update the transform node to provide an cue were the plane actually is.
195
245
     *
196
246
     * \param node the transform node
207
257
    /**
208
258
     * Creates a geode containing the fiber geometry
209
259
     *
210
 
     * \param fibers the fiber dataset to render
211
 
     *
212
 
     * \return the geode
 
260
     * \param fibers the fiber data
 
261
     * \param fibGeode the geode with the fibers as tube strip or lines
 
262
     * \param endCapGeode the end cap sprites. Not used if not in tube mode.
213
263
     */
214
 
    osg::ref_ptr< osg::Node > createFiberGeode( boost::shared_ptr< WDataSetFibers > fibers ) const;
 
264
    void createFiberGeode( boost::shared_ptr< WDataSetFibers > fibers, osg::ref_ptr< osg::Geode > fibGeode,
 
265
                                                                                         osg::ref_ptr< osg::Geode > endCapGeode );
215
266
 
216
267
    /**
217
268
     * The plane node.
218
269
     */
219
270
    osg::ref_ptr< osg::Node > m_plane;
 
271
 
 
272
    /**
 
273
     * Callback for the line geode to allow interactive modification of line smooth and width states.
 
274
     *
 
275
     * \param state the state
 
276
     */
 
277
    void lineGeodeStateCallback( osg::StateSet* state );
220
278
};
221
279
 
222
280
#endif  // WMFIBERDISPLAYSIMPLE_H