lpe-copy_rotate.cpp revision ed09274e7a7dd6549fef7933d703f8ed20db975d
/** \file
* LPE <copy_rotate> implementation
*/
/*
* Authors:
* Maximilian Albert <maximilian.albert@gmail.com>
* Johan Engelen <j.b.c.engelen@alumnus.utwente.nl>
*
* Copyright (C) Authors 2007-2012
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-copy_rotate.h"
#include "sp-shape.h"
#include <cmath>
#include "knot-holder-entity.h"
#include "knotholder.h"
namespace Inkscape {
namespace LivePathEffect {
namespace CR {
class KnotHolderEntityStartingAngle : public LPEKnotHolderEntity {
public:
};
} // namespace CR
rotation_angle(_("Rotation angle:"), _("Angle between two successive copies"), "rotation_angle", &wr, this, 30.0),
num_copies(_("Number of copies:"), _("Number of copies of the original path"), "num_copies", &wr, this, 5),
copiesTo360(_("360º Copies"), _("No rotation angle, fixed to 360º"), "copiesTo360", &wr, this, true),
origin(_("Origin"), _("Origin of the rotation"), "origin", &wr, this, "Adjust the origin of the rotation"),
dist_angle_handle(100)
{
show_orig_path = true;
_provides_knotholder_entities = true;
// register all your parameters here, so Inkscape knows which parameters this effect has:
num_copies.param_make_integer(true);
}
{
}
void
{
using namespace Geom;
origin.param_setValue(A);
dir = unit_vector(B - A);
dist_angle_handle = L2(B - A);
}
{
using namespace Geom;
// I first suspected the minus sign to be a bug in 2geom but it is
// likely due to SVG's choice of coordinate system orientation (max)
double rotation_angle_end = rotation_angle;
if(copiesTo360){
}
rot_pos = origin + dir * Rotate(-deg_to_rad(starting_angle + rotation_angle_end)) * dist_angle_handle;
A = pwd2_in.firstValue();
dir = unit_vector(B - A);
if(fusionPaths){
// I first suspected the minus sign to be a bug in 2geom but it is
// likely due to SVG's choice of coordinate system orientation (max)
for (Geom::PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) {
continue;
}
bool end_open = false;
double timeStart = 0.0;
int position = 0;
end_open = true;
}
}
}
//for (int i = 0; i < num_copies; ++i) {
if(reverseFusion){
position *= -1;
}
if(position == 1){
for (int i = 0; i < num_copies; ++i) {
}
if(i!=0){
}
}
}
if(reverseFusion){
position *= -1;
}
for (int i = 0; i < num_copies; ++i) {
}
} else {
} else {
}
}
}
}
for (int i = 0; i < num_copies; ++i) {
// I first suspected the minus sign to be a bug in 2geom but it is
// likely due to SVG's choice of coordinate system orientation (max)
}
}
}
} else {
for (int i = 0; i < num_copies; ++i) {
// I first suspected the minus sign to be a bug in 2geom but it is
// likely due to SVG's choice of coordinate system orientation (max)
}
}
return output;
}
void
LPECopyRotate::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec)
{
using namespace Geom;
}
void LPECopyRotate::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
{
_("Adjust the starting angle") );
knotholder->add(e);
}
};
namespace CR {
using namespace Geom;
void
KnotHolderEntityStartingAngle::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, guint state)
{
// I first suspected the minus sign to be a bug in 2geom but it is
// likely due to SVG's choice of coordinate system orientation (max)
if (state & GDK_SHIFT_MASK) {
} else {
}
// FIXME: this should not directly ask for updating the item. It should write to SVG, which triggers updating.
}
KnotHolderEntityStartingAngle::knot_get() const
{
}
} // namespace CR
/* ######################## */
} //namespace LivePathEffect
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((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 :