Isis 3 Programmer Reference
NaifDskApi.cpp
Go to the documentation of this file.
1 
24 #include "NaifDskApi.h"
25 
26 // Specs for convenient NAIF vectors and matrices
27 #include <tnt/tnt_array1d.h>
28 #include <tnt/tnt_array1d_utils.h>
29 #include <tnt/tnt_array2d.h>
30 #include <tnt/tnt_array2d_utils.h>
31 
32 #include "IString.h"
33 
34 namespace Isis {
45  bool validate(const NaifVertex &v) {
46  if ( 3 != v.dim1() ) return (false);
47  return (true);
48  }
49 
50 
51 
59  bool validate(const NaifTriangle &t) {
60  if ( 3 != t.dim1() ) return (false);
61  if ( 3 != t.dim2() ) return (false);
62  return (true);
63  }
64 
65 
66 
74  QDebug operator<<(QDebug dbg, const TNT::Array1D<SpiceDouble> &tntArray) {
75  dbg.nospace() << toString(tntArray);
76  return dbg;
77  }
78 
79 
80 
89  QDebug operator<<(QDebug dbg, const TNT::Array2D<SpiceDouble> &tntMatrix) {
90  for (int i = 0; i < tntMatrix.dim1(); i++) {
91  dbg.nospace() << " ";
92  for (int j = 0; j < tntMatrix.dim2(); j++) {
93  dbg.nospace() << toString(tntMatrix[i][j], 15) << " ";
94  }
95  dbg.nospace() << endl;
96  }
97  return dbg;
98  }
99 
100 
101 
112  QString toString(const TNT::Array1D<SpiceDouble> &naifArray, int precision) {
113  QString result = "( ";
114  for (int i = 0; i < naifArray.dim1(); i++) {
115  result += toString(naifArray[i], precision);
116  if (i != naifArray.dim1() - 1) result += ", ";
117  }
118  result += " )";
119  return result;
120  }
121 
122 
123 }
124 // namespace Isis
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
TNT::Array1D< SpiceDouble > NaifVertex
1-D Buffer[3]
Definition: NaifDskApi.h:62
bool validate(const NaifVertex &v)
Verifies that the given NaifVector or NaifVertex is 3 dimensional.
Definition: NaifDskApi.cpp:45
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
TNT::Array2D< SpiceDouble > NaifTriangle
3-D triangle[3][3]
Definition: NaifDskApi.h:63