OrientedPoint.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Martin Miller (martin dot miller at student dot kit dot edu)
17 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
18 * GNU General Public License
19 */
20 
21 #pragma once
22 
23 
24 #include <sstream>
25 
26 #include <Eigen/Core>
27 #include <Eigen/Geometry>
28 
31 
32 #include <RobotAPI/interface/core/OrientedPoint.h>
33 
34 namespace armarx::VariantType
35 {
36  // variant types
37  const VariantTypeId OrientedPoint = Variant::addTypeName("::armarx::OrientedPointBase");
38 } // namespace armarx::VariantType
39 
40 namespace armarx
41 {
42  class OrientedPoint : public virtual OrientedPointBase
43  {
44 
45  public:
46  OrientedPoint();
47  OrientedPoint(const Eigen::Vector3f& position, const Eigen::Vector3f& normal);
49  ::Ice::Float py,
50  ::Ice::Float pz,
51  ::Ice::Float nx,
52  ::Ice::Float ny,
53  ::Ice::Float nz);
54 
55  virtual Eigen::Vector3f positionToEigen() const;
56  virtual Eigen::Vector3f normalToEigen() const;
57 
58  // inherited from VariantDataClass
60  ice_clone() const override
61  {
62  return this->clone();
63  }
64 
65  VariantDataClassPtr
66  clone(const Ice::Current& c = Ice::emptyCurrent) const override
67  {
68  return new OrientedPoint(*this);
69  }
70 
71  std::string output(const Ice::Current& c = Ice::emptyCurrent) const override;
72 
74  getType(const Ice::Current& c = Ice::emptyCurrent) const override
75  {
77  }
78 
79  bool
80  validate(const Ice::Current& c = Ice::emptyCurrent) override
81  {
82  return true;
83  }
84 
85  friend std::ostream&
86  operator<<(std::ostream& stream, const OrientedPoint& rhs)
87  {
88  stream << "OrientedPoint: " << std::endl << rhs.output() << std::endl;
89  return stream;
90  }
91 
92  public: // serialization
93  void serialize(const armarx::ObjectSerializerBasePtr& serializer,
94  const ::Ice::Current& = Ice::emptyCurrent) const override;
95  void deserialize(const armarx::ObjectSerializerBasePtr& serializer,
96  const ::Ice::Current& = Ice::emptyCurrent) override;
97  };
98 
100 } // namespace armarx
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:919
armarx::OrientedPoint::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: OrientedPoint.cpp:104
armarx::OrientedPoint::OrientedPoint
OrientedPoint()
Definition: OrientedPoint.cpp:26
armarx::OrientedPoint::positionToEigen
virtual Eigen::Vector3f positionToEigen() const
Definition: OrientedPoint.cpp:65
armarx::OrientedPoint
Definition: OrientedPoint.h:42
AbstractObjectSerializer.h
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
armarx::OrientedPoint::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: OrientedPoint.h:80
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::VariantType::OrientedPoint
const VariantTypeId OrientedPoint
Definition: OrientedPoint.h:37
armarx::OrientedPoint::getType
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OrientedPoint.h:74
armarx::VariantType
Definition: ChannelRef.h:167
armarx::OrientedPoint::operator<<
friend std::ostream & operator<<(std::ostream &stream, const OrientedPoint &rhs)
Definition: OrientedPoint.h:86
armarx::OrientedPoint::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: OrientedPoint.h:60
armarx::VariantTypeId
Ice::Int VariantTypeId
Definition: Variant.h:43
armarx::OrientedPoint::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: OrientedPoint.cpp:90
armarx::OrientedPoint::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OrientedPoint.cpp:81
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
armarx::OrientedPoint::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OrientedPoint.h:66
Variant.h
armarx::OrientedPoint::normalToEigen
virtual Eigen::Vector3f normalToEigen() const
Definition: OrientedPoint.cpp:73
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::Variant::addTypeName
static VariantTypeId addTypeName(const std::string &typeName)
Register a new type for the use in a Variant.
Definition: Variant.cpp:869