Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1129 - in trunk: Engine/Display fox/FManta
- Date: Mon, 26 Jun 2006 21:02:16 -0600 (MDT)
Author: abe
Date: Mon Jun 26 21:02:14 2006
New Revision: 1129
Modified:
trunk/Engine/Display/OpenGLDisplay.h
trunk/fox/FManta/FMantaWindow.cc
trunk/fox/FManta/FMantaWindow.h
Log:
Added option in dm_demo to toggle fps display on and off.
It was toggled on by default, but still didn't show up! Any idea what the
difference between the opengl environments could be??
M fox/FManta/FMantaWindow.cc
M fox/FManta/FMantaWindow.h
M Engine/Display/OpenGLDisplay.h
Modified: trunk/Engine/Display/OpenGLDisplay.h
==============================================================================
--- trunk/Engine/Display/OpenGLDisplay.h (original)
+++ trunk/Engine/Display/OpenGLDisplay.h Mon Jun 26 21:02:14 2006
@@ -26,6 +26,11 @@
virtual void setupDisplayChannel(SetupContext&);
virtual void displayImage(const DisplayContext& context, const Image*
image);
static ImageDisplay* create(const vector<string>& args);
+
+ // Accessors.
+ bool getDisplayFrameRate() const { return displayFrameRate; }
+ void setDisplayFrameRate( bool b ) { displayFrameRate = b; }
+
private:
OpenGLDisplay(const OpenGLDisplay&);
OpenGLDisplay& operator=(const OpenGLDisplay&);
Modified: trunk/fox/FManta/FMantaWindow.cc
==============================================================================
--- trunk/fox/FManta/FMantaWindow.cc (original)
+++ trunk/fox/FManta/FMantaWindow.cc Mon Jun 26 21:02:14 2006
@@ -19,6 +19,8 @@
#include <Model/Groups/TransparentKDTree.h>
using namespace Manta::Kdtree;
+#include <Engine/Display/OpenGLDisplay.h>
+
#include <iostream>
#include <sstream>
@@ -36,6 +38,7 @@
// Control options
FXMAPFUNC(SEL_CHANGED, FMantaWindow::ID_SPEED_SLIDER,
FMantaWindow::onSpeedSlider ),
FXMAPFUNC(SEL_CHANGED, FMantaWindow::ID_CUTTING_SLIDER,
FMantaWindow::onCuttingSlider ),
+ FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_DISPLAY_FRAME_RATE,
FMantaWindow::onDisplayFrameRate ),
FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_CUTTING_FLIP,
FMantaWindow::onCuttingFlip ),
FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_BOOKMARK_LIST,
FMantaWindow::onCameraBookmark ),
FXMAPFUNC(SEL_COMMAND, FMantaWindow::ID_NAVIGATOR_LIST,
FMantaWindow::onNavigator ),
@@ -157,6 +160,9 @@
// Options menu.
options_menu = new FXMenuPane( this );
+ // Display frame rate.
+ new FXMenuCommand( options_menu, "Toggle fps.", 0, this,
ID_DISPLAY_FRAME_RATE );
+
// Cutting planes.
new FXMenuCheck( options_menu, "Snap Cutting Planes", new FXDataTarget(
cutting_snap ), FXDataTarget::ID_VALUE );
cutting_flip = new FXMenuCommand( options_menu, "Flip Cutting Plane", 0,
this, ID_CUTTING_FLIP );
@@ -293,6 +299,14 @@
return 1;
}
+long FMantaWindow::onDisplayFrameRate( FXObject *sender, FXSelector key,
void *data ) {
+
+ manta_interface->addTransaction("Toggle fps display.",
+
Callback::create(this,&FMantaWindow::mantaDisplayFrameRate));
+
+ return 1;
+}
+
long FMantaWindow::onCuttingSlider( FXObject *sender, FXSelector key, void
*data ) {
// Set the control speed for interaction.
@@ -1237,6 +1251,21 @@
}
}
+void FMantaWindow::mantaDisplayFrameRate() const {
+
+ // Get a pointer to the image display.
+ int channel = manta_frame->getNavigator()->getMantaChannel();
+ OpenGLDisplay *ogl = dynamic_cast< OpenGLDisplay * >(
manta_interface->getImageDisplay( channel ) );
+
+ if (ogl) {
+ const bool b = ogl->getDisplayFrameRate();
+
+ std::cerr << "Toggling display fps to " << (!b) << std::endl;
+ ogl->setDisplayFrameRate( !b );
+ }
+}
+
+
void FMantaWindow::mantaMoveCuttingPlane( Real amount ) const {
// Add a cutting plane on top of the root object.
Modified: trunk/fox/FManta/FMantaWindow.h
==============================================================================
--- trunk/fox/FManta/FMantaWindow.h (original)
+++ trunk/fox/FManta/FMantaWindow.h Mon Jun 26 21:02:14 2006
@@ -94,6 +94,7 @@
ID_SPEED_SLIDER, // Control speed slider was changed.
ID_CUTTING_SLIDER, // Cutting plane slider was changed.
ID_CUTTING_FLIP,
+ ID_DISPLAY_FRAME_RATE, // Toggle fps display.
// Bookmarks.
ID_BOOKMARK_LIST, // User selected a camera bookmark.
@@ -176,6 +177,7 @@
long onQuit ( FXObject *sender, FXSelector key, void *data );
long onFastQuit ( FXObject *sender, FXSelector key, void *data );
long onSpeedSlider ( FXObject *sender, FXSelector key, void *data );
+ long onDisplayFrameRate( FXObject *sender, FXSelector key, void *data );
long onCuttingSlider ( FXObject *sender, FXSelector key, void *data );
long onCuttingFlip ( FXObject *sender, FXSelector key, void *data );
long onCameraBookmark ( FXObject *sender, FXSelector key, void *data );
@@ -234,6 +236,7 @@
void mantaRemoveCuttingPlane() const;
void mantaMoveCuttingPlane( Real amount ) const;
void mantaFlipCuttingPlane() const;
+ void mantaDisplayFrameRate() const;
void mantaPick( int x, int y ) const;
void mantaPOI( int x, int y ) ;
- [MANTA] r1129 - in trunk: Engine/Display fox/FManta, abe, 06/26/2006
Archive powered by MHonArc 2.6.16.