Developer Documentation
RendererInfo.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 
51 #ifndef RENDERERINFO_HH
52 #define RENDERERINFO_HH
53 
54 #include <QString>
55 #include <QObject>
56 #include <ACG/Scenegraph/DrawModes.hh>
61 
62 #include <vector>
63 
66 
67  public :
68 
69  RendererInfo();
70 
71  RendererInfo(RenderInterface* _plugin,QString _name);
72 
75 
77  QString name;
78 
80  QString version;
81 
83  QString description;
84 
87 
89  QAction* optionsAction;
90 };
91 
92 
94  public:
95  RenderManager();
96 
102  bool rendererExists(QString _name);
103 
110  RendererInfo* newRenderer(QString _name);
111 
117  int getRendererId(QString _name);
118 
124  RendererInfo* getRenderer(QString _name);
125 
134  int countRenderers(ACG::SceneGraph::DrawModes::DrawMode _mode);
135 
141  RendererInfo* operator[](unsigned int _id);
142 
147  unsigned int available();
148 
154  void setActive(unsigned int _active, int _id);
155 
161  void setActive(QString _active, int _id);
162 
168  RendererInfo* active(int _id);
169 
175  unsigned int activeId(int _id);
176 
177  private:
179  std::vector<RendererInfo> availableRenderers_;
180 
182  std::vector<unsigned int> activeRenderers_;
183 };
184 
186 DLLEXPORT
187 RenderManager& renderManager();
188 
189 //===================================================================================
190 // Post processor Manager
191 //===================================================================================
192 
195 
196  public :
197 
199 
200  PostProcessorInfo(PostProcessorInterface* _plugin, QString _name);
201 
204 
206  QString name;
207 
209  QString description;
210 
212  QString version;
213 
215  QAction* optionsAction;
216 
217 };
218 
219 
221  public:
222 
224 
230  bool postProcessorExists(QString _name);
231 
238  PostProcessorInfo* newPostProcessor(QString _name);
239 
245  PostProcessorInfo* getPostProcessor(QString _name);
246 
252  PostProcessorInfo* operator[](unsigned int _id);
253 
258  unsigned int available();
259 
265  void setActive(unsigned int _active, int _viewerId);
266 
275  void setActive(QString _active, int _id);
276 
277 
278  //===========================================================================
281  //===========================================================================
282 
288  void append(unsigned int _active, int _viewerId);
289 
295  void append(QString _active, int _id);
296 
303  void insert(unsigned int _active, int _chainIdx, int _viewerId);
304 
311  void insert(QString _active, int _chainIdx, int _id);
312 
318  void remove(int _id, int _chainIdx);
319 
325  int numActive( int _id);
326 
338  unsigned int activeId( int _id, int _chainIdx = 0);
339 
346  PostProcessorInfo* active( int _id, int _chainIdx = 0);
347 
348 
349  private:
351  std::vector<PostProcessorInfo> availablePostProcessors_;
352 
354  std::vector<std::vector<unsigned int> > activePostProcessors_;
355 };
356 
358 DLLEXPORT
359 PostProcessorManager& postProcessorManager();
360 
361 #endif //RENDERERINFO_HH
ACG::SceneGraph::DrawModes::DrawMode modes
Supported DrawModes.
Definition: RendererInfo.hh:86
QAction * optionsAction
Possible action to add an options action or menu to the system.
Definition: RendererInfo.hh:89
QAction * optionsAction
Possible action to add an options action or menu to the system.
#define DLLEXPORT
QString description
Description of the plugin ( requested from the plugin on load)
Definition: RendererInfo.hh:83
Interface to add global image post processor functions from within plugins.
std::vector< PostProcessorInfo > availablePostProcessors_
Vector holding all available post processors.
std::vector< RendererInfo > availableRenderers_
Vector holding all available renderers.
Interface to add additional rendering functions from within plugins.
std::vector< unsigned int > activeRenderers_
The currently active renderer ids.
std::vector< std::vector< unsigned int > > activePostProcessors_
The currently active post processor chain.
QString description
Description of the plugin.
QString name
Name of the plugin ( requested from the plugin on load)
PostProcessorInterface * plugin
Pointer to the loaded plugin (Already casted when loading it)
QString version
Version of the plugin ( requested from the plugin on load)
Definition: RendererInfo.hh:80
RenderInterface * plugin
Pointer to the loaded plugin (Already casted when loading it)
Definition: RendererInfo.hh:74
QString version
Version of the plugin.
QString name
Name of the plugin ( requested from the plugin on load)
Definition: RendererInfo.hh:77