Revision: 7066
http://sumo.svn.sourceforge.net/sumo/?rev=7066&view=rev
Author: dkrajzew
Date: 2009-04-24 13:43:59 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
removed unneeded members, refs#36, #12
Modified Paths:
--------------
trunk/sumo/src/utils/gui/tracker/GUITLLogicPhasesTrackerWindow.cpp
trunk/sumo/src/utils/gui/tracker/GUITLLogicPhasesTrackerWindow.h
Modified: trunk/sumo/src/utils/gui/tracker/GUITLLogicPhasesTrackerWindow.cpp
===================================================================
--- trunk/sumo/src/utils/gui/tracker/GUITLLogicPhasesTrackerWindow.cpp 2009-04-24 08:48:37 UTC (rev 7065)
+++ trunk/sumo/src/utils/gui/tracker/GUITLLogicPhasesTrackerWindow.cpp 2009-04-24 13:43:59 UTC (rev 7066)
@@ -62,6 +62,89 @@
// member method definitions
// ===========================================================================
/* -------------------------------------------------------------------------
+ * GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel-callbacks
+ * ----------------------------------------------------------------------- */
+FXDEFMAP(GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel) GUITLLogicPhasesTrackerPanelMap[]={
+ FXMAPFUNC(SEL_CONFIGURE, 0, GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure),
+ FXMAPFUNC(SEL_PAINT, 0, GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onPaint),
+
+};
+
+// Macro for the GLTestApp class hierarchy implementation
+FXIMPLEMENT(GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel,FXGLCanvas,GUITLLogicPhasesTrackerPanelMap,ARRAYNUMBER(GUITLLogicPhasesTrackerPanelMap))
+
+
+
+/* -------------------------------------------------------------------------
+ * GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel-methods
+ * ----------------------------------------------------------------------- */
+GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::GUITLLogicPhasesTrackerPanel(
+ FXComposite *c, GUIMainWindow &app,
+ GUITLLogicPhasesTrackerWindow &parent) throw()
+ : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*) 0, (FXSelector) 0, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y/*, 0, 0, 300, 200*/),
+ myParent(&parent), myApplication(&app) {}
+
+
+GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::~GUITLLogicPhasesTrackerPanel() throw() {}
+
+
+long
+GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure(
+ FXObject*,FXSelector,void*) {
+ if (makeCurrent()) {
+ int widthInPixels = getWidth();
+ int heightInPixels = getHeight();
+ if (widthInPixels!=0&&heightInPixels!=0) {
+ glViewport(0, 0, widthInPixels-1, heightInPixels-1);
+ glClearColor(0, 0, 0, 1);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+ glDisable(GL_LINE_SMOOTH);
+ glEnable(GL_BLEND);
+ glEnable(GL_ALPHA_TEST);
+ glDisable(GL_COLOR_MATERIAL);
+ glLineWidth(1);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ }
+ }
+ return 1;
+}
+
+
+long
+GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onPaint(
+ FXObject*,FXSelector,void*) {
+ if (!isEnabled()) {
+ return 1;
+ }
+ if (makeCurrent()) {
+ int widthInPixels = getWidth();
+ int heightInPixels = getHeight();
+ if (widthInPixels!=0&&heightInPixels!=0) {
+ glViewport(0, 0, widthInPixels-1, heightInPixels-1);
+ glClearColor(0, 0, 0, 1);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_LIGHTING);
+ glDisable(GL_LINE_SMOOTH);
+ glEnable(GL_BLEND);
+ glEnable(GL_ALPHA_TEST);
+ glDisable(GL_COLOR_MATERIAL);
+ glLineWidth(1);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ // draw
+ glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+ myParent->drawValues(*this);
+ glFlush();
+ swapBuffers();
+ }
+ makeNonCurrent();
+ }
+ return 1;
+}
+
+
+
+/* -------------------------------------------------------------------------
* GUITLLogicPhasesTrackerWindow - FOX callback mapping
* ----------------------------------------------------------------------- */
FXDEFMAP(GUITLLogicPhasesTrackerWindow) GUITLLogicPhasesTrackerWindowMap[]={
@@ -80,7 +163,7 @@
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(
GUIMainWindow &app,
MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &wrapper,
- ValueSource<std::pair<SUMOTime, MSPhaseDefinition> > *src)
+ ValueSource<std::pair<SUMOTime, MSPhaseDefinition> > *src) throw()
: FXMainWindow(app.getApp(), "TLS-Tracker",NULL,NULL,DECOR_ALL,
20,20,300,200),
myApplication(&app), myTLLogic(&logic), myAmInTrackingMode(true) {
@@ -117,7 +200,7 @@
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(
GUIMainWindow &app,
MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &/*wrapper*/,
- const MSSimpleTrafficLightLogic::Phases &/*phases*/)
+ const MSSimpleTrafficLightLogic::Phases &/*phases*/) throw()
: FXMainWindow(app.getApp(), "TLS-Tracker",NULL,NULL,DECOR_ALL,
20,20,300,200),
myApplication(&app), myTLLogic(&logic), myAmInTrackingMode(false),
@@ -141,7 +224,7 @@
}
-GUITLLogicPhasesTrackerWindow::~GUITLLogicPhasesTrackerWindow() {
+GUITLLogicPhasesTrackerWindow::~GUITLLogicPhasesTrackerWindow() throw() {
myApplication->removeChild(this);
delete myConnector;
// just to quit cleanly on a failure
@@ -161,20 +244,8 @@
}
-int
-GUITLLogicPhasesTrackerWindow::getMaxGLWidth() const {
- return myApplication->getMaxGLWidth();
-}
-
-
-int
-GUITLLogicPhasesTrackerWindow::getMaxGLHeight() const {
- return myApplication->getMaxGLHeight();
-}
-
-
void
-GUITLLogicPhasesTrackerWindow::drawValues(GUITLLogicPhasesTrackerPanel &caller) {
+GUITLLogicPhasesTrackerWindow::drawValues(GUITLLogicPhasesTrackerPanel &caller) throw() {
// compute what shall be shown (what is visible)
myFirstPhase2Show = 0;
myFirstPhaseOffset = 0;
@@ -230,8 +301,8 @@
// draw the horizontal lines dividing the signal groups
glColor3d(1, 1, 1);
// compute some values needed more than once
- SUMOReal height = (SUMOReal) caller.getHeightInPixels();
- SUMOReal width = (SUMOReal) caller.getWidthInPixels();
+ SUMOReal height = (SUMOReal) caller.getHeight();
+ SUMOReal width = (SUMOReal) caller.getWidth();
pfSetScaleXY((SUMOReal)(.08*300./width), (SUMOReal)(.08*300./height));
SUMOReal h4 = ((SUMOReal) 4 / height);
SUMOReal h10 = ((SUMOReal) 10 / height);
@@ -394,7 +465,7 @@
void
-GUITLLogicPhasesTrackerWindow::addValue(std::pair<SUMOTime, MSPhaseDefinition> def) {
+GUITLLogicPhasesTrackerWindow::addValue(std::pair<SUMOTime, MSPhaseDefinition> def) throw() {
// do not draw while adding
myLock.lock();
// set the first time if not set before
@@ -442,100 +513,10 @@
void
-GUITLLogicPhasesTrackerWindow::setBeginTime(SUMOTime time) {
+GUITLLogicPhasesTrackerWindow::setBeginTime(SUMOTime time) throw() {
myBeginTime = time;
}
-/* -------------------------------------------------------------------------
- * GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel-methods
- * ----------------------------------------------------------------------- */
-FXDEFMAP(GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel) GUITLLogicPhasesTrackerPanelMap[]={
- FXMAPFUNC(SEL_CONFIGURE, 0, GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure),
- FXMAPFUNC(SEL_PAINT, 0, GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onPaint),
-
-};
-
-// Macro for the GLTestApp class hierarchy implementation
-FXIMPLEMENT(GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel,FXGLCanvas,GUITLLogicPhasesTrackerPanelMap,ARRAYNUMBER(GUITLLogicPhasesTrackerPanelMap))
-
-
-
-GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::GUITLLogicPhasesTrackerPanel(
- FXComposite *c, GUIMainWindow &app,
- GUITLLogicPhasesTrackerWindow &parent)
- : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*) 0, (FXSelector) 0, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y/*, 0, 0, 300, 200*/),
- myParent(&parent), myApplication(&app) {}
-
-
-GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::~GUITLLogicPhasesTrackerPanel() {}
-
-
-size_t
-GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::getHeightInPixels() const {
- return myHeightInPixels;
-}
-
-
-size_t
-GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::getWidthInPixels() const {
- return myWidthInPixels;
-}
-
-
-long
-GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure(
- FXObject*,FXSelector,void*) {
- if (makeCurrent()) {
- myWidthInPixels = myParent->getMaxGLWidth();
- myHeightInPixels = myParent->getMaxGLHeight();
- glViewport(0, 0, myWidthInPixels-1, myHeightInPixels-1);
- glClearColor(0, 0, 0, 1);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_LIGHTING);
- glDisable(GL_LINE_SMOOTH);
- glEnable(GL_BLEND);
- glEnable(GL_ALPHA_TEST);
- glDisable(GL_COLOR_MATERIAL);
- glLineWidth(1);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- }
- return 1;
-}
-
-
-long
-GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onPaint(
- FXObject*,FXSelector,void*) {
- if (!isEnabled()) {
- return 1;
- }
- if (makeCurrent()) {
- myWidthInPixels = getWidth();
- myHeightInPixels = getHeight();
- if (myWidthInPixels!=0&&myHeightInPixels!=0) {
- glViewport(0, 0, myWidthInPixels-1, myHeightInPixels-1);
- glClearColor(0, 0, 0, 1);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_LIGHTING);
- glDisable(GL_LINE_SMOOTH);
- glEnable(GL_BLEND);
- glEnable(GL_ALPHA_TEST);
- glDisable(GL_COLOR_MATERIAL);
- glLineWidth(1);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- // draw
- glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
- myParent->drawValues(*this);
- glFlush();
- swapBuffers();
- }
- makeNonCurrent();
- }
- return 1;
-}
-
-
-
/****************************************************************************/
Modified: trunk/sumo/src/utils/gui/tracker/GUITLLogicPhasesTrackerWindow.h
===================================================================
--- trunk/sumo/src/utils/gui/tracker/GUITLLogicPhasesTrackerWindow.h 2009-04-24 08:48:37 UTC (rev 7065)
+++ trunk/sumo/src/utils/gui/tracker/GUITLLogicPhasesTrackerWindow.h 2009-04-24 13:43:59 UTC (rev 7066)
@@ -70,165 +70,186 @@
public ValueRetriever<std::pair<SUMOTime, MSPhaseDefinition> > {
FXDECLARE(GUITLLogicPhasesTrackerWindow)
public:
- /// Constructor to track current phases
+ /** @brief Constructor to track current phases
+ * @param[in] app The main application window
+ * @param[in] logic The logic to track
+ * @param[in] wrapper The tracked logic's wrapper
+ * @param[in] src The value source to track
+ */
GUITLLogicPhasesTrackerWindow(GUIMainWindow &app,
MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &wrapper,
- ValueSource<std::pair<SUMOTime, MSPhaseDefinition> > *src);
+ ValueSource<std::pair<SUMOTime, MSPhaseDefinition> > *src) throw();
- /// Constructor to show the complete phase diagram
+
+ /** @brief Constructor to show the complete phase diagram
+ * @param[in] app The main application window
+ * @param[in] logic The logic to show
+ * @param[in] wrapper The shown logic's wrapper
+ * @param[in] phases The phases to show
+ */
GUITLLogicPhasesTrackerWindow(
GUIMainWindow &app,
MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &wrapper,
- const MSSimpleTrafficLightLogic::Phases &phases);
+ const MSSimpleTrafficLightLogic::Phases &phases) throw();
- /// Destructor
- ~GUITLLogicPhasesTrackerWindow();
- /// Creates the window (FOX-Toolkit)
+ /// @brief Destructor
+ ~GUITLLogicPhasesTrackerWindow() throw();
+
+
+ /// @brief Creates the window (FOX-Toolkit)
void create();
- /// Returns the information about the largest width allowed for openGL-windows
- int getMaxGLWidth() const;
- /// Returns the information about the largest height allowed for openGL-windows
- int getMaxGLHeight() const;
+ /** @brief Adds a further phase definition
+ * @param[in] def The definition to add
+ */
+ void addValue(std::pair<SUMOTime, MSPhaseDefinition> def) throw();
- /// Adds a further phase definition
- void addValue(std::pair<SUMOTime, MSPhaseDefinition> def);
- /// Sets the time the display shall be shown as beginning at
- void setBeginTime(SUMOTime time);
+ /** @brief Sets the time the display shall be shown as beginning at
+ * @param[in] time The time to start to show the phases from
+ */
+ void setBeginTime(SUMOTime time) throw();
- //{
- /// called on size change
+
+ /// @name FOX-callbacks
+ /// {
+
+ /// @brief called on size change
long onConfigure(FXObject *sender, FXSelector sel, void *data);
- /// called if the widget shall be repainted
+ /// @brief called if the widget shall be repainted
long onPaint(FXObject *sender, FXSelector sel, void *data);
- /// called on a simulation step
+ /// @brief called on a simulation step
long onSimStep(FXObject *sender, FXSelector sel, void *data);
- //}
+ /// }
+
public:
- /// Definition of a storage for phases
+ /// @brief Definition of a storage for phases
typedef std::vector<MSPhaseDefinition> PhasesVector;
- /** @brief This list of stored phases
- Only new phases are stored; The times are not stored at all, they
- are just used to steer the output */
+ /// @brief Definition of a storage for durations
typedef std::vector<size_t> DurationsVector;
+
/**
* @class GUITLLogicPhasesTrackerPanel
- * The canvas for the visualisation.
+ * @brief The canvas for the visualisation of phases
+ *
* The drawing itself id done by the parent.
*/
class GUITLLogicPhasesTrackerPanel : public FXGLCanvas {
FXDECLARE(GUITLLogicPhasesTrackerPanel)
public:
- /// Constructor
+ /** @brief Constructor
+ * @param[in] c The container for this panel
+ * @param[in] app The main application window
+ * @param[in] parent This panel's logial parent
+ */
GUITLLogicPhasesTrackerPanel(FXComposite *c,
- GUIMainWindow &app, GUITLLogicPhasesTrackerWindow &parent);
+ GUIMainWindow &app, GUITLLogicPhasesTrackerWindow &parent) throw();
- /// Destructor
- ~GUITLLogicPhasesTrackerPanel();
+ /// @brief Destructor
+ ~GUITLLogicPhasesTrackerPanel() throw();
- /// Returns the height
- size_t getHeightInPixels() const;
-
- /// Returns the width
- size_t getWidthInPixels() const;
-
/// needed to update
friend class GUITLLogicPhasesTrackerWindow;
- //{
- /// called on size change
+
+ /// @name FOX-callbacks
+ /// {
+
+ /// @brief called on size change
long onConfigure(FXObject*,FXSelector,void*);
- /// called if the widget shall be repainted
+ /// @brief called if the widget shall be repainted
long onPaint(FXObject*,FXSelector,void*);
- //}
+ /// }
+
private:
- /// The parent window
+ /// @brief The parent window
GUITLLogicPhasesTrackerWindow *myParent;
- /// the sizes of the window
- int myWidthInPixels, myHeightInPixels;
-
- /// The main application
+ /// @brief The main application
GUIMainWindow *myApplication;
protected:
- /// protected constructor for FOX
+ /// @brief protected constructor for FOX
GUITLLogicPhasesTrackerPanel() { }
};
-public:
- /// Draws all values
- void drawValues(GUITLLogicPhasesTrackerPanel &caller);
+ /** @brief Draws all values
+ * @param[in] The target panel
+ */
+ void drawValues(GUITLLogicPhasesTrackerPanel &caller) throw();
+
+
private:
- /// The main application
+ /// @brief The main application
GUIMainWindow *myApplication;
- /// The logic to display
+ /// @brief The logic to display
MSTrafficLightLogic *myTLLogic;
- /// The list of phases
+ /// @brief The list of phases
PhasesVector myPhases;
- /// The list of phase durations
+ /// @brief The list of phase durations
DurationsVector myDurations;
- /// The panel to draw on
+ /// @brief The panel to draw on
GUITLLogicPhasesTrackerPanel *myPanel;
- /// A lock to avoid addition of new values while drawing
+ /// @brief A lock to avoid addition of new values while drawing
MFXMutex myLock;
/** @brief The names of links
- This holds an enumeration only - used to avoid time consuming
- string representation of ints */
+ *
+ * This holds an enumeration only - used to avoid time consuming string representation of ints */
std::vector<std::string> myLinkNames;
- /// The index of the first phase that fits into the window
+ /// @brief The index of the first phase that fits into the window
size_t myFirstPhase2Show;
- /// The offset to draw the first phase (left offset)
+ /// @brief The offset to draw the first phase (left offset)
size_t myFirstPhaseOffset;
- /// The time the diagram begins at
+ /// @brief The time the diagram begins at
SUMOTime myFirstTime2Show;
- /// The first time a phase was added at
+ /// @brief The first time a phase was added at
SUMOTime myBeginTime;
- /// The last time a phase was added at
+ /// @brief The last time a phase was added at
SUMOTime myLastTime;
- /// The connector for retrival of further phases
+ /// @brief The connector for retrival of further phases
GLObjectValuePassConnector<std::pair<SUMOTime, MSPhaseDefinition> > *myConnector;
- /// Information whether the tracking mode is on
+ /// @brief Information whether the tracking mode is on
bool myAmInTrackingMode;
- /// The tool bar drag (tracking mode)
+ /// @brief The tool bar drag (tracking mode)
FXToolBarShell *myToolBarDrag;
- /// The tool bar (tracking mode)
+ /// @brief The tool bar (tracking mode)
FXToolBar *myToolBar;
- /// The offset changer (tracking mode)
+ /// @brief The offset changer (tracking mode)
FXRealSpinDial *myBeginOffset;
+
protected:
/// protected constructor for FOX
GUITLLogicPhasesTrackerWindow() { }
+
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|