51VertexPlaneDrawAction::VertexPlaneDrawAction()
54 _planeHeight(nullptr) {}
56bool VertexPlaneDrawAction::refreshPropertyPtrs(
57 HyperGraphElementAction::Parameters* params_) {
59 if (_previousParams) {
61 _typeName +
"::PLANE_WIDTH", 3);
63 _typeName +
"::PLANE_HEIGHT", 3);
71HyperGraphElementAction* VertexPlaneDrawAction::operator()(
72 HyperGraph::HyperGraphElement* element,
73 HyperGraphElementAction::Parameters* params_) {
74 if (
typeid(*element).name() != _typeName)
return nullptr;
75 refreshPropertyPtrs(params_);
76 if (!_previousParams)
return this;
77 if (_show && !_show->value())
return this;
79 if (_planeWidth && _planeHeight) {
80 VertexPlane* that =
static_cast<VertexPlane*
>(element);
81 double d = that->estimate().distance();
84 glColor3f(
float(that->color(0)),
float(that->color(1)),
85 float(that->color(2)));
87 glRotatef(
float(
RAD2DEG(azimuth)), 0.f, 0.f, 1.f);
88 glRotatef(
float(
RAD2DEG(elevation)), 0.f, -1.f, 0.f);
89 glTranslatef(
float(d), 0.f, 0.f);
92 glNormal3f(-1.f, 0.f, 0.f);
93 glVertex3f(0.f, -_planeWidth->value(), -_planeHeight->value());
94 glVertex3f(0.f, _planeWidth->value(), -_planeHeight->value());
95 glVertex3f(0.f, _planeWidth->value(), _planeHeight->value());
96 glVertex3f(0.f, -_planeWidth->value(), _planeHeight->value());
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
static double elevation(const Vector3 &v)
static double azimuth(const Vector3 &v)
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
bool writeVector(std::ostream &os, const Eigen::DenseBase< Derived > &b)
bool readVector(std::istream &is, Eigen::DenseBase< Derived > &b)
constexpr double cst(long double v)
Property< float > FloatProperty