Merge pull request #5262 from Pandagrapher/newlocallab
Improvements on Locallab spot
This commit is contained in:
commit
6a23c48f14
@ -50,10 +50,10 @@ ControlSpotPanel::ControlSpotPanel():
|
|||||||
structexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))),
|
structexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUCCOL"), 0, 100, 1, 0))),
|
||||||
|
|
||||||
struc_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRES"), 1.0, 12.0, 0.1, 4.0))),
|
struc_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRES"), 1.0, 12.0, 0.1, 4.0))),
|
||||||
locX_(Gtk::manage(new Adjuster(M("TP_LOCAL_WIDTH"), 0, 2250, 1, 250))),
|
locX_(Gtk::manage(new Adjuster(M("TP_LOCAL_WIDTH"), 2, 2250, 1, 250))),
|
||||||
locXL_(Gtk::manage(new Adjuster(M("TP_LOCAL_WIDTH_L"), 0, 2250, 1, 250))),
|
locXL_(Gtk::manage(new Adjuster(M("TP_LOCAL_WIDTH_L"), 2, 2250, 1, 250))),
|
||||||
locY_(Gtk::manage(new Adjuster(M("TP_LOCAL_HEIGHT"), 0, 2250, 1, 250))),
|
locY_(Gtk::manage(new Adjuster(M("TP_LOCAL_HEIGHT"), 2, 2250, 1, 250))),
|
||||||
locYT_(Gtk::manage(new Adjuster(M("TP_LOCAL_HEIGHT_T"), 0, 2250, 1, 250))),
|
locYT_(Gtk::manage(new Adjuster(M("TP_LOCAL_HEIGHT_T"), 2, 2250, 1, 250))),
|
||||||
centerX_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CENTER_X"), -1000, 1000, 1, 0))),
|
centerX_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CENTER_X"), -1000, 1000, 1, 0))),
|
||||||
centerY_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CENTER_Y"), -1000, 1000, 1, 0))),
|
centerY_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CENTER_Y"), -1000, 1000, 1, 0))),
|
||||||
circrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CIRCRADIUS"), 2, 150, 1, 18))),
|
circrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CIRCRADIUS"), 2, 150, 1, 18))),
|
||||||
@ -1026,133 +1026,89 @@ 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;
|
||||||
Arcellipse* arc1;
|
Ellipse* shape_ellipse;
|
||||||
arc1 = new Arcellipse();
|
shape_ellipse = new Ellipse();
|
||||||
arc1->innerLineWidth = 0.7;
|
shape_ellipse->datum = Geometry::IMAGE;
|
||||||
arc1->datum = Geometry::IMAGE;
|
shape_ellipse->radiusInImageSpace = true;
|
||||||
arc1->radiusInImageSpace = true;
|
Rectangle* shape_rectangle;
|
||||||
Arcellipse* arc2;
|
shape_rectangle = new Rectangle();
|
||||||
arc2 = new Arcellipse();
|
shape_rectangle->datum = Geometry::IMAGE;
|
||||||
arc2->innerLineWidth = 0.7;
|
EditSubscriber::visibleGeometry.push_back(centerCircle); // (curveid - 1) * 7
|
||||||
arc2->datum = Geometry::IMAGE;
|
EditSubscriber::visibleGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 1
|
||||||
arc2->radiusInImageSpace = true;
|
EditSubscriber::visibleGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 2
|
||||||
Arcellipse* arc3;
|
EditSubscriber::visibleGeometry.push_back(cirX); // (curveid - 1) * 7 + 3
|
||||||
arc3 = new Arcellipse();
|
EditSubscriber::visibleGeometry.push_back(cirXL); // (curveid - 1) * 7 + 4
|
||||||
arc3->innerLineWidth = 0.7;
|
EditSubscriber::visibleGeometry.push_back(cirY); // (curveid - 1) * 7 + 5
|
||||||
arc3->datum = Geometry::IMAGE;
|
EditSubscriber::visibleGeometry.push_back(cirYT); // (curveid - 1) * 7 + 6
|
||||||
arc3->radiusInImageSpace = true;
|
|
||||||
Arcellipse* arc4;
|
|
||||||
arc4 = new Arcellipse();
|
|
||||||
arc4->innerLineWidth = 0.7;
|
|
||||||
arc4->datum = Geometry::IMAGE;
|
|
||||||
arc4->radiusInImageSpace = true;
|
|
||||||
Rectangle* rec;
|
|
||||||
rec = new Rectangle();
|
|
||||||
rec->innerLineWidth = 0.7;
|
|
||||||
rec->datum = Geometry::IMAGE;
|
|
||||||
EditSubscriber::visibleGeometry.push_back(lineX); // (curveid - 1) * 10
|
|
||||||
EditSubscriber::visibleGeometry.push_back(lineXL); // (curveid - 1) * 10 + 1
|
|
||||||
EditSubscriber::visibleGeometry.push_back(lineY); // (curveid - 1) * 10 + 2
|
|
||||||
EditSubscriber::visibleGeometry.push_back(lineYT); // (curveid - 1) * 10 + 3
|
|
||||||
EditSubscriber::visibleGeometry.push_back(centerCircle); // (curveid - 1) * 10 + 4
|
|
||||||
EditSubscriber::visibleGeometry.push_back(arc1); // (curveid - 1) * 10 + 5
|
|
||||||
EditSubscriber::visibleGeometry.push_back(arc2); // (curveid - 1) * 10 + 6
|
|
||||||
EditSubscriber::visibleGeometry.push_back(arc3); // (curveid - 1) * 10 + 7
|
|
||||||
EditSubscriber::visibleGeometry.push_back(arc4); // (curveid - 1) * 10 + 8
|
|
||||||
EditSubscriber::visibleGeometry.push_back(rec); // (curveid - 1) * 10 + 9
|
|
||||||
|
|
||||||
// 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;
|
||||||
arc1 = new Arcellipse();
|
shape_ellipse = new Ellipse();
|
||||||
arc1->innerLineWidth = 0.7;
|
shape_ellipse->datum = Geometry::IMAGE;
|
||||||
arc1->datum = Geometry::IMAGE;
|
shape_ellipse->radiusInImageSpace = true;
|
||||||
arc1->radiusInImageSpace = true;
|
shape_rectangle = new Rectangle();
|
||||||
arc2 = new Arcellipse();
|
shape_rectangle->datum = Geometry::IMAGE;
|
||||||
arc2->innerLineWidth = 0.7;
|
EditSubscriber::mouseOverGeometry.push_back(centerCircle); // (curveid - 1) * 7
|
||||||
arc2->datum = Geometry::IMAGE;
|
EditSubscriber::mouseOverGeometry.push_back(shape_ellipse); // (curveid - 1) * 7 + 1
|
||||||
arc2->radiusInImageSpace = true;
|
EditSubscriber::mouseOverGeometry.push_back(shape_rectangle); // (curveid - 1) * 7 + 2
|
||||||
arc3 = new Arcellipse();
|
EditSubscriber::mouseOverGeometry.push_back(cirX); // (curveid - 1) * 7 + 3
|
||||||
arc3->innerLineWidth = 0.7;
|
EditSubscriber::mouseOverGeometry.push_back(cirXL); // (curveid - 1) * 7 + 4
|
||||||
arc3->datum = Geometry::IMAGE;
|
EditSubscriber::mouseOverGeometry.push_back(cirY); // (curveid - 1) * 7 + 5
|
||||||
arc3->radiusInImageSpace = true;
|
EditSubscriber::mouseOverGeometry.push_back(cirYT); // (curveid - 1) * 7 + 6
|
||||||
arc4 = new Arcellipse();
|
|
||||||
arc4->innerLineWidth = 0.7;
|
|
||||||
arc4->datum = Geometry::IMAGE;
|
|
||||||
arc4->radiusInImageSpace = true;
|
|
||||||
rec = new Rectangle();
|
|
||||||
rec->innerLineWidth = 0.7;
|
|
||||||
rec->datum = Geometry::IMAGE;
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(lineX); // (curveid - 1) * 10
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(lineXL); // (curveid - 1) * 10 + 1
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(lineY); // (curveid - 1) * 10 + 2
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(lineYT); // (curveid - 1) * 10 + 3
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(centerCircle); // (curveid - 1) * 10 + 4
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(arc1); // (curveid - 1) * 10 + 5
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(arc2); // (curveid - 1) * 10 + 6
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(arc3); // (curveid - 1) * 10 + 7
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(arc4); // (curveid - 1) * 10 + 8
|
|
||||||
EditSubscriber::mouseOverGeometry.push_back(rec); // (curveid - 1) * 10 + 9
|
|
||||||
|
|
||||||
row[spots_.curveid] = EditSubscriber::visibleGeometry.size() / 10;
|
row[spots_.curveid] = EditSubscriber::visibleGeometry.size() / 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControlSpotPanel::updateControlSpotCurve(Gtk::TreeModel::Row row)
|
void ControlSpotPanel::updateControlSpotCurve(Gtk::TreeModel::Row row)
|
||||||
{
|
{
|
||||||
const int curveid_ = static_cast<int>(row[spots_.curveid]);
|
const int curveid_ = row[spots_.curveid];
|
||||||
|
EditDataProvider* const dataProvider = getEditProvider();
|
||||||
if (curveid_ == 0) { // Row has no associated curve
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int centerX_ = static_cast<int>(row[spots_.centerX]);
|
|
||||||
const int centerY_ = static_cast<int>(row[spots_.centerY]);
|
|
||||||
const int circrad_ = static_cast<int>(row[spots_.circrad]);
|
|
||||||
const int locX_ = static_cast<int>(row[spots_.locX]);
|
|
||||||
const int locXL_ = static_cast<int>(row[spots_.locXL]);
|
|
||||||
const int locY_ = static_cast<int>(row[spots_.locY]);
|
|
||||||
const int locYT_ = static_cast<int>(row[spots_.locYT]);
|
|
||||||
const int shape_ = static_cast<int>(row[spots_.shape]);
|
|
||||||
const bool isvisible_ = static_cast<bool>(row[spots_.isvisible]);
|
|
||||||
|
|
||||||
// printf("updateControlSpotCurve: %d\n", curveid_);
|
// printf("updateControlSpotCurve: %d\n", curveid_);
|
||||||
|
|
||||||
EditDataProvider* dataProvider = getEditProvider();
|
if (curveid_ == 0 || !dataProvider) { // Row has no associated curve or there is no EditProvider
|
||||||
|
|
||||||
if (!dataProvider) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1160,171 +1116,149 @@ void ControlSpotPanel::updateControlSpotCurve(Gtk::TreeModel::Row row)
|
|||||||
int imH = 0;
|
int imH = 0;
|
||||||
dataProvider->getImageSize(imW, imH);
|
dataProvider->getImageSize(imW, imH);
|
||||||
|
|
||||||
if (!imW || !imH) {
|
if (!imW || !imH) { // No image loaded
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const double decayX = (locX_) * (double (imW)) / 2000.;
|
const int centerX_ = row[spots_.centerX];
|
||||||
const double decayXL = (locXL_) * (double (imW)) / 2000.;
|
const int centerY_ = row[spots_.centerY];
|
||||||
const double decayY = (locY_) * double (imH) / 2000.;
|
const int circrad_ = row[spots_.circrad];
|
||||||
const double decayYT = (locYT_) * double (imH) / 2000.;
|
const int locX_ = row[spots_.locX];
|
||||||
rtengine::Coord origin(imW / 2 + centerX_ * imW / 2000.f, imH / 2 + centerY_ * imH / 2000.f);
|
const int locXL_ = row[spots_.locXL];
|
||||||
|
const int locY_ = row[spots_.locY];
|
||||||
|
const int locYT_ = row[spots_.locYT];
|
||||||
|
const int shape_ = row[spots_.shape];
|
||||||
|
const bool isvisible_ = row[spots_.isvisible];
|
||||||
|
|
||||||
const auto updateLineWithDecay = [&](Geometry * geometry, const float radius, const float decal, const float offSetAngle, const double decay) {
|
const int decayX = locX_ * (imW / 2000);
|
||||||
const auto line = static_cast<Line*>(geometry); // 180
|
const int decayXL = locXL_ * (imW / 2000);
|
||||||
line->begin = PolarCoord(radius, decal) + PolarCoord(decay, offSetAngle);
|
const int decayY = locY_ * (imH / 2000);
|
||||||
line->begin += origin; // 0
|
const int decayYT = locYT_ * (imH / 2000);
|
||||||
line->end = PolarCoord(radius, decal - 180) + PolarCoord(decay, offSetAngle);
|
const rtengine::Coord origin(imW / 2 + centerX_ * imW / 2000, imH / 2 + centerY_ * imH / 2000);
|
||||||
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);
|
const auto circle = static_cast<Circle*>(geometry);
|
||||||
circle->center = origin;
|
circle->center = origin;
|
||||||
circle->radius = circrad_;
|
circle->radius = circrad_;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto updateArcellipse = [&](Geometry * geometry, const double dRad_, const double dRad2_, const double begang_, const double endang_) {
|
const auto updateEllipse = [&](Geometry * geometry) {
|
||||||
const auto arcellipse = static_cast<Arcellipse*>(geometry);
|
const auto ellipse = static_cast<Ellipse*>(geometry);
|
||||||
arcellipse->center = origin;
|
ellipse->center = origin;
|
||||||
arcellipse->begang = begang_;
|
ellipse->radX = decayX;
|
||||||
arcellipse->endang = endang_;
|
ellipse->radXL = decayXL;
|
||||||
arcellipse->radius = dRad_;
|
ellipse->radY = decayY;
|
||||||
arcellipse->radius2 = dRad2_;
|
ellipse->radYT = decayYT;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto updateRectangle = [&](Geometry * geometry) {
|
const auto updateRectangle = [&](Geometry * geometry) {
|
||||||
const auto rectangle = static_cast<Rectangle*>(geometry);
|
const auto rectangle = static_cast<Rectangle*>(geometry);
|
||||||
rectangle->bottomRight.x = origin.x + (int) decayX;
|
rectangle->bottomRight.x = origin.x + decayX;
|
||||||
rectangle->bottomRight.y = origin.y + (int) decayY;
|
rectangle->bottomRight.y = origin.y + decayY;
|
||||||
rectangle->topLeft.x = origin.x - (int) decayXL;
|
rectangle->topLeft.x = origin.x - decayXL;
|
||||||
rectangle->topLeft.y = origin.y - (int) decayYT;
|
rectangle->topLeft.y = origin.y - decayYT;
|
||||||
};
|
};
|
||||||
|
|
||||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 10), 500., 90., 0., decayX);
|
updateCenterCircle(visibleGeometry.at((curveid_ - 1) * 7));
|
||||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 10), 500., 90., 0., decayX);
|
updateCenterCircle(mouseOverGeometry.at((curveid_ - 1) * 7));
|
||||||
|
|
||||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 10 + 1), 500., 90., 180., decayXL);
|
updateEllipse(visibleGeometry.at((curveid_ - 1) * 7 + 1));
|
||||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 10 + 1), 500., 90., 180., decayXL);
|
updateEllipse(mouseOverGeometry.at((curveid_ - 1) * 7 + 1));
|
||||||
|
|
||||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 10 + 2), 500., 180., 90., decayY);
|
updateRectangle(visibleGeometry.at((curveid_ - 1) * 7 + 2));
|
||||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 10 + 2), 500., 180., 90., decayY);
|
updateRectangle(mouseOverGeometry.at((curveid_ - 1) * 7 + 2));
|
||||||
|
|
||||||
updateLineWithDecay(visibleGeometry.at((curveid_ - 1) * 10 + 3), 500., 180., 270., decayYT);
|
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 3), decayX, 0.);
|
||||||
updateLineWithDecay(mouseOverGeometry.at((curveid_ - 1) * 10 + 3), 500., 180., 270., decayYT);
|
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 3), decayX, 0.);
|
||||||
|
|
||||||
updateCircle(visibleGeometry.at((curveid_ - 1) * 10 + 4));
|
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 4), -decayXL, 0.);
|
||||||
updateCircle(mouseOverGeometry.at((curveid_ - 1) * 10 + 4));
|
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 4), -decayXL, 0.);
|
||||||
|
|
||||||
updateArcellipse(visibleGeometry.at((curveid_ - 1) * 10 + 5), decayX, decayYT, 3 * RT_PI_2, 2 * RT_PI);
|
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 5), 0., decayY);
|
||||||
updateArcellipse(visibleGeometry.at((curveid_ - 1) * 10 + 6), decayXL, decayYT, RT_PI, 3 * RT_PI_2);
|
updateSelectionCircle(mouseOverGeometry.at((curveid_ - 1) * 7 + 5), 0., decayY);
|
||||||
updateArcellipse(visibleGeometry.at((curveid_ - 1) * 10 + 7), decayXL, decayY, RT_PI_2, RT_PI);
|
|
||||||
updateArcellipse(visibleGeometry.at((curveid_ - 1) * 10 + 8), decayX, decayY, 0., RT_PI_2);
|
|
||||||
updateArcellipse(mouseOverGeometry.at((curveid_ - 1) * 10 + 5), decayX, decayYT, 3 * RT_PI_2, 2 * RT_PI);
|
|
||||||
updateArcellipse(mouseOverGeometry.at((curveid_ - 1) * 10 + 6), decayXL, decayYT, RT_PI, 3 * RT_PI_2);
|
|
||||||
updateArcellipse(mouseOverGeometry.at((curveid_ - 1) * 10 + 7), decayXL, decayY, RT_PI_2, RT_PI);
|
|
||||||
updateArcellipse(mouseOverGeometry.at((curveid_ - 1) * 10 + 8), decayX, decayY, 0., RT_PI_2);
|
|
||||||
|
|
||||||
updateRectangle(visibleGeometry.at((curveid_ - 1) * 10 + 9));
|
updateSelectionCircle(visibleGeometry.at((curveid_ - 1) * 7 + 6), 0., -decayYT);
|
||||||
updateRectangle(mouseOverGeometry.at((curveid_ - 1) * 10 + 9));
|
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) * 10)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(true); // centerCircle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 1)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true); // cirX
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 2)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true); // cirXL
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 3)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // cirY
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 4)->setActive(true);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(true); // cirYT
|
||||||
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(true); // centerCircle
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 1)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(true); // cirX
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 2)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(true); // cirXL
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 3)->setActive(true);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(true); // cirY
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 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) * 10 + 5)->setActive(true); // arc1
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true); // shape_ellipse
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 6)->setActive(true); // arc2
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 7)->setActive(true); // arc3
|
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 8)->setActive(true); // arc4
|
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false); // rec
|
|
||||||
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 5)->setActive(true); // arc1
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(true); // shape_ellipse
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 6)->setActive(true); // arc2
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 7)->setActive(true); // arc3
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 8)->setActive(true); // arc4
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false); // rec
|
|
||||||
} else { // 1 = Rectangle
|
} else { // 1 = Rectangle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false); // arc1
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false); // arc2
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true); // shape_rectangle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false); // arc3
|
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false); // arc4
|
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 9)->setActive(true); // rec
|
|
||||||
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false); // arc1
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false); // arc2
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(true); // shape_rectangle
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false); // arc3
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false); // arc4
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 9)->setActive(true); // rec
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7)->setActive(false); // centerCircle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 1)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 2)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 3)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false); // cirX
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 4)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false); // cirXL
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // cirY
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false);
|
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // cirYT
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false);
|
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false);
|
|
||||||
EditSubscriber::visibleGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false);
|
|
||||||
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7)->setActive(false); // centerCircle
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 1)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 1)->setActive(false); // shape_ellipse
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 2)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 2)->setActive(false); // shape_rectangle
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 3)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 3)->setActive(false); // cirX
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 4)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 4)->setActive(false); // cirXL
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 5)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 5)->setActive(false); // cirY
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 6)->setActive(false);
|
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 7 + 6)->setActive(false); // cirYT
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 7)->setActive(false);
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 8)->setActive(false);
|
|
||||||
EditSubscriber::mouseOverGeometry.at((curveid_ - 1) * 10 + 9)->setActive(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControlSpotPanel::deleteControlSpotCurve(Gtk::TreeModel::Row row)
|
void ControlSpotPanel::deleteControlSpotCurve(Gtk::TreeModel::Row row)
|
||||||
{
|
{
|
||||||
const int curveid_ = static_cast<int>(row[spots_.curveid]);
|
const int curveid_ = row[spots_.curveid];
|
||||||
|
|
||||||
|
// printf("deleteControlSpotCurve: %d\n", curveid_);
|
||||||
|
|
||||||
if (curveid_ == 0) { // Row has no associated curve
|
if (curveid_ == 0) { // Row has no associated curve
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("deleteControlSpotCurve: %d\n", curveid_);
|
|
||||||
|
|
||||||
// visibleGeometry
|
// visibleGeometry
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 9);
|
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 7 + 6);
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 8);
|
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 7 + 5);
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 7);
|
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 7 + 4);
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 6);
|
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 7 + 3);
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 5);
|
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 7 + 2);
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 4);
|
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 7 + 1);
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 3);
|
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 7);
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 2);
|
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10 + 1);
|
|
||||||
EditSubscriber::visibleGeometry.erase(EditSubscriber::visibleGeometry.begin() + (curveid_ - 1) * 10);
|
|
||||||
|
|
||||||
// mouseOverGeometry
|
// mouseOverGeometry
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 9);
|
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 7 + 6);
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 8);
|
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 7 + 5);
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 7);
|
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 7 + 4);
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 6);
|
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 7 + 3);
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 5);
|
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 7 + 2);
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 4);
|
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 7 + 1);
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 3);
|
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 7);
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 2);
|
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10 + 1);
|
|
||||||
EditSubscriber::mouseOverGeometry.erase(EditSubscriber::mouseOverGeometry.begin() + (curveid_ - 1) * 10);
|
|
||||||
|
|
||||||
row[spots_.curveid] = 0; // Reset associated curve id
|
row[spots_.curveid] = 0; // Reset associated curve id
|
||||||
|
|
||||||
@ -1340,7 +1274,26 @@ void ControlSpotPanel::deleteControlSpotCurve(Gtk::TreeModel::Row row)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CursorShape ControlSpotPanel::getCursor(int objectID)
|
void ControlSpotPanel::updateCurveOpacity(Gtk::TreeModel::Row selectedRow)
|
||||||
|
{
|
||||||
|
const int curveid_ = selectedRow[spots_.curveid];
|
||||||
|
|
||||||
|
// printf("updateCurveOpacity: %d\n", curveid_);
|
||||||
|
|
||||||
|
if (curveid_ == 0) { // Row has no associated curve
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int it_ = 0; it_ < (int) EditSubscriber::visibleGeometry.size(); it_++) {
|
||||||
|
if ((it_ < ((curveid_ - 1) * 7)) || (it_ > ((curveid_ - 1) * 7) + 6)) { // it_ does not belong to selected curve
|
||||||
|
EditSubscriber::visibleGeometry.at(it_)->opacity = 25.;
|
||||||
|
} else {
|
||||||
|
EditSubscriber::visibleGeometry.at(it_)->opacity = 75.;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CursorShape ControlSpotPanel::getCursor(int objectID) const
|
||||||
{
|
{
|
||||||
// printf("Object ID: %d\n", objectID);
|
// printf("Object ID: %d\n", objectID);
|
||||||
|
|
||||||
@ -1350,39 +1303,30 @@ CursorShape ControlSpotPanel::getCursor(int objectID)
|
|||||||
return CSHandOpen;
|
return CSHandOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rem_ = objectID % 10;
|
int rem_ = objectID % 7;
|
||||||
|
|
||||||
switch (rem_) {
|
switch (rem_) {
|
||||||
case (0): // LocX: (curveid_ - 1) * 10
|
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) * 10 + 1
|
case (4): // cirXL: (curveid_ - 1) * 7 + 4
|
||||||
return CSMove1DH;
|
return CSMove1DH;
|
||||||
|
|
||||||
case (2): // LocY: (curveid_ - 1) * 10 + 2
|
case (5): // cirY: (curveid_ - 1) * 7 + 5
|
||||||
return CSMove1DV;
|
return CSMove1DV;
|
||||||
|
|
||||||
case (3): // LocYT: (curveid_ - 1) * 10 + 3
|
case (6): // cirYT: (curveid_ - 1) * 7 + 6
|
||||||
return CSMove1DV;
|
return CSMove1DV;
|
||||||
|
|
||||||
case (4): // centerCircle: (curveid_ - 1) * 10 + 4
|
|
||||||
return CSMove2D;
|
|
||||||
|
|
||||||
case (5): // arc1: (curveid_ - 1) * 10 + 5
|
|
||||||
return CSMove2D;
|
|
||||||
|
|
||||||
case (6): // arc2: (curveid_ - 1) * 10 + 6
|
|
||||||
return CSMove2D;
|
|
||||||
|
|
||||||
case (7): // arc3: (curveid_ - 1) * 10 + 7
|
|
||||||
return CSMove2D;
|
|
||||||
|
|
||||||
case (8): // arc4: (curveid_ - 1) * 10 + 8
|
|
||||||
return CSMove2D;
|
|
||||||
|
|
||||||
case (9): // rec: (curveid_ - 1) * 10 + 9
|
|
||||||
return CSMove2D;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return CSHandOpen;
|
return CSHandOpen;
|
||||||
}
|
}
|
||||||
@ -1424,8 +1368,8 @@ bool ControlSpotPanel::mouseOver(int modifierKey)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int curveId_ = object_ / 10 + 1;
|
int curveId_ = object_ / 7 + 1;
|
||||||
int rem = object_ % 10;
|
int rem = object_ % 7;
|
||||||
|
|
||||||
// Manage mouseOver preview for TreeView
|
// Manage mouseOver preview for TreeView
|
||||||
Gtk::TreeModel::Children children = treemodel_->children();
|
Gtk::TreeModel::Children children = treemodel_->children();
|
||||||
@ -1440,76 +1384,66 @@ bool ControlSpotPanel::mouseOver(int modifierKey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int it_ = 0; it_ < (int) EditSubscriber::visibleGeometry.size(); it_++) {
|
for (int it_ = 0; it_ < (int) EditSubscriber::visibleGeometry.size(); it_++) {
|
||||||
if ((it_ < ((curveId_ - 1) * 10)) || (it_ > ((curveId_ - 1) * 10) + 9)) { // it_ does not belong to cursor pointed curve
|
if ((it_ < ((curveId_ - 1) * 7)) || (it_ > ((curveId_ - 1) * 7) + 6)) { // it_ does not belong to cursor pointed curve
|
||||||
EditSubscriber::visibleGeometry.at(it_)->state = Geometry::NORMAL;
|
EditSubscriber::visibleGeometry.at(it_)->state = Geometry::NORMAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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) * 10)->state = Geometry::PRELIGHT;
|
|
||||||
|
|
||||||
if (method == 1 || method == 3) { // Symmetrical cases
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 1)->state = Geometry::PRELIGHT;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10)->state = Geometry::NORMAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// LocXL
|
|
||||||
if (rem == 1) {
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 1)->state = Geometry::PRELIGHT;
|
|
||||||
|
|
||||||
if (method == 1 || method == 3) { // Symmetrical cases
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10)->state = Geometry::PRELIGHT;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (method == 0 || method == 2) { // Independent cases
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 1)->state = Geometry::NORMAL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// LocY
|
|
||||||
if (rem == 2) {
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 2)->state = Geometry::PRELIGHT;
|
|
||||||
|
|
||||||
if (method == 1 || method == 3) { // Symmetrical cases
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 3)->state = Geometry::PRELIGHT;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 2)->state = Geometry::NORMAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// LocYT
|
|
||||||
if (rem == 3) {
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 3)->state = Geometry::PRELIGHT;
|
|
||||||
|
|
||||||
if (method == 1 || method == 3) { // Symmetrical cases
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 2)->state = Geometry::PRELIGHT;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (method == 0 || method == 2) { // Independent cases
|
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 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) * 10 + 4)->state = Geometry::PRELIGHT;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7)->state = Geometry::PRELIGHT;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 5)->state = Geometry::PRELIGHT;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 1)->state = Geometry::PRELIGHT;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 6)->state = Geometry::PRELIGHT;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 2)->state = Geometry::PRELIGHT;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 7)->state = Geometry::PRELIGHT;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::PRELIGHT;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 8)->state = Geometry::PRELIGHT;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 4)->state = Geometry::PRELIGHT;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 9)->state = Geometry::PRELIGHT;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 5)->state = Geometry::PRELIGHT;
|
||||||
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 6)->state = Geometry::PRELIGHT;
|
||||||
} else {
|
} else {
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 4)->state = Geometry::NORMAL;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7)->state = Geometry::NORMAL;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 5)->state = Geometry::NORMAL;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 2)->state = Geometry::NORMAL;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 6)->state = Geometry::NORMAL;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 3)->state = Geometry::NORMAL;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 7)->state = Geometry::NORMAL;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 4)->state = Geometry::NORMAL;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 8)->state = Geometry::NORMAL;
|
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 7 + 4)->state = Geometry::NORMAL;
|
||||||
EditSubscriber::visibleGeometry.at((curveId_ - 1) * 10 + 9)->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_;
|
lastObject_ = object_;
|
||||||
@ -1531,7 +1465,7 @@ bool ControlSpotPanel::button1Pressed(int modifierKey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Select associated control spot
|
// Select associated control spot
|
||||||
int curveId_ = lastObject_ / 10 + 1;
|
int curveId_ = lastObject_ / 7 + 1;
|
||||||
Gtk::TreeModel::Children children = treemodel_->children();
|
Gtk::TreeModel::Children children = treemodel_->children();
|
||||||
|
|
||||||
for (auto iter = children.begin(); iter != children.end(); iter++) {
|
for (auto iter = children.begin(); iter != children.end(); iter++) {
|
||||||
@ -1571,12 +1505,28 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
|||||||
|
|
||||||
int imW, imH;
|
int imW, imH;
|
||||||
provider->getImageSize(imW, imH);
|
provider->getImageSize(imW, imH);
|
||||||
int rem = lastObject_ % 10;
|
int rem = lastObject_ % 7;
|
||||||
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();
|
||||||
@ -1595,8 +1545,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();
|
||||||
@ -1615,8 +1565,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();
|
||||||
@ -1635,8 +1585,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();
|
||||||
@ -1655,22 +1605,6 @@ bool ControlSpotPanel::drag1(int modifierKey)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Circle, Arcellipses 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;
|
||||||
}
|
}
|
||||||
@ -1783,6 +1717,7 @@ void ControlSpotPanel::setSelectedSpot(int id)
|
|||||||
treeview_.set_cursor(treemodel_->get_path(row));
|
treeview_.set_cursor(treemodel_->get_path(row));
|
||||||
load_ControlSpot_param();
|
load_ControlSpot_param();
|
||||||
updateParamVisibility();
|
updateParamVisibility();
|
||||||
|
updateCurveOpacity(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,8 @@ private:
|
|||||||
void addControlSpotCurve(Gtk::TreeModel::Row row);
|
void addControlSpotCurve(Gtk::TreeModel::Row row);
|
||||||
void updateControlSpotCurve(Gtk::TreeModel::Row row);
|
void updateControlSpotCurve(Gtk::TreeModel::Row row);
|
||||||
void deleteControlSpotCurve(Gtk::TreeModel::Row row);
|
void deleteControlSpotCurve(Gtk::TreeModel::Row row);
|
||||||
CursorShape getCursor(int objectID);
|
void updateCurveOpacity(Gtk::TreeModel::Row selectedRow);
|
||||||
|
CursorShape getCursor(int objectID) const;
|
||||||
bool mouseOver(int modifierKey);
|
bool mouseOver(int modifierKey);
|
||||||
bool button1Pressed(int modifierKey);
|
bool button1Pressed(int modifierKey);
|
||||||
bool button1Released();
|
bool button1Released();
|
||||||
|
@ -74,7 +74,7 @@ void Circle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
cr->set_line_width( getOuterLineWidth() );
|
cr->set_line_width( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord center_ = center;
|
rtengine::Coord center_ = center;
|
||||||
@ -105,7 +105,7 @@ void Circle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb(color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba(color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width( innerLineWidth );
|
cr->set_line_width( innerLineWidth );
|
||||||
@ -197,7 +197,7 @@ void Line::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.0);
|
||||||
cr->set_line_width( getOuterLineWidth() );
|
cr->set_line_width( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord begin_ = begin;
|
rtengine::Coord begin_ = begin;
|
||||||
@ -232,7 +232,7 @@ void Line::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width(innerLineWidth);
|
cr->set_line_width(innerLineWidth);
|
||||||
@ -311,7 +311,7 @@ void Polyline::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
cr->set_line_width( getOuterLineWidth() );
|
cr->set_line_width( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord currPos;
|
rtengine::Coord currPos;
|
||||||
@ -355,7 +355,7 @@ void Polyline::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuff
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width( innerLineWidth );
|
cr->set_line_width( innerLineWidth );
|
||||||
@ -504,7 +504,7 @@ void Rectangle::drawOuterGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuf
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
cr->set_line_width( getOuterLineWidth() );
|
cr->set_line_width( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord tl, br;
|
rtengine::Coord tl, br;
|
||||||
@ -548,7 +548,7 @@ void Rectangle::drawInnerGeometry(Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuf
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width( innerLineWidth );
|
cr->set_line_width( innerLineWidth );
|
||||||
@ -644,7 +644,7 @@ void Rectangle::drawToMOChannel(Cairo::RefPtr<Cairo::Context> &cr, unsigned shor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arcellipse::drawOuterGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
|
void Ellipse::drawOuterGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
|
||||||
{
|
{
|
||||||
if ((flags & F_VISIBLE) && state != INSENSITIVE) {
|
if ((flags & F_VISIBLE) && state != INSENSITIVE) {
|
||||||
RGBColor color;
|
RGBColor color;
|
||||||
@ -655,14 +655,14 @@ void Arcellipse::drawOuterGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOB
|
|||||||
color = outerLineColor;
|
color = outerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
cr->set_line_width ( getOuterLineWidth() );
|
cr->set_line_width ( getOuterLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord center_ = center;
|
rtengine::Coord center_ = center;
|
||||||
double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius)) : double (radius);
|
double radYT_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radYT)) : double (radYT);
|
||||||
double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2);
|
double radY_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radY)) : double (radY);
|
||||||
double begang_ = begang;
|
double radXL_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radXL)) : double (radXL);
|
||||||
double endang_ = endang;
|
double radX_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radX)) : double (radX);
|
||||||
|
|
||||||
if (datum == IMAGE) {
|
if (datum == IMAGE) {
|
||||||
coordSystem.imageCoordToScreen (center.x, center.y, center_.x, center_.y);
|
coordSystem.imageCoordToScreen (center.x, center.y, center_.x, center_.y);
|
||||||
@ -672,27 +672,51 @@ void Arcellipse::drawOuterGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOB
|
|||||||
center_ += objectBuffer->getDataProvider()->posScreen + objectBuffer->getDataProvider()->deltaScreen;
|
center_ += objectBuffer->getDataProvider()->posScreen + objectBuffer->getDataProvider()->deltaScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radius_ > 0 && radius2_ > 0.) {
|
if (radYT_ > 0 && radY_ > 0 && radXL_ > 0 && radX_ > 0) {
|
||||||
|
// To have an ellipse with radius of (radX, radX), a circle of radius 1. shall be twisted with a scale
|
||||||
|
// of radX for x-axis, radY for y-axis
|
||||||
|
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (radX * x, radY * y) in new one
|
||||||
|
// To go back to previous location, center shall be translated to tx = -X * (1 - 1 / radX) in x-axis (x = tx + X)
|
||||||
|
// and ty = -Y * (1 - 1 / radY) in y-axis (y = ty + Y)
|
||||||
cr->save();
|
cr->save();
|
||||||
|
|
||||||
// To have an ellipse with radius of (rad1, rad2), a circle of radius rad1 shall be twisted with a scale
|
// Drawing bottom-right part
|
||||||
// of rad2 / rad1 for y axis
|
cr->scale (radX_, radY_);
|
||||||
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
|
cr->translate(- center_.x * (1 - 1 / radX_), - center_.y * (1 - 1 / radY_));
|
||||||
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
|
cr->arc (center_.x, center_.y, 1.0, 0.0, rtengine::RT_PI_2);
|
||||||
// (Y = rad2 / rad1 * y and y = t + Y)
|
|
||||||
double scale_ = radius2_ / radius_;
|
|
||||||
cr->scale (1., scale_);
|
|
||||||
cr->translate (0., - center_.y * (1 - 1 / scale_));
|
|
||||||
|
|
||||||
cr->arc (center_.x + 0.5, center_.y + 0.5, radius_, begang_, endang_);
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
cr->restore();
|
// Drawing bottom-left part
|
||||||
cr->stroke();
|
cr->scale (radXL_, radY_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radXL_), - center_.y * (1 - 1 / radY_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, rtengine::RT_PI_2, rtengine::RT_PI);
|
||||||
|
cr->scale (radXL_, radY_);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
|
// Drawing top-left part
|
||||||
|
cr->scale (radXL_, radYT_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radXL_), - center_.y * (1 - 1 / radYT_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, rtengine::RT_PI, 3. * rtengine::RT_PI_2);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
|
// Drawing top-right part
|
||||||
|
cr->scale (radX_, radYT_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radX_), - center_.y * (1 - 1 / radYT_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, 3. * rtengine::RT_PI_2, 2. * rtengine::RT_PI);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->stroke ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arcellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
|
void Ellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
|
||||||
{
|
{
|
||||||
if (flags & F_VISIBLE) {
|
if (flags & F_VISIBLE) {
|
||||||
if (state != INSENSITIVE) {
|
if (state != INSENSITIVE) {
|
||||||
@ -704,16 +728,16 @@ void Arcellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOB
|
|||||||
color = innerLineColor;
|
color = innerLineColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_source_rgb (color.getR(), color.getG(), color.getB());
|
cr->set_source_rgba (color.getR(), color.getG(), color.getB(), opacity / 100.);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->set_line_width ( innerLineWidth );
|
cr->set_line_width ( innerLineWidth );
|
||||||
|
|
||||||
rtengine::Coord center_ = center;
|
rtengine::Coord center_ = center;
|
||||||
double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius)) : double (radius);
|
double radYT_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radYT)) : double (radYT);
|
||||||
double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2);
|
double radY_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radY)) : double (radY);
|
||||||
double begang_ = begang;
|
double radXL_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radXL)) : double (radXL);
|
||||||
double endang_ = endang;
|
double radX_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radX)) : double (radX);
|
||||||
|
|
||||||
if (datum == IMAGE) {
|
if (datum == IMAGE) {
|
||||||
coordSystem.imageCoordToScreen (center.x, center.y, center_.x, center_.y);
|
coordSystem.imageCoordToScreen (center.x, center.y, center_.x, center_.y);
|
||||||
@ -724,22 +748,46 @@ void Arcellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOB
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (filled && state != INSENSITIVE) {
|
if (filled && state != INSENSITIVE) {
|
||||||
if (radius_ > 0 && radius2_ > 0.) {
|
if (radYT_ > 0 && radY_ > 0 && radXL_ > 0 && radX_ > 0) {
|
||||||
|
// To have an ellipse with radius of (radX, radX), a circle of radius 1. shall be twisted with a scale
|
||||||
|
// of radX for x-axis, radY for y-axis
|
||||||
|
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (radX * x, radY * y) in new one
|
||||||
|
// To go back to previous location, center shall be translated to tx = -X * (1 - 1 / radX) in x-axis (x = tx + X)
|
||||||
|
// and ty = -Y * (1 - 1 / radY) in y-axis (y = ty + Y)
|
||||||
cr->save();
|
cr->save();
|
||||||
|
|
||||||
// To have an ellipse with radius of (rad1, rad2), a circle of radius rad1 shall be twisted with a scale
|
// Drawing bottom-right part
|
||||||
// of rad2 / rad1 for y axis
|
cr->scale (radX_, radY_);
|
||||||
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
|
cr->translate(- center_.x * (1 - 1 / radX_), - center_.y * (1 - 1 / radY_));
|
||||||
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
|
cr->arc (center_.x, center_.y, 1.0, 0.0, rtengine::RT_PI_2);
|
||||||
// (Y = rad2 / rad1 * y and y = t + Y)
|
|
||||||
double scale_ = radius2_ / radius_;
|
|
||||||
cr->scale (1., scale_);
|
|
||||||
cr->translate (0., - center_.y * (1 - 1 / scale_));
|
|
||||||
|
|
||||||
cr->arc (center_.x + 0.5, center_.y + 0.5, radius_, begang_, endang_);
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
cr->restore();
|
// Drawing bottom-left part
|
||||||
cr->stroke();
|
cr->scale (radXL_, radY_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radXL_), - center_.y * (1 - 1 / radY_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, rtengine::RT_PI_2, rtengine::RT_PI);
|
||||||
|
cr->scale (radXL_, radY_);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
|
// Drawing top-left part
|
||||||
|
cr->scale (radXL_, radYT_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radXL_), - center_.y * (1 - 1 / radYT_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, rtengine::RT_PI, 3. * rtengine::RT_PI_2);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
|
// Drawing top-right part
|
||||||
|
cr->scale (radX_, radYT_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radX_), - center_.y * (1 - 1 / radYT_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, 3. * rtengine::RT_PI_2, 2. * rtengine::RT_PI);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->stroke ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (innerLineWidth > 0.) {
|
if (innerLineWidth > 0.) {
|
||||||
@ -749,22 +797,46 @@ void Arcellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOB
|
|||||||
cr->fill();
|
cr->fill();
|
||||||
}
|
}
|
||||||
} else if (innerLineWidth > 0.) {
|
} else if (innerLineWidth > 0.) {
|
||||||
if (radius_ > 0 && radius2_ > 0.) {
|
if (radYT_ > 0 && radY_ > 0 && radXL_ > 0 && radX_ > 0) {
|
||||||
|
// To have an ellipse with radius of (radX, radX), a circle of radius 1. shall be twisted with a scale
|
||||||
|
// of radX for x-axis, radY for y-axis
|
||||||
|
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (radX * x, radY * y) in new one
|
||||||
|
// To go back to previous location, center shall be translated to tx = -X * (1 - 1 / radX) in x-axis (x = tx + X)
|
||||||
|
// and ty = -Y * (1 - 1 / radY) in y-axis (y = ty + Y)
|
||||||
cr->save();
|
cr->save();
|
||||||
|
|
||||||
// To have an ellipse with radius of (rad1, rad2), a circle of radius rad1 shall be twisted with a scale
|
// Drawing bottom-right part
|
||||||
// of rad2 / rad1 for y axis
|
cr->scale (radX_, radY_);
|
||||||
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
|
cr->translate(- center_.x * (1 - 1 / radX_), - center_.y * (1 - 1 / radY_));
|
||||||
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
|
cr->arc (center_.x, center_.y, 1.0, 0.0, rtengine::RT_PI_2);
|
||||||
// (Y = rad2 / rad1 * y and y = t + Y)
|
|
||||||
double scale_ = radius2_ / radius_;
|
|
||||||
cr->scale (1., scale_);
|
|
||||||
cr->translate (0., - center_.y * (1 - 1 / scale_));
|
|
||||||
|
|
||||||
cr->arc (center_.x + 0.5, center_.y + 0.5, radius_, begang_, endang_);
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
cr->restore();
|
// Drawing bottom-left part
|
||||||
cr->stroke();
|
cr->scale (radXL_, radY_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radXL_), - center_.y * (1 - 1 / radY_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, rtengine::RT_PI_2, rtengine::RT_PI);
|
||||||
|
cr->scale (radXL_, radY_);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
|
// Drawing top-left part
|
||||||
|
cr->scale (radXL_, radYT_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radXL_), - center_.y * (1 - 1 / radYT_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, rtengine::RT_PI, 3. * rtengine::RT_PI_2);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
|
// Drawing top-right part
|
||||||
|
cr->scale (radX_, radYT_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radX_), - center_.y * (1 - 1 / radYT_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, 3. * rtengine::RT_PI_2, 2. * rtengine::RT_PI);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->stroke ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == INSENSITIVE) {
|
if (state == INSENSITIVE) {
|
||||||
@ -784,15 +856,16 @@ void Arcellipse::drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arcellipse::drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short id, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
|
void Ellipse::drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short id, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem)
|
||||||
{
|
{
|
||||||
if (flags & F_HOVERABLE) {
|
if (flags & F_HOVERABLE) {
|
||||||
cr->set_line_width ( getMouseOverLineWidth() );
|
cr->set_line_width ( getMouseOverLineWidth() );
|
||||||
|
|
||||||
rtengine::Coord center_ = center;
|
rtengine::Coord center_ = center;
|
||||||
double radius_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius)) : double (radius);
|
double radYT_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radYT)) : double (radYT);
|
||||||
double radius2_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radius2)) : double (radius2);
|
double radY_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radY)) : double (radY);
|
||||||
double begang_ = begang;
|
double radXL_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radXL)) : double (radXL);
|
||||||
double endang_ = endang;
|
double radX_ = radiusInImageSpace ? coordSystem.scaleValueToCanvas (double (radX)) : double (radX);
|
||||||
|
|
||||||
if (datum == IMAGE) {
|
if (datum == IMAGE) {
|
||||||
coordSystem.imageCoordToCropCanvas (center.x, center.y, center_.x, center_.y);
|
coordSystem.imageCoordToCropCanvas (center.x, center.y, center_.x, center_.y);
|
||||||
@ -802,22 +875,46 @@ void Arcellipse::drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned sh
|
|||||||
center_ += objectBuffer->getDataProvider()->posScreen + objectBuffer->getDataProvider()->deltaScreen;
|
center_ += objectBuffer->getDataProvider()->posScreen + objectBuffer->getDataProvider()->deltaScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radius_ > 0 && radius2_ > 0.) {
|
if (radYT_ > 0 && radY_ > 0 && radXL_ > 0 && radX_ > 0) {
|
||||||
|
// To have an ellipse with radius of (radX, radX), a circle of radius 1. shall be twisted with a scale
|
||||||
|
// of radX for x-axis, radY for y-axis
|
||||||
|
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (radX * x, radY * y) in new one
|
||||||
|
// To go back to previous location, center shall be translated to tx = -X * (1 - 1 / radX) in x-axis (x = tx + X)
|
||||||
|
// and ty = -Y * (1 - 1 / radY) in y-axis (y = ty + Y)
|
||||||
cr->save();
|
cr->save();
|
||||||
|
|
||||||
// To have an ellipse with radius of (rad1, rad2), a circle of radius rad1 shall be twisted with a scale
|
// Drawing bottom-right part
|
||||||
// of rad2 / rad1 for y axis
|
cr->scale (radX_, radY_);
|
||||||
// Center of coordinates (x, y) in previous coordinates system becomes (X, Y) = (x, rad2 / rad1 * y) in new one
|
cr->translate(- center_.x * (1 - 1 / radX_), - center_.y * (1 - 1 / radY_));
|
||||||
// To go back to previous location, center shall be translated to t = -Y * (1 - rad1 / rad2) in y axis
|
cr->arc (center_.x, center_.y, 1.0, 0.0, rtengine::RT_PI_2);
|
||||||
// (Y = rad2 / rad1 * y and y = t + Y)
|
|
||||||
double scale_ = radius2_ / radius_;
|
|
||||||
cr->scale (1., scale_);
|
|
||||||
cr->translate (0., - center_.y * (1 - 1 / scale_));
|
|
||||||
|
|
||||||
cr->arc (center_.x + 0.5, center_.y + 0.5, radius_, begang_, endang_);
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
cr->restore();
|
// Drawing bottom-left part
|
||||||
cr->stroke();
|
cr->scale (radXL_, radY_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radXL_), - center_.y * (1 - 1 / radY_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, rtengine::RT_PI_2, rtengine::RT_PI);
|
||||||
|
cr->scale (radXL_, radY_);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
|
// Drawing top-left part
|
||||||
|
cr->scale (radXL_, radYT_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radXL_), - center_.y * (1 - 1 / radYT_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, rtengine::RT_PI, 3. * rtengine::RT_PI_2);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->save();
|
||||||
|
|
||||||
|
// Drawing top-right part
|
||||||
|
cr->scale (radX_, radYT_);
|
||||||
|
cr->translate(- center_.x * (1 - 1 / radX_), - center_.y * (1 - 1 / radYT_));
|
||||||
|
cr->arc (center_.x, center_.y, 1.0, 3. * rtengine::RT_PI_2, 2. * rtengine::RT_PI);
|
||||||
|
|
||||||
|
cr->restore ();
|
||||||
|
cr->stroke ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filled) {
|
if (filled) {
|
||||||
|
@ -232,6 +232,7 @@ public:
|
|||||||
float innerLineWidth; // ...outerLineWidth = innerLineWidth+2
|
float innerLineWidth; // ...outerLineWidth = innerLineWidth+2
|
||||||
Datum datum;
|
Datum datum;
|
||||||
State state; // set by the Subscriber
|
State state; // set by the Subscriber
|
||||||
|
float opacity; // Percentage of opacity
|
||||||
|
|
||||||
Geometry ();
|
Geometry ();
|
||||||
virtual ~Geometry() {}
|
virtual ~Geometry() {}
|
||||||
@ -322,31 +323,23 @@ public:
|
|||||||
void drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short id, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) override;
|
void drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short id, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Arcellipse : public Geometry
|
class Ellipse : public Geometry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
rtengine::Coord center;
|
rtengine::Coord center;
|
||||||
// rtengine::Coord scalx;
|
int radYT; // Ellipse half-radius for top y-axis
|
||||||
// rtengine::Coord scaly;
|
int radY; // Ellipse half-radius for bottom y-axis
|
||||||
// TODO translax, translay, scalx and scaly are not used
|
int radXL; // Ellipse half-radius for left x-axis
|
||||||
double radius;
|
int radX; // Ellipse half-radius for right x-axis
|
||||||
double radius2;
|
|
||||||
double translax;
|
|
||||||
double translay;
|
|
||||||
double scalx;
|
|
||||||
double scaly;
|
|
||||||
double begang;
|
|
||||||
double endang;
|
|
||||||
bool filled;
|
bool filled;
|
||||||
bool radiusInImageSpace; /// If true, the radius depend on the image scale; if false, it is a fixed 'screen' size
|
bool radiusInImageSpace; /// If true, the radius depend on the image scale; if false, it is a fixed 'screen' size
|
||||||
|
|
||||||
Arcellipse ();
|
Ellipse ();
|
||||||
Arcellipse (rtengine::Coord& center, double radius, double radius2, double translax, double translay, double scalx, double scaly, double begang, double endang, bool filled = false, bool radiusInImageSpace = false);
|
Ellipse (rtengine::Coord& center, int radYT, int radY, int radXL, int radX, bool filled = false, bool radiusInImageSpace = false);
|
||||||
Arcellipse (int centerX, int centerY, double radius, double radius2, double translax, double translay, double scalx, double scaly, double begang, double endang, bool filled = false, bool radiusInImageSpace = false);
|
|
||||||
|
|
||||||
void drawOuterGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem);
|
void drawOuterGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) override;
|
||||||
void drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem);
|
void drawInnerGeometry (Cairo::RefPtr<Cairo::Context> &cr, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) override;
|
||||||
void drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short id, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem);
|
void drawToMOChannel (Cairo::RefPtr<Cairo::Context> &cr, unsigned short id, ObjectMOBuffer *objectBuffer, EditCoordSystem &coordSystem) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OPIcon : public Geometry // OP stands for "On Preview"
|
class OPIcon : public Geometry // OP stands for "On Preview"
|
||||||
@ -501,7 +494,7 @@ inline Geometry::Geometry () :
|
|||||||
innerLineColor (char (255), char (255), char (255)), outerLineColor (
|
innerLineColor (char (255), char (255), char (255)), outerLineColor (
|
||||||
char (0), char (0), char (0)), flags (
|
char (0), char (0), char (0)), flags (
|
||||||
F_VISIBLE | F_HOVERABLE | F_AUTO_COLOR), innerLineWidth (1.5f), datum (
|
F_VISIBLE | F_HOVERABLE | F_AUTO_COLOR), innerLineWidth (1.5f), datum (
|
||||||
IMAGE), state (NORMAL) {
|
IMAGE), state (NORMAL), opacity(100.) {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline RGBAColor::RGBAColor () :
|
inline RGBAColor::RGBAColor () :
|
||||||
@ -545,9 +538,8 @@ inline Line::Line () :
|
|||||||
begin (10, 10), end (100, 100) {
|
begin (10, 10), end (100, 100) {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Arcellipse::Arcellipse () :
|
inline Ellipse::Ellipse () :
|
||||||
center (100, 100), radius (10), radius2 (10), translax (0), translay (0), filled (false), radiusInImageSpace (
|
center (100, 100), radYT (5), radY (5), radXL (10), radX (10), filled (false), radiusInImageSpace (false) {
|
||||||
false) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Circle::Circle (rtengine::Coord& center, int radius, bool filled,
|
inline Circle::Circle (rtengine::Coord& center, int radius, bool filled,
|
||||||
@ -570,17 +562,10 @@ inline Line::Line (int beginX, int beginY, int endX, int endY) :
|
|||||||
begin (beginX, beginY), end (endX, endY) {
|
begin (beginX, beginY), end (endX, endY) {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Arcellipse::Arcellipse (rtengine::Coord& center, double radius, double radius2, double translax, double translay, double scalx, double scaly, double begang, double endang, bool filled,
|
inline Ellipse::Ellipse (rtengine::Coord& center, int radYT, int radY, int radXL, int radX,
|
||||||
bool radiusInImageSpace) :
|
bool filled, bool radiusInImageSpace) :
|
||||||
center (center), radius (radius), radius2 (radius2), translax (translax), translay (translay), scalx (scalx), scaly (scaly), begang (begang), endang (endang), filled (filled), radiusInImageSpace (
|
center (center), radYT (radYT), radY (radY), radXL (radXL), radX (radX), filled (filled),
|
||||||
radiusInImageSpace) {
|
radiusInImageSpace (radiusInImageSpace) {
|
||||||
}
|
|
||||||
|
|
||||||
inline Arcellipse::Arcellipse (int centerX, int centerY, double radius, double radius2, double translax, double translay, double scalx, double scaly, double begang, double endang, bool filled,
|
|
||||||
bool radiusInImageSpace) :
|
|
||||||
center (centerX, centerY), radius (radius), radius2 (radius2), translax (translax), translay (translay), scalx (scalx), scaly (scaly), begang (begang), endang (endang), filled (filled), radiusInImageSpace (
|
|
||||||
radiusInImageSpace) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ void ToolBar::setTool (ToolMode tool)
|
|||||||
ConnectionBlocker cropBlocker(cropConn);
|
ConnectionBlocker cropBlocker(cropConn);
|
||||||
ConnectionBlocker wbWasBlocked(wbTool, wbConn), cpWasBlocked(colPickerTool, cpConn);
|
ConnectionBlocker wbWasBlocked(wbTool, wbConn), cpWasBlocked(colPickerTool, cpConn);
|
||||||
|
|
||||||
stopEdit = tool == TMHand && handTool->get_active() && editingMode;
|
stopEdit = tool == TMHand && handTool->get_active() && editingMode && !blockEdit;
|
||||||
|
|
||||||
handTool->set_active (false);
|
handTool->set_active (false);
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ void ToolBar::hand_pressed ()
|
|||||||
ConnectionBlocker cropBlocker(cropConn);
|
ConnectionBlocker cropBlocker(cropConn);
|
||||||
ConnectionBlocker wbWasBlocked(wbTool, wbConn), cpWasBlocked(colPickerTool, cpConn);
|
ConnectionBlocker wbWasBlocked(wbTool, wbConn), cpWasBlocked(colPickerTool, cpConn);
|
||||||
|
|
||||||
if (editingMode) {
|
if (editingMode && !blockEdit) {
|
||||||
stopEditMode();
|
stopEditMode();
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listener->editModeSwitchedOff ();
|
listener->editModeSwitchedOff ();
|
||||||
@ -289,7 +289,7 @@ void ToolBar::colPicker_pressed (GdkEventButton* event)
|
|||||||
|
|
||||||
if (current != TMColorPicker) {
|
if (current != TMColorPicker) {
|
||||||
// Disabling all other tools, enabling the Picker tool and entering the "visible pickers" mode
|
// Disabling all other tools, enabling the Picker tool and entering the "visible pickers" mode
|
||||||
if (editingMode) {
|
if (editingMode && !blockEdit) {
|
||||||
stopEditMode();
|
stopEditMode();
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listener->editModeSwitchedOff ();
|
listener->editModeSwitchedOff ();
|
||||||
|
@ -64,6 +64,7 @@ protected:
|
|||||||
ToolMode current;
|
ToolMode current;
|
||||||
bool allowNoTool;
|
bool allowNoTool;
|
||||||
bool editingMode; // true if the cursor is being used to remotely edit tool's values
|
bool editingMode; // true if the cursor is being used to remotely edit tool's values
|
||||||
|
bool blockEdit; // true if edit tool shoudn't be disabled when pressing hand button or h/H key
|
||||||
sigc::connection handConn;
|
sigc::connection handConn;
|
||||||
sigc::connection wbConn;
|
sigc::connection wbConn;
|
||||||
sigc::connection cpConn;
|
sigc::connection cpConn;
|
||||||
@ -98,6 +99,11 @@ public:
|
|||||||
|
|
||||||
bool handleShortcutKey (GdkEventKey* event);
|
bool handleShortcutKey (GdkEventKey* event);
|
||||||
void setBatchMode();
|
void setBatchMode();
|
||||||
|
|
||||||
|
void blockEditDeactivation(bool cond = true)
|
||||||
|
{
|
||||||
|
blockEdit = cond;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -281,8 +281,10 @@ void ToolPanelCoordinator::notebookPageChanged(Gtk::Widget* page, guint page_num
|
|||||||
// segfault) and locallab panel is active
|
// segfault) and locallab panel is active
|
||||||
if (photoLoadedOnce) {
|
if (photoLoadedOnce) {
|
||||||
if (page == locallabPanelSW) {
|
if (page == locallabPanelSW) {
|
||||||
|
toolBar->blockEditDeactivation(); // Avoid edit tool deactivation when Locallab page is active (except if pressing other tools button)
|
||||||
locallab->subscribe();
|
locallab->subscribe();
|
||||||
} else {
|
} else {
|
||||||
|
toolBar->blockEditDeactivation(false);
|
||||||
locallab->unsubscribe();
|
locallab->unsubscribe();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user