This class implements a spatial box that can be used to define a transformation (translation, rotation, scale or shear). More...
#include "TrafoBox.hpp"
Public Member Functions | |
TrafoBoxT () | |
The constructor. More... | |
const BoundingBox3fT & | GetBB () const |
Returns the spatial dimensions of this trafo box. More... | |
void | SetBB (const BoundingBox3fT &BB, const ArrayT< Vector3fT > &ExtraRefPos) |
Sets new spatial dimensions for this trafo box. Can only be called when no drag is currently in progress (GetDragState() returns TH_NONE). More... | |
void | SetTrafoMode (TrafoModeT TM) |
Sets the specified transformation mode. Can only be called when no drag is currently in progress (GetDragState() returns TH_NONE). More... | |
void | SetNextTrafoMode () |
Cycles the transformation modes. Can only be called when no drag is currently in progress (GetDragState() returns TH_NONE). More... | |
TrafoHandleT | GetDragState () const |
Returns which of our handles (if any) is currently being dragged by the user. More... | |
TrafoHandleT | CheckForHandle (const ViewWindow2DT &ViewWindow, const wxPoint &PointTS) const |
Returns the handle under the given point PointTS in ViewWindow, TH_NONE if there is none (only handles matching the current trafo mode are considered). More... | |
wxCursor | SuggestCursor (TrafoHandleT TrafoHandle) const |
For the current trafo mode and the given trafo handle, this method returns the related matching cursor that should be activated in the related view window. More... | |
bool | BeginTrafo (const ViewWindow2DT &ViewWindow, const wxPoint &PointTS) |
bool | UpdateTrafo (const ViewWindow2DT &ViewWindow, const wxPoint &PointTS, bool ToggleGrid) |
CommandTransformT * | GetTrafoCommand (MapDocumentT &MapDoc, bool LockTexCoords) const |
This method creates a transform command, according to the current state of the box. More... | |
void | ApplyTrafo (MapElementT *Elem, bool LockTexCoords) const |
Like GetTrafoCommand(), but applies the transformation to the given element immediately. More... | |
void | FinishTrafo () |
void | Render (Renderer2DT &Renderer, const wxColour &OutlineColor, const wxColour &HandleColor) const |
void | Render (Renderer3DT &Renderer, const wxColour &OutlineColor, const wxColour &HandleColor) const |
bool | UpdateStatusBar (ChildFrameT *ChildFrame) const |
This class implements a spatial box that can be used to define a transformation (translation, rotation, scale or shear).
A command for the command history can be created (see method GetTransformCommand()) that actually applies the transformation to a set of map elements.
TrafoBoxT::TrafoBoxT | ( | ) |
The constructor.
void TrafoBoxT::ApplyTrafo | ( | MapElementT * | Elem, |
bool | LockTexCoords | ||
) | const |
Like GetTrafoCommand(), but applies the transformation to the given element immediately.
TrafoBoxT::TrafoHandleT TrafoBoxT::CheckForHandle | ( | const ViewWindow2DT & | ViewWindow, |
const wxPoint & | PointTS | ||
) | const |
Returns the handle under the given point PointTS in ViewWindow, TH_NONE if there is none (only handles matching the current trafo mode are considered).
ViewWindow | The 2D window in which we should search for hits. |
PointTS | The coordinate in tool space at which we are to look for a handle. |
|
inline |
Returns the spatial dimensions of this trafo box.
|
inline |
Returns which of our handles (if any) is currently being dragged by the user.
CommandTransformT * TrafoBoxT::GetTrafoCommand | ( | MapDocumentT & | MapDoc, |
bool | LockTexCoords | ||
) | const |
This method creates a transform command, according to the current state of the box.
IMPORTANT NOTE: This method must be called after a call to BeginTrafo() and before the matching call to EndTrafo()!
void TrafoBoxT::SetBB | ( | const BoundingBox3fT & | BB, |
const ArrayT< Vector3fT > & | ExtraRefPos | ||
) |
Sets new spatial dimensions for this trafo box. Can only be called when no drag is currently in progress (GetDragState() returns TH_NONE).
void TrafoBoxT::SetNextTrafoMode | ( | ) |
Cycles the transformation modes. Can only be called when no drag is currently in progress (GetDragState() returns TH_NONE).
void TrafoBoxT::SetTrafoMode | ( | TrafoModeT | TM | ) |
Sets the specified transformation mode. Can only be called when no drag is currently in progress (GetDragState() returns TH_NONE).
wxCursor TrafoBoxT::SuggestCursor | ( | TrafoHandleT | TrafoHandle | ) | const |
For the current trafo mode and the given trafo handle, this method returns the related matching cursor that should be activated in the related view window.