Skip to content

Commit

Permalink
ign -> gz Migrate Ignition Headers : gz-rendering (#705)
Browse files Browse the repository at this point in the history
* Migrate headers

Signed-off-by: methylDragon <methylDragon@gmail.com>

* Add redirection headers

Signed-off-by: methylDragon <methylDragon@gmail.com>

* Migrate include statements

Signed-off-by: methylDragon <methylDragon@gmail.com>

* Leave ignition as primary in headers to fix ABI

Signed-off-by: methylDragon <methylDragon@gmail.com>

* Fix test

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* Removed some gazeb classic code

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* Revert changes

Signed-off-by: Nate Koenig <nate@openrobotics.org>

* revert to gazebo in gazebo scene viewer

Signed-off-by: Ian Chen <ichen@osrfoundation.org>

* fix build errors

Signed-off-by: Ian Chen <ichen@osrfoundation.org>

Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: Nate Koenig <nate@openrobotics.org>
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
Co-authored-by: Nate Koenig <nate@openrobotics.org>
Co-authored-by: Ian Chen <ichen@osrfoundation.org>
  • Loading branch information
3 people authored Nov 22, 2022
1 parent 10627f6 commit c6798a0
Show file tree
Hide file tree
Showing 551 changed files with 26,975 additions and 23,642 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ find_package(ignition-cmake2 2.14.0 REQUIRED)
#============================================================================
# Set up the project
#============================================================================
ign_configure_project(VERSION_SUFFIX)
ign_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/rendering
VERSION_SUFFIX
)

#============================================================================
# Set project-specific options
Expand Down
30 changes: 15 additions & 15 deletions examples/actor_animation/GlutWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
#include <map>
#include <string>

#include <ignition/math/Matrix4.hh>
#include <ignition/common/Console.hh>
#include <ignition/common/Mesh.hh>
#include <ignition/common/Skeleton.hh>
#include <ignition/common/SkeletonAnimation.hh>
#include <ignition/rendering/Camera.hh>
#include <ignition/rendering/Image.hh>
#include <ignition/rendering/OrbitViewController.hh>
#include <ignition/rendering/RayQuery.hh>
#include <ignition/rendering/Scene.hh>
#include <gz/math/Matrix4.hh>
#include <gz/common/Console.hh>
#include <gz/common/Mesh.hh>
#include <gz/common/Skeleton.hh>
#include <gz/common/SkeletonAnimation.hh>
#include <gz/rendering/Camera.hh>
#include <gz/rendering/Image.hh>
#include <gz/rendering/OrbitViewController.hh>
#include <gz/rendering/RayQuery.hh>
#include <gz/rendering/Scene.hh>

#include "GlutWindow.hh"
#include "example_config.hh"
Expand Down Expand Up @@ -164,7 +164,7 @@ void handleMouse()
2.0 * g_mouse.x / static_cast<double>(rayCamera->ImageWidth()) - 1.0;
double ny = 1.0 -
2.0 * g_mouse.y / static_cast<double>(rayCamera->ImageHeight());
g_rayQuery->SetFromCamera(rayCamera, ignition::math::Vector2d(nx, ny));
g_rayQuery->SetFromCamera(rayCamera, gz::math::Vector2d(nx, ny));
g_target = g_rayQuery->ClosestPoint();
if (!g_target)
{
Expand Down Expand Up @@ -194,7 +194,7 @@ void handleMouse()
if (g_mouse.motionDirty)
{
g_mouse.motionDirty = false;
auto drag = ignition::math::Vector2d(g_mouse.dragX, g_mouse.dragY);
auto drag = gz::math::Vector2d(g_mouse.dragX, g_mouse.dragY);

// left mouse button pan
if (g_mouse.button == GLUT_LEFT_BUTTON && g_mouse.state == GLUT_DOWN)
Expand Down Expand Up @@ -239,18 +239,18 @@ void handleMouse()
//////////////////////////////////////////////////
void updatePose(double _time)
{
std::map<std::string, ignition::math::Matrix4d> animFrames;
std::map<std::string, gz::math::Matrix4d> animFrames;
animFrames = g_skelAnim->PoseAt(_time, true);

std::map<std::string, ignition::math::Matrix4d> skinFrames;
std::map<std::string, gz::math::Matrix4d> skinFrames;

for (auto pair : animFrames)
{
std::string animName = pair.first;
auto animTf = pair.second;

std::string skinName = g_skel->NodeNameAnimToSkin(g_animIdx, animName);
ignition::math::Matrix4d skinTf =
gz::math::Matrix4d skinTf =
g_skel->AlignTranslation(g_animIdx, animName)
* animTf * g_skel->AlignRotation(g_animIdx, animName);

Expand Down
12 changes: 6 additions & 6 deletions examples/actor_animation/GlutWindow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* limitations under the License.
*
*/
#ifndef IGNITION_RENDERING_EXAMPLES_ACTOR_ANIMATION_GLUTWINDOW_HH_
#define IGNITION_RENDERING_EXAMPLES_ACTOR_ANIMATION_GLUTWINDOW_HH_
#ifndef GZ_RENDERING_EXAMPLES_ACTOR_ANIMATION_GLUTWINDOW_HH_
#define GZ_RENDERING_EXAMPLES_ACTOR_ANIMATION_GLUTWINDOW_HH_

#include <vector>
#include "ignition/rendering/RenderTypes.hh"
#include "ignition/common/graphics/Types.hh"
#include "gz/rendering/RenderTypes.hh"
#include "gz/common/graphics/Types.hh"

namespace ir = ignition::rendering;
namespace ic = ignition::common;
namespace ir = gz::rendering;
namespace ic = gz::common;

/// \brief Run the demo and render the scene from the cameras
/// \param[in] _cameras Cameras in the scene
Expand Down
12 changes: 6 additions & 6 deletions examples/actor_animation/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
#include <iostream>
#include <vector>

#include <ignition/common/Console.hh>
#include <ignition/common/Skeleton.hh>
#include <ignition/common/MeshManager.hh>
#include <ignition/common/Mesh.hh>
#include <ignition/rendering.hh>
#include <gz/common/Console.hh>
#include <gz/common/Skeleton.hh>
#include <gz/common/MeshManager.hh>
#include <gz/common/Mesh.hh>
#include <gz/rendering.hh>

#include "example_config.hh"
#include "GlutWindow.hh"

using namespace ignition;
using namespace gz;
using namespace rendering;

const std::string RESOURCE_PATH =
Expand Down
32 changes: 16 additions & 16 deletions examples/camera_tracking/GlutWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

#include <mutex>

#include <ignition/common/Console.hh>
#include <ignition/rendering/Camera.hh>
#include <ignition/rendering/Image.hh>
#include <ignition/rendering/RayQuery.hh>
#include <ignition/rendering/Scene.hh>
#include <ignition/rendering/OrbitViewController.hh>
#include <gz/common/Console.hh>
#include <gz/rendering/Camera.hh>
#include <gz/rendering/Image.hh>
#include <gz/rendering/RayQuery.hh>
#include <gz/rendering/Scene.hh>
#include <gz/rendering/OrbitViewController.hh>

#include "GlutWindow.hh"

Expand Down Expand Up @@ -92,8 +92,8 @@ struct mouseButton
struct mouseButton g_mouse;
std::mutex g_mouseMutex;

ignition::math::Vector3d g_trackOffset(1.0, 0, 0);
ignition::math::Vector3d g_followOffset(-3, 0, 3);
gz::math::Vector3d g_trackOffset(1.0, 0, 0);
gz::math::Vector3d g_followOffset(-3, 0, 3);


//////////////////////////////////////////////////
Expand Down Expand Up @@ -158,7 +158,7 @@ void handleMouse()
2.0 * g_mouse.x / static_cast<double>(rayCamera->ImageWidth()) - 1.0;
double ny = 1.0 -
2.0 * g_mouse.y / static_cast<double>(rayCamera->ImageHeight());
g_rayQuery->SetFromCamera(rayCamera, ignition::math::Vector2d(nx, ny));
g_rayQuery->SetFromCamera(rayCamera, gz::math::Vector2d(nx, ny));
g_target = g_rayQuery->ClosestPoint();
if (!g_target)
{
Expand Down Expand Up @@ -188,7 +188,7 @@ void handleMouse()
if (g_mouse.motionDirty)
{
g_mouse.motionDirty = false;
auto drag = ignition::math::Vector2d(g_mouse.dragX, g_mouse.dragY);
auto drag = gz::math::Vector2d(g_mouse.dragX, g_mouse.dragY);

// left mouse button pan
if (g_mouse.button == GLUT_LEFT_BUTTON && g_mouse.state == GLUT_DOWN)
Expand Down Expand Up @@ -296,21 +296,21 @@ void keyboardCB(unsigned char _key, int, int)
if (_key == 'w' || _key == 'W')
{
node->SetWorldPosition(node->WorldPosition() +
node->WorldRotation() * ignition::math::Vector3d(posIncr, 0, 0));
node->WorldRotation() * gz::math::Vector3d(posIncr, 0, 0));
}
else if (_key == 's' || _key == 'S')
{
node->SetWorldPosition(node->WorldPosition() +
node->WorldRotation() * ignition::math::Vector3d(-posIncr, 0, 0));
node->WorldRotation() * gz::math::Vector3d(-posIncr, 0, 0));
}
else if (_key == 'a' || _key == 'A')
{
node->SetWorldRotation(ignition::math::Quaterniond(0, 0,
node->SetWorldRotation(gz::math::Quaterniond(0, 0,
node->WorldRotation().Yaw() + yawIncr));
}
else if (_key == 'd' || _key == 'D')
{
node->SetWorldRotation(ignition::math::Quaterniond(0, 0,
node->SetWorldRotation(gz::math::Quaterniond(0, 0,
node->WorldRotation().Yaw() - yawIncr));
}
}
Expand Down Expand Up @@ -394,14 +394,14 @@ void keyboardCB(unsigned char _key, int, int)
if (_key == 't' || _key == 'T')
{
double trackPGain = 0.005;
double p = ignition::math::equal(cam->TrackPGain(), 1.0) ?
double p = gz::math::equal(cam->TrackPGain(), 1.0) ?
trackPGain : 1.0;
cam->SetTrackPGain(p);
}
else if (_key == 'f' || _key == 'F')
{
double followPGain = 0.01;
double p = ignition::math::equal(cam->FollowPGain(), 1.0) ?
double p = gz::math::equal(cam->FollowPGain(), 1.0) ?
followPGain : 1.0;
cam->SetFollowPGain(p);
}
Expand Down
8 changes: 4 additions & 4 deletions examples/camera_tracking/GlutWindow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*
*/
#ifndef IGNITION_RENDERING_EXAMPLES_CAMERA_TRACKING_GLUTWINDOW_HH_
#define IGNITION_RENDERING_EXAMPLES_CAMERA_TRACKING_GLUTWINDOW_HH_
#ifndef GZ_RENDERING_EXAMPLES_CAMERA_TRACKING_GLUTWINDOW_HH_
#define GZ_RENDERING_EXAMPLES_CAMERA_TRACKING_GLUTWINDOW_HH_

#include <vector>
#include <ignition/rendering/RenderTypes.hh>
#include <gz/rendering/RenderTypes.hh>

namespace ir = ignition::rendering;
namespace ir = gz::rendering;

/// \brief Run the demo and render the scene from the cameras
/// \param[in] _cameras Cameras in the scene
Expand Down
6 changes: 3 additions & 3 deletions examples/camera_tracking/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
#include <iostream>
#include <vector>

#include <ignition/common/Console.hh>
#include <ignition/rendering.hh>
#include <gz/common/Console.hh>
#include <gz/rendering.hh>
#include "GlutWindow.hh"

using namespace ignition;
using namespace gz;
using namespace rendering;

//////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_scene_viewer/DemoWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
#include <string>
#include <vector>

#include <ignition/rendering.hh>
#include <gz/rendering.hh>

#include "ManualSceneDemo.hh"
#include "DemoWindow.hh"

#define KEY_ESC 27
#define KEY_TAB 9

using namespace ignition;
using namespace gz;
using namespace rendering;

//////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions examples/custom_scene_viewer/DemoWindow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*
*/
#ifndef IGNITION_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_DEMOWINDOW_HH_
#define IGNITION_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_DEMOWINDOW_HH_
#ifndef GZ_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_DEMOWINDOW_HH_
#define GZ_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_DEMOWINDOW_HH_

#include "TestTypes.hh"

namespace ir = ignition::rendering;
namespace ir = gz::rendering;

/// \brief Run the demo
/// \param[in] _Pointer to demo
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_scene_viewer/ManualSceneDemo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*
*/
#include <iostream>
#include <ignition/common/Console.hh>
#include <gz/common/Console.hh>
#include "ManualSceneDemo.hh"
#include "SceneBuilder.hh"
#include "DemoWindow.hh"

using namespace ignition;
using namespace gz;
using namespace rendering;

//////////////////////////////////////////////////
Expand Down
6 changes: 3 additions & 3 deletions examples/custom_scene_viewer/ManualSceneDemo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*
*/
#ifndef IGNITION_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_MANUALSCENEDEMO_HH_
#define IGNITION_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_MANUALSCENEDEMO_HH_
#ifndef GZ_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_MANUALSCENEDEMO_HH_
#define GZ_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_MANUALSCENEDEMO_HH_

#include <string>
#include <ignition/rendering.hh>
#include <gz/rendering.hh>
#include "TestTypes.hh"

namespace ignition
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_scene_viewer/SceneBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "example_config.hh"
#include "SceneBuilder.hh"

using namespace ignition;
using namespace gz;
using namespace rendering;

const std::string RESOURCE_PATH = std::string(PROJECT_BINARY_PATH) + "/media";
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_scene_viewer/SceneBuilder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*
*/
#ifndef IGNITION_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_SCENEBUILDER_HH_
#define IGNITION_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_SCENEBUILDER_HH_
#ifndef GZ_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_SCENEBUILDER_HH_
#define GZ_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_SCENEBUILDER_HH_

#include <string>
#include "TestTypes.hh"
Expand Down
6 changes: 3 additions & 3 deletions examples/custom_scene_viewer/TestTypes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*
*/
#ifndef IGNITION_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_TESTYPES_HH_
#define IGNITION_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_TESTYPES_HH_
#ifndef GZ_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_TESTYPES_HH_
#define GZ_RENDERING_EXAMPLES_CUSTOM_SCENE_VIEWER_TESTYPES_HH_

#include <vector>
#include <ignition/rendering.hh>
#include <gz/rendering.hh>

namespace ignition
{
Expand Down
Loading

0 comments on commit c6798a0

Please sign in to comment.