Equalizer  2.1.0
Parallel Rendering Framework
application.h
1 
2 /* Copyright (c) 2011-2017, Stefan Eilemann <eile@eyescale.ch>
3  * Petros Kataras <petroskataras@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQSEQUEL_APPLICATION_H
20 #define EQSEQUEL_APPLICATION_H
21 
22 #include <co/objectFactory.h> // interface
23 #include <eq/client.h> // base class
24 #include <seq/types.h>
25 
26 namespace seq
27 {
29 class Application : public eq::Client, public co::ObjectFactory
30 {
31 public:
33  SEQ_API Application();
34 
38  SEQ_API co::NodePtr getMasterNode();
39 
41  SEQ_API static std::string getHelp();
43 
59  SEQ_API virtual bool init(int argc, char** argv, co::Object* initData);
60 
75  SEQ_API virtual bool run(co::Object* frameData);
76 
83  SEQ_API virtual bool exit();
84 
86  SEQ_API void stopRunning();
88 
101  virtual bool clientInit(co::Object* initData LB_UNUSED) { return true; }
103  virtual bool clientExit() { return true; }
113  virtual Renderer* createRenderer() = 0;
114 
116  SEQ_API virtual void destroyRenderer(Renderer* renderer);
117 
128  SEQ_API virtual ViewData* createViewData(View& view);
129 
131  SEQ_API virtual void destroyViewData(ViewData* viewData);
133 
136  SEQ_API eq::Config* getConfig();
137  detail::Application* getImpl() { return _impl; }
138 
139 
151  SEQ_API bool registerObject(co::Object* object, const uint32_t type);
152 
161  SEQ_API bool deregister(co::Object* object);
163 
164 protected:
166  SEQ_API virtual ~Application();
167 
168 private:
169  detail::Application* _impl;
170 };
171 }
172 #endif // EQSEQUEL_APPLICATION_H
virtual SEQ_API bool exit()
Exit this application instance.
SEQ_API void stopRunning()
Request that the application leaves its run loop.
virtual SEQ_API bool run(co::Object *frameData)
Run the application main loop.
A configuration is a visualization session driven by an application.
Definition: config.h:58
virtual bool clientInit(co::Object *initData)
Initialize a render client.
Definition: application.h:101
The main application object.
Definition: application.h:29
virtual SEQ_API ViewData * createViewData(View &view)
Create a new per-view data instance.
virtual SEQ_API bool init(int argc, char **argv, co::Object *initData)
Initialize the application instance.
virtual Renderer * createRenderer()=0
Create a new renderer instance.
SEQ_API bool registerObject(co::Object *object, const uint32_t type)
Add and register a new object as master instance.
A renderer instance.
Definition: renderer.h:36
SEQ_API bool deregister(co::Object *object)
Remove and deregister an object.
Stores per-view data.
Definition: viewData.h:30
virtual bool clientExit()
Exit a render client.
Definition: application.h:103
SEQ_API Application()
Construct a new application instance.
A View is a 2D area of a Layout.
Definition: view.h:46
virtual SEQ_API ~Application()
Destruct this application instance.
static SEQ_API std::string getHelp()
SEQ_API co::NodePtr getMasterNode()
virtual SEQ_API void destroyRenderer(Renderer *renderer)
Delete the given renderer.
Sequel - A simple interface to the Equalizer parallel rendering framework.
Definition: application.h:26
The client represents a network node of the application in the cluster.
Definition: client.h:42
virtual SEQ_API void destroyViewData(ViewData *viewData)
Delete the given view data.