#include <quad.h>
See class definition in hearder file "quad.h". For specification see class notes of course CIV-2802 "Sistemas Graficos para Engenharia", period 2010.1. Revisions:
| |
| Quad () | |
| This function creates a new quadrilateral primitive. | |
| Quad (int back) | |
| This function creates a new quadrilateral primitive. | |
| virtual | ~Quad () |
| This function removes a quadrileral 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 quadrilateral 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 quadrilateral primitive to a file (given by its pointer). | |
| int | GetNPts (void) |
| This function returns (as its value) the number of vertices of the current quadrilateral primitive. | |
| void | SetCoords (int id, double x, double y) |
| This function replaces the x and y coordinates of a vertex of the current quadrilateral primitive by the given pair of coordinates. | |
| void | GetCoords (int id, double *x, double *y) |
| This function returns the x and y coordinates of a vertex of the current quadrilateral primitive. | |
| void | Set1stPt (double x, double y) |
| This function is used during interactive construction of a quadrilateral primitive. | |
| void | Set2ndPt (double x, double y) |
| This function is used during interactive construction of a quadrilateral primitive. | |
| int | PickArea (double x, double y) |
| This function checks whether a given point is inside the current quadrilateral primitive. | |
| int | PickVertex (double x, double y, double tol, int *id) |
| This function selects a vertex of the current quadrilateral primitive based on the given point position. | |
| int | PickSide (double x, double y, double tol, int *id) |
| This function selects a side of the current quadrilateral primitive based on the given point position. | |
| void | Translate (double dx, double dy) |
| This function translates the current quadrilateral primitive. | |
| void | TranslateVertex (int id, double dx, double dy) |
| This function translates a vertex of the current quadrilateral primitive using the given translation factors. | |
| void | TranslateSide (int id, double dx, double dy) |
| This function translates the two vertices of a side of the current quadrilateral primitive using the given translation factors. | |
| void | GetBox (double *xmin, double *xmax, double *ymin, double *ymax) |
| This function returns the limiting rectangle that involves the current quadrilateral primitive. | |
| void | DisplayBoundary (void) |
| This function displays the boundary of the current quadrilateral primitive). | |
| void | DisplayInterior (void) |
| This function displays the interior of the current quadrilateral primitive. | |
| void | DisplaySolid (void) |
| Function to display a solid version of a quadrilateral primitive. | |
| void | HighltSolid (void) |
| Function to highlight a solid version of a quadrilateral primitive. | |
| void | DisplayZbuffer (void) |
| Function to send a solid version of a quadrilateral primitive to the zbuffer module to be projected and displayed. | |
| void | BuildSolidPrm (Pnt3d *solid_prm) |
| This function returns an array of points that represents the solid version of a quadrilateral primitive. | |
| static void | PickCode (double x, double y, double xmin, double xmax, double ymin, double ymax, int cod[4]) |
| This function computes a code vector for a picking point with respect to a window (rectangle given by its limiting coordinates). | |
| static int | PickLine (double x, double y, double pick_tol, double x0, double y0, double x1, double y1) |
| This function checks to see whether a given point (x,y) is close to a line (x0, y0, x1, y1). | |
| static void | FaceNormal (Pnt3d *p0, Pnt3d *p1, Pnt3d *p2, Pnt3d *p3, Vec3d *normal) |
| This function computes the normal vector of a quadrilateral polygon. | |
Protected Attributes | |
| Coord | p [4] |
| Primitive vertices. | |
Classes | |
| struct | Pnt3d |
| 3D point struct More... | |
| struct | Vec3d |
| 3D vector struct More... | |
|
|
This function creates a new quadrilateral primitive. It sets its default vertex coordinates 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. The quadrilateral vertices are ordered in counter-clockwise order:
(id = 3) (id = 2) Default vertex coordinates: id = 0 ==> (x0 = 0.0, y0 = 0.0) id = 1 ==> (x1 = 1.0, y1 = 0.0) id = 2 ==> (x2 = 1.0, y2 = 1.0) id = 3 ==> (x3 = 0.0, y3 = 1.0) Definition at line 60 of file quad.cpp. References p, Prm::PRM_QUAD, and Prm::type. |
|
|
This function creates a new quadrilateral primitive. It sets its default vertex coordinates 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 79 of file quad.cpp. References p, Prm::PRM_QUAD, and Prm::type. |
|
|
This function removes a quadrileral 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 returns an array of points that represents the solid version of a quadrilateral primitive. The solid version is a prism that has the 2D primitive as its base and height equal to the primitive height. The solid prism is built in such a way that each of its base faces has a normal vector pointing outwards the prism when traversing its vertices in counter-clockwise order and following the right-hand rule.
Definition at line 218 of file quad.cpp. References FaceNormal(), Prm::height, p, Quad::Pnt3d::x, Quad::Pnt3d::y, Quad::Vec3d::z, and Quad::Pnt3d::z. Referenced by DisplaySolid(), DisplayZbuffer(), and HighltSolid(). |
|
|
This function displays the boundary of the current quadrilateral primitive). Straight lines are used used to display the primitive edges and marks are used to display its vertices. 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, or mark type are specified outside this function. Implements Prm. Definition at line 504 of file quad.cpp. References GetCoords(). |
|
|
This function displays the interior of the current quadrilateral 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. Definition at line 522 of file quad.cpp. References GetCoords(). |
|
|
Function to display a solid version of a quadrilateral primitive. The solid version is a prism that has the 2D primitive as its base and height equal to the primitive height. This function fills the quadrilateral shape of the solid prism faces with the current color. It uses OpenGL display functions.
Implements Prm. Definition at line 539 of file quad.cpp. References BuildSolidPrm(), FaceNormal(), Prm::height, p, Quad::Vec3d::x, Quad::Vec3d::y, and Quad::Vec3d::z. |
|
|
Function to send a solid version of a quadrilateral 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 687 of file quad.cpp. References BuildSolidPrm(), Prm::color, FaceNormal(), Prm::height, p, Quad::Vec3d::x, Quad::Vec3d::y, Quad::Vec3d::z, Dsp::ZbfBeginPoly(), Dsp::ZbfEndPoly(), and Dsp::ZbfVertex(). |
|
||||||||||||||||||||||||
|
This function computes the normal vector of a quadrilateral polygon. It uses the cross product of the polygon edges.
Definition at line 178 of file quad.cpp. References Quad::Pnt3d::x, Quad::Vec3d::x, Quad::Pnt3d::y, Quad::Vec3d::y, Quad::Pnt3d::z, and Quad::Vec3d::z. Referenced by BuildSolidPrm(), DisplaySolid(), and DisplayZbuffer(). |
|
||||||||||||||||||||
|
This function returns the limiting rectangle that involves the current quadrilateral 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. Definition at line 488 of file quad.cpp. References p. |
|
||||||||||||||||
|
This function returns the x and y coordinates of a vertex of the current quadrilateral primitive. The vertex is indicated by an index between 0 and 3. Nothing will happen if the given index is outside this range. The quadrilateral vertices are ordered in counter-clockwise order:
(id = 3) (id = 2)
Implements Prm. Definition at line 329 of file quad.cpp. References p. Referenced by DisplayBoundary(), DisplayInterior(), PickArea(), PickSide(), and PickVertex(). |
|
|
This function returns (as its value) the number of vertices of the current quadrilateral primitive.
Implements Prm. |
|
|
Function to highlight a solid version of a quadrilateral primitive. The solid version is a prism that has the 2D primitive as its base and height equal to the primitive height. This function 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 618 of file quad.cpp. References BuildSolidPrm(), Prm::height, and p. |
|
||||||||||||
|
This function checks whether a given point is inside the current quadrilateral primitive. The adopted algorithm is the so called semi-infinite ray algorithm that starts at the given point and goes in the horizontal direction to positive infinity. If the number of intersections of the ray with the polygon boundary is odd, the point is inside the polygon. If the number of intersections is even, the point is outside. Please refer to class notes of course CIV 2802 - Sistemas Graficos para Engenharia - PUC-Rio.
Implements Prm. Definition at line 356 of file quad.cpp. References GetCoords(). |
|
||||||||||||||||||||||||||||||||
|
This function computes a code vector for a picking point with respect to a window (rectangle given by its limiting coordinates). This code vector is used in function quadPickLine below.
Definition at line 110 of file quad.cpp. Referenced by PickLine(). |
|
||||||||||||||||||||||||||||||||
|
This function checks to see whether a given point (x,y) is close to a line (x0, y0, x1, y1). The adopted algorithm is based on clipping the given line by a tolerance window that is defined by the given point and the current tolerance value. Please refer to class notes of course CIV 2802 - Sistemas Graficos para Engenharia - PUC-Rio.
Definition at line 121 of file quad.cpp. References PickCode(). Referenced by PickSide(). |
|
||||||||||||||||||||
|
This function selects a side of the current quadrilateral primitive based on the given point position. The target side is indicated by an index, which has a value between 0 and 3. The quadrilateral sides are ordered in counter-clockwise order:
(id = 3) (id = 2)
Implements Prm. Definition at line 429 of file quad.cpp. References GetCoords(), and PickLine(). |
|
||||||||||||||||||||
|
This function selects a vertex of the current quadrilateral primitive based on the given point position. In case the given point is close to a vertex of the primitive, the index of the found vertex is returned. The index is a value between 0 and 3. The quadrilateral vertices are ordered in counter-clockwise order:
(id = 3) (id = 2)
Implements Prm. Definition at line 408 of file quad.cpp. References Prm::ABS(), and GetCoords(). |
|
|
This function reads geometry data of current quadrilateral primitive from a file (given by its pointer) and loads the data into the primitive attributes.
Implements Prm. Definition at line 287 of file quad.cpp. References p. |
|
||||||||||||
|
This function is used during interactive construction of a quadrilateral primitive. It sets the x and y coordinates of the first construction point of the current quadrilateral primitive by the given pair of coordinates. The first construction point corresponds to the first corner vertex of the quadrilateral primitive (with id = 0). The quadrilateral vertices are ordered in counter-clockwise order:
(id = 3) (id = 2) The coordinates of vertices with id = 1 and id = 3 are set in such a way the quadrilateral will have horizontal and vertical sides. That is, the following is set: x0 = x3 = x and y0 = y1 = y.
Implements Prm. Definition at line 340 of file quad.cpp. References p. |
|
||||||||||||
|
This function is used during interactive construction of a quadrilateral primitive. It sets the x and y coordinates of the second construction point of the current quadrilateral primitive by the given pair of coordinates. The second construction point corresponds to the third corner vertex of the quadrilateral primitive (with id = 2). The quadrilateral vertices are ordered in counter-clockwise order:
(id = 3) (id = 2) The coordinates of vertices with id = 1 and id = 3 are set in such a way the quadrilateral will have horizontal and vertical sides. That is, the following is set: x2 = x1 = x and y2 = y3 = y.
Implements Prm. Definition at line 348 of file quad.cpp. References p. |
|
||||||||||||||||
|
This function replaces the x and y coordinates of a vertex of the current quadrilateral primitive by the given pair of coordinates. The vertex is indicated by an index between 0 and 3. Nothing will happen if the given index is outside this range. The quadrilateral vertices are ordered in counter-clockwise order:
(id = 3) (id = 2)
Implements Prm. Definition at line 318 of file quad.cpp. References p. |
|
||||||||||||
|
This function translates the current quadrilateral primitive. All the vertices of the primitive are translated by the given translation factors.
Implements Prm. Definition at line 451 of file quad.cpp. References p. |
|
||||||||||||||||
|
This function translates the two vertices of a side of the current quadrilateral primitive using the given translation factors. The target side is indicated by an index, which should have a value between 0 and 3. Nothing will happen if the given index is outside this range. The index of a side corresponds to the index of its first vertex. The quadrilateral sides are ordered in counter-clockwise order:
(id = 3) (id = 2)
Implements Prm. Definition at line 475 of file quad.cpp. References p. |
|
||||||||||||||||
|
This function translates a vertex of the current quadrilateral primitive using the given translation factors. The target vertex is indicated by an index between 0 and 3. Nothing will happen if the given index is outside this range. The quadrilateral vertices are ordered in counter-clockwise order:
(id = 3) (id = 2)
Implements Prm. Definition at line 464 of file quad.cpp. References p. |
|
|
This function writes the geometry attribute data of current quadrilateral primitive to a file (given by its pointer).
Implements Prm. Definition at line 299 of file quad.cpp. References p. |
|
|
Primitive vertices.
Definition at line 83 of file quad.h. Referenced by BuildSolidPrm(), DisplaySolid(), DisplayZbuffer(), GetBox(), GetCoords(), HighltSolid(), Quad(), Read(), Set1stPt(), Set2ndPt(), SetCoords(), Translate(), TranslateSide(), TranslateVertex(), and Write(). |
1.4.2-20050421