27 #ifndef MPBLOCKS_DUBINS_CURVES_EIGEN_GENERICARTIST_HPP_
28 #define MPBLOCKS_DUBINS_CURVES_EIGEN_GENERICARTIST_HPP_
34 namespace curves_eigen {
37 template <
typename Format_t>
48 Cairo::RefPtr<Cairo::Context> ctx = opts.
ctx;
68 ctx->set_source(opts.
patL);
73 ctx->set_source(opts.
patR);
80 ctx->move_to(q0[0], q0[1]);
81 ectx.
arc( c[0], r, alpha[0], alpha[0] + arc[0]);
83 ectx.
arc(c[2], r, alpha[2], alpha[2] + arc[2]);
91 Cairo::RefPtr<Cairo::Context> ctx = opts.
ctx;
111 ctx->set_source(opts.
patR);
116 ctx->set_source(opts.
patL);
123 ctx->move_to(q0[0], q0[1]);
124 ectx.
arc_negative(c[0], r, alpha[0], alpha[0] - arc[0]);
125 ectx.
arc(c[1], r, alpha[1], alpha[1] + arc[1]);
126 ectx.
arc_negative(c[2], r, alpha[2], alpha[2] - arc[2]);
134 Cairo::RefPtr<Cairo::Context> ctx = opts.
ctx;
151 ctx->set_source(opts.
patL);
166 ctx->move_to(q0[0], q0[1]);
167 ectx.
arc(c[0], r, alpha[0], alpha[0] + soln.
s[0]);
169 ectx.
arc(c[1], r, alpha[1], alpha[1] + soln.
s[2]);
177 Cairo::RefPtr<Cairo::Context> ctx = opts.
ctx;
193 ctx->set_source(opts.
patR);
208 ctx->move_to(q0[0], q0[1]);
219 Cairo::RefPtr<Cairo::Context> ctx = opts.
ctx;
235 ctx->set_source(opts.
patL);
238 ctx->set_source(opts.
patR);
251 ctx->move_to(q0[0], q0[1]);
252 ectx.
arc(c[0], r, alpha[0], alpha[0] + soln.
s[0]);
262 Cairo::RefPtr<Cairo::Context> ctx = opts.
ctx;
278 ctx->set_source(opts.
patR);
281 ctx->set_source(opts.
patL);
294 ctx->move_to(q0[0], q0[1]);
297 ectx.
arc(c[1], r, alpha[1], alpha[1] + soln.
s[2]);
305 Cairo::RefPtr<Cairo::Context> ctx = opts.
ctx;
315 ctx->set_source(opts.
patL);
324 ctx->move_to(q0[0], q0[1]);
325 ectx.
arc(c, r, a1, a1 + soln.
s[0]);
335 Cairo::RefPtr<Cairo::Context> ctx = opts.
ctx;
345 ctx->set_source(opts.
patR);
354 ctx->move_to(q0[0], q0[1]);
395 template <
typename Format_t>
396 void draw(
const Eigen::Matrix<Format_t, 3, 1>& q0,
const Format_t r,
405 #endif // MPBLOCKS_DUBINS_CURVES_EIGEN_GENERICARTIST_HPP_
static void drawRSR(const Vector3d_t &q0, const Format_t r, const Path_t &soln, const DrawOpts &opts)
Cairo::RefPtr< Cairo::Pattern > patR
static void drawRS(const Vector3d_t &q0, const Format_t r, const Path_t &soln, const DrawOpts &opts)
void arc(const Eigen::MatrixBase< Derived > &c, double radius, double angle1, double angle2)
Eigen::Matrix< Format_t, 2, 1 > Vector2d_t
Scalar leftAngle_inv(const Scalar alpha)
Scalar leftAngleOf(const Scalar q_theta)
return the angle of the vector from the center of the counter clockwise (left) circle coincident to q...
static void drawRSL(const Vector3d_t &q0, const Format_t r, const Path_t &soln, const DrawOpts &opts)
static Vector3d R(const Vector3d &q0, const Scalar r, const Scalar arc)
Cairo::RefPtr< Cairo::Context > ctx
Vector3d s
lengths of each segment, how it's interpreted depends on id
bool drawBalls
whether or not to draw balls
Cairo::RefPtr< Cairo::Pattern > patPath
static Vector3d L(const Vector3d &q0, const Scalar r, const Scalar arc)
static void drawLS(const Vector3d_t &q0, const Format_t r, const Path_t &soln, const DrawOpts &opts)
void draw(const Eigen::Matrix< Format_t, 3, 1 > &q0, const Format_t r, const Path< Format_t > &soln, const DrawOpts &opts)
int id
identifies the type of path
static void draw(const Vector3d_t &q0, const Format_t r, const Path_t &soln, const DrawOpts &opts)
dispatch the artist
Scalar rightAngle_inv(const Scalar alpha)
Scalar rightAngleOf(const Scalar q_theta)
return the angle of the vector from the center of the clockwise (right) circle coincident to q...
Cairo::RefPtr< Cairo::Pattern > patL
std::vector< double > dash
Integrate< Format_t > Integrate_t
void arc_negative(const Eigen::MatrixBase< Derived > &c, double radius, double angle1, double angle2)
static void drawRLR(const Vector3d_t &q0, const Format_t r, const Path_t &soln, const DrawOpts &opts)
Eigen::Matrix< Scalar, 2, 1 > rightCenter(const Eigen::Matrix< Scalar, 3, 1 > &q, Scalar r)
return the center of a clockwise (right) circle coincident to q with radius r
static Vector3d S(const Vector3d &q0, const Scalar d1)
Eigen::Matrix< Format_t, 3, 1 > Vector3d_t
Encodes a dubins path primitive, which is three connected arc segments.
static void drawLSR(const Vector3d_t &q0, const Format_t r, const Path_t &soln, const DrawOpts &opts)
static void drawLSL(const Vector3d_t &q0, const Format_t r, const Path_t &soln, const DrawOpts &opts)
encapsulates patterns for drawing
Eigen::Matrix< Scalar, 2, 1 > leftCenter(const Eigen::Matrix< Scalar, 3, 1 > &q, Scalar r)
return the center of a counter clockwise (left) circle coincident to q with radius r ...
interface for different solutions
void circle(const Eigen::MatrixBase< Derived > &c, double r)
static void drawLRL(const Vector3d_t &q0, const Format_t r, const Path_t soln, const DrawOpts &opts)
wrapper for cairo context which adds methods allowing for eigen vector typed points ...
void rel_line_to(const Eigen::MatrixBase< Derived > &v)