Linux multi-monitor fullscreen support
[ryzomcore.git] / nel / tools / 3d / object_viewer / located_bindable_dialog.h
blobe587b1a2070884b0846c7b5ad7ec8b0d616a976a
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_LOCATED_BINDABLE_DIALOG_H__C715DCAB_3F07_4777_96DA_61AE2E420B09__INCLUDED_)
18 #define AFX_LOCATED_BINDABLE_DIALOG_H__C715DCAB_3F07_4777_96DA_61AE2E420B09__INCLUDED_
20 #if _MSC_VER > 1000
21 #pragma once
22 #endif
24 namespace NL3D
26 class CPSLocatedBindable;
31 #include "nel/misc/rgba.h"
33 #include "nel/3d/texture.h"
34 #include "nel/3d/ps_plane_basis.h"
35 #include "nel/3d/particle_system.h"
36 #include "nel/3d/ps_particle.h"
37 #include "nel/3d/ps_particle2.h"
39 #include "ps_wrapper.h"
40 #include "dialog_stack.h"
42 using NLMISC::CRGBA;
44 class CParticleDlg;
48 /////////////////////////////////////////////////////////////////////////////
49 // CLocatedBindableDialog dialog
51 class CLocatedBindableDialog : public CDialog, CDialogStack
53 // Construction
54 public:
55 // create this dialog to edit the given bindable
56 CLocatedBindableDialog(CParticleWorkspace::CNode *ownerNode, NL3D::CPSLocatedBindable *bindable); // standard constructor
58 /// dtor
59 ~CLocatedBindableDialog();
62 // init the dialog as a child of the given wnd
63 void init(CParticleDlg* pParent);
64 // Dialog Data
65 //{{AFX_DATA(CLocatedBindableDialog)
66 enum { IDD = IDD_LOCATED_BINDABLE };
67 CEdit m_ZBias;
68 CComboBox m_BlendingMode;
69 BOOL m_IndependantSizes;
70 //}}AFX_DATA
73 // Overrides
74 // ClassWizard generated virtual function overrides
75 //{{AFX_VIRTUAL(CLocatedBindableDialog)
76 protected:
77 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
78 //}}AFX_VIRTUAL
83 // Implementation
84 protected:
86 // enables or disabled controls for independant sizes
87 void updateIndependantSizes(void);
88 // update zbias from edit box & display error mb if needed
89 void updateZBias();
90 /// create the size control, or update it if it has been created. It returns the heivht of the control
91 uint updateSizeControl();
93 CParticleWorkspace::CNode *_Node;
94 NL3D::CPSLocatedBindable *_Bindable; // the bindable being edited
95 CParticleDlg *_ParticleDlg; // the dialog that owns us
96 class CAttribDlgFloat *_SizeCtrl; // the control used for size
97 sint _SizeCtrlX; // x position of the control used for size
98 sint _SizeCtrlY; // x position of the control used for size
100 // look at specific : pointer on windows to edit motion blur params
101 std::vector<CWnd *> _MotionBlurWnd;
104 // Generated message map functions
105 //{{AFX_MSG(CLocatedBindableDialog)
106 afx_msg void OnSelchangeBlendingMode();
107 afx_msg void OnIndeSizes();
108 afx_msg void OnSizeWidth();
109 afx_msg void OnSizeHeight();
110 afx_msg void OnNoAutoLod();
111 afx_msg void OnGlobalColorLighting();
112 afx_msg void OnAlignOnMotion();
113 afx_msg void OnZtest();
114 afx_msg void OnChangeZbias();
115 afx_msg void OnKillfocusZbias();
116 afx_msg void OnZalign();
117 //}}AFX_MSG
118 DECLARE_MESSAGE_MAP()
121 //////////////////////////////////////////////
122 // wrappers to various element of bindables //
123 //////////////////////////////////////////////
125 //////////
126 // size //
127 //////////
128 struct CSizeWrapper : public IPSWrapperFloat, IPSSchemeWrapperFloat
130 NL3D::CPSSizedParticle *S;
131 float get(void) const { return S->getSize(); }
132 void set(const float &v) { S->setSize(v); }
133 scheme_type *getScheme(void) const { return S->getSizeScheme(); }
134 void setScheme(scheme_type *s) { S->setSizeScheme(s); }
135 } _SizeWrapper;
137 ///////////
138 // color //
139 ///////////
140 struct CColorWrapper : public IPSWrapperRGBA, IPSSchemeWrapperRGBA
142 NL3D::CPSColoredParticle *S;
143 CRGBA get(void) const { return S->getColor(); }
144 void set(const CRGBA &v) { S->setColor(v); }
145 scheme_type *getScheme(void) const { return S->getColorScheme(); }
146 void setScheme(scheme_type *s) { S->setColorScheme(s); }
147 } _ColorWrapper;
149 //////////////
150 // angle 2D //
151 //////////////
152 struct CAngle2DWrapper : public IPSWrapperFloat, IPSSchemeWrapperFloat
154 NL3D::CPSRotated2DParticle *S;
155 float get(void) const { return S->getAngle2D(); }
156 void set(const float &v) { S->setAngle2D(v); }
157 scheme_type *getScheme(void) const { return S->getAngle2DScheme(); }
158 void setScheme(scheme_type *s) { S->setAngle2DScheme(s); }
159 } _Angle2DWrapper;
161 /////////////////
162 // plane basis //
163 /////////////////
164 struct CPlaneBasisWrapper : public IPSWrapper<NL3D::CPlaneBasis>, IPSSchemeWrapper<NL3D::CPlaneBasis>
166 NL3D::CPSRotated3DPlaneParticle *S;
167 NL3D::CPlaneBasis get(void) const { return S->getPlaneBasis(); }
168 void set(const NL3D::CPlaneBasis &p) { S->setPlaneBasis(p); }
169 scheme_type *getScheme(void) const { return S->getPlaneBasisScheme(); }
170 void setScheme(scheme_type *s) { S->setPlaneBasisScheme(s); }
171 } _PlaneBasisWrapper;
176 ///////////////////////
177 // motion blur coeff //
178 ///////////////////////
180 struct CMotionBlurCoeffWrapper : public IPSWrapperFloat
182 NL3D::CPSFaceLookAt *P;
183 float get(void) const { return P->getMotionBlurCoeff(); }
184 void set(const float &v) { P->setMotionBlurCoeff(v); }
185 } _MotionBlurCoeffWrapper;
187 struct CMotionBlurThresholdWrapper : public IPSWrapperFloat
189 NL3D::CPSFaceLookAt *P;
190 float get(void) const { return P->getMotionBlurThreshold(); }
191 void set(const float &v) { P->setMotionBlurThreshold(v); }
192 } _MotionBlurThresholdWrapper;
194 ///////////////
195 // fanlight //
196 ///////////////
197 struct CFanLightWrapper : public IPSWrapperUInt
199 NL3D::CPSFanLight *P;
200 uint32 get(void) const { return P->getNbFans(); }
201 void set(const uint32 &v) { P->setNbFans(v); }
202 } _FanLightWrapper;
204 struct CFanLightSmoothnessWrapper : public IPSWrapperUInt
206 NL3D::CPSFanLight *P;
207 uint32 get(void) const { return P->getPhaseSmoothness(); }
208 void set(const uint32 &v) { P->setPhaseSmoothness(v); }
209 } _FanLightSmoothnessWrapper;
211 struct CFanLightPhase : public IPSWrapperFloat
213 NL3D::CPSFanLight *P;
214 float get(void) const { return P->getPhaseSpeed(); }
215 void set(const float &v) { P->setPhaseSpeed(v); }
216 } _FanLightPhaseWrapper;
217 struct CFanLightIntensityWrapper : public IPSWrapperFloat
219 NL3D::CPSFanLight *P;
220 float get(void) const { return P->getMoveIntensity(); }
221 void set(const float &v) { P->setMoveIntensity(v); }
222 } _FanLightIntensityWrapper;
224 ///////////////////////
225 // ribbon / tail dot //
226 ///////////////////////
228 struct CTailParticleWrapper : public IPSWrapperUInt
230 NL3D::CPSTailParticle *P;
231 uint32 get(void) const { return P->getTailNbSeg(); }
232 void set(const uint32 &v) { P->setTailNbSeg(v); }
233 } _TailParticleWrapper;
235 //////////////////////////////////////
236 // duration of segment for a ribbon //
237 //////////////////////////////////////
238 struct CSegDurationWrapper : public IPSWrapperFloat
240 NL3D::CPSRibbonBase *R;
241 float get(void) const { return R->getSegDuration(); }
242 void set(const float &v) { R->setSegDuration(v); }
243 } _SegDurationWrapper;
245 /////////////////////////////
246 // shockwave //
247 /////////////////////////////
249 struct CRadiusCutWrapper : public IPSWrapperFloat
251 NL3D::CPSShockWave *S;
252 float get(void) const { return S->getRadiusCut(); }
253 void set(const float &v) { S->setRadiusCut(v); }
254 } _RadiusCutWrapper;
256 struct CShockWaveNbSegWrapper : public IPSWrapperUInt
258 NL3D::CPSShockWave *S;
259 uint32 get(void) const { return S->getNbSegs(); }
260 void set(const uint32 &v) { S->setNbSegs(v); }
261 } _ShockWaveNbSegWrapper;
263 struct CShockWaveUFactorWrapper : public IPSWrapperFloat
265 NL3D::CPSShockWave *S;
266 float get(void) const { return S->getUFactor(); }
267 void set(const float &v) { S->setUFactor(v); }
268 } _ShockWaveUFactorWrapper;
271 ////////////////////////
272 // unanimated texture //
273 ////////////////////////
275 struct CTextureNoAnimWrapper : public IPSWrapperTexture
277 NL3D::CPSTexturedParticleNoAnim *TP;
278 virtual NL3D::ITexture *get(void) { return TP->getTexture(); }
279 virtual void set(NL3D::ITexture *t) { TP->setTexture(t); }
280 } _TextureNoAnimWrapper;
282 //////////////////////////////
283 // u / v factors for ribbon //
284 //////////////////////////////
286 struct CRibbonUFactorWrapper : public IPSWrapperFloat
288 NL3D::CPSRibbon *R;
289 float get(void) const { return R->getUFactor(); }
290 void set(const float &u) { R->setTexFactor(u, R->getVFactor()); }
291 } _RibbonUFactorWrapper;
293 struct CRibbonVFactorWrapper : public IPSWrapperFloat
295 NL3D::CPSRibbon *R;
296 float get(void) const { return R->getVFactor(); }
297 void set(const float &v) { R->setTexFactor(R->getUFactor(), v); }
298 } _RibbonVFactorWrapper;
300 void updateModifiedFlag() { if (_Node) _Node->setModified(true); }
301 void touchPSState();
302 void updateValidWndForAlignOnMotion(bool align);
305 //{{AFX_INSERT_LOCATION}}
306 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
308 #endif // !defined(AFX_LOCATED_BINDABLE_DIALOG_H__C715DCAB_3F07_4777_96DA_61AE2E420B09__INCLUDED_)