/*
* Vanishing point for 3D perspectives
*
* Authors:
* Maximilian Albert <Anhalter42@gmx.de>
*
* Copyright (C) 2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_VANISHING_POINT_H
#define SEEN_VANISHING_POINT_H
#include <list>
#include <set>
#include "knot.h"
#include "selection.h"
#include "persp3d.h"
#include "box3d.h"
#include "ui/control-manager.h" // TODO break enums out separately
enum VPState {
};
/* VanishingPoint is a simple wrapper class to easily extract VP data from perspectives.
* A VanishingPoint represents a VP in a certain direction (X, Y, Z) of a single perspective.
* In particular, it can potentially have more than one box linked to it (although in facth they
* are rather linked to the parent perspective).
*/
// FIXME: Don't store the box in the VP but rather the perspective (and link the box to it)!!
VanishingPoint(Persp3D *persp, Proj::Axis axis) : my_counter(VanishingPoint::global_counter++), _persp(persp), _axis(axis) {}
VanishingPoint(const VanishingPoint &other) : my_counter(VanishingPoint::global_counter++), _persp(other._persp), _axis(other._axis) {}
return *this;
}
/* vanishing points coincide if they belong to the same perspective */
}
}
}
inline bool is_finite() const {
g_return_val_if_fail (_persp, false);
}
}
return _persp;
}
}
}
inline unsigned int numberOfBoxes() const {
return persp3d_num_boxes(_persp);
}
/* returns all selected boxes sharing this perspective */
inline void updateBoxDisplays() const {
}
inline void updateBoxReprs() const {
}
inline void updatePerspRepr() const {
}
inline void printPt() const {
}
unsigned int my_counter;
static unsigned int global_counter; // FIXME: Only to implement operator< so that we can merge lists. Do this in a better way!!
};
struct VPDrag;
}
};
struct VPDragger {
~VPDragger();
// position of the knot, desktop coords
// position of the knot before it began to drag; updated when released
bool dragging_started;
void updateTip();
unsigned int numberOfBoxes(); // the number of boxes linked to all VPs of the dragger
void mergePerspectives(); // remove duplicate perspectives
void updateBoxDisplays();
void updateZOrders();
void printVPs();
};
struct VPDrag {
~VPDrag();
bool dragging;
void printDraggers(); // convenience for debugging
/*
* FIXME: Should the following functions be merged?
* Also, they should make use of the info in a VanishingPoint structure (regarding boxes
* and perspectives) rather than each time iterating over the whole list of selected items?
*/
void updateDraggers ();
void updateLines ();
void updateBoxHandles ();
void updateBoxReprs ();
void updateBoxDisplays ();
void drawLinesForFace (const SPBox3D *box, Proj::Axis axis); //, guint corner1, guint corner2, guint corner3, guint corner4);
// FIXME: Should this be private? (It's the case with the corresponding function in gradient-drag.h)
// But vp_knot_grabbed_handler
//void deselect_all();
/**
* Create a line from p1 to p2 and add it to the lines list.
*/
};
} // namespace Box3D
#endif /* !SEEN_VANISHING_POINT_H */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :