vanishing-point.h revision 209527815f6ad1b81d21bb3188947aef3d845010
/*
* 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 "libnr/nr-point.h"
#include "knot.h"
#include "selection.h"
#include "axis-manip.h"
#include "line-geometry.h" // TODO: Remove this include as soon as we don't need create_canvas_(point|line) any more.
enum VPState {
VP_FINITE = 0, // perspective lines meet in the VP
VP_INFINITE // perspective lines are parallel
};
// FIXME: Store the Axis of the VP inside the class
/***
inline VanishingPoint(NR::Point const &pt, NR::Point const &ref = NR::Point(0,0))
: NR::Point (pt),
ref_pt (ref),
v_dir (pt[NR::X] - ref[NR::X], pt[NR::Y] - ref[NR::Y]) {}
inline VanishingPoint(NR::Coord x, NR::Coord y, NR::Point const &ref = NR::Point(0,0))
: NR::Point (x, y),
ref_pt (ref),
v_dir (x - ref[NR::X], y - ref[NR::Y]) {}
***/
~VanishingPoint();
bool is_finite() const;
//inline VPState state() { return state; }
//NR::Point ref_pt; // point of reference to compute the direction of parallel lines
};
struct VPDragger {
~VPDragger();
// position of the knot, desktop coords
// position of the knot before it began to drag; updated when released
/* returns the VP of the dragger that belongs to the given perspective */
void updateTip();
void mergePerspectives (); // remove duplicate perspectives
void updateBoxReprs();
void updateZOrders();
};
struct VPDrag {
~VPDrag();
//void grabKnot (VanishingPoint const &vp, gint x, gint y, guint32 etime);
bool local_change;
void updateDraggers ();
void updateLines ();
void updateBoxHandles ();
void drawLinesForFace (const SP3DBox *box, Box3D::Axis axis); //, guint corner1, guint corner2, guint corner3, guint corner4);
bool show_lines; /* whether perspective lines are drawn at all */
// 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();
};
} // namespace Box3D
/** A function to print out the VanishingPoint (prints the coordinates) **/
/***
inline std::ostream &operator<< (std::ostream &out_file, const VanishingPoint &vp) {
out_file << vp;
return out_file;
}
***/
#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 :