OROCHI
 
Loading...
Searching...
No Matches
GxResMotionViewer.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12GX_MOTION_NAMESPACE_BEGIN()
13
14#if GX_DEVELOP
15//===========================================================================
17//===========================================================================
18class GxResMotionViewer : public GxResBase
19{
20 //-----------------------------------------------------------
22 //-----------------------------------------------------------
24public:
25 GX_RTTI_RESOURCE_NAME(GxResMotionViewer, GxResBase, "モーションビューワリソース");
26 // GxClassBaseReference継承クラス用禁止宣言
27 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResMotionViewer);
28
30 static constexpr u32 CHILD_UNIT_MAX_COUNT = GxMath::VALUE_8;
31
33 class MotionBaseCategory : public GxClassBase
34 {
35 //----------------------------------------------------
37 //----------------------------------------------------
39 public:
40 GX_RTTI_ABSTRACT_CLASS(MotionBaseCategory, GxClassBase);
41
43 //--------------------------------------------------------
45 //--------------------------------------------------------
47 public:
49 MotionBaseCategory(void);
51 ~MotionBaseCategory(void) override;
52
54 //--------------------------------------------------------
56 //--------------------------------------------------------
58 private:
60 virtual GxClassBase* allocObject(void) = 0;
62 virtual GxClassBase** allocCategory(void) = 0;
63
65 //--------------------------------------------------------
67 //--------------------------------------------------------
69 public:
71 GxClassBase* addParam(void);
73 s32 deleteParam(GxClassBase* pDeleteObject);
75 constexpr GxClassBase* getParam(u32 index) const { return _ppParam[index]; }
77 constexpr u32 getParamMax(void) const { return _paramMax; }
78
79 private:
81 void getPropertyParam(void* pValue, u32 index);
83 void setPropertyParam(const void* pValue, u32 index );
85 u32 getPropertyParamCount(void);
87 void setPropertyParamCount(u32 paramMax);
88
90 //--------------------------------------------------------
92 //--------------------------------------------------------
94 protected:
95 GxClassBase** _ppParam;
96 u32 _paramMax;
97
99 };
100
102 class MotionSyncCategory : public MotionBaseCategory
103 {
104 //----------------------------------------------------
106 //----------------------------------------------------
108 public:
109 GX_RTTI_CLASS(MotionSyncCategory, MotionBaseCategory);
110
112 class MotionSyncParam : public GxClassBase
113 {
114 //----------------------------------------------------
116 //----------------------------------------------------
118 public:
119 GX_RTTI_CLASS(MotionSyncParam, GxClassBase);
120
122 //----------------------------------------------------
124 //----------------------------------------------------
126
128 MotionSyncParam(void);
130 MotionSyncParam& operator= (MotionSyncParam const& other);
132 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
133
135 //----------------------------------------------------
137 //----------------------------------------------------
139
140 static GxMotionNamesList* _pMotionNameList;
141 static GxMotionNamesList* _pChildMotionNameList;
142 u32 _targetParentMotion;
143 u32 _playChildMotion;
144
146 };
148
149 //--------------------------------------------------------
151 //--------------------------------------------------------
153 private:
155 GX_FORCE_INLINE GxClassBase* allocObject (void) override { return static_cast<GxClassBase*>(GX_NEW MotionSyncParam()); }
157 GX_FORCE_INLINE GxClassBase** allocCategory(void) override { return reinterpret_cast<GxClassBase**>(GX_NEW MotionSyncParam*[_paramMax]); }
158
160 };
161
163 class MotionChildCategory : public MotionBaseCategory
164 {
165 //----------------------------------------------------
167 //----------------------------------------------------
169 public:
170 GX_RTTI_CLASS(MotionChildCategory, MotionBaseCategory);
171
173 class ChildUnitParam : public GxClassBase
174 {
175 //--------------------------------------------------------
177 //--------------------------------------------------------
179 public:
180 GX_RTTI_CLASS(ChildUnitParam, GxClassBase);
181
183 //--------------------------------------------------------
185 //--------------------------------------------------------
187
189 ChildUnitParam(void);
191 ~ChildUnitParam(void);
192
194 //--------------------------------------------------------
196 //--------------------------------------------------------
198
200 GX_FORCE_INLINE void getPropertyResModel(void* const pValue) { *static_cast<GxResModel**>(pValue) = _pResModel; }
202 GX_FORCE_INLINE void setPropertyResModel(const void* const pValue) { GX_SET_CLASS_BASE_REFERENCE( _pResModel, *static_cast<GxResModel**>(const_cast<void*>(pValue))); }
204 GX_FORCE_INLINE void getPropertyResMotion(void* const pValue) { *static_cast<GxResMotionPackage**>(pValue) = _pResMotion; }
206 GX_FORCE_INLINE void setPropertyResMotion(const void* const pValue) { GX_SET_CLASS_BASE_REFERENCE( _pResMotion, *static_cast<GxResMotionPackage**>(const_cast<void*>(pValue))); }
207
209 //--------------------------------------------------------
211 //--------------------------------------------------------
213
214 GxString _name;
215 u32 _attachParentJointNumber;
216 GxResModel* _pResModel;
217 GxResMotionPackage* _pResMotion;
218
220 };
221
223 //--------------------------------------------------------
225 //--------------------------------------------------------
227 private:
229 GX_FORCE_INLINE GxClassBase* allocObject(void) override { return static_cast<GxClassBase*>(GX_NEW ChildUnitParam()); }
231 GX_FORCE_INLINE GxClassBase** allocCategory(void) override { return reinterpret_cast<GxClassBase**>(GX_NEW ChildUnitParam*[_paramMax]); }
232
234 };
235
237 class MotionPlayCategory : public MotionBaseCategory
238 {
239 //----------------------------------------------------
241 //----------------------------------------------------
243 public:
244 GX_RTTI_CLASS(MotionPlayCategory, MotionBaseCategory);
245
247 class PlayParam : public GxClassBase
248 {
249 //----------------------------------------------------
251 //----------------------------------------------------
253 public:
254 GX_RTTI_CLASS(PlayParam, GxClassBase);
255
257 //----------------------------------------------------
259 //----------------------------------------------------
261
263 PlayParam(void);
265 PlayParam& operator= (PlayParam const& other);
267 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
268
270 //----------------------------------------------------
272 //----------------------------------------------------
274
275 static GxMotionNamesList* pMotionNameList;
276 u32 _playId;
277 u32 _playMotion;
278
280 };
281
283 //--------------------------------------------------------
285 //--------------------------------------------------------
287 private:
289 GX_FORCE_INLINE GxClassBase* allocObject(void) override { return static_cast<GxClassBase*>(GX_NEW PlayParam()); }
291 GX_FORCE_INLINE GxClassBase** allocCategory(void) override { return reinterpret_cast<GxClassBase**>(GX_NEW PlayParam*[_paramMax]); }
292
294 };
295
297 //-----------------------------------------------------------
299 //-----------------------------------------------------------
301public:
303 GxResMotionViewer(void);
305 void cleanup(void) override;
306
308 //-----------------------------------------------------------
310 //-----------------------------------------------------------
312public:
314 b32 load(GxStream& stream, u32 /*dataSize*/);
316 b32 save(GxStream& stream);
317
319 //-----------------------------------------------------------
321 //-----------------------------------------------------------
323public:
324#if GX_EDITOR
326 void getToolRtti(GxArray& arrayTool) const override;
327#endif //GX_EDITOR
329 constexpr MotionSyncCategory* getMotionSyncCategory(u32 category) const { return _pMotionSyncCategory[category]; }
331 void swapMotionSyncCategory(u32 index0, u32 index1);
333 GX_FORCE_INLINE MotionChildCategory* getChildUnitCategory(void) { return &_childUnitCategory; }
335 GX_FORCE_INLINE MotionPlayCategory* getPlayCategory(void) { return &_motionPlayCategory; }
337 GX_FORCE_INLINE GxString getModelResourcePath(void) const { return _modelResourcePath; }
339 GX_FORCE_INLINE GxString getMotionResourcePath(void) const { return _motionResourcePath; }
341 GX_FORCE_INLINE GxString getMotionInterpResourcePath(void) const { return _motionInterpResourcePath; }
343 GX_FORCE_INLINE void setModelResourcePath(const GxString& path) { _modelResourcePath = path; }
345 GX_FORCE_INLINE void setMotionResourcePath(const GxString& path) { _motionResourcePath = path; }
347 GX_FORCE_INLINE void setMotionInterpResourcePath(const GxString& path) { _motionInterpResourcePath = path; }
348
350 //-----------------------------------------------------------
352 //-----------------------------------------------------------
354protected:
355 MotionSyncCategory* _pMotionSyncCategory[CHILD_UNIT_MAX_COUNT];
356 MotionChildCategory _childUnitCategory;
357 MotionPlayCategory _motionPlayCategory;
358 GxString _modelResourcePath;
359 GxString _motionResourcePath;
360 GxString _motionInterpResourcePath;
361
363};
364
365//===========================================================================
367//===========================================================================
368class GxResMotionViewerXml : public GxResMotionViewer
369{
370 //-----------------------------------------------------------
372 //-----------------------------------------------------------
374public:
375 // RTTI定義
376 GX_RTTI_RESOURCE_NAME(GxResMotionViewerXml, GxResMotionViewer, "モーションビューワXMLリソース");
377 // GxClassBaseReference継承クラス用禁止宣言
378 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResMotionViewerXml);
379
381 //-----------------------------------------------------------
383 //-----------------------------------------------------------
385public:
387 GxResMotionViewerXml(void);
388
390 //-----------------------------------------------------------
392 //-----------------------------------------------------------
394protected:
396 b32 load(GxStream& in, u32 /*dataSize*/);
398 b32 save(GxStream& out);
399
401};
402
403#endif // GX_DEVELOP
404
405GX_MOTION_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_SET_CLASS_BASE_REFERENCE(__DST__, __SRC__)
オブジェクト設定(参照カウンタを使用する場合)
Definition GxBase.h:318
void GxTypedObject
その他
Definition GxDefine.h:213
配列クラス
Definition GxArray.h:18
オブジェクト基底クラス
Definition GxBase.h:88
static constexpr u32 VALUE_8
8
Definition GxMath.h:122
プロパティクラス
Definition GxProperty.h:48
リソース基底クラス
Definition GxResBase.h:23
void cleanup(void) override
解放
Definition GxResBase.cpp:74
b32 load(GxStream &stream, u32 size)
ロード
Definition GxResBase.h:394
モデルリソースクラス
Definition GxResModel.h:20
モーションパッケージリソース
Definition GxResMotionPackage.h:20
実行時型情報クラス
Definition GxRtti.h:154
ストリーム基礎クラス
Definition GxStream.h:20
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173