Commit b4c859d1 authored by Florent D'Halluin's avatar Florent D'Halluin
Browse files

[yavgui] Add a custom scene class.

* yavgui/src/Makefile.am: Add files.
* yavgui/src/automaton_instance.cc,
* yavgui/src/automaton_instance.hh,
* yavgui/src/automaton_instance.hxx,
* yavgui/src/gui.hh,
* yavgui/src/vcsn_automaton.cc,
* yavgui/src/g_painter.cc,
* yavgui/src/g_painter.hh: Change references.
* yavgui/src/g_scene.cc,
* yavgui/src/g_scene.hh,
* yavgui/src/g_scene.hxx: All new. Implementation.
parent 60431893
2009-08-04 d-halluin <d-halluin@lrde.epita.fr>
[yavgui] Add a custom scene class.
* yavgui/src/Makefile.am: Add files.
* yavgui/src/automaton_instance.cc,
* yavgui/src/automaton_instance.hh,
* yavgui/src/automaton_instance.hxx,
* yavgui/src/gui.hh,
* yavgui/src/vcsn_automaton.cc,
* yavgui/src/g_painter.cc,
* yavgui/src/g_painter.hh: Change references.
* yavgui/src/g_scene.cc,
* yavgui/src/g_scene.hh,
* yavgui/src/g_scene.hxx: All new. Implementation.
2009-08-04 d-halluin <d-halluin@lrde.epita.fr>
 
[yavgui] Change GStateAdder into GVcsnHandler.
......
......@@ -31,9 +31,9 @@ COMMON_SOURCES = main.cc \
dialog_get_layout.moc.cc \
g_view.cc \
g_view.moc.cc \
g_scene.cc \
g_scene.moc.cc \
g_state.cc \
g_state_adder.cc \
g_state_adder.moc.cc \
g_vcsn_handler.cc \
g_vcsn_handler.moc.cc \
g_transition.cc \
......
......@@ -28,7 +28,7 @@ namespace gui
{
AutomatonInstance::AutomatonInstance (QString filename)
: vcsn_automaton_ (),
scene_ (new QGraphicsScene ()),
scene_ (new GScene ()),
view_ (new GView ()),
status_ (""),
filename_ (filename),
......
......@@ -50,7 +50,7 @@ namespace gui
GLayout layout = GLAYOUT_NONE);
inline void refresh (QTextEdit* = NULL, QMenu* = NULL);
inline QGraphicsScene* scene ();
inline GScene* scene ();
inline GView* view ();
inline QString status ();
inline QString filename ();
......@@ -66,7 +66,7 @@ namespace gui
AutomatonInstance (const AutomatonInstance&);
VcsnAutomaton vcsn_automaton_;
QGraphicsScene* scene_;
GScene* scene_;
GView* view_;
QString status_;
......
......@@ -45,7 +45,7 @@ namespace gui
return view_;
}
QGraphicsScene* AutomatonInstance::scene ()
GScene* AutomatonInstance::scene ()
{
return scene_;
}
......
......@@ -31,7 +31,7 @@ namespace gui
namespace display
{
GPainter::GPainter (QGraphicsScene** scene,
GPainter::GPainter (GScene** scene,
GView** view,
GLayout layout)
: scene_ (scene),
......@@ -43,7 +43,7 @@ namespace gui
void GPainter::clear ()
{
QGraphicsScene* sc = new QGraphicsScene ();
GScene* sc = new GScene ();
(sc)->setSceneRect(-SCENE_SIZE / 2, -SCENE_SIZE / 2,
SCENE_SIZE, SCENE_SIZE);
......
......@@ -30,8 +30,7 @@
# include "g_state.hh"
# include "g_transition.hh"
# include "g_view.hh"
# include <QGraphicsScene>
# include "g_scene.hh"
# include <boost/variant.hpp>
......@@ -44,7 +43,7 @@ namespace gui
class GPainter: public boost::static_visitor<>
{
public:
GPainter (QGraphicsScene** scene,
GPainter (GScene** scene,
GView** view,
GLayout layout = GLAYOUT_CIRCLE);
......@@ -57,7 +56,7 @@ namespace gui
private:
void position (std::vector<GState*>& states);
QGraphicsScene** scene_;
GScene** scene_;
GView** view_;
GLayout layout_;
};
......
// g_scene.cc: this file is part of Vaucanson.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2006 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
/**
* @file g_scene.cc
* @author Florent D'Halluin <d-halluin@lrde.epita.fr>
*
*
*/
#include "g_scene.hh"
namespace gui
{
namespace display
{
GScene::GScene ()
{
}
} // ! namespace display
} // ! namespace gui
// g_scene.hh: this file is part of Vaucanson.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2006 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
/**
* @file g_scene.hh
* @author Florent D'Halluin <d-halluin@lrde.epita.fr>
*
*
*/
#ifndef G_SCENE_HH_
# define G_SCENE_HH_
# include <QtGui>
# include "common.hh"
# include "g_state.hh"
namespace gui
{
namespace display
{
class GScene : public QGraphicsScene
{
Q_OBJECT
public:
GScene ();
signals:
void stateSelected (GState* state);
void stateDeselected (GState* state);
void delState (GState* state);
void addState (QPointF pos);
};
} // ! namespace display
} // ! namespace gui
# include "g_scene.hxx"
#endif /* !G_SCENE_HH_ */
// g_scene.hxx: this file is part of Vaucanson.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2006 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
/**
* @file g_scene.hxx
* @author Florent D'Halluin <d-halluin@lrde.epita.fr>
*
*
*/
#ifndef G_SCENE_HXX_
# define G_SCENE_HXX_
namespace gui
{
namespace display
{
} // ! namespace display
} // ! namespace gui
#endif /* !G_SCENE_HXX_ */
......@@ -28,8 +28,6 @@
# include <QObject>
# include <QApplication>
# include <QPushButton>
# include <QGraphicsScene>
# include <QGraphicsView>
# include <QGraphicsItem>
# include <QVBoxLayout>
# include <QtGui>
......@@ -38,6 +36,7 @@
# include "common.hh"
# include "g_view.hh"
# include "g_scene.hh"
using namespace gui::display;
......
......@@ -35,7 +35,7 @@ using namespace vcsn;
namespace gui
{
void VcsnAutomaton::paint (QGraphicsScene** scene,
void VcsnAutomaton::paint (GScene** scene,
GView** view,
display::GLayout layout)
{
......
Supports Markdown
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