Skip to content

Commit

Permalink
Added feedback
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <[email protected]>
  • Loading branch information
ahcorde committed Feb 12, 2021
1 parent 4c18702 commit 19cb831
Show file tree
Hide file tree
Showing 15 changed files with 7 additions and 81 deletions.
13 changes: 0 additions & 13 deletions examples/gazebo_scene_viewer/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1480,19 +1480,6 @@ void SubSceneManager::ProcessCylinder(
}
//! [process cylinder]

//////////////////////////////////////////////////
void SubSceneManager::ProcessEllipsoid(
const gazebo::msgs::Geometry & _geometryMsg, VisualPtr _parent)
{
GeometryPtr ellipsoid = this->activeScene->CreateEllipsoid();
const gazebo::msgs::EllipsoidGeom &ellipsoidMsg = _geometryMsg.ellipsoid();
double x = 2 * ellipsoidMsg.radii().X();
double y = 2 * ellipsoidMsg.radii().Y();
double z = 2 * ellipsoidMsg.radii().Z();
_parent->SetLocalScale(x, y, z);
_parent->AddGeometry(ellipsoid);
}

//////////////////////////////////////////////////
void SubSceneManager::ProcessEmpty(const gazebo::msgs::Geometry&, VisualPtr)
{
Expand Down
3 changes: 0 additions & 3 deletions examples/gazebo_scene_viewer/SceneManagerPrivate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,6 @@ namespace ignition
protected: virtual void ProcessCylinder(
const gazebo::msgs::Geometry &_geometryMsg, VisualPtr _parent);

protected: virtual void ProcessEllipsoid(
const gazebo::msgs::Geometry &_geometryMsg, VisualPtr _parent);

protected: virtual void ProcessEmpty(
const gazebo::msgs::Geometry &_geometryMsg, VisualPtr _parent);

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_demo/GlutWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void updateCameras()
camera->SetLocalPosition(x, y, 0.0);
}

g_offset += 0.0005;
g_offset += 0.05;
}
//! [update camera]

Expand Down
4 changes: 2 additions & 2 deletions examples/simple_demo/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ void buildScene(ScenePtr _scene)

// create ellipsoid visual
VisualPtr ellipsoidVisual = _scene->CreateVisual();
auto ellipsoid = _scene->CreateEllipsoid();
ellipsoid->SetRadii(ignition::math::Vector3d(1.2, 0.7, 0.5));
auto ellipsoid = _scene->CreateSphere();
ellipsoidVisual->SetLocalScale(1.2, 0.7, 0.5);
ellipsoidVisual->AddGeometry(ellipsoid);
ellipsoidVisual->SetLocalPosition(3, -1, 0);
ellipsoidVisual->SetMaterial(green);
Expand Down
5 changes: 1 addition & 4 deletions include/ignition/rendering/Marker.hh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ namespace ignition
MT_TRIANGLE_LIST = 9,

/// \brief Triangle strip primitive
MT_TRIANGLE_STRIP = 10,

/// \brief Ellipsoid geometry
MT_ELLIPSOID = 12,
MT_TRIANGLE_STRIP = 10
};

/// \class Marker Marker.hh ignition/rendering/Marker
Expand Down
8 changes: 3 additions & 5 deletions include/ignition/rendering/Scene.hh
Original file line number Diff line number Diff line change
Expand Up @@ -864,15 +864,13 @@ namespace ignition
/// \return The created cylinder
public: virtual GeometryPtr CreateCylinder() = 0;

/// \brief Create new ellipsoid geometry
/// \return The created ellipsoid
public: virtual MeshPtr CreateEllipsoid() = 0;

/// \brief Create new plane geometry
/// \return The created plane
public: virtual GeometryPtr CreatePlane() = 0;

/// \brief Create new sphere geometry
/// \brief Create new sphere or ellipsoid geometry
/// This method allow to create ellipsoid too, because it can be scaled
/// in 3 dimensions.
/// \return The created sphere
public: virtual GeometryPtr CreateSphere() = 0;

Expand Down
10 changes: 0 additions & 10 deletions include/ignition/rendering/base/BaseScene.hh
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,6 @@ namespace ignition

public: virtual GeometryPtr CreateCylinder() override;

// Documentation inherited.
public: virtual MeshPtr CreateEllipsoid() override;

public: virtual GeometryPtr CreatePlane() override;

public: virtual GeometryPtr CreateSphere() override;
Expand Down Expand Up @@ -558,13 +555,6 @@ namespace ignition
protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
const std::string &_name) = 0;

/// \brief Implementation for creating a ellipsoid geometry object
/// \param[in] _id unique object id.
/// \param[in] _name unique object name.
/// \return Pointer to a ellipsoid geometry object
protected: virtual MeshPtr CreateEllipsoidImpl(unsigned int _id,
const std::string &_name) = 0;

protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
const std::string &_name) = 0;

Expand Down
4 changes: 0 additions & 4 deletions ogre/include/ignition/rendering/ogre/OgreScene.hh
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ namespace ignition
protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
const std::string &_name) override;

// Documentation inherited
protected: virtual MeshPtr CreateEllipsoidImpl(unsigned int _id,
const std::string &_name);

protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
const std::string &_name) override;

Expand Down
6 changes: 0 additions & 6 deletions ogre/src/OgreMarker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ Ogre::MovableObject *OgreMarker::OgreObject() const
return nullptr;
case MT_BOX:
case MT_CYLINDER:
case MT_ELLIPSOID:
case MT_SPHERE:
return this->dataPtr->mesh->OgreObject();
case MT_LINE_STRIP:
Expand Down Expand Up @@ -147,7 +146,6 @@ void OgreMarker::SetMaterial(MaterialPtr _material, bool _unique)
break;
case MT_BOX:
case MT_CYLINDER:
case MT_ELLIPSOID:
case MT_SPHERE:
this->dataPtr->mesh->SetMaterial(derived, false);
break;
Expand Down Expand Up @@ -211,10 +209,6 @@ void OgreMarker::SetType(MarkerType _markerType)
this->dataPtr->mesh =
std::dynamic_pointer_cast<OgreMesh>(this->scene->CreateCylinder());
break;
case MT_ELLIPSOID:
this->dataPtr->mesh =
std::dynamic_pointer_cast<OgreMesh>(this->scene->CreateEllipsoid());
break;
case MT_SPHERE:
this->dataPtr->mesh =
std::dynamic_pointer_cast<OgreMesh>(this->scene->CreateSphere());
Expand Down
7 changes: 0 additions & 7 deletions ogre/src/OgreScene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,6 @@ MeshPtr OgreScene::CreateMeshImpl(unsigned int _id, const std::string &_name,
return this->CreateMeshImpl(_id, _name, descriptor);
}

//////////////////////////////////////////////////
MeshPtr OgreScene::CreateEllipsoidImpl(
unsigned int _id, const std::string &_name)
{
return this->CreateMeshImpl(_id, _name, "unit_ellipsoid");
}

//////////////////////////////////////////////////
MeshPtr OgreScene::CreateMeshImpl(unsigned int _id, const std::string &_name,
const MeshDescriptor &_desc)
Expand Down
4 changes: 0 additions & 4 deletions ogre2/include/ignition/rendering/ogre2/Ogre2Scene.hh
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ namespace ignition
protected: virtual GeometryPtr CreateCylinderImpl(unsigned int _id,
const std::string &_name) override;

// Documentation inherited
protected: virtual MeshPtr CreateEllipsoidImpl(unsigned int _id,
const std::string &_name);

// Documentation inherited
protected: virtual GeometryPtr CreatePlaneImpl(unsigned int _id,
const std::string &_name) override;
Expand Down
5 changes: 0 additions & 5 deletions ogre2/src/Ogre2Marker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Ogre::MovableObject *Ogre2Marker::OgreObject() const
return nullptr;
case MT_BOX:
case MT_CYLINDER:
case MT_ELLIPSOID:
case MT_SPHERE:
return this->dataPtr->mesh->OgreObject();
case MT_LINE_STRIP:
Expand Down Expand Up @@ -160,7 +159,6 @@ void Ogre2Marker::SetMaterial(MaterialPtr _material, bool _unique)
break;
case MT_BOX:
case MT_CYLINDER:
case MT_ELLIPSOID:
case MT_SPHERE:
this->dataPtr->mesh->SetMaterial(derived, false);
break;
Expand Down Expand Up @@ -243,9 +241,6 @@ void Ogre2Marker::SetType(MarkerType _markerType)
case MT_CYLINDER:
newMesh = this->scene->CreateCylinder();
break;
case MT_ELLIPSOID:
newMesh = this->scene->CreateEllipsoid();
break;
case MT_SPHERE:
newMesh = this->scene->CreateSphere();
break;
Expand Down
6 changes: 0 additions & 6 deletions ogre2/src/Ogre2Scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,6 @@ MeshPtr Ogre2Scene::CreateMeshImpl(unsigned int _id, const std::string &_name,
return this->CreateMeshImpl(_id, _name, descriptor);
}

//////////////////////////////////////////////////
MeshPtr Ogre2Scene::CreateEllipsoidImpl(unsigned int _id,
const std::string &_name)
{
return this->CreateMeshImpl(_id, _name, "unit_ellipsoid");
}
//////////////////////////////////////////////////
MeshPtr Ogre2Scene::CreateMeshImpl(unsigned int _id,
const std::string &_name, const MeshDescriptor &_desc)
Expand Down
3 changes: 0 additions & 3 deletions src/Marker_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ void MarkerTest::Marker(const std::string &_renderEngine)
marker->SetType(MarkerType::MT_NONE);
EXPECT_EQ(MarkerType::MT_NONE, marker->Type());

marker->SetType(MarkerType::MT_ELLIPSOID);
EXPECT_EQ(MarkerType::MT_ELLIPSOID, marker->Type());

marker->SetType(MarkerType::MT_POINTS);
EXPECT_EQ(MarkerType::MT_POINTS, marker->Type());

Expand Down
8 changes: 0 additions & 8 deletions src/base/BaseScene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1009,14 +1009,6 @@ GeometryPtr BaseScene::CreatePlane()
return this->CreatePlaneImpl(objId, objName);
}

//////////////////////////////////////////////////
MeshPtr BaseScene::CreateEllipsoid()
{
unsigned int objId = this->CreateObjectId();
std::string objName = this->CreateObjectName(objId, "Ellipsoid");
return this->CreateEllipsoidImpl(objId, objName);
}

//////////////////////////////////////////////////
GeometryPtr BaseScene::CreateSphere()
{
Expand Down

0 comments on commit 19cb831

Please sign in to comment.