Пример #1
0
	////////
	// FileHeader
	FileHeader::FileHeader(InStream &src)
	{
		uint32_t magic = src.ReadUInt32();
		if(magic != 0x0a270000)
			throw Exception("Not a .shp file");
		
		src.SkipBytes(20);
		mFileLength = src.ReadUInt32();
		SwapByteOrder(mFileLength);
		
		mVersion = src.ReadUInt32();
		if(mVersion != 1000)
			throw Exception("Unsupported version");
		
		uint32_t shapeTypeInt = src.ReadUInt32();
		if(!IsSupportedShapeType(shapeTypeInt))
			throw Exception("Unsupported shape type");
		mShapeType = (ShapeType)shapeTypeInt;
		
		mBoundingRect.mMin[0] = (float)src.ReadDouble();
		mBoundingRect.mMin[1] = (float)src.ReadDouble();
		mBoundingRect.mMax[0] = (float)src.ReadDouble();
		mBoundingRect.mMax[1] = (float)src.ReadDouble();
		mMinZ = (float)src.ReadDouble();
		mMaxZ = (float)src.ReadDouble();
		mMinM = (float)src.ReadDouble();
		mMaxM = (float)src.ReadDouble();
	}