Adaptagrams
shape.h
Go to the documentation of this file.
1 /*
2  * vim: ts=4 sw=4 et tw=0 wm=0
3  *
4  * libavoid - Fast, Incremental, Object-avoiding Line Router
5  *
6  * Copyright (C) 2004-2011 Monash University
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  * See the file LICENSE.LGPL distributed with the library.
13  *
14  * Licensees holding a valid commercial license may use this file in
15  * accordance with the commercial license agreement provided with the
16  * library.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21  *
22  * Author(s): Michael Wybrow
23 */
24 
27 
28 
29 #ifndef AVOID_SHAPE_H
30 #define AVOID_SHAPE_H
31 
32 #include <list>
33 #include <set>
34 
35 #include <cstdio>
36 
37 #include "libavoid/dllexport.h"
38 #include "libavoid/geometry.h"
39 #include "libavoid/obstacle.h"
40 
41 namespace topology {
42  class LayoutObstacle;
43 }
44 
45 namespace Avoid {
46 
47 class VertInf;
48 class Router;
49 class ShapeRef;
50 class ConnEnd;
51 class ShapeConnectionPin;
52 class ConnRef;
53 typedef std::list<ShapeRef *> ShapeRefList;
54 
58 {
69 };
70 
71 
81 class AVOID_EXPORT ShapeRef : public Obstacle
82 {
83  public:
119  ShapeRef(Router *router, Polygon& poly, const unsigned int id = 0);
120 
121 // To prevent C++ objects from being destroyed in garbage collected languages
122 // when the libraries are called from SWIG, we hide the declarations of the
123 // destructors and prevent generation of default destructors.
124 #ifndef SWIG
125  virtual ~ShapeRef();
130 #endif
131 
134  const Polygon& polygon(void) const;
135 
143  void transformConnectionPinPositions(ShapeTransformationType transform);
144 
145  Point position(void) const;
146  private:
147  friend class Router;
148  friend class ConnEnd;
149  friend class ShapeConnectionPin;
150  friend class topology::LayoutObstacle;
151 
152  void outputCode(FILE *fp) const;
153  void moveAttachedConns(const Polygon& newPoly);
154  void assignPinVisibilityTo(const unsigned int pinClassId,
155  VertInf *dummyConnectionVert);
156  void setCentrePos(const Point& newCentre);
157 };
158 
159 
160 }
161 
162 
163 #endif
164 
165 
The ConnEnd class represents different possible endpoints for connectors.
Definition: connend.h:110
The shape has been flipped vertically in the Y-dimension.
Definition: shape.h:68
libtopology: Extensions for topology preservation for libcola and libavoid libraries.
Definition: shape.h:41
A dynamic Polygon, to which points can be easily added and removed.
Definition: geomtypes.h:207
The ShapeConnectionPin class represents a fixed point or "pin" on a shape that can be connected to...
Definition: connectionpin.h:96
The shape has been rotated clockwise by 90 degrees.
Definition: shape.h:60
The Point class defines a point in the plane.
Definition: geomtypes.h:52
The shape has been rotated clockwise by 180 degrees.
Definition: shape.h:62
The shape has been flipped horizontally in the X-dimension.
Definition: shape.h:66
ShapeTransformationType
Describes the type of transformation that has been applied to a shape having its transformConnectionP...
Definition: shape.h:57
libavoid: Object-avoiding orthogonal and polyline connector routing library.
Definition: actioninfo.cpp:33
The Router class represents a libavoid router instance.
Definition: router.h:386
The shape has been rotated clockwise by 270 degrees.
Definition: shape.h:64
The ShapeRef class represents a shape object.
Definition: shape.h:81
Contains the interface for the Obstacle class, the superclass for ShapeRef and JunctionRef.