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

Loading...
Searching...
No Matches
GeoTessProfileSurfaceEmpty.h
Go to the documentation of this file.
1//- ****************************************************************************
2//-
3//- Copyright 2009 Sandia Corporation. Under the terms of Contract
4//- DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
5//- 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//- * Redistributions of source code must retain the above copyright notice,
14//- this list of conditions and the following disclaimer.
15//- * Redistributions in binary form must reproduce the above copyright
16//- notice, this list of conditions and the following disclaimer in the
17//- documentation and/or other materials provided with the distribution.
18//- * Neither the name of Sandia National Laboratories nor the names of its
19//- contributors may be used to endorse or promote products derived from
20//- this software without specific prior written permission.
21//-
22//- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23//- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24//- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25//- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26//- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27//- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28//- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29//- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30//- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31//- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32//- POSSIBILITY OF SUCH DAMAGE.
33//-
34//- ****************************************************************************
35
36#ifndef PROFILESURFACE_EMPTY_OBJECT_H
37#define PROFILESURFACE_EMPTY_OBJECT_H
38
39// **** _SYSTEM INCLUDES_ ******************************************************
40
41#include <iostream>
42#include <string>
43#include <fstream>
44
45// use standard library objects
46 using namespace std;
47
48// **** _LOCAL INCLUDES_ *******************************************************
49
50#include "GeoTessUtils.h"
51#include "GeoTessData.h"
52#include "GeoTessProfile.h"
53#include "GeoTessProfileType.h"
54#include "IFStreamAscii.h"
55#include "IFStreamBinary.h"
56#include "GeoTessDataValue.h"
57
58// **** _BEGIN GEOTESS NAMESPACE_ **********************************************
59
60 namespace geotess {
61
62// **** _FORWARD REFERENCES_ ***************************************************
63
64 class GeoTessMetaData;
65
66// **** _CLASS DEFINITION_ *****************************************************
67
77 class GEOTESS_EXP_IMP GeoTessProfileSurfaceEmpty: virtual public GeoTessProfile {
78 public:
79
80 GeoTessProfileSurfaceEmpty() : GeoTessProfile() { }
81
85 static string class_name() { return "ProfileSurfaceEmpty"; }
86
90 virtual int class_size() const { return (int) sizeof(GeoTessProfileSurfaceEmpty); }
91
92 virtual LONG_INT getMemory() { return (LONG_INT)sizeof(GeoTessProfileSurfaceEmpty); }
93
99 virtual const GeoTessProfileType& getType() const { return GeoTessProfileType::SURFACE_EMPTY; }
100
104 virtual bool operator ==(const GeoTessProfile& p) const { return p.getType() == GeoTessProfileType::SURFACE_EMPTY; }
105
114 virtual double getValue(int attributeIndex, int nodeIndex) const { return NaN_DOUBLE; }
115
122 virtual double getValueTop(int attributeIndex) const { return NaN_DOUBLE; }
123
134 virtual bool isNaN(int nodeIndex, int attributeIndex) { return true; }
135
140 virtual double getValue(const GeoTessInterpolatorType& rInterpType,
141 int attributeIndex, double radius,
142 bool allowRadiusOutOfRange) const
143 { return NaN_DOUBLE; }
144
148 virtual void setData(const vector<GeoTessData*>& inData) { }
149
153 virtual void setData(int index, GeoTessData* inData) { }
154
159 virtual GeoTessData** getData()
160 {
161 ostringstream os;
162 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
163 << "Unsupported method call." << endl;
164 throw GeoTessException(os, __FILE__, __LINE__, 4201);
165 return (GeoTessData**) NULL;
166 }
167
171 virtual GeoTessData* getData(int i)
172 {
173 ostringstream os;
174 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
175 << "Unsupported method call." << endl;
176 throw GeoTessException(os, __FILE__, __LINE__, 4201);
177 return (GeoTessData*) NULL;
178 }
179
183 virtual const GeoTessData& getData(int i) const
184 {
185 ostringstream os;
186 os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
187 << "Unsupported method call." << endl;
188 throw GeoTessException(os, __FILE__, __LINE__, 4201);
189 return *(new GeoTessDataValue<int>());
190 }
191
194 virtual GeoTessData* getDataTop()
195 {
196 ostringstream os;
197 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
198 << "Unsupported method call." << endl;
199 throw GeoTessException(os, __FILE__, __LINE__, 4201);
200 return (GeoTessData*) NULL;
201 }
202
206 virtual const GeoTessData& getDataTop() const
207 {
208 ostringstream os;
209 os << endl << "ERROR in ProfileSurfaceEmpty::getDataTop" << endl
210 << "Unsupported method call." << endl;
211 throw GeoTessException(os, __FILE__, __LINE__, 4201);
212 return *(new GeoTessDataValue<int>());
213 }
214
218 virtual GeoTessData* getDataBottom()
219 {
220 ostringstream os;
221 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
222 << "Unsupported method call." << endl;
223 throw GeoTessException(os, __FILE__, __LINE__, 4201);
224 return (GeoTessData*) NULL;
225 }
226
230 virtual const GeoTessData& getDataBottom() const
231 {
232 ostringstream os;
233 os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
234 << "Unsupported method call." << endl;
235 throw GeoTessException(os, __FILE__, __LINE__, 4201);
236 return *(new GeoTessDataValue<int>());
237 }
238
243 virtual float getRadius(int i) const { return NaN_FLOAT; }
244
248 virtual void setRadii(const vector<float>& newRadii) { }
249
250 virtual void setRadius(int index, float radius)
251 { /* do nothing */ }
252
256 virtual float getRadiusTop() const { return NaN_FLOAT; }
257
261 virtual float getRadiusBottom() const { return NaN_FLOAT; }
262
266 virtual int getNRadii() const { return 0; }
267
271 virtual int getNData() const { return 0; }
272
276 virtual float* getRadii() { return (float*) NULL; }
277
279
283 GeoTessProfileSurfaceEmpty(IFStreamBinary& ifs, GeoTessMetaData& gtmd) : GeoTessProfile() { }
284
288 GeoTessProfileSurfaceEmpty(IFStreamAscii& ifs, GeoTessMetaData& gtmd) : GeoTessProfile() { }
289
294 virtual ~GeoTessProfileSurfaceEmpty() { }
295
299 virtual void write(IFStreamBinary& ofs)
300 { ofs.writeByte((byte) GeoTessProfileType::SURFACE_EMPTY.ordinal()); }
301
305 virtual void write(IFStreamAscii& ofs)
306 { ofs.writeInt(GeoTessProfileType::SURFACE_EMPTY.ordinal()); ofs.writeNL();}
307
316 virtual int findClosestRadiusIndex(double radius) const { return -1; }
317
325 virtual void setPointIndex(int nodeIndex, int pntIndex) { }
326
334 virtual void resetPointIndices() { }
335
343 virtual int getPointIndex(int nodeIndex) const { return -1; }
344
348 virtual GeoTessProfile* copy() { return new GeoTessProfileSurfaceEmpty(); }
349
351
352};
353// end class ProfileSurfaceEmpty
354
355}// end namespace geotess
356
357#endif // PROFILESURFACE_EMPTY_OBJECT_H
GEOTESS_EXP_IMP
#define GEOTESS_EXP_IMP
Definition CPPGlobals.h:71
LONG_INT
#define LONG_INT
Definition CPPGlobals.h:111
GeoTessData.h
GeoTessDataValue.h
GeoTessProfile.h
GeoTessProfileType.h
GeoTessUtils.h
IFStreamAscii.h
IFStreamBinary.h
geotess::GeoTessData
Abstract base class that manages the data values attached to a single grid point.
Definition GeoTessData.h:76
geotess::GeoTessDataValue
Manages a single data value attached to a grid node.
Definition GeoTessDataValue.h:75
geotess::GeoTessException
An exception class for all GeoTess objects.
Definition GeoTessException.h:66
geotess::GeoTessInterpolatorType
Enumeration of the interpolation algorithms supported by GeoTess including LINEAR,...
Definition GeoTessInterpolatorType.h:72
geotess::GeoTessMetaData
Basic metadata information about a GeoTessModel.
Definition GeoTessMetaData.h:97
geotess::GeoTessProfile
Abstract class that manages the radii and data values that span a single layer associated with a sing...
Definition GeoTessProfile.h:97
geotess::GeoTessProfile::getType
virtual const GeoTessProfileType & getType() const
geotess::GeoTessProfileSurfaceEmpty
A Profile object that defines a single Data object and no radius value.
Definition GeoTessProfileSurfaceEmpty.h:77
geotess::GeoTessProfileSurfaceEmpty::setData
virtual void setData(const vector< GeoTessData * > &inData)
Definition GeoTessProfileSurfaceEmpty.h:148
geotess::GeoTessProfileSurfaceEmpty::getRadius
virtual float getRadius(int i) const
Definition GeoTessProfileSurfaceEmpty.h:243
geotess::GeoTessProfileSurfaceEmpty::GeoTessProfileSurfaceEmpty
GeoTessProfileSurfaceEmpty()
Definition GeoTessProfileSurfaceEmpty.h:80
geotess::GeoTessProfileSurfaceEmpty::getData
virtual GeoTessData ** getData()
Definition GeoTessProfileSurfaceEmpty.h:159
geotess::GeoTessProfileSurfaceEmpty::getData
virtual const GeoTessData & getData(int i) const
Definition GeoTessProfileSurfaceEmpty.h:183
geotess::GeoTessProfileSurfaceEmpty::getRadiusTop
virtual float getRadiusTop() const
Definition GeoTessProfileSurfaceEmpty.h:256
geotess::GeoTessProfileSurfaceEmpty::getType
virtual const GeoTessProfileType & getType() const
Definition GeoTessProfileSurfaceEmpty.h:99
geotess::GeoTessProfileSurfaceEmpty::getDataBottom
virtual const GeoTessData & getDataBottom() const
Definition GeoTessProfileSurfaceEmpty.h:230
geotess::GeoTessProfileSurfaceEmpty::getNData
virtual int getNData() const
Definition GeoTessProfileSurfaceEmpty.h:271
geotess::GeoTessProfileSurfaceEmpty::setData
virtual void setData(int index, GeoTessData *inData)
Definition GeoTessProfileSurfaceEmpty.h:153
geotess::GeoTessProfileSurfaceEmpty::class_size
virtual int class_size() const
Definition GeoTessProfileSurfaceEmpty.h:90
geotess::GeoTessProfileSurfaceEmpty::getData
virtual GeoTessData * getData(int i)
Definition GeoTessProfileSurfaceEmpty.h:171
geotess::GeoTessProfileSurfaceEmpty::isNaN
virtual bool isNaN(int nodeIndex, int attributeIndex)
Definition GeoTessProfileSurfaceEmpty.h:134
geotess::GeoTessProfileSurfaceEmpty::getValueTop
virtual double getValueTop(int attributeIndex) const
Definition GeoTessProfileSurfaceEmpty.h:122
geotess::GeoTessProfileSurfaceEmpty::class_name
static string class_name()
Definition GeoTessProfileSurfaceEmpty.h:85
geotess::GeoTessProfileSurfaceEmpty::getValue
virtual double getValue(int attributeIndex, int nodeIndex) const
Definition GeoTessProfileSurfaceEmpty.h:114
geotess::GeoTessProfileSurfaceEmpty::getValue
virtual double getValue(const GeoTessInterpolatorType &rInterpType, int attributeIndex, double radius, bool allowRadiusOutOfRange) const
Definition GeoTessProfileSurfaceEmpty.h:140
geotess::GeoTessProfileSurfaceEmpty::getDataBottom
virtual GeoTessData * getDataBottom()
Definition GeoTessProfileSurfaceEmpty.h:218
geotess::GeoTessProfileSurfaceEmpty::getRadiusBottom
virtual float getRadiusBottom() const
Definition GeoTessProfileSurfaceEmpty.h:261
geotess::GeoTessProfileSurfaceEmpty::getDataTop
virtual GeoTessData * getDataTop()
Definition GeoTessProfileSurfaceEmpty.h:194
geotess::GeoTessProfileSurfaceEmpty::getDataTop
virtual const GeoTessData & getDataTop() const
Definition GeoTessProfileSurfaceEmpty.h:206
geotess::GeoTessProfileSurfaceEmpty::getRadii
virtual float * getRadii()
Definition GeoTessProfileSurfaceEmpty.h:276
geotess::GeoTessProfileSurfaceEmpty::setRadii
virtual void setRadii(const vector< float > &newRadii)
Definition GeoTessProfileSurfaceEmpty.h:248
geotess::GeoTessProfileSurfaceEmpty::getMemory
virtual LONG_INT getMemory()
Definition GeoTessProfileSurfaceEmpty.h:92
geotess::GeoTessProfileSurfaceEmpty::getNRadii
virtual int getNRadii() const
Definition GeoTessProfileSurfaceEmpty.h:266
geotess::GeoTessProfileSurfaceEmpty::setRadius
virtual void setRadius(int index, float radius)
Definition GeoTessProfileSurfaceEmpty.h:250
geotess::GeoTessProfileType
Enumeration of the valid Profile types, including EMPTY, THIN, CONSTANT, NPOINT and SURFACE.
Definition GeoTessProfileType.h:70
geotess::GeoTessProfileType::SURFACE_EMPTY
static const GeoTessProfileType SURFACE_EMPTY
Definition GeoTessProfileType.h:120
geotess::IFStreamBinary
Opens a file for binary read and write access.
Definition IFStreamBinary.h:80
geotess
Definition ArrayReuse.h:55