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

This is a group objects that can group any number of shapes or paths. More...

Inheritance diagram for DKShapeGroup:
Inheritance graph
[legend]

Instance Methods

(DKGroupCacheOption) - cacheOptions
 
(void) - calcBoundingRectOfObjects:
 Computes the initial overall bounding rect of the constituent objects. More...
 
(BOOL- clipContentToPath
 
(NSAffineTransform *) - contentTransform
 Returns a transform used to map the contained objects to the group's size, position and angle. More...
 
(NSPoint) - convertPointFromContainer:
 Maps a point from the original container's coordinates to the equivalent group point. More...
 
(NSPoint) - convertPointToContainer:
 Maps a point from the group's coordinates to the equivalent original container point. More...
 
(void) - drawGroupContent
 
(NSSize) - extraSpaceNeededByObjects:
 Computes the extra space needed for the objects. More...
 
(NSRect- groupBoundingRect
 Returns the original untransformed bounds of the grouped objects. More...
 
(NSArray *) - groupObjects
 Gets the list of objects contained by the group. More...
 
(NSSize) - groupScaleRatios
 Returns the scale ratios that the group is currently applying to its contents. More...
 
(id- initWithObjectsInArray:
 Initialises a group from a list of existing objects. More...
 
(NSAffineTransform *) - renderingTransform
 Returns a transform which is the accumulation of all the parent objects above this one. More...
 
(void) - setCacheOptions:
 
(void) - setClipContentToPath:
 
(void) - setGroupObjects:
 Sets up the group state from the original set of objects. More...
 
(void) - setObjects:
 Sets the current list of objects to the given objects. More...
 
(void) - setTransformsVisually:
 
(IBAction) - toggleClipToPath:
 High-level call to toggle path clipping. More...
 
(BOOL- transformsVisually
 
(IBAction) - ungroupObjects:
 High-level call to ungroup the group. More...
 
(void) - ungroupToLayer:
 Unpacks the group back into the nominated layer. More...
 
- Instance Methods inherited from DKDrawableShape
(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
 
- Instance Methods inherited from <DKDrawableContainer>
(DKDrawing *) - drawing
 
(DKImageDataManager *) - imageManager
 
(NSUInteger- indexOfObject:
 
(DKLayer *) - layer
 
(DKMetadataItem *) - metadataItemForKey:
 
(id- metadataObjectForKey:
 

Class Methods

(DKShapeGroup *) + groupWithBezierPaths:objectType:style:
 Creates a group of shapes or paths from a list of bezier paths. More...
 
(DKShapeGroup *) + groupWithObjects:
 Creates a group from a list of existing objects. More...
 
(NSArray *) + objectsAvailableForGroupingFromArray:
 Filters array to remove objects whose class returns NO to isGroupable. More...
 
- Class Methods inherited from DKDrawableShape
(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:
 

Additional Inherited Members

- Protected Attributes inherited from DKDrawableShape
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

This is a group objects that can group any number of shapes or paths.

This is a group objects that can group any number of shapes or paths.

It inherits from DKDrawableShape so that it gets the usual sizing and rotation behaviours.

This operates by establishing its own coordinate system in which the objects are embedded. An informal protocol is used that allows a shape or path to obtain the transform of its "parent". When that parent is a group, the transform is manipulated such that the path is modified just prior to rendering to allow for the group's size, rotation, etc.

Be aware of one "gotcha" with this class - a bit of a chicken-and-egg situation. When objects are grouped, they are offset to be local to the group's overall location. For grouping to be undoable, the objects being grouped need to have a valid container at the time this location offset is done, so that there is an undo manager available to record that change. If not they might end up in the wrong place when undoing the "group" command.

For the normal case of grouping existing objects within a layer, this is not an issue, but can be if you are programmatically creating groups.

Method Documentation

- (DKGroupCacheOption) cacheOptions
- (void) calcBoundingRectOfObjects: (NSArray *)  objects

Computes the initial overall bounding rect of the constituent objects.

This sets the _bounds member to the union of the apparent bounds of the constituent objects. This rect represents the original size and position of the group, and does not change even if the group is moved or resized - transforms are calculated by comparing the original bounds to the instantaneous size and position.

Parameters
objectsthe objects to be grouped
- (BOOL) clipContentToPath
- (NSAffineTransform*) contentTransform

Returns a transform used to map the contained objects to the group's size, position and angle.

This transform is used when drawing the group's contents

Returns
a transform object
- (NSPoint) convertPointFromContainer: (NSPoint)  p

Maps a point from the original container's coordinates to the equivalent group point.

The container will be usually a layer or another group.

Parameters
pa point
Returns
a new point
- (NSPoint) convertPointToContainer: (NSPoint)  p

Maps a point from the group's coordinates to the equivalent original container point.

The container will be usually a layer or another group.

Parameters
pa point
Returns
a new point
- (void) drawGroupContent
- (NSSize) extraSpaceNeededByObjects: (NSArray *)  objects

Computes the extra space needed for the objects.

Parameters
objectsthe objects to be grouped
Returns
a size, the maximum width and height needed to be added to the logical bounds to accomodate the objects visually. Returns the extra space needed to display the object graphically. This will usually be the difference between the logical and reported bounds.

The result is the max of all the contained objects

Returns
the extra space required
- (NSRect) groupBoundingRect

Returns the original untransformed bounds of the grouped objects.

Returns
the original group bounds
- (NSArray*) groupObjects

Gets the list of objects contained by the group.

Returns
the list of contained objects
- (NSSize) groupScaleRatios

Returns the scale ratios that the group is currently applying to its contents.

The scale ratio is the ratio between the group's original bounds and its current size.

Returns
the scale ratios
+ (DKShapeGroup*) groupWithBezierPaths: (NSArray *)  paths
objectType: (NSInteger type
style: (DKStyle *)  style 

Creates a group of shapes or paths from a list of bezier paths.

This constructs a group from a list of bezier paths by wrapping a drawable around each path then grouping the result. While general purpose in nature, this is primarily to support the construction of a group containing text glyphs from a text shape object. The group's location is set to the centre of the union of the bounds of all created objects, which in turn depends on the paths' positions. caller may wish to move the group before adding it to a layer.

Parameters
pathsa list of NSBezierPath objects
typea value indicating what type of objects the group should consist of. Can be 0 = shapes or
stylea style object to apply to each new shape or path as it is created; pass nil to create
Returns
a new group object consisting of a set of other objects built from the supplied paths
+ (DKShapeGroup*) groupWithObjects: (NSArray *)  objects

Creates a group from a list of existing objects.

Initial location is at the centre of the rectangle that bounds all of the contributing objects. the objects can be newly created or already existing as part of a drawing. Grouping the objects will change the parent of the object but not the owner until the group is placed. The group should be added to a drawing layer after creation. The higher level "group" command in the drawing layer class will set up a group from the selection.

Parameters
objectsa list of drawable objects
Returns
a new group object consisting of the objects supplied
- (id) initWithObjectsInArray: (NSArray *)  objects

Initialises a group from a list of existing objects.

Designated initialiser. initial location is at the centre of the rectangle that bounds all of the contributing objects. the objects can be newly created or already existing as part of a drawing. Grouping the objects will change the parent of the object but not the owner until the group is placed. The group should be added to a drawing layer after creation. The higher level "group" command in the drawing layer class will set up a group from the selection.

Parameters
objectsa list of drawable objects
Returns
the group object
+ (NSArray*) objectsAvailableForGroupingFromArray: (NSArray *)  array

Filters array to remove objects whose class returns NO to isGroupable.

Parameters
arraya list of drawable objects
Returns
an array of the same objects less those that can't be grouped
- (NSAffineTransform*) renderingTransform

Returns a transform which is the accumulation of all the parent objects above this one.

Drawables will request and apply this transform when rendering. Either the identity matrix is returned if the group is visually transforming the result, or a combination of the parents above and the content transform. Either way contained objects are oblivious and do the right thing.

Returns
a transform object

Reimplemented from <DKDrawableContainer>.

- (void) setCacheOptions: (DKGroupCacheOption)  cacheOption
- (void) setClipContentToPath: (BOOL clip
- (void) setGroupObjects: (NSArray *)  objects

Sets up the group state from the original set of objects.

This sets the initial size and location of the group, and adjusts the position of each object so it is relative to the group, not the original drawing. It also sets the parent member of each object to the group so that the group's transform is applied when the objects are drawn.

Parameters
objectsthe set of objects to be grouped
- (void) setObjects: (NSArray *)  objects

Sets the current list of objects to the given objects.

This is a low level method called by setGroupObjects: it implements the undoable part of building a group. It should not be directly called.

Parameters
objectsthe objects to be grouped
- (void) setTransformsVisually: (BOOL tv
- (IBAction) toggleClipToPath: (id sender

High-level call to toggle path clipping.

Parameters
senderthe sender of the action
- (BOOL) transformsVisually
- (IBAction) ungroupObjects: (id sender

High-level call to ungroup the group.

Undoably ungroups this and replaces itself in its layer by its contents

Parameters
senderthe sender of the action
- (void) ungroupToLayer: (DKObjectDrawingLayer *)  layer

Unpacks the group back into the nominated layer.

Usually it's better to call the higher level ungroupObjects: action method which calls this. This method strives to preserve as much information about the objects as possible - e.g. their rotation angle and size. Nested groups can cause distortions which are visually preserved though the bounds muct necessarily be altered. Objects are inserted into the layer at the same Z-index position as the group currently occupies.

Parameters
layerthe layer into which the objects are unpacked