summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5db79ea)
raw | patch | inline | side by side (parent: 5db79ea)
author | bryce <bryce@users.sourceforge.net> | |
Sun, 30 Dec 2007 23:40:41 +0000 (23:40 +0000) | ||
committer | bryce <bryce@users.sourceforge.net> | |
Sun, 30 Dec 2007 23:40:41 +0000 (23:40 +0000) |
Fix trailing whitespace.
index ed2eb62fe286c62ed912ff29128a999ae4855b24..117fbcdb7360bb3c6a41b4cddf80a5413aae253e 100644 (file)
}
}
-Glib::ustring
+Glib::ustring
Effect::getName()
{
if (lpeobj->effecttype_set && lpeobj->effecttype < INVALID_LPE)
index 98cb746c5f1d41327429195d316583e2dbdc0f34..964bcd12b256fcb2807d90b95254ce5a216da8c8 100644 (file)
protected:
Effect(LivePathEffectObject *lpeobject);
- // provide a set of doEffect functions so the developer has a choice
+ // provide a set of doEffect functions so the developer has a choice
// of what kind of input/output parameters he desires.
- // the order in which they appear is the order in which they are
+ // the order in which they appear is the order in which they are
// called by this base class. (i.e. doEffect(SPCurve * curve) defaults to calling
// doEffect(std::vector<Geom::Path> )
virtual NArtBpath *
doEffect_nartbpath (NArtBpath * path_in);
- virtual std::vector<Geom::Path>
+ virtual std::vector<Geom::Path>
doEffect_path (std::vector<Geom::Path> & path_in);
- virtual Geom::Piecewise<Geom::D2<Geom::SBasis> >
+ virtual Geom::Piecewise<Geom::D2<Geom::SBasis> >
doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > & pwd2_in);
void registerParameter(Parameter * param);
int oncanvasedit_it;
- Inkscape::UI::Widget::Registry wr;
+ Inkscape::UI::Widget::Registry wr;
Gtk::VBox * vbox;
Gtk::Tooltips * tooltips;
index 2fdc0116e2129c0f8e7929ab90e0d3c0fe809807..85eee66f9cbd3710d416096dbcfe807926e18554 100644 (file)
double pitch_diameter() {return (_number_of_teeth * _module) / M_PI;}
double pitch_radius() {return pitch_diameter() / 2.0;}
void pitch_radius(double R) {_module = (2 * M_PI * R) / _number_of_teeth;}
-
+
// base circle serves as the basis for the involute toothe profile
double base_diameter() {return pitch_diameter() * cos(_pressure_angle);}
double base_radius() {return base_diameter() / 2.0;}
-
+
// diametrical pitch
double diametrical_pitch() {return _number_of_teeth / pitch_diameter();}
-
+
// height of the tooth above the pitch circle
double addendum() {return 1.0 / diametrical_pitch();}
// depth of the tooth below the pitch circle
double dedendum() {return addendum() + _clearance;}
-
+
// root circle specifies the bottom of the fillet between teeth
double root_radius() {return pitch_radius() - dedendum();}
double root_diameter() {return root_radius() * 2.0;}
-
+
// outer circle is the outside diameter of the gear
double outer_radius() {return pitch_radius() + addendum();}
double outer_diameter() {return outer_radius() * 2.0;}
-
+
// angle covered by the tooth on the pitch circle
double tooth_thickness_angle() {return M_PI / _number_of_teeth;}
-
+
Geom::Point centre() {return _centre;}
void centre(Geom::Point c) {_centre = c;}
-
+
double angle() {return _angle;}
void angle(double a) {_angle = a;}
-
+
int number_of_teeth() {return _number_of_teeth;}
-
+
Geom::Path path();
Gear spawn(Geom::Point p);
-
+
Gear(int n, double m, double phi) {
_number_of_teeth = n;
_module = m;
D2<SBasis> B;
D2<SBasis> I;
Linear bo = Linear(start,stop);
-
+
B[0] = cos(bo,2);
B[1] = sin(bo,2);
-
+
I = B - Linear(0,1) * derivative(B);
I = I*base_radius() + _centre;
return I;
D2<SBasis> _arc(double start, double stop, double R) {
D2<SBasis> B;
Linear bo = Linear(start,stop);
-
+
B[0] = cos(bo,2);
B[1] = sin(bo,2);
-
+
B = B*R + _centre;
return B;
}
Geom::Path Gear::path() {
Geom::Path pb;
-
+
// angle covered by a full tooth and fillet
double tooth_rotation = 2.0 * tooth_thickness_angle();
// angle covered by an involute
double root_advance = (tooth_rotation - tip_advance) - (2.0 * involute_advance);
// begin drawing the involute at t if the root circle is larger than the base circle
double involute_t = involute_swath_angle(root_radius())/involute_swath_angle(outer_radius());
-
+
//rewind angle to start drawing from the leading edge of the tooth
double first_tooth_angle = _angle - ((0.5 * tip_advance) + involute_advance);
-
+
Geom::Point prev;
for (int i=0; i < _number_of_teeth; i++)
{
prev = leading_end;
pb.appendNew<LineSegment>(leading_end);
}
-
+
D2<SBasis> root = _arc(cursor, cursor+root_advance, root_radius());
makeContinuous(root, prev);
pb.append(SBasisCurve(root));
cursor += root_advance;
prev = root.at1();
-
+
if (base_radius() > root_radius()) {
Geom::Point trailing_start = root.at1();
Geom::Point trailing_end = (base_radius() * unit_vector(trailing_start - _centre)) + _centre;
prev = trailing_end;
}
}
-
+
return pb;
}
teeth(_("Teeth"), _("The number of teeth"), "teeth", &wr, this, 10),
phi(_("Phi"), _("???"), "phi", &wr, this, 5)
{
+ teeth.param_make_integer();
+ teeth.param_set_range(3, NR_HUGE);
registerParameter( dynamic_cast<Parameter *>(&teeth) );
registerParameter( dynamic_cast<Parameter *>(&phi) );
}
index 9ee7faae433d67200b32681dfc232d82707658a7..500578db464a75fd1cdfed451b29cb7b7abae47e 100644 (file)
}
void
-ScalarParam::param_set_default()
+ScalarParam::param_set_default()
{
param_set_value(defvalue);
}
void
-ScalarParam::param_set_value(gdouble val)
+ScalarParam::param_set_value(gdouble val)
{
value = val;
if (integer)
}
void
-ScalarParam::param_set_range(gdouble min, gdouble max)
+ScalarParam::param_set_range(gdouble min, gdouble max)
{
this->min = min;
this->max = max;
if (rsu)
- rsu->getS()->setRange(min, max);
+ rsu->getS()->setRange(this->min, this->max);
param_set_value(value); // reset value to see whether it is in ranges
}
rsu->setValue(value);
rsu->getS()->setDigits(digits);
rsu->getS()->setIncrements(inc_step, inc_page);
+ rsu->getS()->setRange(min, max);
rsu->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change scalar parameter"));
}
index 4b1c2a5f80397a196800f6c627ae74322fbe7a11..aac9ff25ce8c47b50f5ed310a65aa90c569bde89 100644 (file)
RegisteredScalar::~RegisteredScalar()
{
- if (_widget)
+ if (_widget)
delete _widget;
_value_changed_connection.disconnect();
}
void
-RegisteredScalar::init ( const Glib::ustring& label, const Glib::ustring& tip,
+RegisteredScalar::init ( const Glib::ustring& label, const Glib::ustring& tip,
const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in,
SPDocument * doc_in )
{
index 33d7c29cd1314997a5e82d9f3c81b65ff52336c5..90fb449831ac3c4c4cd74c9081750720a6f5b01c 100644 (file)
/** \file
- * \brief
+ * \brief
*
* Authors:
* Ralf Stephan <ralf@ark.in-berlin.de>
Gtk::ToggleButton *_button;
std::list<Gtk::ToggleButton*> _slavebuttons;
-
+
// a slave button is only sensitive when the master button is active
// i.e. a slave button is greyed-out when the master button is not checked
-
+
void setSlaveButton(std::list<Gtk::ToggleButton*> btns) {
_slavebuttons = btns;
}
- bool setProgrammatically; // true if the value was set by setValue, not changed by the user;
+ bool setProgrammatically; // true if the value was set by setValue, not changed by the user;
// if a callback checks it, it must reset it back to false
public:
RegisteredScalarUnit();
~RegisteredScalarUnit();
- void init (const Glib::ustring& label,
- const Glib::ustring& tip,
- const Glib::ustring& key,
+ void init (const Glib::ustring& label,
+ const Glib::ustring& tip,
+ const Glib::ustring& key,
const RegisteredUnitMenu &rum,
Registry& wr,
Inkscape::XML::Node* repr_in,
SPDocument *doc_in);
- inline void init ( const Glib::ustring& label,
- const Glib::ustring& tip,
- const Glib::ustring& key,
+ inline void init ( const Glib::ustring& label,
+ const Glib::ustring& tip,
+ const Glib::ustring& key,
const RegisteredUnitMenu &rum,
Registry& wr)
{ init(label, tip, key, rum, wr, NULL, NULL); };
public:
RegisteredScalar();
~RegisteredScalar();
- void init (const Glib::ustring& label,
- const Glib::ustring& tip,
- const Glib::ustring& key,
+ void init (const Glib::ustring& label,
+ const Glib::ustring& tip,
+ const Glib::ustring& key,
Registry& wr,
Inkscape::XML::Node* repr_in,
SPDocument *doc_in);
- inline void init ( const Glib::ustring& label,
- const Glib::ustring& tip,
- const Glib::ustring& key,
+ inline void init ( const Glib::ustring& label,
+ const Glib::ustring& tip,
+ const Glib::ustring& key,
Registry& wr)
{ init(label, tip, key, wr, NULL, NULL); };