Commit 54603ff0 authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps: add some slots / import return mapHandler

parent 261883ed
......@@ -38,6 +38,7 @@ SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/view.h
${SCHNApps_ROOT_DIR}/include/window.h
${SCHNApps_ROOT_DIR}/include/mapHandler.h
${SCHNApps_ROOT_DIR}/include/plugin.h
${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
${SCHNApps_ROOT_DIR}/include/dialogs/camerasDialog.h
${SCHNApps_ROOT_DIR}/include/dialogs/pluginsDialog.h
......
......@@ -15,7 +15,7 @@ bool ImportSurfacePlugin::enable()
return true;
}
void ImportSurfacePlugin::importFromFile(const QString& fileName)
MapHandlerGen* ImportSurfacePlugin::importFromFile(const QString& fileName)
{
QFileInfo fi(fileName);
if(fi.exists())
......@@ -43,6 +43,7 @@ void ImportSurfacePlugin::importFromFile(const QString& fileName)
mh->updatePrimitives(Algo::Render::GL2::LINES);
mh->updatePrimitives(Algo::Render::GL2::TRIANGLES);
}
return mhg;
}
}
......
......@@ -35,7 +35,7 @@ public:
virtual void wheelEvent(View* view, int delta, int x, int y) {}
public slots:
void importFromFile(const QString& fileName);
MapHandlerGen* importFromFile(const QString& fileName);
void importFromFileDialog();
private:
......
......@@ -15,7 +15,7 @@ bool ImportVolumePlugin::enable()
return true;
}
void ImportVolumePlugin::importFromFile(const QString& fileName)
MapHandlerGen* ImportVolumePlugin::importFromFile(const QString& fileName)
{
QFileInfo fi(fileName);
if(fi.exists())
......@@ -43,6 +43,7 @@ void ImportVolumePlugin::importFromFile(const QString& fileName)
mh->updatePrimitives(Algo::Render::GL2::LINES);
mh->updatePrimitives(Algo::Render::GL2::TRIANGLES);
}
return mhg;
}
}
......
......@@ -35,7 +35,7 @@ public:
virtual void wheelEvent(View* view, int delta, int x, int y) {}
public slots:
void importFromFile(const QString& fileName);
MapHandlerGen* importFromFile(const QString& fileName);
void importFromFileDialog();
private:
......
......@@ -37,6 +37,7 @@ file(
SET(SCHNApps_H_OBJECT_FILES
${SCHNApps_ROOT_DIR}/include/view.h
${SCHNApps_ROOT_DIR}/include/mapHandler.h
${SCHNApps_ROOT_DIR}/include/plugin.h
${SCHNApps_ROOT_DIR}/include/window.h
${SCHNApps_ROOT_DIR}/include/viewButtonArea.h
${SCHNApps_ROOT_DIR}/include/dialogs/camerasDialog.h
......
importPlugin = schnapps.loadPlugin("ImportSurfacePlugin");
differentialPropertiesPlugin = schnapps.loadPlugin("DifferentialPropertiesPlugin");
renderPlugin = schnapps.loadPlugin("RenderPlugin");
hand = importPlugin.importFromFile("/home/kraemer/Media/Data/surface/midRes/handman_12k.off");
v = schnapps.getView("view_0");
schnapps.linkViewAndPlugin(v.getName(), renderPlugin.getName());
schnapps.linkViewAndMap(v.getName(), hand.getName());
......@@ -29,6 +29,9 @@ public:
virtual ~MapHandlerGen();
const QString& getName() const { return m_name; }
public slots:
QString getName() { return m_name; }
void setName(const QString& name) { m_name = name; }
Window* getWindow() const { return m_window; }
......@@ -42,6 +45,7 @@ public:
bool isUsed() const { return !l_views.empty(); }
public:
void draw(Utils::GLSLShader* shader, int primitive) { m_render->draw(shader, primitive); }
/*********************************************************
......
......@@ -16,12 +16,16 @@ class Window;
class Plugin : public QObject
{
Q_OBJECT
public:
Plugin();
virtual ~Plugin();
const QString& getName() const { return m_name; }
public slots:
const QString& getName() { return m_name; }
QString getName() { return m_name; }
void setName(const QString& name) { m_name = name; }
const QString& getFilePath() { return m_filePath; }
......
......@@ -32,6 +32,9 @@ public:
~View();
const QString& getName() const { return m_name; }
public slots:
QString getName() { return m_name; }
void setName(const QString& name) { m_name = name; }
Window* getWindow() const { return m_window; }
......@@ -39,6 +42,7 @@ public:
bool isCurrentView() const { return m_window->getCurrentView() == this; }
public:
virtual void init();
virtual void preDraw();
virtual void draw();
......
#include <QSplashScreen>
#include <QFileInfo>
#include "PythonQt/PythonQt.h"
#include "PythonQt/gui/PythonQtScriptingConsole.h"
#include "window.h"
......@@ -29,7 +30,9 @@ int main(int argc, char* argv[])
schnapps.show();
pythonContext.addObject("schnapps", &schnapps);
pythonContext.evalFile(app.applicationDirPath() + QString("/init.py"));
QFileInfo fi(app.applicationDirPath() + QString("/init.py"));
if(fi.exists())
pythonContext.evalFile(fi.filePath());
splash->finish(&schnapps);
delete splash;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment