OROCHI
 
Loading...
Searching...
No Matches
GxToolMotionViewer.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 GxToolMotionViewer : public GxToolResourceEditBase
20{
21 //-----------------------------------------------------------
23 //-----------------------------------------------------------
25public:
26 // RTTI定義
27 GX_RTTI_CLASS_NAME_ICON(GxToolMotionViewer, GxToolResourceEditBase, "モーションビューワ編集", GxRtti::ICON_TYPE::MOTION)
28 // ClassBase禁止宣言
29 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxToolMotionViewer);
30private:
32 static constexpr u32 OFFSET_CENTER = 255;
34 static constexpr u32 OFFSET_FILE_PATH = 70;
36 static constexpr u32 OFFSET_MOTION_NAME = 170;
37
38 class UnitForMotionViewer;
39 class GxGuiFormControl;
40 class GxGuiPropertyTableMotionSyncParam;
41 class GxGuiPropertyTableChildUnitParam;
42 class GxGuiPropertyTableMotionPlayParam;
43
45 //-----------------------------------------------------------
47 //-----------------------------------------------------------
49public:
51 GxToolMotionViewer(void);
53 void cleanup(void) override;
55 b32 initialize( void ) override;
56
58 //-----------------------------------------------------------
60 //-----------------------------------------------------------
62private:
64 void convert( void ) override;
66 void setResource(GxResBase* pRes) override;
68 GX_FORCE_INLINE GxResMotionViewerXml* getResMotionViewerXml(void){ return gx_cast<GxResMotionViewerXml*>( getResource() ); }
70 void setResourceModel( GxResModel* pResModel );
72 void setResourceMotionPackage( GxResMotionPackage* pResMotionPackage );
74 void setResourceMotionInterpolationSettings( GxResMotionInterpolationSettingsXml* pResInterpolation );
75
77 //-----------------------------------------------------------
79 //-----------------------------------------------------------
81public:
83 constexpr void getPropertyParentResModel(void* const pValue) { *static_cast<GxResModel**>(pValue) = _pParentResModel; }
85 void setPropertyParentResModel(const void* const pValue);
87 constexpr void getPropertyParentResMotionPackage(void* const pValue) { *static_cast<GxResMotionPackage**>(pValue) = _pParentResMotionPackage; }
89 void setPropertyParentResMotionPackage(const void* const pValue);
91 constexpr void getPropertyParentResMotionInterpolation(void* const pValue) { *static_cast<GxResMotionInterpolationSettingsXml**>(pValue) = _pParentResMotionInterpolation; }
93 void setPropertyParentResMotionInterpolation(const void* const pValue);
95 void getPropertyInterpolateXTranslate(const void* pValue);
97 void getPropertyInterpolateYTranslate(const void* pValue);
99 void getPropertyInterpolateZTranslate(const void* pValue);
101 void getPropertyInterpolatePosition(const void* pValue);
103 void getPropertyInterpolateRotate(const void* pValue);
105 void getPropertyInterpolateScale(const void* pValue);
107 void getPropertyInterpolateLoop(const void* pValue);
109 void setPropertyInterpolateXTranslate(const void* pValue);
111 void setPropertyInterpolateYTranslate(const void* pValue);
113 void setPropertyInterpolateZTranslate(const void* pValue);
115 void setPropertyInterpolatePosition(const void* pValue);
117 void setPropertyInterpolateRotate(const void* pValue);
119 void setPropertyInterpolateScale(const void* pValue);
121 void setPropertyInterpolateLoop(const void* pValue);
122
124 //-----------------------------------------------------------
126 //-----------------------------------------------------------
128public:
130 void onCreate(void) override;
132 void onReload (GxGuiBase* pReloadGui, GxResBase* pReloadRes) override;
134 void update(void) override;
136 void addMenuOwnProperty(GxPropertyTable& table ) override;
138 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
140 void createMotionSyncParamTable(u32 category);
142 void deleteMotionSyncParamTable(u32 category);
144 void createChildUnitParamTable(void);
146 void createMotionPlayParamTable(void);
148 constexpr s32 getSelectIdFromTabGui(void) const { if( _pTab ){ return _pTab->getCurrentIndex() - 1; } return -1;}
149private:
151 static GxString removeReservedCharacters(GxString string);
153 b32 createGuiFilePath( void );
154
156 void createParentUnit(void);
158 void updateParentMotion(void);
160 constexpr UnitForMotionViewer* getParentUnit(void) const { return _pParentUnit; }
162 GX_FORCE_INLINE GxMotionNamesList* getParentMotionNamesList(void){ return &_parentMotionNamesList; }
163
164public:
166 void createChildUnit( void );
168 void deleteChildUnit(u32 deleteObjectIndex);
170 void updateChildUnitResource(void);
172 void updateChildUnitMotion(void);
174 constexpr UnitForMotionViewer* getChildUnit(u32 index) const { return _pChildUnit[index]; }
176 GX_FORCE_INLINE GxMotionNamesList* getChildMotionNamesList(u32 index) { return &_childMotionNamesList[index]; }
177
179 //-----------------------------------------------------------
181 //-----------------------------------------------------------
183private:
184 UnitForMotionViewer* _pParentUnit;
185 GxResModel* _pParentResModel;
186 GxResMotionPackage* _pParentResMotionPackage;
187 GxResMotionInterpolationSettingsXml* _pParentResMotionInterpolation;
188 gx::motion::GxMotionNamesList _parentMotionNamesList;
189 GxResMotionViewerXml::MotionPlayCategory::PlayParam* _pUsePlayParam;
190 UnitForMotionViewer* _pChildUnit[GxResMotionViewer::CHILD_UNIT_MAX_COUNT];
191 gx::motion::GxMotionNamesList _childMotionNamesList[GxResMotionViewer::CHILD_UNIT_MAX_COUNT];
192 gx::core::GxGuiSplitter* _pSplitterMain;
193 gx::core::GxGuiSplitter* _pSplitterRight;
194 gx::core::GxGuiSplitter* _pSplitterLeft;
195 GxGuiTab* _pTab;
196 GxString _tabTitle[GxResMotionViewer::CHILD_UNIT_MAX_COUNT];
197 GxGuiFormControl* _pFormControl;
198 GxGuiPropertyTableMotionSyncParam* _pMotionSyncParamTable;
199 GxGuiPropertyTableChildUnitParam* _pChildUnitParamTable;
200 GxGuiPropertyTableMotionPlayParam* _pMotionPlayParamTable;
201
203};
204
205//===========================================================================
207//===========================================================================
208class GxToolMotionViewer::UnitForMotionViewer : public GxUnitMotion
209{
210 //-------------------------------------------------------------
212 //-------------------------------------------------------------
214public:
215 // RTTI定義
216 GX_RTTI_CLASS_NAME(UnitForMotionViewer, GxUnitMotion, "プレビュー用ユニット")
217
218
219 //-----------------------------------------------------------
221 //-----------------------------------------------------------
223public:
225 UnitForMotionViewer(void);
226
228};
229
230//===========================================================================
232//===========================================================================
233class GxToolMotionViewer::GxGuiFormControl : public GxGuiForm
234{
235 //-----------------------------------------------------------
237 //-----------------------------------------------------------
239public:
240 // RTTI定義
241 GX_RTTI_CLASS(GxToolMotionViewer::GxGuiFormControl, GxGuiForm)
242 // GxClassBaseReference継承クラス用禁止宣言
243 GX_PROHIBIT_CLASS_BASE_REFERENCE( GxGuiFormControl );
244
246 static constexpr u32 PREVIEW_MOTION_MAX_COUNT = GxMath::VALUE_16;
247
249 //-----------------------------------------------------------
251 //-----------------------------------------------------------
253public:
255 GxGuiFormControl(GxToolMotionViewer* pRoot = nullptr);
257 b32 initialize( void ) override;
258
260 //-----------------------------------------------------------
262 //-----------------------------------------------------------
264public:
266 void pushButtonPlay(void);
268 void onPlay (void);
270 void offPlay(void);
272 void addFrame(f32 addFrame);
274 void pushButtonTop(void);
276 void pushButtonBottom(void);
278 void pushButtonBack(void);
280 void pushButtonForward(void);
282 void pushButtonShortcutAdd(void);
284 void pushButtonShortcutDelete(void);
285
287 //-----------------------------------------------------------
289 //-----------------------------------------------------------
291public:
293 constexpr UnitForMotionViewer* getParentUnit(void) const { if(!_pRoot){ return nullptr; } return _pRoot->getParentUnit(); }
295 constexpr f32 getMotionSpeed(void) const { return _motionSpeed; }
297 GX_FORCE_INLINE b32 isPlay(void) const { return _isMotionPlaying; }
299 GX_FORCE_INLINE b32 isInterpolation(void) const { return _isInterpolation; }
301 GX_FORCE_INLINE b32 isApplyInterpolationFlag(void) const { return _isApplyInterpolationFlag; }
302
304 //-----------------------------------------------------------
306 //-----------------------------------------------------------
308private:
309 GxToolMotionViewer* _pRoot;
310 GxGuiButton* _pButtonPlay;
311 f32 _motionSpeed;
312 u32 _motionPlayCount;
313 b32 _isMotionPlaying;
314 b32 _isInterpolation;
315 b32 _isApplyInterpolationFlag;
316
318};
319
320//===========================================================================
322//===========================================================================
323class GxToolMotionViewer::GxGuiPropertyTableMotionSyncParam : public gx::core::GxGuiPropertyTable
324{
325 //-----------------------------------------------------------
327 //-----------------------------------------------------------
329public:
330 GX_RTTI_CLASS( GxToolMotionViewer::GxGuiPropertyTableMotionSyncParam, gx::core::GxGuiPropertyTable );
331 // GxClassBaseReference継承クラス用禁止宣言
332 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableMotionSyncParam);
333
335 //-----------------------------------------------------------
337 //-----------------------------------------------------------
339private:
341 GxGuiPropertyTableMotionSyncParam( void ){}
342public:
344 GxGuiPropertyTableMotionSyncParam( GxToolMotionViewer* pTool, const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON );
345
347 //-----------------------------------------------------------
349 //-----------------------------------------------------------
351private:
353 void onClick( const GxPoint2& pos,u32 button ) override;
355 void createPopUpMenu(const GxPoint2& position);
357 void eventDeleteMotionSyncParam(void);
359 void eventCreateMotionSyncParam(void);
360
362 //-----------------------------------------------------------
364 //-----------------------------------------------------------
366private:
367 GxToolMotionViewer* _pRoot;
368 GxResMotionViewer::MotionSyncCategory::MotionSyncParam* _pSelectObject;
369
371};
372
373//===========================================================================
375//===========================================================================
376class GxToolMotionViewer::GxGuiPropertyTableChildUnitParam : public gx::core::GxGuiPropertyTable
377{
378 //-----------------------------------------------------------
380 //-----------------------------------------------------------
382public:
383 GX_RTTI_CLASS( GxToolMotionViewer::GxGuiPropertyTableChildUnitParam, gx::core::GxGuiPropertyTable );
384 // GxClassBaseReference継承クラス用禁止宣言
385 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableChildUnitParam);
386
388 //-----------------------------------------------------------
390 //-----------------------------------------------------------
392private:
394 GxGuiPropertyTableChildUnitParam( void ){}
395public:
397 GxGuiPropertyTableChildUnitParam( GxToolMotionViewer* pTool, const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON );
398
400 //-----------------------------------------------------------
402 //-----------------------------------------------------------
404private:
406 void onClick( const GxPoint2& pos,u32 button ) override;
408 void createPopUpMenu(const GxPoint2& position);
410 void eventDeleteChildUnitParam(void);
412 void eventCreateChildUnitParam(void);
413
415 //-----------------------------------------------------------
417 //-----------------------------------------------------------
419private:
420 GxToolMotionViewer* _pRoot;
421 GxResMotionViewer::MotionChildCategory::ChildUnitParam* _pSelectObject;
422
424};
425
426//===========================================================================
428//===========================================================================
429class GxToolMotionViewer::GxGuiPropertyTableMotionPlayParam : public gx::core::GxGuiPropertyTable
430{
431 //-----------------------------------------------------------
433 //-----------------------------------------------------------
435public:
436 GX_RTTI_CLASS( GxToolMotionViewer::GxGuiPropertyTableMotionPlayParam, gx::core::GxGuiPropertyTable );
437 // GxClassBaseReference継承クラス用禁止宣言
438 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableMotionPlayParam);
439
441 //-----------------------------------------------------------
443 //-----------------------------------------------------------
445private:
447 GxGuiPropertyTableMotionPlayParam( void ){}
448public:
450 GxGuiPropertyTableMotionPlayParam( GxToolMotionViewer* pTool, const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON );
451
453 //-----------------------------------------------------------
455 //-----------------------------------------------------------
457private:
459 void onClick( const GxPoint2& pos,u32 button ) override;
461 void createPopUpMenu(const GxPoint2& position);
463 void eventDeleteMotionPlayParam(void);
465 void eventCreateMotionPlayParam(void);
466
468 //-----------------------------------------------------------
470 //-----------------------------------------------------------
472private:
473 GxToolMotionViewer* _pRoot;
474
476};
477
478GX_MOTION_NAMESPACE_END()
479#endif // GX_EDITOR
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
T gx_cast(GxClassBaseRoot *pObject)
Definition GxBase.h:264
void GxTypedObject
その他
Definition GxDefine.h:213
static constexpr u32 VALUE_16
16
Definition GxMath.h:123
プロパティクラス
Definition GxProperty.h:48
プロパティテーブルクラス
Definition GxProperty.h:1641
リソース基底クラス
Definition GxResBase.h:23
モデルリソースクラス
Definition GxResModel.h:20
モーションパッケージリソース
Definition GxResMotionPackage.h:20
実行時型情報クラス
Definition GxRtti.h:154
モーションユニット
Definition GxUnitMotion.h:20
座標
Definition GxStruct.h:867
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173