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
34namespace armarx::VariantType
35{
36 // variant types
37 const VariantTypeId OrientedPoint = Variant::addTypeName("::armarx::OrientedPointBase");
38} // namespace armarx::VariantType
39
40namespace armarx
41{
42 class OrientedPoint : public virtual OrientedPointBase
43 {
44
45 public:
47 OrientedPoint(const Eigen::Vector3f& position, const Eigen::Vector3f& normal);
48 OrientedPoint(::Ice::Float px,
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
59 Ice::ObjectPtr
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
constexpr T c
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
virtual Eigen::Vector3f normalToEigen() const
virtual Eigen::Vector3f positionToEigen() const
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
friend std::ostream & operator<<(std::ostream &stream, const OrientedPoint &rhs)
Ice::ObjectPtr ice_clone() const override
OrientedPoint(const Eigen::Vector3f &position, const Eigen::Vector3f &normal)
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
static VariantTypeId addTypeName(const std::string &typeName)
Register a new type for the use in a Variant.
Definition Variant.cpp:869
const VariantTypeId OrientedPoint
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< OrientedPoint > OrientedPointPtr
Ice::Int VariantTypeId
Definition Variant.h:43