Commit 73fd76f1 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

Little bugfix and Shift-Modification of circular and bezier poly lines. (By Hannes.)


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17445 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b0a9a3e0
......@@ -62,8 +62,6 @@ void PolyLineBezierSplineData::addInterpolatePoint(ACG::Vec3d _pos, ACG::Vec3d _
bool PolyLineBezierSplineData::finishSpline()
{
Handles_.clear();
if(Points_.size() % 2)
return false;
for(unsigned int i = 0; i < Points_.size() - 1; i++) {
const ACG::Vec3d firstPoint = Points_[i].Pos_, sndPoint = Points_[i + 1].Pos_;
double r = (firstPoint - sndPoint).norm() / 4.0;
......
......@@ -1213,11 +1213,15 @@ me_move( QMouseEvent* _event )
if(!moveCircle_SelNode_->name().compare("N_Handle0")) {
ACG::Vec3d axisb = (axisa % n).normalize();
lineData->circleMainRadius_ = cr;
if(_event->modifiers() & Qt::ShiftModifier)
lineData->circleSideRadius_ = cr;
lineData->circleMainAxis_ = axisa;
lineData->circleSideAxis_ = axisb;
} else {
ACG::Vec3d axisb = (n % axisa).normalize();
lineData->circleSideRadius_ = cr;
if(_event->modifiers() & Qt::ShiftModifier)
lineData->circleMainRadius_ = cr;
lineData->circleSideAxis_ = axisa;
lineData->circleMainAxis_ = axisb;
}
......@@ -1248,13 +1252,17 @@ me_move( QMouseEvent* _event )
ACG::Vec3d onPlane = cameraPos + t * cameraDir;
lineData->Handles_[handleIndex] = onPlane;
if(handleIndex % 2 == 1 && handleIndex != (int)lineData->Handles_.size()) {
if(handleIndex % 2 == 1 && handleIndex != ((int)lineData->Handles_.size() - 1)) {
double dist = (lineData->Handles_[handleIndex + 1] - control.Pos_).norm();
if(_event->modifiers() & Qt::ShiftModifier)
dist = (onPlane - control.Pos_).norm();
ACG::Vec3d dir = -(onPlane - control.Pos_).normalize();
lineData->Handles_[handleIndex + 1] = control.Pos_ + dir * dist;
}
if(handleIndex % 2 == 0 && handleIndex) {
double dist = (lineData->Handles_[handleIndex - 1] - control.Pos_).norm();
if(_event->modifiers() & Qt::ShiftModifier)
dist = (onPlane - control.Pos_).norm();
ACG::Vec3d dir = -(onPlane - control.Pos_).normalize();
lineData->Handles_[handleIndex - 1] = control.Pos_ + dir * dist;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment