/*
* 3D box face implementation
*
* Authors:
* Maximilian Albert <Anhalter42@gmx.de>
* Abhishek Sharma
* Jon A. Cruz <jon@joncruz.org>
*
* Copyright (C) 2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "box3d-side.h"
#include "document.h"
#include "xml/document.h"
#include "attributes.h"
#include "inkscape.h"
#include "persp3d.h"
#include "persp3d-reference.h"
#include "ui/tools/box3d-tool.h"
#include "preferences.h"
#include "desktop-style.h"
#include "box3d.h"
}
}
this->readAttr( "inkscape:box3dsidetype" );
}
Inkscape::XML::Node* Box3DSide::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
// this is where we end up when saving as plain SVG (also in other circumstances?)
// thus we don' set "sodipodi:type" so that the box is only saved as an ordinary svg:path
}
if (flags & SP_OBJECT_WRITE_EXT) {
}
this->set_shape();
/* Duplicate the path */
//Nulls might be possible if this called iteratively
if ( !curve ) {
return NULL;
}
g_free (d);
return repr;
}
// TODO: In case the box was recreated (by undo, e.g.) we need to recreate the path
// (along with other info?) from the parent box.
/* fixme: we should really collect updates */
switch (key) {
if (value) {
}
}
break;
default:
break;
}
}
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // since we change the description, it's not a "just translation" anymore
}
if (flags & (SP_OBJECT_MODIFIED_FLAG |
this->set_shape();
}
}
/* Create a new Box3DSide and append it to the parent box */
{
return box3d_side;
}
/*
* Function which return the type attribute for Box3D.
* Acts as a replacement for directly accessing the XML Tree directly.
*/
{
}
void
// This call is responsible for live update of the sides during the initial drag
}
// avoid a warning caused by sp_document_height() (which is called from sp_item_i2d_affine() below)
// when reading a file containing 3D boxes
return;
}
if (!box) {
g_warning("Parent of 3D box side is not a 3D box.\n");
return;
}
if (!persp) {
return;
}
// TODO: Draw the correct quadrangle here
// To do this, determine the perspective of the box, the orientation of the side (e.g., XY-FRONT)
// compute the coordinates of the corners in P^3, project them onto the canvas, and draw the
// resulting path.
box3d_side_compute_corner_ids(this, corners);
{
g_warning ("Trying to draw a 3D box side with invalid coordinates.\n");
return;
}
c->closepath();
/* Reset the this'scurve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
this->setCurveInsync( c, TRUE);
if (hasPathEffect() && pathEffectsEnabled()) {
if (success) {
}
}
c->unref();
}
{
break;
break;
break;
default:
break;
}
}
static void
}
Persp3D *
}
// TODO: Copy over all important attributes (see sp_selected_item_to_curved_repr() for an example)
return repr;
}
/*
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 :