#include <PolygonShapeEditor.h>
point
. More...This class is supposed to do th actual creating/editing of the contour lines represented by an instance of PolygonShape.
This is my new Implenetation of the old PolygonShapeEditor. This new version makes full use of the enhanced Features of the new PolygonShape class. As a result, here are some highlights of the new variant:
Interpretation of User Interactions: From the Interpretors point of view, there are five basic things the user can do apart from the usual things like asking stupid questions or looking concerned due to serious damage or criticizing this imaculate artwork of software: He can
IS_READY
IS_TRANSFORM
, unless the current edit mode is MODE_DRAW_STRIP
. In this case, the interpreter will be pushed into state IS_DRAW
, and an edge strip will be started at this node.IS_READY
IS_REGION
, unless the current edit mode is MODE_DRAW
. In this case, a new edge strip will be started at the mouse position, and the interpreter is pushed into state IS_DRAW
IS_REGION
IS_READY
IS_TRANSFORM
mEditMode
-> IS_TRANSFORM
IS_READY
IS_CANCEL
IS_DRAW
IS_DRAW
IS_READY
IS_CANCEL
IS_REGION
mRegionMode
) -> IS_REGION
IS_READY
IS_CANCEL
IS_CANCEL
IS_READY
|
This will create an editor instance.
|
|
Does nothing. |
|
Sets the radius of the nodes. A node will be regarded as "under the mouse" if the distance between this node and the mouse coordinates is equal or less than radius
|
|
|
|
|
|
|
|
This is usefull for instance to connect WheelEvents to it |
|
This is usefull for instance to connect WheelEvents to it |
|
|
|
|
|
This signal is emitted on every modification done to the nodes/edges of the current PolygonShape. Use this to decide when to redraw the shape. |
|
tells the Editor to edit the PolygonShape pointed at by |
|
|
|
The size of a node specifies the radius of its sensitive area. A node will be regarded as beeing "under the mouse" if the position of the mouse pointer is within a distance from the node's position smaller than or equal to this radius.
|
|
while being in restirced mode, the editor will only allow isomorph modifications of the edited PolygonShape, i.e. all operation that would modify the shape's topology are be prohibited. In paritcular, no nodes/edges will be added/removed, while by the editor.
|
|
|
|
|
|
The editor is equiped with a popup menu that will show when you click the right mouse button while in state
|
|
|
|
Actualy their are two slightly different semantics connected to this method:
|
|
This might be usefull to decide what to draw (or not to draw) during rendering. You might for example want to draw the selection box during a region select.
|
|
|
|
|
|
|
|
this method will pass
|
|
this method will call the apropriate transformation method, determined by the value of mEditMode
|
|
this method will call the apropriate transformation method, determined by the value of mEditMode
|
|
this method will pass
|
|
this method will call the apropriate region select method, determined by the value of mRegionMode
|
|
this method will call the apropriate region select method, determined by the value of mRegionMode
|
|
You can leeeave your hat on...;-) Hehe, nasty you! No, not what you think. This starts or continues drawing a strip of lines.
|
|
Finish a Strip, taking point as the last point.
|
|
Cancels a strip, that is, the current line is not added.
|
|
starts or continues translations of selected nodes
|
|
|
|
resets selected nodes to their old positions.
|
|
starts or continues scaling of selected nodes
|
|
|
|
resets selected nodes to their old positions.
|
|
starts or continues rotating along the z axis
|
|
|
|
resets selected nodes to their old positions.
|
|
|
|
everything in the marked rectangluar region becomes selected |
|
selection is left unchanged |
|
|
|
everything in the spheric region becomes selected |
|
selection is left unchanged |
|
|
|
calculates facors that map the components of
|
|
|
|
calculate the angle between two line going from mCenter to
|
|
fills a float[16] array so it represents 4x4 Identity
|
|
alters matrix to represent an translation.
|
|
alters matrix to represent a rotation around an axis oriented by the line R*(0,0,1) + c along angle angle rad
|
|
alters a matrix to represent an affine scalation with moved origin
|
|
|
|
|
|
This holds the state in which the interpretation has currently reached The value of |
|
|
|
|
|
|
|
|
|
A pointer to the Shape that is to be edited. Maybe null. |
|
|
|
OK, i admitt, this is a hack. It solves the following problem: if the user shift-clicks on a node, that is selected and immediatly after this begins a transformation, it is assumed,that he/she did not actualy want to deselect the node. On the other hand, if no translation accurs, he propably wants to deselect the node. So we have to remember if the node should be deselected again on mouse up. Yust keep it like this ;-=) |
|
the key of the node that was selected before a transformation
|