lpe-fillet-chamfer.cpp revision cd2b6231b76bbcbbf6b882bf9321b0675de202b1
/*
* Author(s):
* Jabiertxo Arraiza Cenoz <jabier.arraiza@marker.es>
*
* Copyright (C) 2014 Author(s)
*
* Special thanks to Johan Engelen for the base of the effect -powerstroke-
* Also to ScislaC for point me to the idea
* Also su_v for his construvtive feedback and time
* Also to Mc- (IRC nick) for his important contribution to find real time
* values based on
* and finaly to Liam P. White for his big help on coding, that save me a lot of hours
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-fillet-chamfer.h"
#include "desktop.h"
#include "helper/geom-nodetype.h"
#include "live_effects/parameter/filletchamferpointarray.h"
// for programmatically updating knots
#include "selection.h"
#include "tools-switch.h"
#include "ui/tool/control-point-selection.h"
#include "ui/tool/selectable-control-point.h"
#include "ui/tools/node-tool.h"
// TODO due to internal breakage in glibmm headers, this must be last:
using namespace Geom;
namespace Inkscape {
namespace LivePathEffect {
const double tolerance = 0.001;
const double gapHelper = 0.00001;
ignore_radius_0(_("Ignore 0 radius knots"), _("Ignore 0 radius knots"), "ignore_radius_0", &wr, this, false),
only_selected(_("Change only selected nodes"), _("Change only selected nodes"), "only_selected", &wr, this, false),
flexible(_("Flexible radius size (%)"), _("Flexible radius size (%)"), "flexible", &wr, this, false),
helper_size(_("Helper size with direction"), _("Helper size with direction"), "helper_size", &wr, this, 0)
{
}
LPEFilletChamfer::~LPEFilletChamfer() {}
{
// use manage here, because after deletion of Effect object, others might
// still be pointing to this widget.
vbox->set_homogeneous(false);
if ((*it)->widget_is_visible) {
Inkscape::UI::Widget::Scalar *widgRegistered = Gtk::manage(dynamic_cast<Inkscape::UI::Widget::Scalar *>(widg));
widgRegistered->signal_value_changed().connect(sigc::mem_fun(*this, &LPEFilletChamfer::updateFillet));
if (widg) {
}
Inkscape::UI::Widget::Scalar *widgRegistered = Gtk::manage(dynamic_cast<Inkscape::UI::Widget::Scalar *>(widg));
widgRegistered->signal_value_changed().connect(sigc::mem_fun(*this, &LPEFilletChamfer::refreshKnots));
}
if (widg) {
if (tip) {
} else {
widg->set_has_tooltip(false);
}
}
}
++it;
}
return vbox;
}
void LPEFilletChamfer::toggleHide()
{
if (hide_knots) {
} else {
}
}
refreshKnots();
}
void LPEFilletChamfer::toggleFlexFixed()
{
unsigned int i = 0;
if (flexible) {
(*point_it)[Y]));
} else {
(*point_it)[Y]));
}
i++;
}
if (flexible) {
} else {
}
}
void LPEFilletChamfer::updateFillet()
{
double power = 0;
if (!flexible) {
} else {
}
}
void LPEFilletChamfer::fillet()
{
}
void LPEFilletChamfer::inverse()
{
}
void LPEFilletChamfer::chamfer()
{
}
void LPEFilletChamfer::doubleChamfer()
{
}
void LPEFilletChamfer::refreshKnots()
{
}
}
{
++i) {
return true;
}
}
}
return false;
}
{
for (Inkscape::UI::ControlPointSelection::Set::iterator i = selection.begin(); i != selection.end(); ++i) {
if ((*i)->selected()) {
}
}
}
int counter = 0;
int pathCounter = 0;
continue;
}
}
double powerend = 0;
while (curve_it1 != curve_endit) {
if (power > 0) {
}
}
if (filletChamferData[counter][Y] == 0) {
}
}
++curve_it1;
++curve_it2;
counter++;
pathCounter++;
}
}
}
{
if ((*i)->selected()) {
}
}
}
int counter = 0;
for (PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) {
int pathCounter = 0;
continue;
}
}
while (curve_it1 != curve_endit) {
bool toggle = true;
if (filletChamferData[counter][Y] == 0 ||
(only_selected &&
toggle = false;
}
if (toggle) {
} else {
}
++curve_it1;
if (curve_it2 != curve_endit) {
++curve_it2;
}
counter++;
pathCounter++;
}
}
}
{
if (SP_IS_SHAPE(lpeItem)) {
for (PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) {
continue;
// the closing line segment is always of type
// Geom::LineSegment.
// closingline.isDegenerate() did not work, because it only checks for
// *exact* zero length, which goes wrong for relative coordinates and
// rounding errors...
// the closing line segment has zero-length. So stop before that one!
}
}
int counter = 0;
while (curve_it1 != curve_endit) {
if (counter == 0) {
} else {
}
} else {
}
} else {
}
++curve_it1;
if (curve_it2 != curve_endit) {
++curve_it2;
}
counter++;
}
}
} else {
g_warning("LPE Fillet can only be applied to shapes (not groups).");
}
}
{
if (SP_IS_SHAPE(lpeItem)) {
SPCurve *c = SP_IS_PATH(lpeItem) ? static_cast<SPPath const *>(lpeItem)->get_original_curve() : SP_SHAPE(lpeItem)->getCurve();
filletChamferData.size()) {
}
} else {
g_warning("LPE Fillet can only be applied to shapes (not groups).");
}
}
{
int nKnots = c->nodes_in_path();
nKnots--;
}
}
return nKnots;
}
void
{
.toPwSb());
}
}
{
int counter = 0;
continue;
// the closing line segment is always of type
// Geom::LineSegment.
// closingline.isDegenerate() did not work, because it only checks for
// *exact* zero length, which goes wrong for relative coordinates and
// rounding errors...
// the closing line segment has zero-length. So stop before that one!
}
}
int counterCurves = 0;
while (curve_it1 != curve_endit) {
&intpart);
if (filletChamferData[counter][Y] == 0) {
time_it1 = 0;
}
&intpart);
} else {
&intpart);
}
double resultLenght = 0;
time_it1_B = 1;
} else {
}
if (resultLenght > 0 && time_it2 != 0) {
&intpart);
} else {
if (time_it2 == 0) {
time_it1_B = 1;
} else {
}
}
time_it1_B = 1;
time_it2 = 0;
time_it1_B = 1;
time_it2 = 0;
}
if (time_it1_B < time_it1) {
}
if (counterCurves > 0) {
} else {
}
if (curve_it2 != curve_endit) {
}
if (curve_it2 != curve_endit) {
}
if (cubic1) {
}
if (cubic2) {
}
endArcPoint - startArcPoint) < 0;
if (ccwToggle) {
}
if (ccwToggle) {
}
if (time_it1_B != 1) {
}
if (type == 4) {
}
} else if (type == 2) {
} else {
}
} else {
}
}
++curve_it1;
if (curve_it2 != curve_endit) {
++curve_it2;
}
counter++;
}
}
return pathvector_out;
}
}; //namespace LivePathEffect
}; /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offset:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :