[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: o_arc_basic.c
User: pcjc2
Date: 07/02/25 08:43:20
Modified: . Tag: noscreen o_arc_basic.c o_box_basic.c
o_bus_basic.c o_circle_basic.c o_line_basic.c
o_net_basic.c o_picture.c o_pin_basic.c
o_text_basic.c
Log:
Removed get_..._bounds() functions unused since changing to world coodinates.
Revision Changes Path
No revision
No revision
1.31.2.9 +0 -65 eda/geda/gaf/libgeda/src/o_arc_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_arc_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_arc_basic.c,v
retrieving revision 1.31.2.8
retrieving revision 1.31.2.9
diff -u -b -r1.31.2.8 -r1.31.2.9
--- o_arc_basic.c 25 Feb 2007 13:41:25 -0000 1.31.2.8
+++ o_arc_basic.c 25 Feb 2007 13:43:20 -0000 1.31.2.9
@@ -548,71 +548,6 @@
}
-/*! \brief
- * \par Function Description
- * This function calculates the smallest rectangle the arc can be drawn into.
- * The <B>OBJECT</B> pointed by object is assumed to be an arc.
- * The <B>left</B>, <B>top</B>, <B>right</B> and <B>bottom</B> pointed integers define
- * this rectangle at the end of the function. It is expressed in screen units.
- *
- * The process is divided into two steps : the first step is to calculate the
- * coordinates of the two ends of the arc and the coordinates of the center.
- * They form a first rectangle but (depending on the start angle and the sweep
- * of the arc) not the right.
- *
- * \param [in] w_current The TOPLEVEL object.
- * \param [in] object
- * \param [out] left
- * \param [out] top
- * \param [out] right
- * \param [out] bottom
- */
-void get_arc_bounds(TOPLEVEL *w_current, OBJECT *object,
- int *left, int *top, int *right, int *bottom)
-{
- int x1, y1, x2, y2, x3, y3;
- int radius, start_angle, end_angle;
- int i, angle;
-
- radius = object->arc->screen_width / 2;
- start_angle = object->arc->start_angle % 360;
- end_angle = object->arc->end_angle % 360;
-
- x1 = object->arc->screen_x;
- y1 = object->arc->screen_y;
- x2 = x1 + radius * cos(start_angle * M_PI / 180);
- y2 = y1 - radius * sin(start_angle * M_PI / 180);
- x3 = x1 + radius * cos((start_angle + end_angle) * M_PI / 180);
- y3 = y1 - radius * sin((start_angle + end_angle) * M_PI / 180);
-
- *left = (x1 < x2) ? ((x1 < x3) ? x1 : x3) : ((x2 < x3) ? x2 : x3);
- *right = (x1 > x2) ? ((x1 > x3) ? x1 : x3) : ((x2 > x3) ? x2 : x3);
- *top = (y1 < y2) ? ((y1 < y3) ? y1 : y3) : ((y2 < y3) ? y2 : y3);
- *bottom = (y1 > y2) ? ((y1 > y3) ? y1 : y3) : ((y2 > y3) ? y2 : y3);
-
- /*! \note
- * The previous rectangle is extended to the final one by checking
- * whether the arc is over a main axis (vertical or horizontal).
- * If so, the rectangle is extended in these directions.
- */
- angle = ((int) (start_angle / 90)) * 90;
- for(i = 0; i < 4; i++) {
- angle = angle + 90;
- if(angle < start_angle + end_angle) {
- if(angle % 360 == 0) *right = x1 + radius;
- if(angle % 360 == 90) *top = y1 - radius;
- if(angle % 360 == 180) *left = x1 - radius;
- if(angle % 360 == 270) *bottom = y1 + radius;
- } else {
- break;
- }
- }
-
- /* PB : bounding box has to take into account the width of the line it is
- composed with, ie adding/substracting half the width to this box */
- /* PB : but width is unknown here */
-
-}
/*! \brief
* \par Function Description
1.26.2.8 +0 -30 eda/geda/gaf/libgeda/src/o_box_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_box_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_box_basic.c,v
retrieving revision 1.26.2.7
retrieving revision 1.26.2.8
diff -u -b -r1.26.2.7 -r1.26.2.8
--- o_box_basic.c 25 Feb 2007 13:41:25 -0000 1.26.2.7
+++ o_box_basic.c 25 Feb 2007 13:43:20 -0000 1.26.2.8
@@ -644,36 +644,6 @@
}
-/*! \brief Get BOX bounding rectangle.
- * \par Function Description
- * This function sets the <B>left</B>, <B>top</B>, <B>right</B> and <B>bottom</B>
- * parameters to the bounding rectangle of the box object described in
- * <B>*box</B> in SCREEN units.
- *
- * \param [in] w_current The TOPLEVEL object.
- * \param [in] box BOX OBJECT to read coordinates from.
- * \param [out] left Left box coordinate in SCREEN units.
- * \param [out] top Top box coordinate in SCREEN units.
- * \param [out] right Right box coordinate in SCREEN units.
- * \param [out] bottom Bottom box coordinate in SCREEN units.
- */
-void get_box_bounds(TOPLEVEL *w_current, BOX *box,
- int *left, int *top, int *right, int *bottom)
-{
- *left = box->screen_upper_x;
- *top = box->screen_upper_y;
- *right = box->screen_lower_x;
- *bottom = box->screen_lower_y;
-
- /* PB : bounding box has to take into account the width of the line */
- /* PB : but line width is unknown here */
-
- *left = *left - 4;
- *top = *top - 4;
- *right = *right + 4;
- *bottom = *bottom + 4;
-}
-
/*! \brief Get BOX bounding rectangle in WORLD coordinates.
* \par Function Description
* This function sets the <B>left</B>, <B>top</B>, <B>right</B> and <B>bottom</B>
1.17.2.7 +0 -29 eda/geda/gaf/libgeda/src/o_bus_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_bus_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_bus_basic.c,v
retrieving revision 1.17.2.6
retrieving revision 1.17.2.7
diff -u -b -r1.17.2.6 -r1.17.2.7
--- o_bus_basic.c 25 Feb 2007 13:41:25 -0000 1.17.2.6
+++ o_bus_basic.c 25 Feb 2007 13:43:20 -0000 1.17.2.7
@@ -47,35 +47,6 @@
* \par Function Description
*
*/
-void get_bus_bounds(TOPLEVEL *w_current, LINE *line, int *left, int *top,
- int *right, int *bottom)
-{
- *left = w_current->width;
- *top = w_current->height;
- *right = 0;
- *bottom = 0;
-
- if (line->screen_x[0] < *left) *left = line->screen_x[0];
- if (line->screen_x[0] > *right) *right = line->screen_x[0];
- if (line->screen_y[0] < *top) *top = line->screen_y[0];
- if (line->screen_y[0] > *bottom) *bottom = line->screen_y[0];
-
- if (line->screen_x[1] < *left) *left = line->screen_x[1];
- if (line->screen_x[1] > *right) *right = line->screen_x[1];
- if (line->screen_y[1] < *top) *top = line->screen_y[1];
- if (line->screen_y[1] > *bottom) *bottom = line->screen_y[1];
-
- *left = *left - 4;
- *top = *top - 4;
-
- *right = *right + 4;
- *bottom = *bottom + 4;
-}
-
-/* \brief
- * \par Function Description
- *
- */
void world_get_bus_bounds(TOPLEVEL *w_current, LINE *line, int *left, int *top,
int *right, int *bottom)
{
1.27.2.8 +0 -35 eda/geda/gaf/libgeda/src/o_circle_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_circle_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_circle_basic.c,v
retrieving revision 1.27.2.7
retrieving revision 1.27.2.8
diff -u -b -r1.27.2.7 -r1.27.2.8
--- o_circle_basic.c 25 Feb 2007 13:41:25 -0000 1.27.2.7
+++ o_circle_basic.c 25 Feb 2007 13:43:20 -0000 1.27.2.8
@@ -565,41 +565,6 @@
}
-/*! \brief Get circle bounding rectangle.
- * \par Function Description
- * This function sets the <B>left</B>, <B>top</B>, <B>right</B>
- * and <B>bottom</B> pointed variables to the boundings of the circle object
- * described in <B>*circle</B> in screen unit.
- *
- * The function finds the smallest rectangle that cover this circle.
- *
- * \param [in] w_current The TOPLEVEL object.
- * \param [in] circle Circle OBJECT to read coordinates from.
- * \param [out] left Left circle coordinate in SCREEN units.
- * \param [out] top Top circle coordinate in SCREEN units.
- * \param [out] right Right circle coordinate in SCREEN units.
- * \param [out] bottom Bottom circle coordinate in SCREEN units.
- */
-void get_circle_bounds(TOPLEVEL *w_current, CIRCLE *circle,
- int *left, int *top,
- int *right, int *bottom)
-{
- *left = circle->screen_x - circle->screen_radius;
- *top = circle->screen_y - circle->screen_radius;
- *right = circle->screen_x + circle->screen_radius;
- *bottom = circle->screen_y + circle->screen_radius;
-
- /* PB : need to take into account the width of the line */
-
- /* out temp
- *left = *left - 4;
- *top = *top - 4;
-
- *right = *right + 4;
- *bottom = *bottom + 4;
- */
-}
-
/*! \brief Get circle bounding rectangle in WORLD coordinates.
* \par Function Description
* This function sets the <B>left</B>, <B>top</B>, <B>right</B> and <B>bottom</B>
1.26.2.8 +0 -40 eda/geda/gaf/libgeda/src/o_line_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_line_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_line_basic.c,v
retrieving revision 1.26.2.7
retrieving revision 1.26.2.8
diff -u -b -r1.26.2.7 -r1.26.2.8
--- o_line_basic.c 25 Feb 2007 13:41:25 -0000 1.26.2.7
+++ o_line_basic.c 25 Feb 2007 13:43:20 -0000 1.26.2.8
@@ -533,46 +533,6 @@
}
-/*! \brief Get line bounding rectangle.
- * \par Function Description
- * This function sets the <B>left</B>, <B>top</B>, <B>right</B> and
- * <B>bottom</B> parameters to the boundings of the line object described
- * by <B>*line</B> in screen units.
- *
- * \param [in] w_current The TOPLEVEL object.
- * \param [in] line line OBJECT to read coordinates from.
- * \param [out] left Left line coordinate in SCREEN units.
- * \param [out] top Top line coordinate in SCREEN units.
- * \param [out] right Right line coordinate in SCREEN units.
- * \param [out] bottom Bottom line coordinate in SCREEN units.
- */
-void get_line_bounds(TOPLEVEL *w_current, LINE *line, int *left, int *top,
- int *right, int *bottom)
-{
- *left = w_current->width;
- *top = w_current->height;
- *right = 0;
- *bottom = 0;
-
- if (line->screen_x[0] < *left) *left = line->screen_x[0];
- if (line->screen_x[0] > *right) *right = line->screen_x[0];
- if (line->screen_y[0] < *top) *top = line->screen_y[0];
- if (line->screen_y[0] > *bottom) *bottom = line->screen_y[0];
-
- if (line->screen_x[1] < *left) *left = line->screen_x[1];
- if (line->screen_x[1] > *right) *right = line->screen_x[1];
- if (line->screen_y[1] < *top) *top = line->screen_y[1];
- if (line->screen_y[1] > *bottom) *bottom = line->screen_y[1];
-
- /* PB : bounding box has to take into account the width of the line */
- /* PB : but line width is unknown here */
-
- *left = *left - 4;
- *top = *top - 4;
- *right = *right + 4;
- *bottom = *bottom + 4;
-}
-
/*! \brief Get line bounding rectangle in WORLD coordinates.
* \par Function Description
* This function sets the <B>left</B>, <B>top</B>, <B>right</B> and
1.34.2.7 +0 -45 eda/geda/gaf/libgeda/src/o_net_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_net_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_net_basic.c,v
retrieving revision 1.34.2.6
retrieving revision 1.34.2.7
diff -u -b -r1.34.2.6 -r1.34.2.7
--- o_net_basic.c 25 Feb 2007 13:41:25 -0000 1.34.2.6
+++ o_net_basic.c 25 Feb 2007 13:43:20 -0000 1.34.2.7
@@ -52,51 +52,6 @@
* \param [out] right
* \param [out] bottom
*/
-void get_net_bounds(TOPLEVEL *w_current, LINE *line, int *left, int *top,
- int *right, int *bottom)
-{
- *left = w_current->width;
- *top = w_current->height;
- *right = 0;
- *bottom = 0;
-
- if (line->screen_x[0] < *left)
- *left = line->screen_x[0];
- if (line->screen_x[0] > *right)
- *right = line->screen_x[0];
- if (line->screen_y[0] < *top)
- *top = line->screen_y[0];
- if (line->screen_y[0] > *bottom)
- *bottom = line->screen_y[0];
-
- if (line->screen_x[1] < *left)
- *left = line->screen_x[1];
- if (line->screen_x[1] > *right)
- *right = line->screen_x[1];
- if (line->screen_y[1] < *top)
- *top = line->screen_y[1];
- if (line->screen_y[1] > *bottom)
- *bottom = line->screen_y[1];
-
- *left = *left - 4;
- *top = *top - 4;
-
- *right = *right + 4;
- *bottom = *bottom + 4;
-}
-
-
-/*! \todo Finish function documentation!!!
- * \brief
- * \par Function Description
- *
- * \param [in] w_current The TOPLEVEL object.
- * \param [in] line
- * \param [out] left
- * \param [out] top
- * \param [out] right
- * \param [out] bottom
- */
void world_get_net_bounds(TOPLEVEL *w_current, LINE *line, int *left,
int *top, int *right, int *bottom)
{
1.5.2.7 +0 -23 eda/geda/gaf/libgeda/src/o_picture.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_picture.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_picture.c,v
retrieving revision 1.5.2.6
retrieving revision 1.5.2.7
diff -u -b -r1.5.2.6 -r1.5.2.7
--- o_picture.c 25 Feb 2007 13:41:25 -0000 1.5.2.6
+++ o_picture.c 25 Feb 2007 13:43:20 -0000 1.5.2.7
@@ -480,29 +480,6 @@
}
-/*! \brief Get picture bounding rectangle.
- * \par Function Description
- * This function sets the <B>left</B>, <B>top</B>, <B>right</B> and
- * <B>bottom</B> parameters to the boundings of the picture object described
- * in <B>*picture</B> in SCREEN units.
- *
- * \param [in] w_current The TOPLEVEL object.
- * \param [in] picture Picture OBJECT to read coordinates from.
- * \param [out] left Left picture coordinate in SCREEN units.
- * \param [out] top Top picture coordinate in SCREEN units.
- * \param [out] right Right pircture coordinate in SCREEN units.
- * \param [out] bottom Bottom picture coordinate in SCREEN units.
- */
-void get_picture_bounds(TOPLEVEL *w_current, PICTURE *picture,
- int *left, int *top, int *right, int *bottom)
-{
- *left = picture->screen_upper_x;
- *top = picture->screen_upper_y;
- *right = picture->screen_lower_x;
- *bottom = picture->screen_lower_y;
-
-}
-
/*! \brief Get picture bounding rectangle in WORLD coordinates.
* \par Function Description
* This function sets the <B>left</B>, <B>top</B>, <B>right</B> and
1.24.2.7 +0 -30 eda/geda/gaf/libgeda/src/o_pin_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_pin_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_pin_basic.c,v
retrieving revision 1.24.2.6
retrieving revision 1.24.2.7
diff -u -b -r1.24.2.6 -r1.24.2.7
--- o_pin_basic.c 25 Feb 2007 13:41:25 -0000 1.24.2.6
+++ o_pin_basic.c 25 Feb 2007 13:43:20 -0000 1.24.2.7
@@ -46,36 +46,6 @@
* \par Function Description
*
*/
-void get_pin_bounds(TOPLEVEL *w_current, LINE *line, int *left, int *top,
- int *right, int *bottom)
-{
- *left = w_current->width;
- *top = w_current->height;
- *right = 0;
- *bottom = 0;
-
- if (line->screen_x[0] < *left) *left = line->screen_x[0];
- if (line->screen_x[0] > *right) *right = line->screen_x[0];
- if (line->screen_y[0] < *top) *top = line->screen_y[0];
- if (line->screen_y[0] > *bottom) *bottom = line->screen_y[0];
-
- if (line->screen_x[1] < *left) *left = line->screen_x[1];
- if (line->screen_x[1] > *right) *right = line->screen_x[1];
- if (line->screen_y[1] < *top) *top = line->screen_y[1];
- if (line->screen_y[1] > *bottom) *bottom = line->screen_y[1];
-
- *left = *left - 4;
- *top = *top - 4;
-
- *right = *right + 4;
- *bottom = *bottom + 4;
-}
-
-/*! \todo Finish function documentation!!!
- * \brief
- * \par Function Description
- *
- */
void world_get_pin_bounds(TOPLEVEL *w_current, LINE *line, int *left, int *top,
int *right, int *bottom)
{
1.25.2.6 +0 -12 eda/geda/gaf/libgeda/src/o_text_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_text_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_text_basic.c,v
retrieving revision 1.25.2.5
retrieving revision 1.25.2.6
diff -u -b -r1.25.2.5 -r1.25.2.6
--- o_text_basic.c 25 Feb 2007 13:41:25 -0000 1.25.2.5
+++ o_text_basic.c 25 Feb 2007 13:43:20 -0000 1.25.2.6
@@ -66,18 +66,6 @@
* \par Function Description
*
*/
-void get_text_bounds(TOPLEVEL *w_current, OBJECT *o_current,
- int *left, int *top, int *right, int *bottom)
-{
- get_object_list_bounds(w_current, o_current->text->prim_objs, left, top,
- right, bottom);
-}
-
-/*! \todo Finish function documentation!!!
- * \brief
- * \par Function Description
- *
- */
int world_get_text_bounds(TOPLEVEL *w_current, OBJECT *o_current, int *left,
int *top, int *right, int *bottom)
{
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs