#include <C9PointProxyEH.h>
|
| enum | { kMainDiamondHeight = 24, kCornerDiamondHeight = 8, kMainSquareHeight = 19, kCornerSquareHeight = 7, kLineSquareHeight = 7 } |
| |
|
static IReferencePointData::ReferencePointPosition | TransformPosition (const IReferencePointData::ReferencePointPosition &position, const PMReal &xScale, const PMReal &yScale, const PMReal &cwAngle, bool16 invert) |
| |
| static void | TransformPoint (PMPoint &point, const PMReal &xScale, const PMReal &yScale, const PMReal &cwAngle, const PMPoint &referencePoint, bool16 invert) |
| |
static IReferencePointData::ReferencePointPosition | GetFirstPosition (const PMLine &line) |
| |
static IReferencePointData::ReferencePointPosition | GetLastPosition (const PMLine &line) |
| |
| static PMPoint | GetCornerPoint (const IReferencePointData::ReferencePointPosition &position, const PMRect &mainSquare) |
| |
| static PMRect | GetCornerRect (const IReferencePointData::ReferencePointPosition &position, const PMRect &mainSquare, const PMReal &cornerHeight) |
| |
| static PMPolygon4 | GetCornerDiamond (const IReferencePointData::ReferencePointPosition &position, const PMPolygon4 &mainDiamond, const PMReal &cornerHeight) |
| |
| static bool16 | Contains (const PMPolygon4 &poly4, const PMPoint &point) |
| |
| static void | MakeDiamond (PMPolygon4 &poly4, const PMPoint ¢er, const PMReal &height) |
| |
| static void | Poly4Inset (PMPolygon4 &poly4, const PMReal &inset) |
| |
| static short | Octant (const PMReal &angle) |
| |
| static PMPoint | PositionToPoint (const IReferencePointData::ReferencePointPosition &position) |
| |
static IReferencePointData::ReferencePointPosition | PointToPosition (const PMPoint &point) |
| |
Helper class providing partial implementation of IEventHandler for a proxy widget (e.g. control strip or transform panel).
- See Also
- IEventHandler.h
- IProxyWidgetAttributes.h
Constants for the appearance of the proxy.
| virtual bool16 C9PointProxyEH::CanHaveKeyFocus | ( | | ) | const |
| pure virtual |
Client must override this function.
- Parameters
- Returns
- kTrue if you want the proxy to be a tab stop (and keyboard drivable), kFalse otherwise.
Reimplemented from DVHostedWidgetEH.
Change the reference position
- Parameters
| newPosition | the new reference point position |
High level routine: Given a point, hit test the proxy points and return the hit position. Calls either HitTestSquares, HitTestDiamonds, or HitTestLine to do its work.
- Parameters
| localPoint | the point to use for hittesting. |
- Returns
- IReferencePointData::ReferencePointPosition the new reference position after doing the hittest.
| static bool16 C9PointProxyEH::Contains | ( | const PMPolygon4 & | poly4, | | | const PMPoint & | point | | ) | | |
| static |
Test if the given polygon contains a point
- Parameters
| poly4 | the polygon to use |
| point | the point to test |
- Returns
- static bool16 return kTrue if point is in the polygon
Given the size of the main proxy widget and a reference position and a size, return a rect that is the size of one of the points of the proxy. Used when proxy is rotated.
- Parameters
| position | the reference position to draw |
| mainDiamond | the size of the main proxy in rotated mode |
| cornerHeight | the size of each proxy point |
- Returns
- static PMPolygon4 a polygon the size of the proxy
Given the size of the main proxy widget and a reference position, return a point location of one of the points of the proxy.
- Parameters
| position | the reference position to draw |
| mainSquare | the size of the main proxy |
- Returns
- static PMPoint the returned point corresponding to the given position
Given the size of the main proxy widget and a reference position and a size, return a rect that is the size of one of the points of the proxy.
- Parameters
| position | the reference position to draw |
| mainSquare | the size of the main proxy |
| cornerHeight | the size of each proxy point |
- Returns
- static PMRect the rect size of the proxy (centered on GetCornerPoint)
| void C9PointProxyEH::HandleKeyEvent | ( | VirtualKey & | key | ) | |
| protected |
Handle a key event when the proxy widget has focus. Currently handles numbers and arrow keys
- Parameters
| key | the virtual key to handle and move the proxy point |
| virtual bool16 C9PointProxyEH::KeyDown | ( | IEvent * | e | ) | |
| virtual |
Override if you want non-standard keyboard handling when proxy widget has focus. Default implementation responds to number pad numbers, regular numbers, arrows (all to move proxy point around), and return/enter/escape (to lose focus).
- Parameters
- Returns
- kTrue if event was handled, kFalse otherwise.
Reimplemented from DVHostedWidgetEH.
| virtual bool16 C9PointProxyEH::LButtonDn | ( | IEvent * | e | ) | |
| virtual |
Override if you want to provide special event handling. Default implementation changes the current layout window's reference point in response to clicked on point.
- Parameters
- Returns
- bool16 kTrue if event was handled, kFalse otherwise.
Reimplemented from DVHostedWidgetEH.
Given a height and a center, return a polygon describing the size of the diamond appearance of the proxy.
- Parameters
| poly4 | OUT the returned polygon |
| center | the center of the widget |
| height | the height to make the polygon |
| static short C9PointProxyEH::Octant | ( | const PMReal & | angle | ) | |
| static |
Given an angle, return the octant of the proxy. Used for diamond appearance. 1 means 45 degrees, 2 90, etc. So octant value is the number of 45 degree rotations of the proxy.
- Parameters
- Returns
- static short the octant value. 0 if regular rect appearance, non-zero odd value for diamond appearance
| static void C9PointProxyEH::Poly4Inset | ( | PMPolygon4 & | poly4, | | | const PMReal & | inset | | ) | | |
| static |
Inset the given polygon by an amount
- Parameters
| poly4 | IN/OUT the polygon to alter |
| inset | the amount to inset |
Map a reference position into a point on the proxy
- Parameters
| position | the given ref position |
- Returns
- static PMPoint the returned point
| virtual void C9PointProxyEH::PostGetKeyFocus | ( | | ) | |
| protectedvirtual |
Called after the proxy widget acquires keyboard focus.
- Parameters
- Returns
- kTrue if event has been handled and should not be further dispatched, kFalse otherwise (pass event to next handler)
Reimplemented from DVHostedWidgetEH.
| virtual void C9PointProxyEH::PostGiveUpKeyFocus | ( | | ) | |
| protectedvirtual |
Called after the proxy widget loses keyboard focus.
- Parameters
- Returns
- kTrue if event has been handled and should not be further dispatched, kFalse otherwise (pass event to next handler)
Reimplemented from DVHostedWidgetEH.
| static void C9PointProxyEH::TransformPoint | ( | PMPoint & | point, | | | const PMReal & | xScale, | | | const PMReal & | yScale, | | | const PMReal & | cwAngle, | | | const PMPoint & | referencePoint, | | | bool16 | invert | | ) | | |
| static |
Transform the given point into a reference position
- Parameters
| position | IN/OUT the position to transform |
| xScale | IN the x scale to use in the transform |
| yScale | IN the y scale to use in the transform |
| cwAngle | IN the angle to use in the transform |
| referencePoint | IN the reference point to use during the transform of the point |
| invert | IN whether to invert the scale/rotate matrix |
Transform the current reference position by the given scale and angle
- Parameters
| position | the position to transform |
| xScale | the x scale to use in the transform |
| yScale | the y scale to use in the transform |
| cwAngle | the angle to use in the transform |
| invert | whether to invert (kTrue) or not (kFalse) the reference position |
- Returns
- static IReferencePointData::ReferencePointPosition the original position transformed by the given values