##

CollisionState.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/* Desc: A collision state
* Author: Nate Koenig
*/
#ifndef GAZEBO_PHYSICS_COLLISIONSTATE_HH_
#define GAZEBO_PHYSICS_COLLISIONSTATE_HH_
#include <ignition/math/Pose3.hh>
#include "gazebo/physics/State.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class GZ_PHYSICS_VISIBLE CollisionState : public State
{
public: CollisionState();
public: explicit CollisionState(const CollisionPtr _collision);
public: explicit CollisionState(const sdf::ElementPtr _sdf);
public: virtual ~CollisionState();
public: virtual void Load(const sdf::ElementPtr _elem);
public: const ignition::math::Pose3d &Pose() const;
public: bool IsZero() const;
public: void FillSDF(sdf::ElementPtr _sdf);
public: CollisionState &operator=(const CollisionState &_state);
public: CollisionState operator-(const CollisionState &_state) const;
public: CollisionState operator+(const CollisionState &_state) const;
public: inline friend std::ostream &operator<<(std::ostream &_out,
const gazebo::physics::CollisionState &_state)
{
_out << "<collision name='" << _state.name << "'>"
<< "<pose>" << _state.pose << "</pose>";
_out << "</collision>";
return _out;
}
private: ignition::math::Pose3d pose;
};
}
}
#endif
gazebo::physics::CollisionState::operator=
CollisionState & operator=(const CollisionState &_state)
Assignment operator.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::CollisionState::operator-
CollisionState operator-(const CollisionState &_state) const
Subtraction operator.
system.hh
gazebo::physics::CollisionState::IsZero
bool IsZero() const
Return true if the values in the state are zero.
State.hh
gazebo::physics::CollisionState
Store state information of a physics::Collision object.
Definition: CollisionState.hh:43
gazebo::physics::CollisionState::operator+
CollisionState operator+(const CollisionState &_state) const
Addition operator.
gazebo::physics::CollisionState::CollisionState
CollisionState()
Default constructor.
gazebo::physics::CollisionState::~CollisionState
virtual ~CollisionState()
Destructor.
gazebo::physics::CollisionState::operator<<
friend std::ostream & operator<<(std::ostream &_out, const gazebo::physics::CollisionState &_state)
Stream insertion operator.
Definition: CollisionState.hh:101
gazebo::physics::State
State of an entity.
Definition: State.hh:43
gazebo::physics::CollisionPtr
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
gazebo::physics::State::name
std::string name
Name associated with this State.
Definition: State.hh:124
gazebo::physics::CollisionState::Load
virtual void Load(const sdf::ElementPtr _elem)
Load state from SDF element.
gazebo::physics::CollisionState::Pose
const ignition::math::Pose3d & Pose() const
Get the Collision pose.
gazebo::physics::CollisionState::FillSDF
void FillSDF(sdf::ElementPtr _sdf)
Populate a state SDF element with data from the object.