Gets Locallab spots more discrete, fixes #5247
Selection lines have been replaced by more discrete selection points Bugfixes/improvements: - Selection points have now priority on ellipse/rectangle and center circle which improves Locallab spot resizing - When mouse-overing a Locallab spot, all the spot becames now orange (even selection spots)
This commit is contained in:
@@ -1026,73 +1026,77 @@ void ControlSpotPanel::addControlSpotCurve(Gtk::TreeModel::Row row)
|
||||
}
|
||||
|
||||
// Creation of visibleGeometry
|
||||
Line* lineX;
|
||||
lineX = new Line();
|
||||
lineX->innerLineWidth = 2.5;
|
||||
lineX->datum = Geometry::IMAGE;
|
||||
Line* lineXL;
|
||||
lineXL = new Line();
|
||||
lineXL->innerLineWidth = 2.5;
|
||||
lineXL->datum = Geometry::IMAGE;
|
||||
Line* lineY;
|
||||
lineY = new Line();
|
||||
lineY->innerLineWidth = 2.5;
|
||||
lineY->datum = Geometry::IMAGE;
|
||||
Line* lineYT;
|
||||
lineYT = new Line();
|
||||
lineYT->innerLineWidth = 2.5;
|
||||
lineYT->datum = Geometry::IMAGE;
|
||||
Circle* cirX;
|
||||
cirX = new Circle();
|
||||
cirX->radius = 4.;
|
||||
cirX->filled = true;
|
||||
cirX->datum = Geometry::IMAGE;
|
||||
Circle* cirXL;
|
||||
cirXL = new Circle();
|
||||
cirXL->radius = 4.;
|
||||
cirXL->filled = true;
|
||||
cirXL->datum = Geometry::IMAGE;
|
||||
Circle* cirY;
|
||||
cirY = new Circle();
|
||||
cirY->radius = 4.;
|
||||
cirY->filled = true;
|
||||
cirY->datum = Geometry::IMAGE;
|
||||
Circle* cirYT;
|
||||
cirYT = new Circle();
|
||||
cirYT->radius = 4.;
|
||||
cirYT->filled = true;
|
||||
cirYT->datum = Geometry::IMAGE;
|
||||
Circle* centerCircle;
|
||||
centerCircle = new Circle();
|
||||
centerCircle->datum = Geometry::IMAGE;
|
||||
centerCircle->radiusInImageSpace = true;
|
||||
Ellipse* shape_ellipse;
|
||||
shape_ellipse = new Ellipse();
|
||||
shape_ellipse->innerLineWidth = 0.7;
|
||||
shape_ellipse->datum = Geometry::IMAGE;
|
||||
shape_ellipse->radiusInImageSpace = true;
|
||||
Rectangle* shape_rectangle;
|
||||
shape_rectangle = new Rectangle();
|
||||
shape_rectangle->innerLineWidth = 0.7;
|
||||
shape_rectangle->datum = Geometry::IMAGE;
|
||||
EditSubscriber::visibleGeometry.push_back(lineX); // (curveid - 1) * 7
|
||||
EditSubscriber::visibleGeometry.push_back(lineXL); // (curveid - 1) * 7 + 1
|
||||
EditSubscriber::visibleGeometry.push_back(lineY); // (curveid - 1) * 7 + 2
|
||||
EditSubscriber::visibleGeometry.push_back(lineYT); // (curveid - 1) * 7 + 3
|
||||
EditSubscriber::visibleGeometry.push_back(centerCircle); // (curveid - 1) * 7 + 4
|
||||
EditSubscriber::visibleGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 5
|
||||
EditSubscriber::visibleGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 6
|
||||
EditSubscriber::visibleGeometry.push_back(centerCircle); // (curveid - 1) * 7
|
||||
EditSubscriber::visibleGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 1
|
||||
EditSubscriber::visibleGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 2
|
||||
EditSubscriber::visibleGeometry.push_back(cirX); // (curveid - 1) * 7 + 3
|
||||
EditSubscriber::visibleGeometry.push_back(cirXL); // (curveid - 1) * 7 + 4
|
||||
EditSubscriber::visibleGeometry.push_back(cirY); // (curveid - 1) * 7 + 5
|
||||
EditSubscriber::visibleGeometry.push_back(cirYT); // (curveid - 1) * 7 + 6
|
||||
|
||||
// Creation of mouseOverGeometry
|
||||
lineX = new Line();
|
||||
lineX->innerLineWidth = 2.5;
|
||||
lineX->datum = Geometry::IMAGE;
|
||||
lineXL = new Line();
|
||||
lineXL->innerLineWidth = 2.5;
|
||||
lineXL->datum = Geometry::IMAGE;
|
||||
lineY = new Line();
|
||||
lineY->innerLineWidth = 2.5;
|
||||
lineY->datum = Geometry::IMAGE;
|
||||
lineYT = new Line();
|
||||
lineYT->innerLineWidth = 2.5;
|
||||
lineYT->datum = Geometry::IMAGE;
|
||||
cirX = new Circle();
|
||||
cirX->radius = 4.;
|
||||
cirX->filled = true;
|
||||
cirX->datum = Geometry::IMAGE;
|
||||
cirXL = new Circle();
|
||||
cirXL->radius = 4.;
|
||||
cirXL->filled = true;
|
||||
cirXL->datum = Geometry::IMAGE;
|
||||
cirY = new Circle();
|
||||
cirY->radius = 4.;
|
||||
cirY->filled = true;
|
||||
cirY->datum = Geometry::IMAGE;
|
||||
cirYT = new Circle();
|
||||
cirYT->radius = 4.;
|
||||
cirYT->filled = true;
|
||||
cirYT->datum = Geometry::IMAGE;
|
||||
centerCircle = new Circle();
|
||||
centerCircle->datum = Geometry::IMAGE;
|
||||
centerCircle->radiusInImageSpace = true;
|
||||
shape_ellipse = new Ellipse();
|
||||
shape_ellipse->innerLineWidth = 0.7;
|
||||
shape_ellipse->datum = Geometry::IMAGE;
|
||||
shape_ellipse->radiusInImageSpace = true;
|
||||
shape_rectangle = new Rectangle();
|
||||
shape_rectangle->innerLineWidth = 0.7;
|
||||
shape_rectangle->datum = Geometry::IMAGE;
|
||||
EditSubscriber::mouseOverGeometry.push_back(lineX); // (curveid - 1) * 7
|
||||
EditSubscriber::mouseOverGeometry.push_back(lineXL); // (curveid - 1) * 7 + 1
|
||||
EditSubscriber::mouseOverGeometry.push_back(lineY); // (curveid - 1) * 7 + 2
|
||||
EditSubscriber::mouseOverGeometry.push_back(lineYT); // (curveid - 1) * 7 + 3
|
||||
EditSubscriber::mouseOverGeometry.push_back(centerCircle); // (curveid - 1) * 7 + 4
|
||||
EditSubscriber::mouseOverGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 5
|
||||
EditSubscriber::mouseOverGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 6
|
||||
EditSubscriber::mouseOverGeometry.push_back(centerCircle); // (curveid - 1) * 7
|
||||
EditSubscriber::mouseOverGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 1
|
||||
EditSubscriber::mouseOverGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 2
|
||||
EditSubscriber::mouseOverGeometry.push_back(cirX); // (curveid - 1) * 7 + 3
|
||||
EditSubscriber::mouseOverGeometry.push_back(cirXL); // (curveid - 1) * 7 + 4
|
||||
EditSubscriber::mouseOverGeometry.push_back(cirY); // (curveid - 1) * 7 + 5
|
||||
EditSubscriber::mouseOverGeometry.push_back(cirYT); // (curveid - 1) * 7 + 6
|
||||
|
||||
row[spots_.curveid] = EditSubscriber::visibleGeometry.size() / 7;
|
||||
}
|
||||
@@ -1130,17 +1134,15 @@ void ControlSpotPanel::updateControlSpotCurve(Gtk::TreeModel::Row row)
|
||||
const int decayXL = locXL_ * (imW / 2000);
|
||||
const int decayY = locY_ * (imH / 2000);
|
||||
const int decayYT = locYT_ * (imH / 2000);
|
||||
rtengine::Coord origin(imW / 2 + centerX_ * imW / 2000, imH / 2 + centerY_ * imH / 2000);
|
||||
const rtengine::Coord origin(imW / 2 + centerX_ * imW / 2000, imH / 2 + centerY_ * imH / 2000);
|
||||
|
||||
const auto updateLineWithDecay = [&](Geometry * geometry, const float radius, const float decal, const float offSetAngle, const double decay) {
|
||||
const auto line = static_cast<Line*>(geometry); // 180
|
||||
line->begin = PolarCoord(radius, decal) + PolarCoord(decay, offSetAngle);
|
||||
line->begin += origin; // 0
|
||||
line->end = PolarCoord(radius, decal - 180) + PolarCoord(decay, offSetAngle);
|
||||
line->end += origin;
|
||||
const auto updateSelectionCircle = [&](Geometry * geometry, const int offsetX, const int offsetY) {
|
||||
const auto cir = static_cast<Circle*>(geometry);
|
||||
cir->center.x = origin.x + offsetX;
|
||||
cir->center.y = origin.y + offsetY;
|
||||
};
|
||||
|
||||
const auto updateCircle = [&](Geometry * geometry) {
|
||||
const auto updateCenterCircle = [&](Geometry * geometry) {
|
||||
const auto circle = static_cast<Circle*>(geometry);
|
||||
circle->center = origin;
|
||||
circle->radius = circrad_;
|
||||
@@ -1163,70 +1165,70 @@ void ControlSpotPanel::updateControlSpotCurve(Gtk::TreeModel::Row row)
|
||||
rectangle->topLeft.y = origin.y - decayYT;
|
||||
};
|
||||
|
||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 7), 500., 90., 0., decayX);
|
||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 7), 500., 90., 0., decayX);
|
||||
updateCenterCircle(visibleGeometry.at((curveid_ - 1) * 7));
|
||||
updateCenterCircle(mouseOverGeometry.at((curveid_ - 1) * 7));
|
||||
|
||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 7 + 1), 500., 90., 180., decayXL);
|
||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 7 + 1), 500., 90., 180., decayXL);
|
||||
updateEllipse(visibleGeometry.at((curveid_ - 1) * 7 + 1));
|
||||
updateEllipse(mouseOverGeometry.at((curveid_ - 1) * 7 + 1));
|
||||
|
||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 7 + 2), 500., 180., 90., decayY);
|
||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 7 + 2), 500., 180., 90., decayY);
|
||||
updateRectangle(visibleGeometry.at((curveid_ - 1) * 7 + 2));
|
||||
updateRectangle(mouseOverGeometry.at((curveid_ - 1) * 7 + 2));
|
||||
|
||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 7 + 3), 500., 180., 270., decayYT);
|
||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 7 + 3), 500., 180., 270., decayYT);
|
||||
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 3), decayX, 0.);
|
||||
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 3), decayX, 0.);
|
||||
|
||||
updateCircle(visibleGeometry.at((curveid_ - 1) * 7 + 4));
|
||||
updateCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 4));
|
||||
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 4), -decayXL, 0.);
|
||||
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 4), -decayXL, 0.);
|
||||
|
||||
updateEllipse(visibleGeometry.at((curveid_ - 1) * 7 + 5));
|
||||
updateEllipse(mouseOverGeometry.at((curveid_ - 1) * 7 + 5));
|
||||
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 5), 0., decayY);
|
||||
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 5), 0., decayY);
|
||||
|
||||
updateRectangle(visibleGeometry.at((curveid_ - 1) * 7 + 6));
|
||||
updateRectangle(mouseOverGeometry.at((curveid_ - 1) * 7 + 6));
|
||||
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 6), 0., -decayYT);
|
||||
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 6), 0., -decayYT);
|
||||
|
||||
// Update Arcellipse/Rectangle visibility according to shape and visibility
|
||||
if (isvisible_) {
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(true);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(true); // centerCircle
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true); // cirX
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true); // cirXL
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // cirY
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // cirYT
|
||||
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(true);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(true); // centerCircle
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true); // cirX
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true); // cirXL
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // cirY
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // cirYT
|
||||
|
||||
if (shape_ == 0) { // 0 = Ellipse
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // shape_ellipse
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // shape_rectangle
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true); // shape_ellipse
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // shape_ellipse
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // shape_rectangle
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true); // shape_ellipse
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||
} else { // 1 = Rectangle
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // shape_ellipse
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // shape_rectangle
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true); // shape_rectangle
|
||||
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // shape_ellipse
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // shape_rectangle
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true); // shape_rectangle
|
||||
}
|
||||
} else {
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(false);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false);
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(false); // centerCircle
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false); // cirX
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false); // cirXL
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // cirY
|
||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // cirYT
|
||||
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(false);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false);
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(false); // centerCircle
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false); // cirX
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false); // cirXL
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // cirY
|
||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // cirYT
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1285,27 +1287,27 @@ CursorShape ControlSpotPanel::getCursor(int objectID) const
|
||||
int rem_ = objectID % 7;
|
||||
|
||||
switch (rem_) {
|
||||
case (0): // LocX: (curveid_ - 1) * 7
|
||||
case (0): // centerCircle: (curveid_ - 1) * 7
|
||||
return CSMove2D;
|
||||
|
||||
case (1): // shape_ellipse: (curveid_ - 1) * 7 + 1
|
||||
return CSMove2D;
|
||||
|
||||
case (2): // shape_rectangle: (curveid_ - 1) * 7 + 2
|
||||
return CSMove2D;
|
||||
|
||||
case (3): // cirX: (curveid_ - 1) * 7 + 3
|
||||
return CSMove1DH;
|
||||
|
||||
case (1): // LocXL: (curveid_ - 1) * 7 + 1
|
||||
case (4): // cirXL: (curveid_ - 1) * 7 + 4
|
||||
return CSMove1DH;
|
||||
|
||||
case (2): // LocY: (curveid_ - 1) * 7 + 2
|
||||
case (5): // cirY: (curveid_ - 1) * 7 + 5
|
||||
return CSMove1DV;
|
||||
|
||||
case (3): // LocYT: (curveid_ - 1) * 7 + 3
|
||||
case (6): // cirYT: (curveid_ - 1) * 7 + 6
|
||||
return CSMove1DV;
|
||||
|
||||
case (4): // centerCircle: (curveid_ - 1) * 7 + 4
|
||||
return CSMove2D;
|
||||
|
||||
case (5): // shape_ellipse: (curveid_ - 1) * 7 + 5
|
||||
return CSMove2D;
|
||||
|
||||
case (6): // shape_rectangle: (curveid_ - 1) * 7 + 6
|
||||
return CSMove2D;
|
||||
|
||||
default:
|
||||
return CSHandOpen;
|
||||
}
|
||||
@@ -1370,65 +1372,61 @@ bool ControlSpotPanel::mouseOver(int modifierKey)
|
||||
|
||||
const int method = shapeMethod_->get_active_row_number();
|
||||
|
||||
// LocX
|
||||
if (rem == 0) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7)->state = Geometry::PRELIGHT;
|
||||
|
||||
if (method == 1 || method == 3) { // Symmetrical cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 1)->state = Geometry::PRELIGHT;
|
||||
}
|
||||
} else {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7)->state = Geometry::NORMAL;
|
||||
}
|
||||
|
||||
// LocXL
|
||||
if (rem == 1) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 1)->state = Geometry::PRELIGHT;
|
||||
|
||||
if (method == 1 || method == 3) { // Symmetrical cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7)->state = Geometry::PRELIGHT;
|
||||
}
|
||||
} else {
|
||||
if (method == 0 || method == 2) { // Independent cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 1)->state = Geometry::NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
// LocY
|
||||
if (rem == 2) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 2)->state = Geometry::PRELIGHT;
|
||||
|
||||
if (method == 1 || method == 3) { // Symmetrical cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::PRELIGHT;
|
||||
}
|
||||
} else {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 2)->state = Geometry::NORMAL;
|
||||
}
|
||||
|
||||
// LocYT
|
||||
if (rem == 3) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::PRELIGHT;
|
||||
|
||||
if (method == 1 || method == 3) { // Symmetrical cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 2)->state = Geometry::PRELIGHT;
|
||||
}
|
||||
} else {
|
||||
if (method == 0 || method == 2) { // Independent cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
// Circle, Arcellipses and Rectangle
|
||||
if (rem >= 4) {
|
||||
if (rem >= 0 && rem < 3) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7)->state = Geometry::PRELIGHT;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 1)->state = Geometry::PRELIGHT;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 2)->state = Geometry::PRELIGHT;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::PRELIGHT;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 4)->state = Geometry::PRELIGHT;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::PRELIGHT;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 6)->state = Geometry::PRELIGHT;
|
||||
} else {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7)->state = Geometry::NORMAL;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 2)->state = Geometry::NORMAL;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::NORMAL;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 4)->state = Geometry::NORMAL;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 4)->state = Geometry::NORMAL;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::NORMAL;
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 6)->state = Geometry::NORMAL;
|
||||
}
|
||||
|
||||
// cirX
|
||||
if (rem == 3) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::PRELIGHT;
|
||||
|
||||
if (method == 1 || method == 3) { // Symmetrical cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 4)->state = Geometry::PRELIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
// cirXL
|
||||
if (rem == 4) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 4)->state = Geometry::PRELIGHT;
|
||||
|
||||
if (method == 1 || method == 3) { // Symmetrical cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::PRELIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
// cirY
|
||||
if (rem == 5) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::PRELIGHT;
|
||||
|
||||
if (method == 1 || method == 3) { // Symmetrical cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 6)->state = Geometry::PRELIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
// cirYT
|
||||
if (rem == 6) {
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 6)->state = Geometry::PRELIGHT;
|
||||
|
||||
if (method == 1 || method == 3) { // Symmetrical cases
|
||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::PRELIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
lastObject_ = object_;
|
||||
return true;
|
||||
}
|
||||
@@ -1492,8 +1490,24 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
||||
int method = shapeMethod_->get_active_row_number();
|
||||
Coord* newCoord = new Coord(provider->posImage.x + provider->deltaImage.x, provider->posImage.y + provider->deltaImage.y);
|
||||
|
||||
// LocX
|
||||
if (rem == 0) {
|
||||
// Circle, Ellipses and Rectangle
|
||||
if (rem >= 0 && rem < 3) {
|
||||
double deltaX = (double (newCoord->x) - double (lastCoord_->x)) * 2000. / double (imW);
|
||||
double deltaY = (double (newCoord->y) - double (lastCoord_->y)) * 2000. / double (imH);
|
||||
centerX_->setValue(centerX_->getValue() + deltaX);
|
||||
centerY_->setValue(centerY_->getValue() + deltaY);
|
||||
row[spots_.centerX] = (int) centerX_->getValue();
|
||||
row[spots_.centerY] = (int) centerY_->getValue();
|
||||
|
||||
updateControlSpotCurve(row);
|
||||
|
||||
if (listener) {
|
||||
listener->panelChanged(EvLocallabSpotCenter, "X=" + centerX_->getTextValue() + ", Y=" + centerY_->getTextValue());
|
||||
}
|
||||
}
|
||||
|
||||
// cirX
|
||||
if (rem == 3) {
|
||||
double deltaX = (double (newCoord->x) - double (lastCoord_->x)) * 2000. / double (imW);
|
||||
locX_->setValue(locX_->getValue() + deltaX);
|
||||
row[spots_.locX] = (int) locX_->getValue();
|
||||
@@ -1512,8 +1526,8 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
||||
}
|
||||
}
|
||||
|
||||
// LocXL
|
||||
if (rem == 1) {
|
||||
// cirXL
|
||||
if (rem == 4) {
|
||||
double deltaXL = (double (lastCoord_->x) - double (newCoord->x)) * 2000. / double (imW);
|
||||
locXL_->setValue(locXL_->getValue() + deltaXL);
|
||||
row[spots_.locXL] = (int) locXL_->getValue();
|
||||
@@ -1532,8 +1546,8 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
||||
}
|
||||
}
|
||||
|
||||
// LocY
|
||||
if (rem == 2) {
|
||||
// cirY
|
||||
if (rem == 5) {
|
||||
double deltaY = (double (newCoord->y) - double (lastCoord_->y)) * 2000. / double (imH);
|
||||
locY_->setValue(locY_->getValue() + deltaY);
|
||||
row[spots_.locY] = (int) locY_->getValue();
|
||||
@@ -1552,8 +1566,8 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
||||
}
|
||||
}
|
||||
|
||||
// LocYT
|
||||
if (rem == 3) {
|
||||
// cirYT
|
||||
if (rem == 6) {
|
||||
double deltaYT = (double (lastCoord_->y) - double (newCoord->y)) * 2000. / double (imH);
|
||||
locYT_->setValue(locYT_->getValue() + deltaYT);
|
||||
row[spots_.locYT] = (int) locYT_->getValue();
|
||||
@@ -1572,22 +1586,6 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
||||
}
|
||||
}
|
||||
|
||||
// Circle, Ellipses and Rectangle
|
||||
if (rem >= 4) {
|
||||
double deltaX = (double (newCoord->x) - double (lastCoord_->x)) * 2000. / double (imW);
|
||||
double deltaY = (double (newCoord->y) - double (lastCoord_->y)) * 2000. / double (imH);
|
||||
centerX_->setValue(centerX_->getValue() + deltaX);
|
||||
centerY_->setValue(centerY_->getValue() + deltaY);
|
||||
row[spots_.centerX] = (int) centerX_->getValue();
|
||||
row[spots_.centerY] = (int) centerY_->getValue();
|
||||
|
||||
updateControlSpotCurve(row);
|
||||
|
||||
if (listener) {
|
||||
listener->panelChanged(EvLocallabSpotCenter, "X=" + centerX_->getTextValue() + ", Y=" + centerY_->getTextValue());
|
||||
}
|
||||
}
|
||||
|
||||
lastCoord_->set(newCoord->x, newCoord->y);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user