Commit f3dd0444 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

[ConvexShapeContact] Move definition of isEqual to cc file.

parent f0c6c35b
......@@ -154,21 +154,7 @@ namespace hpp {
const JointAndShapes_t& floorSurfaces,
const JointAndShapes_t& objectSurfaces);
bool isEqual(const DifferentiableFunction& other) const {
const ConvexShapeContact& castother = dynamic_cast<const ConvexShapeContact&>(other);
if (!DifferentiableFunction::isEqual(other))
return false;
if (robot_ != castother.robot_)
return false;
if (objectConvexShapes_.size() != castother.objectConvexShapes_.size())
return false;
for (std::size_t i = 0; i < objectConvexShapes_.size(); i++)
if (floorConvexShapes_[i] != castother.floorConvexShapes_[i])
return false;
return true;
}
bool isEqual(const DifferentiableFunction& other) const;
private:
/// Add a ConvexShape as an object.
......@@ -270,12 +256,8 @@ namespace hpp {
const JointAndShapes_t& floorSurfaces,
const JointAndShapes_t& objectSurfaces);
bool isEqual(const DifferentiableFunction& other) const {
const ConvexShapeContactComplement& castother = dynamic_cast<const ConvexShapeContactComplement&>(other);
if (!DifferentiableFunction::isEqual(other))
return false;
return (*sibling_ != *(castother.sibling_));
}
bool isEqual(const DifferentiableFunction& other) const;
private:
void impl_compute (LiegroupElementRef result, ConfigurationIn_t argument) const;
......@@ -335,18 +317,8 @@ namespace hpp {
virtual void impl_jacobian(matrixOut_t jacobian, vectorIn_t arg)
const;
bool isEqual(const DifferentiableFunction& other) const {
const ConvexShapeContactHold& castother = dynamic_cast<const ConvexShapeContactHold&>(other);
if (!DifferentiableFunction::isEqual(other))
return false;
if (constraint_ != castother.constraint_)
return false;
if (complement_ != castother.complement_)
return false;
return true;
}
bool isEqual(const DifferentiableFunction& other) const;
private:
ConvexShapeContactPtr_t constraint_;
ConvexShapeContactComplementPtr_t complement_;
......
......@@ -58,6 +58,22 @@ namespace hpp {
computeRadius();
}
bool ConvexShapeContact::isEqual(const DifferentiableFunction& other) const
{
const ConvexShapeContact& castother = dynamic_cast
<const ConvexShapeContact&>(other);
if (!DifferentiableFunction::isEqual(other))
return false;
if (robot_ != castother.robot_)
return false;
if (objectConvexShapes_.size() != castother.objectConvexShapes_.size())
return false;
for (std::size_t i = 0; i < objectConvexShapes_.size(); i++)
if (floorConvexShapes_[i] != castother.floorConvexShapes_[i])
return false;
return true;
}
ConvexShapeContactPtr_t ConvexShapeContact::create (
const std::string& name, DevicePtr_t robot,
const JointAndShapes_t& floorSurfaces,
......@@ -339,6 +355,16 @@ namespace hpp {
{
}
bool ConvexShapeContactComplement::isEqual
(const DifferentiableFunction& other) const
{
const ConvexShapeContactComplement& castother = dynamic_cast
<const ConvexShapeContactComplement&>(other);
if (!DifferentiableFunction::isEqual(other))
return false;
return (*sibling_ != *(castother.sibling_));
}
std::pair < ConvexShapeContactPtr_t,
ConvexShapeContactComplementPtr_t >
ConvexShapeContactComplement::createPair
......@@ -495,5 +521,19 @@ namespace hpp {
complement_->impl_jacobian(jacobian.bottomRows<3>(), arg);
}
bool ConvexShapeContactHold::isEqual(const DifferentiableFunction& other)
const
{
const ConvexShapeContactHold& castother = dynamic_cast
<const ConvexShapeContactHold&>(other);
if (!DifferentiableFunction::isEqual(other))
return false;
if (constraint_ != castother.constraint_)
return false;
if (complement_ != castother.complement_)
return false;
return true;
}
} // namespace constraints
} // namespace hpp
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment