OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
ossimMatrix3x3 Class Reference

#include <ossimMatrix3x3.h>

Public Member Functions

ossimColumnVector3d getEigenValues (const NEWMAT::Matrix &rhs)
 

Static Public Member Functions

static NEWMAT::Matrix create ()
 
static NEWMAT::Matrix create (const NEWMAT::Matrix &m)
 
static NEWMAT::Matrix create (double v00, double v01, double v02, double v10, double v11, double v12, double v20, double v21, double v22)
 
static NEWMAT::Matrix createIdentity ()
 
static NEWMAT::Matrix createZero ()
 
static NEWMAT::Matrix createRotationMatrix (double angleX, double angleY, double angleZ, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
 
static NEWMAT::Matrix createRotationXMatrix (double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
 
static NEWMAT::Matrix createRotationYMatrix (double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
 
static NEWMAT::Matrix createRotationZMatrix (double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
 
static NEWMAT::Matrix createScaleMatrix (double X, double Y, double Z)
 
static NEWMAT::Matrix createTranslationMatrix (double dx, double dy)
 

Protected Member Functions

 ossimMatrix3x3 ()
 

Private Member Functions

 ossimMatrix3x3 (const ossimMatrix3x3 &rhs)
 
const ossimMatrix3x3operator= (const ossimMatrix3x3 &rhs)
 

Detailed Description

Definition at line 25 of file ossimMatrix3x3.h.

Constructor & Destructor Documentation

◆ ossimMatrix3x3() [1/2]

ossimMatrix3x3::ossimMatrix3x3 ( )
inlineprotected

Definition at line 74 of file ossimMatrix3x3.h.

74 {} // To squash un-warranted compiler warnings...

◆ ossimMatrix3x3() [2/2]

ossimMatrix3x3::ossimMatrix3x3 ( const ossimMatrix3x3 rhs)
private

Definition at line 277 of file ossimMatrix3x3.cpp.

278 {
279 }

Member Function Documentation

◆ create() [1/3]

NEWMAT::Matrix ossimMatrix3x3::create ( )
static

Returns a blank 3x3 matrix.

Definition at line 17 of file ossimMatrix3x3.cpp.

Referenced by ossimAlphaSensor::formHPRmat(), ossimLsrSpace::ossimLsrSpace(), ossimIpodSensor::updateModel(), ossimSkyBoxLearSensor::updateModel(), ossimSonomaSensor::updateModel(), and ossimLandSatModel::updateModel().

18 {
19  NEWMAT::Matrix m(3, 3);
20 
21  m[0][0] = 1.0;
22  m[0][1] = 0.0;
23  m[0][2] = 0.0;
24 
25  m[1][0] = 0.0;
26  m[1][1] = 1.0;
27  m[1][2] = 0.0;
28 
29  m[2][0] = 0.0;
30  m[2][1] = 0.0;
31  m[2][2] = 1.0;
32 
33  return m;
34 }

◆ create() [2/3]

NEWMAT::Matrix ossimMatrix3x3::create ( const NEWMAT::Matrix &  m)
static

Returns a copy of "m". Note: If "m" is not a 3x3 that's an error and a blank matrix is returned.

Definition at line 57 of file ossimMatrix3x3.cpp.

References ossimNotify(), and ossimNotifyLevel_FATAL.

58 {
59  NEWMAT::Matrix m(3, 3);
60 
61  if (rhs.Ncols() != 3 || rhs.Nrows() != 3)
62  {
63  ossimNotify(ossimNotifyLevel_FATAL) << "ossimMatrix3x3::create(const NEWMAT::Matrix& rhs) ERROR:"
64  << "\nMatrix passed to function not a 3x3!"
65  << "\nnumber of columns: " << rhs.Ncols()
66  << "\nnumber of rows: " << rhs.Nrows()
67  << "\nReturn blank 3x3 matrix...\n";
68  return m;
69  }
70 
71  m[0][0] = rhs[0][0];
72  m[0][1] = rhs[0][1];
73  m[0][2] = rhs[0][2];
74  m[0][3] = rhs[0][3];
75  m[1][0] = rhs[1][0];
76  m[1][1] = rhs[1][1];
77  m[1][2] = rhs[1][2];
78  m[1][3] = rhs[1][3];
79  m[2][0] = rhs[2][0];
80  m[2][1] = rhs[2][1];
81  m[2][2] = rhs[2][2];
82  m[2][3] = rhs[2][3];
83 
84  return m;
85 }
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ create() [3/3]

NEWMAT::Matrix ossimMatrix3x3::create ( double  v00,
double  v01,
double  v02,
double  v10,
double  v11,
double  v12,
double  v20,
double  v21,
double  v22 
)
static

Create a 3x3 with assigned values.

Definition at line 36 of file ossimMatrix3x3.cpp.

39 {
40  NEWMAT::Matrix m(3, 3);
41 
42  m[0][0] = v00;
43  m[0][1] = v01;
44  m[0][2] = v02;
45 
46  m[1][0] = v10;
47  m[1][1] = v11;
48  m[1][2] = v12;
49 
50  m[2][0] = v20;
51  m[2][1] = v21;
52  m[2][2] = v22;
53 
54  return m;
55 }

◆ createIdentity()

NEWMAT::Matrix ossimMatrix3x3::createIdentity ( )
static

Definition at line 110 of file ossimMatrix3x3.cpp.

Referenced by createScaleMatrix(), and ossimSonomaSensor::loadState().

111 {
112  NEWMAT::Matrix m(3,3);
113 
114  m[0][0] = 1.0;
115  m[0][1] = 0.0;
116  m[0][2] = 0.0;
117 
118  m[1][0] = 0.0;
119  m[1][1] = 1.0;
120  m[1][2] = 0.0;
121 
122  m[2][0] = 0.0;
123  m[2][1] = 0.0;
124  m[2][2] = 1.0;
125 
126  return m;
127 }

◆ createRotationMatrix()

NEWMAT::Matrix ossimMatrix3x3::createRotationMatrix ( double  angleX,
double  angleY,
double  angleZ,
ossimCoordSysOrientMode  orientationMode = OSSIM_RIGHT_HANDED 
)
static

Definition at line 157 of file ossimMatrix3x3.cpp.

References createRotationXMatrix(), createRotationYMatrix(), and createRotationZMatrix().

Referenced by ossimTopographicCorrectionFilter::computeLightDirection(), and ossimBumpShadeTileSource::computeLightDirection().

161 {
162  return (createRotationZMatrix(angleZ, orientationMode)*
163  createRotationYMatrix(angleY, orientationMode)*
164  createRotationXMatrix(angleX, orientationMode));
165 }
static NEWMAT::Matrix createRotationXMatrix(double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
static NEWMAT::Matrix createRotationYMatrix(double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)
static NEWMAT::Matrix createRotationZMatrix(double angle, ossimCoordSysOrientMode orientationMode=OSSIM_RIGHT_HANDED)

◆ createRotationXMatrix()

NEWMAT::Matrix ossimMatrix3x3::createRotationXMatrix ( double  angle,
ossimCoordSysOrientMode  orientationMode = OSSIM_RIGHT_HANDED 
)
static

Definition at line 167 of file ossimMatrix3x3.cpp.

References OSSIM_RIGHT_HANDED, and RAD_PER_DEG.

Referenced by createRotationMatrix(), and ossimApplanixUtmModel::updateModel().

169 {
170  NEWMAT::Matrix m(3,3);
171  double Cosine = cos(angle*RAD_PER_DEG);
172  double Sine = sin(angle*RAD_PER_DEG);
173 
174  if(orientationMode == OSSIM_RIGHT_HANDED)
175  {
176  m << 1 << 0 << 0
177  << 0 << Cosine << Sine
178  << 0 << -Sine << Cosine;
179  }
180  else
181  {
182  m << 1 << 0 << 0
183  << 0 << Cosine << -Sine
184  << 0 << Sine << Cosine;
185  }
186  return m;
187 }
#define RAD_PER_DEG

◆ createRotationYMatrix()

NEWMAT::Matrix ossimMatrix3x3::createRotationYMatrix ( double  angle,
ossimCoordSysOrientMode  orientationMode = OSSIM_RIGHT_HANDED 
)
static

Definition at line 189 of file ossimMatrix3x3.cpp.

References OSSIM_RIGHT_HANDED, and RAD_PER_DEG.

Referenced by createRotationMatrix(), and ossimApplanixUtmModel::updateModel().

191 {
192  NEWMAT::Matrix m(3,3);
193  double Cosine = cos(angle*RAD_PER_DEG);
194  double Sine = sin(angle*RAD_PER_DEG);
195 
196  if(orientationMode == OSSIM_RIGHT_HANDED)
197  {
198  m[0][0] = Cosine;
199  m[0][1] = 0.0;
200  m[0][2] = -Sine;
201 
202  m[1][0] = 0.0;
203  m[1][1] = 1.0;
204  m[1][2] = 0.0;
205 
206  m[2][0] = Sine;
207  m[2][1] = 0.0;
208  m[2][2] = Cosine;
209  }
210  else
211  {
212  m[0][0] = Cosine;
213  m[0][1] = 0.0;
214  m[0][2] = Sine;
215 
216  m[1][0] = 0.0;
217  m[1][1] = 1.0;
218  m[1][2] = 0.0;
219 
220  m[2][0] = -Sine;
221  m[2][1] = 0.0;
222  m[2][2] = Cosine;
223  }
224  return m;
225 }
#define RAD_PER_DEG

◆ createRotationZMatrix()

NEWMAT::Matrix ossimMatrix3x3::createRotationZMatrix ( double  angle,
ossimCoordSysOrientMode  orientationMode = OSSIM_RIGHT_HANDED 
)
static

Definition at line 228 of file ossimMatrix3x3.cpp.

References OSSIM_RIGHT_HANDED, and RAD_PER_DEG.

Referenced by ossimImageViewAffineTransform::buildCompositeTransform(), ossimAffineTransform::computeMatrix(), createRotationMatrix(), and ossimApplanixUtmModel::updateModel().

230 {
231  NEWMAT::Matrix m(3,3);
232  double Cosine = cos(angle*RAD_PER_DEG);
233  double Sine = sin(angle*RAD_PER_DEG);
234 
235  if(orientationMode == OSSIM_RIGHT_HANDED)
236  {
237  m[0][0] = Cosine;
238  m[0][1] = Sine;
239  m[0][2] = 0.0;
240 
241  m[1][0] = -Sine;
242  m[1][1] = Cosine;
243  m[1][2] = 0.0;
244 
245  m[2][0] = 0.0;
246  m[2][1] = 0.0;
247  m[2][2] = 1.0;
248  }
249  else
250  {
251  m[0][0] = Cosine;
252  m[0][1] = -Sine;
253  m[0][2] = 0.0;
254 
255  m[1][0] = Sine;
256  m[1][1] = Cosine;
257  m[1][2] = 0.0;
258 
259  m[2][0] = 0.0;
260  m[2][1] = 0.0;
261  m[2][2] = 1.0;
262  }
263  return m;
264 }
#define RAD_PER_DEG

◆ createScaleMatrix()

NEWMAT::Matrix ossimMatrix3x3::createScaleMatrix ( double  X,
double  Y,
double  Z 
)
static

Definition at line 266 of file ossimMatrix3x3.cpp.

References createIdentity(), x, and y.

Referenced by ossimAffineTransform::computeMatrix().

267 {
268  NEWMAT::Matrix m = createIdentity();
269 
270  m[0][0] = x;
271  m[1][1] = y;
272  m[2][2] = z;
273 
274  return m;
275 }
ossim_uint32 x
ossim_uint32 y
static NEWMAT::Matrix createIdentity()

◆ createTranslationMatrix()

NEWMAT::Matrix ossimMatrix3x3::createTranslationMatrix ( double  dx,
double  dy 
)
static

Definition at line 138 of file ossimMatrix3x3.cpp.

Referenced by ossimAffineTransform::computeMatrix().

139 {
140  NEWMAT::Matrix m(3,3);
141 
142  m[0][0] = 1.0;
143  m[0][1] = 0.0;
144  m[0][2] = dx;
145 
146  m[1][0] = 0.0;
147  m[1][1] = 1.0;
148  m[1][2] = dy;
149 
150  m[2][0] = 0.0;
151  m[2][1] = 0.0;
152  m[2][2] = 1.0;
153 
154  return m;
155 }

◆ createZero()

NEWMAT::Matrix ossimMatrix3x3::createZero ( )
static

Definition at line 129 of file ossimMatrix3x3.cpp.

130 {
131  NEWMAT::Matrix m(3,3);
132 
133  m = 0.0;
134 
135  return m;
136 }

◆ getEigenValues()

ossimColumnVector3d ossimMatrix3x3::getEigenValues ( const NEWMAT::Matrix &  rhs)

Uses the matrix package to compute the eigenvalues for this matrix

Definition at line 87 of file ossimMatrix3x3.cpp.

References EigenValues(), ossimNotify(), and ossimNotifyLevel_FATAL.

88 {
89  if (matrix.Ncols() != 3 || matrix.Nrows() != 3)
90  {
91  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL: ossimColumnVector3d operator*(const NEWMAT::Matrix& lhs,"
92  << "\nconst ossimColumnVector3d& rhs), "
93  << "\nMatrix passed to function not a 3x3!"
94  << "\nnumber of columns: " << matrix.Ncols()
95  << "\nnumber of rows: " << matrix.Nrows()
96  << "\nReturn blank ossimColumnVector3d...\n";
97  return ossimColumnVector3d();
98  }
99 
100  NEWMAT::DiagonalMatrix d;
101  NEWMAT::SymmetricMatrix s;
102 
103  s << matrix;
104 
105  NEWMAT::EigenValues(s, d);
106 
107  return ossimColumnVector3d(d[0], d[1], d[2]);
108 }
void EigenValues(const SymmetricMatrix &, DiagonalMatrix &)
Definition: evalue.cpp:286
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ operator=()

const ossimMatrix3x3 & ossimMatrix3x3::operator= ( const ossimMatrix3x3 rhs)
private

Definition at line 281 of file ossimMatrix3x3.cpp.

281 { return rhs; }

The documentation for this class was generated from the following files: