summaryrefslogtreecommitdiffstats
path: root/src/box3d-face.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2007-07-10 13:58:55 +0000
committercilix42 <cilix42@users.sourceforge.net>2007-07-10 13:58:55 +0000
commitde3ad1fa20e7a33a0524d3cf11502be0241b4cfe (patch)
tree58e422543527a7c5460bff7553039ac171245dfd /src/box3d-face.cpp
parentMore 3D auxiliary/convenience functions (diff)
downloadinkscape-de3ad1fa20e7a33a0524d3cf11502be0241b4cfe.tar.gz
inkscape-de3ad1fa20e7a33a0524d3cf11502be0241b4cfe.zip
Create all 3D box faces in the beginning (fixes resizing bug; first step towards correct handling of degenerate boxes)
(bzr r3212)
Diffstat (limited to 'src/box3d-face.cpp')
-rw-r--r--src/box3d-face.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/box3d-face.cpp b/src/box3d-face.cpp
index 4f85fbf6e..2c2d6209a 100644
--- a/src/box3d-face.cpp
+++ b/src/box3d-face.cpp
@@ -14,15 +14,24 @@
#include "box3d-face.h"
#include <iostream>
-Box3DFace::Box3DFace(SP3DBox *box3d) : dir1 (Box3D::NONE), dir2 (Box3D::NONE), path (NULL), parent_box3d (box3d)
-{
- for (int i = 0; i < 4; ++i) {
- this->corners[i] = new NR::Point(0, 0);
- }
-}
-
-Box3DFace::Box3DFace(SP3DBox *box3d, NR::Point &A, NR::Point &B, NR::Point &C, NR::Point &D)
-{
+// FIXME: It's quite redundant to pass the box plus the corners plus the axes. At least the corners can
+// theoretically be reconstructed from the box and the axes, but in order to do this we need
+// access to box->corners, which is not possible if we only have a forward declaration of SP3DBox
+// in box3d-face.h. (But we can't include box3d.h itself because the latter already includes
+// box3d-face.h).
+Box3DFace::Box3DFace(SP3DBox *box, NR::Point &A, NR::Point &B, NR::Point &C, NR::Point &D,
+ Box3D::Axis plane, Box3D::FrontOrRear rel_pos)
+ : path (NULL), parent_box3d (box)
+ {
+ /*
+ Box3D::Axis axis = (rel_pos == Box3D::FRONT ? Box3D::NONE : Box3D::third_axis_direction (plane));
+ dir1 = extract_first_axis_direction (plane);
+ dir2 = extract_second_axis_direction (plane);
+ set_corners (box->corners[axis],
+ box->corners[axis ^ dir1],
+ box->corners[axis ^ dir1 ^ dir2],
+ box->corners[axis ^ dir2]);
+ */
set_corners (A, B, C, D);
}