Revision: 7693
http://playerstage.svn.sourceforge.net/playerstage/?rev=7693&view=rev
Author: natepak
Date: 2009-05-19 14:33:39 +0000 (Tue, 19 May 2009)
Log Message:
-----------
Fixed some bugs in the GUI. Fixed visualization of static models
Modified Paths:
--------------
code/gazebo/trunk/server/gui/StatusBar.cc
code/gazebo/trunk/server/gui/Toolbar.cc
code/gazebo/trunk/server/physics/Body.cc
code/gazebo/trunk/server/rendering/OgreCreator.cc
code/gazebo/trunk/worlds/pioneer2dx.world
Modified: code/gazebo/trunk/server/gui/StatusBar.cc
===================================================================
--- code/gazebo/trunk/server/gui/StatusBar.cc 2009-05-19 03:47:34 UTC (rev
7692)
+++ code/gazebo/trunk/server/gui/StatusBar.cc 2009-05-19 14:33:39 UTC (rev
7693)
@@ -29,6 +29,7 @@
#include <FL/Fl_Value_Output.H>
#include <FL/Fl_Output.H>
#include <FL/Fl_Button.H>
+#include <FL/Fl_Box.H>
#include <string.h>
#include "Gui.hh"
@@ -79,8 +80,11 @@
this->pauseTime->align(FL_ALIGN_RIGHT);
this->pauseTime->precision(2);
- x = this->w() - 80;
- //x = this->pauseTime->x() + this->pauseTime->w() + 80;
+ x = this->pauseTime->x() + this->pauseTime->w();
+ int width = this->w() - (x + 90);
+ Fl_Box *spacingBox = new Fl_Box(x, y, width, 20);
+
+ x = spacingBox->x() + spacingBox->w();
this->playButton = new Fl_Button(x, y, 30, 20, "@||");
this->playButton->callback( &gazebo::StatusBar::PlayPauseButtonCB, this );
@@ -89,7 +93,8 @@
this->stepButton->callback( &gazebo::StatusBar::StepButtonCB, this );
this->stepButton->deactivate();
- this->resizable(NULL);
+ this->resizable(spacingBox);
+
this->end();
this->show();
Modified: code/gazebo/trunk/server/gui/Toolbar.cc
===================================================================
--- code/gazebo/trunk/server/gui/Toolbar.cc 2009-05-19 03:47:34 UTC (rev
7692)
+++ code/gazebo/trunk/server/gui/Toolbar.cc 2009-05-19 14:33:39 UTC (rev
7693)
@@ -157,13 +157,17 @@
{
Fl_Hold_Browser *browser = (Fl_Hold_Browser*)(w);
Toolbar *toolbar = (Toolbar*)(data);
- int selected = browser->value();
- std::string lineText = browser->text(selected);
- std::string lbl;
+ std::string lineText, lbl;
int beginLbl = 0;
int endLbl = 0;
int beginValue = 0;
+ int selected = browser->value();
+ if (selected <= 0)
+ return;
+
+ lineText = browser->text(selected);
+
if (lineText.find("-Body") != std::string::npos)
{
/*beginLbl = lineText.rfind("@") + 2;
@@ -220,6 +224,8 @@
Fl_Hold_Browser *browser = toolbar->paramBrowser;
int selected = browser->value();
Model *model =
dynamic_cast<Model*>(Simulator::Instance()->GetSelectedEntity());
+
+
Body *body = NULL;
Geom *geom = NULL;
OgreVisual *vis = NULL;
@@ -288,9 +294,14 @@
void Toolbar::EntityBrowserCB( Fl_Widget *w, void *data )
{
Fl_Hold_Browser *browser = (Fl_Hold_Browser*)(w);
+ std::string lineText;
int selected = browser->value();
- std::string lineText = browser->text(selected);
+ if (selected <=0)
+ return;
+
+ lineText = browser->text(selected);
+
Model *model = World::Instance()->GetModelByName(lineText);
Simulator::Instance()->SetSelectedEntity(model);
}
Modified: code/gazebo/trunk/server/physics/Body.cc
===================================================================
--- code/gazebo/trunk/server/physics/Body.cc 2009-05-19 03:47:34 UTC (rev
7692)
+++ code/gazebo/trunk/server/physics/Body.cc 2009-05-19 14:33:39 UTC (rev
7693)
@@ -554,11 +554,6 @@
// Return the pose of the body
Pose3d Body::GetPose() const
{
-
- /*if (this->IsStatic())
- return this->staticPose;
- else
- */
return this->pose;
}
Modified: code/gazebo/trunk/server/rendering/OgreCreator.cc
===================================================================
--- code/gazebo/trunk/server/rendering/OgreCreator.cc 2009-05-19 03:47:34 UTC
(rev 7692)
+++ code/gazebo/trunk/server/rendering/OgreCreator.cc 2009-05-19 14:33:39 UTC
(rev 7693)
@@ -761,11 +761,9 @@
Pose3d pose;
- if (owner->IsGeom() || !owner->GetParent())
- {
+ if ((owner->IsGeom() && !owner->IsStatic()) || !owner->GetParent())
vis->SetPose( owner->GetPose() );
- }
- else
+ else
vis->SetPose(owner->GetPose() - owner->GetParent()->GetPose());
}
}
Modified: code/gazebo/trunk/worlds/pioneer2dx.world
===================================================================
--- code/gazebo/trunk/worlds/pioneer2dx.world 2009-05-19 03:47:34 UTC (rev
7692)
+++ code/gazebo/trunk/worlds/pioneer2dx.world 2009-05-19 14:33:39 UTC (rev
7693)
@@ -128,7 +128,7 @@
<model:physical name="box1_model">
<xyz>1 1.5 0.5</xyz>
<canonicalBody>box1_body</canonicalBody>
- <static>false</static>
+ <static>true</static>
<body:box name="box1_body">
<geom:box name="box1_geom">
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit