You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
2.4 KiB
91 lines
2.4 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright Š 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: Transform.h
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of Transform.h
|
|
//----------------------------------------------------------------------------
|
|
#ifndef __TRANSFORM__H__INCLUDED__
|
|
#define __TRANSFORM__H__INCLUDED__
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif
|
|
|
|
class CVector
|
|
{
|
|
public:
|
|
CVector();
|
|
CVector( double a0, double a1, double a2 ) { Set( a0, a1, a2 ); }
|
|
~CVector(){}
|
|
|
|
public:
|
|
void Set( double a0, double a1, double a2 );
|
|
|
|
public:
|
|
double& operator[] ( int i ) { return m_pElement[i]; }
|
|
CVector& operator =( CVector& v );
|
|
CVector& operator -=( CVector& v );
|
|
CVector& operator +=( CVector& v );
|
|
CVector& operator *=( double d );
|
|
CVector& operator -();
|
|
|
|
public:
|
|
friend CVector operator *( CVector& v, double d ) { return CVector(v)*=d; }
|
|
friend CVector operator -( CVector& v1, CVector& v2 ) { return CVector(v1)-=v2; }
|
|
friend CVector operator +( CVector& v1, CVector& v2 ) { return CVector(v1)+=v2; }
|
|
|
|
private:
|
|
double m_pElement[3];
|
|
};
|
|
|
|
class CMatrix
|
|
{
|
|
public:
|
|
CMatrix();
|
|
CMatrix( double a00, double a01, double a02,
|
|
double a10, double a11, double a12,
|
|
double a20, double a21, double a22 ) { Set( a00, a01, a02, a10, a11, a12, a20, a21, a22 ); }
|
|
~CMatrix() {}
|
|
|
|
public:
|
|
void Set( double a00, double a01, double a02,
|
|
double a10, double a11, double a12,
|
|
double a20, double a21, double a22 );
|
|
|
|
public:
|
|
double* operator[] ( int i ) { return m_pElement[i]; }
|
|
CMatrix& operator =( CMatrix& m );
|
|
CMatrix& operator *=( CMatrix& m ) { return *this=CMatrix(*this)*m; }
|
|
|
|
public:
|
|
friend CMatrix operator *( CMatrix& m1, CMatrix& m2 );
|
|
friend CVector operator *( CMatrix& m, CVector& v );
|
|
friend CVector operator *( CVector& v, CMatrix& m ) { return m*v; }
|
|
|
|
private:
|
|
double m_pElement[3][3];
|
|
};
|
|
|
|
class CTransform
|
|
{
|
|
public:
|
|
CTransform();
|
|
~CTransform();
|
|
double* GetParameters() { return m_Values; }
|
|
void Prepare( double Xc, double Yc, double Zc, double Psicd, double Thetacd, double Phicd );
|
|
bool Evaluate( double angle, double range, double& pan, double& tilt, double& zoom );
|
|
private:
|
|
CMatrix m_Matrix;
|
|
CVector m_Vector;
|
|
bool m_bPrepared;
|
|
double m_Values[6];
|
|
};
|
|
|
|
#endif
|