OpenWalnut  1.5.0dev
template/WToolkit.cpp
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 // This file's purpose is to provide a list of modules and additional extensions as entry point for OpenWalnut's module loader.
26 // Both functAdd your modules here. If you miss this step, OpenWalnut will not be able to load your modules/extensions.
27 
28 #include <memory>
29 
30 #include <core/kernel/WModule.h>
31 
32 #include "WMTemplate.h"
33 #include "WMTemplateColormapping.h"
34 #include "WMTemplateContainers.h"
35 #include "WMTemplateDataLoader.h"
36 #include "WMTemplateRenderPipelines.h"
37 #include "WMTemplateShaders.h"
38 #include "WMTemplateUI.h"
39 
40 // #include "WToolkit.h"
41 
42 /**
43  * This function is called by OpenWalnut, when loading your library to learn about the modules you provide. The function is called with a given
44  * list reference, where you add all of your modules. Modules which are not registered this way, cannot be used in OpenWalnut. As this is called
45  * before loading any project file or running any module, it is ensured that you can rely on the modules provided here in your project files and
46  * other modules.
47  *
48  * \note this function is optional. You can remove it if you do not need it.
49  *
50  * \param m the list of modules. Add you module instances into this list.
51  */
52 extern "C" void WLoadModule( WModuleList& m ) // NOLINT
53 {
54  // This line is needed by the module loader to actually find your module. You need to add this to your module too. Do NOT add a ";" here.
55  m.push_back( std::shared_ptr< WModule >( new WMTemplate ) );
56  m.push_back( std::shared_ptr< WModule >( new WMTemplateContainers ) );
57  m.push_back( std::shared_ptr< WModule >( new WMTemplateUI ) );
58  m.push_back( std::shared_ptr< WModule >( new WMTemplateShaders ) );
59  m.push_back( std::shared_ptr< WModule >( new WMTemplateColormapping ) );
60  m.push_back( std::shared_ptr< WModule >( new WMTemplateRenderPipelines ) );
61  m.push_back( std::shared_ptr< WModule >( new WMTemplateDataLoader ) );
62 }
63 
64 /**
65  * This function is called by OpenWalnut, when loading your module to allow registration of additional classes and implementations that are not
66  * WModule classes. At this point, OW is completely initialized, thus allowing you to register nearly everything to the sub-systems supporting
67  * this. A typical example is the postprocessing meachnism in OpenWalnut. It allows you to register your own postprocessors easily. As this
68  * function is called on start-up, before loading project files, you can rely on additional functionality in your project files and modules.
69  *
70  * \note this function is optional. You can remove it if you do not need it.
71  *
72  * \param localPath this is the path to the toolkit. Our build system ensures, that your resources and shaders get placed there.
73  */
74 extern "C" void WRegisterArbitrary( const boost::filesystem::path& /*localPath*/ )
75 {
76  // Example for registering your own postprocessor:
77  // WGEPostprocessor::addPostprocessor( WGEPostprocessor::SPtr( new MyStylishPostprocessing( localPath ) ) );
78  // wlog::debug( "TemplateToolbox - Arbitrary Extension" ) << "My resource path is: " << localPath.string();
79 }
80 
A module that explains the usage of the WGEColormapping interface including the GLSL codes.
A module that explains re-use and re-combination of existing modules.
A module that explains the data loader module interface in OpenWalnut.
A module that explains the usage of the WGEOffscreen interface including the GLSL codes.
A module that explains the usage of the WGEShader interface.
A module that explains the usage of the abstract UI interface in OpenWalnut.
Definition: WMTemplateUI.h:51
This module is intended to be a simple template and example module.
Definition: WMTemplate.h:53