aboutsummaryrefslogtreecommitdiff
path: root/iosApp/WhirlyGlobeMaplyComponent.xcframework/ios-arm64/WhirlyGlobeMaplyComponent.framework/Headers/MaplyGlobeRenderController.h
blob: 95d1b615206051cfdcfc7799ad147a0e64968277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
*  MaplyGlobeRenderController.h
*  WhirlyGlobeComponent
*
*  Created by Steve Gifford on 10/23/10.
*  Copyright 2011-2022 mousebird consulting
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*
*/

#import <UIKit/UIKit.h>
#import <WhirlyGlobeMaplyComponent/MaplyRenderController.h>
#import <WhirlyGlobeMaplyComponent/MaplyRemoteTileFetcher.h>

/**
    Animation State used by the WhirlyGlobeViewControllerAnimationDelegate.
    
    You fill out one of these when you're implementing the animation delegate.  Return it and the view controller will set the respective values to match.
  */
@interface WhirlyGlobeViewControllerAnimationState : NSObject

/// Heading is calculated from due north
/// If not set or set to MAXFLOAT, this is ignored
@property (nonatomic) double heading;

/// Height above the globe
@property (nonatomic) double height;

/// Tilt as used in the view controller
/// If not set or set to MAXFLOAT, we calculate tilt the regular way
@property (nonatomic) double tilt;

/// Roll as used in the view controller
@property (nonatomic) double roll;

/// Position to move to on the globe
@property (nonatomic) MaplyCoordinateD pos;

/// If set, this is a point on the screen where pos should be.
/// By default this is (-1,-1) meaning the screen position is just the middle.  Otherwise, this is where the position should wind up on the screen, if it can.
@property (nonatomic) CGPoint screenPos;

/// If set, the globe will be centered at this point on the screen
@property (nonatomic) CGPoint globeCenter;

/**
    Interpolate a new state between the given states A and B.
    
    This does a simple interpolation (lat/lon, not great circle) between the two animation states.
  */
+ (nonnull WhirlyGlobeViewControllerAnimationState *)Interpolate:(double)t from:(WhirlyGlobeViewControllerAnimationState *__nonnull)stateA to:(WhirlyGlobeViewControllerAnimationState *__nonnull)stateB;

@end

/**
   The Globe Render Controller is a standalone renderer for the globe.
      This is separate from the WhirlyGlobeViewController, but performs a similar function for
    offline rendering.
 */
@interface WhirlyGlobeRenderController : MaplyRenderController

/// Initialize with the size of the target rendering buffer
- (instancetype __nullable) initWithSize:(CGSize)screenSize mode:(MaplyRenderType)renderType;

/// Initialize as an offline renderer of a given target size with default renderer (Metal)
- (instancetype __nullable)initWithSize:(CGSize)size;

/** Set this if you're doing frame by frame animation.
    It will move particles along and run any animations you may have going.
 **/
@property (nonatomic,assign) NSTimeInterval currentTime;

/**
    Set the viewing state all at once
    
    This sets the position, tilt, height, screen position and heading all at once.
  */
- (void)setViewState:(WhirlyGlobeViewControllerAnimationState *__nonnull)viewState;

/**
    Make a WhirlyGlobeViewControllerAnimationState object from the current view state.
    
    This returns the current view parameters in a single WhirlyGlobeViewControllerAnimationState.
  */
- (nullable WhirlyGlobeViewControllerAnimationState *)getViewState;

/**
    Takes a snapshot of the current OpenGL view and returns it.
  */
- (UIImage *__nullable)snapshot;

/**
     This version of snapshot just returns the raw NSData from the "screen".
 */
- (NSData *__nullable)snapshotData;


/**
    If set, keep north facing upward on the screen as the user moves around.
    
    Off by default.
  */
@property(nonatomic,assign) bool keepNorthUp;

@end