/**
* @file
* LPE perspective path effect implementation.
*/
/* Authors:
* Maximilian Albert <maximilian.albert@gmail.com>
* Johan Engelen <j.b.c.engelen@alumnus.utwente.nl>
*
* Copyright (C) 2007-2012 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <gtkmm.h>
#include "persp3d.h"
//#include "transf_mat_3x4.h"
#include "document.h"
#include "document-private.h"
#include "live_effects/lpe-perspective_path.h"
#include "live_effects/lpeobject.h"
#include "sp-item-group.h"
#include "knot-holder-entity.h"
#include "knotholder.h"
#include "desktop.h"
#include "inkscape.h"
namespace Inkscape {
namespace LivePathEffect {
namespace PP {
{
public:
};
} // namespace PP
// initialise your parameters here:
uses_plane_xy(_("Uses XY plane?"), _("If true, put the path on the left side of an imaginary box, otherwise on the right side"), "uses_plane_xy", &wr, this, true)
{
// register all your parameters here, so Inkscape knows which parameters this effect has:
concatenate_before_pwd2 = true; // don't split the path into its subpaths
_provides_knotholder_entities = true;
apply_to_clippath_and_mask = true;
}
{
}
void
{
if(persp == 0 ){
Gtk::BUTTONS_OK, true);
item->removeCurrentPathEffect(false);
}
}
void
{
original_bbox(lpeitem, true);
if(persp == 0 ){
Gtk::BUTTONS_OK, true);
return;
}
Geom::Affine doc2d = Geom::Scale(1, -1) * Geom::Translate(0, item->document->getHeight().value("px"));
}
for ( SPObject *child = this->lpeobj->document->getDefs()->firstChild(); child && !persp; child = child->getNext() ) {
}
if (SP_IS_PERSP3D(child) && strcmp(child->getId(), const_cast<const gchar *>(perspectiveID.c_str())) == 0) {
break;
}
}
if(first == 0 ){
Gtk::BUTTONS_OK, true);
return;
}
if(persp == 0){
Gtk::BUTTONS_OK, true);
perspectiveID = _("First perspective");
}else{
Gtk::BUTTONS_OK, true);
}
};
{
using namespace Geom;
// FIXME: the minus sign is there because the SVG coordinate system goes down;
// remove this once we have unified coordinate systems
//Geom::Point orig = Geom::Point(bounds_X.min(), bounds_Y.middle());
//orig = Geom::Point(orig[X], sp_document_height(this->lpeobj->document) - orig[Y]);
//double offset = uses_plane_xy ? boundingbox_X.extent() : 0.0;
/**
g_print ("Orig: (%8.2f, %8.2f)\n", orig[X], orig[Y]);
g_print ("B[1] - orig[1]: %8.2f\n", (B[1] - orig[1])[0].valueAt(0));
g_print ("B[0] - orig[0]: %8.2f\n", (B[0] - orig[0])[0].valueAt(0));
**/
if (uses_plane_xy) {
} else {
preimage[0] = B[0] - B[0]; // hack!
}
/* set perspective origin to first point of path */
/**
g_print ("preimage[1]: %8.2f\n", preimage[1][0].valueAt(0));
g_print ("preimage[2]: %8.2f\n", preimage[2][0].valueAt(0));
**/
for (int j = 0; j < 3; ++j) {
res[j] =
+ tmat[j][3];
}
return output;
}
{
// use manage here, because after deletion of Effect object, others might still be pointing to this widget.
if ((*it)->widget_is_visible) {
if (widg) {
if (tip) {
} else {
widg->set_has_tooltip(false);
}
}
}
++it;
}
apply3D->signal_clicked().connect(sigc::bind<Gtk::Entry*>(sigc::mem_fun(*this,&LPEPerspectivePath::refresh),perspective));
}
void LPEPerspectivePath::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
_("Adjust the origin") );
knotholder->add(e);
};
namespace PP {
void
{
using namespace Geom;
lpe->offsety.param_set_value(-(s - origin)[Geom::Y]); // additional minus sign is due to coordinate system flipping
// FIXME: this should not directly ask for updating the item. It should write to SVG, which triggers updating.
}
{
}
} // namespace PP
} //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:fileencoding=utf-8:textwidth=99 :