Exemplo n.º 1
0
BOOL CHMMDemoDoc::OnOpenDocument(LPCTSTR path)
{
    bool result = false;
    
    int length = strlen( path );
    const char* tmp = path + length - 3;

    if( _stricmp(tmp,"bmp") == 0 || _stricmp(tmp,"jpg") == 0 || 
        _stricmp(tmp-1,"jpeg") == 0 )
    {
        CHMMDemoView* camera_view = GetCameraView();
        CCamera& camera = camera_view->Camera();

        if ( camera.IsRunning() ) camera.Stop();

        //load image from disk
        CImage& image = camera.GetFrame();
        image.Load( path, 1 );

        camera_view->Invalidate();
        camera_view->SetSelection(0); 
        
    }
    else if( _stricmp(tmp,"txt") == 0 )
    {   
        DeleteContents();
        SetModifiedFlag();  // dirty during de-serialize

        m_base.SetBaseView( GetImageBaseView() );

        {
            CWaitCursor wait;
            m_base.SetFileName( path );
            result = m_base.Load();
        }

        if( !result )
        {
            m_base.SetFileName("");
            AfxMessageBox("Failed to open database");
        }
        else
        {
            SetModifiedFlag(FALSE);     // start off with unmodified

            //try to read appropriate config file.
            //create cfg file name
            CString cfg_name = path;
            cfg_name.Replace( ".txt", "CFG.txt" );
            
            //reset parameters (HMM, Sampling etc.) for whole application
            CHMMDemoApp* app = (CHMMDemoApp*)AfxGetApp();
            app->LoadConfig( cfg_name, true );
        }
    }
    return  result;
}
Exemplo n.º 2
0
	XMMATRIX XM_CALLCONV Camera::GetCameraViewProjection() const
	{
		return XMMatrixMultiply(GetCameraView(), m_mProj);
	}
Exemplo n.º 3
0
	XMMATRIX XM_CALLCONV OptimizedCamera::GetOptCameraViewProjection() const
	{
		return XMMatrixMultiply(GetCameraView(), m_mOptProj);
	}