Added aqua_speed for rite geo 50 tryker
[ryzomcore.git] / nel / tools / 3d / object_viewer / texture_anim_dlg.h
blob3a05fcc258f44011f4d5cce50764c26a662292ce
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_TEXTURE_ANIM_DLG_H__4A689FB0_93B9_4F5A_8075_8006D8FD19B2__INCLUDED_)
18 #define AFX_TEXTURE_ANIM_DLG_H__4A689FB0_93B9_4F5A_8075_8006D8FD19B2__INCLUDED_
20 #if _MSC_VER > 1000
21 #pragma once
22 #endif
24 #include "ps_wrapper.h"
25 #include "nel/3d/ps_particle.h"
26 #include "value_gradient_dlg.h"
27 #include "popup_notify.h"
28 #include "particle_workspace.h"
30 namespace NL3D
32 class CPSTexturedParticle;
33 class CPSMultiTexturedParticle;
37 class CTextureChooser;
38 class CAttribDlgInt;
39 class CValueGradientDlg;
40 class CMultiTexDlg;
42 /////////////////////////////////////////////////////////////////////////////
43 // CTextureAnimDlg dialog
45 class CTextureAnimDlg : public CDialog, IPopupNotify
47 // Construction
48 public:
49 CTextureAnimDlg(CParticleWorkspace::CNode *ownerNode, NL3D::CPSTexturedParticle *p, NL3D::CPSMultiTexturedParticle *mtp = NULL); // standard constructor
50 ~CTextureAnimDlg();
52 void init(sint x, sint y, CWnd *pParent);
53 // Dialog Data
54 //{{AFX_DATA(CTextureAnimDlg)
55 enum { IDD = IDD_TEXTURE_ANIM };
56 CButton m_ChooseTextures;
57 BOOL m_EnableTextureAnim;
58 BOOL m_MultiTexEnable;
59 //}}AFX_DATA
62 BOOL EnableWindow( BOOL bEnable);
64 // Overrides
65 // ClassWizard generated virtual function overrides
66 //{{AFX_VIRTUAL(CTextureAnimDlg)
67 protected:
68 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
69 //}}AFX_VIRTUAL
71 // Implementation
72 protected:
73 NL3D::CPSTexturedParticle *_EditedParticle;
74 NL3D::CPSMultiTexturedParticle *_MTP;
75 CParticleWorkspace::CNode *_Node;
76 // dialog to choose a constant texture
77 CTextureChooser *_TextureChooser;
78 // dialog to have a theme or constant value for texture id
79 CAttribDlgInt *_TextureIndexDialog;
80 CMultiTexDlg *_MultiTexDlg;
81 // Generated message map functions
82 //{{AFX_MSG(CTextureAnimDlg)
83 afx_msg void OnChooseTextures();
84 afx_msg void OnEnableTextureAnim();
85 afx_msg void OnMultiTex();
86 afx_msg void OnEditMultitex();
87 //}}AFX_MSG
88 DECLARE_MESSAGE_MAP()
89 // delete created controls
90 void cleanCtrl(void);
91 // create the right controls, depending on the fact that a an,imated texture is used or not
92 void setupCtrl(void);
93 //////////////////////////////////
94 // wrapper for single texture //
95 //////////////////////////////////
97 struct CTextureWrapper : public IPSWrapperTexture
99 NL3D::CPSTexturedParticle *P;
100 NL3D::ITexture *get(void) { return P->getTexture(); }
101 void set(NL3D::ITexture *t) { P->setTexture(t); }
102 } _TextureWrapper;
104 ///////////////////////////////////////
105 // wrapper for texture anim sequence //
106 ///////////////////////////////////////
108 struct CTextureIndexWrapper : public IPSWrapper<sint32>, IPSSchemeWrapper<sint32>
110 NL3D::CPSTexturedParticle *P;
111 sint32 get(void) const { return P->getTextureIndex(); }
112 void set(const sint32 &v) { P->setTextureIndex(v); }
113 scheme_type *getScheme(void) const { return P->getTextureIndexScheme(); }
114 void setScheme(scheme_type *s) { P->setTextureIndexScheme(s); }
115 } _TextureIndexWrapper;
118 * the implementation of this struct tells the gradient dialog bow how to edit a texture list
121 struct CGradientInterface : public IValueGradientDlgClient
123 // the particle being edited
124 CValueGradientDlg *Dlg;
125 NL3D::CPSTexturedParticle *P;
126 // all method inherited from IValueGradientDlgClient
127 virtual CEditAttribDlg *createDialog(uint index, CValueGradientDlg *grad, CParticleWorkspace::CNode *ownerNode);
128 virtual void modifyGradient(TAction, uint index);
129 virtual void displayValue(CDC *dc, uint index, sint x, sint y);
130 virtual uint32 getSchemeSize(void) const;
131 virtual uint32 getNbSteps(void) const;
132 virtual void setNbSteps(uint32 value);
134 /////////////////////////////////////////////////
135 // wrapper for the texture chooser //
136 // that allows to choose a texture in the list //
137 /////////////////////////////////////////////////
139 struct CTextureWrapper : public IPSWrapperTexture
141 CValueGradientDlg *Dlg;
142 NL3D::CPSTexturedParticle *P;
143 // index of the particle in the list
144 uint32 Index;
145 NL3D::ITexture *get(void);
146 void set(NL3D::ITexture *t);
147 } _TextureWrapper;
149 } _GradientInterface;
152 /// inherited from IPopuNotify
153 void childPopupClosed(CWnd *child);
154 void updateModifiedFlag() { if (_Node) _Node->setModified(true); }
157 //{{AFX_INSERT_LOCATION}}
158 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
160 #endif // !defined(AFX_TEXTURE_ANIM_DLG_H__4A689FB0_93B9_4F5A_8075_8006D8FD19B2__INCLUDED_)