Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / object_viewer / vegetable_dlg.h
blob72d5882591d3b05aa92cbf345205d18f128248e3
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #if !defined(AFX_VEGETABLE_DLG_H__4E65E757_88C9_4FCE_94CC_9E429D8DFD68__INCLUDED_)
18 #define AFX_VEGETABLE_DLG_H__4E65E757_88C9_4FCE_94CC_9E429D8DFD68__INCLUDED_
20 #if _MSC_VER > 1000
21 #pragma once
22 #endif // _MSC_VER > 1000
23 // vegetable_dlg.h : header file
26 #include "ps_wrapper.h"
27 #include "vegetable_refresh.h"
28 #include "vegetable_list_box.h"
31 class CObjectViewer;
32 class CVegetableApperancePage;
33 class CVegetableDensityPage;
34 class CVegetableScalePage;
35 class CVegetableRotatePage;
36 class CVegetableWindDlg;
38 namespace NL3D
40 class CVegetable;
41 class CTileVegetableDesc;
45 /////////////////////////////////////////////////////////////////////////////
46 // CVegetableDlg dialog
48 class CVegetableDlg : public CDialog, public IVegetableRefresh
50 // Construction
51 public:
52 CVegetableDlg(CObjectViewer *viewer, CWnd* pParent = NULL); // standard constructor
54 ~CVegetableDlg();
56 // Dialog Data
57 //{{AFX_DATA(CVegetableDlg)
58 enum { IDD = IDD_VEGETABLE_DLG };
59 CVegetableListBox VegetableList;
60 CStatic StaticPolyCount;
61 CButton CheckSnapToGround;
62 CButton CheckEnableVegetable;
63 CButton CheckAutomaticRefresh;
64 CButton ButtonRefreshLandscape;
65 CButton CheckShowLandscape;
66 CStatic SelectVegetableStaticText;
67 //}}AFX_DATA
70 // IVegetableRefresh implementation: only if automatic refresh is checked
71 virtual void refreshVegetableDisplay();
74 public:
76 // get count of vegetable in the dlg
77 uint getNumVegetables() const;
78 std::string getVegetableName(uint id) const;
79 void updateCurSelVegetableName();
80 NL3D::CVegetable *getVegetable(uint id) const;
82 // Change the hiden state of the id vegetable.
83 void setShowHideVegetable (uint id, bool visible, bool refreshDisplay);
84 void swapShowHideVegetable (uint id);
85 bool isVegetableVisible (uint id);
87 // Overrides
88 // ClassWizard generated virtual function overrides
89 //{{AFX_VIRTUAL(CVegetableDlg)
90 protected:
91 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
92 //}}AFX_VIRTUAL
94 /** set the vegetble to edit. NULL will hide all the windows.
95 * Called by ListBox selection.
97 void setVegetableToEdit(NL3D::CVegetable *vegetable);
99 // Implementation
100 protected:
101 CObjectViewer *_ObjView;
102 friend class CVegetableListBox;
104 // Name to save.
105 std::string _LastVegetSetName;
107 // A desc of vegetable to edit.
108 struct CVegetableDesc
110 // The vegetable
111 NL3D::CVegetable *Vegetable;
112 // The name of this vegetable.
113 std::string VegetableName;
114 // Visibility. Editor feature only
115 bool Visible;
117 CVegetableDesc();
119 // init the vegetable
120 void initDefaultVegetable();
121 void initVegetable(const NL3D::CVegetable &vegetable);
122 // update VegetableName according to Vegetable
123 void updateVegetableName();
124 // delete the vegetable
125 void deleteVegetable();
128 // The vegetable List.
129 std::vector<CVegetableDesc> _Vegetables;
131 // The property sheet.
132 CPropertySheet *_PropertySheet;
133 CVegetableDensityPage *_VegetableDensityPage;
134 CVegetableApperancePage *_VegetableApperancePage;
135 CVegetableScalePage *_VegetableScalePage;
136 CVegetableRotatePage *_VegetableRotatePage;
138 // Extra wind dlg
139 CVegetableWindDlg *_VegetableWindDlg;
141 // refresh vegetable display even if box unchecked.
142 void doRefreshVegetableDisplay();
144 // clear all vegetables.
145 void clearVegetables();
146 // load a vegetSet with a FileDialog
147 bool loadVegetableSet(NL3D::CTileVegetableDesc &vegetSet, const TCHAR *title);
148 /** build the vegetSet from the current _Vegetables
149 * NB: transform Rotate Angle in Radians.
150 * \param keepDefaultShapeName if true, then vegetables with a ShapeName.empty() are kept.
151 * \param keepHiden if true, then vegetables maked as hiden in ObjectViewer are kept.
153 void buildVegetableSet(NL3D::CTileVegetableDesc &vegetSet, bool keepDefaultShapeName= true, bool keepHiden= true );
154 // append the vegetSet to the current _Vegetables
155 // NB: transform Rotate Angle in Degrees.
156 void appendVegetableSet(NL3D::CTileVegetableDesc &vegetSet);
158 // Generated message map functions
159 //{{AFX_MSG(CVegetableDlg)
160 afx_msg void OnDestroy();
161 virtual BOOL OnInitDialog();
162 afx_msg void OnSelchangeListVegetable();
163 afx_msg void OnButtonVegetableAdd();
164 afx_msg void OnButtonVegetableClear();
165 afx_msg void OnButtonVegetableInsert();
166 afx_msg void OnButtonVegetableLoadDesc();
167 afx_msg void OnButtonVegetableLoadSet();
168 afx_msg void OnButtonVegetableRemove();
169 afx_msg void OnButtonVegetableSaveDesc();
170 afx_msg void OnButtonVegetableSaveSet();
171 afx_msg void OnButtonVegetableAppendSet();
172 afx_msg void OnButtonVegetableCopy();
173 afx_msg void OnButtonVegetableRefresh();
174 afx_msg void OnCheckVegetableShow();
175 afx_msg void OnButtonVegetableSetupWind();
176 afx_msg void OnCheckVegetableAutomatic();
177 afx_msg void OnCheckVegetableEnable();
178 afx_msg void OnCheckVegetableSnaptoground();
179 //}}AFX_MSG
180 DECLARE_MESSAGE_MAP()
183 //{{AFX_INSERT_LOCATION}}
184 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
186 #endif // !defined(AFX_VEGETABLE_DLG_H__4E65E757_88C9_4FCE_94CC_9E429D8DFD68__INCLUDED_)