1
//---------------------------------------------------------------------------
3
// Project: OpenWalnut ( http://www.openwalnut.org )
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
8
// This file is part of OpenWalnut.
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.
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.
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/>.
23
//---------------------------------------------------------------------------
25
#ifndef WBOUNDARYBUILDER_H
26
#define WBOUNDARYBUILDER_H
28
#include <boost/array.hpp>
29
#include <boost/shared_ptr.hpp>
31
#include <osg/ref_ptr>
33
#include "core/common/WProperties.h"
34
#include "core/graphicsEngine/shaders/WGEShader.h"
35
#include "core/graphicsEngine/WGEManagedGroupNode.h"
37
// forward declarations
38
class WGEManagedGroupNode;
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.
45
class WBoundaryBuilder
49
* Constructs an builder instance.
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.
55
WBoundaryBuilder( boost::shared_ptr< const WDataSetScalar > texture,
56
boost::shared_ptr< const WProperties > properties,
57
boost::array< osg::ref_ptr< WGEManagedGroupNode >, 3 > *slices );
62
virtual ~WBoundaryBuilder();
65
* Starts rendering and finally insert result in output.
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.
70
virtual void run( osg::ref_ptr< WGEManagedGroupNode > output, const char sliceNum = -1 ) = 0;
74
* The underlying scalar dataset to compute those boundaries for.
76
boost::shared_ptr< const WDataSetScalar > m_texture;
79
* The three slice positions.
80
* 0 : xSlice, 1 : ySlice, 2 : zSlice
82
boost::array< WPropDouble, 3 > m_slicePos;
85
* Pointer to the three slices.
86
* 0 : xSlice, 1 : ySlice, 2 : zSlice
88
boost::array< osg::ref_ptr< WGEManagedGroupNode >, 3 > m_slices;
91
* Gray matter threshold.
93
WPropDouble m_grayMatter;
96
* White matter threshold.
98
WPropDouble m_whiteMatter;
101
* Shader generating the curves of gray and white matter.
103
osg::ref_ptr< WGEShader > m_shader;
108
WPropColor m_gmColor;
111
* White matter color.
113
WPropColor m_wmColor;
118
#endif // WBOUNDARYBUILDER_H