57 if (
typeid(*element).name() !=
_typeName)
return nullptr;
60 if (!params || !params->
os) {
72VertexSE2DrawAction::VertexSE2DrawAction()
74 _drawActions(nullptr),
76 _triangleY(nullptr) {}
78bool VertexSE2DrawAction::refreshPropertyPtrs(
79 HyperGraphElementAction::Parameters* params_) {
81 if (_previousParams) {
83 _typeName +
"::TRIANGLE_X", .2f);
85 _typeName +
"::TRIANGLE_Y", .05f);
93HyperGraphElementAction* VertexSE2DrawAction::operator()(
94 HyperGraph::HyperGraphElement* element,
95 HyperGraphElementAction::Parameters* params_) {
96 if (
typeid(*element).name() != _typeName)
return nullptr;
97 initializeDrawActionsCache();
98 refreshPropertyPtrs(params_);
100 if (!_previousParams)
return this;
102 if (_show && !_show->value())
return this;
104 VertexSE2* that =
static_cast<VertexSE2*
>(element);
108 glTranslatef((
float)that->estimate().translation().x(),
109 (
float)that->estimate().translation().y(), 0.f);
110 glRotatef((
float)
RAD2DEG(that->estimate().rotation().angle()), 0.f, 0.f, 1.f);
112 (
float)_triangleX->value() * .3f);
113 drawCache(that->cacheContainer(), params_);
114 drawUserData(that->userData(), params_);
const EstimateType & estimate() const
return the current estimate of the vertex
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
Abstract action that operates on a graph entity.
const Vector2 & translation() const
translational component
const Rotation2D & rotation() const
rotational component
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
VertexSE2WriteGnuplotAction()
2D pose Vertex, (x,y,theta)
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
virtual bool write(std::ostream &os) const
write the vertex to a stream
EIGEN_MAKE_ALIGNED_OPERATOR_NEW VertexSE2()
bool writeVector(std::ostream &os, const Eigen::DenseBase< Derived > &b)
bool readVector(std::istream &is, Eigen::DenseBase< Derived > &b)
void drawArrow2D(float len, float head_width, float head_len)
Property< float > FloatProperty
#define POSE_VERTEX_COLOR