/*
* Routines for dealing with lines (intersections, etc.)
*
* Authors:
* Maximilian Albert <Anhalter42@gmx.de>
*
* Copyright (C) 2007 authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "line-geometry.h"
#include "inkscape.h"
#include "desktop.h"
#include "desktop-style.h"
#include "display/sp-canvas.h"
#include "display/sp-ctrlline.h"
#include "display/sodipodi-ctrl.h"
#include "ui/control-manager.h"
using Inkscape::ControlManager;
namespace Box3D {
/**
* Draw a line beginning at 'start'. If is_endpoint is true, use 'vec' as the endpoint
* of the segment. Otherwise interpret it as the direction of the line.
* FIXME: Think of a better way to distinguish between the two constructors of lines.
*/
{
if (is_endpoint)
else
}
{
}
return *this;
}
return no_point;
}
{
}
{
/* return the intersection of this line with a perpendicular line passing through pt */
return *result;
}
{
// FIXME: It may speed things up (but how much?) if we assume that
// pt lies on the line and thus skip the following test
g_warning ("Point does not lie on line.\n");
return 0;
}
return lambda;
}
/* The coordinates of w with respect to the basis {v1, v2} */
std::pair<double, double> coordinates (Geom::Point const &v1, Geom::Point const &v2, Geom::Point const &w)
{
// vectors are not linearly independent; we indicate this in the return value(s)
}
}
/* whether w lies inside the sector spanned by v1 and v2 */
{
// catch the case that the vectors are not linearly independent
// FIXME: Can we assume that it's safe to return true if the vectors point in different directions?
}
}
bool lies_in_quadrangle (Geom::Point const &A, Geom::Point const &B, Geom::Point const &C, Geom::Point const &D, Geom::Point const &pt)
{
}
{
}
/*
* Returns the two corners of the quadrangle A, B, C, D spanning the edge that is hit by a semiline
* starting at pt and going into direction dir.
* If none of the sides is hit, it returns a pair containing two identical points.
*/
side_of_intersection (Geom::Point const &A, Geom::Point const &B, Geom::Point const &C, Geom::Point const &D,
{
double tmp_angle;
}
}
}
}
}
}
}
if (angle == -1) {
// no intersection found; return a pair containing two identical points
} else {
return result;
}
}
{
/* remaining viewbox corners */
std::pair <Geom::Point, Geom::Point> e = side_of_intersection (vb.min(), lr, vb.max(), ul, this->pt, this->v_dir);
// perspective line lies outside the canvas
}
}
{
"size", size,
"filled", 1,
"fill_color", rgba,
"stroked", 1,
"stroke_color", 0x000000ff,
NULL);
}
{
}
} // namespace Box3D
/*
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:fileencoding=utf-8:textwidth=99 :