Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EllipsoidShape: use const references in API #521

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bullet-featherstone/src/ShapeFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ Vector3d ShapeFeatures::GetEllipsoidShapeRadii(
Identity ShapeFeatures::AttachEllipsoidShape(
const Identity &_linkID,
const std::string &_name,
const Vector3d _radii,
const Vector3d &_radii,
const Pose3d &_pose)
{
btVector3 positions[1];
Expand Down
2 changes: 1 addition & 1 deletion bullet-featherstone/src/ShapeFeatures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class ShapeFeatures :
public: Identity AttachEllipsoidShape(
const Identity &_linkID,
const std::string &_name,
const Vector3d _radii,
const Vector3d &_radii,
const Pose3d &_pose) override;

// ----- Sphere Features -----
Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/ShapeFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Vector3d ShapeFeatures::GetEllipsoidShapeRadii(
Identity ShapeFeatures::AttachEllipsoidShape(
const Identity &_linkID,
const std::string &_name,
const Vector3d _radii,
const Vector3d &_radii,
const Pose3d &_pose)
{
common::MeshManager *meshMgr = common::MeshManager::Instance();
Expand Down
2 changes: 1 addition & 1 deletion dartsim/src/ShapeFeatures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class ShapeFeatures :
public: Identity AttachEllipsoidShape(
const Identity &_linkID,
const std::string &_name,
const Vector3d _radii,
const Vector3d &_radii,
const Pose3d &_pose) override;

// ----- Sphere Features -----
Expand Down
8 changes: 4 additions & 4 deletions include/gz/physics/EllipsoidShape.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace gz
/// \brief Set the radius of this EllipsoidShape
/// \param[in] _radii
/// The desired radius of this EllipsoidShape
public: void SetRadii(Dimensions _radii);
public: void SetRadii(const Dimensions &_radii);
};

public: template <typename PolicyT>
Expand All @@ -79,7 +79,7 @@ namespace gz
typename FromPolicy<PolicyT>::template Use<LinearVector>;

public: virtual void SetEllipsoidShapeRadii(
const Identity &_ellipsoidID, Dimensions _radii) = 0;
const Identity &_ellipsoidID, const Dimensions &_radii) = 0;
};
};

Expand Down Expand Up @@ -109,7 +109,7 @@ namespace gz
/// \returns a ShapePtrType to the newly constructed EllipsoidShape
public: ShapePtrType AttachEllipsoidShape(
const std::string &_name = "ellipsoid",
Dimensions _radii = Dimensions::Constant(1.0),
const Dimensions &_radii = Dimensions::Constant(1.0),
const PoseType &_pose = PoseType::Identity());
};

Expand All @@ -125,7 +125,7 @@ namespace gz
public: virtual Identity AttachEllipsoidShape(
const Identity &_linkID,
const std::string &_name,
Dimensions _radii,
const Dimensions &_radii,
const PoseType &_pose) = 0;
};
};
Expand Down
4 changes: 2 additions & 2 deletions include/gz/physics/detail/EllipsoidShape.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace gz
/////////////////////////////////////////////////
template <typename PolicyT, typename FeaturesT>
void SetEllipsoidShapeProperties::EllipsoidShape<PolicyT, FeaturesT>
::SetRadii(Dimensions _radii)
::SetRadii(const Dimensions &_radii)
{
this->template Interface<SetEllipsoidShapeProperties>()
->SetEllipsoidShapeRadii(this->identity, _radii);
Expand All @@ -48,7 +48,7 @@ namespace gz
auto AttachEllipsoidShapeFeature::Link<PolicyT, FeaturesT>
::AttachEllipsoidShape(
const std::string &_name,
Dimensions _radii,
const Dimensions &_radii,
const PoseType &_pose) -> ShapePtrType
{
return ShapePtrType(this->pimpl,
Expand Down
2 changes: 1 addition & 1 deletion tpe/plugin/src/ShapeFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ Vector3d ShapeFeatures::GetEllipsoidShapeRadii(
Identity ShapeFeatures::AttachEllipsoidShape(
const Identity &_linkID,
const std::string &_name,
Vector3d _radii,
const Vector3d &_radii,
const Pose3d &_pose)
{
auto it = this->links.find(_linkID);
Expand Down
2 changes: 1 addition & 1 deletion tpe/plugin/src/ShapeFeatures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class ShapeFeatures :
public: Identity AttachEllipsoidShape(
const Identity &_linkID,
const std::string &_name,
Vector3d _radii,
const Vector3d &_radii,
const Pose3d &_pose) override;

// ----- Sphere Features -----
Expand Down
Loading