//
//  LCPathObject.h
//  LogoistCore
//
//  Created by Mendel Kucharzeck on 27.01.12.
//  Copyright (c) 2012 AvisNocturna Software. All rights reserved.
//

#import "LCBaseObject.h"
#import <AvisNocturnaCrossCore/ANGeometryHelper-Defines.h>

@class LCBasePathElement;

@interface LCPathObject : LCBaseObject
{
    CGPoint position;
    NSMutableArray *pathElements;
    
    ANGeometry_PathMode pathMode;
    float strokeLineWidth;
    CGLineCap lineCap;

    CGPoint cachedCenterOfPath;
    
    //Events
    CGPoint dragStartPoint;
    CGPoint dragStartPosition;
    BOOL isCurrentlyApplyingTools;
}

@property (assign) CGPoint position;

@property (assign) ANGeometry_PathMode pathMode;
@property (assign) float strokeLineWidth;
@property (assign) CGLineCap lineCap;

- (void) addPathElement:(LCBasePathElement*)element;
- (void) addPathElement:(LCBasePathElement*)element atIndex:(NSInteger)index;
- (void) removePathElement:(LCBasePathElement*)element;
- (LCBasePathElement*) pathElementWithIdentifier:(NSString*)identifier;
@property (readonly) NSArray *pathElements;

- (LCBasePathElement*) nextPathElementForPathElement:(LCBasePathElement*)element;
- (LCBasePathElement*) previousPathElementForPathElement:(LCBasePathElement*)element;

- (void) cacheCenterOfPath;
- (CGPoint) centerOfPath;
- (void) resetCachedCenterOfPath;

- (void) updatePathRunCounters;

//For Subclassers
- (BOOL) canConfigurePathMode;              //Default: YES
- (NSInteger) minimumPathComponents;        //Default 3

@end
