Debian Codegraph @

src/Gui/ViewProviderBuilder.h

raw
1 /***************************************************************************
2 * Copyright (c) 2010 Werner Mayer <wmayer[at]users.sourceforge.net> *
3 * *
4 * This file is part of the FreeCAD CAx development system. *
5 * *
6 * This library is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Library General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU Library General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Library General Public *
17 * License along with this library; see the file COPYING.LIB. If not, *
18 * write to the Free Software Foundation, Inc., 59 Temple Place, *
19 * Suite 330, Boston, MA 02111-1307, USA *
20 * *
21 ***************************************************************************/
22
23 #ifndef GUI_VIEWPROVIDERBUILDER_H
24 #define GUI_VIEWPROVIDERBUILDER_H
25
26 #include <map>
27 #include <vector>
28 #include <Base/Type.h>
29
30
31 class SoNode;
32
33 namespace App
34 {
35 class Property;
36 }
37
38 namespace Gui
39 {
40
41 class ViewProvider;
42 class SoFCSelection;
43 class GuiExport ViewProviderBuilder
44 {
45 public:
46 /// Constructor
47 ViewProviderBuilder();
48 virtual ~ViewProviderBuilder();
49 virtual void buildNodes(const App::Property*, std::vector<SoNode*>&) const = 0;
50
51 static void add(const Base::Type&, const Base::Type&);
52 static ViewProvider* create(const Base::Type&);
53 static SoFCSelection* createSelection();
54
55 private:
56 static std::map<Base::Type, Base::Type> _prop_to_view;
57 };
58
59 class GuiExport ViewProviderColorBuilder: public ViewProviderBuilder
60 {
61 public:
62 /// Constructor
63 ViewProviderColorBuilder();
64 ~ViewProviderColorBuilder() override;
65 void buildNodes(const App::Property*, std::vector<SoNode*>&) const override;
66 };
67
68 } // namespace Gui
69
70
71 #endif // GUI_VIEWPROVIDERBUILDER_H