OpenWalnut  1.3.1
WCustomWidget.h
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 WCUSTOMWIDGET_H
26 #define WCUSTOMWIDGET_H
27 
28 #include <string>
29 
30 #include <boost/shared_ptr.hpp>
31 
32 #include <osg/ref_ptr>
33 
34 #include "../graphicsEngine/WGEViewer.h"
35 
36 class WGEGroupNode;
37 
38 /**
39  * Custom widget which is created by a module to display custom information.
40  */
42 {
43 public:
44  /**
45  * Abbreviation for a shared pointer on a instance of this class.
46  */
47  typedef boost::shared_ptr< WCustomWidget > SPtr;
48 
49  /**
50  * Abbreviation for a const shared pointer on a instance of this class.
51  */
52  typedef boost::shared_ptr< const WCustomWidget > ConstSPtr;
53 
54  /**
55  * Constructor. Create a custom widget instance.
56  *
57  * \param title the title of the widget
58  */
59  explicit WCustomWidget( std::string title );
60 
61  /**
62  * Destructor
63  */
64  virtual ~WCustomWidget();
65 
66  /**
67  * Get the scene which is displayed
68  *
69  * \return the scene as osg::ref_ptr
70  */
71  virtual osg::ref_ptr< WGEGroupNode > getScene() const = 0;
72 
73  /**
74  * Get the viewer which is used
75  *
76  * \return the viewer as boost::shard_ptr
77  */
78  virtual boost::shared_ptr< WGEViewer > getViewer() const = 0;
79 
80  /**
81  * Get the title of the widget.
82  *
83  * \return title as string
84  */
85  virtual std::string getTitle() const;
86 
87 protected:
88 private:
89  /**
90  * The widget's title string.
91  */
92  std::string m_title;
93 };
94 
95 #endif // WCUSTOMWIDGET_H