WhirlyGlobe  1.2
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 
00026 @class WhirlyGlobeView;
00028 
00030 @protocol WhirlyGlobeAnimationDelegate
00032 - (void)updateView:(WhirlyGlobeView *)globeView;
00033 @end
00034 
00038 @interface WhirlyGlobeView : NSObject
00039 {
00040         float fieldOfView;
00041         float imagePlaneSize;
00042         float nearPlane;
00043         float farPlane;
00044         
00046         float heightAboveGlobe;
00047         
00049         Eigen::Quaternion<float> rotQuat;
00050     
00052     NSDate *lastChangedTime;
00053     
00055     NSObject<WhirlyGlobeAnimationDelegate> *delegate;
00056 }
00057 
00058 @property (nonatomic,assign) float fieldOfView,imagePlaneSize,nearPlane,farPlane,heightAboveGlobe;
00059 @property (nonatomic,assign) Eigen::Quaternion<float> rotQuat;
00060 @property (nonatomic,retain) NSDate *lastChangedTime;
00061 @property (nonatomic,retain) NSObject<WhirlyGlobeAnimationDelegate> *delegate;
00062 
00065 - (void)calcFrustumWidth:(unsigned int)frameWidth height:(unsigned int)frameHeight ll:(Point2f &)ll ur:(Point2f &)ur near:(float &)near far:(float &)far;
00066 
00068 - (float)minHeightAboveGlobe;
00069 - (float)maxHeightAboveGlobe;
00070 
00072 - (void)setHeightAboveGlobe:(float)newH;
00073 
00075 - (void)cancelAnimation;
00076 
00078 - (void)animate;
00079 
00081 - (float)calcZbufferRes;
00082 
00084 - (float)calcEarthZOffset;
00085 
00088 - (Eigen::Affine3f)calcModelMatrix;
00089 
00091 - (Eigen::Vector3f)currentUp;
00092 
00094 + (Eigen::Vector3f)prospectiveUp:(Eigen::Quaternion<float> &)prospectiveRot;
00095 
00097 - (Point3f)pointUnproject:(Point2f)screenPt width:(unsigned int)frameWidth height:(unsigned int)frameHeight clip:(bool)clip;
00098 
00103 - (bool)pointOnSphereFromScreen:(CGPoint)pt transform:(const Eigen::Affine3f *)transform frameSize:(const Point2f &)frameSize hit:(Point3f *)hit;
00104 
00108 - (CGPoint)pointOnScreenFromSphere:(const Point3f &)worldLoc transform:(const Eigen::Affine3f *)transform frameSize:(const Point2f &)frameSize;
00109 
00113 - (Eigen::Quaternionf) makeRotationToGeoCoord:(const WhirlyGlobe::GeoCoord &)worldLoc keepNorthUp:(BOOL)northUp;
00114 
00115 @end
00116 
00117