cctw  0.2.1
Public Slots | Public Member Functions | Public Attributes | Private Attributes | List of all members
CctwCrystalCoordinateTransform Class Reference

#include <cctwcrystalcoordinatetransform.h>

Inheritance diagram for CctwCrystalCoordinateTransform:
Inheritance graph
Collaboration diagram for CctwCrystalCoordinateTransform:
Collaboration graph

Public Slots

virtual bool hasInverse () const
 
virtual CctwDoubleVector3D forward (CctwDoubleVector3D d)
 
virtual CctwDoubleVector3D inverse (CctwDoubleVector3D q)
 
void updateFromParameters ()
 
void setCurrentFrame (double frame)
 
double changeCount ()
 
void report ()
 
CctwDoubleMatrix3x3 createBMatrix (const CctwUnitCell &cell) const
 
CctwDoubleVector3D getDetPos (double x, double y)
 
CctwDoubleVector3D getDetPos (CctwDoubleVector3D xyz)
 
CctwDoubleVector3D pixel2qlab (double x, double y, double z)
 
CctwDoubleVector3D pixel2qlab (CctwDoubleVector3D pixel)
 
CctwDoubleVector3D qlab2hkl (double qx, double qy, double qz)
 
CctwDoubleVector3D qlab2hkl (CctwDoubleVector3D qlab)
 
CctwDoubleVector3D hkl2grid (double h, double k, double l)
 
CctwDoubleVector3D hkl2grid (CctwDoubleVector3D hkl)
 
CctwDoubleVector3D grid2hkl (double gx, double gy, double gz)
 
CctwDoubleVector3D grid2hkl (CctwDoubleVector3D grid)
 
CctwDoubleVector3D hkl2qlab (double h, double k, double l)
 
CctwDoubleVector3D hkl2qlab (CctwDoubleVector3D hkl)
 
CctwDoubleVector3D qlab2pixel (double qx, double qy, double qz)
 
CctwDoubleVector3D qlab2pixel (CctwDoubleVector3D qlab)
 
CctwDoubleVector3D getDetPix (double x, double y, double z)
 
CctwDoubleVector3D getDetPix (CctwDoubleVector3D xyz)
 
double twoThetaAngle ()
 
double omegaAngle ()
 
double chiAngle ()
 
double phiAngle ()
 
CctwDoubleMatrix3x3 bMat ()
 
CctwDoubleMatrix3x3 uMat ()
 
CctwDoubleMatrix3x3 gMat ()
 
CctwDoubleMatrix3x3 dMat ()
 
CctwDoubleMatrix3x3 oMat ()
 
CctwDoubleVector3D oVec ()
 
CctwDoubleMatrix3x3 ubMatInv ()
 
CctwDoubleMatrix3x3 gridBasisInv ()
 
CctwDoubleMatrix3x3 bMatInv ()
 
CctwDoubleMatrix3x3 uMatInv ()
 
CctwDoubleMatrix3x3 gMatInv ()
 
CctwDoubleMatrix3x3 dMatInv ()
 
CctwDoubleMatrix3x3 oMatInv ()
 
CctwDoubleVector3D cdVec ()
 
CctwDoubleVector3D ndVec ()
 
- Public Slots inherited from CctwTransformInterface
virtual bool hasInverse () const =0
 
virtual CctwDoubleVector3D forward (CctwDoubleVector3D d)=0
 
virtual CctwDoubleVector3D inverse (CctwDoubleVector3D q)=0
 
virtual CctwDoubleVector3D forward (double x, double y, double z)
 
virtual CctwDoubleVector3D inverse (double x, double y, double z)
 
- Public Slots inherited from CctwObject
virtual void printLine (QString line)
 
virtual void printMessage (QString msg, QDateTime dt=QDateTime::currentDateTime())
 
virtual QString settingsScript ()
 
QString scriptValueLiteral (QVariant v)
 

Public Member Functions

 CctwCrystalCoordinateTransform (CctwCrystalCoordinateParameters *parms, QString name, const double *angles, QObject *parent)
 
- Public Member Functions inherited from CctwTransformInterface
 CctwTransformInterface (QString name, QObject *parent)
 
- Public Member Functions inherited from CctwObject
 CctwObject (QString name, QObject *parent=0)
 
virtual void writeSettings (QSettings *set, QString section)
 
virtual void readSettings (QSettings *set, QString section)
 

Public Attributes

double m_TwoThetaAngle
 
double m_OmegaAngle
 
double m_ChiAngle
 
double m_PhiAngle
 
CctwDoubleMatrix3x3 m_BMat
 
CctwDoubleMatrix3x3 m_UMat
 
CctwDoubleMatrix3x3 m_GMat
 
CctwDoubleMatrix3x3 m_DMat
 
CctwDoubleMatrix3x3 m_OMat
 
CctwDoubleVector3D m_OVec
 

Private Attributes

CctwCrystalCoordinateParametersm_Parms
 
double m_CurrentFrame
 
int m_CurrentFrameChangeCount
 
const double * m_Angles
 
CctwDoubleMatrix3x3 m_UBMatInv
 
CctwDoubleMatrix3x3 m_GridBasisInv
 
CctwDoubleMatrix3x3 m_BMatInv
 
CctwDoubleMatrix3x3 m_UMatInv
 
CctwDoubleMatrix3x3 m_GMatInv
 
CctwDoubleMatrix3x3 m_DMatInv
 
CctwDoubleMatrix3x3 m_OMatInv
 
CctwDoubleVector3D m_CD
 
CctwDoubleVector3D m_ND
 

Additional Inherited Members

- Properties inherited from CctwObject
QString name
 

Detailed Description

Definition at line 8 of file cctwcrystalcoordinatetransform.h.

Constructor & Destructor Documentation

CctwCrystalCoordinateTransform::CctwCrystalCoordinateTransform ( CctwCrystalCoordinateParameters parms,
QString  name,
const double *  angles,
QObject *  parent 
)

Member Function Documentation

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::bMat ( )
inlineslot

Definition at line 53 of file cctwcrystalcoordinatetransform.h.

References m_BMat.

53 { return m_BMat; }
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::bMatInv ( )
inlineslot

Definition at line 62 of file cctwcrystalcoordinatetransform.h.

References m_BMatInv.

62 { return m_BMatInv; }
CctwDoubleVector3D CctwCrystalCoordinateTransform::cdVec ( )
inlineslot

Definition at line 68 of file cctwcrystalcoordinatetransform.h.

References m_CD.

68 { return m_CD; }
double CctwCrystalCoordinateTransform::changeCount ( )
slot
double CctwCrystalCoordinateTransform::chiAngle ( )
inlineslot

Definition at line 50 of file cctwcrystalcoordinatetransform.h.

References m_ChiAngle.

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::createBMatrix ( const CctwUnitCell cell) const
slot

Definition at line 106 of file cctwcrystalcoordinatetransform.cpp.

References CctwUnitCell::a(), CctwUnitCell::alpha(), CctwUnitCell::b(), CctwUnitCell::beta(), CctwUnitCell::c(), CctwUnitCell::gamma(), CctwMatrix3x3< T >::inverted(), and CctwMatrix3x3< T >::transposed().

Referenced by updateFromParameters().

107 {
108  double alat = cell.a();
109  double blat = cell.b();
110  double clat = cell.c();
111  double alpha = cell.alpha();
112  double beta = cell.beta();
113  double gamma = cell.gamma();
114 
116 
117  zzz(0,0) = alat;
118  zzz(1,0) = 0;
119  zzz(2,0) = 0;
120 
121  zzz(0,1) = blat*cos(gamma);
122  zzz(1,1) = blat*sin(gamma);
123  zzz(2,1) = 0;
124 
125  zzz(0,2) = clat*cos(beta);
126  zzz(1,2) = clat*(cos(alpha) - cos(beta)*cos(gamma))/sin(gamma);
127  zzz(2,2) = sqrt(clat*clat - zzz(0,2)*zzz(0,2) - zzz(1,2)*zzz(1,2));
128 
129  CctwDoubleMatrix3x3 tmat = zzz.inverted();
130 
131  return tmat.transposed();
132 }
double beta() const
double b() const
double a() const
double alpha() const
CctwMatrix3x3 transposed() const
double gamma() const
CctwMatrix3x3 inverted(bool *invertible=NULL) const
double c() const
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::dMat ( )
inlineslot

Definition at line 56 of file cctwcrystalcoordinatetransform.h.

References m_DMat.

56 { return m_DMat; }
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::dMatInv ( )
inlineslot

Definition at line 65 of file cctwcrystalcoordinatetransform.h.

References m_DMatInv.

65 { return m_DMatInv; }
CctwDoubleVector3D CctwCrystalCoordinateTransform::forward ( CctwDoubleVector3D  d)
virtualslot

Definition at line 139 of file cctwcrystalcoordinatetransform.cpp.

References getDetPos(), hkl2grid(), pixel2qlab(), qlab2hkl(), setCurrentFrame(), CctwVector3D< T >::x(), CctwVector3D< T >::y(), and CctwVector3D< T >::z().

Referenced by CctwApplication::calculateChunkDependencies().

140 {
141  setCurrentFrame(d.z());
142 
143  return hkl2grid(qlab2hkl(pixel2qlab(getDetPos(d.x(), d.y()))));
144 }
CctwDoubleVector3D hkl2grid(double h, double k, double l)
CctwDoubleVector3D getDetPos(double x, double y)
CctwDoubleVector3D pixel2qlab(double x, double y, double z)
T x() const
Definition: cctwvector3d.h:17
T z() const
Definition: cctwvector3d.h:19
T y() const
Definition: cctwvector3d.h:18
CctwDoubleVector3D qlab2hkl(double qx, double qy, double qz)
CctwDoubleVector3D CctwCrystalCoordinateTransform::getDetPix ( double  x,
double  y,
double  z 
)
slot

Definition at line 283 of file cctwcrystalcoordinatetransform.cpp.

Referenced by CctwqtTransformTester::testGetDetPix().

284 {
285  return getDetPix(CctwDoubleVector3D(x,y,z));
286 }
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D getDetPix(double x, double y, double z)
CctwDoubleVector3D CctwCrystalCoordinateTransform::getDetPix ( CctwDoubleVector3D  xyz)
slot

Definition at line 288 of file cctwcrystalcoordinatetransform.cpp.

References CctwCrystalCoordinateParameters::det0x, CctwCrystalCoordinateParameters::det0y, m_Parms, CctwCrystalCoordinateParameters::pixelSize, CctwVector3D< T >::x(), and CctwVector3D< T >::y().

289 {
290  CctwDoubleVector3D detpix;
291 
292  detpix.x() = (int)(xyz.x()/m_Parms->pixelSize() + m_Parms->det0x() - 0.5);
293  detpix.y() = (int)(xyz.y()/m_Parms->pixelSize() + m_Parms->det0y() - 0.5);
294 
295  if (m_Parms->get_ExtraFlip()) {
296  double x = detpix.x();
297  double y = detpix.y();
298 
299  detpix.x() = 2048-y;
300  detpix.y() = 2048-x;
301  }
302 
303  return detpix;
304 }
CctwCrystalCoordinateParameters * m_Parms
T x() const
Definition: cctwvector3d.h:17
T y() const
Definition: cctwvector3d.h:18
CctwDoubleVector3D CctwCrystalCoordinateTransform::getDetPos ( double  x,
double  y 
)
slot

Definition at line 156 of file cctwcrystalcoordinatetransform.cpp.

References CctwCrystalCoordinateParameters::det0x, CctwCrystalCoordinateParameters::det0y, m_Parms, and CctwCrystalCoordinateParameters::pixelSize.

Referenced by forward(), getDetPos(), and CctwqtTransformTester::testGetDetPos().

157 {
158  double pixelSize = m_Parms->pixelSize();
159 
160  if (m_Parms->get_ExtraFlip()) {
161  return CctwDoubleVector3D(((2048-y)+0.5 - m_Parms->det0x())*pixelSize,
162  ((2048-x)+0.5 - m_Parms->det0y())*pixelSize, 0.0);
163  } else {
164  return CctwDoubleVector3D((x+0.5 - m_Parms->det0x())*pixelSize,
165  (y+0.5 - m_Parms->det0y())*pixelSize, 0.0);
166  }
167 }
CctwCrystalCoordinateParameters * m_Parms
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D CctwCrystalCoordinateTransform::getDetPos ( CctwDoubleVector3D  xyz)
slot

Definition at line 151 of file cctwcrystalcoordinatetransform.cpp.

References getDetPos(), CctwVector3D< T >::x(), and CctwVector3D< T >::y().

152 {
153  return getDetPos(xyz.x(), xyz.y());
154 }
CctwDoubleVector3D getDetPos(double x, double y)
T x() const
Definition: cctwvector3d.h:17
T y() const
Definition: cctwvector3d.h:18
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::gMat ( )
inlineslot

Definition at line 55 of file cctwcrystalcoordinatetransform.h.

References m_GMat.

55 { return m_GMat; }
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::gMatInv ( )
inlineslot

Definition at line 64 of file cctwcrystalcoordinatetransform.h.

References m_GMatInv.

64 { return m_GMatInv; }
CctwDoubleVector3D CctwCrystalCoordinateTransform::grid2hkl ( double  gx,
double  gy,
double  gz 
)
slot

Definition at line 223 of file cctwcrystalcoordinatetransform.cpp.

Referenced by CctwqtTransformTester::testGrid2HKL().

224 {
225  return grid2hkl(CctwDoubleVector3D(gx,gy,gz));
226 }
CctwDoubleVector3D grid2hkl(double gx, double gy, double gz)
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D CctwCrystalCoordinateTransform::grid2hkl ( CctwDoubleVector3D  grid)
slot

Definition at line 228 of file cctwcrystalcoordinatetransform.cpp.

References CctwCrystalCoordinateParameters::gridBasis, CctwCrystalCoordinateParameters::gridDim, CctwCrystalCoordinateParameters::gridOffset, CctwCrystalCoordinateParameters::gridOrigin, and m_Parms.

229 {
230  CctwDoubleVector3D xyz = grid - m_Parms->gridOffset();
231 
232  for (int i=0; i<3; i++) {
233  xyz(i) /= qMax(m_Parms->gridDim()(i),0.0);
234  }
235 
236  xyz = m_Parms->gridBasis()*xyz;
237  xyz = xyz + m_Parms->gridOrigin();
238 
239  return xyz;
240 }
CctwCrystalCoordinateParameters * m_Parms
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::gridBasisInv ( )
inlineslot

Definition at line 61 of file cctwcrystalcoordinatetransform.h.

References m_GridBasisInv.

61 { return m_GridBasisInv; }
bool CctwCrystalCoordinateTransform::hasInverse ( ) const
virtualslot

Definition at line 134 of file cctwcrystalcoordinatetransform.cpp.

135 {
136  return false;
137 }
CctwDoubleVector3D CctwCrystalCoordinateTransform::hkl2grid ( double  h,
double  k,
double  l 
)
slot

Definition at line 204 of file cctwcrystalcoordinatetransform.cpp.

Referenced by forward(), and CctwqtTransformTester::testHKL2Grid().

205 {
206  return hkl2grid(CctwDoubleVector3D(h,k,l));
207 }
CctwDoubleVector3D hkl2grid(double h, double k, double l)
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D CctwCrystalCoordinateTransform::hkl2grid ( CctwDoubleVector3D  hkl)
slot

Definition at line 209 of file cctwcrystalcoordinatetransform.cpp.

References CctwCrystalCoordinateParameters::gridDim, CctwCrystalCoordinateParameters::gridOffset, CctwCrystalCoordinateParameters::gridOrigin, m_GridBasisInv, and m_Parms.

210 {
211  CctwDoubleVector3D xyz = hkl;
212 
213  xyz = xyz - m_Parms->gridOrigin();
214  xyz = m_GridBasisInv*xyz;
215 
216  for (int i=0; i<3; i++) {
217  xyz(i) *= qMax(m_Parms->gridDim()(i),0.0);
218  }
219 
220  return xyz+m_Parms->gridOffset();
221 }
CctwCrystalCoordinateParameters * m_Parms
CctwDoubleVector3D CctwCrystalCoordinateTransform::hkl2qlab ( double  h,
double  k,
double  l 
)
slot

Definition at line 242 of file cctwcrystalcoordinatetransform.cpp.

Referenced by CctwqtTransformTester::testHKL2QLab().

243 {
244  return hkl2qlab(CctwDoubleVector3D(h,k,l));
245 }
CctwDoubleVector3D hkl2qlab(double h, double k, double l)
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D CctwCrystalCoordinateTransform::hkl2qlab ( CctwDoubleVector3D  hkl)
slot

Definition at line 247 of file cctwcrystalcoordinatetransform.cpp.

References m_Parms, and CctwCrystalCoordinateParameters::ubMat.

248 {
249  return m_Parms->ubMat()*hkl;
250 }
CctwCrystalCoordinateParameters * m_Parms
CctwDoubleVector3D CctwCrystalCoordinateTransform::inverse ( CctwDoubleVector3D  q)
virtualslot

Definition at line 146 of file cctwcrystalcoordinatetransform.cpp.

147 {
148  return CctwDoubleVector3D();
149 }
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D CctwCrystalCoordinateTransform::ndVec ( )
inlineslot

Definition at line 69 of file cctwcrystalcoordinatetransform.h.

References m_ND.

69 { return m_ND; }
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::oMat ( )
inlineslot

Definition at line 57 of file cctwcrystalcoordinatetransform.h.

References m_OMat.

57 { return m_OMat; }
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::oMatInv ( )
inlineslot

Definition at line 66 of file cctwcrystalcoordinatetransform.h.

References m_OMatInv.

66 { return m_OMatInv; }
double CctwCrystalCoordinateTransform::omegaAngle ( )
inlineslot

Definition at line 49 of file cctwcrystalcoordinatetransform.h.

References m_OmegaAngle.

CctwDoubleVector3D CctwCrystalCoordinateTransform::oVec ( )
inlineslot

Definition at line 58 of file cctwcrystalcoordinatetransform.h.

References m_OVec.

58 { return m_OVec; }
double CctwCrystalCoordinateTransform::phiAngle ( )
inlineslot

Definition at line 51 of file cctwcrystalcoordinatetransform.h.

References m_PhiAngle.

CctwDoubleVector3D CctwCrystalCoordinateTransform::pixel2qlab ( double  x,
double  y,
double  z 
)
slot

Definition at line 169 of file cctwcrystalcoordinatetransform.cpp.

Referenced by forward(), and CctwqtTransformTester::testPixel2QLab().

170 {
171  return pixel2qlab(CctwDoubleVector3D(x,y,z));
172 }
CctwDoubleVector3D pixel2qlab(double x, double y, double z)
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D CctwCrystalCoordinateTransform::pixel2qlab ( CctwDoubleVector3D  pixel)
slot

Definition at line 174 of file cctwcrystalcoordinatetransform.cpp.

References m_CD, m_DMatInv, m_GMatInv, m_OMatInv, m_OVec, m_Parms, CctwVector3D< T >::normalized(), CctwCrystalCoordinateParameters::wavelength, and CctwVector3D< T >::x().

175 {
176  CctwDoubleVector3D xyz = pixel;
177  double scale = 1.0/m_Parms->wavelength();
178 
179  xyz = m_OMatInv*xyz;
180  xyz = xyz - m_OVec;
181 
182  xyz = m_DMatInv*xyz;
183  xyz = xyz - m_CD;
184  xyz = xyz.normalized();
185  xyz = xyz*scale;
186 
187  xyz.x() -= scale;
188 
189  xyz = m_GMatInv*xyz;
190 
191  return xyz;
192 }
CctwCrystalCoordinateParameters * m_Parms
T x() const
Definition: cctwvector3d.h:17
CctwVector3D< T > normalized() const
CctwDoubleVector3D CctwCrystalCoordinateTransform::qlab2hkl ( double  qx,
double  qy,
double  qz 
)
slot

Definition at line 194 of file cctwcrystalcoordinatetransform.cpp.

Referenced by forward(), and CctwqtTransformTester::testQLab2HKL().

195 {
196  return qlab2hkl(CctwDoubleVector3D(qx,qy,qz));
197 }
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D qlab2hkl(double qx, double qy, double qz)
CctwDoubleVector3D CctwCrystalCoordinateTransform::qlab2hkl ( CctwDoubleVector3D  qlab)
slot

Definition at line 199 of file cctwcrystalcoordinatetransform.cpp.

References m_UBMatInv.

200 {
201  return m_UBMatInv*qlab;
202 }
CctwDoubleVector3D CctwCrystalCoordinateTransform::qlab2pixel ( double  qx,
double  qy,
double  qz 
)
slot

Definition at line 252 of file cctwcrystalcoordinatetransform.cpp.

Referenced by CctwqtTransformTester::testQLab2Pixel().

253 {
254  return qlab2pixel(CctwDoubleVector3D(qx,qy,qz));
255 }
CctwDoubleVector3D qlab2pixel(double qx, double qy, double qz)
CctwVector3D< double > CctwDoubleVector3D
Definition: cctwvector3d.h:71
CctwDoubleVector3D CctwCrystalCoordinateTransform::qlab2pixel ( CctwDoubleVector3D  qlab)
slot

Definition at line 257 of file cctwcrystalcoordinatetransform.cpp.

References CctwVector3D< double >::dotProduct(), m_CD, m_DMat, m_GMat, m_ND, m_OMat, m_OVec, m_Parms, and CctwCrystalCoordinateParameters::wavelength.

258 {
259  CctwDoubleVector3D xyz = qlab;
260 
261  xyz = m_GMat*xyz;
262  xyz(0) += 1.0/m_Parms->wavelength();
263  xyz = xyz.normalized();
264 
266  double cosang = CctwDoubleVector3D::dotProduct(xyz, m_ND);
267 
268  double pdist = -dmin/cosang;
269 
270  xyz = xyz*pdist;
271 
272  xyz = xyz + m_CD;
273 
274  xyz = m_DMat*xyz;
275 
276  xyz = xyz + m_OVec;
277 
278  xyz = m_OMat*xyz;
279 
280  return xyz;
281 }
CctwCrystalCoordinateParameters * m_Parms
static double dotProduct(const CctwVector3D< double > &v1, const CctwVector3D< double > &v2)
void CctwCrystalCoordinateTransform::report ( )
slot

Definition at line 97 of file cctwcrystalcoordinatetransform.cpp.

98 {
99 // printMessage(tr("CctwqtCrystalCoordinateParameters - wavelength() = %1")
100 // .arg(m_QTParms->wavelength()));
101 
102 // printMessage(tr("CctwCrystalCoordinateParameters::m_Wavelength = %1")
103 // .arg(((CctwCrystalCoordinateParameters*) m_QTParms)->m_Wavelength));
104 }
void CctwCrystalCoordinateTransform::setCurrentFrame ( double  frame)
slot

Definition at line 36 of file cctwcrystalcoordinatetransform.cpp.

References CctwCrystalCoordinateParameters::chiAngle(), CctwCrystalCoordinateParameters::distance, CctwMatrix3x3< T >::identity(), CctwMatrix3x3< T >::inverted(), m_CD, m_ChiAngle, m_CurrentFrame, m_CurrentFrameChangeCount, m_DMat, m_DMatInv, m_GMat, m_GMatInv, m_ND, m_OmegaAngle, m_Parms, m_PhiAngle, m_TwoThetaAngle, CctwCrystalCoordinateParameters::omegaAngle(), CctwCrystalCoordinateParameters::orientErrorDetPitch, CctwCrystalCoordinateParameters::orientErrorDetRoll, CctwCrystalCoordinateParameters::orientErrorDetYaw, CctwCrystalCoordinateParameters::orientErrorGonPitch, CctwCrystalCoordinateParameters::phiAngle(), CctwMatrix3x3< T >::rotX(), CctwMatrix3x3< T >::rotY(), CctwMatrix3x3< T >::rotZ(), CctwCrystalCoordinateParameters::twoThetaAngle(), and CctwCrystalCoordinateParameters::xTrans.

Referenced by forward(), CctwqtTransformTester::testGetDetPix(), CctwqtTransformTester::testGetDetPos(), CctwqtTransformTester::testGrid2HKL(), CctwqtTransformTester::testHKL2Grid(), CctwqtTransformTester::testHKL2QLab(), CctwqtTransformTester::testPixel2QLab(), CctwqtTransformTester::testQLab2HKL(), and CctwqtTransformTester::testQLab2Pixel().

37 {
38  if (frame != m_CurrentFrame) {
39  m_CurrentFrame = frame;
40 
43  m_PhiAngle = m_Parms->phiAngle(frame);
44  m_ChiAngle = m_Parms->chiAngle(frame);
45 
46  // if (m_Angles == NULL) {
47 // m_OmegaAngle = frame*m_Parms->omegaStep() + m_Parms->omegaCorrection();
48 // } else {
49 // int f0 = ::floor(frame);
50 // int f1 = f0+1;
51 // double df = frame-f0;
52 // m_OmegaAngle = m_Angles[f0]+df*(m_Angles[f1]-m_Angles[f0]);
53 // }
54 
56 
62 
63  m_DMatInv = dimat;
64  m_DMat = dimat.inverted();
65 
67 
72 
73  m_GMat = gmat;
74  m_GMatInv = gmat.inverted();
75 
76  CctwDoubleVector3D cD(m_Parms->distance(), 0, 0);
79  CctwDoubleVector3D tVec = m_GMat*m_Parms->xTrans();
80 
81  cD = tVec - cD;
82 
83  CctwDoubleVector3D nD(dimat(0,0), dimat(1,0), dimat(2,0));
84 
85  m_CD = cD;
86  m_ND = nD;
87 
89  }
90 }
CctwCrystalCoordinateParameters * m_Parms
static CctwMatrix3x3 rotZ(double r)
static CctwMatrix3x3 rotX(double r)
static CctwMatrix3x3 rotY(double r)
CctwMatrix3x3 inverted(bool *invertible=NULL) const
static CctwMatrix3x3 identity()
double CctwCrystalCoordinateTransform::twoThetaAngle ( )
inlineslot
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::ubMatInv ( )
inlineslot

Definition at line 60 of file cctwcrystalcoordinatetransform.h.

References m_UBMatInv.

60 { return m_UBMatInv; }
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::uMat ( )
inlineslot

Definition at line 54 of file cctwcrystalcoordinatetransform.h.

References m_UMat.

54 { return m_UMat; }
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::uMatInv ( )
inlineslot

Definition at line 63 of file cctwcrystalcoordinatetransform.h.

References m_UMatInv.

63 { return m_UMatInv; }
void CctwCrystalCoordinateTransform::updateFromParameters ( )
slot

Definition at line 14 of file cctwcrystalcoordinatetransform.cpp.

References CctwCrystalCoordinateParameters::chiAngle(), createBMatrix(), CctwCrystalCoordinateParameters::gridBasis, CctwMatrix3x3< T >::inverted(), m_BMat, m_BMatInv, m_ChiAngle, m_GridBasisInv, m_OMat, m_OMatInv, m_OmegaAngle, m_OVec, m_Parms, m_PhiAngle, m_TwoThetaAngle, m_UBMatInv, m_UMat, m_UMatInv, CctwCrystalCoordinateParameters::oMat, CctwCrystalCoordinateParameters::omegaAngle(), CctwCrystalCoordinateParameters::oVec, CctwCrystalCoordinateParameters::phiAngle(), CctwCrystalCoordinateParameters::twoThetaAngle(), CctwCrystalCoordinateParameters::ubMat, and CctwCrystalCoordinateParameters::unitCell.

Referenced by CctwCrystalCoordinateTransform().

15 {
17  m_TwoThetaAngle = m_Parms->twoThetaAngle(0.0); // + m_Parms->twoThetaCorrection();
18  m_PhiAngle = m_Parms->phiAngle(0.0); // + m_Parms->phiCorrection();
19  m_ChiAngle = m_Parms->chiAngle(0.0); // + m_Parms->chiCorrection();
20 
22 
23  m_OMat = m_Parms->oMat();
25  m_OVec = m_Parms->oVec();
26 
28 
31 
34 }
CctwCrystalCoordinateParameters * m_Parms
CctwDoubleMatrix3x3 createBMatrix(const CctwUnitCell &cell) const
CctwMatrix3x3 inverted(bool *invertible=NULL) const

Member Data Documentation

const double* CctwCrystalCoordinateTransform::m_Angles
private

Definition at line 77 of file cctwcrystalcoordinatetransform.h.

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_BMat

Definition at line 85 of file cctwcrystalcoordinatetransform.h.

Referenced by bMat(), and updateFromParameters().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_BMatInv
private

Definition at line 95 of file cctwcrystalcoordinatetransform.h.

Referenced by bMatInv(), and updateFromParameters().

CctwDoubleVector3D CctwCrystalCoordinateTransform::m_CD
private

Definition at line 101 of file cctwcrystalcoordinatetransform.h.

Referenced by cdVec(), pixel2qlab(), qlab2pixel(), and setCurrentFrame().

double CctwCrystalCoordinateTransform::m_ChiAngle
double CctwCrystalCoordinateTransform::m_CurrentFrame
private

Definition at line 74 of file cctwcrystalcoordinatetransform.h.

Referenced by setCurrentFrame().

int CctwCrystalCoordinateTransform::m_CurrentFrameChangeCount
private

Definition at line 75 of file cctwcrystalcoordinatetransform.h.

Referenced by changeCount(), and setCurrentFrame().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_DMat

Definition at line 88 of file cctwcrystalcoordinatetransform.h.

Referenced by dMat(), qlab2pixel(), and setCurrentFrame().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_DMatInv
private

Definition at line 98 of file cctwcrystalcoordinatetransform.h.

Referenced by dMatInv(), pixel2qlab(), and setCurrentFrame().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_GMat

Definition at line 87 of file cctwcrystalcoordinatetransform.h.

Referenced by gMat(), qlab2pixel(), and setCurrentFrame().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_GMatInv
private

Definition at line 97 of file cctwcrystalcoordinatetransform.h.

Referenced by gMatInv(), pixel2qlab(), and setCurrentFrame().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_GridBasisInv
private

Definition at line 94 of file cctwcrystalcoordinatetransform.h.

Referenced by gridBasisInv(), hkl2grid(), and updateFromParameters().

CctwDoubleVector3D CctwCrystalCoordinateTransform::m_ND
private

Definition at line 102 of file cctwcrystalcoordinatetransform.h.

Referenced by ndVec(), qlab2pixel(), and setCurrentFrame().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_OMat

Definition at line 89 of file cctwcrystalcoordinatetransform.h.

Referenced by oMat(), qlab2pixel(), and updateFromParameters().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_OMatInv
private

Definition at line 99 of file cctwcrystalcoordinatetransform.h.

Referenced by oMatInv(), pixel2qlab(), and updateFromParameters().

double CctwCrystalCoordinateTransform::m_OmegaAngle
CctwDoubleVector3D CctwCrystalCoordinateTransform::m_OVec
CctwCrystalCoordinateParameters* CctwCrystalCoordinateTransform::m_Parms
private
double CctwCrystalCoordinateTransform::m_PhiAngle
double CctwCrystalCoordinateTransform::m_TwoThetaAngle
CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_UBMatInv
private

Definition at line 93 of file cctwcrystalcoordinatetransform.h.

Referenced by qlab2hkl(), ubMatInv(), and updateFromParameters().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_UMat

Definition at line 86 of file cctwcrystalcoordinatetransform.h.

Referenced by uMat(), and updateFromParameters().

CctwDoubleMatrix3x3 CctwCrystalCoordinateTransform::m_UMatInv
private

Definition at line 96 of file cctwcrystalcoordinatetransform.h.

Referenced by uMatInv(), and updateFromParameters().


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