WhirlyGlobe  1.1
A 3D interactive globe toolkit for ios
/Users/sjg/iPhone/WhirlyGlobe/WhirlyGlobeSrc/WhirlyGlobeLib/include/GlobeView.h
00001 /*
00002  *  GlobeView.h
00003  *  WhirlyGlobeLib
00004  *
00005  *  Created by Steve Gifford on 1/14/11.
00006  *  Copyright 2011 mousebird consulting
00007  *
00008  *  Licensed under the Apache License, Version 2.0 (the "License");
00009  *  you may not use this file except in compliance with the License.
00010  *  You may obtain a copy of the License at
00011  *  http://www.apache.org/licenses/LICENSE-2.0
00012  *
00013  *  Unless required by applicable law or agreed to in writing, software
00014  *  distributed under the License is distributed on an "AS IS" BASIS,
00015  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  *  See the License for the specific language governing permissions and
00017  *  limitations under the License.
00018  *
00019  */
00020 
00021 #import <UIKit/UIKit.h>
00022 #import "WhirlyVector.h"
00023 #import "WhirlyGeometry.h"
00024 
00025 @class WhirlyGlobeView;
00026 
00028 @protocol WhirlyGlobeAnimationDelegate
00030 - (void)updateView:(WhirlyGlobeView *)globeView;
00031 @end
00032 
00036 @interface WhirlyGlobeView : NSObject
00037 {
00038         float fieldOfView;
00039         float imagePlaneSize;
00040         float nearPlane;
00041         float farPlane;
00042         
00044         float heightAboveGlobe;
00045         
00047         Eigen::Quaternion<float> rotQuat;
00048     
00050     NSDate *lastChangedTime;
00051     
00053     NSObject<WhirlyGlobeAnimationDelegate> *delegate;
00054 }
00055 
00056 @property (nonatomic,assign) float fieldOfView,imagePlaneSize,nearPlane,farPlane,heightAboveGlobe;
00057 @property (nonatomic,assign) Eigen::Quaternion<float> rotQuat;
00058 @property (nonatomic,retain) NSDate *lastChangedTime;
00059 @property (nonatomic,retain) NSObject<WhirlyGlobeAnimationDelegate> *delegate;
00060 
00063 - (void)calcFrustumWidth:(unsigned int)frameWidth height:(unsigned int)frameHeight ll:(Point2f &)ll ur:(Point2f &)ur near:(float &)near far:(float &)far;
00064 
00066 - (float)minHeightAboveGlobe;
00067 - (float)maxHeightAboveGlobe;
00068 
00070 - (void)setHeightAboveGlobe:(float)newH;
00071 
00073 - (void)cancelAnimation;
00074 
00076 - (void)animate;
00077 
00079 - (float)calcZbufferRes;
00080 
00082 - (float)calcEarthZOffset;
00083 
00086 - (Eigen::Affine3f)calcModelMatrix;
00087 
00089 - (Eigen::Vector3f)currentUp;
00090 
00092 + (Eigen::Vector3f)prospectiveUp:(Eigen::Quaternion<float> &)prospectiveRot;
00093 
00095 - (Point3f)pointUnproject:(Point2f)screenPt width:(unsigned int)frameWidth height:(unsigned int)frameHeight clip:(bool)clip;
00096 
00101 - (bool)pointOnSphereFromScreen:(CGPoint)pt transform:(const Eigen::Affine3f *)transform frameSize:(const Point2f &)frameSize hit:(Point3f *)hit;
00102 
00106 - (CGPoint)pointOnScreenFromSphere:(const Point3f &)worldLoc transform:(const Eigen::Affine3f *)transform frameSize:(const Point2f &)frameSize;
00107 
00111 - (Eigen::Quaternionf) makeRotationToGeoCoord:(const WhirlyGlobe::GeoCoord &)worldLoc keepNorthUp:(BOOL)northUp;
00112 
00113 @end
00114 
00115