WhirlyGlobe  1.1
A 3D interactive globe toolkit for ios
/Users/sjg/iPhone/WhirlyGlobe/WhirlyGlobeSrc/WhirlyGlobeLib/include/ShapeReader.h
00001 /*
00002  *  ShapeReader.h
00003  *  WhirlyGlobeLib
00004  *
00005  *  Created by Steve Gifford on 2/1/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 "VectorData.h"
00023 #import "GlobeMath.h"
00024 
00025 namespace WhirlyGlobe
00026 {
00027 
00031 class ShapeReader : public VectorReader
00032 {
00033 public:
00035         ShapeReader(NSString *fileName);
00036         virtual ~ShapeReader();
00037         
00039         virtual bool isValid();
00040         
00042         virtual VectorShapeRef getNextObject(const StringSet *filterAttrs);
00043     
00045     virtual bool canReadByIndex() { return true; }
00046     
00048     virtual unsigned int getNumObjects();
00049 
00051     virtual VectorShapeRef getObjectByIndex(unsigned int vecIndex,const StringSet *filter);
00052     
00053 protected:
00054         void *shp;
00055         void *dbf;
00056         int where,numEntity,shapeType;
00057         double minBound[4], maxBound[4];
00058 };
00059 
00060 }