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
|
// Creation of visibleGeometry
|
||||||
Line* lineX;
|
Circle* cirX;
|
||||||
lineX = new Line();
|
cirX = new Circle();
|
||||||
lineX->innerLineWidth = 2.5;
|
cirX->radius = 4.;
|
||||||
lineX->datum = Geometry::IMAGE;
|
cirX->filled = true;
|
||||||
Line* lineXL;
|
cirX->datum = Geometry::IMAGE;
|
||||||
lineXL = new Line();
|
Circle* cirXL;
|
||||||
lineXL->innerLineWidth = 2.5;
|
cirXL = new Circle();
|
||||||
lineXL->datum = Geometry::IMAGE;
|
cirXL->radius = 4.;
|
||||||
Line* lineY;
|
cirXL->filled = true;
|
||||||
lineY = new Line();
|
cirXL->datum = Geometry::IMAGE;
|
||||||
lineY->innerLineWidth = 2.5;
|
Circle* cirY;
|
||||||
lineY->datum = Geometry::IMAGE;
|
cirY = new Circle();
|
||||||
Line* lineYT;
|
cirY->radius = 4.;
|
||||||
lineYT = new Line();
|
cirY->filled = true;
|
||||||
lineYT->innerLineWidth = 2.5;
|
cirY->datum = Geometry::IMAGE;
|
||||||
lineYT->datum = Geometry::IMAGE;
|
Circle* cirYT;
|
||||||
|
cirYT = new Circle();
|
||||||
|
cirYT->radius = 4.;
|
||||||
|
cirYT->filled = true;
|
||||||
|
cirYT->datum = Geometry::IMAGE;
|
||||||
Circle* centerCircle;
|
Circle* centerCircle;
|
||||||
centerCircle = new Circle();
|
centerCircle = new Circle();
|
||||||
centerCircle->datum = Geometry::IMAGE;
|
centerCircle->datum = Geometry::IMAGE;
|
||||||
centerCircle->radiusInImageSpace = true;
|
centerCircle->radiusInImageSpace = true;
|
||||||
Ellipse* shape_ellipse;
|
Ellipse* shape_ellipse;
|
||||||
shape_ellipse = new Ellipse();
|
shape_ellipse = new Ellipse();
|
||||||
shape_ellipse->innerLineWidth = 0.7;
|
|
||||||
shape_ellipse->datum = Geometry::IMAGE;
|
shape_ellipse->datum = Geometry::IMAGE;
|
||||||
shape_ellipse->radiusInImageSpace = true;
|
shape_ellipse->radiusInImageSpace = true;
|
||||||
Rectangle* shape_rectangle;
|
Rectangle* shape_rectangle;
|
||||||
shape_rectangle = new Rectangle();
|
shape_rectangle = new Rectangle();
|
||||||
shape_rectangle->innerLineWidth = 0.7;
|
|
||||||
shape_rectangle->datum = Geometry::IMAGE;
|
shape_rectangle->datum = Geometry::IMAGE;
|
||||||
EditSubscriber::visibleGeometry.push_back(lineX); // (curveid - 1) * 7
|
EditSubscriber::visibleGeometry.push_back(centerCircle); // (curveid - 1) * 7
|
||||||
EditSubscriber::visibleGeometry.push_back(lineXL); // (curveid - 1) * 7 + 1
|
EditSubscriber::visibleGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 1
|
||||||
EditSubscriber::visibleGeometry.push_back(lineY); // (curveid - 1) * 7 + 2
|
EditSubscriber::visibleGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 2
|
||||||
EditSubscriber::visibleGeometry.push_back(lineYT); // (curveid - 1) * 7 + 3
|
EditSubscriber::visibleGeometry.push_back(cirX); // (curveid - 1) * 7 + 3
|
||||||
EditSubscriber::visibleGeometry.push_back(centerCircle); // (curveid - 1) * 7 + 4
|
EditSubscriber::visibleGeometry.push_back(cirXL); // (curveid - 1) * 7 + 4
|
||||||
EditSubscriber::visibleGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 5
|
EditSubscriber::visibleGeometry.push_back(cirY); // (curveid - 1) * 7 + 5
|
||||||
EditSubscriber::visibleGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 6
|
EditSubscriber::visibleGeometry.push_back(cirYT); // (curveid - 1) * 7 + 6
|
||||||
|
|
||||||
// Creation of mouseOverGeometry
|
// Creation of mouseOverGeometry
|
||||||
lineX = new Line();
|
cirX = new Circle();
|
||||||
lineX->innerLineWidth = 2.5;
|
cirX->radius = 4.;
|
||||||
lineX->datum = Geometry::IMAGE;
|
cirX->filled = true;
|
||||||
lineXL = new Line();
|
cirX->datum = Geometry::IMAGE;
|
||||||
lineXL->innerLineWidth = 2.5;
|
cirXL = new Circle();
|
||||||
lineXL->datum = Geometry::IMAGE;
|
cirXL->radius = 4.;
|
||||||
lineY = new Line();
|
cirXL->filled = true;
|
||||||
lineY->innerLineWidth = 2.5;
|
cirXL->datum = Geometry::IMAGE;
|
||||||
lineY->datum = Geometry::IMAGE;
|
cirY = new Circle();
|
||||||
lineYT = new Line();
|
cirY->radius = 4.;
|
||||||
lineYT->innerLineWidth = 2.5;
|
cirY->filled = true;
|
||||||
lineYT->datum = Geometry::IMAGE;
|
cirY->datum = Geometry::IMAGE;
|
||||||
|
cirYT = new Circle();
|
||||||
|
cirYT->radius = 4.;
|
||||||
|
cirYT->filled = true;
|
||||||
|
cirYT->datum = Geometry::IMAGE;
|
||||||
centerCircle = new Circle();
|
centerCircle = new Circle();
|
||||||
centerCircle->datum = Geometry::IMAGE;
|
centerCircle->datum = Geometry::IMAGE;
|
||||||
centerCircle->radiusInImageSpace = true;
|
centerCircle->radiusInImageSpace = true;
|
||||||
shape_ellipse = new Ellipse();
|
shape_ellipse = new Ellipse();
|
||||||
shape_ellipse->innerLineWidth = 0.7;
|
|
||||||
shape_ellipse->datum = Geometry::IMAGE;
|
shape_ellipse->datum = Geometry::IMAGE;
|
||||||
shape_ellipse->radiusInImageSpace = true;
|
shape_ellipse->radiusInImageSpace = true;
|
||||||
shape_rectangle = new Rectangle();
|
shape_rectangle = new Rectangle();
|
||||||
shape_rectangle->innerLineWidth = 0.7;
|
|
||||||
shape_rectangle->datum = Geometry::IMAGE;
|
shape_rectangle->datum = Geometry::IMAGE;
|
||||||
EditSubscriber::mouseOverGeometry.push_back(lineX); // (curveid - 1) * 7
|
EditSubscriber::mouseOverGeometry.push_back(centerCircle); // (curveid - 1) * 7
|
||||||
EditSubscriber::mouseOverGeometry.push_back(lineXL); // (curveid - 1) * 7 + 1
|
EditSubscriber::mouseOverGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 1
|
||||||
EditSubscriber::mouseOverGeometry.push_back(lineY); // (curveid - 1) * 7 + 2
|
EditSubscriber::mouseOverGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 2
|
||||||
EditSubscriber::mouseOverGeometry.push_back(lineYT); // (curveid - 1) * 7 + 3
|
EditSubscriber::mouseOverGeometry.push_back(cirX); // (curveid - 1) * 7 + 3
|
||||||
EditSubscriber::mouseOverGeometry.push_back(centerCircle); // (curveid - 1) * 7 + 4
|
EditSubscriber::mouseOverGeometry.push_back(cirXL); // (curveid - 1) * 7 + 4
|
||||||
EditSubscriber::mouseOverGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 5
|
EditSubscriber::mouseOverGeometry.push_back(cirY); // (curveid - 1) * 7 + 5
|
||||||
EditSubscriber::mouseOverGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 6
|
EditSubscriber::mouseOverGeometry.push_back(cirYT); // (curveid - 1) * 7 + 6
|
||||||
|
|
||||||
row[spots_.curveid] = EditSubscriber::visibleGeometry.size() / 7;
|
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 decayXL = locXL_ * (imW / 2000);
|
||||||
const int decayY = locY_ * (imH / 2000);
|
const int decayY = locY_ * (imH / 2000);
|
||||||
const int decayYT = locYT_ * (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 updateSelectionCircle = [&](Geometry * geometry, const int offsetX, const int offsetY) {
|
||||||
const auto line = static_cast<Line*>(geometry); // 180
|
const auto cir = static_cast<Circle*>(geometry);
|
||||||
line->begin = PolarCoord(radius, decal) + PolarCoord(decay, offSetAngle);
|
cir->center.x = origin.x + offsetX;
|
||||||
line->begin += origin; // 0
|
cir->center.y = origin.y + offsetY;
|
||||||
line->end = PolarCoord(radius, decal - 180) + PolarCoord(decay, offSetAngle);
|
|
||||||
line->end += origin;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto updateCircle = [&](Geometry * geometry) {
|
const auto updateCenterCircle = [&](Geometry * geometry) {
|
||||||
const auto circle = static_cast<Circle*>(geometry);
|
const auto circle = static_cast<Circle*>(geometry);
|
||||||
circle->center = origin;
|
circle->center = origin;
|
||||||
circle->radius = circrad_;
|
circle->radius = circrad_;
|
||||||
@@ -1163,70 +1165,70 @@ void ControlSpotPanel::updateControlSpotCurve(Gtk::TreeModel::Row row)
|
|||||||
rectangle->topLeft.y = origin.y - decayYT;
|
rectangle->topLeft.y = origin.y - decayYT;
|
||||||
};
|
};
|
||||||
|
|
||||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 7), 500., 90., 0., decayX);
|
updateCenterCircle(visibleGeometry.at((curveid_ - 1) * 7));
|
||||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 7), 500., 90., 0., decayX);
|
updateCenterCircle(mouseOverGeometry.at((curveid_ - 1) * 7));
|
||||||
|
|
||||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 7 + 1), 500., 90., 180., decayXL);
|
updateEllipse(visibleGeometry.at((curveid_ - 1) * 7 + 1));
|
||||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 7 + 1), 500., 90., 180., decayXL);
|
updateEllipse(mouseOverGeometry.at((curveid_ - 1) * 7 + 1));
|
||||||
|
|
||||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 7 + 2), 500., 180., 90., decayY);
|
updateRectangle(visibleGeometry.at((curveid_ - 1) * 7 + 2));
|
||||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 7 + 2), 500., 180., 90., decayY);
|
updateRectangle(mouseOverGeometry.at((curveid_ - 1) * 7 + 2));
|
||||||
|
|
||||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 7 + 3), 500., 180., 270., decayYT);
|
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 3), decayX, 0.);
|
||||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 7 + 3), 500., 180., 270., decayYT);
|
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 3), decayX, 0.);
|
||||||
|
|
||||||
updateCircle(visibleGeometry.at((curveid_ - 1) * 7 + 4));
|
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 4), -decayXL, 0.);
|
||||||
updateCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 4));
|
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 4), -decayXL, 0.);
|
||||||
|
|
||||||
updateEllipse(visibleGeometry.at((curveid_ - 1) * 7 + 5));
|
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 5), 0., decayY);
|
||||||
updateEllipse(mouseOverGeometry.at((curveid_ - 1) * 7 + 5));
|
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 5), 0., decayY);
|
||||||
|
|
||||||
updateRectangle(visibleGeometry.at((curveid_ - 1) * 7 + 6));
|
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 6), 0., -decayYT);
|
||||||
updateRectangle(mouseOverGeometry.at((curveid_ - 1) * 7 + 6));
|
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 6), 0., -decayYT);
|
||||||
|
|
||||||
// Update Arcellipse/Rectangle visibility according to shape and visibility
|
// Update Arcellipse/Rectangle visibility according to shape and visibility
|
||||||
if (isvisible_) {
|
if (isvisible_) {
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(true); // centerCircle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true); // cirX
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true); // cirXL
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // cirY
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // cirYT
|
||||||
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(true); // centerCircle
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true); // cirX
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true); // cirXL
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // cirY
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // cirYT
|
||||||
|
|
||||||
if (shape_ == 0) { // 0 = Ellipse
|
if (shape_ == 0) { // 0 = Ellipse
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // shape_ellipse
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true); // shape_ellipse
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // shape_rectangle
|
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 + 1)->setActive(true); // shape_ellipse
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // shape_rectangle
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||||
} else { // 1 = Rectangle
|
} else { // 1 = Rectangle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // shape_ellipse
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // shape_rectangle
|
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 + 1)->setActive(false); // shape_ellipse
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // shape_rectangle
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true); // shape_rectangle
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(false); // centerCircle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false); // cirX
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false); // cirXL
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // cirY
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // cirYT
|
||||||
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(false); // centerCircle
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false); // cirX
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false); // cirXL
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // cirY
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // cirYT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1285,27 +1287,27 @@ CursorShape ControlSpotPanel::getCursor(int objectID) const
|
|||||||
int rem_ = objectID % 7;
|
int rem_ = objectID % 7;
|
||||||
|
|
||||||
switch (rem_) {
|
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;
|
return CSMove1DH;
|
||||||
|
|
||||||
case (1): // LocXL: (curveid_ - 1) * 7 + 1
|
case (4): // cirXL: (curveid_ - 1) * 7 + 4
|
||||||
return CSMove1DH;
|
return CSMove1DH;
|
||||||
|
|
||||||
case (2): // LocY: (curveid_ - 1) * 7 + 2
|
case (5): // cirY: (curveid_ - 1) * 7 + 5
|
||||||
return CSMove1DV;
|
return CSMove1DV;
|
||||||
|
|
||||||
case (3): // LocYT: (curveid_ - 1) * 7 + 3
|
case (6): // cirYT: (curveid_ - 1) * 7 + 6
|
||||||
return CSMove1DV;
|
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:
|
default:
|
||||||
return CSHandOpen;
|
return CSHandOpen;
|
||||||
}
|
}
|
||||||
@@ -1370,65 +1372,61 @@ bool ControlSpotPanel::mouseOver(int modifierKey)
|
|||||||
|
|
||||||
const int method = shapeMethod_->get_active_row_number();
|
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
|
// 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 + 4)->state = Geometry::PRELIGHT;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::PRELIGHT;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::PRELIGHT;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 6)->state = Geometry::PRELIGHT;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 6)->state = Geometry::PRELIGHT;
|
||||||
} else {
|
} 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 + 4)->state = Geometry::NORMAL;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::NORMAL;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::NORMAL;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 6)->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_;
|
lastObject_ = object_;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1492,8 +1490,24 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
|||||||
int method = shapeMethod_->get_active_row_number();
|
int method = shapeMethod_->get_active_row_number();
|
||||||
Coord* newCoord = new Coord(provider->posImage.x + provider->deltaImage.x, provider->posImage.y + provider->deltaImage.y);
|
Coord* newCoord = new Coord(provider->posImage.x + provider->deltaImage.x, provider->posImage.y + provider->deltaImage.y);
|
||||||
|
|
||||||
// LocX
|
// Circle, Ellipses and Rectangle
|
||||||
if (rem == 0) {
|
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);
|
double deltaX = (double (newCoord->x) - double (lastCoord_->x)) * 2000. / double (imW);
|
||||||
locX_->setValue(locX_->getValue() + deltaX);
|
locX_->setValue(locX_->getValue() + deltaX);
|
||||||
row[spots_.locX] = (int) locX_->getValue();
|
row[spots_.locX] = (int) locX_->getValue();
|
||||||
@@ -1512,8 +1526,8 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocXL
|
// cirXL
|
||||||
if (rem == 1) {
|
if (rem == 4) {
|
||||||
double deltaXL = (double (lastCoord_->x) - double (newCoord->x)) * 2000. / double (imW);
|
double deltaXL = (double (lastCoord_->x) - double (newCoord->x)) * 2000. / double (imW);
|
||||||
locXL_->setValue(locXL_->getValue() + deltaXL);
|
locXL_->setValue(locXL_->getValue() + deltaXL);
|
||||||
row[spots_.locXL] = (int) locXL_->getValue();
|
row[spots_.locXL] = (int) locXL_->getValue();
|
||||||
@@ -1532,8 +1546,8 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocY
|
// cirY
|
||||||
if (rem == 2) {
|
if (rem == 5) {
|
||||||
double deltaY = (double (newCoord->y) - double (lastCoord_->y)) * 2000. / double (imH);
|
double deltaY = (double (newCoord->y) - double (lastCoord_->y)) * 2000. / double (imH);
|
||||||
locY_->setValue(locY_->getValue() + deltaY);
|
locY_->setValue(locY_->getValue() + deltaY);
|
||||||
row[spots_.locY] = (int) locY_->getValue();
|
row[spots_.locY] = (int) locY_->getValue();
|
||||||
@@ -1552,8 +1566,8 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocYT
|
// cirYT
|
||||||
if (rem == 3) {
|
if (rem == 6) {
|
||||||
double deltaYT = (double (lastCoord_->y) - double (newCoord->y)) * 2000. / double (imH);
|
double deltaYT = (double (lastCoord_->y) - double (newCoord->y)) * 2000. / double (imH);
|
||||||
locYT_->setValue(locYT_->getValue() + deltaYT);
|
locYT_->setValue(locYT_->getValue() + deltaYT);
|
||||||
row[spots_.locYT] = (int) locYT_->getValue();
|
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);
|
lastCoord_->set(newCoord->x, newCoord->y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user