GeoTessCPP: rstt/GeoTessCPP/include/GeoTessProfileSurfaceEmpty.h Source File

GeoTessCPP 2.2.3 Software to facilitate storage and retrieval of 3D information about the Earth.

GeoTessProfileSurfaceEmpty.h
Go to the documentation of this file.
1 //- ****************************************************************************
2 //-
3 //- Copyright 2009 National Technology & Engineering Solutions of Sandia, LLC
4 //- (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
5 //- Government retains certain rights in this software.
6 //-
7 //- BSD Open Source License
8 //- All rights reserved.
9 //-
10 //- Redistribution and use in source and binary forms, with or without
11 //- modification, are permitted provided that the following conditions are met:
12 //-
13 //- 1. Redistributions of source code must retain the above copyright notice,
14 //- this list of conditions and the following disclaimer.
15 //-
16 //- 2. Redistributions in binary form must reproduce the above copyright
17 //- notice, this list of conditions and the following disclaimer in the
18 //- documentation and/or other materials provided with the distribution.
19 //-
20 //- 3. Neither the name of the copyright holder nor the names of its
21 //- contributors may be used to endorse or promote products derived from
22 //- this software without specific prior written permission.
23 //-
24 //- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 //- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 //- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 //- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28 //- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 //- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 //- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 //- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 //- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 //- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 //- POSSIBILITY OF SUCH DAMAGE.
35 //-
36 //- ****************************************************************************
37
38 #ifndef PROFILESURFACE_EMPTY_OBJECT_H
39 #define PROFILESURFACE_EMPTY_OBJECT_H
40
41 // **** _SYSTEM INCLUDES_ ******************************************************
42
43 #include <iostream>
44 #include <string>
45 #include <fstream>
46
47 // use standard library objects
48 using namespace std;
49
50 // **** _LOCAL INCLUDES_ *******************************************************
51
52 #include "GeoTessUtils.h"
53 #include "GeoTessData.h"
54 #include "GeoTessProfile.h"
55 #include "GeoTessProfileType.h"
56 #include "IFStreamAscii.h"
57 #include "IFStreamBinary.h"
58 #include "GeoTessDataValue.h"
59
60 // **** _BEGIN GEOTESS NAMESPACE_ **********************************************
61
62 namespace geotess {
63
64 // **** _FORWARD REFERENCES_ ***************************************************
65
66 class GeoTessMetaData;
67
68 // **** _CLASS DEFINITION_ *****************************************************
69
79 class GEOTESS_EXP_IMP GeoTessProfileSurfaceEmpty: virtual public GeoTessProfile {
80 public:
81
82 GeoTessProfileSurfaceEmpty() : GeoTessProfile() { }
83
87 static string class_name() { return "ProfileSurfaceEmpty"; }
88
92 virtual int class_size() const { return (int) sizeof(GeoTessProfileSurfaceEmpty); }
93
94 virtual LONG_INT getMemory() { return (LONG_INT)sizeof(GeoTessProfileSurfaceEmpty); }
95
101 virtual const GeoTessProfileType& getType() const { return GeoTessProfileType::SURFACE_EMPTY; }
102
106 virtual bool operator ==(const GeoTessProfile& p) const { return p.getType() == GeoTessProfileType::SURFACE_EMPTY; }
107
116 virtual double getValue(int attributeIndex, int nodeIndex) const { return NaN_DOUBLE; }
117
124 virtual double getValueTop(int attributeIndex) const { return NaN_DOUBLE; }
125
136 virtual bool isNaN(int nodeIndex, int attributeIndex) { return true; }
137
142 virtual double getValue(const GeoTessInterpolatorType& rInterpType,
143 int attributeIndex, double radius,
144 bool allowRadiusOutOfRange) const
145 { return NaN_DOUBLE; }
146
150 virtual void setData(const vector<GeoTessData*>& inData) { }
151
155 virtual void setData(int index, GeoTessData* inData) { }
156
161 virtual GeoTessData** getData()
162 {
163 ostringstream os;
164 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
165 << "Unsupported method call." << endl;
166 throw GeoTessException(os, __FILE__, __LINE__, 4201);
167 return (GeoTessData**) NULL;
168 }
169
173 virtual GeoTessData* getData(int i)
174 {
175 ostringstream os;
176 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
177 << "Unsupported method call." << endl;
178 throw GeoTessException(os, __FILE__, __LINE__, 4201);
179 return (GeoTessData*) NULL;
180 }
181
185 virtual const GeoTessData& getData(int i) const
186 {
187 ostringstream os;
188 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
189 << "Unsupported method call." << endl;
190 throw GeoTessException(os, __FILE__, __LINE__, 4201);
191 return *(new GeoTessDataValue<int>());
192 }
196 virtual GeoTessData* getDataTop()
197 {
198 ostringstream os;
199 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
200 << "Unsupported method call." << endl;
201 throw GeoTessException(os, __FILE__, __LINE__, 4201);
202 return (GeoTessData*) NULL;
203 }
204
208 virtual const GeoTessData& getDataTop() const
209 {
210 ostringstream os;
211 os << endl << "ERROR in ProfileSurfaceEmpty::getDataTop" << endl
212 << "Unsupported method call." << endl;
213 throw GeoTessException(os, __FILE__, __LINE__, 4201);
214 return *(new GeoTessDataValue<int>());
215 }
216
220 virtual GeoTessData* getDataBottom()
221 {
222 ostringstream os;
223 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
224 << "Unsupported method call." << endl;
225 throw GeoTessException(os, __FILE__, __LINE__, 4201);
226 return (GeoTessData*) NULL;
227 }
228
232 virtual const GeoTessData& getDataBottom() const
233 {
234 ostringstream os;
235 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
236 << "Unsupported method call." << endl;
237 throw GeoTessException(os, __FILE__, __LINE__, 4201);
238 return *(new GeoTessDataValue<int>());
239 }
240
245 virtual float getRadius(int i) const { return NaN_FLOAT; }
246
250 virtual void setRadii(const vector<float>& newRadii) { }
251
252 virtual void setRadius(int index, float radius)
253 { /* do nothing */ }
254
258 virtual float getRadiusTop() const { return NaN_FLOAT; }
259
263 virtual float getRadiusBottom() const { return NaN_FLOAT; }
264
268 virtual int getNRadii() const { return 0; }
269
273 virtual int getNData() const { return 0; }
274
278 virtual float* getRadii() { return (float*) NULL; }
279
281
285 GeoTessProfileSurfaceEmpty(IFStreamBinary& ifs, GeoTessMetaData& gtmd) : GeoTessProfile() { }
286
290 GeoTessProfileSurfaceEmpty(IFStreamAscii& ifs, GeoTessMetaData& gtmd) : GeoTessProfile() { }
291
296 virtual ~GeoTessProfileSurfaceEmpty() { }
297
301 virtual void write(IFStreamBinary& ofs)
302 { ofs.writeByte((byte) GeoTessProfileType::SURFACE_EMPTY.ordinal()); }
303
307 virtual void write(IFStreamAscii& ofs)
308 { ofs.writeInt(GeoTessProfileType::SURFACE_EMPTY.ordinal()); ofs.writeNL();}
309
318 virtual int findClosestRadiusIndex(double radius) const { return -1; }
319
327 virtual void setPointIndex(int nodeIndex, int pntIndex) { }
328
336 virtual void resetPointIndices() { }
337
345 virtual int getPointIndex(int nodeIndex) const { return -1; }
346
350 virtual GeoTessProfile* copy() { return new GeoTessProfileSurfaceEmpty(); }
351
353
354 };
355 // end class ProfileSurfaceEmpty
356
357 }// end namespace geotess
358
359 #endif // PROFILESURFACE_EMPTY_OBJECT_H
geotess::GeoTessProfileSurfaceEmpty::getData
virtual const GeoTessData & getData(int i) const
Definition: GeoTessProfileSurfaceEmpty.h:185
geotess::GeoTessProfileSurfaceEmpty::setData
virtual void setData(const vector< GeoTessData * > &inData)
Definition: GeoTessProfileSurfaceEmpty.h:150
geotess::GeoTessProfileSurfaceEmpty::getValue
virtual double getValue(const GeoTessInterpolatorType &rInterpType, int attributeIndex, double radius, bool allowRadiusOutOfRange) const
Definition: GeoTessProfileSurfaceEmpty.h:142
geotess
Definition: ArrayReuse.h:57
IFStreamBinary.h
geotess::GeoTessProfile
Abstract class that manages the radii and data values that span a single layer associated with a sing...
Definition: GeoTessProfile.h:99
GeoTessProfileType.h
geotess::GeoTessProfileSurfaceEmpty::getRadiusBottom
virtual float getRadiusBottom() const
Definition: GeoTessProfileSurfaceEmpty.h:263
GeoTessData.h
geotess::GeoTessProfileSurfaceEmpty::getNRadii
virtual int getNRadii() const
Definition: GeoTessProfileSurfaceEmpty.h:268
GeoTessProfile.h
geotess::GeoTessProfileType
Enumeration of the valid Profile types, including EMPTY, THIN, CONSTANT, NPOINT and SURFACE.
Definition: GeoTessProfileType.h:72
geotess::GeoTessDataValue
Manages a single data value attached to a grid node.
Definition: GeoTessData.h:65
geotess::GeoTessProfileSurfaceEmpty::class_name
static string class_name()
Definition: GeoTessProfileSurfaceEmpty.h:87
geotess::GeoTessProfileSurfaceEmpty::getNData
virtual int getNData() const
Definition: GeoTessProfileSurfaceEmpty.h:273
geotess::GeoTessProfileSurfaceEmpty::getData
virtual GeoTessData ** getData()
Definition: GeoTessProfileSurfaceEmpty.h:161
geotess::GeoTessProfileSurfaceEmpty::GeoTessProfileSurfaceEmpty
GeoTessProfileSurfaceEmpty()
Definition: GeoTessProfileSurfaceEmpty.h:82
geotess::GeoTessProfileSurfaceEmpty::getRadiusTop
virtual float getRadiusTop() const
Definition: GeoTessProfileSurfaceEmpty.h:258
geotess::GeoTessProfileSurfaceEmpty::getType
virtual const GeoTessProfileType & getType() const
Definition: GeoTessProfileSurfaceEmpty.h:101
geotess::GeoTessProfileSurfaceEmpty::setRadius
virtual void setRadius(int index, float radius)
Definition: GeoTessProfileSurfaceEmpty.h:252
geotess::GeoTessProfileSurfaceEmpty::getDataTop
virtual const GeoTessData & getDataTop() const
Definition: GeoTessProfileSurfaceEmpty.h:208
GeoTessUtils.h
geotess::GeoTessProfileSurfaceEmpty::getRadii
virtual float * getRadii()
Definition: GeoTessProfileSurfaceEmpty.h:278
geotess::GeoTessProfileSurfaceEmpty::getValue
virtual double getValue(int attributeIndex, int nodeIndex) const
Definition: GeoTessProfileSurfaceEmpty.h:116
LONG_INT
#define LONG_INT
Definition: CPPGlobals.h:113
geotess::GeoTessProfileSurfaceEmpty::setRadii
virtual void setRadii(const vector< float > &newRadii)
Definition: GeoTessProfileSurfaceEmpty.h:250
geotess::GeoTessProfileSurfaceEmpty::setData
virtual void setData(int index, GeoTessData *inData)
Definition: GeoTessProfileSurfaceEmpty.h:155
geotess::GeoTessProfileSurfaceEmpty::class_size
virtual int class_size() const
Definition: GeoTessProfileSurfaceEmpty.h:92
geotess::GeoTessProfileSurfaceEmpty::getDataTop
virtual GeoTessData * getDataTop()
Definition: GeoTessProfileSurfaceEmpty.h:196
geotess::GeoTessProfileSurfaceEmpty::isNaN
virtual bool isNaN(int nodeIndex, int attributeIndex)
Definition: GeoTessProfileSurfaceEmpty.h:136
geotess::GeoTessData
Abstract base class that manages the data values attached to a single grid point.
Definition: GeoTessData.h:78
GEOTESS_EXP_IMP
#define GEOTESS_EXP_IMP
Definition: CPPGlobals.h:73
IFStreamAscii.h
geotess::GeoTessProfileSurfaceEmpty::getData
virtual GeoTessData * getData(int i)
Definition: GeoTessProfileSurfaceEmpty.h:173
geotess::GeoTessProfileSurfaceEmpty::getValueTop
virtual double getValueTop(int attributeIndex) const
Definition: GeoTessProfileSurfaceEmpty.h:124
geotess::IFStreamBinary
Opens a file for binary read and write access.
Definition: IFStreamBinary.h:82
geotess::GeoTessMetaData
Basic metadata information about a GeoTessModel.
Definition: GeoTessMetaData.h:98
geotess::GeoTessProfile::getType
virtual const GeoTessProfileType & getType() const
geotess::GeoTessProfileSurfaceEmpty::getDataBottom
virtual const GeoTessData & getDataBottom() const
Definition: GeoTessProfileSurfaceEmpty.h:232
GeoTessDataValue.h
geotess::GeoTessException
An exception class for all GeoTess objects.
Definition: GeoTessException.h:68
geotess::GeoTessProfileSurfaceEmpty::getMemory
virtual LONG_INT getMemory()
Definition: GeoTessProfileSurfaceEmpty.h:94
geotess::GeoTessProfileSurfaceEmpty::getRadius
virtual float getRadius(int i) const
Definition: GeoTessProfileSurfaceEmpty.h:245
geotess::GeoTessProfileSurfaceEmpty
A Profile object that defines a single Data object and no radius value.
Definition: GeoTessProfileSurfaceEmpty.h:79
geotess::GeoTessInterpolatorType
Enumeration of the interpolation algorithms supported by GeoTess including LINEAR,...
Definition: GeoTessInterpolatorType.h:74
geotess::GeoTessProfileSurfaceEmpty::getDataBottom
virtual GeoTessData * getDataBottom()
Definition: GeoTessProfileSurfaceEmpty.h:220