#include <circ.h>
See class definition in hearder file "circ.h". For specification see class notes of course CIV-2802 "Sistemas Graficos para Engenharia", period 2010.1. Revisions:
| |
| Circ () | |
| This function creates a new circle primitive. | |
| Circ (int back) | |
| This function creates a new circle primitive. | |
| virtual | ~Circ () |
| This function removes a circle primitive from the current list of primitives and releases memory that is used by it. | |
| void | Read (FILE *fd) |
| This function reads geometry data of current circle primitive from a file (given by its pointer) and loads the data into the primitive attributes. | |
| void | Write (FILE *fd) |
| This function writes the geometry attribute data of current circle primitive to a file (given by its pointer). | |
| int | GetNPts (void) |
| This function returns (as its value) the number of vertices of the current circle primitive. | |
| void | SetCoords (int id, double x, double y) |
| This function recomputes the radius of the current circle primitive based on the given point location and on the circle center point. | |
| void | GetCoords (int id, double *x, double *y) |
| This function returns the x and y coordinates of a point of the current circle primitive. | |
| void | Set1stPt (double x, double y) |
| This function is used during interactive construction of a circle primitive. | |
| void | Set2ndPt (double x, double y) |
| This function is used during interactive construction of a circle primitive. | |
| int | PickArea (double x, double y) |
| This function checks whether a given point is inside the current circle primitive. | |
| int | PickVertex (double x, double y, double tol, int *id) |
| This function selects a vertex on the boundary of the current circle primitive based on the given point position. | |
| int | PickSide (double x, double y, double tol, int *id) |
| This is a dummy function that does not do anything. | |
| void | Translate (double dx, double dy) |
| This function translates the current circle primitive. | |
| void | TranslateVertex (int id, double dx, double dy) |
| This function translates a vertex on the boundary of the current circle primitive using the given translation factors. | |
| void | TranslateSide (int id, double dx, double dy) |
| This is a dummy function that does not do anything. | |
| void | GetBox (double *xmin, double *xmax, double *ymin, double *ymax) |
| This function returns the limiting rectangle that involves the current circle primitive. | |
| void | DisplayBoundary (void) |
| This function displays the boundary of the current circle primitive. | |
| void | DisplayInterior (void) |
| This function displays the interior of the current circle primitive. | |
| void | DisplaySolid (void) |
| Function to display a solid version of a circle primitive. | |
| void | HighltSolid (void) |
| Function to highlight a solid version of a circle primitive. | |
| void | DisplayZbuffer (void) |
| Function to send a solid version of a circle primitive to the zbuffer module to be projected and displayed. | |
| void | GetLateralNormal (Coord *p, Coord *normal) |
| This functions computes the normal vector at a point on the current circle object. | |
| static const int | CIRC_SEGS = 32 |
| Number of segments to discretize circle. | |
| static const double | M_PI = 3.141592654 |
| The number PI. | |
Protected Attributes | |
| Coord | c |
| Circle center. | |
| double | r |
| Circle radius. | |
|
|
This function creates a new circle primitive. It sets its default center coordinates - (0.0,0.0) - and radius (1.0) -, and puts it at the beginning of the list of primitives. The head pointer to the list is modified accordingly. The special case of a current empty list is also treated. Definition at line 72 of file circ.cpp. References c, Prm::PRM_CIRC, r, and Prm::type. |
|
|
This function creates a new circle primitive. It sets its default center coordinates - (0.0,0.0) - and radius (1.0) -, and puts it at the end of the list of primitives if the "back" argument is true (1). If the "back" is false (0), the primitive is put at the beginning of the list of primitives. The head pointer to the list is modified accordingly. The special case of a current empty list is also treated.
Definition at line 87 of file circ.cpp. References c, Prm::PRM_CIRC, r, and Prm::type. |
|
|
This function removes a circle primitive from the current list of primitives and releases memory that is used by it. The head pointer to the list of primitives may be modified accordingly. The special case of a resulting empty list is also treated. |
|
|
This function displays the boundary of the current circle primitive. Marks are used to display the four vertices of the circle as indicated below:
(id = 1) The Canvas Draw (CD) graphics library is used to display the boundary of the primitive. Please refer to CD documentation for additional information. The function only deals with the geometric attributes of the primitive. This means that other attributes such as foreground color, line style are specified outside this function. Implements Prm. |
|
|
This function displays the interior of the current circle primitive. The interior area is filled with the currently specified foreground color. The Canvas Draw (CD) graphics library is used to display the interior of the primitive. Please refer to CD documentation for additional information. The function only deals with the geometric attributes of the primitive. This means that other attributes such as background color or interior style are specified outside this function. Implements Prm. |
|
|
Function to display a solid version of a circle primitive. The solid version is a prism that has the 2D primitive as its base and height equal to the primitive height. This function creates a facet prism that approximates the resulting cylinder and fills the facets of the solid prism faces with the current color. It uses OpenGL display functions.
Implements Prm. Definition at line 327 of file circ.cpp. References c, CIRC_SEGS, GetLateralNormal(), Prm::height, M_PI, and r. |
|
|
Function to send a solid version of a circle primitive to the zbuffer module to be projected and displayed. The solid version is a prism that has the 2D primitive as its base and height equal to the primitive height.
Implements Prm. Definition at line 460 of file circ.cpp. References c, CIRC_SEGS, Prm::color, GetLateralNormal(), Prm::height, M_PI, r, Dsp::ZbfBeginPoly(), Dsp::ZbfEndPoly(), and Dsp::ZbfVertex(). |
|
||||||||||||||||||||
|
This function returns the limiting rectangle that involves the current circle primitive. This rectangle is the primitive bounding box, which is parallel to the x and y axes, with the minimum and maximum x and y coordinates of the primitive's vertices.
Implements Prm. |
|
||||||||||||||||
|
This function returns the x and y coordinates of a point of the current circle primitive. The returned point coordinates correspond to a point on the circle boundary, with x coordinate equal to the x coordinate of the center plus the radius value and with y coordinate equals to the y coordinate of the center. The given index (id) is not used.
Implements Prm. |
|
||||||||||||
|
This functions computes the normal vector at a point on the current circle object.
Definition at line 113 of file circ.cpp. References c. Referenced by DisplaySolid(), and DisplayZbuffer(). |
|
|
This function returns (as its value) the number of vertices of the current circle primitive. In this program it is assumed that a circle has four vertices: the four limiting points on its boundary. The circle vertices are ordered in counter-clockwise order as shown below:
(id = 1)
Implements Prm. |
|
|
Function to highlight a solid version of a circle primitive. The solid version is a prism that has the 2D primitive as its base and height equal to the primitive height. This function creates a facet prism that approximates the resulting cylinder, displays the edges of the prism, and draws marks at its vertices, all with the current color. It uses OpenGL display functions.
Implements Prm. Definition at line 391 of file circ.cpp. References c, CIRC_SEGS, Prm::height, M_PI, and r. |
|
||||||||||||
|
This function checks whether a given point is inside the current circle primitive.
Implements Prm. |
|
||||||||||||||||||||
|
This is a dummy function that does not do anything. It exists just for compatibility with other primitive types.
Implements Prm. |
|
||||||||||||||||||||
|
This function selects a vertex on the boundary of the current circle primitive based on the given point position. The circle vertices are ordered in counter-clockwise order as shown below:
(id = 1)
Implements Prm. Definition at line 199 of file circ.cpp. References Prm::ABS(), c, and r. |
|
|
This function reads geometry data of current circle primitive from a file (given by its pointer) and loads the data into the primitive attributes.
Implements Prm. |
|
||||||||||||
|
This function is used during interactive construction of a circle primitive. It sets the x and y coordinates of the first construction point of the current circle primitive by the given pair of coordinates. The first construction point corresponds to the center point of the circle primitive.
Implements Prm. Definition at line 167 of file circ.cpp. References c. |
|
||||||||||||
|
This function is used during interactive construction of a circle primitive. It sets the x and y coordinates of the second construction point of the current circle primitive by the given pair of coordinates. The second construction point corresponds to any point on the boundary of the circle primitive. The given point coordinates are used to compute the new circle radius based on the current center point.
Implements Prm. |
|
||||||||||||||||
|
This function recomputes the radius of the current circle primitive based on the given point location and on the circle center point. The given index (id) is not used.
Implements Prm. |
|
||||||||||||
|
This function translates the current circle primitive. The center point of the circle is translated by the given translation factors.
Implements Prm. Definition at line 238 of file circ.cpp. References c. |
|
||||||||||||||||
|
This is a dummy function that does not do anything. It exists just for compatibility with other primitive types. Implements Prm. |
|
||||||||||||||||
|
This function translates a vertex on the boundary of the current circle primitive using the given translation factors. The given translation factors are used to compute the new coordinates of the target vertex of the circle. The circle vertices are ordered in counter-clockwise order as shown below:
(id = 1) For vertices with id = 0 or id = 2, only the horizontal translation parameter (dx) is considered to compute the new position of the vertex. For vertices with id = 1 or id = 3, only the vertical translation parameter (dy) is considered to compute the new position of the vertex. The circle radius is recomputed based on the translated vertex coordinates and on the current center point.
Implements Prm. Definition at line 246 of file circ.cpp. References c, Prm::COORD_TOL, and r. |
|
|
This function writes the geometry attribute data of current circle primitive to a file (given by its pointer).
Implements Prm. |
|
|
Circle center.
Definition at line 67 of file circ.h. Referenced by Circ(), DisplayBoundary(), DisplayInterior(), DisplaySolid(), DisplayZbuffer(), GetBox(), GetCoords(), GetLateralNormal(), HighltSolid(), PickArea(), PickVertex(), Read(), Set1stPt(), Set2ndPt(), SetCoords(), Translate(), TranslateVertex(), and Write(). |
|
|
Number of segments to discretize circle.
Definition at line 59 of file circ.cpp. Referenced by DisplaySolid(), DisplayZbuffer(), and HighltSolid(). |
|
|
The number PI.
Definition at line 63 of file circ.cpp. Referenced by DisplaySolid(), DisplayZbuffer(), and HighltSolid(). |
|
|
Circle radius.
Definition at line 71 of file circ.h. Referenced by Circ(), DisplayBoundary(), DisplayInterior(), DisplaySolid(), DisplayZbuffer(), GetBox(), GetCoords(), HighltSolid(), PickArea(), PickVertex(), Read(), Set2ndPt(), SetCoords(), TranslateVertex(), and Write(). |
1.4.2-20050421