Core Plot (macOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTConstraints Class Reference

Implements a one-dimensional constrained position within a given numeric range. More...

#import <CPTConstraints.h>

+ Inheritance diagram for CPTConstraints:
+ Collaboration diagram for CPTConstraints:

Public Class Methods

Factory Methods
(nonnull instancetype) + constraintWithLowerOffset:
 Creates and returns a new CPTConstraints instance initialized with a fixed offset from the lower bound. More...
 
(nonnull instancetype) + constraintWithUpperOffset:
 Creates and returns a new CPTConstraints instance initialized with a fixed offset from the upper bound. More...
 
(nonnull instancetype) + constraintWithRelativeOffset:
 Creates and returns a new CPTConstraints instance initialized with a proportional offset relative to the bounds. More...
 
- Public Class Methods inherited from NSObject
(id+ alloc
 
(Class+ class
 
(void) + initialize
 
(void) + load
 
(id+ new
 
- Public Class Methods inherited from <NSKeyValueBindingCreation>
(void) + exposeBinding:
 
- Public Class Methods inherited from <NSSecureCoding>
(BOOL+ supportsSecureCoding:
 

Public Instance Methods

(CGFloat- positionForLowerBound:upperBound: [implementation]
 Compute the position given a range of values. More...
 
Initialization
(nonnull instancetype) - initWithLowerOffset:
 Initializes a newly allocated CPTConstraints instance initialized with a fixed offset from the lower bound. More...
 
(nonnull instancetype) - initWithUpperOffset:
 Initializes a newly allocated CPTConstraints instance initialized with a fixed offset from the upper bound. More...
 
(nonnull instancetype) - initWithRelativeOffset:
 Initializes a newly allocated CPTConstraints instance initialized with a proportional offset relative to the bounds. More...
 
Comparison
(BOOL- isEqualToConstraint:
 Determines whether a given constraint is equal to the receiver. More...
 
Position
(CGFloat- positionForLowerBound:upperBound:
 
- Public Instance Methods inherited from NSObject
(Class- classForCoder
 
(id- copy
 
(void) - dealloc
 
(void) - finalize
 
(id- init
 
(id- mutableCopy
 
- Public Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger- hash
 
(BOOL- isEqual:
 
- Public Instance Methods inherited from <NSKeyValueBindingCreation>
(NSArray *) - exposedBindings
 
(Class- valueClassForBinding:
 
(void) - bind:toObject:withKeyPath:options:
 
(NSArray *) - optionDescriptionsForBinding:
 
(NSDictionary *) - infoForBinding:
 
(void) - unbind:
 
- Public Instance Methods inherited from <NSCopying>
(id- copyWithZone:
 
- Public Instance Methods inherited from <NSCoding>
(id- initWithCoder:
 
(void) - encodeWithCoder:
 

Detailed Description

Implements a one-dimensional constrained position within a given numeric range.

Supports fixed distance from either end of the range and a proportional fraction of the range.

Method Documentation

◆ constraintWithLowerOffset:

+ (nonnull instancetype) constraintWithLowerOffset: (CGFloat newOffset

Creates and returns a new CPTConstraints instance initialized with a fixed offset from the lower bound.

Parameters
newOffsetThe offset.
Returns
A new CPTConstraints instance initialized with the given offset.

◆ constraintWithRelativeOffset:

+ (nonnull instancetype) constraintWithRelativeOffset: (CGFloat newOffset

Creates and returns a new CPTConstraints instance initialized with a proportional offset relative to the bounds.

For example, an offset of 0.0 will return a position equal to the lower bound, 1.0 will return the upper bound, and 0.5 will return a point midway between the two bounds.

Parameters
newOffsetThe offset.
Returns
A new CPTConstraints instance initialized with the given offset.

◆ constraintWithUpperOffset:

+ (nonnull instancetype) constraintWithUpperOffset: (CGFloat newOffset

Creates and returns a new CPTConstraints instance initialized with a fixed offset from the upper bound.

Parameters
newOffsetThe offset.
Returns
A new CPTConstraints instance initialized with the given offset.

◆ initWithLowerOffset:

- (nonnull instancetype) initWithLowerOffset: (CGFloat newOffset

Initializes a newly allocated CPTConstraints instance initialized with a fixed offset from the lower bound.

Parameters
newOffsetThe offset.
Returns
The initialized CPTConstraints object.

◆ initWithRelativeOffset:

- (nonnull instancetype) initWithRelativeOffset: (CGFloat newOffset

Initializes a newly allocated CPTConstraints instance initialized with a proportional offset relative to the bounds.

For example, an offset of 0.0 will return a position equal to the lower bound, 1.0 will return the upper bound, and 0.5 will return a point midway between the two bounds.

Parameters
newOffsetThe offset.
Returns
The initialized CPTConstraints object.

◆ initWithUpperOffset:

- (nonnull instancetype) initWithUpperOffset: (CGFloat newOffset

Initializes a newly allocated CPTConstraints instance initialized with a fixed offset from the upper bound.

Parameters
newOffsetThe offset.
Returns
The initialized CPTConstraints object.

◆ isEqualToConstraint:

- (BOOL) isEqualToConstraint: (nullable CPTConstraints *)  otherConstraint

Determines whether a given constraint is equal to the receiver.

Parameters
otherConstraintThe constraint to check.
Returns
YES if the constraints are equal.

Provided by category CPTConstraints(AbstractMethods).

◆ positionForLowerBound:upperBound: [1/2]

- (CGFloat) positionForLowerBound: (CGFloat __unused)  lowerBound
upperBound: (CGFloat __unused)  upperBound 
implementation

Compute the position given a range of values.

Parameters
lowerBoundThe lower bound; must be less than or equal to the upperBound.
upperBoundThe upper bound; must be greater than or equal to the lowerBound.
Returns
The calculated position.

Provided by category CPTConstraints(AbstractMethods).

◆ positionForLowerBound:upperBound: [2/2]

- (CGFloat) positionForLowerBound: (CGFloat lowerBound
upperBound: (CGFloat upperBound 

Provided by category CPTConstraints(AbstractMethods).


The documentation for this class was generated from the following files: