source: orbit/iOS/Orbit/Orbit/CorePlotHeaders/CPTAxis.h @ e5b8e57

ServoTab_Interfacepyramid
Last change on this file since e5b8e57 was a9059a5, checked in by Steve Castellotti <sc@…>, 10 years ago

Arduino:

  • updated to permit custom setting of Throttle, Yaw, and Pitch

Android:

  • Minor tweak to Configuration location

iOS:

  • Property mode set to 100644
File size: 9.0 KB
Line 
1#import "CPTDefinitions.h"
2#import "CPTLayer.h"
3#import "CPTTextStyle.h"
4#import <Foundation/Foundation.h>
5
6/// @file
7
8@class CPTAxis;
9@class CPTAxisSet;
10@class CPTAxisTitle;
11@class CPTGridLines;
12@class CPTLimitBand;
13@class CPTLineCap;
14@class CPTLineStyle;
15@class CPTPlotSpace;
16@class CPTPlotRange;
17@class CPTPlotArea;
18@class CPTShadow;
19
20/**
21 *  @brief Enumeration of labeling policies
22 **/
23typedef enum _CPTAxisLabelingPolicy {
24    CPTAxisLabelingPolicyNone,              ///< No labels provided; user sets labels and tick locations.
25    CPTAxisLabelingPolicyLocationsProvided, ///< User sets tick locations; axis makes labels.
26    CPTAxisLabelingPolicyFixedInterval,     ///< Fixed interval labeling policy.
27    CPTAxisLabelingPolicyAutomatic,         ///< Automatic labeling policy.
28    CPTAxisLabelingPolicyEqualDivisions     ///< Divide the plot range into equal parts.
29}
30CPTAxisLabelingPolicy;
31
32#pragma mark -
33
34/**
35 *  @brief Axis labeling delegate.
36 **/
37@protocol CPTAxisDelegate<NSObject>
38
39@optional
40
41/// @name Labels
42/// @{
43
44/** @brief @optional Determines if the axis should relabel itself now.
45 *  @param axis The axis.
46 *  @return @YES if the axis should relabel now.
47 **/
48-(BOOL)axisShouldRelabel:(CPTAxis *)axis;
49
50/** @brief @optional The method is called after the axis is relabeled to allow the delegate to perform any
51 *  necessary cleanup or further labeling actions.
52 *  @param axis The axis.
53 **/
54-(void)axisDidRelabel:(CPTAxis *)axis;
55
56/** @brief @optional This method gives the delegate a chance to create custom labels for each tick.
57 *  It can be used with any labeling policy. Returning @NO will cause the axis not
58 *  to update the labels. It is then the delegate&rsquo;s responsiblity to do this.
59 *  @param axis The axis.
60 *  @param locations The locations of the major ticks.
61 *  @return @YES if the axis class should proceed with automatic labeling.
62 **/
63-(BOOL)axis:(CPTAxis *)axis shouldUpdateAxisLabelsAtLocations:(NSSet *)locations;
64
65/** @brief @optional This method gives the delegate a chance to create custom labels for each minor tick.
66 *  It can be used with any labeling policy. Returning @NO will cause the axis not
67 *  to update the labels. It is then the delegate&rsquo;s responsiblity to do this.
68 *  @param axis The axis.
69 *  @param locations The locations of the minor ticks.
70 *  @return @YES if the axis class should proceed with automatic labeling.
71 **/
72-(BOOL)axis:(CPTAxis *)axis shouldUpdateMinorAxisLabelsAtLocations:(NSSet *)locations;
73
74/// @}
75
76@end
77
78#pragma mark -
79
80@interface CPTAxis : CPTLayer {
81    @private
82    CPTCoordinate coordinate;
83    CPTPlotSpace *plotSpace;
84    NSSet *majorTickLocations;
85    NSSet *minorTickLocations;
86    CGFloat majorTickLength;
87    CGFloat minorTickLength;
88    CGFloat labelOffset;
89    CGFloat minorTickLabelOffset;
90    CGFloat labelRotation;
91    CGFloat minorTickLabelRotation;
92    CPTAlignment labelAlignment;
93    CPTAlignment minorTickLabelAlignment;
94    CPTLineStyle *axisLineStyle;
95    CPTLineStyle *majorTickLineStyle;
96    CPTLineStyle *minorTickLineStyle;
97    CPTLineStyle *majorGridLineStyle;
98    CPTLineStyle *minorGridLineStyle;
99    CPTLineCap *axisLineCapMin;
100    CPTLineCap *axisLineCapMax;
101    NSDecimal labelingOrigin;
102    NSDecimal majorIntervalLength;
103    NSUInteger minorTicksPerInterval;
104    NSUInteger preferredNumberOfMajorTicks;
105    CPTAxisLabelingPolicy labelingPolicy;
106    CPTTextStyle *labelTextStyle;
107    CPTTextStyle *minorTickLabelTextStyle;
108    CPTTextStyle *titleTextStyle;
109    NSNumberFormatter *labelFormatter;
110    NSNumberFormatter *minorTickLabelFormatter;
111    BOOL labelFormatterChanged;
112    BOOL minorLabelFormatterChanged;
113    NSSet *axisLabels;
114    NSSet *minorTickAxisLabels;
115    CPTAxisTitle *axisTitle;
116    NSString *title;
117    CGFloat titleOffset;
118    CGFloat titleRotation;
119    NSDecimal titleLocation;
120    CPTSign tickDirection;
121    BOOL needsRelabel;
122    NSArray *labelExclusionRanges;
123    CPTPlotRange *visibleRange;
124    CPTPlotRange *visibleAxisRange;
125    CPTPlotRange *gridLinesRange;
126    NSArray *alternatingBandFills;
127    NSMutableArray *mutableBackgroundLimitBands;
128    BOOL separateLayers;
129    CPTShadow *labelShadow;
130    __cpt_weak CPTPlotArea *plotArea;
131    __cpt_weak CPTGridLines *minorGridLines;
132    __cpt_weak CPTGridLines *majorGridLines;
133}
134
135/// @name Axis
136/// @{
137@property (nonatomic, readwrite, copy) CPTLineStyle *axisLineStyle;
138@property (nonatomic, readwrite, assign) CPTCoordinate coordinate;
139@property (nonatomic, readwrite, assign) NSDecimal labelingOrigin;
140@property (nonatomic, readwrite, assign) CPTSign tickDirection;
141@property (nonatomic, readwrite, copy) CPTPlotRange *visibleRange;
142@property (nonatomic, readwrite, copy) CPTPlotRange *visibleAxisRange;
143@property (nonatomic, readwrite, copy) CPTLineCap *axisLineCapMin;
144@property (nonatomic, readwrite, copy) CPTLineCap *axisLineCapMax;
145/// @}
146
147/// @name Title
148/// @{
149@property (nonatomic, readwrite, copy) CPTTextStyle *titleTextStyle;
150@property (nonatomic, readwrite, retain) CPTAxisTitle *axisTitle;
151@property (nonatomic, readwrite, assign) CGFloat titleOffset;
152@property (nonatomic, readwrite, copy) NSString *title;
153@property (nonatomic, readwrite, assign) CGFloat titleRotation;
154@property (nonatomic, readwrite, assign) NSDecimal titleLocation;
155@property (nonatomic, readonly, assign) NSDecimal defaultTitleLocation;
156/// @}
157
158/// @name Labels
159/// @{
160@property (nonatomic, readwrite, assign) CPTAxisLabelingPolicy labelingPolicy;
161@property (nonatomic, readwrite, assign) CGFloat labelOffset;
162@property (nonatomic, readwrite, assign) CGFloat minorTickLabelOffset;
163@property (nonatomic, readwrite, assign) CGFloat labelRotation;
164@property (nonatomic, readwrite, assign) CGFloat minorTickLabelRotation;
165@property (nonatomic, readwrite, assign) CPTAlignment labelAlignment;
166@property (nonatomic, readwrite, assign) CPTAlignment minorTickLabelAlignment;
167@property (nonatomic, readwrite, copy) CPTTextStyle *labelTextStyle;
168@property (nonatomic, readwrite, copy) CPTTextStyle *minorTickLabelTextStyle;
169@property (nonatomic, readwrite, retain) NSNumberFormatter *labelFormatter;
170@property (nonatomic, readwrite, retain) NSNumberFormatter *minorTickLabelFormatter;
171@property (nonatomic, readwrite, retain) NSSet *axisLabels;
172@property (nonatomic, readwrite, retain) NSSet *minorTickAxisLabels;
173@property (nonatomic, readonly, assign) BOOL needsRelabel;
174@property (nonatomic, readwrite, retain) NSArray *labelExclusionRanges;
175@property (nonatomic, readwrite, retain) CPTShadow *labelShadow;
176/// @}
177
178/// @name Major Ticks
179/// @{
180@property (nonatomic, readwrite, assign) NSDecimal majorIntervalLength;
181@property (nonatomic, readwrite, assign) CGFloat majorTickLength;
182@property (nonatomic, readwrite, copy) CPTLineStyle *majorTickLineStyle;
183@property (nonatomic, readwrite, retain) NSSet *majorTickLocations;
184@property (nonatomic, readwrite, assign) NSUInteger preferredNumberOfMajorTicks;
185/// @}
186
187/// @name Minor Ticks
188/// @{
189@property (nonatomic, readwrite, assign) NSUInteger minorTicksPerInterval;
190@property (nonatomic, readwrite, assign) CGFloat minorTickLength;
191@property (nonatomic, readwrite, copy) CPTLineStyle *minorTickLineStyle;
192@property (nonatomic, readwrite, retain) NSSet *minorTickLocations;
193/// @}
194
195/// @name Grid Lines
196/// @{
197@property (nonatomic, readwrite, copy) CPTLineStyle *majorGridLineStyle;
198@property (nonatomic, readwrite, copy) CPTLineStyle *minorGridLineStyle;
199@property (nonatomic, readwrite, copy) CPTPlotRange *gridLinesRange;
200/// @}
201
202/// @name Background Bands
203/// @{
204@property (nonatomic, readwrite, copy) NSArray *alternatingBandFills;
205@property (nonatomic, readonly, retain) NSArray *backgroundLimitBands;
206/// @}
207
208/// @name Plot Space
209/// @{
210@property (nonatomic, readwrite, retain) CPTPlotSpace *plotSpace;
211/// @}
212
213/// @name Layers
214/// @{
215@property (nonatomic, readwrite, assign) BOOL separateLayers;
216@property (nonatomic, readwrite, cpt_weak_property) __cpt_weak CPTPlotArea *plotArea;
217@property (nonatomic, readonly, cpt_weak_property) __cpt_weak CPTGridLines *minorGridLines;
218@property (nonatomic, readonly, cpt_weak_property) __cpt_weak CPTGridLines *majorGridLines;
219@property (nonatomic, readonly, retain) CPTAxisSet *axisSet;
220/// @}
221
222/// @name Labels
223/// @{
224-(void)relabel;
225-(void)setNeedsRelabel;
226-(void)updateMajorTickLabels;
227-(void)updateMinorTickLabels;
228/// @}
229
230/// @name Ticks
231/// @{
232-(NSSet *)filteredMajorTickLocations:(NSSet *)allLocations;
233-(NSSet *)filteredMinorTickLocations:(NSSet *)allLocations;
234/// @}
235
236/// @name Background Bands
237/// @{
238-(void)addBackgroundLimitBand:(CPTLimitBand *)limitBand;
239-(void)removeBackgroundLimitBand:(CPTLimitBand *)limitBand;
240/// @}
241
242@end
243
244#pragma mark -
245
246/** @category CPTAxis(AbstractMethods)
247 *  @brief CPTAxis abstract methods—must be overridden by subclasses
248 **/
249@interface CPTAxis(AbstractMethods)
250
251/// @name Coordinate Space Conversions
252/// @{
253-(CGPoint)viewPointForCoordinateDecimalNumber:(NSDecimal)coordinateDecimalNumber;
254/// @}
255
256/// @name Grid Lines
257/// @{
258-(void)drawGridLinesInContext:(CGContextRef)context isMajor:(BOOL)major;
259/// @}
260
261/// @name Background Bands
262/// @{
263-(void)drawBackgroundBandsInContext:(CGContextRef)context;
264-(void)drawBackgroundLimitsInContext:(CGContextRef)context;
265/// @}
266
267@end
Note: See TracBrowser for help on using the repository browser.