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 <RobotAPI/interface/core/OrientedPoint.h>
27 
28 #include <Eigen/Core>
29 #include <Eigen/Geometry>
30 
31 #include <sstream>
32 
33 namespace armarx::VariantType
34 {
35  // variant types
36  const VariantTypeId OrientedPoint = Variant::addTypeName("::armarx::OrientedPointBase");
37 }
38 
39 namespace armarx
40 {
42  public virtual OrientedPointBase
43  {
44 
45  public:
46  OrientedPoint();
47  OrientedPoint(const Eigen::Vector3f& position, const Eigen::Vector3f& normal);
48  OrientedPoint(::Ice::Float px, ::Ice::Float py, ::Ice::Float pz, ::Ice::Float nx, ::Ice::Float ny, ::Ice::Float nz);
49 
50  virtual Eigen::Vector3f positionToEigen() const;
51  virtual Eigen::Vector3f normalToEigen() const;
52 
53  // inherited from VariantDataClass
54  Ice::ObjectPtr ice_clone() const override
55  {
56  return this->clone();
57  }
58  VariantDataClassPtr clone(const Ice::Current& c = Ice::emptyCurrent) const override
59  {
60  return new OrientedPoint(*this);
61  }
62  std::string output(const Ice::Current& c = Ice::emptyCurrent) const override;
63  VariantTypeId getType(const Ice::Current& c = Ice::emptyCurrent) const override
64  {
66  }
67  bool validate(const Ice::Current& c = Ice::emptyCurrent) override
68  {
69  return true;
70  }
71 
72  friend std::ostream& operator<<(std::ostream& stream, const OrientedPoint& rhs)
73  {
74  stream << "OrientedPoint: " << std::endl << rhs.output() << std::endl;
75  return stream;
76  }
77 
78  public: // serialization
79  void serialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) const override;
80  void deserialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) override;
81  };
82 
84 }
85 
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:918
armarx::OrientedPoint::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: OrientedPoint.cpp:96
armarx::OrientedPoint::OrientedPoint
OrientedPoint()
Definition: OrientedPoint.cpp:26
armarx::OrientedPoint::positionToEigen
virtual Eigen::Vector3f positionToEigen() const
Definition: OrientedPoint.cpp:60
armarx::OrientedPoint
Definition: OrientedPoint.h:41
AbstractObjectSerializer.h
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::OrientedPoint::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: OrientedPoint.h:67
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::VariantType::OrientedPoint
const VariantTypeId OrientedPoint
Definition: OrientedPoint.h:36
armarx::OrientedPoint::getType
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OrientedPoint.h:63
armarx::VariantType
Definition: ChannelRef.h:160
armarx::OrientedPoint::operator<<
friend std::ostream & operator<<(std::ostream &stream, const OrientedPoint &rhs)
Definition: OrientedPoint.h:72
armarx::OrientedPoint::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: OrientedPoint.h:54
armarx::VariantTypeId
Ice::Int VariantTypeId
Definition: Variant.h:44
armarx::OrientedPoint::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: OrientedPoint.cpp:83
armarx::OrientedPoint::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OrientedPoint.cpp:75
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:58
Variant.h
armarx::OrientedPoint::normalToEigen
virtual Eigen::Vector3f normalToEigen() const
Definition: OrientedPoint.cpp:67
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::Variant::addTypeName
static VariantTypeId addTypeName(const std::string &typeName)
Register a new type for the use in a Variant.
Definition: Variant.cpp:751