Skip to content
Snippets Groups Projects
Commit c961b6eb authored by stefan's avatar stefan
Browse files

boost export for glwin_base

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1810 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 274a919f
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ set(OST_GFX_PYMOD_SOURCES ...@@ -10,6 +10,7 @@ set(OST_GFX_PYMOD_SOURCES
export_scene_observer.cc export_scene_observer.cc
export_render_options.cc export_render_options.cc
export_color_ops.cc export_color_ops.cc
export_glwin_base.cc
) )
if (ENABLE_IMG) if (ENABLE_IMG)
......
//------------------------------------------------------------------------------
// This file is part of the OpenStructure project <www.openstructure.org>
//
// Copyright (C) 2008-2010 by the OpenStructure authors
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 3.0 of the License, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
// details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//------------------------------------------------------------------------------
#include <boost/python.hpp>
#include <ost/gfx/glwin_base.hh>
#include "glwin_base_proxy.hh"
using namespace boost::python;
using namespace ost;
using namespace ost::gfx;
void export_GLWinBase()
{
class_<GLWinBase, GLWinBaseProxy, boost::noncopyable>("GLWinBase", no_init)
.def("DoRefresh",&GLWinBase::DoRefresh)
.def("StatusMessage",&GLWinBase::StatusMessage)
;
}
#ifndef OST_GFX_GLWIN_BASE_PROXY_HH
#define OST_GFX_GLWIN_BASE_PROXY_HH
#include <boost/python.hpp>
#include <boost/python/register_ptr_to_python.hpp>
using namespace boost::python;
#include <ost/gfx/glwin_base.hh>
using namespace ost;
using namespace ost::gfx;
namespace {
class GLWinBaseProxy: public GLWinBase {
public:
GLWinBaseProxy(PyObject *p) :
self(p) {
}
virtual void DoRefresh() {
call_method<void>(self, "DoRefresh");
}
virtual void StatusMessage(const String& m) {
call_method<void, const String>(self, "StatusMessage", m);
}
private:
PyObject* self;
};
}
#endif
...@@ -42,6 +42,8 @@ extern void export_RenderOptions(); ...@@ -42,6 +42,8 @@ extern void export_RenderOptions();
extern void export_ColorOps(); extern void export_ColorOps();
extern void export_GLWinBase();
using namespace ost; using namespace ost;
using namespace ost::gfx; using namespace ost::gfx;
...@@ -77,6 +79,7 @@ BOOST_PYTHON_MODULE(_gfx) ...@@ -77,6 +79,7 @@ BOOST_PYTHON_MODULE(_gfx)
export_SymmetryNode(); export_SymmetryNode();
export_SceneObserver(); export_SceneObserver();
export_ColorOps(); export_ColorOps();
export_GLWinBase();
enum_<RenderMode::Type>("RenderMode") enum_<RenderMode::Type>("RenderMode")
.value("SIMPLE",RenderMode::SIMPLE) .value("SIMPLE",RenderMode::SIMPLE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment