libgeda

m_basic.c File Reference

#include <config.h>
#include <stdio.h>
#include <math.h>
#include "libgeda_priv.h"
Include dependency graph for m_basic.c:

Go to the source code of this file.

Functions

void set_window (TOPLEVEL *toplevel, PAGE *page, int xmin, int xmax, int ymin, int ymax)
 Set the contraints for the current page.
void rotate_point (int x, int y, int angle, int *newx, int *newy)
 Rotate a point by an arbitrary angle.
void rotate_point_90 (int x, int y, int angle, int *newx, int *newy)
 Rotate point in 90 degree increments only.
void PAPERSIZEtoWORLD (int width, int height, int border, int *right, int *bottom)
 Convert Paper size to World coordinates.

Function Documentation

void set_window ( TOPLEVEL toplevel,
PAGE page,
int  xmin,
int  xmax,
int  ymin,
int  ymax 
)
Function Description
This function will set the current page constraints.
Parameters:
[in]toplevelThe TOPLEVEL object.
[in,out]pageThe PAGE object to set constraints on.
[in]xminThe minimum x coordinate for the page.
[in]xmaxThe maximum x coordinate for the page.
[in]yminThe minimum y coordinate for the page.
[in]ymaxThe maximum y coordinate for the page.

Definition at line 43 of file m_basic.c.

void rotate_point ( int  x,
int  y,
int  angle,
int *  newx,
int *  newy 
)
Function Description
This function will rotate a point coordinate by an arbitrary angle and return the new coordinate in the newx and newy parameters.
Parameters:
[in]xInput point x coordinate.
[in]yInput point y coordinate.
[in]angleAngle to rotate in degrees.
[out]newxOutput point x coordinate.
[out]newyOutput point y coordinate.

Definition at line 93 of file m_basic.c.

void rotate_point_90 ( int  x,
int  y,
int  angle,
int *  newx,
int *  newy 
)
Function Description
This function takes a point coordinate and rotates it by 90 degrees at a time. The new point coordinate is returned in newx and newy.
Parameters:
[in]xInput point x coordinate.
[in]yInput point y coordinate.
[in]angleAngle to rotate by (90 degree increments only).
[out]newxOutput point x coordinate.
[out]newyOutput point y coordinate.

Definition at line 119 of file m_basic.c.

void PAPERSIZEtoWORLD ( int  width,
int  height,
int  border,
int *  right,
int *  bottom 
)
Function Description
This function takes the paper size and converts it to world coordinates. It supports landscape with a fixed aspect ratio.
Parameters:
[in]widthPaper width. (units?)
[in]heightPaper height. (units?)
[in]borderPaper border size. (units?)
[out]rightRight world coordinate. (units?)
[out]bottomBottom world coordinate. (units?)
Todo:
Support more modes than just landscape only mode.

Definition at line 168 of file m_basic.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines