#include <prmed.h>
Collaboration diagram for PrmEd:
See class specification in hearder file "prmed.h". For specification see class notes of course CIV-2802 "Sistemas Graficos para Engenharia", period 2011.1. Revisions:
| |
| static void | InitParams (cdCanvas *canvas, Dsp *display) |
| This function initialize the values of the local paramaters of the primitive edition module. | |
| static void | ResetParams (void) |
| This function resets the values of the local paramaters of the primitive edition module. | |
| static void | SetCurType (Prm::Type type) |
| This function specifies the type of the new primitives to be inserted. | |
| static void | UnselectAllPrm (void) |
| This function unselects all primitives and resets the local pointer to the selected primitive. | |
| static void | InsertPrm1stPt (double x, double y, double tol) |
| This function and the next two functions below are used to interactively insert a new primitive in the current model. | |
| static void | EchoPrm2ndPt (double x, double y) |
| This function should be called when there is an event of mouse-move during an interactive creation of a primitive. | |
| static void | InsertPrm2ndPt (double x, double y) |
| This function should be called when there is an event of button-release during an interactive creation of a primitive. | |
| static void | SelectDragPrm (double x, double y, double tol) |
| This function and the two functions below are used to select a primitive and to interactively manipulate its position or shape. | |
| static void | UpdateDragPrm (double x, double y) |
| This function should be called when there is an event of mouse-move, while the mouse button is pressed, during an interactive manipulation of a primitive. | |
| static void | FinishDragPrm (double x, double y) |
| This function should be called when there is an event of mouse button-release at the end of an interactive manipulation of a primitive. | |
| static void | DeleteSelPrm (void) |
| This function deletes a currently selected primitive, eliminating it from the list of primitives. | |
| static void | MoveSelPrmToFront (void) |
| This function moves a currently selected primitive to the front of the list of primitives. | |
| static void | MoveSelPrmToBack (void) |
| This function moves a currently selected primitive to the front of the list of primitives. | |
| static double | GetTolerance (void) |
| This function returns the current tolerance value to be used in primitive edition. | |
| static void | SetColor (long int color) |
| This function sets the color of the currently selected primitive and stores the given color as the current one for the next primitives to be created. | |
| static long int | GetColor (void) |
| This function returns the current color used for the next primitives to be created. | |
| static void | SetMaxHeight (double height) |
| This function sets the maximum primitive height of the entire model. | |
| static void | SetHeightFac (double fac) |
| This function sets the height of the currently selected primitive according to the given factor and the maximum allowable height (which is equal to the maximum size in the XY plane). | |
| static double | GetHeightFac (void) |
| This function returns the value of the currently selected primitive height factor. | |
| static void | DspTmpPrmLines (void) |
| This function displays in XOR mode the boundary lines of the primitive being interactively created or of the current selected primitive being manipulated. | |
| static cdCanvas * | Gdatascreen = 0L |
| CD handle to data canvas. | |
| static Dsp * | dsp = 0L |
| Current display module. | |
| static long int | curr_color = Dsp::WHITE |
| Current display color. | |
| static double | coord_tol = 0.001 |
| Coordinate tolerance value. | |
| static Prm::Coord | first_mousept = { 0.0, 0.0 } |
| First mouse position for a button-press-mouse-move-button-up event. | |
| static int | mouse_has_moved = 0 |
| Flag to indicate that mouse has moved since the first mouse position. | |
| static Prm::Coord | curr_mousept = { 0.0, 0.0 } |
| Current mouse position for a mouse-move event. | |
| static Prm * | sel_prm = 0L |
| Varialble that holds a pointer to the current selected primitive. | |
| static int | sel_vert = -1 |
| Variable that holds an index of the current selected primitive vertex. | |
| static int | sel_side = -1 |
| Variable that holds an index of the current selected primitive side. | |
| static Prm::Type | prm_type = Prm::PRM_QUAD |
| Current primitive type to be attributed to new primitives to be inserted. | |
| static double | max_height = 50.0 |
| Maximum primitive height value (used only in 3D). | |
|
|
This function deletes a currently selected primitive, eliminating it from the list of primitives. Nothing will happen if the current list is empty or if no primitive is currently selected. It redisplays the entire model. Definition at line 461 of file prmed.cpp. References Prm::ChkEmptyModel(), and sel_prm. Referenced by Model::DeleteSelPrm(). |
|
|
This function displays in XOR mode the boundary lines of the primitive being interactively created or of the current selected primitive being manipulated.
Definition at line 108 of file prmed.cpp. References Prm::DisplayBoundary(), dsp, Gdatascreen, sel_prm, and Dsp::XorMode(). Referenced by EchoPrm2ndPt(), and UpdateDragPrm(). |
|
||||||||||||
|
This function should be called when there is an event of mouse-move during an interactive creation of a primitive. Its main objective is to display the boundary of the primitive being created. The primitive geometry is defined temporarely by the mouse location at button-press (specified through a call to function prmedInsertPrm1stPt above) an by the given mouse point location.
Definition at line 217 of file prmed.cpp. References Prj::ABS(), curr_mousept, DspTmpPrmLines(), mouse_has_moved, sel_prm, Prm::Set2ndPt(), Prm::Coord::x, and Prm::Coord::y. Referenced by Model::EchoPrm2ndPt(). |
|
||||||||||||
|
This function should be called when there is an event of mouse button-release at the end of an interactive manipulation of a primitive. The translation parameters used to drag the entire primitive, or one of its vertex or side, are computed based on the given point location. The manipulated primitive is maintained selected, which means that it will appear highlighted when the model is redisplayed at the end of this function.
Definition at line 426 of file prmed.cpp. References Prm::ChkEmptyModel(), curr_mousept, sel_prm, sel_side, sel_vert, Prm::Translate(), Prm::TranslateSide(), Prm::TranslateVertex(), Prm::Coord::x, and Prm::Coord::y. Referenced by Model::FinishDragPrm(). |
|
|
This function returns the current color used for the next primitives to be created. The color is given by a long integer with a coded RGB color (adopted in the CD graphics system). Definition at line 519 of file prmed.cpp. References curr_color. Referenced by Model::GetColor(). |
|
|
This function returns the value of the currently selected primitive height factor. This factor is a ratio between the height of the selected primitive and the maximum allowable height (which is equal to the maximum size in the XY plane). If no primitive is selected, a null value is returned. The function is only used in 3D.
Definition at line 557 of file prmed.cpp. References Prm::ChkEmptyModel(), Prm::GetHeight(), max_height, and sel_prm. Referenced by Model::GetHeightFac(). |
|
|
This function returns the current tolerance value to be used in primitive edition.
Definition at line 492 of file prmed.cpp. References coord_tol. Referenced by Circ::TranslateVertex(). |
|
||||||||||||
|
This function initialize the values of the local paramaters of the primitive edition module. It also stores the handle to the current CD data canvas and the pointer to the current display object.
Definition at line 125 of file prmed.cpp. References dsp, Gdatascreen, and ResetParams(). Referenced by Model::Model(). |
|
||||||||||||||||
|
This function and the next two functions below are used to interactively insert a new primitive in the current model. The present one should be called to setup the module for the creation of a new primitive and to insert the first primitive vertex. This function should be called when there is an event of mouse button-press during an interactive creation of a primitive. The location where this event occur is the position of the first vertex of the new primitive. This function unselects all primitives and redisplays the current model. The current color, which is specified in function SetColor below, is attributed to the new primitive. A null height is set to the new primitive. The primitive is added to the front of the list of primitives. The primitive is selected, which means that it will appear highlighted when the model is redisplayed at the end of this button-press-mouse-move-button-release interaction.
Definition at line 172 of file prmed.cpp. References coord_tol, curr_color, curr_mousept, first_mousept, mouse_has_moved, Prm::PRM_CIRC, Prm::PRM_QUAD, prm_type, sel_prm, Prm::Select(), Prm::Set1stPt(), Prm::SetColor(), Prm::Coord::x, and Prm::Coord::y. Referenced by Model::InsertPrm1stPt(). |
|
||||||||||||
|
This function should be called when there is an event of button-release during an interactive creation of a primitive. Its main objective is to finish up the creating of the primitive. The primitive geometry is defined by the mouse location at button-press (specified through a call to function prmedInsertPrm1stPt above) an by the given mouse point location.
Definition at line 267 of file prmed.cpp. References Prj::ABS(), coord_tol, first_mousept, sel_prm, Prm::Set2ndPt(), Prm::Coord::x, and Prm::Coord::y. Referenced by Model::InsertPrm2ndPt(). |
|
|
This function moves a currently selected primitive to the front of the list of primitives. Nothing will happen if the current list is empty or if no primitive is currently selected. It redisplays the entire model. Definition at line 482 of file prmed.cpp. References Prm::ChkEmptyModel(), Prm::MoveBack(), and sel_prm. Referenced by Model::MoveSelPrmToBack(). |
|
|
This function moves a currently selected primitive to the front of the list of primitives. Nothing will happen if the current list is empty or if no primitive is currently selected. It redisplays the entire model. Definition at line 472 of file prmed.cpp. References Prm::ChkEmptyModel(), Prm::MoveFront(), and sel_prm. Referenced by Model::MoveSelPrmToFront(). |
|
|
This function resets the values of the local paramaters of the primitive edition module.
Definition at line 134 of file prmed.cpp. References coord_tol, curr_color, max_height, mouse_has_moved, Prm::PRM_QUAD, prm_type, sel_prm, sel_side, sel_vert, and Dsp::WHITE. Referenced by InitParams(), Model::Open(), and Model::Reset(). |
|
||||||||||||||||
|
This function and the two functions below are used to select a primitive and to interactively manipulate its position or shape. The present one should be called when there is an event of mouse button-press. The location where this event occur is used to select the target primitive to manipulate. This location is also used to select a vertex or a side of the primitive. The selection searches a primitive starting from the front to the back of the list of primitives. Three types of primitive manipulation can occur:
This function may be used just for selection of a primitive. This occurs when there is no mouse-move after the button-press event. In this case, the button-release mouse position is the same as the button-press mouse position. After selecting a primitive, or one of its vertex or side, the function stores the first mouse point position in a local variable so that it can be used by the two next functions. It also redisplays the entire model so that the selected primitive will appear highlighted. This function may also be used to unselect all the primitives, in case no primitive is selected at the given point location.
Definition at line 302 of file prmed.cpp. References Prm::ChkEmptyModel(), coord_tol, curr_mousept, Prm::First(), first_mousept, mouse_has_moved, Prm::Next(), Prm::PickArea(), Prm::PickSide(), Prm::PickVertex(), sel_prm, sel_side, sel_vert, Prm::Select(), Prm::UnselectAll(), Prm::Coord::x, and Prm::Coord::y. Referenced by Model::SelectDragPrm(). |
|
|
This function sets the color of the currently selected primitive and stores the given color as the current one for the next primitives to be created. The color is given by a long integer with a coded RGB color (adopted in the CD graphics system). If there is one primitive selected, it changes the color of this primitive and redisplays the entire model.
Definition at line 499 of file prmed.cpp. References Prm::ChkEmptyModel(), curr_color, sel_prm, and Prm::SetColor(). Referenced by Model::SetColor(). |
|
|
This function specifies the type of the new primitives to be inserted.
Definition at line 148 of file prmed.cpp. References Prm::PRM_CIRC, Prm::PRM_QUAD, and prm_type. Referenced by Model::SetPrmType(). |
|
|
This function sets the height of the currently selected primitive according to the given factor and the maximum allowable height (which is equal to the maximum size in the XY plane). It redisplays the entire model. Nothing will happen if no primitive is selected. The function is only used in 3D.
Definition at line 536 of file prmed.cpp. References Prm::ChkEmptyModel(), max_height, sel_prm, and Prm::SetHeight(). Referenced by Model::SetHeightFac(). |
|
|
This function sets the maximum primitive height of the entire model. The function is only used in 3D.
Definition at line 526 of file prmed.cpp. References coord_tol, and max_height. Referenced by Model::Open(). |
|
|
This function unselects all primitives and resets the local pointer to the selected primitive.
Definition at line 164 of file prmed.cpp. References sel_prm, and Prm::UnselectAll(). Referenced by Model::UnselectAllPrm(). |
|
||||||||||||
|
This function should be called when there is an event of mouse-move, while the mouse button is pressed, during an interactive manipulation of a primitive. Its main objective is to display the boundary lines representing the transformed primitive. The translation parameters used to drag the entire primitive, or one of its vertex or side, are computed based on the given point location.
Definition at line 367 of file prmed.cpp. References Prj::ABS(), Prm::ChkEmptyModel(), curr_mousept, DspTmpPrmLines(), mouse_has_moved, sel_prm, sel_side, sel_vert, Prm::Translate(), Prm::TranslateSide(), Prm::TranslateVertex(), Prm::Coord::x, and Prm::Coord::y. Referenced by Model::UpdateDragPrm(). |
|
|
Coordinate tolerance value.
Definition at line 63 of file prmed.cpp. Referenced by GetTolerance(), InsertPrm1stPt(), InsertPrm2ndPt(), ResetParams(), SelectDragPrm(), and SetMaxHeight(). |
|
|
Current display color.
Definition at line 59 of file prmed.cpp. Referenced by GetColor(), InsertPrm1stPt(), ResetParams(), and SetColor(). |
|
|
Current mouse position for a mouse-move event.
Definition at line 75 of file prmed.cpp. Referenced by EchoPrm2ndPt(), FinishDragPrm(), InsertPrm1stPt(), SelectDragPrm(), and UpdateDragPrm(). |
|
|
Current display module.
Definition at line 55 of file prmed.cpp. Referenced by DspTmpPrmLines(), and InitParams(). |
|
|
First mouse position for a button-press-mouse-move-button-up event.
Definition at line 67 of file prmed.cpp. Referenced by InsertPrm1stPt(), InsertPrm2ndPt(), and SelectDragPrm(). |
|
|
CD handle to data canvas.
Definition at line 51 of file prmed.cpp. Referenced by DspTmpPrmLines(), and InitParams(). |
|
|
Maximum primitive height value (used only in 3D).
Definition at line 99 of file prmed.cpp. Referenced by GetHeightFac(), ResetParams(), SetHeightFac(), and SetMaxHeight(). |
|
|
Flag to indicate that mouse has moved since the first mouse position.
Definition at line 71 of file prmed.cpp. Referenced by EchoPrm2ndPt(), InsertPrm1stPt(), ResetParams(), SelectDragPrm(), and UpdateDragPrm(). |
|
|
Current primitive type to be attributed to new primitives to be inserted.
Definition at line 95 of file prmed.cpp. Referenced by InsertPrm1stPt(), ResetParams(), and SetCurType(). |
|
|
Varialble that holds a pointer to the current selected primitive. A null value means that no primitive is selected. Definition at line 80 of file prmed.cpp. Referenced by DeleteSelPrm(), DspTmpPrmLines(), EchoPrm2ndPt(), FinishDragPrm(), GetHeightFac(), InsertPrm1stPt(), InsertPrm2ndPt(), MoveSelPrmToBack(), MoveSelPrmToFront(), ResetParams(), SelectDragPrm(), SetColor(), SetHeightFac(), UnselectAllPrm(), and UpdateDragPrm(). |
|
|
Variable that holds an index of the current selected primitive side. A negative value means that no side is selected. Definition at line 90 of file prmed.cpp. Referenced by FinishDragPrm(), ResetParams(), SelectDragPrm(), and UpdateDragPrm(). |
|
|
Variable that holds an index of the current selected primitive vertex. A negative value means that no vertex is selected. Definition at line 85 of file prmed.cpp. Referenced by FinishDragPrm(), ResetParams(), SelectDragPrm(), and UpdateDragPrm(). |
1.4.2-20050421