GeoTessCPP  2.0.0
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  }
192  virtual GeoTessData* getDataTop()
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 
216  virtual GeoTessData* getDataBottom()
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 
251  virtual float getRadiusTop() const { return NaN_FLOAT; }
252 
256  virtual float getRadiusBottom() const { return NaN_FLOAT; }
257 
261  virtual int getNRadii() const { return 0; }
262 
266  virtual int getNData() const { return 0; }
267 
271  virtual float* getRadii() { return (float*) NULL; }
272 
274 
279 
283  GeoTessProfileSurfaceEmpty(IFStreamAscii& ifs, GeoTessMetaData& gtmd) : GeoTessProfile() { }
284 
289  virtual ~GeoTessProfileSurfaceEmpty() { }
290 
294  virtual void write(IFStreamBinary& ofs)
295  { ofs.writeByte((byte) GeoTessProfileType::SURFACE_EMPTY.ordinal()); }
296 
300  virtual void write(IFStreamAscii& ofs)
301  { ofs.writeInt(GeoTessProfileType::SURFACE_EMPTY.ordinal()); ofs.writeNL();}
302 
311  virtual int findClosestRadiusIndex(double radius) const { return -1; }
312 
320  virtual void setPointIndex(int nodeIndex, int pntIndex) { }
321 
329  virtual void resetPointIndices() { }
330 
338  virtual int getPointIndex(int nodeIndex) const { return -1; }
339 
343  virtual GeoTessProfile* copy() { return new GeoTessProfileSurfaceEmpty(); }
344 
346 
347 };
348 // end class ProfileSurfaceEmpty
349 
350 }// end namespace geotess
351 
352 #endif // PROFILESURFACE_EMPTY_OBJECT_H