00001 /* 00002 Copyright 2011, CERTEC 00003 00004 This file is part of HIPP. 00005 00006 HIPP is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 HIPP is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with HIPP. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 #ifndef __HIPPDOCUMENT_H__ 00022 #define __HIPPDOCUMENT_H__ 00023 00024 #include <wx/docview.h> 00025 #include <iostream> 00026 #include "HippShape.h" 00027 #include "../nodes/PaintableTexture.h" 00028 00029 namespace hipp { 00042 class HippDocument : public wxDocument 00043 { 00044 public: 00045 HippDocument(void); 00046 ~HippDocument(void); 00047 00055 wxCommandProcessor *OnCreateCommandProcessor(); 00056 00072 std::ostream& SaveObject(std::ostream& stream); 00073 00088 std::istream& LoadObject(std::istream& stream); 00089 list<HippShape*>* getShapes() 00090 { 00091 return &shapes; 00092 } 00093 00094 HippShape* getTopShapeAt(wxPoint pt); 00095 00096 void setShapes(std::list<HippShape*>* shapes) 00097 { 00098 this->shapes = *shapes; 00099 } 00100 00101 HippShape *getSelectedShape() const 00102 { 00103 return selected; 00104 } 00105 00106 void setSelectedShape(HippShape *selected); 00107 00108 virtual void OnCreatePolyline(PolylineEvent &event); 00109 00110 bool getUpdateHaptic(); 00111 00112 protected: 00113 virtual bool DoOpenDocument(const wxString &file); 00114 std::list<HippShape*> shapes; 00115 HippShape *selected; // @TODO this should be in HippView 00116 DECLARE_DYNAMIC_CLASS(HippDocument) 00117 bool updateHaptic; 00118 }; 00119 } 00120 00121 wxDECLARE_EVENT(HippEVT_CURVE_SELECTED, wxCommandEvent); 00122 wxDECLARE_EVENT(HippEVT_CURVE_INFO_UPDATED, wxCommandEvent); 00123 #endif
1.7.1