WhirlyGlobe  1.2
A 3D interactive globe toolkit for iOS
/Users/sjg/iPhone/WhirlyGlobe/WhirlyGlobeSrc/WhirlyGlobeLib/include/SphericalEarthLayer.h
00001 /*
00002  *  SphericalEarth.h
00003  *  WhirlyGlobeLib
00004  *
00005  *  Created by Steve Gifford on 1/11/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 <math.h>
00022 #import "WhirlyVector.h"
00023 #import "TextureGroup.h"
00024 #import "GlobeScene.h"
00025 #import "DataLayer.h"
00026 #import "RenderCache.h"
00027 
00028 // Each chunk of the globe is broken into this many units
00029 static const unsigned int SphereTessX = 10,SphereTessY = 25;
00030 //static const unsigned int SphereTessX = 20,SphereTessY = 50;
00031 
00038 @interface SphericalEarthLayer : NSObject<WhirlyGlobeLayer>
00039 {
00040         TextureGroup *texGroup;
00041         WhirlyGlobe::GlobeScene *scene;
00042         unsigned int xDim,yDim;
00043         unsigned int chunkX,chunkY;
00044     bool savingToCache;
00045     NSString *cacheName;
00046     WhirlyGlobe::RenderCacheWriter *cacheWriter;
00048     float fade;
00049 //      float radius;  // 1.0 by default
00050 }
00051 
00052 @property (nonatomic,assign) float fade;
00053 
00056 - (id)initWithTexGroup:(TextureGroup *)texGroup;
00057 
00061 - (id)initWithTexGroup:(TextureGroup *)texGroup cacheName:(NSString *)cacheName;
00062 
00064 - (void)saveToCacheName:(NSString *)cacheName;
00065 
00067 - (void)startWithThread:(WhirlyGlobeLayerThread *)layerThread scene:(WhirlyGlobe::GlobeScene *)scene;
00068 
00071 - (float)smallestTesselation;
00072 
00073 @end