g2o
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_)
 redefine this to do the action stuff. If successful, the action returns a pointer to itself More...
 
- 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)
 redefine this to do the action stuff. If successful, the action returns a pointer to itself More...
 
virtual ~HyperGraphElementAction ()
 destroyed actions release the memory More...
 
const std::string & typeName () const
 returns the typeid name of the action More...
 
const std::string & name () const
 returns the name of an action, e.g "draw" More...
 
void setTypeName (const std::string &typeName_)
 sets the type on which an action has to operate More...
 

Additional Inherited Members

- Public Types inherited from g2o::HyperGraphElementAction
typedef std::map< std::string, HyperGraphElementAction * > ActionMap
 
- Protected Attributes inherited from g2o::HyperGraphElementAction
std::string _typeName
 
std::string _name
 

Detailed Description

Definition at line 82 of file edge_se2_pointxy.h.

Constructor & Destructor Documentation

g2o::EdgeSE2PointXYWriteGnuplotAction::EdgeSE2PointXYWriteGnuplotAction ( )

Definition at line 96 of file edge_se2_pointxy.cpp.

96 : 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

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 98 of file edge_se2_pointxy.cpp.

References __PRETTY_FUNCTION__, g2o::HyperGraphElementAction::_typeName, g2o::BaseVertex< D, T >::estimate(), LANDMARK_EDGE_COLOR, LANDMARK_EDGE_GHOST_COLOR, g2o::BaseEdge< D, E >::measurement(), g2o::HyperGraphElementAction::name(), g2o::HyperGraph::Edge::numUndefinedVertices(), g2o::WriteGnuplotAction::Parameters::os, g2o::SE2::rotation(), g2o::SE2::translation(), and g2o::HyperGraph::Edge::vertex().

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

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