www.pudn.com > cad3d.zip > 3DCoordSystem.h
// 3DCoordSystem.h: interface for the C3DCoordSystem class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_3DCOORDSYSTEM_H__D41BDAC8_E721_11D4_96C9_BB0DB9BC4E08__INCLUDED_)
#define AFX_3DCOORDSYSTEM_H__D41BDAC8_E721_11D4_96C9_BB0DB9BC4E08__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "3DMath/3DMath.h"
#include "3DMath/3DVector.h"
class MATH3D_API C3DCoordSystem
{
protected:
C3DPoint m_origin;
C3DVector m_basis[3];
public:
C3DCoordSystem();//creates standart cartesian coordinate system (Normalized!)
C3DCoordSystem( const C3DCoordSystem& rOther);
C3DCoordSystem( const C3DVector& rVx);//creates cartesian coordinate system from one vector (Normalized!)
C3DCoordSystem( const C3DVector& rVx,const C3DVector& rVy,const C3DVector& rVz,
const C3DPoint& rOrigin = C3DPoint());
~C3DCoordSystem();
inline C3DVector& BaseVectorRef(int i);
inline C3DPoint& OriginRef();
//creates orthogonal coordinate system from one vector
void CreateComplement(const C3DVector& rVx);
// void Orthogonalize();
void Normalize();
//returns if the basis is correct (the vectors aren't coplanar)
/*
bool IsCorrect() const;
bool IsOrthogonal() const;
*/
};
inline C3DVector& C3DCoordSystem::BaseVectorRef(int i)
{
CHECK(0 <= i);
CHECK(i <= 2);
return m_basis[i];
}
inline C3DPoint& C3DCoordSystem::OriginRef()
{
return m_origin;
}
#endif // !defined(AFX_3DCOORDSYSTEM_H__D41BDAC8_E721_11D4_96C9_BB0DB9BC4E08__INCLUDED_)