Skip to content
Snippets Groups Projects
Commit c9307ef8 authored by sebastianfreitag's avatar sebastianfreitag
Browse files

added VistaSimpleOpenGLDraw, an IVistaOpenGLDraw which can take a draw routine...

added VistaSimpleOpenGLDraw, an IVistaOpenGLDraw which can take a draw routine as constructor parameter (e.g., as a lambda function)
parent 268d6d0e
No related branches found
No related tags found
No related merge requests found
Pipeline #
/*============================================================================*/
/* ViSTA VR toolkit */
/* Copyright (c) 1997-2016 RWTH Aachen University */
/*============================================================================*/
/* License */
/* */
/* This program 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 of the License, or */
/* (at your option) any later version. */
/* */
/* This program 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 program. If not, see <http://www.gnu.org/licenses/>. */
/*============================================================================*/
/* Contributors */
/* */
/*============================================================================*/
/*============================================================================*/
/* INCLUDES */
/*============================================================================*/
#include "VistaSimpleOpenGLDraw.h"
/*============================================================================*/
/* CONSTRUCTORS / DESTRUCTOR */
/*============================================================================*/
VistaSimpleOpenGLDraw::VistaSimpleOpenGLDraw(
std::function<void()> funcDraw,
const VistaBoundingBox& oBoundingBox)
: IVistaOpenGLDraw()
, m_funcDraw(funcDraw)
, m_oBB(oBoundingBox)
{
}
VistaSimpleOpenGLDraw::~VistaSimpleOpenGLDraw()
{
}
/*============================================================================*/
/* IMPLEMENTATION */
/*============================================================================*/
bool VistaSimpleOpenGLDraw::Do()
{
m_funcDraw();
return true;
}
bool VistaSimpleOpenGLDraw::GetBoundingBox(VistaBoundingBox &bb)
{
bb = m_oBB;
return true;
}
/*============================================================================*/
/* END OF FILE */
/*============================================================================*/
/*============================================================================*/
/* ViSTA VR toolkit */
/* Copyright (c) 1997-2016 RWTH Aachen University */
/*============================================================================*/
/* License */
/* */
/* This program 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 of the License, or */
/* (at your option) any later version. */
/* */
/* This program 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 program. If not, see <http://www.gnu.org/licenses/>. */
/*============================================================================*/
/* Contributors */
/* */
/*============================================================================*/
#ifndef _VISTASIMPLEOPENGLDRAW_H
#define _VISTASIMPLEOPENGLDRAW_H
/*============================================================================*/
/* INCLUDES */
/*============================================================================*/
#include "../VistaKernelConfig.h"
#include "VistaOpenGLDraw.h"
#include <functional>
#include "VistaMath/VistaBoundingBox.h"
/*============================================================================*/
/* FORWARD DECLARATIONS */
/*============================================================================*/
/*============================================================================*/
/* CLASS DEFINITIONS */
/*============================================================================*/
class VISTAKERNELAPI VistaSimpleOpenGLDraw : public IVistaOpenGLDraw
{
public:
VistaSimpleOpenGLDraw(std::function<void()> funcDraw, const VistaBoundingBox& oBoundingBox);
virtual ~VistaSimpleOpenGLDraw();
virtual bool Do();
virtual bool GetBoundingBox(VistaBoundingBox &bb);
protected:
VistaBoundingBox m_oBB;
std::function<void()> m_funcDraw;
private:
};
#endif // _VISTASIMPLEOPENGLDRAW_H
/*============================================================================*/
/* END OF FILE */
/*============================================================================*/
......@@ -37,6 +37,8 @@ set( DirFiles
VistaOpenGLDebug.h
VistaOpenGLDraw.cpp
VistaOpenGLDraw.h
VistaSimpleOpenGLDraw.cpp
VistaSimpleOpenGLDraw.h
VistaOpenGLNode.cpp
VistaOpenGLNode.h
VistaOpenGLPolyLine.cpp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment