1 /****************************************************************************
2 ** $Id: rs_information.h 1926 2004-11-20 00:42:21Z andrew $
4 ** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
6 ** This file is part of the qcadlib Library project.
8 ** This file may be distributed and/or modified under the terms of the
9 ** GNU General Public License version 2 as published by the Free Software
10 ** Foundation and appearing in the file LICENSE.GPL included in the
11 ** packaging of this file.
13 ** Licensees holding valid qcadlib Professional Edition licenses may use
14 ** this file in accordance with the qcadlib Commercial License
15 ** Agreement provided with the Software.
17 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 ** See http://www.ribbonsoft.com for further details.
22 ** Contact info@ribbonsoft.com if any conditions of this licensing are
25 **********************************************************************/
27 #ifndef RS_INFORMATION_H
28 #define RS_INFORMATION_H
30 #include "rs_entitycontainer.h"
35 * Class for getting information about entities. This includes
36 * also things like the end point of an element which is
37 * nearest to a given coordinate.
38 * There's no interaction handled in this class.
39 * This class is bound to an entity container.
41 * @author Andrew Mustun
46 RS_Information(RS_EntityContainer & entityContainer);
48 static bool isDimension(RS2::EntityType type);
49 static bool isTrimmable(RS_Entity * e);
50 static bool isTrimmable(RS_Entity * e1, RS_Entity * e2);
52 Vector getNearestEndpoint(const Vector & point, double * dist = NULL) const;
53 Vector getNearestPointOnEntity(const Vector & point, bool onEntity = true,
54 double * dist = NULL, RS_Entity ** entity = NULL) const;
55 RS_Entity * getNearestEntity(const Vector & point, double * dist = NULL,
56 RS2::ResolveLevel level = RS2::ResolveAll) const;
58 static VectorSolutions getIntersection(RS_Entity * e1, RS_Entity * e2, bool onEntities = false);
59 static VectorSolutions getIntersectionLineLine(RS_Line * e1, RS_Line * e2);
60 static VectorSolutions getIntersectionLineArc(RS_Line * line, RS_Arc * arc);
61 static VectorSolutions getIntersectionArcArc(RS_Arc * e1, RS_Arc * e2);
62 static VectorSolutions getIntersectionLineEllipse(RS_Line * line, RS_Ellipse * ellipse);
64 static bool isPointInsideContour(const Vector & point, RS_EntityContainer * contour,
65 bool * onContour = NULL);
68 RS_EntityContainer * container;