#include <prmio.h>
See class definition in hearder file "prmio.h". For specification see class notes of course CIV-2802 "Sistemas Graficos para Engenharia", period 2011.1. Revisions:
| |
| static int | Interpret (FILE *fd) |
| This function interprets the commands in the given file (given by a pointer to its descriptor structure) and creates in memory a list of primitives resulting from this interpretation. | |
| static void | WriteList (FILE *fd) |
| This function writes current primitive list in memory to the specified file. | |
| static int | NextLabel (FILE *fd, char *label) |
| This function finds the next "%" character in the input file and reads the label next to it. | |
| static long int | GetColorCode (char *color_label) |
| This function returns the RGB coded color that corresponds to a given color label. | |
|
|
This function returns the RGB coded color that corresponds to a given color label.
Definition at line 66 of file prmio.cpp. References Dsp::BLACK, Dsp::BLUE, Dsp::CYAN, Dsp::DARK_BLUE, Dsp::DARK_CYAN, Dsp::DARK_GRAY, Dsp::DARK_GREEN, Dsp::DARK_MAGENTA, Dsp::DARK_RED, Dsp::DARK_YELLOW, Dsp::GRAY, Dsp::GREEN, Dsp::MAGENTA, Dsp::RED, Dsp::WHITE, and Dsp::YELLOW. Referenced by Interpret(). |
|
|
This function interprets the commands in the given file (given by a pointer to its descriptor structure) and creates in memory a list of primitives resulting from this interpretation. The following commands are currently treated (please, see documentation in header file "prm.h" concerning the functions used to create a list of primitives): CREATE.FRONT type Creates a new primitive with an empty geometry and puts it at the beginning of the list of primitives. The primitive type is indicated by an integer code: 1 for quadrilateral primitives 2 for circle primitives CREATE.BACK type Creates a new primitive with an empty geometry and puts it at the end of the list of primitives. The primitive type is indicated by an integer code: 1 for quadrilateral primitives 2 for circle primitives MOVE.FRONT Moves current primitive to the beginning of list of primitives. MOVE.BACK Moves current primitive to the end of list of primitives. SET.GEOM Sets the geometry data of current primitive by the specified data: For quadrilateral primitives, its vertex coordinates: x0 y0 x1 y1 x2 y2 x3 y3 For circle primitives, its center coordinates and radius: xc yc r SET.COLOR color Specifies the color of current primitive. The color is indicated by one of the strings (sequence of characters) below: WHITE GRAY DARK_GRAY BLACK RED DARK_RED GREEN DARK_GREEN BLUE DARK_BLUE YELLOW DARK_YELLOW MAGENTA DARK_MAGENTA CYAN DARK_CYAN SET.COLOR_CODE color_code Specifies the color code of current primitive. The color code is a long int variable in which the color RGB components are codificated, as in CD graphics system. SET.HEIGHT height Specifies the height of current primitive (used only in 3D). TRANSLATE dx dy Translates current primitive using specified translation factors (floating point numbers dx and dy). TRANSLATE.VERTEX id dx dy Translates one of the vertices of current primitive using specified translation factors (floating point numbers dx and dy). The target vertex is indicated by an integer number (id) between 0 and the number of primivite vertices minus one. TRANSLATE.SIDE id dx dy Translates one of the sides of current primitive using specified translation factors (floating point numbers dx and dy). The target side is indicated by an integer number (id) between 0 and the number of primivite vertices minus one. END Indicates the end of primitive file interpretation.
Definition at line 113 of file prmio.cpp. References GetColorCode(), Prm::MoveBack(), Prm::MoveFront(), NextLabel(), Prm::PRM_CIRC, Prm::PRM_QUAD, Prm::Read(), Prm::SetColor(), Prm::SetHeight(), Prm::Translate(), Prm::TranslateSide(), and Prm::TranslateVertex(). Referenced by Model::Open(). |
|
||||||||||||
|
This function finds the next "%" character in the input file and reads the label next to it.
Definition at line 49 of file prmio.cpp. Referenced by Interpret(). |
|
|
This function writes current primitive list in memory to the specified file. The format used to write the primitive list is the same used to interpret it (see function prmioInterpret above). The primitives are written in the same order that are positioned in the list and are indicated by their set of vertex coordinates. Therefore, the following commands are used to write primitive data to a file: CREATE.BACK type Specifies a new primitive with an empty geometry to be placed at the of the list of primitives. The primitive type is indicated by an integer code: 1 for quadrilateral primitives 2 for circle primitives SET.GEOM Specifies the geometry data of current primitive the following data: For quadrilateral primitives, its vertex coordinates: x0 y0 x1 y1 x2 y2 x3 y3 For circle primitives, its center coordinates and radius: xc yc r SET.COLOR_CODE color_code Specifies the color code of current primitive. The color code is a long int variable in which the color RGB components are codificated, as in CD graphics system. SET.HEIGHT height Specifies the height of current primitive (used only in 3D). END Indicates the end of primitive specification.
Definition at line 237 of file prmio.cpp. References Prm::First(), Prm::GetColor(), Prm::GetHeight(), Prm::GetType(), Prm::Next(), and Prm::Write(). Referenced by Model::Save(). |
1.4.2-20050421