box3d.h revision fc5435340e1a4a9fc54edaf29bc60aed1409582e
#ifndef __SP_3DBOX_H__
#define __SP_3DBOX_H__
/*
* SVG <box3d> implementation
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* 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 "inkscape.h"
#include "perspective-line.h"
#include "sp-item-group.h"
#include "sp-path.h"
#include "xml/document.h"
#include "line-geometry.h"
#include "box3d-face.h"
#define SP_TYPE_3DBOX (sp_3dbox_get_type ())
guint z_orders[6]; // z_orders[i] holds the ID of the face at position #i in the group (from top to bottom)
// Use a mathematically correct model to update the boxes.
double ratio_x;
double ratio_y;
double ratio_z;
guint front_bits; /* used internally to determine which of two parallel faces is supposed to be the front face */
};
struct SP3DBoxClass {
};
GType sp_3dbox_get_type (void);
void sp_3dbox_recompute_corners (SP3DBox *box, NR::Point const pt1, NR::Point const pt2, NR::Point const pt3);
bool sp_3dbox_recompute_z_orders (SP3DBox *box); /* returns true if there was a change in the z-orders
(which triggers an update of the repr) */
void sp_3dbox_move_corner_in_XY_plane (SP3DBox *box, guint id, NR::Point pt, Box3D::Axis axes = Box3D::XY);
void sp_3dbox_move_corner_in_Z_direction (SP3DBox *box, guint id, NR::Point pt, bool constrained = true);
NR::Maybe<NR::Point> sp_3dbox_get_midpoint_between_corners (SP3DBox *box, guint id_corner1, guint id_corner2);
void sp_3dbox_corners_for_perspective_lines (const SP3DBox * box, Box3D::Axis axis, NR::Point &corner1, NR::Point &corner2, NR::Point &corner3, NR::Point &corner4);
guint sp_3dbox_get_corner_id_along_edge (const SP3DBox *box, guint corner, Box3D::Axis axis, Box3D::FrontOrRear rel_pos);
NR::Point sp_3dbox_get_corner_along_edge (const SP3DBox *box, guint corner, Box3D::Axis axis, Box3D::FrontOrRear rel_pos);
}
#endif