Default STEP export to board only
[geda-pcb/pcjc2/v2.git] / src / rotate.h
blob815ac4c2ae2670f9264dbf54ed30c73db2fba92b
1 /*!
2 * \file src/rotate.h
4 * \brief Prototypes for transform routines.
6 * <hr>
8 * <h1><b>Copyright.</b></h1>\n
10 * PCB, interactive printed circuit board design
12 * Copyright (C) 1994,1995,1996 Thomas Nau
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 * Contact addresses for paper mail and Email:
30 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
32 * Thomas.Nau@rz.uni-ulm.de
35 #ifndef PCB_ROTATE_H
36 #define PCB_ROTATE_H
38 #include "global.h"
40 /* ---------------------------------------------------------------------------
41 * some useful transformation macros and constants
43 #define ROTATE(x,y,x0,y0,n) \
44 { \
45 Coord dx = (x)-(x0), \
46 dy = (y)-(y0); \
48 switch(n & 0x03) \
49 { \
50 case 1: (x)=(x0)+dy; (y)=(y0)-dx; \
51 break; \
52 case 2: (x)=(x0)-dx; (y)=(y0)-dy; \
53 break; \
54 case 3: (x)=(x0)-dy; (y)=(y0)+dx; \
55 break; \
56 default: break; \
57 } \
59 #define ROTATE_VIA_LOWLEVEL(v,x0,y0,n) ROTATE((v)->X,(v)->Y,(x0),(y0),(n))
60 #define ROTATE_PIN_LOWLEVEL(p,x0,y0,n) ROTATE((p)->X,(p)->Y,(x0),(y0),(n))
61 #define ROTATE_PAD_LOWLEVEL(p,x0,y0,n) \
62 RotateLineLowLevel(((LineType *) (p)),(x0),(y0),(n))
64 #define ROTATE_TYPES (ELEMENT_TYPE | TEXT_TYPE | ELEMENTNAME_TYPE | ARC_TYPE)
67 void RotateLineLowLevel (LineType *, Coord, Coord, unsigned);
68 void RotateArcLowLevel (ArcType *, Coord, Coord, unsigned);
69 void RotateBoxLowLevel (BoxType *, Coord, Coord, unsigned);
70 void RotateTextLowLevel (TextType *, Coord, Coord, unsigned);
71 void RotatePolygonLowLevel (PolygonType *, Coord, Coord, unsigned);
72 void RotateElementLowLevel (DataType *, ElementType *, Coord, Coord, unsigned);
73 void *RotateObject (int, void *, void *, void *, Coord, Coord,
74 unsigned);
75 void RotateScreenObject (Coord, Coord, unsigned);
77 #endif