pcb 4.1.1
An interactive printed circuit board layout editor.

rotate.h File Reference

Prototypes for transform routines. More...

#include "global.h"
Include dependency graph for rotate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ROTATE(x, y, x0, y0, n)
#define ROTATE_VIA_LOWLEVEL(v, x0, y0, n)   ROTATE((v)->X,(v)->Y,(x0),(y0),(n))
#define ROTATE_PIN_LOWLEVEL(p, x0, y0, n)   ROTATE((p)->X,(p)->Y,(x0),(y0),(n))
#define ROTATE_PAD_LOWLEVEL(p, x0, y0, n)   RotateLineLowLevel(((LineType *) (p)),(x0),(y0),(n))
#define ROTATE_TYPES   (ELEMENT_TYPE | TEXT_TYPE | ELEMENTNAME_TYPE | ARC_TYPE)

Functions

void RotateLineLowLevel (LineType *, Coord, Coord, unsigned)
 Rotates a line in 90 degree steps.
void RotateArcLowLevel (ArcType *, Coord, Coord, unsigned)
 Rotates an arc.
void RotateBoxLowLevel (BoxType *, Coord, Coord, unsigned)
 Rotates a box in 90 degree steps.
void RotateTextLowLevel (TextType *, Coord, Coord, unsigned)
 Rotates a text in 90 degree steps.
void RotatePolygonLowLevel (PolygonType *, Coord, Coord, unsigned)
 Rotates a polygon in 90 degree steps.
void RotateElementLowLevel (DataType *, ElementType *, Coord, Coord, unsigned)
 Rotate an element in 90 degree steps.
void * RotateObject (int, void *, void *, void *, Coord, Coord, unsigned)
 Rotates an objects at the cursor position as identified by its ID.
void RotateScreenObject (Coord, Coord, unsigned)

Detailed Description

Prototypes for transform routines.


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 1994,1995,1996 Thomas Nau

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Contact addresses for paper mail and Email:

Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany

Thomas.Nau@rz.uni-ulm.de

Definition in file rotate.h.


Define Documentation

#define ROTATE (   x,
  y,
  x0,
  y0,
  n 
)
Value:
{                                                                                               \
                Coord   dx = (x)-(x0),                                  \
                                        dy = (y)-(y0);                                  \
                                                                                                        \
                switch(n & 0x03)                                                                        \
                {                                                                                       \
                        case 1:         (x)=(x0)+dy; (y)=(y0)-dx;       \
                                                break;                                          \
                        case 2:         (x)=(x0)-dx; (y)=(y0)-dy;       \
                                                break;                                          \
                        case 3:         (x)=(x0)-dy; (y)=(y0)+dx;       \
                                                break;                                          \
                        default:        break;                                          \
                }                                                                                       \
        }

Definition at line 43 of file rotate.h.

#define ROTATE_PAD_LOWLEVEL (   p,
  x0,
  y0,
  n 
)    RotateLineLowLevel(((LineType *) (p)),(x0),(y0),(n))

Definition at line 61 of file rotate.h.

Referenced by RotateElementLowLevel().

#define ROTATE_PIN_LOWLEVEL (   p,
  x0,
  y0,
  n 
)    ROTATE((p)->X,(p)->Y,(x0),(y0),(n))

Definition at line 60 of file rotate.h.

Referenced by RotateElementLowLevel().

#define ROTATE_TYPES   (ELEMENT_TYPE | TEXT_TYPE | ELEMENTNAME_TYPE | ARC_TYPE)

Definition at line 64 of file rotate.h.

Referenced by RotateScreenObject().

#define ROTATE_VIA_LOWLEVEL (   v,
  x0,
  y0,
  n 
)    ROTATE((v)->X,(v)->Y,(x0),(y0),(n))

Definition at line 59 of file rotate.h.

Referenced by RotateBuffer().


Function Documentation

void RotateArcLowLevel ( ArcType ,
Coord  ,
Coord  ,
unsigned   
)

Rotates an arc.

Definition at line 190 of file rotate.c.

References ArcType::Height, NormalizeAngle(), ArcType::Point1, ArcType::Point2, ROTATE, RotateBoxLowLevel(), ArcType::StartAngle, ArcType::Width, PointType::X, ArcType::X, PointType::Y, and ArcType::Y.

Referenced by RotateArc(), RotateBuffer(), and RotateElementLowLevel().

Here is the call graph for this function:

void RotateBoxLowLevel ( BoxType ,
Coord  ,
Coord  ,
unsigned   
)

Rotates a box in 90 degree steps.

Definition at line 348 of file rotate.c.

References MAX, MIN, ROTATE, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by common_draw_pcb_text(), RotateArcLowLevel(), RotateBuffer(), RotatePolygonLowLevel(), RotateTextLowLevel(), and SetTextBoundingBox().

void RotateLineLowLevel ( LineType ,
Coord  ,
Coord  ,
unsigned   
)

Rotates a line in 90 degree steps.

Definition at line 104 of file rotate.c.

References ROTATE, and SetLineBoundingBox().

Referenced by common_draw_pcb_text(), RotateBuffer(), and RotateElementLowLevel().

Here is the call graph for this function:

void* RotateObject ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3,
Coord  X,
Coord  Y,
unsigned  Steps 
)
void RotatePolygonLowLevel ( PolygonType ,
Coord  ,
Coord  ,
unsigned   
)

Rotates a polygon in 90 degree steps.

Definition at line 159 of file rotate.c.

References END_LOOP, POLYGONPOINT_LOOP, ROTATE, and RotateBoxLowLevel().

Referenced by RotateBuffer().

Here is the call graph for this function:

void RotateScreenObject ( Coord  ,
Coord  ,
unsigned   
)
void RotateTextLowLevel ( TextType Text,
Coord  X,
Coord  Y,
unsigned  Number 
)

Rotates a text in 90 degree steps.

Only the bounding box is rotated, text rotation itself is done by the drawing routines.

Definition at line 140 of file rotate.c.

References TextType::Direction, Number, ROTATE, RotateBoxLowLevel(), TEST_FLAG, TextType::X, and TextType::Y.

Referenced by FreeRotateElementLowLevel(), RotateBuffer(), RotateElementLowLevel(), RotateElementName(), and RotateText().

Here is the call graph for this function: