Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00029 #ifndef HIPPVIEW_H_
00030 #define HIPPVIEW_H_
00031
00032 #include <wx/docview.h>
00033 #include <wx/print.h>
00034 #include "HippFrame.h"
00035 #include <H3DUtil/AutoRef.h>
00036 #include "../nodes/PaintableTexture.h"
00037 #include "HippShape.h"
00038 #include "HippPrintFormats.h"
00039
00040 using H3DUtil::AutoRef;
00041
00042
00043 namespace hipp {
00044 class HippFrame;
00045 class HippDocument;
00046
00063 class HippView: public wxView {
00064 public:
00065 HippView();
00066
00067
00069 virtual bool OnCreate(wxDocument *doc, long flags);
00071 virtual wxPrintout *OnCreatePrintout();
00073 virtual void OnDraw(wxDC* dc);
00075 virtual void OnDraw();
00077 virtual void OnDrawForPrinter(wxDC* dc, PRINT_FORMAT format);
00079 virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
00081 virtual bool OnClose(bool deleteWindow = true);
00082
00083 HippDocument* GetDocument();
00084 void SetDocument(wxDocument *doc);
00085
00086 virtual void DoSelectShape(wxJoystickEvent &event);
00088 void OnCut(wxCommandEvent& event);
00089
00090 int current_viewpoint_id;
00091
00092 void OnFullscreen(wxCommandEvent & event);
00093 void RestoreWindow(wxCommandEvent & event);
00094 void MirrorScene(wxCommandEvent & event);
00095 void RenderMode(wxCommandEvent & event);
00096 void OnIdle(wxIdleEvent & event);
00097
00098 void togglePenColour();
00099 void updatePenOptions();
00100 bool* getPenWhitePtr() {return penWhitePtr;}
00101 int* getPenWidthPtr() {return penWidthPtr;}
00102
00103 wxPoint getDevicePos() const;
00104 void UpdateWindowSize(wxSizeEvent &frameSizeEvent);
00105
00106 list<Node*> GetTopLevelViews();
00107
00108 HippFrame* GetFrame(){return frame;}
00109
00110 private:
00112 virtual void OnDrawToDC(int w, int h, const unsigned char * cairoData, wxDC* dc);
00114 virtual void OnDrawShapeOntoContext(HippShape* shape, Cairo::RefPtr<Cairo::Context> context, HippShape* selectedShape, bool isHaptic);
00115
00116 void HippView::CloseFile();
00117 bool loadFile(const string &filename);
00118 HippFrame* frame;
00119
00120 wxString currentFilename;
00121 wxString currentPath;
00122 bool lastmirror;
00123 bool lastDeviceStatus;
00124 string settings_path;
00125 string common_path;
00126 string deviceinfo_file;
00127 string viewpoint_file;
00128 string render_mode;
00129 bool loaded_first_file;
00130 NodeVector allDevices;
00131 list<Node*> VPlist;
00132 TimeStamp last_viewmenu_update;
00133 bool* penWhitePtr;
00134 int* penWidthPtr;
00135
00136 HippShape* lastTopShape;
00137
00138 AutoRef<Node> device_info;
00139
00140 X3D::DEFNodes default_stylus_dn;
00141
00142 vector<PaintableTexture*> textures;
00143
00144 DECLARE_DYNAMIC_CLASS( HippView)
00145 };
00146 }
00147 #endif