예제 #1
0
 CAxisRotation::CAxisRotation(const CQuaternion & oQuat) {
    CLog oLog("math","CAxisRotation::Constructor (CQuaternion)",LL_OBJECT);
    double dHalfAngle = acos(oQuat.Scalar());
    double dSinHalfAngle = sin(dHalfAngle);
    m_dAngle = 2.0F * dHalfAngle;
    if (fabs(dSinHalfAngle) == 0) {
       CVector3D temp(0,1,0);
       m_oAxis = temp;
    }
    else {
       m_oAxis = oQuat.Vector() / dSinHalfAngle;
    }
 } //CAxisRotation(const CQuaternion & quat)
예제 #2
0
//************************************
// Method:    OnOpLog
// FullName:  CImgView::OnOpLog
// Access:    protected 
// Returns:   void
// Qualifier:
//************************************
void CImgView::OnOpLog() 
{
	// TODO: Add your command handler code here
	procStatus eRetCode = eNormal;
	CLogarihDlg oDlg;
	INT nRes = oDlg.DoModal();		
	if(nRes == IDOK)
	{
		CPGTLogTransformer oLog(oDlg.m_nConst);
		
		eRetCode = process(&oLog);
		if(eRetCode != eNormal)
		{
			AfxMessageBox(CUtility::MessageTranslate(eRetCode));
		}
	}	
}
예제 #3
0
 char* CAxisRotation::ToString(int iPrecision) const {       
    CLog oLog("math","CAxisRotation::ToString");
    // Allocate output buffer space and initialise it to a null string.
    char* pcOutput = (char*)malloc(512);
    pcOutput[0] = 0;
    char* pcStr = 0;
    // Create axis string
    pcStr = m_oAxis.ToString(iPrecision);
    strcat(pcOutput,pcStr);
    free(pcStr);
    strcat(pcOutput," ");
    // Create angle string
    CScalar oComponent(m_dAngle);
    pcStr = oComponent.ToString(iPrecision);
    strcat(pcOutput,pcStr);
    free(pcStr);
    // Chop string and return
    int length = strlen(pcOutput) + 1;
    pcOutput = (char*)realloc(pcOutput,length);
    return pcOutput;
 } //ToString(int iPrecision) const
예제 #4
0
파일: trimodel.cpp 프로젝트: Floppy/Vapour
 int CTriModel::NumMeshes(void) const {
    CLog oLog("3d","CTriModel::NumMeshes",LL_FUNCTION);
    return m_oMeshes.size();
 }
예제 #5
0
파일: trimodel.cpp 프로젝트: Floppy/Vapour
 CTriModel::~CTriModel() {
    CLog oLog("3d","CTriModel::Destructor",LL_OBJECT);
 }
예제 #6
0
파일: trimodel.cpp 프로젝트: Floppy/Vapour
 CTriModel::CTriModel() {
    CLog oLog("3d","CTriModel::Constructor (default)",LL_OBJECT);
 }
예제 #7
0
 CAxisRotation CAxisRotation::MergeOutside(const CAxisRotation & oRot) const{
    CLog oLog("math","CAxisRotation::MergeOutside");
    return oRot.MergeInside(*this);
 }
예제 #8
0
 CAxisRotation CAxisRotation::MergeInside(const CAxisRotation & oRot) const{
    CLog oLog("math","CAxisRotation::MergeInside");
    CQuaternion first(*this);
    CQuaternion second(oRot);
    return CAxisRotation(first * second);
 }
예제 #9
0
 bool CAxisRotation::operator ==(const CAxisRotation& oRot) const {
    CLog oLog("math","CAxisRotation::operator==");
    return ((m_dAngle == oRot.m_dAngle) && (m_oAxis == oRot.m_oAxis));
 }
예제 #10
0
 CAxisRotation& CAxisRotation::operator=(const CAxisRotation& oRot) {
    CLog oLog("math","CAxisRotation::operator=");
    m_oAxis = oRot.m_oAxis;
    m_dAngle = oRot.m_dAngle;
    return *this;
 } //operator=(const CAxisRotation& oRot)
예제 #11
0
 void CAxisRotation::ToDouble(double& dX, double& dY, double& dZ, double& dAngle) const {
    CLog oLog("math","CAxisRotation::ToDouble");
    m_oAxis.ToDouble(dX, dY, dZ);
    dAngle = m_dAngle;
 } //ToDouble(double& dX, double& dY, double& dZ, double& dAngle) const
예제 #12
0
파일: trimodel.cpp 프로젝트: Floppy/Vapour
 CMesh& CTriModel::Mesh(int iMesh) {
    CLog oLog("3d","CTriModel::Mesh",LL_FUNCTION);
    return m_oMeshes[iMesh];
 }
예제 #13
0
 CAxisRotation::CAxisRotation(const CVector3D & oAxis, const double dAngle) :
    m_dAngle(dAngle),
    m_oAxis(oAxis)
 {
    CLog oLog("math","CAxisRotation::Constructor (CVector3D,double)",LL_OBJECT);
 } //CAxisRotation(const CVector3D & oAxis, const double dAngle)
예제 #14
0
 CAxisRotation::CAxisRotation(const double dX, const double dY, const double dZ, const double dAngle) :
    m_dAngle(dAngle),
    m_oAxis(dX,dY,dZ)
 {
    CLog oLog("math","CAxisRotation::Constructor (doubles)",LL_OBJECT);
 } //CAxisRotation(const double dX, const double dY, const double dZ, const double dAngle)
예제 #15
0
 CAxisRotation::CAxisRotation(const CAxisRotation & oRot) :
    m_dAngle(oRot.m_dAngle),
    m_oAxis(oRot.m_oAxis)
 {
    CLog oLog("math","CAxisRotation::Constructor (copy)",LL_OBJECT);
 } //CAxisRotation(const CAxisRotation & rot)
예제 #16
0
 CAxisRotation::CAxisRotation() :
    m_dAngle(0.0F),
    m_oAxis(0,1,0)
 {
    CLog oLog("math","CAxisRotation::Constructor (default)",LL_OBJECT);
 } //CAxisRotation()	
예제 #17
0
 bool CAxisRotation::ParseString(const char* pcInput, int* piUsed) {
    CLog oLog("math","CAxisRotation::ParseString");
    double pdInputData[4];
    const int iNumComponents = 4;
    int iCurrentComponent = 0;
    bool bFractionalPart = false;
    bool bExponentPart = false;
    int iStrLength = strlen(pcInput);
    bool bRetVal = (iStrLength == 0) ? false : true;
    unsigned long int ulIntegerPart = 0;
    unsigned long int ulFractionalPart = 0;
    unsigned long int ulFractionalDivisor = 1;
    long int lExponentPart = 0;
    int iMantissaSign = 1;
    int iExponentSign = 1;
    int iCharIndex = 0;
    bool waiting = false;
    for (iCharIndex=0; (iCharIndex<iStrLength) && bRetVal && (iCurrentComponent < iNumComponents); iCharIndex++) {
       if (waiting) {
          // Assign to current component
          lExponentPart *= iExponentSign;
          pdInputData[iCurrentComponent] = (iMantissaSign * (ulIntegerPart + ((double)ulFractionalPart / (double)ulFractionalDivisor))) * pow(10,lExponentPart);
          // Reset variables
          bFractionalPart = false;
          bExponentPart = false;
          ulIntegerPart = 0;
          ulFractionalPart = 0;
          ulFractionalDivisor = 1;
          lExponentPart = 0;
          iMantissaSign = 1;
          iExponentSign = 1;
          // Move on
          iCurrentComponent++;
          waiting = false;
       }
       if (isdigit(pcInput[iCharIndex])) {
          if (bExponentPart) {
             lExponentPart *= 10;
             lExponentPart += pcInput [iCharIndex] - '0';
          }
          else if (bFractionalPart) {
             ulFractionalPart *= 10;
             ulFractionalDivisor *= 10;
             ulFractionalPart += pcInput[iCharIndex] - '0';
          }
          else {
             ulIntegerPart *= 10;
             ulIntegerPart += pcInput[iCharIndex] - '0';
          }
       }
       else if (pcInput[iCharIndex] == '-') {
          if (bExponentPart) {
             iExponentSign = -1;
          }
          else {
             iMantissaSign = -1;
          }
       }
       else if (pcInput[iCharIndex] == ' ') {
          // Waiting for next component.
          waiting = true;
       }
       else if (pcInput[iCharIndex] == '.') {
          bFractionalPart = true;
       }
       else if ((pcInput[iCharIndex] == 'e') || (pcInput[iCharIndex] == 'E')) {
          bExponentPart = true;
       }
       else bRetVal = false;
    }
    // Assign last component
    if (bRetVal && (iCurrentComponent != iNumComponents)) {
       lExponentPart *= iExponentSign;
       pdInputData[iCurrentComponent] = (iMantissaSign * (ulIntegerPart + ((double)ulFractionalPart / (double)ulFractionalDivisor))) * pow(10,lExponentPart);
    }
    if (iCurrentComponent != iNumComponents-1) bRetVal = false;
    if (piUsed != NULL) {
       *piUsed = iCharIndex;
    }
    m_oAxis.FromDouble(pdInputData[0],pdInputData[1],pdInputData[2]);
    m_dAngle = pdInputData[3];
    return bRetVal;
 } //ParseString(const char* pcInput, int& piUsed)
예제 #18
0
 void CAxisRotation::FromDouble(double dX, double dY, double dZ, double dAngle) {
    CLog oLog("math","CAxisRotation::FromDouble");
    m_dAngle = dAngle;
    m_oAxis.FromDouble(dX, dY, dZ);
    return;
 } //FromDouble(double dX, double dY, double dZ, double dAngle)
예제 #19
0
 CAxisRotation::CAxisRotation(const CEulerRotation & oRot) {
    CLog oLog("math","CAxisRotation::Constructor (CEulerRotation)",LL_OBJECT);
    CQuaternion oQuat(oRot);
    *this = CAxisRotation(oQuat);
 } //CAxisRotation(const CEulerRotation & oRot)
예제 #20
0
 CAxisRotation& CAxisRotation::Normalise() {
    CLog oLog("math","CAxisRotation::Normalise");
    m_oAxis.Normalise();
    return *this;
 } //Normalise()