Skip to content

Commit 9911c32

Browse files
simonschmeisserrhaschke
authored andcommitted
Ogre 13 compatibility
- Adapt to new createSceneManager - Add missing deque include - Ogre::UTFString was removed in 13.0 - CI: Add Ogre 13.6
1 parent fc75912 commit 9911c32

10 files changed

+38
-1
lines changed

.github/workflows/ci.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ jobs:
2626
ogre: 1.12
2727
qt: 6
2828
cxxflags: -Wno-deprecated-declarations -Werror
29+
- distro: noetic
30+
ogre: 13.6
31+
qt: 5
2932

3033
env:
3134
CXXFLAGS: "-DRVIZ_DEPRECATE_QT4_SLOTS -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls -Wno-strict-aliasing -Wno-sign-compare ${{ matrix.cxxflags}}"
3235
UPSTREAM_WORKSPACE: ${{ matrix.distro != 'jammy' && 'github:rhaschke/python_qt_binding#silent-external-warnings' || '' }}
36+
AFTER_INIT: ${{ startsWith(matrix.ogre, '13') && 'apt install -q -y software-properties-common && add-apt-repository ppa:s-schmeisser/ogre-13-focal -y' || ''}}
3337
AFTER_INSTALL_TARGET_DEPENDENCIES: apt install -qq -y libogre-${{ matrix.ogre }}-dev
3438
CATKIN_LINT: true
3539
CMAKE_ARGS: -DRVIZ_QT_VERSIONS="${{ matrix.qt }}"

src/image_view/image_view.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ using namespace rviz;
5858
ImageView::ImageView(QWidget* parent) : QtOgreRenderWindow(parent), texture_it_(nh_)
5959
{
6060
setAutoRender(false);
61+
#if (OGRE_VERSION < OGRE_VERSION_CHECK(13, 0, 0))
6162
scene_manager_ = ogre_root_->createSceneManager(Ogre::ST_GENERIC, "TestSceneManager");
63+
#else
64+
scene_manager_ = ogre_root_->createSceneManager(Ogre::DefaultSceneManagerFactory::FACTORY_TYPE_NAME,
65+
"TestSceneManager");
66+
#endif
6267
}
6368

6469
ImageView::~ImageView()

src/rviz/default_plugin/covariance_property.h

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#ifndef COVARIANCE_PROPERTY_H
3131
#define COVARIANCE_PROPERTY_H
3232

33+
#include <deque>
34+
3335
#include <QColor>
3436

3537
#include <OgreColourValue.h>

src/rviz/default_plugin/image_display.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ void ImageDisplay::onInitialize()
8181
static uint32_t count = 0;
8282
std::stringstream ss;
8383
ss << "ImageDisplay" << count++;
84+
#if (OGRE_VERSION < OGRE_VERSION_CHECK(13, 0, 0))
8485
img_scene_manager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC, ss.str());
86+
#else
87+
img_scene_manager_ = Ogre::Root::getSingleton().createSceneManager(
88+
Ogre::DefaultSceneManagerFactory::FACTORY_TYPE_NAME, ss.str());
89+
#endif
8590
}
8691

8792
img_scene_node_ = img_scene_manager_->getRootSceneNode()->createChildSceneNode();

src/rviz/image/ros_image_texture.h

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
#include <ros/ros.h>
4343

44+
#include <deque>
4445
#include <stdexcept>
4546

4647
namespace rviz

src/rviz/ogre_helpers/apply_visibility_bits.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include <OgreMovableObject.h>
3333
#include <OgreSceneNode.h>
34+
#include <OgreIteratorWrapper.h>
3435

3536
namespace rviz
3637
{

src/rviz/ogre_helpers/movable_text.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
#include <OgreHardwareBufferManager.h>
5252
#include <Overlay/OgreFontManager.h>
5353
#include <Overlay/OgreFont.h>
54+
#if (OGRE_VERSION < OGRE_VERSION_CHECK(13, 0, 0))
5455
#include <OgreUTFString.h>
56+
#endif
5557

5658
#include <sstream>
5759

@@ -215,7 +217,11 @@ void MovableText::showOnTop(bool show)
215217

216218
void MovableText::_setupGeometry()
217219
{
220+
#if (OGRE_VERSION >= OGRE_VERSION_CHECK(13, 0, 0))
221+
Ogre::String utfCaption(mCaption);
222+
#else
218223
Ogre::UTFString::utf32string utfCaption(Ogre::UTFString(mCaption).asUTF32());
224+
#endif
219225

220226
assert(mpFont);
221227
assert(!mpMaterial.isNull());

src/rviz/visualization_manager.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ VisualizationManager::VisualizationManager(RenderPanel* render_panel,
140140
render_panel->setAutoRender(false);
141141

142142
private_->threaded_nh_.setCallbackQueue(&private_->threaded_queue_);
143-
143+
#if (OGRE_VERSION < OGRE_VERSION_CHECK(13, 0, 0))
144144
scene_manager_ = ogre_root_->createSceneManager(Ogre::ST_GENERIC);
145+
#else
146+
scene_manager_ = ogre_root_->createSceneManager();
147+
#endif
145148

146149
rviz::RenderSystem::RenderSystem::get()->prepareOverlays(scene_manager_);
147150

src/test/render_points_test.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ MyFrame::MyFrame(QWidget* parent)
5252

5353
try
5454
{
55+
#if (OGRE_VERSION < OGRE_VERSION_CHECK(13, 0, 0))
5556
scene_manager_ = root_->createSceneManager(Ogre::ST_GENERIC, "TestSceneManager");
57+
#else
58+
scene_manager_ = root_->createSceneManager(Ogre::DefaultSceneManagerFactory::FACTORY_TYPE_NAME,
59+
"TestSceneManager");
60+
#endif
5661

5762
render_panel_ = new QtOgreRenderWindow();
5863
render_panel_->resize(this->size());

src/test/two_render_widgets.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* POSSIBILITY OF SUCH DAMAGE.
2828
*/
2929

30+
#include <rviz/ogre_helpers/compatibility.h>
3031
#include <rviz/ogre_helpers/render_system.h>
3132
#include <rviz/ogre_helpers/render_widget.h>
3233

@@ -68,7 +69,11 @@ int main(int argc, char** argv)
6869
container.show();
6970

7071
// Make a scene and show it in the window.
72+
#if (OGRE_VERSION < OGRE_VERSION_CHECK(13, 0, 0))
7173
Ogre::SceneManager* scene_manager = render_system->root()->createSceneManager(Ogre::ST_GENERIC);
74+
#else
75+
Ogre::SceneManager* scene_manager = render_system->root()->createSceneManager();
76+
#endif
7277

7378
Ogre::Entity* thing = scene_manager->createEntity("thing", "rviz_cone.mesh");
7479
Ogre::SceneNode* node = scene_manager->getRootSceneNode()->createChildSceneNode();

0 commit comments

Comments
 (0)