GeoTessCPP  2.6.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 
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  }
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 
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 
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
#define GEOTESS_EXP_IMP
Definition: CPPGlobals.h:71
#define LONG_INT
Definition: CPPGlobals.h:111
Abstract base class that manages the data values attached to a single grid point.
Definition: GeoTessData.h:76
Manages a single data value attached to a grid node.
An exception class for all GeoTess objects.
Enumeration of the interpolation algorithms supported by GeoTess including LINEAR,...
Basic metadata information about a GeoTessModel.
Abstract class that manages the radii and data values that span a single layer associated with a sing...
virtual const GeoTessProfileType & getType() const
A Profile object that defines a single Data object and no radius value.
virtual void setData(const vector< GeoTessData * > &inData)
virtual void setData(int index, GeoTessData *inData)
virtual bool isNaN(int nodeIndex, int attributeIndex)
virtual double getValueTop(int attributeIndex) const
virtual const GeoTessProfileType & getType() const
virtual double getValue(int attributeIndex, int nodeIndex) const
virtual double getValue(const GeoTessInterpolatorType &rInterpType, int attributeIndex, double radius, bool allowRadiusOutOfRange) const
virtual const GeoTessData & getDataTop() const
virtual void setRadii(const vector< float > &newRadii)
virtual const GeoTessData & getDataBottom() const
virtual const GeoTessData & getData(int i) const
virtual void setRadius(int index, float radius)
Enumeration of the valid Profile types, including EMPTY, THIN, CONSTANT, NPOINT and SURFACE.
Opens a file for binary read and write access.