48VertexLine3DDrawAction::VertexLine3DDrawAction()
51 _lineWidth(nullptr) {}
53bool VertexLine3DDrawAction::refreshPropertyPtrs(
54 HyperGraphElementAction::Parameters* params_) {
58 if (_previousParams) {
60 _typeName +
"::LINE_LENGTH", 15);
62 _typeName +
"::LINE_WIDTH", 5);
70HyperGraphElementAction* VertexLine3DDrawAction::operator()(
71 HyperGraph::HyperGraphElement* element,
72 HyperGraphElementAction::Parameters* params_) {
73 if (
typeid(*element).name() != _typeName) {
77 refreshPropertyPtrs(params_);
78 if (!_previousParams) {
82 if (_show && !_show->value()) {
86 VertexLine3D* that =
static_cast<VertexLine3D*
>(element);
87 Line3D line = that->estimate();
90 Vector3 npoint = line.d().cross(line.w());
92 glColor3f(
float(that->color(0)),
float(that->color(1)),
93 float(that->color(2)));
94 if (_lineLength && _lineWidth) {
95 glLineWidth(
float(_lineWidth->value()));
97 glNormal3f(
float(npoint.x()),
float(npoint.y()),
float(npoint.z()));
98 glVertex3f(
float(npoint.x() - direction.x() * _lineLength->value() / 2),
99 float(npoint.y() - direction.y() * _lineLength->value() / 2),
100 float(npoint.z() - direction.z() * _lineLength->value() / 2));
101 glVertex3f(
float(npoint.x() + direction.x() * _lineLength->value() / 2),
102 float(npoint.y() + direction.y() * _lineLength->value() / 2),
103 float(npoint.z() + direction.z() * _lineLength->value() / 2));
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
virtual bool refreshPropertyPtrs(HyperGraphElementAction::Parameters *params_)
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
some general case utility functions
bool writeVector(std::ostream &os, const Eigen::DenseBase< Derived > &b)
bool readVector(std::istream &is, Eigen::DenseBase< Derived > &b)
Property< float > FloatProperty