GeoTessCPP  2.1
Software to facilitate storage and retrieval of 3D information about the Earth.
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
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 
78 public:
79 
81 
85  static string class_name() { return "ProfileSurfaceEmpty"; }
86 
90  virtual int class_size() const { return (int) sizeof(GeoTessProfileSurfaceEmpty); }
91 
97  virtual const GeoTessProfileType& getType() const { return GeoTessProfileType::SURFACE_EMPTY; }
98 
102  virtual bool operator ==(const GeoTessProfile& p) const { return p.getType() == GeoTessProfileType::SURFACE_EMPTY; }
103 
112  virtual double getValue(int attributeIndex, int nodeIndex) const { return NaN_DOUBLE; }
113 
120  virtual double getValueTop(int attributeIndex) const { return NaN_DOUBLE; }
121 
132  virtual bool isNaN(int nodeIndex, int attributeIndex) { return true; }
133 
138  virtual double getValue(const GeoTessInterpolatorType& rInterpType,
139  int attributeIndex, double radius,
140  bool allowRadiusOutOfRange) const
141  { return NaN_DOUBLE; }
142 
146  virtual void setData(const vector<GeoTessData*>& inData) { }
147 
151  virtual void setData(int index, GeoTessData* inData) { }
152 
157  virtual GeoTessData** getData()
158  {
159  ostringstream os;
160  os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
161  << "Unsupported method call." << endl;
162  throw GeoTessException(os, __FILE__, __LINE__, 4201);
163  return (GeoTessData**) NULL;
164  }
165 
169  virtual GeoTessData* getData(int i)
170  {
171  ostringstream os;
172  os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
173  << "Unsupported method call." << endl;
174  throw GeoTessException(os, __FILE__, __LINE__, 4201);
175  return (GeoTessData*) NULL;
176  }
177 
181  virtual const GeoTessData& getData(int i) const
182  {
183  ostringstream os;
184  os << endl << "ERROR in ProfileSurfaceEmpty::getData" << endl
185  << "Unsupported method call." << endl;
186  throw GeoTessException(os, __FILE__, __LINE__, 4201);
187  return *(new GeoTessDataValue<int>());
188  }
193  {
194  ostringstream os;
195  os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
196  << "Unsupported method call." << endl;
197  throw GeoTessException(os, __FILE__, __LINE__, 4201);
198  return (GeoTessData*) NULL;
199  }
200 
204  virtual const GeoTessData& getDataTop() const
205  {
206  ostringstream os;
207  os << endl << "ERROR in ProfileSurfaceEmpty::getDataTop" << endl
208  << "Unsupported method call." << endl;
209  throw GeoTessException(os, __FILE__, __LINE__, 4201);
210  return *(new GeoTessDataValue<int>());
211  }
212 
217  {
218  ostringstream os;
219  os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
220  << "Unsupported method call." << endl;
221  throw GeoTessException(os, __FILE__, __LINE__, 4201);
222  return (GeoTessData*) NULL;
223  }
224 
228  virtual const GeoTessData& getDataBottom() const
229  {
230  ostringstream os;
231  os << endl << "ERROR in ProfileSurfaceEmpty::getDataBottom" << endl
232  << "Unsupported method call." << endl;
233  throw GeoTessException(os, __FILE__, __LINE__, 4201);
234  return *(new GeoTessDataValue<int>());
235  }
236 
241  virtual float getRadius(int i) const { return NaN_FLOAT; }
242 
246  virtual void setRadii(const vector<float>& newRadii) { }
247 
248  virtual void setRadius(int index, float radius)
249  { /* do nothing */ }
250 
254  virtual float getRadiusTop() const { return NaN_FLOAT; }
255 
259  virtual float getRadiusBottom() const { return NaN_FLOAT; }
260 
264  virtual int getNRadii() const { return 0; }
265 
269  virtual int getNData() const { return 0; }
270 
274  virtual float* getRadii() { return (float*) NULL; }
275 
277 
282 
286  GeoTessProfileSurfaceEmpty(IFStreamAscii& ifs, GeoTessMetaData& gtmd) : GeoTessProfile() { }
287 
292  virtual ~GeoTessProfileSurfaceEmpty() { }
293 
297  virtual void write(IFStreamBinary& ofs)
298  { ofs.writeByte((byte) GeoTessProfileType::SURFACE_EMPTY.ordinal()); }
299 
303  virtual void write(IFStreamAscii& ofs)
304  { ofs.writeInt(GeoTessProfileType::SURFACE_EMPTY.ordinal()); ofs.writeNL();}
305 
314  virtual int findClosestRadiusIndex(double radius) const { return -1; }
315 
323  virtual void setPointIndex(int nodeIndex, int pntIndex) { }
324 
332  virtual void resetPointIndices() { }
333 
341  virtual int getPointIndex(int nodeIndex) const { return -1; }
342 
346  virtual GeoTessProfile* copy() { return new GeoTessProfileSurfaceEmpty(); }
347 
349 
350 };
351 // end class ProfileSurfaceEmpty
352 
353 }// end namespace geotess
354 
355 #endif // PROFILESURFACE_EMPTY_OBJECT_H
static string class_name()
Definition: GeoTessProfileSurfaceEmpty.h:85
virtual float getRadiusBottom() const
Definition: GeoTessProfileSurfaceEmpty.h:259
A Profile object that defines a single Data object and no radius value.
Definition: GeoTessProfileSurfaceEmpty.h:77
virtual int getNData() const
Definition: GeoTessProfileSurfaceEmpty.h:269
virtual GeoTessData ** getData()
Definition: GeoTessProfileSurfaceEmpty.h:157
virtual void setData(int index, GeoTessData *inData)
Definition: GeoTessProfileSurfaceEmpty.h:151
virtual const GeoTessData & getDataBottom() const
Definition: GeoTessProfileSurfaceEmpty.h:228
virtual double getValue(int attributeIndex, int nodeIndex) const
Definition: GeoTessProfileSurfaceEmpty.h:112
virtual float getRadius(int i) const
Definition: GeoTessProfileSurfaceEmpty.h:241
Opens a file for binary read and write access.
Definition: IFStreamBinary.h:79
virtual float getRadiusTop() const
Definition: GeoTessProfileSurfaceEmpty.h:254
Enumeration of the interpolation algorithms supported by GeoTess including LINEAR, NATURAL_NEIGHBOR and CUBIC_SPLINE.
Definition: GeoTessInterpolatorType.h:71
virtual bool isNaN(int nodeIndex, int attributeIndex)
Definition: GeoTessProfileSurfaceEmpty.h:132
Enumeration of the valid Profile types, including EMPTY, THIN, CONSTANT, NPOINT and SURFACE...
Definition: GeoTessProfileType.h:69
virtual const GeoTessProfileType & getType() const
virtual void setRadius(int index, float radius)
Definition: GeoTessProfileSurfaceEmpty.h:248
virtual int getNRadii() const
Definition: GeoTessProfileSurfaceEmpty.h:264
Manages a single data value attached to a grid node.
Definition: GeoTessData.h:63
virtual GeoTessData * getDataBottom()
Definition: GeoTessProfileSurfaceEmpty.h:216
virtual const GeoTessProfileType & getType() const
Definition: GeoTessProfileSurfaceEmpty.h:97
virtual GeoTessData * getData(int i)
Definition: GeoTessProfileSurfaceEmpty.h:169
An exception class for all GeoTess objects.
Definition: GeoTessException.h:65
virtual const GeoTessData & getDataTop() const
Definition: GeoTessProfileSurfaceEmpty.h:204
#define byte
signed-byte typedef
Definition: CPPGlobals.h:94
virtual int class_size() const
Definition: GeoTessProfileSurfaceEmpty.h:90
virtual void setRadii(const vector< float > &newRadii)
Definition: GeoTessProfileSurfaceEmpty.h:246
virtual void setData(const vector< GeoTessData * > &inData)
Definition: GeoTessProfileSurfaceEmpty.h:146
Abstract class that manages the radii and data values that span a single layer associated with a sing...
Definition: GeoTessProfile.h:96
Abstract base class that manages the data values attached to a single grid point. ...
Definition: GeoTessData.h:75
virtual const GeoTessData & getData(int i) const
Definition: GeoTessProfileSurfaceEmpty.h:181
virtual double getValueTop(int attributeIndex) const
Definition: GeoTessProfileSurfaceEmpty.h:120
virtual float * getRadii()
Definition: GeoTessProfileSurfaceEmpty.h:274
Basic metadata information about a GeoTessModel.
Definition: GeoTessMetaData.h:96
GeoTessProfileSurfaceEmpty()
Definition: GeoTessProfileSurfaceEmpty.h:80
virtual GeoTessData * getDataTop()
Definition: GeoTessProfileSurfaceEmpty.h:192
#define GEOTESS_EXP_IMP
Definition: CPPGlobals.h:71
virtual double getValue(const GeoTessInterpolatorType &rInterpType, int attributeIndex, double radius, bool allowRadiusOutOfRange) const
Definition: GeoTessProfileSurfaceEmpty.h:138