Go to the documentation of this file.
29 DIFF_RADIUS * (
static_cast<double>(rand() % precision) /
30 static_cast<double>(precision - 1));
36 win1.enableMousePanZoom(
true);
42 randomPoly[i].x = radius * cos(ang);
43 randomPoly[i].y = radius * sin(ang);
45 randomPoly.removeRedundantVertices();
46 std::vector<double>
x,
y;
47 randomPoly.getPlotData(
x,
y);
48 win1.plot(
x,
y,
"b-5",
"Polygon");
50 std::vector<TPolygon2D> convexPolys;
52 convexPolys.push_back(randomPoly);
54 win2.enableMousePanZoom(
true);
57 it != convexPolys.end(); ++it)
60 it->getPlotData(
x,
y);
61 win2.plot(
x,
y,
"r-3", plotName);
62 if (!it->isConvex()) cout <<
"FAIL.\n";
69 int main(
int argc,
char** argv)
bool kbhit() noexcept
An OS-independent version of kbhit, which returns true if a key has been pushed.
const Scalar * const_iterator
double extractDayTimeFromTimestamp(const mrpt::system::TTimeStamp t)
Returns the number of seconds ellapsed from midnight in the given timestamp.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::system::TTimeStamp getCurrentLocalTime()
Returns the current (local) time.
const unsigned int NUMBER_OF_EDGES
2D polygon, inheriting from std::vector<TPoint2D>.
Classes for creating GUI windows for 2D and 3D visualization.
Create a GUI window and display plots with MATLAB-like interfaces and commands.
bool splitInConvexComponents(const TPolygon2D &poly, std::vector< TPolygon2D > &components)
Splits a 2D polygon into convex components.
This base provides a set of functions for maths stuff.
GLsizei const GLchar ** string
double randomDouble(size_t precision=1000)
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |