Skip to content

Commit

Permalink
Merge pull request #743 from gazebosim/ahcorde/3_to_6_10142022
Browse files Browse the repository at this point in the history
3 to 6
  • Loading branch information
ahcorde authored Oct 25, 2022
2 parents 18e69f0 + 0410533 commit b1e81b7
Show file tree
Hide file tree
Showing 65 changed files with 3,608 additions and 233 deletions.
2 changes: 1 addition & 1 deletion examples/gazebo_scene_viewer/GazeboWorldDemo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using namespace rendering;

void Connect()
{
ignition::common::Console::SetVerbosity(4);
common::Console::SetVerbosity(4);
gazebo::transport::init();
gazebo::transport::run();

Expand Down
8 changes: 4 additions & 4 deletions examples/gazebo_scene_viewer/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ DirectionalLightPtr SubSceneManager::DirectionalLight(
LightPtr light = this->activeScene->LightByName(name);

DirectionalLightPtr dirLight =
std::dynamic_pointer_cast<rendering::DirectionalLight>(light);
std::dynamic_pointer_cast<DirectionalLight>(light);

// check if not found
if (!dirLight)
Expand Down Expand Up @@ -1038,7 +1038,7 @@ PointLightPtr SubSceneManager::PointLight(
std::string name = _lightMsg.name();
LightPtr light = this->activeScene->LightByName(name);
PointLightPtr pointLight =
std::dynamic_pointer_cast<rendering::PointLight>(light);
std::dynamic_pointer_cast<PointLight>(light);

// check if not found
if (!pointLight)
Expand Down Expand Up @@ -1110,7 +1110,7 @@ SpotLightPtr SubSceneManager::SpotLight(const gazebo::msgs::Light &_lightMsg,
std::string name = _lightMsg.name();
LightPtr light = this->activeScene->LightByName(name);
SpotLightPtr spotLight =
std::dynamic_pointer_cast<rendering::SpotLight>(light);
std::dynamic_pointer_cast<SpotLight>(light);

// check if not found
if (!spotLight)
Expand Down Expand Up @@ -1225,7 +1225,7 @@ CameraPtr SubSceneManager::Camera(const gazebo::msgs::Sensor &_sensorMsg,
// find existing camera with name
std::string name = _sensorMsg.name();
SensorPtr sensor = this->activeScene->SensorByName(name);
CameraPtr camera = std::dynamic_pointer_cast<rendering::Camera>(sensor);
CameraPtr camera = std::dynamic_pointer_cast<Camera>(sensor);

// check if not found
if (!camera)
Expand Down
4 changes: 2 additions & 2 deletions ogre/src/OgreCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void OgreCamera::SetSelectionBuffer()
}

//////////////////////////////////////////////////
VisualPtr OgreCamera::VisualAt(const ignition::math::Vector2i
VisualPtr OgreCamera::VisualAt(const math::Vector2i
&_mousePos)
{
VisualPtr result;
Expand All @@ -231,7 +231,7 @@ VisualPtr OgreCamera::VisualAt(const ignition::math::Vector2i
}

float ratio = screenScalingFactor();
ignition::math::Vector2i mousePos(
math::Vector2i mousePos(
static_cast<int>(std::rint(ratio * _mousePos.X())),
static_cast<int>(std::rint(ratio * _mousePos.Y())));

Expand Down
4 changes: 2 additions & 2 deletions ogre/src/OgreDepthCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,15 @@ const float *OgreDepthCamera::DepthData() const
}

//////////////////////////////////////////////////
ignition::common::ConnectionPtr OgreDepthCamera::ConnectNewDepthFrame(
common::ConnectionPtr OgreDepthCamera::ConnectNewDepthFrame(
std::function<void(const float *, unsigned int, unsigned int,
unsigned int, const std::string &)> _subscriber)
{
return this->dataPtr->newDepthFrame.Connect(_subscriber);
}

//////////////////////////////////////////////////
ignition::common::ConnectionPtr OgreDepthCamera::ConnectNewRgbPointCloud(
common::ConnectionPtr OgreDepthCamera::ConnectNewRgbPointCloud(
std::function<void(const float *, unsigned int, unsigned int,
unsigned int, const std::string &)> _subscriber)
{
Expand Down
24 changes: 12 additions & 12 deletions ogre/src/OgreDynamicLines.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ enum {POSITION_BINDING, TEXCOORD_BINDING};
class ignition::rendering::OgreDynamicLinesPrivate
{
/// \brief list of colors at each point
public: std::vector<ignition::math::Color> colors;
public: std::vector<math::Color> colors;

/// \brief List of points for the line
public: std::vector<ignition::math::Vector3d> points;
public: std::vector<math::Vector3d> points;

/// \brief Used to indicate if the lines require an update
public: bool dirty = false;
Expand All @@ -57,8 +57,8 @@ OgreDynamicLines::~OgreDynamicLines()
}

/////////////////////////////////////////////////
void OgreDynamicLines::AddPoint(const ignition::math::Vector3d &_pt,
const ignition::math::Color &_color)
void OgreDynamicLines::AddPoint(const math::Vector3d &_pt,
const math::Color &_color)
{
this->dataPtr->points.push_back(_pt);
this->dataPtr->colors.push_back(_color);
Expand All @@ -67,14 +67,14 @@ void OgreDynamicLines::AddPoint(const ignition::math::Vector3d &_pt,

/////////////////////////////////////////////////
void OgreDynamicLines::AddPoint(double _x, double _y,
double _z, const ignition::math::Color &_color)
double _z, const math::Color &_color)
{
this->AddPoint(ignition::math::Vector3d(_x, _y, _z), _color);
this->AddPoint(math::Vector3d(_x, _y, _z), _color);
}

/////////////////////////////////////////////////
void OgreDynamicLines::SetPoint(unsigned int _index,
const ignition::math::Vector3d &_value)
const math::Vector3d &_value)
{
if (_index >= this->dataPtr->points.size())
{
Expand All @@ -90,24 +90,24 @@ void OgreDynamicLines::SetPoint(unsigned int _index,

/////////////////////////////////////////////////
void OgreDynamicLines::SetColor(unsigned int _index,
const ignition::math::Color &_color)
const math::Color &_color)
{
this->dataPtr->colors[_index] = _color;
this->dataPtr->dirty = true;
}

/////////////////////////////////////////////////
ignition::math::Vector3d OgreDynamicLines::Point(
math::Vector3d OgreDynamicLines::Point(
const unsigned int _index) const
{
if (_index >= this->dataPtr->points.size())
{
ignerr << "Point index[" << _index << "] is out of bounds[0-"
<< this->dataPtr->points.size()-1 << "]\n";

return ignition::math::Vector3d(ignition::math::INF_D,
ignition::math::INF_D,
ignition::math::INF_D);
return math::Vector3d(math::INF_D,
math::INF_D,
math::INF_D);
}

return this->dataPtr->points[_index];
Expand Down
10 changes: 5 additions & 5 deletions ogre/src/OgreGpuRays.cc
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ void OgreGpuRays::CreateOrthoCam()
}

Ogre::SceneNode *rootSceneNode = std::dynamic_pointer_cast<
ignition::rendering::OgreNode>(this->scene->RootVisual())->Node();
OgreNode>(this->scene->RootVisual())->Node();
this->dataPtr->pitchNodeOrtho = rootSceneNode->createChildSceneNode();
this->dataPtr->pitchNodeOrtho->attachObject(this->dataPtr->orthoCam);

Expand Down Expand Up @@ -899,7 +899,7 @@ void OgreGpuRays::CreateCanvas()
this->Name() + "second_pass_canvas");

Ogre::SceneNode *visualSceneNode = std::dynamic_pointer_cast<
ignition::rendering::OgreNode>(this->dataPtr->visual)->Node();
OgreNode>(this->dataPtr->visual)->Node();

Ogre::Node *visualParent = visualSceneNode->getParent();
if (visualParent != nullptr)
Expand All @@ -908,7 +908,7 @@ void OgreGpuRays::CreateCanvas()
}
this->dataPtr->pitchNodeOrtho->addChild(visualSceneNode);

// Convert mesh from common::Mesh to rendering::mesh and add it to
// Convert mesh from common::Mesh to mesh and add it to
// the canvas visual
MeshPtr renderingMesh = this->scene->CreateMesh(
this->dataPtr->undistMesh);
Expand All @@ -919,7 +919,7 @@ void OgreGpuRays::CreateCanvas()

MaterialPtr canvasMaterial =
this->scene->CreateMaterial(this->Name() + "_green");
canvasMaterial->SetAmbient(ignition::math::Color(0, 1, 0, 1));
canvasMaterial->SetAmbient(math::Color(0, 1, 0, 1));
this->dataPtr->visual->SetMaterial(canvasMaterial);

this->dataPtr->visual->SetVisible(true);
Expand Down Expand Up @@ -981,7 +981,7 @@ void OgreGpuRays::notifyRenderSingleObject(Ogre::Renderable *_rend,
}

//////////////////////////////////////////////////
ignition::common::ConnectionPtr OgreGpuRays::ConnectNewGpuRaysFrame(
common::ConnectionPtr OgreGpuRays::ConnectNewGpuRaysFrame(
std::function<void(const float *_frame, unsigned int _width,
unsigned int _height, unsigned int _channels,
const std::string &/*_format*/)> _subscriber)
Expand Down
6 changes: 3 additions & 3 deletions ogre/src/OgreMarker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ MaterialPtr OgreMarker::Material() const

//////////////////////////////////////////////////
void OgreMarker::SetPoint(unsigned int _index,
const ignition::math::Vector3d &_value)
const math::Vector3d &_value)
{
this->dataPtr->dynamicRenderable->SetPoint(_index, _value);
}

//////////////////////////////////////////////////
void OgreMarker::AddPoint(const ignition::math::Vector3d &_pt,
const ignition::math::Color &_color)
void OgreMarker::AddPoint(const math::Vector3d &_pt,
const math::Color &_color)
{
this->dataPtr->dynamicRenderable->AddPoint(_pt, _color);
}
Expand Down
2 changes: 1 addition & 1 deletion ogre/src/OgreMaterial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void OgreMaterial::UpdateShaderParams()
void OgreMaterial::UpdateShaderParams(ConstShaderParamsPtr _params,
Ogre::GpuProgramParametersSharedPtr _ogreParams)
{
for (const auto name_param : *_params)
for (const auto & name_param : *_params)
{
if (ShaderParam::PARAM_FLOAT == name_param.second.Type())
{
Expand Down
6 changes: 3 additions & 3 deletions ogre/src/OgreMaterialSwitcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using namespace rendering;
OgreMaterialSwitcher::OgreMaterialSwitcher()
: lastTechnique(nullptr)
{
this->currentColor = ignition::math::Color(0.0f, 0.0f, 0.1f);
this->currentColor = math::Color(0.0f, 0.0f, 0.1f);
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -157,7 +157,7 @@ void OgreMaterialSwitcher::postRenderTargetUpdate(

/////////////////////////////////////////////////
std::string OgreMaterialSwitcher::EntityName(
const ignition::math::Color &_color) const
const math::Color &_color) const
{
auto iter = this->colorDict.find(_color.AsRGBA());

Expand All @@ -178,7 +178,7 @@ void OgreMaterialSwitcher::NextColor()
/////////////////////////////////////////////////
void OgreMaterialSwitcher::Reset()
{
this->currentColor = ignition::math::Color(0.0, 0.0, 0.0);
this->currentColor = math::Color(0.0, 0.0, 0.0);
this->lastTechnique = nullptr;
this->lastEntity.clear();
this->colorDict.clear();
Expand Down
8 changes: 4 additions & 4 deletions ogre/src/OgreMesh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ bool OgreMesh::HasSkeleton() const
std::map<std::string, math::Matrix4d>
OgreMesh::SkeletonLocalTransforms() const
{
std::map<std::string, ignition::math::Matrix4d> mapTfs;
std::map<std::string, math::Matrix4d> mapTfs;
if (this->ogreEntity->hasSkeleton())
{
Ogre::SkeletonInstance *skel = this->ogreEntity->getSkeleton();
Expand All @@ -102,10 +102,10 @@ std::map<std::string, math::Matrix4d>
Ogre::Quaternion quat(bone->getOrientation());
Ogre::Vector3 p(bone->getPosition());

ignition::math::Quaterniond tfQuat(quat.w, quat.x, quat.y, quat.z);
ignition::math::Vector3d tfTrans(p.x, p.y, p.z);
math::Quaterniond tfQuat(quat.w, quat.x, quat.y, quat.z);
math::Vector3d tfTrans(p.x, p.y, p.z);

ignition::math::Matrix4d tf(tfQuat);
math::Matrix4d tf(tfQuat);
tf.SetTranslation(tfTrans);

mapTfs[bone->getName()] = tf;
Expand Down
2 changes: 1 addition & 1 deletion ogre/src/OgreRTShaderSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ void OgreRTShaderSystem::Update()
bool OgreRTShaderSystem::SetShadowTextureSize(const unsigned int _size)
{
// check if texture size is a power of 2
if (!ignition::math::isPowerOfTwo(_size))
if (!math::isPowerOfTwo(_size))
{
ignerr << "Shadow texture size must be a power of 2" << std::endl;
return false;
Expand Down
2 changes: 1 addition & 1 deletion ogre/src/OgreRayQuery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void OgreRayQuery::MeshInformation(const Ogre::Mesh *_mesh,
++j, vertex += vbuf->getVertexSize())
{
posElem->baseVertexPointerToElement(vertex, &pReal);
ignition::math::Vector3d pt(pReal[0], pReal[1], pReal[2]);
math::Vector3d pt(pReal[0], pReal[1], pReal[2]);
_vertices[current_offset + j] =
OgreConversions::Convert((_orient * (pt * _scale)) + _position);
}
Expand Down
6 changes: 3 additions & 3 deletions ogre/src/OgreRenderEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void OgreRenderEngine::CreateLogger()
{
// create log file path
std::string logPath;
ignition::common::env(IGN_HOMEDIR, logPath);
common::env(IGN_HOMEDIR, logPath);
logPath = common::joinPaths(logPath, ".ignition", "rendering");
common::createDirectories(logPath);
logPath = common::joinPaths(logPath, "ogre.log");
Expand Down Expand Up @@ -816,5 +816,5 @@ Ogre::OverlaySystem *OgreRenderEngine::OverlaySystem() const
#endif

// Register this plugin
IGNITION_ADD_PLUGIN(ignition::rendering::OgreRenderEnginePlugin,
ignition::rendering::RenderEnginePlugin)
IGNITION_ADD_PLUGIN(OgreRenderEnginePlugin,
rendering::RenderEnginePlugin)
2 changes: 1 addition & 1 deletion ogre/src/OgreScene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void OgreScene::SetGradientBackgroundColor(
return;
}

// Convert the ignition::math::Color to Ogre::ColourValue.
// Convert the math::Color to Ogre::ColourValue.
std::array<Ogre::ColourValue, 4> ogreColors;
for (auto i = 0u; i < 4; ++i)
ogreColors[i].setAsRGBA(_colors[i].AsRGBA());
Expand Down
4 changes: 2 additions & 2 deletions ogre/src/OgreSelectionBuffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ Ogre::Entity *OgreSelectionBuffer::OnSelectionClick(const int _x, const int _y)

size_t posInStream = 0;

ignition::math::Color::BGRA color(0);
math::Color::BGRA color(0);
if (!this->dataPtr->buffer)
{
ignerr << "Selection buffer is null.\n";
return nullptr;
}
memcpy(static_cast<void *>(&color), this->dataPtr->buffer + posInStream, 4);
ignition::math::Color cv;
math::Color cv;
cv.SetFromARGB(color);
cv.A(1.0);
const std::string &entName =
Expand Down
16 changes: 8 additions & 8 deletions ogre/src/OgreText.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void OgreMovableText::SetTextString(const std::string &_text)
}

//////////////////////////////////////////////////
void OgreMovableText::SetColor(const ignition::math::Color &_color)
void OgreMovableText::SetColor(const math::Color &_color)
{
if (this->color != _color)
{
Expand Down Expand Up @@ -323,13 +323,13 @@ void OgreMovableText::SetShowOnTop(const bool _onTop)
}

//////////////////////////////////////////////////
ignition::math::AxisAlignedBox OgreMovableText::AABB() const
math::AxisAlignedBox OgreMovableText::AABB() const
{
return ignition::math::AxisAlignedBox(
ignition::math::Vector3d(this->aabb->getMinimum().x,
return math::AxisAlignedBox(
math::Vector3d(this->aabb->getMinimum().x,
this->aabb->getMinimum().y,
this->aabb->getMinimum().z),
ignition::math::Vector3d(this->aabb->getMaximum().x,
math::Vector3d(this->aabb->getMaximum().x,
this->aabb->getMaximum().y,
this->aabb->getMaximum().z));
}
Expand Down Expand Up @@ -489,7 +489,7 @@ void OgreMovableText::SetupGeometry()
pVert = static_cast<float*>(ptbuf->lock(Ogre::HardwareBuffer::HBL_DISCARD));

// Derive space width from a capital A
if (ignition::math::equal(this->spaceWidth, 0.0f))
if (math::equal(this->spaceWidth, 0.0f))
{
this->spaceWidth = this->font->getGlyphAspectRatio('A') *
this->charHeight * 2.0;
Expand Down Expand Up @@ -983,7 +983,7 @@ void OgreText::SetTextString(const std::string &_text)
}

//////////////////////////////////////////////////
void OgreText::SetColor(const ignition::math::Color &_color)
void OgreText::SetColor(const math::Color &_color)
{
BaseText::SetColor(_color);
this->dataPtr->ogreObj->SetColor(_color);
Expand Down Expand Up @@ -1026,7 +1026,7 @@ void OgreText::SetShowOnTop(const bool _onTop)
}

//////////////////////////////////////////////////
ignition::math::AxisAlignedBox OgreText::AABB() const
math::AxisAlignedBox OgreText::AABB() const
{
return this->dataPtr->ogreObj->AABB();
}
Loading

0 comments on commit b1e81b7

Please sign in to comment.