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"
37 * Class for getting information about entities. This includes
38 * also things like the end point of an element which is
39 * nearest to a given coordinate.
40 * There's no interaction handled in this class.
41 * This class is bound to an entity container.
43 * @author Andrew Mustun
45 class RS_Information {
47 RS_Information(RS_EntityContainer& entityContainer);
49 static bool isDimension(RS2::EntityType type);
50 static bool isTrimmable(RS_Entity* e);
51 static bool isTrimmable(RS_Entity* e1, RS_Entity* e2);
53 Vector getNearestEndpoint(const Vector& point,
54 double* dist = NULL) const;
55 Vector getNearestPointOnEntity(const Vector& point,
58 RS_Entity** entity=NULL) const;
59 RS_Entity* getNearestEntity(const Vector& point,
61 RS2::ResolveLevel level=RS2::ResolveAll) const;
63 static VectorSolutions getIntersection(RS_Entity* e1,
65 bool onEntities = false);
67 static VectorSolutions getIntersectionLineLine(RS_Line* e1,
70 static VectorSolutions getIntersectionLineArc(RS_Line* line,
73 static VectorSolutions getIntersectionArcArc(RS_Arc* e1,
76 static VectorSolutions getIntersectionLineEllipse(RS_Line* line,
79 static bool isPointInsideContour(const Vector& point,
80 RS_EntityContainer* contour,
81 bool* onContour=NULL);
84 RS_EntityContainer* container;