box3d.cpp revision 5b4ae179dca0cac4e3141df5f5436e49d1398f51
#define __SP_3DBOX_C__
/*
* SVG <box3d> implementation
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* bulia byak <buliabyak@users.sf.net>
* Maximilian Albert <Anhalter42@gmx.de>
*
* Copyright (C) 2007 Authors
* Copyright (C) 1999-2002 Lauris Kaplinski
* Copyright (C) 2000-2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "box3d.h"
//static void sp_3dbox_release (SPObject *object);
static Inkscape::XML::Node *sp_3dbox_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
//static gchar *sp_3dbox_description(SPItem *item);
//static void sp_3dbox_set_shape(SPShape *shape);
static SPGroupClass *parent_class;
sp_3dbox_get_type(void)
{
if (!type) {
sizeof(SP3DBoxClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(SP3DBox),
16, /* n_preallocs */
NULL, /* value_table */
};
}
return type;
}
static void
{
// SPItemClass *item_class = (SPItemClass *) klass;
//sp_object_class->release = sp_3dbox_release;
//item_class->description = sp_3dbox_description;
}
static void
{
//box3d->faces[4]->hook_path_to_3dbox();
for (int i = 0; i < 6; ++i) {
if (i == 4) continue;
}
}
static void
{
}
//sp_object_read_attr(object, "width");
}
/*
static void
sp_3dbox_release (SPObject *object)
{
SP3DBox *box3d = SP_3DBOX(object);
for (int i = 0; i < 6; ++i) {
if (box3d->faces[i]) {
delete box3d->faces[i]; // FIXME: Anything else to do? Do we need to clean up the face first?
}
}
if (((SPObjectClass *) parent_class)->release) {
((SPObjectClass *) parent_class)->release (object);
}
}
*/
{
//SP3DBox *box3d = SP_3DBOX(object);
switch (key) {
/***
case SP_ATTR_WIDTH:
rect->width.readOrUnset(value);
object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
break;
***/
default:
}
break;
}
}
static void
{
//SP3DBox *box3d = SP_3DBOX(object);
/* Invoke parent method */
//sp_3dbox_set_shape (box3d);
}
static Inkscape::XML::Node *sp_3dbox_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
// FIXME: How to handle other contexts???
return repr;
}
for (int i = 0; i < 6; ++i) {
if (i == 4) continue;
}
}
}
return repr;
}
void
{
// FIXME: Why does the following call not automatically update the children
// of box3d (which is an SPGroup, which should do this)?
//SP_OBJECT(box3d)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
/**
SP_OBJECT(box3d->path_face1)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
SP_OBJECT(box3d->path_face2)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
SP_OBJECT(box3d->path_face3)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
SP_OBJECT(box3d->path_face4)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
SP_OBJECT(box3d->path_face5)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
SP_OBJECT(box3d->path_face6)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
***/
}
static void
// FIXME: Note that this is _not_ the virtual set_shape() method inherited from SPShape,
// since SP3DBox is inherited from SPGroup. The following method is "artificially"
// called from sp_3dbox_update().
//sp_3dbox_set_shape(SPShape *shape)
{
// FIXME: How to handle other contexts???
return;
/* Only update the curves during dragging; setting the svg representations
is expensive and only done once at the end */
box3d->faces[0]->set_corners (box3d->corners[0], box3d->corners[4], box3d->corners[6], box3d->corners[2]);
box3d->faces[1]->set_corners (box3d->corners[1], box3d->corners[5], box3d->corners[7], box3d->corners[3]);
box3d->faces[2]->set_corners (box3d->corners[0], box3d->corners[1], box3d->corners[5], box3d->corners[4]);
box3d->faces[3]->set_corners (box3d->corners[2], box3d->corners[3], box3d->corners[7], box3d->corners[6]);
box3d->faces[5]->set_corners (box3d->corners[4], box3d->corners[5], box3d->corners[7], box3d->corners[6]);
}
box3d->faces[4]->set_corners (box3d->corners[0], box3d->corners[1], box3d->corners[3], box3d->corners[2]);
}
void sp_3dbox_recompute_corners (SP3DBox *box, NR::Point const A, NR::Point const B, NR::Point const C)
{
}
void
for (int i = 0; i < 6; ++i) {
}
}
void
{
}
/* set the 'front' corners */
/* set the 'rear' corners */
}
void
{
/* set the four corners of the face containing corners[id] */
}
{
}
{
// Is all this sufficiently precise also for degenerate cases?
} else {
}
}
/*
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 :