Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExampleProjectionGUI.cpp

Example for using the ProjectionGUI

Author
MIP
/*
This file is part of the BIAS library (Basic ImageAlgorithmS).
Copyright (C) 2003, 2004 (see file CONTACTS for details)
Multimediale Systeme der Informationsverarbeitung
Institut fuer Informatik
Christian-Albrechts-Universitaet Kiel
BIAS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
BIAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with BIAS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
@example ExampleProjectionGUI.cpp
@relates wxProjectionDialog
@brief Example for using the ProjectionGUI
@ingroup g_examples
@author MIP
*/
#include <wx/wx.h>
#include <Base/Common/BIASpragma.hh>
#include <Gui/wxProjectionDialog.hh>
#include <Gui/StringConv.hh>
#include <Utils/Param.hh>
#include <iostream>
#include <vector>
#include <string>
using namespace BIAS;
using namespace std;
// classes
/** \cond HIDDEN_SYMBOLS */
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
DECLARE_APP(MyApp)
class MyFrame : public wxFrame
{
public:
MyFrame();
~MyFrame();
void ShowDialog();
};
// implementation
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame();
frame->Show(TRUE);
SetTopWindow(frame);
frame->ShowDialog();
return true;
}
MyFrame::MyFrame()
: wxFrame(NULL, -1, _T("ProjectionGUI"), wxDefaultPosition, wxSize(400,600) )
{
if(wxTheApp->argc > 1)
proj.XMLRead(WxToAscii(wxTheApp->argv[1]));
else{
BIAS::Pose pose;
K[0][0]=K[1][1] = 200;
K[0][2]=400;K[1][2]=300;
proj.CreatePerspective (pose,K, 800, 600);
}
}
void MyFrame::ShowDialog()
{
BIAS::wxProjectionDialog dlg(proj,this,-1,wxT("Projection"),true);
dlg.ShowModal();
dlg.Destroy();
}
MyFrame::~MyFrame()
{
}
/** \endcond */