GeoTessCPP
2.0.0
Software to facilitate storage and retrieval of 3D information about the Earth.
|
00001 //- **************************************************************************** 00002 //- 00003 //- Copyright 2009 Sandia Corporation. Under the terms of Contract 00004 //- DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 00005 //- retains certain rights in this software. 00006 //- 00007 //- BSD Open Source License. 00008 //- All rights reserved. 00009 //- 00010 //- Redistribution and use in source and binary forms, with or without 00011 //- modification, are permitted provided that the following conditions are met: 00012 //- 00013 //- * Redistributions of source code must retain the above copyright notice, 00014 //- this list of conditions and the following disclaimer. 00015 //- * Redistributions in binary form must reproduce the above copyright 00016 //- notice, this list of conditions and the following disclaimer in the 00017 //- documentation and/or other materials provided with the distribution. 00018 //- * Neither the name of Sandia National Laboratories nor the names of its 00019 //- contributors may be used to endorse or promote products derived from 00020 //- this software without specific prior written permission. 00021 //- 00022 //- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00023 //- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00024 //- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00025 //- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00026 //- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00027 //- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00028 //- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00029 //- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00030 //- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00031 //- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 //- POSSIBILITY OF SUCH DAMAGE. 00033 //- 00034 //- **************************************************************************** 00035 00036 #ifndef PROFILESURFACE_EMPTY_OBJECT_H 00037 #define PROFILESURFACE_EMPTY_OBJECT_H 00038 00039 // **** _SYSTEM INCLUDES_ ****************************************************** 00040 00041 #include <iostream> 00042 #include <string> 00043 #include <fstream> 00044 00045 // use standard library objects 00046 using namespace std; 00047 00048 // **** _LOCAL INCLUDES_ ******************************************************* 00049 00050 #include "GeoTessUtils.h" 00051 #include "GeoTessData.h" 00052 #include "GeoTessProfile.h" 00053 #include "GeoTessProfileType.h" 00054 #include "IFStreamAscii.h" 00055 #include "IFStreamBinary.h" 00056 #include "GeoTessDataValue.h" 00057 00058 // **** _BEGIN GEOTESS NAMESPACE_ ********************************************** 00059 00060 namespace geotess { 00061 00062 // **** _FORWARD REFERENCES_ *************************************************** 00063 00064 class GeoTessMetaData; 00065 00066 // **** _CLASS DEFINITION_ ***************************************************** 00067 00077 class GEOTESS_EXP_IMP GeoTessProfileSurfaceEmpty: virtual public GeoTessProfile { 00078 public: 00079 00080 GeoTessProfileSurfaceEmpty() : GeoTessProfile() { } 00081 00085 static string class_name() { return "ProfileSurfaceEmpty"; } 00086 00090 virtual int class_size() const { return (int) sizeof(GeoTessProfileSurfaceEmpty); } 00091 00097 virtual const GeoTessProfileType& getType() const { return GeoTessProfileType::SURFACE_EMPTY; } 00098 00102 virtual bool operator ==(const GeoTessProfile& p) const { return p.getType() == GeoTessProfileType::SURFACE_EMPTY; } 00103 00112 virtual double getValue(int attributeIndex, int nodeIndex) const { return NaN_DOUBLE; } 00113 00120 virtual double getValueTop(int attributeIndex) const { return NaN_DOUBLE; } 00121 00132 virtual bool isNaN(int nodeIndex, int attributeIndex) { return true; } 00133 00138 virtual double getValue(const GeoTessInterpolatorType& rInterpType, 00139 int attributeIndex, double radius, 00140 bool allowRadiusOutOfRange) const 00141 { return NaN_DOUBLE; } 00142 00146 virtual void setData(const vector<GeoTessData*>& inData) { } 00147 00151 virtual void setData(int index, GeoTessData* inData) { } 00152 00157 virtual GeoTessData** getData() 00158 { 00159 ostringstream os; 00160 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl 00161 << "Unsupported method call." << endl; 00162 throw GeoTessException(os, __FILE__, __LINE__, 4201); 00163 return (GeoTessData**) NULL; 00164 } 00165 00169 virtual GeoTessData* getData(int i) 00170 { 00171 ostringstream os; 00172 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl 00173 << "Unsupported method call." << endl; 00174 throw GeoTessException(os, __FILE__, __LINE__, 4201); 00175 return (GeoTessData*) NULL; 00176 } 00177 00181 virtual const GeoTessData& getData(int i) const 00182 { 00183 ostringstream os; 00184 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl 00185 << "Unsupported method call." << endl; 00186 throw GeoTessException(os, __FILE__, __LINE__, 4201); 00187 return *(new GeoTessDataValue<int>()); 00188 } 00192 virtual GeoTessData* getDataTop() 00193 { 00194 ostringstream os; 00195 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl 00196 << "Unsupported method call." << endl; 00197 throw GeoTessException(os, __FILE__, __LINE__, 4201); 00198 return (GeoTessData*) NULL; 00199 } 00200 00204 virtual const GeoTessData& getDataTop() const 00205 { 00206 ostringstream os; 00207 os << endl << "ERROR in ProfileSurfaceEmpty::getDataTop" << endl 00208 << "Unsupported method call." << endl; 00209 throw GeoTessException(os, __FILE__, __LINE__, 4201); 00210 return *(new GeoTessDataValue<int>()); 00211 } 00212 00216 virtual GeoTessData* getDataBottom() 00217 { 00218 ostringstream os; 00219 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl 00220 << "Unsupported method call." << endl; 00221 throw GeoTessException(os, __FILE__, __LINE__, 4201); 00222 return (GeoTessData*) NULL; 00223 } 00224 00228 virtual const GeoTessData& getDataBottom() const 00229 { 00230 ostringstream os; 00231 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl 00232 << "Unsupported method call." << endl; 00233 throw GeoTessException(os, __FILE__, __LINE__, 4201); 00234 return *(new GeoTessDataValue<int>()); 00235 } 00236 00241 virtual float getRadius(int i) const { return NaN_FLOAT; } 00242 00246 virtual void setRadii(const vector<float>& newRadii) { } 00247 00251 virtual float getRadiusTop() const { return NaN_FLOAT; } 00252 00256 virtual float getRadiusBottom() const { return NaN_FLOAT; } 00257 00261 virtual int getNRadii() const { return 0; } 00262 00266 virtual int getNData() const { return 0; } 00267 00271 virtual float* getRadii() { return (float*) NULL; } 00272 00274 00278 GeoTessProfileSurfaceEmpty(IFStreamBinary& ifs, GeoTessMetaData& gtmd) : GeoTessProfile() { } 00279 00283 GeoTessProfileSurfaceEmpty(IFStreamAscii& ifs, GeoTessMetaData& gtmd) : GeoTessProfile() { } 00284 00289 virtual ~GeoTessProfileSurfaceEmpty() { } 00290 00294 virtual void write(IFStreamBinary& ofs) 00295 { ofs.writeByte((byte) GeoTessProfileType::SURFACE_EMPTY.ordinal()); } 00296 00300 virtual void write(IFStreamAscii& ofs) 00301 { ofs.writeInt(GeoTessProfileType::SURFACE_EMPTY.ordinal()); ofs.writeNL();} 00302 00311 virtual int findClosestRadiusIndex(double radius) const { return -1; } 00312 00320 virtual void setPointIndex(int nodeIndex, int pntIndex) { } 00321 00329 virtual void resetPointIndices() { } 00330 00338 virtual int getPointIndex(int nodeIndex) const { return -1; } 00339 00343 virtual GeoTessProfile* copy() { return new GeoTessProfileSurfaceEmpty(); } 00344 00346 00347 }; 00348 // end class ProfileSurfaceEmpty 00349 00350 }// end namespace geotess 00351 00352 #endif // PROFILESURFACE_EMPTY_OBJECT_H