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

« back to all changes in this revision

Viewing changes to src/modules/schmahmannPandyaSlices/boundaryCurvesWMGM/WBoundaryBuilder.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@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 WBOUNDARYBUILDER_H
 
26
#define WBOUNDARYBUILDER_H
 
27
 
 
28
#include <boost/array.hpp>
 
29
#include <boost/shared_ptr.hpp>
 
30
 
 
31
#include <osg/ref_ptr>
 
32
 
 
33
#include "core/common/WProperties.h"
 
34
#include "core/graphicsEngine/shaders/WGEShader.h"
 
35
#include "core/graphicsEngine/WGEManagedGroupNode.h"
 
36
 
 
37
// forward declarations
 
38
class WGEManagedGroupNode;
 
39
class WDataSetScalar;
 
40
 
 
41
/**
 
42
 * Abstract base class for a boundary builder which needs serveral input paramertes \ref WBoundaryBuilder constructor
 
43
 * and provides an interface: \ref run for generating the graphics.
 
44
 */
 
45
class WBoundaryBuilder
 
46
{
 
47
public:
 
48
    /**
 
49
     * Constructs an builder instance.
 
50
     *
 
51
     * \param texture The underlying scalar dataset to compute those boundaries for
 
52
     * \param properties Properties, like slice positions, thresholds etc.
 
53
     * \param slices Slice geodes which are controlled (hide/unhide) by the module.
 
54
     */
 
55
    WBoundaryBuilder( boost::shared_ptr< const WDataSetScalar > texture,
 
56
                      boost::shared_ptr< const WProperties > properties,
 
57
                      boost::array< osg::ref_ptr< WGEManagedGroupNode >, 3 > *slices );
 
58
 
 
59
    /**
 
60
     * Destructs this.
 
61
     */
 
62
    virtual ~WBoundaryBuilder();
 
63
 
 
64
    /**
 
65
     * Starts rendering and finally insert result in output.
 
66
     *
 
67
     * \param output Where to put/insert the results.
 
68
     * \param sliceNum If given -1 all slice will perform an update, otherwise only the slice with the given slice number.
 
69
     */
 
70
    virtual void run( osg::ref_ptr< WGEManagedGroupNode > output, const char sliceNum = -1 ) = 0;
 
71
 
 
72
protected:
 
73
    /**
 
74
     * The underlying scalar dataset to compute those boundaries for.
 
75
     */
 
76
    boost::shared_ptr< const WDataSetScalar > m_texture;
 
77
 
 
78
    /**
 
79
     * The three slice positions.
 
80
     * 0 : xSlice, 1 : ySlice, 2 : zSlice
 
81
     */
 
82
    boost::array< WPropDouble, 3 > m_slicePos;
 
83
 
 
84
    /**
 
85
     * Pointer to the three slices.
 
86
     * 0 : xSlice, 1 : ySlice, 2 : zSlice
 
87
     */
 
88
    boost::array< osg::ref_ptr< WGEManagedGroupNode >, 3 > m_slices;
 
89
 
 
90
    /**
 
91
     * Gray matter threshold.
 
92
     */
 
93
    WPropDouble m_grayMatter;
 
94
 
 
95
    /**
 
96
     * White matter threshold.
 
97
     */
 
98
    WPropDouble m_whiteMatter;
 
99
 
 
100
    /**
 
101
     * Shader generating the curves of gray and white matter.
 
102
     */
 
103
    osg::ref_ptr< WGEShader > m_shader;
 
104
 
 
105
    /**
 
106
     * Gray matter color.
 
107
     */
 
108
    WPropColor m_gmColor;
 
109
 
 
110
    /**
 
111
     * White matter color.
 
112
     */
 
113
    WPropColor m_wmColor;
 
114
 
 
115
private:
 
116
};
 
117
 
 
118
#endif  // WBOUNDARYBUILDER_H