Skip to content

Commit

Permalink
New splash screen, added ROS_DISTRO to version.cpp.in, image sources …
Browse files Browse the repository at this point in the history
…moved to image_src

git-svn-id: https://code.ros.org/svn/ros-pkg/stacks/visualization/trunk@39799 eb33c2ac-9c88-4c90-87e0-44a10359b0c3
  • Loading branch information
David Gossow committed Aug 1, 2012
1 parent b0328e7 commit 11ea36d
Show file tree
Hide file tree
Showing 24 changed files with 108 additions and 282 deletions.
2 changes: 1 addition & 1 deletion default.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Visualization Manager:
Enabled: true
Global Options:
Fixed Frame: /map
Background Color: 0; 0; 0
Background Color: 48; 48; 48
Displays:
- Class: rviz/Grid
Name: Grid
Expand Down
278 changes: 0 additions & 278 deletions icons_src/rotate_cam_.svg

This file was deleted.

Binary file added image_src/RViz.blend
Binary file not shown.
Binary file added image_src/RViz.stl
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added image_src/splash.xcf
Binary file not shown.
File renamed without changes
Binary file modified images/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/rviz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if(${SVN_VERSION} MATCHES "^exported$")
OUTPUT_VARIABLE SVN_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

set(ROS_DISTRO $ENV{ROS_DISTRO})

configure_file(version.cpp.in ${VERSION_FILE} @ONLY)

# We create one lib with the C++...
Expand Down
1 change: 1 addition & 0 deletions src/rviz/load_resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ QPixmap loadPixmap( QString url, bool fill_cache )
// so the error won't appear again anytime soon.
if ( boost::filesystem::exists( path ) )
{
ROS_DEBUG_NAMED( "load_resource", "Loading '%s'", path.string().c_str() );
if ( !pixmap.load( QString::fromStdString( path.string() ) ) )
{
ROS_ERROR( "Could not load pixmap '%s'", path.string().c_str() );
Expand Down
24 changes: 22 additions & 2 deletions src/rviz/splash_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,37 @@
*/

#include "rviz/splash_screen.h"
#include "version.h"

#include <QPainter>

#include <iostream>
#include <QCoreApplication>

namespace rviz
{

SplashScreen::SplashScreen( const QPixmap& pixmap )
: QSplashScreen( pixmap )
{}
{
}

void SplashScreen::showMessage( const QString& message )
{
QSplashScreen::showMessage( message, Qt::AlignLeft | Qt::AlignBottom );
QSplashScreen::showMessage( message, Qt::AlignLeft | Qt::AlignBottom, Qt::white );
}

void SplashScreen::drawContents ( QPainter * painter )
{
QSplashScreen::drawContents( painter );

QString version_info = "r"+QString(get_version().c_str());
version_info += " (" + QString(get_distro().c_str()) + ")";

painter->setPen( QColor(192,192,192) );
QRect r = rect();
r .setRect(r.x() + 5, r.y() + 5, r.width() - 10, r.height() - 10);
painter->drawText( r, Qt::AlignRight | Qt::AlignBottom, version_info );
}

} // end namespace rviz
5 changes: 5 additions & 0 deletions src/rviz/splash_screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

#include <QSplashScreen>


class QPainter;

namespace rviz
{

Expand All @@ -41,6 +44,8 @@ Q_OBJECT
public:
SplashScreen( const QPixmap& pixmap );

void drawContents ( QPainter * painter );

public Q_SLOTS:
void showMessage( const QString& message );
};
Expand Down
7 changes: 7 additions & 0 deletions src/rviz/version.cpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,11 @@ std::string get_version()
return "@SVN_VERSION@";
}

std::string get_distro()
{
// The return string here is replaced at compile time by
// CMakeLists.txt in this directory.
return "@ROS_DISTRO@";
}

}
1 change: 1 addition & 0 deletions src/rviz/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
namespace rviz
{
std::string get_version();
std::string get_distro();
}

#endif // RVIZ_VERSION_H
2 changes: 1 addition & 1 deletion src/rviz/visualization_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ VisualizationManager::VisualizationManager( RenderPanel* render_panel, WindowMan
global_options_, frame_manager_, false,
SLOT( updateFixedFrame() ), this );

background_color_property_ = new ColorProperty( "Background Color", Qt::black,
background_color_property_ = new ColorProperty( "Background Color", QColor(48,48,48),
"Background color for the 3D view.",
global_options_, SLOT( updateBackgroundColor() ), this );

Expand Down
Loading

0 comments on commit 11ea36d

Please sign in to comment.