30 #ifdef G2O_HAVE_OPENGL 37 using namespace Eigen;
40 namespace deprecated {
42 VertexSE3::VertexSE3() :
52 for (
int i=0; i<7; i++)
61 for (
int i=0; i<7; i++)
87 #ifdef G2O_HAVE_OPENGL 88 void drawTriangle(
float xSize,
float ySize){
90 glBegin(GL_TRIANGLES);
92 p[1] << -xSize, ySize, 0.;
93 p[2] << -xSize, -ySize, 0.;
94 for (
int i = 1; i < 2; ++i) {
95 Vector3f normal = (p[i] - p[0]).cross(p[i+1] - p[0]);
96 glNormal3f(normal.x(), normal.y(), normal.z());
97 glVertex3f(p[0].x(), p[0].y(), p[0].z());
98 glVertex3f(p[i].x(), p[i].y(), p[i].z());
99 glVertex3f(p[i+1].x(), p[i+1].y(), p[i+1].z());
105 _cacheDrawActions = 0;
111 if (_previousParams){
113 _triangleY = _previousParams->makeProperty<
FloatProperty>(_typeName +
"::TRIANGLE_Y", .05f);
125 if (! _cacheDrawActions){
129 refreshPropertyPtrs(params_);
130 if (! _previousParams)
133 if (_show && !_show->value())
138 glColor3f(0.5f,0.5f,0.8f);
142 glRotatef((
float)
RAD2DEG(aa.angle()),(
float)aa.axis().x(),(float)aa.axis().y(),(float)aa.axis().z());
143 if (_triangleX && _triangleY){
144 drawTriangle(_triangleX->value(), _triangleY->value());
148 for (CacheContainer::iterator it=caches->begin(); it!=caches->end(); it++){
149 Cache* c = it->second;
150 (*_cacheDrawActions)(c, params_);
154 while (d && _cacheDrawActions ){
155 (*_cacheDrawActions)(d, params_);
const Data * next() const
#define __PRETTY_FUNCTION__
data packet for a vertex. Extend this class to store in the vertices the potential additional informa...
const Data * userData() const
the user data associated with this vertex
Abstract action that operates on a graph entity.
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
redefine this to do the action stuff. If successful, the action returns a pointer to itself ...
CacheContainer * cacheContainer()
virtual void updateCache()
Eigen::Matrix< double, 7, 1 > Vector7d
VertexSE3WriteGnuplotAction()
const std::string & name() const
returns the name of an action, e.g "draw"
static HyperGraphActionLibrary * instance()
return the single instance of the HyperGraphActionLibrary
const Eigen::Quaterniond & rotation() const
HyperGraphElementAction * actionByName(const std::string &name)
3D pose Vertex, (x,y,z,qw,qx,qy,qz) the parameterization for the increments constructed is a 6d vecto...
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
const EstimateType & estimate() const
return the current estimate of the vertex
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
virtual bool write(std::ostream &os) const
write the vertex to a stream
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
const Vector3D & translation() const