USGS

Isis 3.0 Object Programmers' Reference

Home

NaifDskApi.cpp
Go to the documentation of this file.
1 
24 #include "NaifDskApi.h"
25 
26 #include <SpiceUsr.h>
27 #include <SpiceZfc.h>
28 
29 extern "C" {
30  #include <SpiceDLA.h>
31  #include <SpiceDSK.h>
32  #include <pl02.h>
33 }
34 
35 // Specs for convenient NAIF vectors and matrices
36 #include <tnt/tnt_array1d.h>
37 #include <tnt/tnt_array1d_utils.h>
38 #include <tnt/tnt_array2d.h>
39 #include <tnt/tnt_array2d_utils.h>
40 
41 #include "IString.h"
42 
43 namespace Isis {
54  bool validate(const NaifVertex &v) {
55  if ( 3 != v.dim1() ) return (false);
56  return (true);
57  }
58 
59 
60 
68  bool validate(const NaifTriangle &t) {
69  if ( 3 != t.dim1() ) return (false);
70  if ( 3 != t.dim2() ) return (false);
71  return (true);
72  }
73 
74 
75 
83  QDebug operator<<(QDebug dbg, const TNT::Array1D<SpiceDouble> &tntArray) {
84  dbg.nospace() << toString(tntArray);
85  return dbg;
86  }
87 
88 
89 
98  QDebug operator<<(QDebug dbg, const TNT::Array2D<SpiceDouble> &tntMatrix) {
99  for (int i = 0; i < tntMatrix.dim1(); i++) {
100  dbg.nospace() << " ";
101  for (int j = 0; j < tntMatrix.dim2(); j++) {
102  dbg.nospace() << toString(tntMatrix[i][j], 15) << " ";
103  }
104  dbg.nospace() << endl;
105  }
106  return dbg;
107  }
108 
109 
110 
121  QString toString(const TNT::Array1D<SpiceDouble> &naifArray, int precision) {
122  QString result = "( ";
123  for (int i = 0; i < naifArray.dim1(); i++) {
124  result += toString(naifArray[i], precision);
125  if (i != naifArray.dim1() - 1) result += ", ";
126  }
127  result += " )";
128  return result;
129  }
130 
131 
132 }
133 // namespace Isis