pcb 4.1.1
An interactive printed circuit board layout editor.

rotate.c File Reference

Functions used to rotate pins, elements ... More...

#include <stdlib.h>
#include "global.h"
#include "crosshair.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "misc.h"
#include "polygon.h"
#include "rotate.h"
#include "rtree.h"
#include "rubberband.h"
#include "search.h"
#include "select.h"
#include "set.h"
#include "undo.h"
Include dependency graph for rotate.c:

Go to the source code of this file.

Functions

static void * RotateText (LayerType *Layer, TextType *Text)
 Rotates a text object and redraws it.
static void * RotateArc (LayerType *Layer, ArcType *Arc)
 Rotates an arc.
static void * RotateElement (ElementType *Element)
 Rotates an element.
static void * RotateElementName (ElementType *Element)
 Rotates the name of an element.
static void * RotateLinePoint (LayerType *Layer, LineType *Line, PointType *Point)
 Rotates a line's point.
void RotatePointLowLevel (PointType *Point, Coord X, Coord Y, unsigned Number)
 Rotates a point in 90 degree steps.
void RotateLineLowLevel (LineType *Line, Coord X, Coord Y, unsigned Number)
 Rotates a line in 90 degree steps.
void RotateTextLowLevel (TextType *Text, Coord X, Coord Y, unsigned Number)
 Rotates a text in 90 degree steps.
void RotatePolygonLowLevel (PolygonType *Polygon, Coord X, Coord Y, unsigned Number)
 Rotates a polygon in 90 degree steps.
void RotateArcLowLevel (ArcType *Arc, Coord X, Coord Y, unsigned Number)
 Rotates an arc.
void RotateElementLowLevel (DataType *Data, ElementType *Element, Coord X, Coord Y, unsigned Number)
 Rotate an element in 90 degree steps.
void RotateBoxLowLevel (BoxType *Box, Coord X, Coord Y, unsigned Number)
 Rotates a box in 90 degree steps.
void * RotateObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord X, Coord Y, unsigned Steps)
 Rotates an objects at the cursor position as identified by its ID.
void RotateScreenObject (Coord X, Coord Y, unsigned Steps)

Variables

static Coord CenterX
static Coord CenterY
static unsigned Number
static ObjectFunctionType RotateFunctions

Detailed Description

Functions used to rotate pins, elements ...


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.c.


Function Documentation

static void * RotateArc ( LayerType Layer,
ArcType Arc 
) [static]

Rotates an arc.

Definition at line 298 of file rotate.c.

References LayerType::arc_tree, CenterX, CenterY, ClearFromPolygon(), PCBType::Data, Draw(), DrawArc(), EraseArc(), Number, PCB, r_delete_entry(), r_insert_entry(), RestoreToPolygon(), and RotateArcLowLevel().

Here is the call graph for this function:

void RotateArcLowLevel ( ArcType Arc,
Coord  X,
Coord  Y,
unsigned  Number 
)

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 Box,
Coord  X,
Coord  Y,
unsigned  Number 
)

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().

static void * RotateElement ( ElementType Element) [static]

Rotates an element.

Definition at line 316 of file rotate.c.

References CenterX, CenterY, PCBType::Data, Draw(), DrawElement(), EraseElement(), Number, PCB, and RotateElementLowLevel().

Here is the call graph for this function:

static void * RotateElementName ( ElementType Element) [static]

Rotates the name of an element.

Definition at line 329 of file rotate.c.

References CenterX, CenterY, PCBType::Data, Draw(), DrawElementName(), ELEMENTTEXT_LOOP, END_LOOP, EraseElementName(), n, DataType::name_tree, Number, PCB, r_delete_entry(), r_insert_entry(), and RotateTextLowLevel().

Here is the call graph for this function:

void RotateLineLowLevel ( LineType Line,
Coord  X,
Coord  Y,
unsigned  Number 
)

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:

static void * RotateLinePoint ( LayerType Layer,
LineType Line,
PointType Point 
) [static]
void* RotateObject ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3,
Coord  X,
Coord  Y,
unsigned  Steps 
)
void RotatePointLowLevel ( PointType Point,
Coord  X,
Coord  Y,
unsigned  Number 
)

Rotates a point in 90 degree steps.

Definition at line 95 of file rotate.c.

References ROTATE, PointType::X, and PointType::Y.

Referenced by RotateLinePoint(), and RotateObject().

void RotatePolygonLowLevel ( PolygonType Polygon,
Coord  X,
Coord  Y,
unsigned  Number 
)

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  X,
Coord  Y,
unsigned  Steps 
)
static void * RotateText ( LayerType Layer,
TextType Text 
) [static]

Rotates a text object and redraws it.

Definition at line 173 of file rotate.c.

References CenterX, CenterY, ClearFromPolygon(), PCBType::Data, Draw(), DrawText(), EraseText(), Number, PCB, r_delete_entry(), r_insert_entry(), RestoreToPolygon(), RotateTextLowLevel(), and LayerType::text_tree.

Here is the call graph for this function:

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:


Variable Documentation

Initial value:
 {
  NULL,
  RotateText,
  NULL,
  NULL,
  RotateElement,
  RotateElementName,
  NULL,
  NULL,
  RotateLinePoint,
  NULL,
  RotateArc,
  NULL
}

Definition at line 76 of file rotate.c.