Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ShowCamWxApp.cpp
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 #include <Base/Common/W32Compat.hh>
26 
27 #include "ShowCamWxApp.hh"
28 #include "ShowCamWxFrame.hh"
29 
30 using namespace BIAS;
31 using namespace std;
32 
33 
34 bool ShowCamWxApp::OnInit()
35 {
36  // Open console for windows
38 
39  // create main frame
40  ShowCamWxFrame *mainFrame;
41  mainFrame = new ShowCamWxFrame(AsciiToWx("BIAS ShowCamWx"), wxPoint(0,0),
42  wxSize(1000,650));
43 
44  // read params from file
45  mainFrame->InitParams(argc, WxToAsciiArray(argv, argc));
46 
47  // necessary for high resolution on small monitors (hackish...)
48  // mainFrame->SetSizeHints(900,700,1800,1600);
49 
50  // initialize cameras and try to open them
51  mainFrame->InitCameras();
52 
53  //check if Pan Tilt Unit is requested and open it
54 #ifdef BIAS_HAVE_PanTilt
55  mainFrame->InitPanTiltUnit();
56 #endif
57 
58  mainFrame->CreateMenu();
59  // create main windows
60  mainFrame->Show(true);
61 
62  SetTopWindow(mainFrame);
63 
64  return true;
65 }
66 
67 IMPLEMENT_APP(ShowCamWxApp)
void BIASGui_EXPORT ConsoleRedirectIO(std::string name=std::string(""))
Extra Console for WIN32 WinMain gui applications.
wxString AsciiToWx(const char *thestring)
Converts a C string to a wxString.
Definition: StringConv.hh:32
void CreateMenu()
Creates the menu of the main window.
void InitParams(int &argc, char *argv[])
Initializes all paramaters for param file.
void InitCameras()
Initialize cameras with param file.
Class for converting an array of wxStrings to an array of non-const ASCII strings.
Definition: StringConv.hh:60