OROCHI
 
Loading...
Searching...
No Matches
GxToolMotionInterpolationNew.h
Go to the documentation of this file.
1//===========================================================================
8//
9//===========================================================================
10#pragma once
11
12#if GX_EDITOR
13
14GX_MOTION_NAMESPACE_BEGIN()
15
16//===========================================================================
18//===========================================================================
19class GxToolMotionInterpolationNew : public GxToolResourceEditBase
20{
21 //-----------------------------------------------------------
23 //-----------------------------------------------------------
25public:
26 // RTTI定義
27 GX_RTTI_CLASS_NAME_ICON(GxToolMotionInterpolationNew, GxToolResourceEditBase, "モーション補間編集", GxRtti::ICON_TYPE::MOTION)
28 GX_PROHIBIT_CLASS_BASE_REFERENCE( GxToolMotionInterpolationNew )
29private:
31 static constexpr u32 OFFSET_MOTION_LIST = 635;
33 static constexpr u32 OFFSET_FILE_PATH = 70;
35 static constexpr u32 OFFSET_BUTTON_PANEL = 135;
37 static constexpr u32 OFFSET_FILTER_PANEL = 160;
39 static constexpr u32 MASK_FILTER = static_cast<u32>(0x01) << 15;
41 static constexpr u32 MOTION_FILTER_NAME_MAX_COUNT = GxMath::VALUE_512;
42
43private:
44 class UnitPreviewCharacter;
45 class GxGuiFormControl;
46 class GxGuiPropertyTableMotion;
47 class GxGuiPropertyTableFilter;
48 class GxGuiPropertyTableFilterPreview;
49
51 //-----------------------------------------------------------
53 //-----------------------------------------------------------
55public:
57 GxToolMotionInterpolationNew(void);
59 void cleanup(void) override;
61 b32 initialize( void ) override;
62
64 //-----------------------------------------------------------
66 //-----------------------------------------------------------
68private:
70 void save(void) override;
72 void convertAs( u32 attribute ) override;
74 void convert( void ) override;
76 void setResource(GxResBase* pRes) override;
78 void setResourceModel( GxResModel* pResModel );
80 void setResourceMotionPackage( GxResMotionPackage* pResMotionPackage );
82 void setResourceMotionInterpolationSettingsXml( GxResMotionInterpolationSettingsXml* pResInterpolation );
84 void updateMotionNumberFromInterpolateMode(void);
86 void updateInterpolateModeFromMotionNumber(void);
87
88public:
90 void onCreate(void) override;
92 void update(void) override;
94 void addMenuOwnProperty(GxPropertyTable& table) override;
96 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
97private:
99 static GxString removeReservedCharacters(GxString string);
101 void createUnitModel(void);
103 void changeMotion(s32 motionNumber);
105 b32 createGuiFilePath(void);
107 void createGuiMotionTable(void);
109 void createGuiFilterTable(void);
111 void eventButtonCreateInterpolationSetting(void);
113 void createInterpolationSettingsResource(void);
115 void updateFilterMotionNameListForMotionTable(void);
117 void clearMaskFliterBit(void);
118
120 //-----------------------------------------------------------
122 //-----------------------------------------------------------
124public:
126 constexpr void getPropertyResModel(void* const pValue) { *static_cast<GxResModel**>(pValue) = _pResModel; }
128 void setPropertyResModel(const void* const pValue);
130 constexpr void getPropertyGxResMotionPackage(void* const pValue) { *static_cast<GxResMotionPackage**>(pValue) = _pResMotionPackage; }
132 void setPropertyGxResMotionPackage(const void* const pValue);
134 constexpr void getPropertyResMotionInterpolationSettingsXml(void* const pValue) { *static_cast<GxResMotionInterpolationSettingsXml**>(pValue) = _pResMotionInterpolationSettingsXml; }
136 void setPropertyResMotionInterpolationSettingsXml(const void* const pValue);
138 void getPropertyResMotionInterpolationSettingDefault(void* const pValue);
140 void setPropertyResMotionInterpolationSettingDefault(const void* const pValue);
142 void getPropertyInterpolateXTranslate(const void* pValue);
144 void getPropertyInterpolateYTranslate(const void* pValue);
146 void getPropertyInterpolateZTranslate(const void* pValue);
148 void getPropertyInterpolatePosition(const void* pValue);
150 void getPropertyInterpolateRotate(const void* pValue);
152 void getPropertyInterpolateScale(const void* pValue);
154 void setPropertyInterpolateXTranslate(const void* pValue);
156 void setPropertyInterpolateYTranslate(const void* pValue);
158 void setPropertyInterpolateZTranslate(const void* pValue);
160 void setPropertyInterpolatePosition(const void* pValue);
162 void setPropertyInterpolateRotate(const void* pValue);
164 void setPropertyInterpolateScale(const void* pValue);
165
166public:
168 constexpr GxUnitMotion* getModel(void) const { return _pUnitModel; }
170 constexpr GxResMotionInterpolationSettingsXml* getResMotionInterpolationSettingsXml(void){ return _pResMotionInterpolationSettingsXml; }
172 GX_FORCE_INLINE GxMotionNamesList* getMotionNamesList(void){ return &_motionNamesList; }
174 constexpr GxGuiFormControl* getFormContrl(void){ return _pFormControl; }
176 constexpr GxGuiPropertyTableMotion* getMotionTable(void){ return _pMotionTable; }
178 constexpr GX_ENUM* getMotionFilterNameEnum(void){ return _motionFilterNameEnum; }
180 constexpr u32 getMotionFilterNameCount(void){ return _motionFilterNameCount; }
182 GxMotionInterpolationSetting* getUselessInterpolationObject(u32 start, u32 target);
183
185 //-----------------------------------------------------------
187 //-----------------------------------------------------------
189private:
190 GxResModel* _pResModel;
191 GxUnitMotion* _pUnitModel;
192 GxResMotionPackage* _pResMotionPackage;
193 GxResMotionInterpolationSettingsXml* _pResMotionInterpolationSettingsXml;
194 GxMotionNamesList _motionNamesList;
195 GxArray _filterNamesList;
196 GX_ENUM _motionFilterNameEnum[MOTION_FILTER_NAME_MAX_COUNT];
197 u32 _motionFilterNameCount;
198 GxString _interpolationDialogPath;
199 GxGuiSplitter* _pSplitterFile;
200 GxGuiSplitter* _pSplitterFilter;
201 GxGuiSplitter* _pSplitterFilterName;
202 GxGuiFormControl* _pFormControl;
203 GxGuiPropertyTableMotion* _pMotionTable;
204 GxGuiPropertyTableFilter* _pFilterTable;
205 GxGuiPropertyTableFilterPreview* _pFormFilterPreview;
206 GxMotionInterpolationSetting* _pOldSelectInterpolateObject;
207
209};
210
211//===========================================================================
213//===========================================================================
214class GxToolMotionInterpolationNew::GxGuiFormControl : public GxGuiForm
215{
216 //-----------------------------------------------------------
218 //-----------------------------------------------------------
220public:
221 // RTTI定義
222 GX_RTTI_CLASS(GxToolMotionInterpolationNew::GxGuiFormControl, GxGuiForm)
223 // GxClassBaseReference継承クラス用禁止宣言
224 GX_PROHIBIT_CLASS_BASE_REFERENCE( GxGuiFormControl )
225
226
227 //-----------------------------------------------------------
229 //-----------------------------------------------------------
231public:
233 GxGuiFormControl(GxToolMotionInterpolationNew* pRoot = nullptr);
235 b32 initialize( void ) override;
236
238 //-----------------------------------------------------------
240 //-----------------------------------------------------------
242public:
244 void onDraw( void ) override;
246 void createMotionGui(void);
248 void update(void) override;
250 void pushButtonPlay(void);
252 void onPlay (void);
254 void offPlay(void);
256 void addFrame(f32 addFrame);
258 void eventAddInterpolationSettings(void);
260 void pushButtonTop(void);
262 void pushButtonBottom(void);
264 void pushButtonBack(void);
266 void pushButtonForward(void);
267
269 //-----------------------------------------------------------
271 //-----------------------------------------------------------
273public:
275 constexpr GxUnitMotion* getModel(void) const { if(!_pRoot){ return nullptr; } return _pRoot->getModel(); }
277 GX_FORCE_INLINE b32 isPlay(void) const { return _isMotionPlaying; }
279 constexpr f32 getDefaultMotionInterpFrame(void) const { return _defaultMotionInterpolateFrame; }
281 constexpr void setDefaultMotionInterpFrame(f32 defaultMotionInterpolateFrame){ _defaultMotionInterpolateFrame = defaultMotionInterpolateFrame; }
283 constexpr INTERPOLATE getDefaultMotionInterpType(void) const { return _defaultMotionInterpolateType; }
285 constexpr void setDefaultMotionInterpType(INTERPOLATE defaultMotionInterpolateType){ _defaultMotionInterpolateType = defaultMotionInterpolateType; }
287 constexpr f32 getDefaultMotionInterpCurvaturep(void) const { return _defaultMotionInterpolateCurvaturep; }
289 constexpr void setDefaultMotionInterpCurvaturep(f32 defaultMotionInterpolateCurvaturep){ _defaultMotionInterpolateCurvaturep = defaultMotionInterpolateCurvaturep; }
291 constexpr u32 getStartMotionNumber(void) const { return _startMotionNumber; }
293 constexpr void setStartMotionNumber(u32 startMotionNumber){ _startMotionNumber = startMotionNumber; }
295 constexpr u32 getTargetMotionNumber(void) const { return _targetMotionNumber; }
297 constexpr void setTargetMotionNumber(u32 targetMotionNumber){ _targetMotionNumber = targetMotionNumber; }
299 GX_FORCE_INLINE b32 isRequestRemakeTableMotion(void) const { return _isRequestRemakeTableMotion; }
301 constexpr void resetRequestRemakeTableMotion(void){ _isRequestRemakeTableMotion = false; }
302
304 //-----------------------------------------------------------
306 //-----------------------------------------------------------
308private:
309 GxToolMotionInterpolationNew* _pRoot;
310 GxGuiPropertyComboBoxEnum* _pGuiEnumStartMotion;
311 GxGuiPropertyComboBoxEnum* _pGuiEnumTargetMotion;
312 GxGuiButton* _pButtonPlay;
313 f32 _motionSpeed;
314 b32 _isMotionPlaying;
315 f32 _defaultMotionInterpolateFrame;
316 INTERPOLATE _defaultMotionInterpolateType;
317 f32 _defaultMotionInterpolateCurvaturep;
318 u32 _startMotionNumber;
319 u32 _targetMotionNumber;
320 b32 _isRequestRemakeTableMotion;
321
323};
324
325//===========================================================================
327//===========================================================================
328class GxToolMotionInterpolationNew::GxGuiPropertyTableMotion : public gx::core::GxGuiPropertyTable
329{
330 //-----------------------------------------------------------
332 //-----------------------------------------------------------
334public:
335 GX_RTTI_CLASS( GxToolMotionInterpolationNew::GxGuiPropertyTableMotion, gx::core::GxGuiPropertyTable )
336 // GxClassBaseReference継承クラス用禁止宣言
337 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableMotion)
338
339
340 //-----------------------------------------------------------
342 //-----------------------------------------------------------
344private:
346 GxGuiPropertyTableMotion( void ) : _pRoot(nullptr), _pSelectObject(nullptr){}
347public:
349 GxGuiPropertyTableMotion( GxToolMotionInterpolationNew* pTool, const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON );
351
352 //-----------------------------------------------------------
354 //-----------------------------------------------------------
356public:
358 GX_FORCE_INLINE b32 isChange( void ){ return updateObjectList(); }
360 GX_FORCE_INLINE b32 isRequestRemake(void) const { return _isRequestRemake; }
362 constexpr void resetRequestRemake(void){ _isRequestRemake = false; }
364 constexpr GxMotionInterpolationSetting* getEditObject(void) const { return _pSelectObject; }
366 constexpr s32 getSelectStartMotion(void) const { return _pSelectObject ? static_cast<s32>(_pSelectObject->getStartMotionNumber()) : -1; }
368 constexpr s32 getSelectTargetMotion(void) const { return _pSelectObject ? static_cast<s32>(_pSelectObject->getTargetMotionNumber()) : -1; }
369
371 //-----------------------------------------------------------
373 //-----------------------------------------------------------
375private:
377 void onClick( const GxPoint2& position, u32 button ) override;
379 void createPopUpMenu(const GxPoint2& position);
381 void eventDeleteInterpolationSettings(void);
382
384 //-----------------------------------------------------------
386 //-----------------------------------------------------------
388private:
389 GxToolMotionInterpolationNew* _pRoot;
390 GxMotionInterpolationSetting* _pSelectObject;
391 b32 _isRequestRemake;
392
394};
395
396//===========================================================================
398//===========================================================================
399class GxToolMotionInterpolationNew::GxGuiPropertyTableFilter : public gx::core::GxGuiPropertyTable
400{
401 //-----------------------------------------------------------
403 //-----------------------------------------------------------
405public:
406 GX_RTTI_CLASS( GxToolMotionInterpolationNew::GxGuiPropertyTableFilter, gx::core::GxGuiPropertyTable )
407 // GxClassBaseReference継承クラス用禁止宣言
408 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableFilter)
409
410
411 //-----------------------------------------------------------
413 //-----------------------------------------------------------
415private:
417 GxGuiPropertyTableFilter( void ) : _pRoot(nullptr), _pSelectObject(nullptr), _pOldSelectObject(nullptr){}
418public:
420 GxGuiPropertyTableFilter( GxToolMotionInterpolationNew* pTool, const GxProperty& property, GxTypedObject* pObject , u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON );
421
423 //-----------------------------------------------------------
425 //-----------------------------------------------------------
427public:
429 void update(void) override;
430private:
432 void onClick( const GxPoint2& position, u32 button ) override;
434 void createPopUpMenu(const GxPoint2& position);
436 void eventAddFilterSettings(void);
438 void eventDeleteFilterSettings(void);
440 void eventAddMotionToFilter(u32 motionNumber);
442 void eventDeleteMotionToFilter(u32 motionNumber);
443
445 //-----------------------------------------------------------
447 //-----------------------------------------------------------
449public:
451 GX_FORCE_INLINE b32 isRename( void ){ return _isRename; }
453 GX_FORCE_INLINE b32 isRequestRemakeOwn(void){ return _isRequestRemakeOwn; }
455 constexpr void resetRequestRemakeOwn(void){ _isRequestRemakeOwn = false; }
457 GX_FORCE_INLINE b32 isRequestRemakeTableMotion(void){ return _isRequestRemakeTableMotion; }
459 constexpr void resetRequestRemakeTableMotion(void){ _isRequestRemakeTableMotion = false; }
461 constexpr void setMotionNumberForFilter(u32 motionNumberForFilter){ _motionNumberForFilter = motionNumberForFilter; }
463 constexpr u32 getMotionNumberForFilter(void){ return _motionNumberForFilter; }
465 constexpr GxResMotionInterpolationSettings::Filter* getEditObject(void){ return _pSelectObject; }
466
468 //-----------------------------------------------------------
470 //-----------------------------------------------------------
472private:
473 GxToolMotionInterpolationNew* _pRoot;
475 u32 _motionNumberForFilter;
476 b32 _isRequestRemakeOwn;
477 b32 _isRequestRemakeTableMotion;
478 b32 _isRename;
479 GxString _oldSelectObjectString;
481
483};
484
485//===========================================================================
487//===========================================================================
488class GxToolMotionInterpolationNew::GxGuiPropertyTableFilterPreview : public GxGuiForm
489{
490 //-----------------------------------------------------------
492 //-----------------------------------------------------------
494public:
495 GX_RTTI_CLASS( GxToolMotionInterpolationNew::GxGuiPropertyTableFilterPreview, GxGuiForm )
496 // GxClassBaseReference継承クラス用禁止宣言
497 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableFilterPreview)
498
499
500 //-----------------------------------------------------------
502 //-----------------------------------------------------------
504public:
506 GxGuiPropertyTableFilterPreview( void ) : _pRoot(nullptr), _pSelectData(nullptr){}
508 GxGuiPropertyTableFilterPreview( GxToolMotionInterpolationNew* pRoot);
509
511 //-----------------------------------------------------------
513 //-----------------------------------------------------------
515public:
517 void onDraw( void ) override;
519 void onSize( const GxSize& size ) override;
520
522 //-----------------------------------------------------------
524 //-----------------------------------------------------------
526public:
528 constexpr void setPreviewObject(GxResMotionInterpolationSettings::Filter* pSelectData){ _pSelectData = pSelectData;}
529
531 //-----------------------------------------------------------
533 //-----------------------------------------------------------
535private:
536 GxToolMotionInterpolationNew* _pRoot;
538 s32 _formWidth;
539
541};
542
543GX_MOTION_NAMESPACE_END()
544#endif // GX_EDITOR
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
void GxTypedObject
その他
Definition GxDefine.h:213
INTERPOLATE
補間タイプ
Definition GxMotionDefine.h:17
配列クラス
Definition GxArray.h:18
static constexpr u32 VALUE_512
512
Definition GxMath.h:128
モーションの補間設定を保管するクラス
Definition GxMotionInterpolationSetting.h:19
プロパティクラス
Definition GxProperty.h:48
プロパティテーブルクラス
Definition GxProperty.h:1641
リソース基底クラス
Definition GxResBase.h:23
モデルリソースクラス
Definition GxResModel.h:20
フィルター
Definition GxResMotionInterpolationSettings.h:32
モーションパッケージリソース
Definition GxResMotionPackage.h:20
実行時型情報クラス
Definition GxRtti.h:154
モーションユニット
Definition GxUnitMotion.h:20
GUI用
Definition GxDefine.h:194
座標
Definition GxStruct.h:867
サイズ
Definition GxStruct.h:730
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173