DrawKit
Vector and illustration framework for Mac OS X
Instance Methods | Class Methods | Protected Attributes | List of all members
DKDrawableShape Class Reference

A semi-abstract base class for a drawable object consisting of any path-based shape that can be drawn to fit a rectangle. More...

Inheritance diagram for DKDrawableShape:
Inheritance graph
[legend]

Instance Methods

(NSInteger- addHotspot:
 
(void) - adjustToFitGrid:
 
(void) - adoptPath:
 
(BOOL- allowSizeKnobsToRotateShape
 
(NSArray *) - breakApart
 
(BOOL- canPastePathWithPasteboard:
 
(NSPoint) - convertPointFromRelativeLocation:
 
(IBAction) - convertToPath:
 
(DKDistortionTransform *) - distortionTransform
 
(void) - drawHotspotAtPoint:inState:
 
(void) - drawHotspotsInState:
 
(void) - drawKnob:
 
(void) - flipHorizontally
 
(void) - flipVertically
 
(DKHotspot *) - hotspotForPartCode:
 
(NSPoint) - hotspotPointForPartcode:
 
(NSRect- hotspotRect:
 
(NSArray *) - hotspots
 
(DKHotspot *) - hotspotUnderMouse:
 
(id- initWithBezierPath:
 
(id- initWithBezierPath:rotatedToAngle:
 
(id- initWithBezierPath:rotatedToAngle:style:
 
(id- initWithBezierPath:style:
 
(id- initWithCanonicalBezierPath:
 
(id- initWithCanonicalBezierPath:style:
 
(id- initWithOvalInRect:
 
(id- initWithOvalInRect:style:
 
(id- initWithRect:
 
(id- initWithRect:style:
 
(NSAffineTransform *) - inverseTransform
 
(NSPoint) - knobPoint:
 
(NSPoint) - locationIgnoringOffset
 
(DKDrawablePath *) - makePath
 
(void) - moveKnob:toPoint:allowRotate:constrain:
 
(NSInteger- operationMode
 
(IBAction) - pastePath:
 
(NSBezierPath *) - path
 
(NSBezierPath *) - path:withFinalSize:offsetBy:fromPartcode:
 Transforms a path to the final size and position relative to a partcode. More...
 
(NSBezierPath *) - pathWithFinalSize:offsetBy:fromPartcode:
 Return a rectangular path offset from a given partcode. More...
 
(NSBezierPath *) - pathWithRelativePosition:finalSize:
 Return a rectangular path with given relative origin but absolute final size. More...
 
(NSBezierPath *) - pathWithRelativeRect:
 Return a rectangular path with given size and origin. More...
 
(NSPoint) - pointForRelativeLocation:
 Convert a point from relative coordinates to absolute coordinates. More...
 
(void) - removeHotspot:
 
(void) - resetBoundingBox
 
(IBAction) - resetBoundingBox:
 
(void) - resetBoundingBoxAndRotation
 
(void) - reshapePath
 
(IBAction) - rotate:
 
(void) - rotateUsingReferencePoint:constrain:
 
(NSPoint) - rotationKnobPoint
 
(void) - setDistortionTransform:
 
(IBAction) - setDistortMode:
 
(void) - setDragAnchorToPart:
 
(void) - setHotspots:
 
(void) - setOperationMode:
 
(void) - setPath:
 
(IBAction) - toggleHorizontalFlip:
 
(IBAction) - toggleVerticalFlip:
 
(NSAffineTransform *) - transform
 Return a transform that maps the object's stored path to its true location in the drawing. More...
 
(NSBezierPath *) - transformedPath
 
(NSAffineTransform *) - transformIncludingParent
 
(NSString *) - undoActionNameForPartCode:
 
(IBAction) - unrotate:
 
- Instance Methods inherited from DKDrawableObject
(void) - addMetadata:
 
(void) - addUserInfo:
 
(NSSet *) - allRegisteredStyles
 
(NSSet *) - allStyles
 
(CGFloat- angle
 
(CGFloat- angleInDegrees
 Return the shape's current rotation angle. More...
 
(NSRect- apparentBounds
 
(void) - applyTransform:
 Apply the transform to the object. More...
 
(NSRect- bounds
 
(NSImage *) - cachedImage
 Returns an image of the object representing its current appearance at 100% scale. More...
 
(NSColor *) - colourForKey:
 
(id< DKDrawableContainer >) - container
 Returns the immediate parent of this object. More...
 
(NSAffineTransform *) - containerTransform
 Return the container's transform. More...
 
(CGFloat- convertLength:
 
(NSPoint) - convertPointToDrawing:
 
(IBAction) - copyDrawingStyle:
 
(void) - creationTool:willBeginCreationAtPoint:
 
(void) - creationTool:willEndCreationAtPoint:
 
(NSView *) - currentView
 
(NSCursor *) - cursorForPartcode:mouseButtonDown:
 
(void) - detachStyle
 If the object's style is currently sharable, copy it and make it non-sharable. More...
 
(void) - drawContent
 
(void) - drawContentInRect:fromRect:withStyle:
 
(void) - drawContentWithSelectedState:
 
(void) - drawContentWithStyle:
 
(void) - drawGhostedContent
 
(DKDrawing *) - drawing
 
(void) - drawSelectedState
 
(void) - drawSelectionPath:
 
(NSSize) - extraSpaceNeeded
 
(CGFloat- floatValueForKey:
 
(NSUInteger- geometryChecksum
 
(void) - group:willUngroupObjectWithTransform:
 This object is being ungrouped from a group. More...
 
(void) - groupWillAddObject:
 This object is being added to a group. More...
 
(BOOL- hasMetadataForKey:
 
(NSInteger- hitPart:
 
(NSInteger- hitSelectedPart:forSnapDetection:
 
(NSUInteger- indexInContainer
 Returns the index position of this object in its container layer. More...
 
(id- initWithStyle:
 Initializes the drawable to have the style given. More...
 
(BOOL- intersectsRect:
 
(NSInteger- intValueForKey:
 
(void) - invalidateRenderingCache
 Discard all cached rendering information. More...
 
(BOOL- isBeingHitTested
 Is a hit-test in progress. More...
 
(BOOL- isGhosted
 Retuirn whether the object is ghosted rather than with its full style. More...
 
(BOOL- isKeyObject
 Is the object currently the layer's key object? More...
 
(BOOL- isPendingObject
 Is the object currently a pending object? More...
 
(BOOL- isSelected
 
(BOOL- isTrackingMouse
 
(DKKnobType) - knobTypeForPartCode:
 
(DKObjectOwnerLayer *) - layer
 Returns the layer that this object ultimately belongs to. More...
 
(NSPoint) - location
 
(BOOL- locationLocked
 Whether the object's location is locked or not. More...
 
(IBAction) - lock:
 
(BOOL- locked
 
(IBAction) - lockLocation:
 
(NSRect- logicalBounds
 
(NSMenu *) - menu
 Reurn the menu to use as the object's contextual menu. More...
 
(NSMutableDictionary *) - metadata
 
(NSUInteger- metadataChecksum
 
(void) - metadataDidChangeKey:
 
(DKMetadataItem *) - metadataItemForKey:
 
(DKMetadataItem *) - metadataItemForKey:limitToLocalSearch:
 
(NSArray *) - metadataItemsForKeysInArray:
 
(NSArray *) - metadataItemsForKeysInArray:limitToLocalSearch:
 
(NSArray *) - metadataKeys
 
(id- metadataObjectForKey:
 
(void) - metadataWillChangeKey:
 
(void) - mouseDoubleClickedAtPoint:inPart:event:
 
(void) - mouseDownAtPoint:inPart:event:
 
(void) - mouseDraggedAtPoint:inPart:event:
 
(NSSize) - mouseDragOffset
 
(BOOL- mouseHasMovedSinceStartOfTracking
 
(NSSize) - mouseOffset
 
(BOOL- mouseSnappingEnabled
 
(void) - mouseUpAtPoint:inPart:event:
 
(void) - notifyGeometryChange:
 
(void) - notifyStatusChange
 
(void) - notifyVisualChange
 
(void) - objectDidBecomeSelected
 
(void) - objectIsNoLongerSelected
 
(BOOL- objectIsValid
 
(BOOL- objectMayBecomeSelected
 Is the object able to be selected? More...
 
(void) - objectWasAddedToLayer:
 The object was added to a layer. More...
 
(void) - objectWasRemovedFromLayer:
 The object was removed from the layer. More...
 
(void) - objectWasUngrouped
 This object was ungrouped from a group. More...
 
(NSSize) - offset
 
(void) - offsetLocationByX:byY:
 
(NSAttributedString *) - originalText
 
(IBAction) - pasteDrawingStyle:
 
(NSData *) - pdf
 Returns the single object rendered as a PDF image. More...
 
(NSPoint) - pointForPartcode:
 
(BOOL- pointHitsPath:
 Test a point against the offscreen bitmap representation of the shape. More...
 
(BOOL- populateContextualMenu:
 
(BOOL- populateContextualMenu:atPoint:
 
(void) - readSupplementaryDataFromPasteboard:
 Read additional data from the pasteboard specific to the object. More...
 
(BOOL- rectHitsPath:
 Test if a rect encloses any of the shape's actual pixels. More...
 
(void) - removeMetadataForKey:
 
(NSBezierPath *) - renderingPath
 
(void) - replaceMatchingStylesFromSet:
 
(void) - resetOffset
 
(void) - resizeWidthBy:heightBy:
 
(void) - rotateByAngle:
 Rotate the shape by adding a delta angle to the current angle. More...
 
(DKMetadataSchema) - schema
 
(void) - setAngle:
 Set the object's current angle in radians. More...
 
(void) - setBeingHitTested:
 Set whether a hit-test in progress. More...
 
(void) - setColour:forKey:
 
(void) - setContainer:
 
(void) - setFloatValue:forKey:
 
(void) - setGhosted:
 Set whether the object is ghosted rather than with its full style. More...
 
(void) - setIntValue:forKey:
 
(void) - setLocation:
 
(void) - setLocationLocked:
 Sets whether the object's location is locked or not. More...
 
(void) - setLocked:
 
(void) - setMetadata:
 
(void) - setMetadataItem:forKey:
 
(void) - setMetadataItemType:forKey:
 
(void) - setMetadataItemValue:forKey:
 
(void) - setMetadataObject:forKey:
 
(void) - setMouseDragOffset:
 
(void) - setMouseHasMovedSinceStartOfTracking:
 
(void) - setMouseSnappingEnabled:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsDisplayInRects:
 
(void) - setNeedsDisplayInRects:withExtraPadding:
 
(void) - setOffset:
 
(void) - setOriginalText:
 
(void) - setSize:
 
(void) - setSize:forKey:
 
(void) - setString:forKey:
 
(void) - setStyle:
 
(void) - setTrackingMouse:
 
(void) - setupMetadata
 
(void) - setUserInfo:
 
(void) - setUserInfoObject:forKey:
 Set an item of user info. More...
 
(void) - setVisible:
 
(NSSize) - size
 
(NSSize) - sizeForKey:
 
(NSPoint) - snappedMousePoint:forSnappingPointsWithControlFlag:
 
(NSPoint) - snappedMousePoint:withControlFlag:
 Offset the point to cause snap to grid + guides accoding to the drawing's settings. More...
 
(NSArray *) - snappingPoints
 
(NSArray *) - snappingPointsWithOffset:
 
(NSString *) - stringForKey:
 
(DKStyle *) - style
 
(void) - styleDidChange:
 
(void) - styleWillChange:
 
(NSSet *) - subSelection
 Return the subselection of the object. More...
 
(NSImage *) - swatchImageWithSize:
 
(NSUndoManager *) - undoManager
 
(IBAction) - unlock:
 
(IBAction) - unlockLocation:
 
(void) - updateMetadataKeys
 
(void) - updateRulerMarkers
 
(BOOL- useLowQualityDrawing
 
(NSMutableDictionary *) - userInfo
 Return the attached user info. More...
 
(id- userInfoObjectForKey:
 Return an item of user info. More...
 
(BOOL- visible
 
(void) - willBeAddedAsSubstituteFor:toLayer:
 Some high-level operations substitute a new object in place of an existing one (or several). More...
 
(void) - writeSupplementaryDataToPasteboard:
 Write additional data to the pasteboard specific to the object. More...
 
- Instance Methods inherited from NSObject
(NSString *) - address
 
(DKStyleRegistry *) - applicationWillReturnStyleRegistry
 
(BOOL- canBeUsedWithSelectionTool
 
(id- categoryManager:shouldReplaceObject:withObject:
 
(Class- classForCoder
 
(NSColor *) - colorValue
 
(NSColor *) - colourValue
 
(id- copy
 
(void) - dealloc
 
(id- deepCopy
 
(NSDictionary *) - dimensionValuesForArrowStroke:
 
(CGFloat- drawing:convertDistanceToExternalCoordinates:
 
(NSPoint) - drawing:convertLocationToExternalCoordinates:
 
(void) - drawing:didDrawRect:inView:
 
(void) - drawing:willDrawRect:inView:
 
(NSString *) - drawing:willReturnAbbreviationForUnit:
 
(NSString *) - drawing:willReturnFormattedCoordinateForDistance:
 
(CGFloat- drawingWillReturnUnitToPointsConversonFactor:
 
(void) - finalize
 
(NSString *) - hexString
 
(void) - hotspot:didEndTrackingWithEvent:inView:
 
(void) - hotspot:isTrackingWithEvent:inView:
 
(void) - hotspot:willBeginTrackingWithEvent:inView:
 
(NSData *) - imageData
 
(NSImage *) - imageResourceNamed:
 
(id- init
 
(id- initWithExpression:
 
(id- instantiateObjectWithShortName:parameters:
 
(BOOL- isLiteralValue
 
(void) - layoutManager:willPlaceGlyphAtIndex:atLocation:pathAngle:yOffset:
 
(void) - menuItem:wasAddedForObject:inCategory:
 
(BOOL- moveObjectTo:position:slope:userInfo:
 
(id- mutableCopy
 
(void) - oneShotComplete
 
(void) - oneShotHasReached:
 
(void) - oneShotWillBegin
 
(void) - path:elementIndex:type:points:subPathIndex:subPathClosed:contextInfo:
 
(id- placeLinkFromPoint:toPoint:onPath:linkNumber:userInfo:
 
(id- placeObjectAtPoint:onPath:position:slope:userInfo:
 
(NSPoint) - point
 
(NSPoint) - pointForTextLayout
 
(DKStyle *) - registry:shouldReplaceStyle:withStyle:
 
(NSBezierPath *) - renderer:willRenderPath:
 
(void) - routeFinder:progressHasReached:
 
(void) - setValue:forNumericParameter:
 
(NSString *) - stringValue
 
(CGFloat- taperFactorAtDistance:onPath:ofLength:
 
(void) - toolDidPerformUndoableAction:
 
(void) - toolWillPerformUndoableAction:
 
(NSURL *) - url
 
- Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger- hash
 
(BOOL- isEqual:
 
- Instance Methods inherited from <NSKeyValueBindingCreation>
(void) - bind:toObject:withKeyPath:options:
 
(NSArray *) - exposedBindings
 
(NSDictionary *) - infoForBinding:
 
(NSArray *) - optionDescriptionsForBinding:
 
(void) - unbind:
 
(Class- valueClassForBinding:
 
- Instance Methods inherited from <DKStorableObject>
(NSUInteger- index
 
(BOOL- isMarked
 
(void) - setIndex:
 
(void) - setMarked:
 
(void) - setStorage:
 
(id< DKObjectStorage >) - storage
 
- Instance Methods inherited from <NSCoding>
(void) - encodeWithCoder:
 
(id- initWithCoder:
 
- Instance Methods inherited from <NSCopying>
(id- copyWithZone:
 
- Instance Methods inherited from <DKRenderable>
(NSMutableDictionary *) - renderingCache
 

Class Methods

(NSCursor *) + cursorForShapePartcode:
 
(DKDrawableShape *) + drawableShapeWithBezierPath:
 
(DKDrawableShape *) + drawableShapeWithBezierPath:rotatedToAngle:
 
(DKDrawableShape *) + drawableShapeWithBezierPath:rotatedToAngle:withStyle:
 
(DKDrawableShape *) + drawableShapeWithBezierPath:withStyle:
 
(DKDrawableShape *) + drawableShapeWithCanonicalBezierPath:
 
(DKDrawableShape *) + drawableShapeWithOvalInRect:
 
(DKDrawableShape *) + drawableShapeWithRect:
 
(NSInteger+ knobMask
 Return which particular knobs are used by instances of this class. More...
 
(void) + setAngularConstraintAngle:
 
(void) + setInfoWindowBackgroundColour:
 
(void) + setKnobMask:
 
(NSRect+ unitRectAtOrigin
 
- Class Methods inherited from DKDrawableObject
(Class+ classForConversionRequestFor:
 Return the class to use in place of the given class when performing a conversion. More...
 
(NSUInteger+ countOfNativeObjectsOnPasteboard:
 Return the number of native objects held by the pasteboard. More...
 
(BOOL+ displaysSizeInfoWhenDragging
 Return whether an info floater is displayed when resizing an object. More...
 
(NSColor *) + ghostColour
 Return the outline colour to use when drawing objects in their ghosted state. More...
 
(NSInteger+ initialPartcodeForObjectCreation
 
(NSDictionary *) + interconversionTable
 Return the interconversion table. More...
 
(BOOL+ isGroupable
 Return whether obejcts of this class can be grouped. More...
 
(BOOL+ metadataChangesAreUndoable
 
(NSArray *) + nativeObjectsFromPasteboard:
 
(NSArray *) + pasteboardTypesForOperation:
 
(void) + setDisplaysSizeInfoWhenDragging:
 Set whether an info floater is displayed when resizing an object. More...
 
(void) + setGhostColour:
 Set the outline colour to use when drawing objects in their ghosted state. More...
 
(void) + setInterconversionTable:
 Return the interconversion table. More...
 
(void) + setMetadataChangesAreUndoable:
 
(void) + substituteClass:forClass:
 Sets the class to use in place of the a base class when performing a conversion. More...
 
(NSRect+ unionOfBoundsOfDrawablesInArray:
 Returns the union of the bounds of the objects in the array. More...
 
- Class Methods inherited from NSObject
(id+ alloc
 
(Class+ class
 
(void) + initialize
 
(void) + load
 
(id+ new
 
- Class Methods inherited from <NSKeyValueBindingCreation>
(void) + exposeBinding:
 

Protected Attributes

BOOL m_inRotateOp
 
NSRect mBoundsCache
 
- Protected Attributes inherited from DKDrawableObject
BOOL m_clipToBBox: 1
 
BOOL m_showBBox: 1
 
BOOL m_showPartcodes: 1
 
BOOL m_showTargets: 1
 
BOOL m_unused_padding: 4
 

Detailed Description

A semi-abstract base class for a drawable object consisting of any path-based shape that can be drawn to fit a rectangle.

DKDrawableShape is a semi-abstract base class for a drawable object consisting of any path-based shape that can be drawn to fit a rectangle. DKShapeFactory can be used to supply lots of different path shapes usable with this class.

This implements rotation of the shape about a specified point (defaulting to the centre), and also standard selection handles.

Resizing and moving of the shape is handled by its implementations of the mouseDown/dragged/up event handlers.

This class uses the handle drawing supplied by DKKnob.

The path is stored internally in its untransformed form. This means that its datum is at the origin and it is unrotated. When rendered, the object's location and rotation angle are applied so what you see is what you expect. The bounds naturally refers to the transformed bounds. The selection handles themselves are also transformed by the same transform, since the shape remains editable at any orientation.

The canonical path is set to have a bounding rect 1.0 on each side. The actual size of the object is factored into the transform to render the object in the drawing. Thus the original path is NEVER changed once established. This allows us to share basic shapes which can be generated by a factory class.

Method Documentation

- (NSInteger) addHotspot: (DKHotspot *)  hspot

Provided by category DKDrawableShape(Hotspots).

- (void) adjustToFitGrid: (DKGridLayer *)  grid
- (void) adoptPath: (NSBezierPath *)  path
- (BOOL) allowSizeKnobsToRotateShape
- (NSArray*) breakApart
- (BOOL) canPastePathWithPasteboard: (NSPasteboard *)  pb
- (NSPoint) convertPointFromRelativeLocation: (NSPoint)  rloc
- (IBAction) convertToPath: (id sender
+ (NSCursor*) cursorForShapePartcode: (NSInteger pc
- (DKDistortionTransform*) distortionTransform
+ (DKDrawableShape*) drawableShapeWithBezierPath: (NSBezierPath *)  path
+ (DKDrawableShape*) drawableShapeWithBezierPath: (NSBezierPath *)  path
rotatedToAngle: (CGFloat angle 
+ (DKDrawableShape*) drawableShapeWithBezierPath: (NSBezierPath *)  path
rotatedToAngle: (CGFloat angle
withStyle: (DKStyle *)  aStyle 
+ (DKDrawableShape*) drawableShapeWithBezierPath: (NSBezierPath *)  path
withStyle: (DKStyle *)  aStyle 
+ (DKDrawableShape*) drawableShapeWithCanonicalBezierPath: (NSBezierPath *)  path
+ (DKDrawableShape*) drawableShapeWithOvalInRect: (NSRect aRect
+ (DKDrawableShape*) drawableShapeWithRect: (NSRect aRect
- (void) drawHotspotAtPoint: (NSPoint)  hp
inState: (DKHotspotState)  state 

Provided by category DKDrawableShape(Hotspots).

- (void) drawHotspotsInState: (DKHotspotState)  state

Provided by category DKDrawableShape(Hotspots).

- (void) drawKnob: (NSInteger knobPartCode
- (void) flipHorizontally
- (void) flipVertically
- (DKHotspot*) hotspotForPartCode: (NSInteger pc

Provided by category DKDrawableShape(Hotspots).

- (NSPoint) hotspotPointForPartcode: (NSInteger pc

Provided by category DKDrawableShape(Hotspots).

- (NSRect) hotspotRect: (DKHotspot *)  hs

Provided by category DKDrawableShape(Hotspots).

- (NSArray*) hotspots

Provided by category DKDrawableShape(Hotspots).

- (DKHotspot*) hotspotUnderMouse: (NSPoint)  mp

Provided by category DKDrawableShape(Hotspots).

- (id) initWithBezierPath: (NSBezierPath *)  aPath
- (id) initWithBezierPath: (NSBezierPath *)  aPath
rotatedToAngle: (CGFloat angle 
- (id) initWithBezierPath: (NSBezierPath *)  aPath
rotatedToAngle: (CGFloat angle
style: (DKStyle *)  style 
- (id) initWithBezierPath: (NSBezierPath *)  aPath
style: (DKStyle *)  aStyle 
- (id) initWithCanonicalBezierPath: (NSBezierPath *)  aPath
- (id) initWithCanonicalBezierPath: (NSBezierPath *)  aPath
style: (DKStyle *)  aStyle 
- (id) initWithOvalInRect: (NSRect aRect
- (id) initWithOvalInRect: (NSRect aRect
style: (DKStyle *)  aStyle 
- (id) initWithRect: (NSRect aRect
- (id) initWithRect: (NSRect aRect
style: (DKStyle *)  aStyle 
- (NSAffineTransform*) inverseTransform
+ (NSInteger) knobMask

Return which particular knobs are used by instances of this class.

The default is to use all knobs, but subclasses may want to override this for particular uses

Returns
bitmask indicating which knobs are used
- (NSPoint) knobPoint: (NSInteger knobPartCode
- (NSPoint) locationIgnoringOffset
- (DKDrawablePath*) makePath
- (void) moveKnob: (NSInteger knobPartCode
toPoint: (NSPoint)  p
allowRotate: (BOOL rotate
constrain: (BOOL constrain 
- (NSInteger) operationMode
- (IBAction) pastePath: (id sender
- (NSBezierPath*) path
- (NSBezierPath*) path: (NSBezierPath *)  inPath
withFinalSize: (NSSize)  size
offsetBy: (NSPoint)  offset
fromPartcode: (NSInteger pc 

Transforms a path to the final size and position relative to a partcode.

The resulting path is positioned at a fixed offset and size relative to a partcode (a corner, say) in such a way that the object's size and angle set the positioning and orientation of the path but not its actual size. This is useful for adding an adornment to the shape that is unscaled by the object, such as the text indicator shown by DKTextShape

Parameters
paththe path to transform
sizethe final desired size of the rectangle
offsetan offset in absolute units from the nominated partcode position
pcthe partcode that the path is positioned relative to
Returns
the transformed path

Provided by category DKDrawableShape(Utilities).

- (NSBezierPath*) pathWithFinalSize: (NSSize)  size
offsetBy: (NSPoint)  offset
fromPartcode: (NSInteger pc 

Return a rectangular path offset from a given partcode.

The resulting path is positioned at a fixed offset and size relative to a partcode (a corner, say) in such a way that the object's size and angle set the positioning and orientation of the path but not its actual size. This is useful for adding an adornment to the shape that is unscaled by the object, such as the text indicator shown by DKTextShape

Parameters
sizethe final desired size of the rectangle
offsetan offset in absolute units from the nominated partcode position
pcthe partcode that the path is positioned relative to
Returns
a rectangular path transformed to the current true size, position and angle of the shape

Provided by category DKDrawableShape(Utilities).

- (NSBezierPath*) pathWithRelativePosition: (NSPoint)  relLoc
finalSize: (NSSize)  size 

Return a rectangular path with given relative origin but absolute final size.

Not affected by the object's current offset. By specifying a final size the resulting path can represent a fixed-sized region independent of the object's current size.

Parameters
relLoca point expressed relative to the unit square
sizethe final desired size o fthe rectangle
Returns
a rectangular path transformed to the current true size, position and angle of the shape

Provided by category DKDrawableShape(Utilities).

- (NSBezierPath*) pathWithRelativeRect: (NSRect relRect

Return a rectangular path with given size and origin.

Not affected by the object's current offset

Parameters
relRecta rectangle expressed relative to the unit square
Returns
a rectangular path transformed to the current true size, position and angle of the shape

Provided by category DKDrawableShape(Utilities).

- (NSPoint) pointForRelativeLocation: (NSPoint)  relLoc

Convert a point from relative coordinates to absolute coordinates.

Not affected by the object's current offset

Parameters
relLoca point expressed relative to the unit square
Returns
the absolute point taking into account scale, position and angle

Provided by category DKDrawableShape(Utilities).

- (void) removeHotspot: (DKHotspot *)  hspot

Provided by category DKDrawableShape(Hotspots).

- (void) resetBoundingBox
- (IBAction) resetBoundingBox: (id sender
- (void) resetBoundingBoxAndRotation
- (void) reshapePath
- (IBAction) rotate: (id sender
- (void) rotateUsingReferencePoint: (NSPoint)  rp
constrain: (BOOL constrain 
- (NSPoint) rotationKnobPoint
+ (void) setAngularConstraintAngle: (CGFloat radians
- (void) setDistortionTransform: (DKDistortionTransform *)  dt
- (IBAction) setDistortMode: (id sender
- (void) setDragAnchorToPart: (NSInteger knobPartCode
- (void) setHotspots: (NSArray *)  spots

Provided by category DKDrawableShape(Hotspots).

+ (void) setInfoWindowBackgroundColour: (NSColor *)  colour
+ (void) setKnobMask: (NSInteger knobMask
- (void) setOperationMode: (NSInteger mode
- (void) setPath: (NSBezierPath *)  path
- (IBAction) toggleHorizontalFlip: (id sender
- (IBAction) toggleVerticalFlip: (id sender
- (NSAffineTransform*) transform

Return a transform that maps the object's stored path to its true location in the drawing.

Override for real transforms - the default merely returns the identity matrix

Returns
a transform

Implements DKDrawableObject.

- (NSBezierPath*) transformedPath
- (NSAffineTransform*) transformIncludingParent
- (NSString*) undoActionNameForPartCode: (NSInteger pc
+ (NSRect) unitRectAtOrigin
- (IBAction) unrotate: (id sender

Member Data Documentation

- (BOOL) m_inRotateOp
protected
- (NSRect) mBoundsCache
protected