61 #include "QtClippingDialog.hh"
63 #include "../Scenegraph/ClippingNode.hh"
84 connect( ui_.setButton, SIGNAL( clicked() ),
85 this, SLOT( set_plane() ) );
86 connect( ui_.sweepRangeSlider, SIGNAL( valueChanged(
int) ),
87 this, SLOT( sweep_plane(
int) ) );
90 connect( ui_.okButton, SIGNAL( clicked() ),
91 this, SLOT( accept() ) );
93 layout()->setSizeConstraint( QLayout::SetFixedSize );
102 QtClippingDialog::show()
113 QtClippingDialog::update_values()
118 ui_.positionXLineEdit->setText(s.setNum(position[0],
'f', 3));
119 ui_.positionYLineEdit->setText(s.setNum(position[1],
'f', 3));
120 ui_.positionZLineEdit->setText(s.setNum(position[2],
'f', 3));
123 ui_.normalXLineEdit->setText(s.setNum(normal[0],
'f', 3));
124 ui_.normalYLineEdit->setText(s.setNum(normal[1],
'f', 3));
125 ui_.normalZLineEdit->setText(s.setNum(normal[2],
'f', 3));
128 ui_.sliceWidthLineEdit->setText(s.setNum(slice_width,
'f', 3));
136 QtClippingDialog::set_plane()
139 Vec3f position( ui_.positionXLineEdit->text().toFloat(),
140 ui_.positionYLineEdit->text().toFloat(),
141 ui_.positionZLineEdit->text().toFloat() );
143 Vec3f normal( ui_.normalXLineEdit->text().toFloat(),
144 ui_.normalYLineEdit->text().toFloat(),
145 ui_.normalZLineEdit->text().toFloat() );
147 float slice_width = ui_.sliceWidthLineEdit->text().toFloat();
149 node_->
set_plane(position, normal, slice_width);
153 ui_.sweepRangeSlider->setValue(0);
156 emit signalNodeChanged(node_);
164 QtClippingDialog::set_sweep_range(
float _radius)
167 ui_.sweepRangeLineEdit->setText(s.setNum(_radius,
'f', 3));
175 QtClippingDialog::sweep_plane(
int _i)
177 float range = ui_.sweepRangeLineEdit->text().toFloat();
178 float offset = ((float)_i) / 100.0 * range;
182 emit signalNodeChanged(node_);
void set_plane(const Vec3f &_position, const Vec3f &_normal, float _eps=0.0)
set position and normal of plane
Namespace providing different geometric functions concerning angles.
QtClippingDialog(QWidget *_parent, SceneGraph::ClippingNode *_node)
Default constructor.
void set_offset(float _dist)
sweep plane along normal by _dist
const Vec3f & position() const
get position
const Vec3f & normal() const
get normal
float slice_width() const
get slice width