55 #include "QtClippingDialog.hh" 57 #include "../Scenegraph/ClippingNode.hh" 78 connect( ui_.setButton, SIGNAL( clicked() ),
79 this, SLOT( set_plane() ) );
80 connect( ui_.sweepRangeSlider, SIGNAL( valueChanged(
int) ),
81 this, SLOT( sweep_plane(
int) ) );
84 connect( ui_.okButton, SIGNAL( clicked() ),
85 this, SLOT( accept() ) );
87 layout()->setSizeConstraint( QLayout::SetFixedSize );
96 QtClippingDialog::show()
107 QtClippingDialog::update_values()
112 ui_.positionXLineEdit->setText(s.setNum(position[0],
'f', 3));
113 ui_.positionYLineEdit->setText(s.setNum(position[1],
'f', 3));
114 ui_.positionZLineEdit->setText(s.setNum(position[2],
'f', 3));
117 ui_.normalXLineEdit->setText(s.setNum(normal[0],
'f', 3));
118 ui_.normalYLineEdit->setText(s.setNum(normal[1],
'f', 3));
119 ui_.normalZLineEdit->setText(s.setNum(normal[2],
'f', 3));
122 ui_.sliceWidthLineEdit->setText(s.setNum(slice_width,
'f', 3));
130 QtClippingDialog::set_plane()
133 Vec3f position( ui_.positionXLineEdit->text().toFloat(),
134 ui_.positionYLineEdit->text().toFloat(),
135 ui_.positionZLineEdit->text().toFloat() );
137 Vec3f normal( ui_.normalXLineEdit->text().toFloat(),
138 ui_.normalYLineEdit->text().toFloat(),
139 ui_.normalZLineEdit->text().toFloat() );
141 float slice_width = ui_.sliceWidthLineEdit->text().toFloat();
143 node_->
set_plane(position, normal, slice_width);
147 ui_.sweepRangeSlider->setValue(0);
150 emit signalNodeChanged(node_);
158 QtClippingDialog::set_sweep_range(
float _radius)
161 ui_.sweepRangeLineEdit->setText(s.setNum(_radius,
'f', 3));
169 QtClippingDialog::sweep_plane(
int _i)
171 float range = ui_.sweepRangeLineEdit->text().toFloat();
172 float offset = ((float)_i) / 100.0 * range;
176 emit signalNodeChanged(node_);
const Vec3f & position() const
get position
float slice_width() const
get slice width
Namespace providing different geometric functions concerning angles.
const Vec3f & normal() const
get normal
void set_plane(const Vec3f &_position, const Vec3f &_normal, float _eps=0.0)
set position and normal of plane
void set_offset(float _dist)
sweep plane along normal by _dist