Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / object_viewer / located_properties.h
blob27251835033b74ee3a10640017be545ae0485acc
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/>.
18 #if !defined(AFX_LOCATED_PROPERTIES_H__772D6C3B_6CFD_47B5_A132_A8D2352EACF9__INCLUDED_)
19 #define AFX_LOCATED_PROPERTIES_H__772D6C3B_6CFD_47B5_A132_A8D2352EACF9__INCLUDED_
21 #if _MSC_VER > 1000
22 #pragma once
23 #endif // _MSC_VER > 1000
24 // located_properties.h : header file
26 #include "editable_range.h"
27 #include "particle_tree_ctrl.h"
28 #include "dialog_stack.h"
29 #include "start_stop_particle_system.h"
30 #include "particle_workspace.h"
32 namespace NL3D
34 class CPSLocated;
35 };
38 class CAttribDlgFloat;
40 /////////////////////////////////////////////////////////////////////////////
41 // CLocatedProperties dialog
43 class CLocatedProperties : public CDialog, public CObjectViewer::IMainLoopCallBack
45 // Construction
46 public:
47 CLocatedProperties(CParticleWorkspace::CNode *node, NL3D::CPSLocated *loc, CParticleDlg *pdlg); // standard constructor
49 ~CLocatedProperties();
51 void init(uint32 x, uint32 y);
53 CEditableRangeUInt *getParticleCountDlg() const { return _MaxNbParticles; }
55 // Dialog Data
56 //{{AFX_DATA(CLocatedProperties)
57 enum { IDD = IDD_LOCATED_PROPERTIES };
58 CButton m_EditTriggerOnDeath;
59 CButton m_TriggerOnDeathCtrl;
60 CButton m_ParametricMotionCtrl;
61 CStatic m_MaxNbParticles;
62 BOOL m_LimitedLifeTime;
63 BOOL m_SystemBasis;
64 BOOL m_DisgradeWithLOD;
65 BOOL m_ParametricIntegration;
66 BOOL m_ParametricMotion;
67 BOOL m_TriggerOnDeath;
68 int m_MatrixMode;
69 //}}AFX_DATA
72 // Overrides
73 // ClassWizard generated virtual function overrides
74 //{{AFX_VIRTUAL(CLocatedProperties)
75 protected:
76 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
77 //}}AFX_VIRTUAL
79 // Implementation
80 protected:
81 CParticleWorkspace::CNode *_Node;
83 CEditableRangeUInt *_MaxNbParticles;
84 CEditableRangeUInt *_SkipFramesDlg;
86 CAttribDlgFloat *_MassDialog;
87 CAttribDlgFloat *_LifeDialog;
89 CParticleDlg *_ParticleDlg;
90 /// some wrappers used to read / write value from / to the particle system
93 /////////////////////////////////////////////////
94 // wrapper to tune the max number of particles //
95 /////////////////////////////////////////////////
98 struct CMaxNbParticlesWrapper : public IPSWrapperUInt
100 CParticleWorkspace::CNode *Node;
101 NL3D::CPSLocated *Located;
102 CParticleTreeCtrl *TreeCtrl;
103 uint32 get(void) const { return Located->getMaxSize(); }
104 void set(const uint32 &v)
106 // if the max new size is lower than the current number of instance, we must suppress item
107 // in the CParticleTreeCtrl
109 if (v < Located->getSize())
111 nlassert(Node);
112 TreeCtrl->suppressLocatedInstanceNbItem(*Node, v);
115 Located->resize(v);
117 } _MaxNbParticlesWrapper;
120 /////////////////////////////////////////////////
121 // wrapper to tune the mass of particles //
122 /////////////////////////////////////////////////
124 struct CMassWrapper : public IPSWrapperFloat, IPSSchemeWrapperFloat
126 NL3D::CPSLocated *Located;
127 float get(void) const { return Located->getInitialMass(); }
128 void set(const float &v) { Located->setInitialMass(v); }
129 virtual scheme_type *getScheme(void) const { return Located->getMassScheme(); }
130 virtual void setScheme(scheme_type *s) { Located->setMassScheme(s); }
131 } _MassWrapper;
133 struct CLifeWrapper : public IPSWrapperFloat, IPSSchemeWrapperFloat
135 CStartStopParticleSystem *SSPS;
136 NL3D::CPSLocated *Located;
137 CParticleWorkspace::CNode *Node;
138 float get(void) const { return Located->getInitialLife(); }
139 void set(const float &v) { Located->setInitialLife(v); SSPS->resetAutoCount(Node); }
140 virtual scheme_type *getScheme(void) const { return Located->getLifeScheme(); }
141 virtual void setScheme(scheme_type *s) { Located->setLifeScheme(s); SSPS->resetAutoCount(Node); }
142 } _LifeWrapper;
145 // the located this dialog is editing
146 NL3D::CPSLocated *_Located;
149 /// update the integrable check box
150 void updateIntegrable(void);
152 /// update the 'trigger on death' control
153 void updateTriggerOnDeath(void);
155 // from CObjectViewer::IMainLoopCallBack
156 virtual void goPostRender();
157 virtual void goPreRender() {}
160 // Generated message map functions
161 //{{AFX_MSG(CLocatedProperties)
162 virtual BOOL OnInitDialog();
163 afx_msg void OnLimitedLifeTime();
164 afx_msg void OnSystemBasis();
165 afx_msg void OnDisgradeWithLod();
166 afx_msg void OnParametricMotion();
167 afx_msg void OnEditTriggerOnDeath();
168 afx_msg void OnTriggerOnDeath();
169 afx_msg void OnAssignCount();
170 afx_msg void OnSelchangeMatrixMode();
171 //}}AFX_MSG
172 DECLARE_MESSAGE_MAP()
174 void touchPSState();
177 //{{AFX_INSERT_LOCATION}}
178 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
180 #endif // !defined(AFX_LOCATED_PROPERTIES_H__772D6C3B_6CFD_47B5_A132_A8D2352EACF9__INCLUDED_)