2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 9abcb3e4 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Merge development into public/master.

parents 6a38ca99 01fa8683
[submodule "ext/lua"]
path = ext/lua
url = https://github.com/LuaDist/lua
ignore = dirty
......@@ -6,14 +6,13 @@ CAMPVis originally devoloped by:
Technische Universitaet Muenchen
Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
The CAMPVis Software Framework project is partially funded by the German
The CAMPVis Software Framework project was partially funded by the German
Ministry of Education and Research (BMBF) [index number 01IS12057].
Further developers and contributors (only larger projects listed here):
* Regression Testing Interface: Hossain Mahmud <hossain.mahmud@gmail.com>
* Scripting Engine: Artur Grunau <artur.grunau@uj.edu.pl>
* SWIG-based Lua Binding Generator: Artur Grunau <artur.grunau@uj.edu.pl>
* Qt GUI: Artur Grunau <artur.grunau@uj.edu.pl>
* Diffusion Tensor Imaging Plugin: Tobias Brachert <brachert@mytum.de>
For authorship of the individual processors, please have a look into the
corresponding header files.
#
# CAMPVis - Yet another visualization framework
# CMake file inspired by Voreen
#
# = CAMPVis - Yet another medical visualization framework =====================
PROJECT(CAMPVis)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR)
#
# Global Build Options
#
SET(CAMPVIS_VERSION 1.0.0)
OPTION(BUILD_SHARED_LIBS "Build shared libraries?" ON)
#OPTION(CAMPVIS_PRECOMPILED_HEADER "Use pre-compiled headers?" ON)
# = Global Build Options ======================================================
OPTION(BUILD_SHARED_LIBS "Build shared libraries (strongly recommended!)" ON)
OPTION(CAMPVIS_DEBUG "Activate debug code?" ON)
OPTION(CAMPVIS_BUILD_APPLICATION "Build CAMPVis Application" ON)
OPTION(CAMPVIS_BUILD_CORE "Build CAMPVis Core" ON)
OPTION(CAMPVIS_BUILD_MODULES "Build CAMPVis Modules" ON)
OPTION(CAMPVIS_ENABLE_SCRIPTING "Add support for scripting CAMPVis using Lua" OFF)
OPTION(CAMPVIS_BUILD_LIB_CGT "Build CGT Library" ON)
OPTION(CAMPVIS_BUILD_LIB_LUA "Build Lua Library" OFF)
OPTION(CAMPVIS_BUILD_DOXYGEN "Build Doxygen Documentation" OFF)
OPTION(CAMPVIS_DEPLOY_SHADERS "Deploy Shader files to binary directory" OFF)
OPTION(CAMPVIS_GROUP_SOURCE_FILES "Group source files by directory" ON)
OPTION(CAMPVIS_BUILD_GOOGLETEST "Build googletest library" OFF)
OPTION(CAMPVIS_BUILD_TEST_SOURCES "Build Unit Tests of gooogletest" OFF)
OPTION(CAMPVIS_ENABLE_TESTING "Build CAMPVis Unit Tests using gooogletest" OFF)
IF(WIN32)
OPTION(CAMPVIS_COPY_EXTERNAL_DLLS "Copy external DLLs to bin directory?" ON)
......@@ -32,81 +22,88 @@ IF(WIN32)
OPTION(CAMPVIS_GENERATE_MANIFEST "Generate manifest in Visual Studio debug builds (switch on when encountering errors using incremental linking)?" OFF)
ENDIF()
# = Further Build Options =====================================================
SET(CAMPVIS_DEFAULT_ENABLED_MODULES "STABLE_NO_DEPENDENCIES" CACHE STRING "Default CAMPVis modules to activate")
SET_PROPERTY(CACHE CAMPVIS_DEFAULT_ENABLED_MODULES PROPERTY STRINGS "NONE" "STABLE_NO_DEPENDENCIES" "STABLE_WITH_EXTERNAL_DEPENDENCIES" "TESTING" "ALL")
#
# Further Build Configurations
#
# propagate CAMPVIS_ENABLE_SCRIPTING to CAMPVIS_BUILD_LIB_LUA to support deprecated code
IF (CAMPVIS_ENABLE_SCRIPTING)
SET(CAMPVIS_BUILD_LIB_LUA ON)
ENDIF()
include(cmake/commonconf.cmake)
include(cmake/parseModulesDir.cmake)
MESSAGE(STATUS "--------------------------------------------------------------------------------")
IF(CAMPVIS_BUILD_LIB_CGT)
ADD_SUBDIRECTORY(ext/cgt)
ADD_SUBDIRECTORY(ext/sigslot)
ENDIF()
IF(CAMPVIS_BUILD_LIB_LUA)
IF(WIN32)
# Keep LUA_BUILD_AS_DLL in sync with BUILD_SHARED_LIBS
SET(LUA_BUILD_AS_DLL ${BUILD_SHARED_LIBS} CACHE BOOL "Build Lua library as DLL" FORCE)
ENDIF(WIN32)
# = Start the definition of all CAMPVis targets ===============================
MESSAGE(STATUS "--------------------------------------------------------------------------------")
ADD_SUBDIRECTORY(ext/lua EXCLUDE_FROM_ALL)
# If the above command failed, provide a hint how to fix the problem
IF(NOT TARGET liblua)
MESSAGE(SEND_ERROR "Did you forget to run `git submodule update --init`?")
ENDIF(NOT TARGET liblua)
ENDIF()
IF(CAMPVIS_BUILD_CORE)
ADD_SUBDIRECTORY(core)
ENDIF()
# cgt, sigslot and campvis-core are enabled by default.
ADD_SUBDIRECTORY(ext/cgt)
ADD_SUBDIRECTORY(ext/sigslot)
ADD_SUBDIRECTORY(core)
IF(CAMPVIS_BUILD_MODULES)
ADD_SUBDIRECTORY(modules)
ENDIF()
# build scripting targets when enabled
IF(CAMPVIS_ENABLE_SCRIPTING)
# build Lua from source
ADD_SUBDIRECTORY(ext/lua)
SET(LUA_DIR "${CampvisHome}/ext/lua")
# First, find Lua to setup paths for all projects correctly
FIND_PACKAGE(Lua REQUIRED)
IF(LUA_FOUND)
MESSAGE(STATUS "* Found Lua")
LIST(APPEND CampvisGlobalDefinitions ${LUA_DEFINITIONS})
LIST(APPEND CampvisGlobalIncludeDirs ${LUA_INCLUDE_DIR})
LIST(APPEND CampvisGlobalExternalLibs ${LUA_LIBRARY})
ELSE(LUA_FOUND)
MESSAGE(FATAL_ERROR "Lua not found!")
ENDIF(LUA_FOUND)
LIST(APPEND CampvisGlobalIncludeDirs "${LUA_DIR}/src" "${CMAKE_BINARY_DIR}/ext/lua")
LIST(APPEND CampvisGlobalExternalLibs "liblua")
LIST(APPEND CampvisGlobalDefinitions "-DCAMPVIS_HAS_SCRIPTING")
ADD_SUBDIRECTORY(scripting)
LIST(APPEND CampvisGlobalDefinitions "-DCAMPVIS_HAS_SCRIPTING")
ENDIF()
IF(CAMPVIS_BUILD_APPLICATION)
ADD_SUBDIRECTORY(application)
ENDIF()
IF(CAMPVIS_BUILD_GOOGLETEST)
# build campvis-test when enabled
IF(CAMPVIS_ENABLE_TESTING)
ADD_SUBDIRECTORY(ext/gtest-1.7.0)
ENDIF()
IF(CAMPVIS_BUILD_TEST_SOURCES)
ADD_SUBDIRECTORY(test)
ENDIF()
# build doxygen when enabled
IF(CAMPVIS_BUILD_DOXYGEN)
ADD_SUBDIRECTORY(doc EXCLUDE_FROM_ALL)
ENDIF()
#
# Copy External DLLs
#
MESSAGE(STATUS "--------------------------------------------------------------------------------")
MESSAGE(STATUS "Finishing up")
# = Export all CAMPVis Targets so that they can be included easily ============
# write package version file
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/CAMPVisConfigVersion.cmake"
VERSION ${CAMPVIS_VERSION}
COMPATIBILITY AnyNewerVersion
)
# write campvis targets file
export(EXPORT campvis-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/CAMPVisTargets.cmake"
# NAMESPACE Upstream::
)
# write campvis configuration file
configure_file("${CampvisHome}/cmake/CAMPVisConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CAMPVisConfig.cmake"
@ONLY
)
#INSTALL(EXPORT campvis-targets NAMESPACE Upstream:: DESTINATION ${CampvisLibInstallDir})
EXPORT(PACKAGE CAMPVis)
# = Copy Windows DLLs to binary dir for improved development experience =======
IF(WIN32)
# gather Qt4 DLLs - TODO: remove redundant naming of required components
FIND_PACKAGE(Qt4DLLs COMPONENTS QtCore QtGui QtOpenGL QtNetwork QtXmlPatterns)
......@@ -120,3 +117,5 @@ IF(WIN32)
COPY_EXTERNAL_DLLS(CampvisExternalDllsDebug CampvisExternalDllsRelease false)
ENDIF()
ENDIF()
MESSAGE(STATUS "--------------------------------------------------------------------------------")
......@@ -26,12 +26,13 @@ CAMPVis a software platform for medical imaging and visualization. It is targete
* [Intel TBB](https://www.threadingbuildingblocks.org/)
* OpenGL 3.3+ Capable Video Hardware (and Drivers!)
* Qt 4.8 for Application Package (Qt 5 Support in Progress)
* CMake Build System
* CMake 3.0+
### Tested Environments
* Windows: MSVC 2010+, Linux: gcc 4.8+
* nVidia GPUs
* various nVidia GPUs
* AMD R290X
* Intel HD4000+ GPUs (Basically Ivy Bridge and Later)
### Getting in Touch
......
......@@ -2,10 +2,10 @@ PROJECT(campvis-application)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
INCLUDE(../cmake/commonconf.cmake)
MESSAGE(STATUS "Configuring CAMPVis Application")
MESSAGE(STATUS "Configuring CAMPVis-Application")
FILE(GLOB CampvisApplicationSources
*.cpp
campvisapplication.cpp
gui/*.cpp
gui/adjusterwidgets/*.cpp
gui/mdi/*.cpp
......@@ -14,7 +14,8 @@ FILE(GLOB CampvisApplicationSources
)
FILE(GLOB CampvisApplicationHeaders
*.h
applicationapi.h
campvisapplication.h
glsl/*.frag
glsl/*.vert
gui/*.h
......@@ -28,7 +29,6 @@ FILE(GLOB CampvisApplicationForms
)
SET(CampvisApplicationToBeMocced
qtjobprocessor.h
gui/mainwindow.h
gui/datacontainerinspectorcanvas.h
gui/datacontainerinspectorwidget.h
......@@ -39,7 +39,6 @@ SET(CampvisApplicationToBeMocced
gui/qtdatahandle.h
gui/logviewerwidget.h
gui/loghighlighter.h
gui/scriptingwidget.h
gui/workflowcontrollerwidget.h
gui/mdi/mdidockarea.h
gui/mdi/mdidockablewindow.h
......@@ -64,11 +63,32 @@ SET(CampvisApplicationToBeMocced
gui/properties/stringpropertywidget.h
gui/properties/statuspropertywidget.h
gui/properties/transferfunctionpropertywidget.h
tools/qtexteditlog.h
tools/bufferinglog.h
tools/qtexteditlog.h
tools/qtjobprocessor.h
)
IF(CAMPVIS_ENABLE_SCRIPTING)
LIST(APPEND CampvisApplicationToBeMocced
${CMAKE_CURRENT_SOURCE_DIR}/gui/completinglualineedit.h
${CMAKE_CURRENT_SOURCE_DIR}/gui/luatablewidget.h
${CMAKE_CURRENT_SOURCE_DIR}/gui/scriptingwidget.h
)
ELSE(CAMPVIS_ENABLE_SCRIPTING)
LIST(REMOVE_ITEM CampvisApplicationSources
${CMAKE_CURRENT_SOURCE_DIR}/gui/completinglualineedit.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gui/luatablewidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gui/scriptingwidget.cpp
)
LIST(REMOVE_ITEM CampvisApplicationHeaders
${CMAKE_CURRENT_SOURCE_DIR}/gui/completinglualineedit.h
${CMAKE_CURRENT_SOURCE_DIR}/gui/luatablewidget.h
${CMAKE_CURRENT_SOURCE_DIR}/gui/scriptingwidget.h
)
ENDIF(CAMPVIS_ENABLE_SCRIPTING)
# add additional sources from the activated modules
FOREACH(ModFile ${CampvisModulesApplicationSources})
# adjust relative path
......@@ -103,19 +123,31 @@ IF(CAMPVIS_ENABLE_SCRIPTING)
LIST(APPEND CampvisMainLibs campvis-scripting)
ENDIF(CAMPVIS_ENABLE_SCRIPTING)
ADD_EXECUTABLE(campvis-application
ADD_LIBRARY(campvis-application-lib
${CampvisApplicationSources} ${CampvisApplicationHeaders}
${CampvisApplicationMoc}
)
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${CampvisApplicationDefinitions} ${QT_DEFINITIONS})
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs})
TARGET_LINK_LIBRARIES(campvis-application ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES})
TARGET_LINK_LIBRARIES(campvis-application-lib ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES})
# if campvis-core is built as a shared library, CMake will define the following flag to instruct
# the code to export DLL symbols
SET_TARGET_PROPERTIES(campvis-application-lib PROPERTIES DEFINE_SYMBOL "CAMPVIS_APPLICATION_BUILD_DLL")
IF(CAMPVIS_GROUP_SOURCE_FILES)
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisApplicationSources ${CampvisHome} "")
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisApplicationHeaders ${CampvisHome} "")
ENDIF()
INSTALL(TARGETS campvis-application-lib DESTINATION exports EXPORT campvis-targets)
ADD_EXECUTABLE(campvis-application "campvis.cpp")
TARGET_LINK_LIBRARIES(campvis-application campvis-application-lib ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES})
IF(CAMPVIS_DEPLOY_SHADERS)
LIST(APPEND CampvisShaderDirectories "application/data")
LIST(APPEND CampvisShaderDirectories "application/glsl")
......
......@@ -22,37 +22,28 @@
//
// ================================================================================================
#include "tools/shading.frag"
#include "tools/texture3d.frag"
in vec3 ex_TexCoord; ///< incoming texture coordinate
in vec4 ex_Position; ///< incoming texture coordinate
out vec4 out_Color; ///< outgoing fragment color
uniform vec4 _color;
uniform LightSource _lightSource;
uniform vec3 _cameraPosition;
uniform sampler3D _strainTexture;
uniform TextureParameters3D _textureParameters;
void main() {
out_Color = _color;
vec3 worldCoords = ex_Position.xyz / ex_Position.z;
vec3 texCoords = worldToTexture(_textureParameters, worldCoords);
out_Color = texture(_strainTexture, texCoords);
while (length(out_Color) == 0.0) {
worldCoords -= normalize(ex_TexCoord) * 0.1;
texCoords = worldToTexture(_textureParameters, worldCoords);
out_Color = texture(_strainTexture, texCoords);
}
#ifdef ENABLE_SHADING
// compute gradient (needed for shading and normals)
vec3 gradient = ex_TexCoord;
out_Color.rgb = calculatePhongShading(ex_Position.xyz / ex_Position.z, _lightSource, _cameraPosition, gradient, _color.rgb, _color.rgb, vec3(1.0, 1.0, 1.0));
#ifndef APPLICATIONAPI_H__
#define APPLICATIONAPI_H__
#ifdef CAMPVIS_DYNAMIC_LIBS
#ifdef CAMPVIS_APPLICATION_BUILD_DLL
// building library -> export symbols
#ifdef WIN32
#define CAMPVIS_APPLICATION_API __declspec(dllexport)
#else
#define CAMPVIS_APPLICATION_API
#endif
#else
// including library -> import symbols
#ifdef WIN32
#define CAMPVIS_APPLICATION_API __declspec(dllimport)
#else
#define CAMPVIS_APPLICATION_API
#endif
#endif
#else
// building/including static library -> do nothing
#define CAMPVIS_APPLICATION_API
#endif
}
#endif // APPLICATIONAPI_H__
%module application
%include factory.i
%include std_pair.i
%include std_string.i
%include std_vector.i
%import "core/bindings/campvis.i"
%{
#include "application/campvisapplication.h"
#include "core/properties/allproperties.h"
#include "core/pipeline/abstractprocessor.h"
#include "core/pipeline/abstractworkflow.h"
#include "core/pipeline/autoevaluationpipeline.h"
%}
namespace campvis {
class CampVisApplication {
public:
CampVisApplication(int& argc, char** argv);
~CampVisApplication();
void init();
void deinit();
int run();
%apply SWIGTYPE *DISOWN {AbstractPipeline* pipeline};
void addPipeline(AbstractPipeline* pipeline);
DataContainer* createAndAddDataContainer(const std::string& name);
%clear AbstractPipeline* pipeline;
void rebuildAllShadersFromFiles();
void setPipelineVisibility(AbstractPipeline* pipeline, bool visibility);
/// Signal emitted when the collection of pipelines has changed.
sigslot::signal0 s_PipelinesChanged;
/// Signal emitted when the collection of DataContainers has changed.
sigslot::signal0 s_DataContainersChanged;
};
}
%luacode {
print("Module campvis-application loaded")
}
......@@ -2,7 +2,7 @@
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// If not explicitly stated otherwise: Copyright (C) 2012-2015, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
......@@ -24,10 +24,6 @@
#include "application/campvisapplication.h"
#ifdef Q_WS_X11
#include <X11/Xlib.h>
#endif
using namespace campvis;
/**
......@@ -38,9 +34,8 @@ using namespace campvis;
* \return 0 if program exited successfully
**/
int main(int argc, char** argv) {
#ifdef Q_WS_X11
XInitThreads();
#endif
// Make Xlib and GLX thread safe under X11
QCoreApplication::setAttribute(Qt::AA_X11InitThreads);
CampVisApplication app(argc, argv);
app.init();
......
......@@ -2,7 +2,7 @@
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012-2014, all rights reserved,
// If not explicitly stated otherwise: Copyright (C) 2012-2015, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universitaet Muenchen
......@@ -35,26 +35,26 @@
#include "cgt/texturereadertga.h"
#include "cgt/qt/qtthreadedcanvas.h"
#include "application/campvispainter.h"
#include "application/gui/properties/propertywidgetfactory.h"
#include "application/gui/mainwindow.h"
#include "application/gui/mdi/mdidockablewindow.h"
#include "core/tools/simplejobprocessor.h"
#include "core/init.h"
#include "core/tools/stringutils.h"
#include "core/tools/quadrenderer.h"
#include "core/pipeline/abstractpipeline.h"
#include "core/pipeline/abstractworkflow.h"
#include "core/pipeline/pipelinefactory.h"
#include "core/pipeline/pipelinepainter.h"
#include "core/datastructures/imagerepresentationconverter.h"
#include "core/pipeline/visualizationprocessor.h"
#include "modules/pipelinefactory.h"
#include "qtjobprocessor.h"
#include "tools/qtjobprocessor.h"
#include <QApplication>
#ifdef CAMPVIS_HAS_SCRIPTING
#include "scripting/gen_pipelineregistration.h"
#include "scripting/glue/luavmstate.h"
#endif
namespace campvis {
......@@ -71,82 +71,40 @@ namespace campvis {
, _argc(argc)
, _argv(argv)
{
// Make Xlib and GLX thread safe under X11
QApplication::setAttribute(Qt::AA_X11InitThreads);
sigslot::signal_manager::init();
sigslot::signal_manager::getRef().start();
cgt::GlContextManager::init();
OpenGLJobProcessor::init();
SimpleJobProcessor::init();
QtJobProcessor::init();
}
CampVisApplication::~CampVisApplication() {
cgtAssert(_initialized == false, "Destructing initialized CampVisApplication, deinitialize first!");
sigslot::signal_manager::getRef().stop();
sigslot::signal_manager::deinit();
}
void CampVisApplication::init() {
cgtAssert(_initialized == false, "Tried to initialize CampVisApplication twice.");
// Init CGT
cgt::InitFeature::Features featureset = cgt::InitFeature::ALL;
cgt::init(featureset);
LogMgr.getConsoleLog()->addCat("", true);
_mainWindow = new MainWindow(this);
// create a local OpenGL context and init GL
_localContext = new QtThreadedCanvas("", cgt::ivec2(16, 16));
cgt::GlContextManager::getRef().registerContextAndInitGlew(_localContext, "Local Context");
cgt::initGL(featureset);
ShdrMgr.setDefaultGlslVersion("330");
LGL_ERROR;
QuadRenderer::init();
QtJobProcessor::init();
std::vector<std::string> searchPaths;
if (_argc > 0) {
// ugly hack
std::string basePath(_argv[0]);
basePath = cgt::FileSystem::parentDir(basePath);
ShdrMgr.addPath(basePath);
ShdrMgr.addPath(basePath + "/core/glsl");
basePath = cgt::FileSystem::parentDir(cgt::FileSystem::parentDir(basePath));
ShdrMgr.addPath(basePath);
ShdrMgr.addPath(basePath + "/core/glsl");
searchPaths.push_back(cgt::FileSystem::parentDir(basePath));
searchPaths.push_back(cgt::FileSystem::parentDir(cgt::FileSystem::parentDir(basePath)));
#ifdef CAMPVIS_SOURCE_DIR
{
std::string sourcePath = CAMPVIS_SOURCE_DIR;
ShdrMgr.addPath(sourcePath);
ShdrMgr.addPath(sourcePath + "/core/glsl");
}
searchPaths.push_back(CAMPVIS_SOURCE_DIR);
#endif
}
_mainWindow->init();
// ensure matching OpenGL specs
LINFO("Using Graphics Hardware " << GpuCaps.getVendorAsString() << " " << GpuCaps.getGlRendererString() << " on " << GpuCaps.getOSVersionString());
LINFO("Supported OpenGL " << GpuCaps.getGlVersion() << ", GLSL " << GpuCaps.getShaderVersion());
if (GpuCaps.getGlVersion() < cgt::GpuCapabilities::GlVersion::CGT_GL_VERSION_3_3) {
LERROR("Your system does not support OpenGL 3.3, which is mandatory. CAMPVis will probably not work as intended.");
}
if (GpuCaps.getShaderVersion() < cgt::GpuCapabilities::GlVersion::SHADER_VERSION_330) {
LERROR("Your system does not support GLSL Shader Version 3.30, which is mandatory. CAMPVis will probably not work as intended.");
}
_localContext = new QtThreadedCanvas("", cgt::ivec2(16, 16));
campvis::init(_localContext, searchPaths);
_mainWindow = new MainWindow(this);
cgt::GLContextScopedLock lock(_localContext);
{
_mainWindow->init();
// load textureData from file
cgt::TextureReaderTga trt;
_errorTexture = trt.loadTexture(ShdrMgr.completePath("application/data/no_input.tga"), cgt::Texture::LINEAR);
#ifdef CAMPVIS_HAS_SCRIPTING
// create and store Lua VM for this very pipeline
_luaVmState = new LuaVmState();
......@@ -159,9 +117,11 @@ namespace campvis {
LERROR("Error setting up Lua VM.");
// Load CAMPVis' core Lua module to have SWIG glue for AutoEvaluationPipeline available
if (! _luaVmState->execString("require(\"cgt\")"))
LERROR("Error setting up Lua VM.");
if (! _luaVmState->execString("require(\"campvis\")"))
LERROR("Error setting up Lua VM.");
if (! _luaVmState->execString("require(\"cgt\")"))
if (! _luaVmState->execString("require(\"application\")"))
LERROR("Error setting up Lua VM.");
if (! _luaVmState->execString("pipelines = {}"))
......@@ -169,8 +129,11 @@ namespace campvis {
if (! _luaVmState->execString("inspect = require 'inspect'"))
LERROR("Error setting up Lua VM.");
if (! _luaVmState->injectGlobalObjectPointer(this, "campvis::CampVisApplication *", "application"))
LERROR("Could not inject the pipeline into the Lua VM.");
#endif
GLCtxtMgr.releaseContext(_localContext, false);
}
// parse argument list and create pipelines
QStringList pipelinesToAdd = this->arguments();
......@@ -186,7 +149,7 @@ namespace campvis {
std::vector<AbstractPipeline*> pipelines = w->getPipelines();
for (auto it = pipelines.begin(); it != pipelines.end(); ++it) {
addPipeline((*it)->getName(), *it);
addPipeline(*it);
}