22 uint8_t
CPolygon::serializeGetVersion()
const {
return 2; }
33 out.WriteBufferFixEndianness<
double>(
34 (
double*)&TPolygon2D::operator[](0), 2 * n);
59 for (i = 0; i < n; i++)
64 for (i = 0; i < n; i++)
79 in >> n >> dumm >> dumm >> dumm >> dumm >> dumm >> dumm;
85 for (
size_t i = 0; i < n; i++)
90 for (
size_t i = 0; i < n; i++)
110 (
double*)&TPolygon2D::operator[](0), 2 * n);
122 const std::vector<double>& x,
const std::vector<double>& y)
124 ASSERT_(x.size() == y.size() && !x.empty());
125 setAllVertices(x.size(), &x[0], &y[0]);
132 size_t nVertices,
const double* xs,
const double* ys)
136 for (
size_t i = 0; i < nVertices; i++)
147 size_t nVertices,
const float* xs,
const float* ys)
151 for (
size_t i = 0; i < nVertices; i++)
159 std::vector<double>& x, std::vector<double>& y)
const 165 for (
size_t i = 0; i < n; i++)
size_t size(const MATRIXLIKE &m, const int dim)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
To be added to all CSerializable-classes implementation files.
void setAllVertices(const std::vector< double > &x, const std::vector< double > &y)
Set all vertices at once.
A wrapper of a TPolygon2D class, implementing CSerializable.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
VALUE & operator[](const KEY &key)
Write/read via [i] operator, that creates an element if it didn't exist already.
void getAllVertices(std::vector< double > &x, std::vector< double > &y) const
Get all vertices at once.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
#define ASSERT_(f)
Defines an assertion mechanism.
This base provides a set of functions for maths stuff.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for "archives": classes abstracting I/O streams.
mrpt::vision::TStereoCalibResults out
size_t ReadBufferFixEndianness(T *ptr, size_t ElementCount)
Reads a sequence of elemental datatypes, taking care of reordering their bytes from the MRPT stream s...