Commit d62d8e61 authored by wiebel's avatar wiebel

Added a class for the graphics display

Connected that class with widget that holds graphics displays
added gui superclass
changed CMakeLists Files accordingly
added documentation
parent 07426d3e
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT( BrainCognize )
set( QT_INCLUDE_DIR /local/install )
# Package dependencies
FIND_PACKAGE( Qt4 REQUIRED )
FIND_PACKAGE( OpenGL REQUIRED )
......@@ -17,7 +19,6 @@ SET(
${QT_QTOPENGL_LIBRARY}
)
ADD_SUBDIRECTORY( gui )
SET( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib )
MARK_AS_ADVANCED( LIBRARY_OUTPUT_PATH )
......@@ -28,8 +29,13 @@ MARK_AS_ADVANCED( EXECUTABLE_OUTPUT_PATH )
#-----------------------
# -Wno-long-long is used since on Ubuntu 8.10 it won't compile without it
SET( CMAKE_CXX_FLAGS "-Wall -pedantic -Wno-long-long" )
SET( CMAKE_CXX_FLAGS "-Wall -pedantic -ansi -Wno-long-long" )
ADD_SUBDIRECTORY( math )
ADD_SUBDIRECTORY( dataHandler )
ADD_SUBDIRECTORY( graphicsEngine )
ADD_SUBDIRECTORY( gui )
ADD_SUBDIRECTORY( plugins )
ADD_EXECUTABLE( bCognize bCognize.cpp )
TARGET_LINK_LIBRARIES(
......@@ -47,4 +53,11 @@ ADD_CUSTOM_TARGET(doc
COMMENT "Build doxygen documentation"
VERBATIM
)
ADD_CUSTOM_TARGET(docs
COMMAND echo "If you would like to build the documentation issue 'make doc', i.e. remove the trailing 's'."
COMMAND exit 1
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/..
COMMENT "Hint for for peope who are used to using 'make docs' instead of 'make doc'."
VERBATIM
)
......@@ -11,6 +11,10 @@
/**
* The main routine starting up the whole application.
*
* \mainpage BrainCognize Inline Documentation
*
* For a list of the current modules see the "Modules" tab in the naviagtion bar above.
*/
int main( int argc, char* argv[] )
{
......
//---------------------------------------------------------------------------
//
// Project: BrainCognize
//
//---------------------------------------------------------------------------
#include "BGLScenePainter.h"
#include <GL/gl.h>
#include <GL/glu.h>
BGLScenePainter::BGLScenePainter()
{
// TODO Auto-generated constructor stub
}
BGLScenePainter::~BGLScenePainter()
{
// TODO Auto-generated destructor stub
}
void BGLScenePainter::initGL()
{
}
void BGLScenePainter::paintGL()
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glLoadIdentity();
glBegin( GL_QUADS );
glColor3f( 0.5, 0.5, 0.9 );
glVertex3d( 0, 0, -0.05 );
glVertex3d( .5, 0, -0.05 );
glVertex3d( .5, .5, -0.05 );
glVertex3d( 0, .5, -0.05 );
glColor3f( 1, 0.5, 0.9 );
glVertex3d( .25, 0.3, -0.05 );
glVertex3d( .25, 0.3, -0.05 );
glVertex3d( 5, .5, -0.05 );
glVertex3d( .25, .5, -0.05 );
glEnd();
}
void BGLScenePainter::resizeGL(int w, int h)
{
}
//---------------------------------------------------------------------------
//
// Project: BrainCognize
//
//---------------------------------------------------------------------------
#ifndef BGLSCENEPAINTER_H
#define BGLSCENEPAINTER_H
/**
* \ingroup ge
* This is the base class for rendering the scene graph.
*/
class BGLScenePainter
{
public:
BGLScenePainter();
virtual ~BGLScenePainter();
/**
* Initialize the OpenGL context, e.g., set main transformation matrices.
*/
virtual void initGL();
/**
* Do the OpenGL painting in every frame.
*/
virtual void paintGL();
/**
* Called, when the window is resized and re-initialization of the
* window parameters and matrices may need to be done.
*/
virtual void resizeGL(int w, int h);
};
/**
\defgroup ge GraphicsEngine
\brief
This module implements the graphics engine for BrainCognize.
*/
#endif /* BGLSCENEPAINTER_H */
list( APPEND GE_SRC
BGLScenePainter.cpp
)
add_library( ge SHARED ${GE_SRC} )
\ No newline at end of file
//---------------------------------------------------------------------------
//
// Project: BrainCognize
//
//---------------------------------------------------------------------------
#include "BGUI.h"
BGUI::BGUI()
{
// TODO Auto-generated constructor stub
}
BGUI::~BGUI()
{
// TODO Auto-generated destructor stub
}
//---------------------------------------------------------------------------
//
// Project: BrainCognize
//
//---------------------------------------------------------------------------
#ifndef BGUI_H
#define BGUI_H
/**
* This class prescribes the interface to the GUI.
* \ingroup gui
*/
class BGUI
{
public:
BGUI();
virtual ~BGUI();
/**
* \brief
* enable/disable the access to the GUI
* \post
* GUI enabled/disabled
* \param enable true iff gui should be enabled
*/
virtual void setEnabled (bool enable) = 0;
};
/**
\defgroup gui GUI
\brief
This module implements the graphical user interface for BrainCognize.
*/
#endif /* BGUI_H */
add_subdirectory( qt4 )
\ No newline at end of file
add_subdirectory( qt4 )
list( APPEND GUI_SRC
BGUI.cpp
)
add_library( gui SHARED ${GUI_SRC} )
\ No newline at end of file
......@@ -139,3 +139,8 @@ void BMainWindow::setupGUI( QMainWindow *MainWindow )
QMetaObject::connectSlotsByName( MainWindow );
}
void BMainWindow::setEnabled (bool enable)
{
// NOTE implement here
}
......@@ -17,16 +17,19 @@
#include <QtGui/QToolBar>
#include <QtGui/QWidget>
#include "../BGUI.h"
//forward declarations
class BQtGLWidget;
class BQtPipelineBrowser;
#include "../icons/icons.h"
/**
* \ingroup gui
* This class contains the main window and the layout
* of the widgets within the window.
*/
class BMainWindow
class BMainWindow : public BGUI
{
public:
......@@ -35,6 +38,15 @@ public:
*/
void setupGUI( QMainWindow *MainWindow );
/**
* \brief
* enable/disable the access to the GUI
* \post
* GUI enabled/disabeld
* \param enable true iff gui should be enabled
*/
void setEnabled( bool enable );
private:
QAction* m_actionLoad;
QAction* m_actionSave;
......
......@@ -5,12 +5,22 @@
//---------------------------------------------------------------------------
#include "BQtGLWidget.h"
#include "../../graphicsEngine/BGLScenePainter.h"
BQtGLWidget::BQtGLWidget( BGLScenePainter* scenePainter, QWidget *parent ) :
m_scenePainter( scenePainter ), QGLWidget( parent ), m_recommendedSize()
{
m_recommendedSize.setWidth( 200 );
m_recommendedSize.setHeight( 200 );
}
BQtGLWidget::BQtGLWidget( QWidget *parent ) :
QGLWidget( parent ), m_recommendedSize()
{
m_recommendedSize.setWidth( 200 );
m_recommendedSize.setHeight( 200 );
m_scenePainter = new BGLScenePainter();
}
......@@ -22,17 +32,7 @@ BQtGLWidget::~BQtGLWidget()
void BQtGLWidget::paintGL()
{
// TODO we have to have something automatic in here in the future
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glLoadIdentity();
glBegin( GL_QUADS );
glColor3f( 0.5, 0.5, 0.9 );
glVertex3d( 0, 0, -0.05 );
glVertex3d( .5, 0, -0.05 );
glVertex3d( .5, .5, -0.05 );
glVertex3d( 0, .5, -0.05 );
glEnd();
m_scenePainter->paintGL();
}
QSize BQtGLWidget::sizeHint() const
......
......@@ -9,13 +9,18 @@
#include <QtOpenGL/QGLWidget>
class BGLScenePainter;
/**
* \ingroup gui
* A widget containing an open gl display area.
*/
class BQtGLWidget: public QGLWidget
{
public:
BQtGLWidget( QWidget *parent = 0 );
BQtGLWidget( BGLScenePainter* scenePainter, QWidget *parent = 0 );
virtual ~BQtGLWidget();
/**
......@@ -29,10 +34,16 @@ private:
*/
void paintGL();
/**
* Holds the GL scene painter of the widget
*/
BGLScenePainter* m_scenePainter;
/**
* Holds the recommended size for the widget
*/
QSize m_recommendedSize;
};
#endif /* BQTGLWIDGET_H */
......@@ -10,6 +10,7 @@
#include <QtGui/QDockWidget>
/**
* \ingroup gui
* Represents the browser showing the loaded data sets
* and applied filter/methods/algorithms/plugins
*/
......
......@@ -4,4 +4,5 @@ list( APPEND GUI_QT4_SRC
BQtPipelineBrowser.cpp
)
add_library( guiqt4 SHARED ${GUI_QT4_SRC} )
\ No newline at end of file
add_library( guiqt4 SHARED ${GUI_QT4_SRC} )
target_link_libraries( guiqt4 gui ge )
\ No newline at end of file
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