g2o
Loading...
Searching...
No Matches
Public Member Functions | List of all members
g2o::EdgeSE2PointXYWriteGnuplotAction Class Reference

#include <edge_se2_pointxy.h>

Inheritance diagram for g2o::EdgeSE2PointXYWriteGnuplotAction:
Inheritance graph
[legend]
Collaboration diagram for g2o::EdgeSE2PointXYWriteGnuplotAction:
Collaboration graph
[legend]

Public Member Functions

 EdgeSE2PointXYWriteGnuplotAction ()
 
virtual HyperGraphElementActionoperator() (HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
 
- Public Member Functions inherited from g2o::WriteGnuplotAction
 WriteGnuplotAction (const std::string &typeName_)
 
- Public Member Functions inherited from g2o::HyperGraphElementAction
 HyperGraphElementAction (const std::string &typeName_="")
 
virtual HyperGraphElementActionoperator() (const HyperGraph::HyperGraphElement *element, Parameters *parameters)
 
virtual ~HyperGraphElementAction ()
 
const std::string & typeName () const
 returns the typeid name of the action
 
const std::string & name () const
 returns the name of an action, e.g "draw"
 
void setTypeName (const std::string &typeName_)
 sets the type on which an action has to operate
 

Additional Inherited Members

- Public Types inherited from g2o::HyperGraphElementAction
typedef std::shared_ptr< HyperGraphElementActionHyperGraphElementActionPtr
 
typedef std::map< std::string, HyperGraphElementActionPtrActionMap
 
- Protected Attributes inherited from g2o::HyperGraphElementAction
std::string _typeName
 
std::string _name
 

Detailed Description

Definition at line 86 of file edge_se2_pointxy.h.

Constructor & Destructor Documentation

◆ EdgeSE2PointXYWriteGnuplotAction()

g2o::EdgeSE2PointXYWriteGnuplotAction::EdgeSE2PointXYWriteGnuplotAction ( )

Definition at line 92 of file edge_se2_pointxy.cpp.

93 : WriteGnuplotAction(typeid(EdgeSE2PointXY).name()) {}
const std::string & name() const
returns the name of an action, e.g "draw"
WriteGnuplotAction(const std::string &typeName_)

Member Function Documentation

◆ operator()()

HyperGraphElementAction * g2o::EdgeSE2PointXYWriteGnuplotAction::operator() ( HyperGraph::HyperGraphElement element,
HyperGraphElementAction::Parameters parameters 
)
virtual

redefine this to do the action stuff. If successful, the action returns a pointer to itself

Reimplemented from g2o::HyperGraphElementAction.

Definition at line 95 of file edge_se2_pointxy.cpp.

97 {
98 if (typeid(*element).name() != _typeName) return nullptr;
99 WriteGnuplotAction::Parameters* params =
100 static_cast<WriteGnuplotAction::Parameters*>(params_);
101 if (!params->os) {
102 return nullptr;
103 }
104
105 EdgeSE2PointXY* e = static_cast<EdgeSE2PointXY*>(element);
106 if (e->numUndefinedVertices()) return this;
107 VertexSE2* fromEdge = static_cast<VertexSE2*>(e->vertex(0));
108 VertexPointXY* toEdge = static_cast<VertexPointXY*>(e->vertex(1));
109 *(params->os) << fromEdge->estimate().translation().x() << " "
110 << fromEdge->estimate().translation().y() << " "
111 << fromEdge->estimate().rotation().angle() << std::endl;
112 *(params->os) << toEdge->estimate().x() << " " << toEdge->estimate().y()
113 << std::endl;
114 *(params->os) << std::endl;
115 return this;
116}

References g2o::HyperGraphElementAction::_typeName, g2o::BaseVertex< D, T >::estimate(), g2o::HyperGraph::Edge::numUndefinedVertices(), g2o::WriteGnuplotAction::Parameters::os, g2o::SE2::rotation(), g2o::SE2::translation(), and g2o::HyperGraph::Edge::vertex().


The documentation for this class was generated from the following files: