box3d-side.cpp revision 7b24a1fa06853c0ac55ccd3c1504e47db021d457
#define __BOX3D_SIDE_C__
/*
* 3D box face implementation
*
* Authors:
* Maximilian Albert <Anhalter42@gmx.de>
*
* 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 "box3d-context.h"
#include "prefs-utils.h"
#include "desktop-style.h"
#include "box3d.h"
static Inkscape::XML::Node *box3d_side_write (SPObject *object, Inkscape::XML::Node *repr, guint flags);
static SPShapeClass *parent_class;
box3d_side_get_type (void)
{
if (!type) {
sizeof (Box3DSideClass),
sizeof (Box3DSide),
16,
NULL, /* value_table */
};
}
return type;
}
static void
{
}
static void
{
}
static void
{
}
{
// 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) {
}
/* Duplicate the path */
//Nulls might be possible if this called iteratively
if ( !curve ) {
return NULL;
}
g_free (d);
return repr;
}
static void
{
// 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;
}
}
static void
{
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 |
}
}
void
/* This call is responsible for live update of the sides during the initial drag */
}
void
{
// 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 (!SP_IS_BOX3D(parent)) {
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.
unsigned int corners[4];
c->closepath();
c->unref();
}
void
/* use last used style */
} else {
/* use default style */
}
}
gchar *
{
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:encoding=utf-8:textwidth=99 :