OROCHI
 
Loading...
Searching...
No Matches
GxSysTool.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13#if GX_DEVELOP
14
15#include <functional>
16
17GX_CORE_NAMESPACE_BEGIN()
18
19// 前方宣言
20class GxGuiSystem;
21class GxGuiMessageBox;
22class GxResSystemConfig;
23class GxHandle;
24class GxToolViewProperty;
25class GxResThumbnailTno;
26
27//===========================================================================
29//===========================================================================
30class GxSysTool : public GxSysBase, public SingletonBase<GxSysTool>
31{
32 //-------------------------------------------------------------
34 //-------------------------------------------------------------
36public:
37 GX_RTTI_ABSTRACT_CLASS(GxSysTool, GxSysBase)
38 // GxClassBase継承クラス用禁止宣言
39 GX_PROHIBIT_CLASS_BASE(GxSysTool)
40 // new, delete定義
41 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
42
43 // インナークラス宣言
44 class GxLocationDataTool;
45 class GxToolElement;
46 struct GxDataInitialize;
47 class GxDataProcessBar;
48 class GxDataPadInformation;
49 class GxDataMouseInformation;
50 class GxDataModelInformation;
51 class GxDataGUIInformation;
52 class GxPropertySortNode;
53 class GxFileRecord;
54 class GxFavoriteFolder;
55 class GxGuiMenuSelectTool;
56 class GxDataToolShortcut;
57 class GxGuiProcessBar;
58 class GxGuiFps;
59
60 template <class T> class GxIteratorDesktop;
61
63 static constexpr u32 TOOL_BAR_BUTTON_PLAY_INDEX = 0;
65 static constexpr u32 TOOL_BAR_BUTTON_PAUSE_INDEX = 1;
66
67 // フォントテクスチャ関連
69 static const GX_CSTR FONT_TEXTURE;
71 static const GxVector2 FONT_HALF_SIZE_SINGLE;
73 static const GxVector2 FONT_FULL_SIZE_SINGLE;
75 static const u32 FONT_HALF_COLUMN;
77 static const u32 FONT_FULL_COLUMN;
78
79 // フォントサイズ関連
81 static constexpr u32 FONT_HALF_SIZE_WIDTH = 6;
83 static constexpr u32 FONT_HALF_SIZE_HEIGHT = 12;
85 static constexpr u32 FONT_FULL_SIZE_WIDTH = 12;
87 static constexpr u32 FONT_FULL_SIZE_HEIGHT = 12;
89 static const u32 FONT_SIZE_HEIGHT = FONT_HALF_SIZE_HEIGHT > FONT_FULL_SIZE_HEIGHT ? FONT_HALF_SIZE_HEIGHT : FONT_FULL_SIZE_HEIGHT;
90
92 static const f32 FONT_HALF_SIZE_WIDTH_F32;
94 static const f32 FONT_FULL_SIZE_WIDTH_F32;
96 static const f32 FONT_SIZE_HEIGHT_F32;
97
99 static GX_CHAR SYSTEM_CONFIG_RES_PATH[64];
100
102 // todo:必要なものはSystemFlagに移動
103 enum class DRAW_FLAG_INDEX
104 {
105 ALL_OFF = 0,
106 MATRIX,
107 FPS,
108 PROCESS_BAR,
109 GRID,
110 PAD,
111 PAUSE,
112 HANDLE,
113 GPU,
114 LOADING,
115 MAX,
116 };
117
119 static constexpr u32 WINDOW_CREATE_OFFSET = 24;
120
122 static const f32 TOOL_RENDER_Z;
124 static const GxPrimitiveMaterial TOOL_MATERIAL;
126 static const GxPrimitiveMaterial TOOL_MATERIAL_ND;
127
129 enum class BASIS_CORNER
130 {
131 LEFT_TOP = 0,
133 RIGHT_TOP,
135 MAX,
136 };
137#if GX_DEVELOP
139 GX_ENUM_TABLE_MAX(BASIS_CORNER)
140#endif //GX_DEVELOP
141
143 static GX_CHAR USED_FILE_PATH_FILE_PATH[64];
145 static const u32 USED_FILE_PATH_MAX;
147 static GX_CHAR FAVORITE_FOLDER_FILE_PATH[64];
149 static const u32 FAVORITE_FOLDER_MAX;
150private:
152 static constexpr u32 CREATE_ASYNC_TOOL_MAX = 4;
153
155 //-------------------------------------------------------------
157 //-------------------------------------------------------------
159public:
161 GxSysTool( void );
163 ~GxSysTool( void ) override {}
164
166 b32 initialize( const GxClassBase* pInitialInformation ) override;
167
169 virtual b32 initializeThreadLocalStorage(u32 workerThreadIndex);
170
172 void terminate( void ) override;
173
175 //-------------------------------------------------------------
177 //-------------------------------------------------------------
179
182 void beginToolRender( void );
183
185 void render( void );
186
189 void endToolRender( void );
190
192 void update( void ) override;
193
195 void createAsyncTools(void);
196
198 virtual void checkMouseEvent( void );
199
201 virtual void checkMouseEventForMultiSelect( void );
202
204 virtual void checkKeyEvent( void );
205
207 GX_FORCE_INLINE void forceExit( void ) { getGxSysMain()->forceExit( GxSysMain::EXIT_CODE::NORMAL); }
208
210 void setPlay(b32 on);
211private:
213 GX_FORCE_INLINE void getPlayProperty(void* const pValue) { *static_cast<b32*>(const_cast<void*>(pValue)) = !getGxSysMain()->isStop(); }
215 GX_FORCE_INLINE void setPlayProperty(const void* const pValue) { setPlay(*static_cast<b32*>(const_cast<void*>(pValue))); }
216
218 GX_FORCE_INLINE void getPauseProperty(void* const pValue) { *static_cast<b32*>(const_cast<void*>(pValue)) = getGxSysMain()->isPause(); }
220 GX_FORCE_INLINE void setPauseProperty(const void* const pValue) { getGxSysMain()->setPause(*static_cast<b32*>(const_cast<void*>(pValue))); }
221
222#if defined(_WINDOWS)
224 GX_FORCE_INLINE void getTitleBarEnable(void* const pValue) const { *static_cast<b32*>(const_cast<void*>(pValue)) = (GetWindowLongW(getGxSysMain()->getHwndParent(), GWL_STYLE) & WS_CAPTION) != 0; }
226 void setTitleBarEnable(const void* const pValue);
228 GX_FORCE_INLINE void getToolBarEnable(void* const pValue) const { *static_cast<b32*>(const_cast<void*>(pValue)) = getGxSysMain()->getHwndToolbar() != nullptr; }
230 void setToolBarEnable(const void* const pValue);
231#endif //_WINDOWS
232public:
234 void minimizeAllWindow( void );
235
237 void normalizeAllWindow( void );
238
240 void setAllWindowCenter( void );
241
243 GxColor createColorFromString( const GxString& string );
245 void adjustColorWithString( const GxString& string, GxColor& baseColor, f32 hueMax = 20.f, f32 saturationMax = 0.2f, f32 valueMax = 0.2f );
246
248 GX_FORCE_INLINE void setRenderTarget(GxRenderTexture* pRenderTarget){ getContext2D()->setRenderTarget(pRenderTarget, 1.f); }
250 GX_FORCE_INLINE void copyRenderTargetToTexture(u32 index = 0, GxRenderTexture* pTexture = nullptr, u32 dstMipLevel = 0, const GxRect* pSrcRect = nullptr, const GxPoint2* pDstPoint = nullptr){ getContext2D()->copyRenderTargetToTexture(index, pTexture, dstMipLevel, pSrcRect, pDstPoint, 1.f); }
252 GX_FORCE_INLINE void clear(const GxColor& clearColor){ getContext2D()->clear(clearColor, 1.f); }
253
255 GX_FORCE_INLINE void setScreenSize(const GxSize& size) { getContext2D()->setScreenSize(size, 1.0f); }
257 GX_FORCE_INLINE void set2DScissorRect( const GxRect& rect, f32 priority = TOOL_RENDER_Z )
258 {
259 GxRect scissorRect( rect );
260 scissorRect._left = GxMath::getMax( 0,scissorRect._left );
261 scissorRect._top = GxMath::getMax( 0,scissorRect._top );
262 scissorRect._right = GxMath::getMax( 0,scissorRect._right );
263 scissorRect._bottom = GxMath::getMax( 0,scissorRect._bottom );
264 getContext2D()->setScissorRect(scissorRect, priority);
265 }
266
267 //---- GxPrimitiveVertex取得
269 GxPrimitiveVertex* draw2DLineStrip( const u32 numVertex, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D, f32 priority = TOOL_RENDER_Z );
271 GxPrimitiveVertex* draw2DLineList( const u32 numVertex, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D, f32 priority = TOOL_RENDER_Z );
273 GxPrimitiveVertex* draw2DTriangleStrip( const u32 numVertex, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D, f32 priority = TOOL_RENDER_Z );
275 GxPrimitiveVertex* draw2DTriangleList( const u32 numVertex, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D, f32 priority = TOOL_RENDER_Z );
277 GxPrimitiveVertex* draw2DTriangleFan( const u32 numVertex, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D, f32 priority = TOOL_RENDER_Z );
279 GxPrimitiveVertex* draw2DQuadList( const u32 numVertex, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D, f32 priority = TOOL_RENDER_Z );
280
281 //---- 点描画
283 void draw2DPoint( const GxPoint2& point, const GxColor& color, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
284
285 //---- ライン描画
287 void draw2DLineF( const GxPoint2& point0, const GxPoint2& point1, const GxColor& color, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
289 void draw2DLineG( const GxPoint2& point0, const GxPoint2& point1, const GxColor& color0, const GxColor& color1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
291 void draw2DPolyLineF( const GxPoint2& point0, const GxPoint2& point1, const u32 width, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
293 void draw2DPolyLineG( const GxPoint2& point0, const GxPoint2& point1, const u32 width, const GxColor& color0, const GxColor& color1, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
295 void draw2DSplineCurveF(const GxPoint2& start, const GxPoint2& control, const GxPoint2& end, const GxColor& color, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D);
297 void draw2DSplineCurveG(const GxPoint2& start, const GxPoint2& control, const GxPoint2& end, const GxColor& colorStart, const GxColor& colorEnd, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D);
299 void draw2DPolySplineCurveF(const GxPoint2& start, const GxPoint2& control, const GxPoint2& end, const u32 width, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D);
301 void draw2DPolySplineCurveG(const GxPoint2& start, const GxPoint2& control, const GxPoint2& end, const u32 width, const GxColor& colorStart, const GxColor& colorEnd, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D);
303 b32 isIncludeSplineCurve(const GxPoint2& position, const GxPoint2& start, const GxPoint2& control, const GxPoint2& end, const u32 width) const;
305 void draw2DBezierCurveF(const GxPoint2& start, const GxPoint2& control1, const GxPoint2& control2, const GxPoint2& end, const GxColor& color, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D);
307 void draw2DBezierCurveG(const GxPoint2& start, const GxPoint2& control1, const GxPoint2& control2, const GxPoint2& end, const GxColor& colorStart, const GxColor& colorEnd, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D);
309 void draw2DPolyBezierCurveF(const GxPoint2& start, const GxPoint2& control1, const GxPoint2& control2, const GxPoint2& end, const u32 width, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D);
311 void draw2DPolyBezierCurveG(const GxPoint2& start, const GxPoint2& control1, const GxPoint2& control2, const GxPoint2& end, const u32 width, const GxColor& colorStart, const GxColor& colorEnd, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D);
313 b32 isIncludeBezierCurve(const GxPoint2& position, const GxPoint2& start, const GxPoint2& control1, const GxPoint2& control2, const GxPoint2& end, const u32 width) const;
314
315 //---- 矢印描画
317 void draw2DArrowF( const GxPoint2& point0, const GxPoint2& point1, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
319 void draw2DArrowG( const GxPoint2& point0, const GxPoint2& point1, const GxColor& color0, const GxColor& color1, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
320
321 //---- 矩形描画
323 void draw2DRectF( const GxRect& rect, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
325 void draw2DRectF( const GxRect& rect, f32 z, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
327 void draw2DRectG( const GxRect& rect, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
329 void draw2DRectG( const GxRect& rect, f32 z, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
331 void draw2DRectTextureF( const GxRect& rect, const GxColor& color, const GxVector2& uv0, const GxVector2& uv1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
333 void draw2DRectTextureF( const GxRect& rect, f32 z, const GxColor& color, const GxVector2& uv0, const GxVector2& uv1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
334
336 void draw2DRectF( const GxRect& rect, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
338 void draw2DRectF( const GxRect& rect, f32 z, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
340 void draw2DRectG( const GxRect& rect, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
342 void draw2DRectG( const GxRect& rect, f32 z, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
344 void draw2DRectTextureF( const GxRect& rect, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color, const GxVector2& uv0, const GxVector2& uv1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
346 void draw2DRectTextureF( const GxRect& rect, f32 z, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color, const GxVector2& uv0, const GxVector2& uv1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
347
349 void draw2DRectTextureF( const GxRect& rect, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color, const GxVector2& uv0, const GxVector2& uv1, GxRenderTexture* pTexture );
351 void draw2DRectTextureF( const GxRect& rect, f32 z, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color, const GxVector2& uv0, const GxVector2& uv1, GxRenderTexture* pTexture );
353 void draw2DRectTextureG( const GxRect& rect, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, const GxVector2& uv0, const GxVector2& uv1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
355 void draw2DRectTextureG( const GxRect& rect, f32 z, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, const GxVector2& uv0, const GxVector2& uv1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
357 void draw2DRectTextureG( const GxRect& rect, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, const GxVector2& uv0, const GxVector2& uv1, GxRenderTexture* pTexture );
359 void draw2DRectTextureG( const GxRect& rect, f32 z, const GxVector2& rotateCenter, const f32 rotateRadian, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, const GxVector2& uv0, const GxVector2& uv1, GxRenderTexture* pTexture );
360
362 void draw2DRectTextureF( const GxRect& rect, const GxColor& color, const GxVector2& uv0, const GxVector2& uv1, GxRenderTexture* pTexture );
364 void draw2DRectTextureF( const GxRect& rect, f32 z, const GxColor& color, const GxVector2& uv0, const GxVector2& uv1, GxRenderTexture* pTexture );
366 void draw2DRectTextureG( const GxRect& rect, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, const GxVector2& uv0, const GxVector2& uv1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
368 void draw2DRectTextureG( const GxRect& rect, f32 z, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, const GxVector2& uv0, const GxVector2& uv1, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
370 void draw2DRectTextureG( const GxRect& rect, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, const GxVector2& uv0, const GxVector2& uv1, GxRenderTexture* pTexture );
372 void draw2DRectTextureG( const GxRect& rect, f32 z, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3, const GxVector2& uv0, const GxVector2& uv1, GxRenderTexture* pTexture );
373
374 //---- 三角形描画
376 void draw2DTriangleF( const GxPoint2& point0, const GxPoint2& point1, const GxPoint2& point2, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
378 void draw2DTriangleF( const GxVector3& point0, const GxVector3& point1, const GxVector3& point2, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
380 void draw2DTriangleG( const GxPoint2& point0, const GxPoint2& point1, const GxPoint2& point2, const GxColor& color0, const GxColor& color1, const GxColor& color2, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
382 void draw2DTriangleG( const GxVector3& point0, const GxVector3& point1, const GxVector3& point2, const GxColor& color0, const GxColor& color1, const GxColor& color2, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
383
384 //---- 円・扇描画
386 void draw2DCircleF( const GxPoint2& center, const u32 radius, const GxColor& color, const u32 divide = 36, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
388 void draw2DCircleF( const GxVector3& center, const u32 radius, const GxColor& color, const u32 divide = 36, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
390 void draw2DCircleG( const GxPoint2& center, const u32 radius, const GxColor& color0, const GxColor& color1, const u32 divide = 36, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
392 void draw2DCircleG( const GxVector3& center, const u32 radius, const GxColor& color0, const GxColor& color1, const u32 divide = 36, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
394 void draw2DFanF( const GxPoint2& center, const u32 radius, const f32 degreeStart, const f32 degreeDelta, const GxColor& color, const u32 divide = 12, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
396 void draw2DFanF( const GxVector3& center, const u32 radius, const f32 degreeStart, const f32 degreeDelta, const GxColor& color, const u32 divide = 12, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D );
397
399 void draw2DString( const GxPoint2& point, GX_CSTR string, const GxColor& color = GxColor::WHITE, u32 sizeHeight = FONT_SIZE_HEIGHT, b32 isUseLineBreak = false );
401 void draw2DString( const GxPoint2& point, f32 z, GX_CSTR string, const GxColor& colorc = GxColor::WHITE, const GxPrimitiveMaterial& material = GxPrimitiveMaterial::DEFAULT_2D, u32 sizeHeight = FONT_SIZE_HEIGHT, b32 isUseLineBreak = false );
402
404 void draw2DFramePlateF( const GxRect& frame, const GxColor& frameColor, const GxColor& color );
406 void draw2DFramePlateG( const GxRect& frame, const GxColor& frameColor, const GxColor& color0, const GxColor& color1, const GxColor& color2, const GxColor& color3);
407
408 //---- GxPrimitiveVertex取得
410 GxPrimitiveVertex* draw3DLineStrip( const u32 numVertex, const GxPrimitiveMaterial& material, const GxVector3& priorityPoint, u32 viewFlag = 0xFFFFFFFF);
412 GxPrimitiveVertex* draw3DLineList( const u32 numVertex, const GxPrimitiveMaterial& material, const GxVector3& priorityPoint, u32 viewFlag = 0xFFFFFFFF );
414 GxPrimitiveVertex* draw3DTriangleList(const u32 numVertex, const GxPrimitiveMaterial& material, const GxVector3& priorityPoint, u32 viewFlag = 0xFFFFFFFF);
416 GxPrimitiveVertex* draw3DTriangleStrip(const u32 numVertex, const GxPrimitiveMaterial& material, const GxVector3& priorityPoint, u32 viewFlag = 0xFFFFFFFF);
418 GxPrimitiveVertex* draw3DTriangleFan(const u32 numVertex, const GxPrimitiveMaterial& material, const GxVector3& priorityPoint, u32 viewFlag = 0xFFFFFFFF);
419
420 //---- ライン描画
422 void draw3DLineF( const GxVector3& point0, const GxVector3& point1, const GxColor& color, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
424 void draw3DLineG( const GxVector3& point0, const GxVector3& point1, const GxColor& color0, const GxColor& color1, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
425
426 //---- 矢印描画
428 void draw3DArrowF( const GxVector3& point0, const GxVector3& point1, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, const f32 headRatio = 0.2f, const f32 headDegree = 30.f, u32 viewFlag = 0xFFFFFFFF );
430 void draw3DArrowG( const GxVector3& point0, const GxVector3& point1, const GxColor& color0, const GxColor& color1, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, const f32 headRatio = 0.2f, const f32 headDegree = 30.f, u32 viewFlag = 0xFFFFFFFF );
431
432 //---- 三角形描画
434 void draw3DTriangleF( const GxVector3& point0, const GxVector3& point1, const GxVector3&, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF);
436 void draw3DTriangleG( const GxVector3& point0, const GxVector3& point1, const GxVector3&, const GxColor& color0, const GxColor& color1, const GxColor& color2, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
437
438 //---- 円描画
440 void draw3DFanF( const GxVector3& center, const GxVector3& axis, const GxVector3& Start, const f32 degree, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
442 void draw3DFanG( const GxVector3& center, const GxVector3& axis, const GxVector3& Start, const f32 degree, const GxColor& color0, const GxColor& color1, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
444 void draw3DCircleF( const GxVector3& center, const GxVector3& axis, const f32 radius, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
446 void draw3DCircleG( const GxVector3& center, const GxVector3& axis, const f32 radius, const GxColor& color0, const GxColor& color1, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
447
448 //---- 球描画
450 void draw3DSphere( const GxShapeSphere& sphere, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, const u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
452 void draw3DSphere( const GxVector3& center, const f32 radius, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, const u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
454 void draw3DSphere( const GxMatrixAffine& coord, const f32 radius, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, const u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
455
456 //---- 箱描画
458 void draw3DBox( const GxShapeBox& box, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
460 void draw3DBox( const GxMatrixAffine& coord, const GxVector3& extent, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
461
462 //---- 円柱描画
464 void draw3DCylinder( const GxShapeCylinder& cylinder, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
466 void draw3DCylinder( const GxMatrixAffine& coord, const GxVector3& extent, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
467
468 //---- カプセル描画
470 void draw3DCapsule( const GxShapeCapsule& capsule, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
472 void draw3DCapsule( const GxMatrixAffine& coord, const f32 radius, const f32 height, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
473
474 //---- マルチ球描画
476 void draw3DMultisphere( const GxShapeMultisphere& multisphere, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
478 void draw3DMultisphere( const GxMatrixAffine& coord, const GxVector3& offset0, const f32 radius0, const GxVector3& offset1, const f32 radius1, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
480 void draw3DMultisphere( const GxVector3& position0, const f32 radius0, const GxVector3& position1, const f32 radius1, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divide = 12, u32 viewFlag = 0xFFFFFFFF );
481
482 //---- 円錐描画
484 void draw3DCone( const GxVector3& top, const GxVector3& center, const f32 radius, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divie = 12, u32 viewFlag = 0xFFFFFFFF);
486 void draw3DConeElliptical( const GxVector3& top, const GxVector3& center, const GxVector3& axis0, const GxVector3& axis1, const f32 radius0, const f32 radius1, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 divie = 12, u32 viewFlag = 0xFFFFFFFF);
487
488 //---- ボーン描画
490 void draw3DJoint( const GxVector3& position, const f32 thickness = 0.03f, const GxColor& color = GxColor(0, 0, 96), PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
492 void draw3DBone( const GxVector3& position, const GxVector3& parentPosition, const f32 thickness = 0.03f, const GxColor& color = GxColor(0, 0, 96), PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
493
494 //---- 角錐台描画
496 void draw3DFrustum( const GxShapeFrustum& frustum, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
498 void draw3DFrustum( const GxMatrixAffine& top, f32 nearZ, f32 farZ, f32 fov, f32 aspectRatio, const GxColor& color, PRIMITIVE_FILL_MODE fillMode = PRIMITIVE_FILL_MODE::SOLID, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 viewFlag = 0xFFFFFFFF );
499
500 //---- 文字描画
502 void draw3DString( const GxVector3& position, GX_CSTR string, const GxColor& color = GxColor::WHITE, const GxPrimitiveMaterial& material = TOOL_MATERIAL, u32 sizeHeight = FONT_SIZE_HEIGHT, b32 isUseAutoLineBreak = false );
503
505 void getDrawRectString(GxRect& dstRect, const GxPoint2& position, GX_CSTR string, u32 sizeHeigt = FONT_SIZE_HEIGHT, b32 isUseLineBreak = false);
506
508 void draw3DLineXYZ( const GxMatrixAffine& matrix, f32 axisLength = 30.f, const GxColor& colorCenter = GxColor::WHITE, const GxColor& colorX = GxColor::SYSTEM_AXIS_X, const GxColor& colorY = GxColor::SYSTEM_AXIS_Y, const GxColor& colorZ = GxColor::SYSTEM_AXIS_Z, const GxPrimitiveMaterial& material = TOOL_MATERIAL);
509
510protected:
512 void drawSub2DString( b32 isUse3DContext, const GxPoint2& point, f32 z, GX_CSTR string, const GxColor& color, const GxPrimitiveMaterial& material, u32 sizeHeight, b32 isUseLineBreak );
513
515 void drawSub3DCylinderLine( const GxMatrixAffine& coord, const GxVector3& extent, const GxColor& color, const GxPrimitiveMaterial& material, u32 divide, u32 viewFlag = 0xFFFFFFFF );
517 void drawSub3DCylinderFill( const GxMatrixAffine& coord, const GxVector3& extent, const GxColor& color, const GxPrimitiveMaterial& material, u32 divide, u32 viewFlag = 0xFFFFFFFF );
518
520 void drawSub3DMultisphereLine( const GxVector3& position0, const f32 radius0, const GxVector3& position1, const f32 radius1, GxVector3* pCircumference, const GxColor& color, const GxPrimitiveMaterial& material, u32 divide, u32 viewFlag = 0xFFFFFFFF );
522 void drawSub3DMultisphereFill( const GxVector3& position0, const f32 radius0, const GxVector3& position1, const f32 radius1, GxVector3* pCircumference, const GxColor& color, const GxPrimitiveMaterial& material, u32 divide, u32 viewFlag = 0xFFFFFFFF );
524 void calculateCircumference( const GxVector3& axis, const u32 divide, GxVector3* pCircumference );
526 void calculateCircumferenceElliptical( const GxVector3& axis0, const GxVector3& axis1, const f32 radius0, const f32 radius1, const u32 divide, GxVector3* pCircumference );
528 void drawSubHalfSphere( const GxVector3& center, const f32 radius, const GxColor& color, const u32 quarterDiv, const GxVector3* pCircumference, const GxPrimitiveMaterial& material, const b32 isUpper, u32 viewFlag = 0xFFFFFFFF );
529
531 void drawSub3DConeLine( const GxVector3& top, const GxVector3& center, const GxVector3* pCircumference, const GxColor& color, const GxPrimitiveMaterial& material, u32 divide, u32 viewFlag = 0xFFFFFFFF);
533 void drawSub3DConeFill( const GxVector3& top, const GxVector3& center, const GxVector3* pCircumference, const GxColor& color, const GxPrimitiveMaterial& material, u32 divide, u32 viewFlag = 0xFFFFFFFF);
534
536 void drawSub3DBoneLine( const GxVector3& top, const GxVector3& bottom, const GxVector3* pSide, const GxColor& color, const GxPrimitiveMaterial& material, u32 viewFlag = 0xFFFFFFFF );
538 void drawSub3DBoneFill( const GxVector3& top, const GxVector3& bottom, const GxVector3* pSide, const GxColor& color, const GxPrimitiveMaterial& material, u32 viewFlag = 0xFFFFFFFF );
539
541 void drawSubFrustumFill( const GxVector3* nearPlane, const GxVector3* farPlane, const GxVector3& priorityPoint, const GxColor& color, const GxPrimitiveMaterial& material, u32 viewFlag = 0xFFFFFFFF );
543 void drawSubFrustumLine( const GxVector3* nearPlane, const GxVector3* farPlane, const GxVector3& priorityPoint, const GxColor& color, const GxPrimitiveMaterial& material, u32 viewFlag = 0xFFFFFFFF );
544
545public:
548 virtual GxVector3 transformScreenToWorld( const GxPoint2& screenPosition );
549
551 b32 transformScreenToWorldBackgroundHit( const GxPoint2& screenPosition, GxVector3& worldPosition );
552
554 f32 getRatioScreenToWorld( const GxVector3& basePosition, const RENDER_VIEW viewport );
555
557 GxPoint2 transformPrimitive2DToScreen( const GxPoint2& primitive2DPosition );
558
560 void getFilter( GxString& filter, const GxRttiResource* pResRtti, const b32 addsChildrensRtti );
561
563 void getExtension( GxString& extension, const GxRttiResource* pResRttiTop, const GxRttiResource* pResRtti, const b32 addsChildrensRtti );
564
566 GxGuiFileDialog* setFileDialogSave( GxString* pFullPath, const GxRttiResource& resRtti, const GxProperty& saveEvent );
567
569 GxGuiFileDialog* setFileDialogOpen( GxString* pFullPath, const GxRttiResource& resRtti, const GxProperty& openEvent );
570
572 GxGuiMessageBox* setMessageBox(GxGuiWindow* pOwner, GX_CSTR message, GX_CSTR caption);
573
575 GxGuiMessageBox* setMessageBox(GxGuiWindow* pOwner, GX_CSTR message, GX_CSTR caption, const GxProperty& okEvent);
576
578 GxGuiMessageBox* setMessageBox(GxGuiWindow* pOwner, GX_CSTR message, GX_CSTR caption, const GxProperty& okEvent, const GxProperty& cancelEvent, b32 isOkCancel = true);
579
581 GxGuiMessageBox* setMessageBox(GxGuiWindow* pOwner, GX_CSTR message, GX_CSTR caption, const GxProperty& yesEvent, const GxProperty& noEvent, const GxProperty& cancelEvent);
582
584 GX_FORCE_INLINE void setDrawFlag( DRAW_FLAG_INDEX index, b32 value) { _drawFlag.setFlag(index, value); }
586 GX_FORCE_INLINE b32 isDrawFlag( DRAW_FLAG_INDEX index) const { return _drawFlag.isFlag(index); }
588 GX_FORCE_INLINE b32 isDraw(DRAW_FLAG_INDEX index) const { return !_drawFlag.isFlag(DRAW_FLAG_INDEX::ALL_OFF) && _drawFlag.isFlag(index); }
589
591 GX_FORCE_INLINE void setPropertyIsDrawGrid( const void* const pValue ) { getGxSysMain()->setDevelopFlag(DEVELOP_FLAG_TOOL_DRAW_GRID, *static_cast<b32*>(const_cast<void*>(pValue))); }
593 GX_FORCE_INLINE void getPropertyIsDrawGrid( void* const pValue ) { *static_cast<b32*>(pValue) = getGxSysMain()->isOnDevelopFlag(DEVELOP_FLAG_TOOL_DRAW_GRID); }
594
596 GX_FORCE_INLINE const GxRect& getSafetyArea( void ) const { return getGxSysRenderBase()->getSafetyArea(); }
597
599 GxRect getCreateWindowRect( const u32 width, const u32 height );
600
602 GxRect adjustRect( const GxRect& target, const GxRect& adjust ) const ;
603
605 void addToDesktop(GxGuiWindow* pWindow);
606
608 constexpr void eventNone( void ) {}
609
611 void eventExitApplication( void );
612
614 void changeStage( void* pRtti );
615
617 GX_FORCE_INLINE void createUnit(void* pRtti) { if (pRtti) { getGxSysUnit()->createAndAddBottom(*static_cast<GxRtti*>(pRtti)); } }
618
620 void createTool( void* pRtti );
621
623 void eventSingleStep(void);
624
625#if defined(_WINDOWS)
627 void eventChangeAppWindowSize( u32 height );
628#endif // _WINDOWS
630 void eventOpenOnlineHelp( void );
632 void eventShowVersionInfo( void );
633
635 template<typename T> T* createTool(b32 isOutsideWindow = true, b32 isMovable = true, b32 isClosable = true) { return static_cast<T*>(createTool(T::GX_RTTI, isOutsideWindow, isMovable, isClosable)); }
637 void createToolAsync(const std::function<void(void)>& pCallback) { GX_ASSERT(_createAsyncToolCount < CREATE_ASYNC_TOOL_MAX, "ツール生成数オーバー"); _createAsyncToolCallbacks[_createAsyncToolCount++] = const_cast<std::function<void(void)>&>(pCallback); }
639 template<typename T> T* getTool(GxResBase* pResource = nullptr) const { return static_cast<T*>(getTool(T::GX_RTTI, pResource)); }
641 GxToolBase* getTool(const GxRtti& rtti, GxResBase* pResource = nullptr) const;
643 static void getTools(const GxRtti& rtti, GxArrayClassBaseReference& list);
644#if GX_EDITOR
646 GxGuiDockingWindow* createDockingWindow(GxToolBase* pTool, b32 isOutsideWindow = false);
648 void eventSaveToolLocation( void );
650 void eventLoadToolLocation(void);
651#endif //GX_EDITOR
652private:
653#if GX_EDITOR
655 GxToolElement* createToolElements(GxGuiBase* pGui);
657 void createTools(GxToolElement& toolElement);
659 GxGuiBase* createToolsSub(GxToolElement& toolElement);
660#endif //GX_EDITOR
661public:
663 virtual GxClassBase* loadElement( const GxRtti& rtti );
665 virtual void saveElement( GxClassBase* pData );
667 virtual b32 detachElement( const GxRtti& rtti );
668
670 virtual void loadToolPosition(const GxRtti& rtti, GxRect* pRectDefault, GxRect* pRectBefore);
672 virtual void saveToolPosition(const GxRtti& rtti, const GxRect& rect);
673
675 void setPadInformation( const GxDataPadInformation& data );
677 void getPadInformation( GxDataPadInformation& data );
678
680 void setMouseInformation( const GxDataMouseInformation& data );
682 void getMouseInformation( GxDataMouseInformation& data );
683
685 void setModelInformation( const GxDataModelInformation& data );
687 void getModelInformation( GxDataModelInformation& data );
688
690 void setGUIInformation(const GxDataGUIInformation& data);
692 void getGUIInformation(GxDataGUIInformation& data);
693
695 GX_FORCE_INLINE void toggleRenderOrtho(void){ _isRenderOrtho = !_isRenderOrtho; }
697 GX_FORCE_INLINE b32 isRenderOrtho(void){ return _isRenderOrtho; }
699 void updateRenderOrtho(void);
700
701#if defined(_WINDOWS)
703 void saveAppWindowData( void );
704#endif // _WINDOWS
705
707 void loadAndStoreToolPosition(GxToolBase* pTool);
708
710 static void addAllChildrenProperty( GxClassBaseRoot* pObject, GxPropertyTable& table, GxProperty::EVENT_ARGUMENT_FUNCTION_POINTER function, const GxRtti* pRtti, const GxRtti* pRttiExcept = nullptr, b32 alignOrder = true );
712 static void sortChildrenNodeProperty( GxPropertyTable& table );
714 static void addPageProperty(GxPropertyTable& tableDest, const GxPropertyTable& tableSrc, u32& indexTableSrc);
716 static b32 setActiveToolHasResource(const GxRtti& toolRtti, const GxResBase* pRes);
717
719 static void executeBatchFile(GX_CSTR path);
720private:
722 GxToolBase* createTool(const GxRtti& rtti, b32 isOutsideWindow = true, b32 isMovable = true, b32 isClosable = true);
723
725 //-------------------------------------------------------------------------
727 //-------------------------------------------------------------------------
729public:
731 GxSize getOutputScreenSize(void) const;
733 GX_FORCE_INLINE GxPoint2 getMouseOutputScreenPosition(void) const { return getGxSysInput()->getMouse()->getPosition() - getOutputScreenOffset(); }
735 GxPoint2 getOutputScreenOffset(void) const;
737 GxPoint2 getOutputClientOffset(GxToolViewProperty* pToolViewProperty) const;
739 b32 isOutputWindowFocused(void);
740
742 GX_FORCE_INLINE const GxPropertyTable& getDefaultPropertyTable( void ) const { return _defaultMenuTable; }
743
745 b32 isOnProcessBar( void ) const;
747 GxGuiProcessBar* getGuiProcessBar(void) const;
749 GxGuiFps* getGuiFps(void) const;
750
752 constexpr GxResThumbnailTno* getResThumbnail(void) const { return _pResThumbnail; }
754 constexpr GxResTexture* getResCheckTexture( void ) const { return _pResCheckTexture; }
755
756#if GX_EDITOR
758 GX_FORCE_INLINE b32 isOutsideWindow(void) const { return _outsideWindowFlag; }
760 GX_FORCE_INLINE void setIsOutsideWindow(b32 flag) { _outsideWindowFlag = flag; }
761#endif //GX_EDITOR
762
764 GX_FORCE_INLINE b32 isControlXSI(void) const { return _controlXSI; }
766 constexpr u32 getHandleDrawMode(void) const { return _isUseZTestDrawHandle ? 1 : 0; }
768 GX_FORCE_INLINE b32 isFileDialogUseOriginalPath(void) const { return _fileDialogUseOriginalPath; }
769
771 GX_FORCE_INLINE GxGuiDesktop* getDesktop( void ) { return getGxGuiSystem()->getDesktop(); }
772
773#if defined(_WINDOWS)
775 virtual void fileDropped( const GxString& filePath, const GxPoint2& position );
776#endif //_WINDOWS
777
779 GxToolResourceEditBase* createToolAndLoad( GX_CSTR filePath );
780
782 constexpr GxUnitBase* getDropUnit(void) { return _pDropUnit; }
784 constexpr void setDropUnit(GxUnitBase* pUnit) { _pDropUnit = pUnit; }
785
787 constexpr GX_CSTR getDropFilePath( void ) { return _dropFilePath; }
789 constexpr void setDropFilePath(GX_CSTR filePath) { GX_ASSERT(filePath, "nullptrには設定できません"); _dropFilePath = filePath; }
790
792 GxUnitBase* createUnit( GX_CSTR filePath );
793
795 void setCurrentHandle( GxHandle* pHandle );
796
798 constexpr GxHandle* getCurrentHandle( void ){ return _pCurrentHandle; }
799
801 GxHandle* allocateHandle(const u32 handleTypeFlag = GxHandle::HANDLE_TYPE_ALL);
802
804 void freeHandle(GxHandle* pHandle);
805
807 GxHandle* getNearestHandle( const GxPoint2& position, s32& lengthSquare );
808
810 GX_FORCE_INLINE GxHandleConfig* getHandleConfig( void ){ return &_handleConfig; }
811
812protected:
813#if defined(_WINDOWS)
815 GX_FORCE_INLINE b32 initializeWindows(void) { return true; }
817 void setAppWindow( const GxPoint2& position, const GxSize& size, b32 maximize );
818#endif //_WINDOWS
819
821 void drawGrid( void );
822
824 void updateSafetyArea( void );
825
827 void updateScreenMatrix( void );
828
830 void renderPreGui( void );
831
833 void renderPostGui( void );
834public:
836 void renderAxis(const GxPoint2& offset, const GxSize& resolution);
838 void renderPause(const GxPoint2& offset);
840 void renderPadAll(const GxPoint2& offset, const GxSize& resolution);
841protected:
843 void renderPad( const GxPad* pPad, const GxPoint2& position );
844
846 virtual void addMenuBarTableFile(GxPropertyTable& table);
848 virtual void addMenuBarTableEdit(GxPropertyTable& table);
850 virtual void addMenuBarTableView(GxPropertyTable& table);
852 virtual void addMenuBarTableTools(GxPropertyTable& table);
854 virtual void addMenuBarTableHelp(GxPropertyTable& table);
855private:
856#if !GX_EDITOR
858 GxPropertyTable createRightClickMenuTable(void);
859#endif // !GX_EDITOR
861 void addMenuTableToolChild(GxPropertyTable& table, const GxRtti* pRttiParent, const GxRtti* pRttiExcept = nullptr);
862
863#if defined(_WINDOWS)
864public:
866 virtual GxPropertyTable createMenuBarTable( void );
868 virtual GxPropertyTable createToolBarTable( void );
870 void eventHandleTranslate(void);
872 void eventHandleRotate(void);
874 void eventHandleScale(void);
876 void eventHandleLocalTranslate(void);
877#endif // _WINDOWS
878
879public:
881 GxUnitLocate* getUnitFromHandle(GxHandle* pHandle);
883 GxUnitLocate* getOldSelectUnit(void);
884
886 GxUnit2DBase* getUnitFromHandle2D(GxHandle* pHandle);
887
889 void eventSaveScreenshot(void);
890
891protected:
893 GxGuiFileDialog* setFileDialog( GxString* pFullPath, const GxRttiResource& resRtti, const GxProperty& okEvent, const GxGuiFileDialog::MODE mode );
894
895public:
897 void addAndSaveFileRecord( GxResBase* pRes );
898
900 void addFileRecord( GX_CSTR pPath, GX_CSTR pExtension, GX_CSTR pTime = nullptr );
901
903 GX_FORCE_INLINE GxArrayClassBase& getFileRecordList( void ){ return _fileRecordList; }
904
906 void clearAllFileRecord( void );
907
909 void loadFileRecord( void );
910
912 void saveFileRecord( void );
913
914public:
916 void addAndSaveFavoriteFolder(GX_CSTR path);
917
919 void addFavoriteFolder(GX_CSTR path);
920
922 void removeAndSaveFavoriteFolder(GX_CSTR path);
923
925 void removeFavoriteFolder(GX_CSTR path);
926
928 GX_FORCE_INLINE GxArrayClassBase& getFavoriteFolderList(void){ return _favoriteFolderList; }
929
931 void clearAllFavoriteFolder(void);
932
934 void loadFavoriteFolder(void);
935
937 void saveFavoriteFolder(void);
938
939public:
941 void openOnlineHelp(const GxRtti* pRtti);
943 GX_FORCE_INLINE virtual GxString getDefaultBackgroundResource(void) { return ""; }
945 GX_FORCE_INLINE virtual s32 getDefaultCharacterMotionNo(void) { return 0; }
947 GX_FORCE_INLINE const GxString& getMotionToolConfigFile(void) const { return _motionToolConfigFilePath; }
948
949protected:
951 void updateSingleStep( void );
952
953public:
955 constexpr GxPrimitiveManager* getPrimitiveManager2D(void) const { return _pManager2D; }
957 constexpr GxPrimitiveManager* getPrimitiveManager3D(void) const { return _pManager3D; }
958
959private:
960#if defined(GX_THREAD_LOCAL_STORAGE)
962 GX_FORCE_INLINE GxPrimitiveContext* getContext2D(void) { return _pContext2D; }
964 GX_FORCE_INLINE GxPrimitiveContext* getContext3D(void) { return _pContext3D; }
965#else //GX_THREAD_LOCAL_STORAGE
967 GX_FORCE_INLINE GxPrimitiveContext* getContext2D(void) { return _pContext2D[GxThread::getCurrentThread()->getIndex()]; }
969 GX_FORCE_INLINE GxPrimitiveContext* getContext3D(void) { return _pContext3D[GxThread::getCurrentThread()->getIndex()]; }
970#endif // !GX_THREAD_LOCAL_STORAGE
971
972protected:
974 b32 createGuiDevelop( void );
975
977 b32 initializeLoadSystemConfig(const GxToolInitialInformation* pToolInitialInformation);
978#if defined(_WINDOWS)
980 void eventCreateToolAndLoad( void* pArgument );
981#endif //_WINDOWS
983 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index);
985 static GX_CSTR DRAW_FLAG_NAME[static_cast<s32>(DRAW_FLAG_INDEX::MAX)];
986
987private:
989 void setFontVertexData(GxPrimitiveVertex*& pVertex, const GxVector3& positionLeftTop, const GxVector3& positionRightBottom, const GxFloat2& uvLeftTop, const GxFloat2& uvRightBottom, const GxColor& color);
990
991public:
993 GX_FORCE_INLINE GxClipboard* getClipboard(void){ return &_clipboard; }
994
996 constexpr GxArrayClassBase& getUnitTreeSelectNodes( void ) { return _unitTreeSelectNodes; }
998 constexpr GxArrayClassBase& getUnitTreeCutNodes( void ) { return _unitTreeCutNodes; }
1000 constexpr GxClassBaseRoot* getUnitTreeLastSelectNode( void ) { return _pUnitTreeLastSelectNode; }
1002 GX_FORCE_INLINE void setUnitTreeLastSelectNode( GxClassBaseRoot* pUnit ) { _pUnitTreeLastSelectNode = pUnit; }
1003
1005 constexpr GX_ENUM* getSettableTool(void) const { return _pSettableTool; }
1007 constexpr u32 getNumSettableTool(void) const { return _numSettableTool; }
1008
1010 constexpr GxGuiProgressWindow* getProgressWindow(void) const { return _pProgressWindow; }
1011
1013 //-------------------------------------------------------------
1015 //-------------------------------------------------------------
1017protected:
1018 u32 _windowCreateCount;
1019 GxMatrix44 _screenMatrix;
1020 GxResSystemConfig* _pResConfig;
1021 b32 _controlXSI;
1022 b32 _isUseZTestDrawHandle;
1023
1024 GxGuiSystem* _pGui;
1025 GxPropertyTable _defaultMenuTable;
1027
1028 GxArray* _pListToolNameWithHelp;
1029
1030private:
1031 GxPrimitiveManager* _pManager2D;
1032 GxPrimitiveManager* _pManager3D;
1033 u32 _subPriority2D;
1034 u32 _subPriority3D;
1035
1036#if defined(GX_THREAD_LOCAL_STORAGE)
1037 static GX_THREAD_LOCAL_STORAGE GxPrimitiveContext* _pContext2D;
1038 static GX_THREAD_LOCAL_STORAGE GxPrimitiveContext* _pContext3D;
1039#else //GX_THREAD_LOCAL_STORAGE
1040 static GxPrimitiveContext* _pContext2D[GxThread::THREAD_MAX];
1041 static GxPrimitiveContext* _pContext3D[GxThread::THREAD_MAX];
1042#endif // !GX_THREAD_LOCAL_STORAGE
1043
1044 GxResTexture* _pResFontTexture;
1045 GxFontTable _fontTable;
1047
1048 GxResThumbnailTno* _pResThumbnail;
1049 GxResTexture* _pResCheckTexture;
1050#if GX_EDITOR
1051 b32 _outsideWindowFlag;
1052#endif //GX_EDITOR
1053 GxString _onlineHelpURLFilePath;
1054 GxString _motionToolConfigFilePath;
1055
1056 b32 _singleStepInputOld;
1057 s32 _singleStepRepeatStart;
1058 s32 _singleStepRepeatSpan;
1059 s32 _singleStepRepeatCounter;
1060
1061 GxGuiProcessBar* _pGuiProcessBar;
1062 GxGuiFps* _pGuiFps;
1063
1064 GxArrayClassBase _handleArray;
1065 GxArrayClassBase _handleFreeArray;
1066 GxArrayClassBase _handleBufferArray;
1067 GxHandle* _pCurrentHandle;
1068 GxHandleConfig _handleConfig;
1069 GxUnitLocate* _pOldSelectUnit;
1070 GxPoint2 _onMousePosition;
1071 b32 _isMultiSelect;
1072
1073 GxArrayClassBase _fileRecordList;
1074
1075 GxArrayClassBase _favoriteFolderList;
1076
1077 BASIS_CORNER _padInfoBasis;
1078 GxPoint2 _padInfoOffset;
1079 b32 _padInfoIsDirectionY;
1080 b32 _isBlink;
1081 f32 _blinkTime;
1082 b32 _isRenderOrtho;
1083 b32 _isRenderOrthoOld;
1084 GxColor _jointFontColor;
1085 u32 _jointFontSize;
1086 u32 _maxPropertyEnumHeight;
1087
1088 b32 _fileDialogUseOriginalPath;
1089 b32 _isReportLog;
1090 GxString _reportString;
1091 f32 _reportDrawTime;
1092
1093 GxClipboard _clipboard;
1094 GxUnitBase* _pDropUnit;
1095 GX_CSTR _dropFilePath;
1096
1097 std::function<void(void)> _createAsyncToolCallbacks[CREATE_ASYNC_TOOL_MAX];
1098 u32 _createAsyncToolCount;
1099
1100 GxArrayClassBase _unitTreeSelectNodes;
1101 GxArrayClassBase _unitTreeCutNodes;
1102 GxClassBaseRoot* _pUnitTreeLastSelectNode;
1103
1104 GX_ENUM* _pSettableTool;
1105 u32 _numSettableTool;
1106
1107 GxGuiProgressWindow* _pProgressWindow;
1108
1110};
1111
1112//===========================================================================
1113// アクセスインターフェース
1114//===========================================================================
1115GX_FORCE_INLINE GxSysTool* getGxSysTool(void){ return GxSysTool::getSingletonPointer(); }
1116
1117//===========================================================================
1119//===========================================================================
1120class GxSysTool::GxPropertySortNode : public GxClassBase
1121{
1122 //-------------------------------------------------------------
1124 //-------------------------------------------------------------
1126public:
1127 // RTTI定義
1128 GX_RTTI_CLASS( GxSysTool::GxPropertySortNode, GxClassBase )
1129 // new, delete定義
1130 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1131
1132
1133 //-------------------------------------------------------------
1135 //-------------------------------------------------------------
1137
1139 GxPropertySortNode( void ){}
1141 ~GxPropertySortNode( void ) override {}
1142
1144 //-------------------------------------------------------------
1146 //-------------------------------------------------------------
1148
1149 GxString _name;
1150 GxPropertyTable _subTable;
1151
1153};
1154
1155//===========================================================================
1156// システムコンフィグ関連クラス
1157//===========================================================================
1158//===========================================================================
1160//===========================================================================
1161class GxSysTool::GxLocationDataTool : public GxClassBase
1162{
1163 //-------------------------------------------------------------
1165 //-------------------------------------------------------------
1167public:
1168 // RTTI定義
1169 GX_RTTI_CLASS( GxSysTool::GxLocationDataTool, GxClassBase )
1170 // new, delete定義
1171 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1172
1173
1174 //-----------------------------------------------------------
1176 //-----------------------------------------------------------
1178
1180 GxLocationDataTool( void );
1181
1183 ~GxLocationDataTool( void ) override;
1184
1186 //-----------------------------------------------------------
1188 //-----------------------------------------------------------
1190
1192 constexpr GxArrayClassBase* getList( void ) { return &_listToolElement; }
1193
1195 //-----------------------------------------------------------
1197 //-----------------------------------------------------------
1199private:
1200 GxArrayClassBase _listToolElement;
1201
1203};
1204
1205//===========================================================================
1207//===========================================================================
1208struct GxSysTool::GxDataInitialize : public GxStructBase
1209{
1210 //-----------------------------------------------------------
1212 //-----------------------------------------------------------
1214public:
1215 // RTTI宣言
1216 GX_RTTI_STRUCT(GxDataInitialize);
1217
1219 //-----------------------------------------------------------
1221 //-----------------------------------------------------------
1223public:
1225 GxDataInitialize(void);
1227 GxDataInitialize(u32 /*unuse*/) {}
1228
1230 //-----------------------------------------------------------
1232 //-----------------------------------------------------------
1234public:
1236 void loadJson(const GxJson::GxJsonNode& jsonNode);
1237
1239 //-----------------------------------------------------------
1241 //-----------------------------------------------------------
1243public:
1244 // GUI色関連
1245 GxColor _guiFrameColor;
1246 GxColor _guiBackColor;
1247 GxColor _guiTextColor;
1248 GxColor _guiKeyWord1Color;
1249 GxColor _guiKeyWord2Color;
1250 GxColor _guiSelectedColor;
1251 GxRect _guiExpandFrameRect;
1252
1253 GxColor _buttonOffColor[4];
1254 f32 _buttonOffColorValue[4];
1255 GxColor _buttonOnColor[4];
1256 f32 _buttonOnColorValue[4];
1257
1258 // 画面サイズ関連
1259 GxPoint2 _posAppWindow;
1260 GxSize _sizeAppWindow;
1261 b32 _isAppWindowMaximized;
1262
1263 // その他
1264 b32 _duplicateControlXSI;
1265 b32 _isUseZTestDrawHandle;
1266
1267 // カスタムクリアカラー使う
1268 b32 _useCustomClearColor;
1269 GxColor _customClearColor;
1270
1271 //
1272 b32 _isRealFloatFormat;
1273 b32 _fileDialogUseOriginalPath;
1274
1275 b32 _useRTDWheelScrollAlways;
1276 b32 _isStopRTDPlayByClick;
1277
1278 GxGuiConfig _guiConfig;
1279 GxHandleConfig _handleConfig;
1280
1282};
1283
1284//===========================================================================
1286//===========================================================================
1287class GxSysTool::GxToolElement : public GxClassBase
1288{
1289 //-------------------------------------------------------------
1291 //-------------------------------------------------------------
1293public:
1294 static const u32 TAB_TOOL_MAX = 4;
1295
1296 // RTTI定義
1297 GX_RTTI_CLASS(GxSysTool::GxToolElement, GxClassBase)
1298 // new, delete定義
1299 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1300
1301
1302 //-----------------------------------------------------------
1304 //-----------------------------------------------------------
1306
1308 GxToolElement(void);
1310 ~GxToolElement(void);
1311
1313 //-----------------------------------------------------------
1315 //-----------------------------------------------------------
1317
1318 const GxRtti* _pToolRtti[TAB_TOOL_MAX];
1319 b32 _movable[TAB_TOOL_MAX];
1320 b32 _closable[TAB_TOOL_MAX];
1321 GxToolElement* _pToolElement0;
1322 GxToolElement* _pToolElement1;
1323 GxGuiSplitter::OFFSET_BASIS _offsetBasis;
1324 s32 _offset;
1325
1327};
1328
1329//===========================================================================
1331//===========================================================================
1332class GxSysTool::GxDataProcessBar : public GxClassBase
1333{
1334 //-------------------------------------------------------------
1336 //-------------------------------------------------------------
1338public:
1339 // RTTI定義
1340 GX_RTTI_CLASS( GxSysTool::GxDataProcessBar, GxClassBase )
1341 // new, delete定義
1342 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1343
1344
1345 //-----------------------------------------------------------
1347 //-----------------------------------------------------------
1349
1351 GxDataProcessBar( void );
1353 ~GxDataProcessBar( void ) override {}
1354
1356 //-----------------------------------------------------------
1358 //-----------------------------------------------------------
1360
1362 void loadJson(const GxJson::GxJsonNode& jsonNode);
1363
1364 //---- プロパティ設定
1365 void getBasisBarProperty( s32* pBasis );
1366 void setBasisBarProperty( const s32* const pBasis );
1367 void getBasisFpsProperty( s32* pBasis );
1368 void setBasisFpsProperty( const s32* const pBasis );
1369
1371 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
1372
1374 //-----------------------------------------------------------
1376 //-----------------------------------------------------------
1378
1379 u32 _width;
1380 GxPoint2 _position;
1381 u32 _lengthRatio;
1382 b32 _isBarDirectionY;
1383 b32 _drawAll;
1384 b32 _drawSubThread;
1385 GxPoint2 _fpsPosition;
1386
1387 BASIS_CORNER _basisBar;
1388 BASIS_CORNER _basisFps;
1389
1391};
1392
1393//===========================================================================
1395//===========================================================================
1396class GxSysTool::GxDataPadInformation : public GxClassBase
1397{
1398 //-------------------------------------------------------------
1400 //-------------------------------------------------------------
1402public:
1403 // RTTI定義
1404 GX_RTTI_CLASS( GxSysTool::GxDataPadInformation, GxClassBase )
1405 // new, delete定義
1406 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1407
1408
1409 static const GxPoint2 POSITION_DEFAULT;
1410
1412 //-----------------------------------------------------------
1414 //-----------------------------------------------------------
1416
1418 GxDataPadInformation( void );
1420 ~GxDataPadInformation( void ) override {}
1421
1423 //-----------------------------------------------------------
1425 //-----------------------------------------------------------
1427
1429 void loadJson(const GxJson::GxJsonNode& jsonNode);
1430
1432 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
1433
1435 void getBasisProperty( s32* pBasis );
1437 void setBasisProperty( const s32* const pBasis );
1438
1440 //-----------------------------------------------------------
1442 //-----------------------------------------------------------
1444
1445 BASIS_CORNER _basis;
1446 GxPoint2 _offset;
1447 b32 _isDirectionY;
1448
1450};
1451
1452//===========================================================================
1454//===========================================================================
1455class GxSysTool::GxDataMouseInformation : public GxClassBase
1456{
1457 //-------------------------------------------------------------
1459 //-------------------------------------------------------------
1461public:
1462 // RTTI定義
1463 GX_RTTI_CLASS( GxSysTool::GxDataMouseInformation, GxClassBase )
1464 // new, delete定義
1465 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1466
1467
1468 //-----------------------------------------------------------
1470 //-----------------------------------------------------------
1472
1474 GxDataMouseInformation( void );
1476 ~GxDataMouseInformation( void ) override {}
1477
1479 //-----------------------------------------------------------
1481 //-----------------------------------------------------------
1483
1485 void loadJson(const GxJson::GxJsonNode& jsonNode);
1486
1488 //-----------------------------------------------------------
1490 //-----------------------------------------------------------
1492
1493 b32 _isBlink;
1494 f32 _blinkTime;
1495
1497};
1498//===========================================================================
1500//===========================================================================
1501class GxSysTool::GxDataModelInformation : public GxClassBase
1502{
1503 //-------------------------------------------------------------
1505 //-------------------------------------------------------------
1507public:
1508 // RTTI定義
1509 GX_RTTI_CLASS( GxSysTool::GxDataModelInformation, GxClassBase )
1510 // new, delete定義
1511 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1512
1513
1514 //-----------------------------------------------------------
1516 //-----------------------------------------------------------
1518
1520 GxDataModelInformation( void );
1522 ~GxDataModelInformation( void ) override {}
1523
1525 //-----------------------------------------------------------
1527 //-----------------------------------------------------------
1529
1531 void loadJson(const GxJson::GxJsonNode& jsonNode);
1532
1534 //-----------------------------------------------------------
1536 //-----------------------------------------------------------
1538
1539 GxColor _jointFontColor;
1540 u32 _jointFontSize;
1541
1543};
1544
1545//===========================================================================
1546// デスクトップGUI系
1547//===========================================================================
1548//===========================================================================
1549// GUI表示設定保存用データクラス
1550//===========================================================================
1551class GxSysTool::GxDataGUIInformation : public GxClassBase
1552{
1553 //-------------------------------------------------------------
1555 //-------------------------------------------------------------
1557public:
1558 // RTTI定義
1559 GX_RTTI_CLASS(GxSysTool::GxDataGUIInformation, GxClassBase)
1560 // new, delete定義
1561 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1562
1563
1564 //-----------------------------------------------------------
1566 //-----------------------------------------------------------
1568
1570 GxDataGUIInformation(void);
1572 ~GxDataGUIInformation(void) override {}
1573
1575 //-----------------------------------------------------------
1577 //-----------------------------------------------------------
1579
1581 void loadJson(const GxJson::GxJsonNode& jsonNode);
1582
1584 //-----------------------------------------------------------
1586 //-----------------------------------------------------------
1588
1589 u32 _maxPropertyEnumHeight;
1590
1592};
1593//===========================================================================
1595//===========================================================================
1596class GxSysTool::GxGuiProcessBar : public GxGuiBase
1597{
1598 //-----------------------------------------------------------
1600 //-----------------------------------------------------------
1602public:
1603 GX_RTTI_CLASS(GxSysTool::GxGuiProcessBar, GxGuiBase)
1604 // GxClassBaseReference継承クラス用禁止宣言
1605 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiProcessBar)
1606
1607
1608 static constexpr u32 PROCESS_BAR_WIDTH_DEFAULT = 3;
1610 static constexpr u32 PROCESS_BAR_LENGTH_RATIO_DEFAULT = 100;
1611
1613 static const b32 PROCESS_BAR_IS_BAR_DIRECTIN_Y_DEFAULT;
1615 static const GxPoint2 PROCESS_BAR_POSITION_DEFAULT;
1617 static const GxRect PROCESS_BAR_BUTTON_RECT_ALL;
1619 static const GxRect PROCESS_BAR_BUTTON_RECT;
1620
1622 //-----------------------------------------------------------
1624 //-----------------------------------------------------------
1626
1628 GxGuiProcessBar(void);
1629
1631 b32 initialize( void ) override;
1632
1634 //-----------------------------------------------------------
1636 //-----------------------------------------------------------
1638
1640 void setProcessBarData( const GxDataProcessBar& data );
1641
1643 void getProcessBarData( GxDataProcessBar& data );
1644
1646 GX_FORCE_INLINE b32 isOnProcessBar( void ) const { return _drawAll;}
1647
1649 //-----------------------------------------------------------
1651 //-----------------------------------------------------------
1653protected:
1655 void update( void ) override;
1656
1658 void onClick( const GxPoint2& position, u32 button ) override;
1659
1661 void onDraw( void ) override;
1662
1663private:
1665 void drawProcessBar( void );
1666
1668 void drawProcessBarBody( const GxProfiler::GxLog* pLog, const u32 bufferIndex, const u32 maxLen, const f32 denom, GxRect& bar );
1669
1671 void drawScale( const GxRect& frame, const GxRect& barMax );
1672
1674 void updateGuiRegion( void );
1675
1677 //-----------------------------------------------------------
1679 //-----------------------------------------------------------
1681
1682 u32 _barWidth;
1683 GxPoint2 _barPosition;
1684 u32 _lengthRatio;
1685 b32 _isBarDirectionY;
1686 b32 _drawSubThread;
1687 GxRect _buttonRect;
1688
1689 BASIS_CORNER _basisBar;
1690
1691 b32 _drawAll;
1692 GxRect _buttonRectAll;
1693
1694 GxSize _oldOutputResolution;
1695 u32 _oldThreadProfilerCount;
1696
1698};
1699
1700//===========================================================================
1702//===========================================================================
1703class GxSysTool::GxGuiFps : public GxGuiBase
1704{
1705 //-----------------------------------------------------------
1707 //-----------------------------------------------------------
1709public:
1710 GX_RTTI_CLASS(GxSysTool::GxGuiFps, GxGuiBase)
1711
1712
1713 static const GxPoint2 PROCESS_BAR_FPS_POSITION_DEFAULT;
1715 static const u32 PROCESS_BAR_FPS_DRAW_STRING_MAX;
1716
1718 //-----------------------------------------------------------
1720 //-----------------------------------------------------------
1722public:
1724 GxGuiFps(void);
1725
1727 //-----------------------------------------------------------
1729 //-----------------------------------------------------------
1731protected:
1733 void update(void) override;
1735 void onDraw(void) override;
1736
1738 //-----------------------------------------------------------
1740 //-----------------------------------------------------------
1742public:
1744 GX_FORCE_INLINE void setFpsPosition(const GxPoint2& position) { _fpsPosition = position; }
1746 constexpr void setBasis(BASIS_CORNER basis) { _basis = basis; }
1747
1749 //-----------------------------------------------------------
1751 //-----------------------------------------------------------
1753private:
1754 GxPoint2 _fpsPosition;
1755 BASIS_CORNER _basis;
1756
1758};
1759
1760//===========================================================================
1762//===========================================================================
1763class GxSysTool::GxFileRecord : public GxClassBase
1764{
1765 //-------------------------------------------------------------
1767 //-------------------------------------------------------------
1769public:
1770 // RTTI定義
1771 GX_RTTI_CLASS( GxSysTool::GxFileRecord, GxClassBase )
1772 // new, delete定義
1773 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1774
1775
1776 //-----------------------------------------------------------
1778 //-----------------------------------------------------------
1780
1782 GxFileRecord( void ){}
1784 ~GxFileRecord( void ) override {}
1785
1787 //-----------------------------------------------------------
1789 //-----------------------------------------------------------
1791public:
1793 GX_FORCE_INLINE void setPath( GX_CSTR path ){ GX_ASSERT(path,"pPath is nullptr"); _path = path; updateFileName(); }
1795 GX_FORCE_INLINE void setExtension( GX_CSTR extension ){ GX_ASSERT(extension,"pExtension is nullptr"); _extension = extension; updateFileName(); }
1797 GX_FORCE_INLINE void setTime( GX_CSTR time ){ _time = time; }
1799 GX_FORCE_INLINE void setFileName( GX_CSTR fileName ){ _fileName = fileName; }
1800
1802 constexpr GX_CSTR getPath( void ) const { return _path.getString(); }
1804 constexpr GX_CSTR getExtension( void ) const { return _extension.getString(); }
1806 constexpr GX_CSTR getTime( void ) const { return _time.getString(); }
1808 constexpr GX_CSTR getFileName( void ) const { return _fileName.getString(); }
1809
1811 //-----------------------------------------------------------
1813 //-----------------------------------------------------------
1815protected:
1817 GX_FORCE_INLINE void updateFileName( void ){ _fileName = _path + GxString(".") + _extension; }
1818
1820 //-----------------------------------------------------------
1822 //-----------------------------------------------------------
1824protected:
1825 GxString _path;
1826 GxString _extension;
1827 GxString _time;
1828
1829 GxString _fileName;
1830
1832};
1833
1834//===========================================================================
1836//===========================================================================
1837class GxSysTool::GxFavoriteFolder : public GxClassBase
1838{
1839 //-------------------------------------------------------------
1841 //-------------------------------------------------------------
1843public:
1844 // RTTI定義
1845 GX_RTTI_CLASS(GxSysTool::GxFavoriteFolder, GxClassBase)
1846
1847
1848 //-----------------------------------------------------------
1850 //-----------------------------------------------------------
1852
1854 GxFavoriteFolder(void){}
1856 ~GxFavoriteFolder(void) override {}
1857
1859 //-----------------------------------------------------------
1861 //-----------------------------------------------------------
1863public:
1865 GX_FORCE_INLINE void setPath(GX_CSTR path){ GX_ASSERT(path, "pPath is nullptr"); _path = path; }
1867 constexpr GX_CSTR getPath(void) const { return _path.getString(); }
1868
1870 //-----------------------------------------------------------
1872 //-----------------------------------------------------------
1874protected:
1875 GxString _path;
1876
1878};
1879
1880//===========================================================================
1882//===========================================================================
1883class GxSysTool::GxGuiMenuSelectTool : public GxGuiMenu
1884{
1885 //-------------------------------------------------------------
1887 //-------------------------------------------------------------
1889public:
1890 // RTTI定義
1891 GX_RTTI_CLASS( GxGuiMenuSelectTool, GxGuiMenu )
1892
1893
1894 //-----------------------------------------------------------
1896 //-----------------------------------------------------------
1898
1900 GxGuiMenuSelectTool( void ):_pResBase(nullptr){}
1902 GxGuiMenuSelectTool( const GxPoint2& position, GxGuiWindow* pGuiWindow ) : Super(position, pGuiWindow), _pResBase(nullptr){};
1903
1905 void cleanup( void ) override;
1906
1908 //-----------------------------------------------------------
1910 //-----------------------------------------------------------
1912public:
1914 GX_FORCE_INLINE void setResBase( GxResBase* pResBase ){ GX_ASSERT(pResBase, "pResBase is nullptr"); _pResBase = pResBase; _pResBase->addReference(); }
1915
1917 void setCreateToolArrayRtti( const GxArray& rttiArray );
1918
1919private:
1921 void eventCreateToolAndSetResource( void* pArgument );
1922
1924 //-----------------------------------------------------------
1926 //-----------------------------------------------------------
1928protected:
1929 GxResBase* _pResBase;
1930
1932};
1933
1934//===========================================================================
1936//===========================================================================
1937class GxSysTool::GxDataToolShortcut : public GxClassBase
1938{
1939 //-------------------------------------------------------------
1941 //-------------------------------------------------------------
1943public:
1944 // RTTI定義
1945 GX_RTTI_CLASS(GxDataToolShortcut, GxClassBase)
1946 // GxClassBaseReference継承クラス用禁止宣言
1947 GX_PROHIBIT_CLASS_BASE(GxDataToolShortcut)
1948 // new, delete定義
1949 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
1950
1951
1952 //-------------------------------------------------------------
1954 //-------------------------------------------------------------
1956
1958 GxDataToolShortcut(void);
1959
1961 //-------------------------------------------------------------
1963 //-------------------------------------------------------------
1965
1967 void loadJson(const GxJson::GxJsonNode& jsonNode);
1969 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
1970
1972 //-------------------------------------------------------------
1974 //-------------------------------------------------------------
1976
1978 constexpr u32 getToolId(void) const { return _toolId; }
1980 constexpr void setToolId(u32 id) { _toolId = id; }
1982 constexpr GxKeyboard::KEY getTriggerKey(void) const { return _triggerKey; }
1984 constexpr void setTriggerKey(GxKeyboard::KEY key) { _triggerKey = key; }
1986 GX_FORCE_INLINE b32 getSearchChild(void) const { return _searchChild; }
1988 GX_FORCE_INLINE void setSearchChild(b32 searchChild) { _searchChild = searchChild; }
1989
1991 //-------------------------------------------------------------
1993 //-------------------------------------------------------------
1995private:
1996 u32 _toolId;
1997 GxKeyboard::KEY _triggerKey;
1998 b32 _searchChild;
1999
2001};
2002
2003//===========================================================================
2005//===========================================================================
2006class GxToolInitialInformation : public GxClassBase
2007{
2008 //-----------------------------------------------------------
2010 //-----------------------------------------------------------
2012public:
2013 // RTTI定義
2014 GX_RTTI_CLASS(GxToolInitialInformation, GxClassBase)
2015 // GxClassBase継承クラス用禁止宣言
2016 GX_PROHIBIT_CLASS_BASE(GxToolInitialInformation)
2017
2018
2019 //-------------------------------------------------------------
2021 //-------------------------------------------------------------
2023public:
2025 GxToolInitialInformation(void);
2026
2028 //-----------------------------------------------------------
2030 //-----------------------------------------------------------
2032
2034 void loadJson(const GxJson::GxJsonNode& jsonNode);
2035
2036#if GX_DEVELOP
2038 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index);
2039#endif // GX_DEVELOP
2040
2042 //-----------------------------------------------------------
2044 //-----------------------------------------------------------
2046
2048 GX_FORCE_INLINE void setServerSize3D(u32 bufferSize, u32 vertexBufferSize, u32 indexBufferSize, b32 use32BitIndex = false)
2049 {
2050 _bufferSize3D = bufferSize;
2051 _vertexBufferSize3D = vertexBufferSize;
2052 _indexBufferSize3D = indexBufferSize;
2053 _use32BitIndex3D = use32BitIndex;
2054 }
2055
2057 GX_FORCE_INLINE void setServerSize2D(u32 bufferSize, u32 vertexBufferSize, u32 indexBufferSize, b32 use32BitIndex = false)
2058 {
2059 _bufferSize2D = bufferSize;
2060 _vertexBufferSize2D = vertexBufferSize;
2061 _indexBufferSize2D = indexBufferSize;
2062 _use32BitIndex2D = use32BitIndex;
2063 }
2064
2066 constexpr void setThreadProfilingLogMax(u32 logMax) { _threadProfilingLogMax = logMax; }
2067
2069 //-----------------------------------------------------------
2071 //-----------------------------------------------------------
2073
2074 u32 _bufferSize3D;
2075 u32 _vertexBufferSize3D;
2076 u32 _indexBufferSize3D;
2077 b32 _use32BitIndex3D;
2078 u32 _bufferSize2D;
2079 u32 _vertexBufferSize2D;
2080 u32 _indexBufferSize2D;
2081 b32 _use32BitIndex2D;
2082 u32 _threadProfilingLogMax;
2083 GX_CSTR _configFileSuffix;
2084 GxString _onlineHelpURLFilePath;
2085 GxString _motionToolConfigFilePath;
2086
2087 GxSysTool::GxDataInitialize _dataInitialize;
2088 GxSysTool::GxDataProcessBar _dataProcessBar;
2089 GxSysTool::GxDataPadInformation _dataPadInformation;
2090 GxSysTool::GxDataMouseInformation _dataMouseInformation;
2091 GxSysTool::GxDataModelInformation _dataModelInformation;
2092 GxSysTool::GxDataGUIInformation _dataGUIInformation;
2093 GxSysTool::GxDataToolShortcut _shortcuts[static_cast<s32>(GxKeyboard::KEY::Z) - static_cast<s32>(GxKeyboard::KEY::A)];
2094
2096};
2097
2098//===========================================================================
2101//===========================================================================
2102template<class T> class GxSysTool::GxIteratorDesktop
2103{
2104 //-----------------------------------------------------------
2106 //-----------------------------------------------------------
2108public:
2110 GxIteratorDesktop(void) : _pCurrent( nullptr ) {}
2112 virtual ~GxIteratorDesktop(void) { _pCurrent = nullptr; }
2113
2115 //-----------------------------------------------------------
2117 //-----------------------------------------------------------
2119
2121 T* getTop( void );
2123 T* getNext( void );
2124private:
2126 T* getNextSub(GxGuiBase* pTop);
2128 T* getNextFromParent(GxGuiBase* pTarget);
2129
2131 //-----------------------------------------------------------
2133 //-----------------------------------------------------------
2135private:
2136 T* _pCurrent;
2137
2139};
2140
2141template<class T>
2142T* GxSysTool::GxIteratorDesktop<T>::getTop( void )
2143{
2144 // GxGuiWindow継承以外は早めにはじく
2145 if (T::GX_RTTI.isDerived(GxGuiWindow::GX_RTTI) && getGxGuiSystem()->getDesktop())
2146 {
2147 _pCurrent = getNextSub(getGxGuiSystem()->getDesktop()->getChild());
2148 return _pCurrent;
2149 }
2150 _pCurrent = nullptr;
2151 return nullptr;
2152}
2153
2154template<class T>
2155T* GxSysTool::GxIteratorDesktop<T>::getNext(void)
2156{
2157 if (!_pCurrent->getNext())
2158 {
2159 // 終端に来たら親をたどる
2160 _pCurrent = getNextFromParent(_pCurrent);
2161 return _pCurrent;
2162 }
2163 _pCurrent = getNextSub(_pCurrent->getNext());
2164 return _pCurrent;
2165}
2166
2167template<class T>
2168T* GxSysTool::GxIteratorDesktop<T>::getNextSub(GxGuiBase* pTop)
2169{
2170 for (auto* pGui = pTop; pGui; pGui = pGui->getNext())
2171 {
2172 if (pGui->getRtti().isDerived(T::GX_RTTI))
2173 {
2174 return static_cast<T*>(pGui);
2175 }
2176 else if (pGui->getRtti().isDerived(GxGuiSplitter::GX_RTTI))
2177 {
2178 auto* pGui0 = getNextSub(static_cast<GxGuiSplitter*>(pGui)->getGui0());
2179 if (pGui0)
2180 {
2181 return pGui0;
2182 }
2183 auto* pGui1 = getNextSub(static_cast<GxGuiSplitter*>(pGui)->getGui1());
2184 if (pGui1)
2185 {
2186 return pGui1;
2187 }
2188 }
2189 }
2190 return nullptr;
2191}
2192
2193template<class T>
2194T* GxSysTool::GxIteratorDesktop<T>::getNextFromParent(GxGuiBase* pTarget)
2195{
2196 auto* pSplitter = gx_cast<GxGuiSplitter*>(pTarget->getParent());
2197 if (pSplitter)
2198 {
2199 if (pSplitter->getGui0() == pTarget)
2200 {
2201 // GUI1を引き続き探索
2202 auto* pNext = getNextSub(pSplitter->getGui1());
2203 if (pNext)
2204 {
2205 return pNext;
2206 }
2207 }
2208 return getNextSub(pSplitter->getNext());
2209 }
2210 return nullptr;
2211}
2212
2213GX_CORE_NAMESPACE_END()
2214
2215#endif // GX_DEVELOP
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
T gx_cast(GxClassBaseRoot *pObject)
Definition GxBase.h:264
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
@ MAX
定義数
void GxTypedObject
その他
Definition GxDefine.h:213
PRIMITIVE_FILL_MODE
塗りつぶしモード
Definition GxPrimitive.h:31
@ SOLID
塗りつぶし
RENDER_VIEW
描画優先度(ビュー)
Definition GxRender.h:442
@ RIGHT_TOP
右上
@ RIGHT_BOTTOM
右下
@ LEFT_BOTTOM
左下
@ LEFT_TOP
左上
配列クラス
Definition GxArrayClassBase.h:18
参照カウンタ用配列クラス
Definition GxArrayClassBase.h:145
配列クラス
Definition GxArray.h:18
オブジェクト基底クラス
Definition GxBase.h:88
virtual s32 addReference(void)
参照カウンタを加算
Definition GxBase.cpp:303
基底クラス
Definition GxBase.h:51
フォントテーブル情報
Definition GxFontTable.h:236
フォントテーブルアクセス
Definition GxFontTable.h:35
JSON解析用ノード
Definition GxJson.h:108
static GX_FORCE_INLINE T getMax(const T value0, const T value1)
大きいほうを取得
Definition GxMath.h:174
パッドクラス
Definition GxInputPad.h:25
プリミティブの並列発行を管理します。
Definition GxPrimitiveContext.h:22
プリミティブの描画発行単位を管理します。
Definition GxPrimitiveManager.h:23
プロパティクラス
Definition GxProperty.h:48
プロパティテーブルクラス
Definition GxProperty.h:1641
テクスチャクラス
Definition GxRenderTexture.h:19
リソース基底クラス
Definition GxResBase.h:23
テクスチャリソース
Definition GxResTexture.h:23
実行時型情報クラス
Definition GxRtti.h:154
リソース実行時型情報クラス
Definition GxRttiResource.h:188
箱形状クラス
Definition GxShape.h:333
カプセル形状クラス
Definition GxShape.h:707
円柱形状クラス
Definition GxShape.h:634
角錐台
Definition GxShape.h:531
マルチ球形状クラス
Definition GxShape.h:776
球形状クラス
Definition GxShape.h:240
システム基底クラス
Definition GxSysBase.h:18
void forceExit(EXIT_CODE code)
強制終了(メインループの停止)
Definition GxSysMain.cpp:1176
@ NORMAL
正常終了
GX_FORCE_INLINE b32 isPause(void) const
一時停止中判定
Definition GxSysMain.h:693
GX_FORCE_INLINE b32 isStop(void) const
停止中判定
Definition GxSysMain.h:691
void setPause(b32 flag)
一時停止を設定
Definition GxSysMain.cpp:4503
GX_FORCE_INLINE const GxRect & getSafetyArea(void) const
セーフティエリアの取得
Definition GxSysRenderBase.h:167
GxUnitBase * createAndAddBottom(u32 listProcessNumber, u32 listKindNumber, const GxRtti &rtti)
指定リストの終端にユニットを追加作成
Definition GxSysUnit.cpp:379
static GxThread * getCurrentThread(void)
カレントスレッドを取得
Definition GxThread.cpp:505
constexpr u32 getIndex(void) const
インデックスを取得
Definition GxThread.h:251
static constexpr u32 THREAD_MAX
スレッドの最大数
Definition GxThread.h:188
2D基礎ユニットクラス
Definition GxUnit2DBase.h:24
ユニット基礎クラス
Definition GxUnitBase.h:45
座標ユニット基礎クラス
Definition GxUnitLocate.h:23
シングルトン基礎クラス
Definition GxSingleton.h:19
GUI用
Definition GxDefine.h:194
Definition GxColor.h:21
static const GxColor SYSTEM_AXIS_X
X軸
Definition GxColor.h:55
static const GxColor SYSTEM_AXIS_Z
Z軸
Definition GxColor.h:57
static const GxColor WHITE
Definition GxColor.h:37
static const GxColor SYSTEM_AXIS_Y
Y軸
Definition GxColor.h:56
インデックス指定型フラグ
Definition GxStruct.h:1294
2次元浮動小数点数クラス
Definition GxStruct.h:22
4×4行列(行優先)
Definition GxMatrix.h:607
アフィン変換行列(行優先)
Definition GxMatrix.h:330
座標
Definition GxStruct.h:867
プリミティブマテリアル
Definition GxPrimitive.h:103
static const GxPrimitiveMaterial DEFAULT_2D
2Dデフォルト
Definition GxPrimitive.h:136
プリミティブ頂点
Definition GxPrimitive.h:20
矩形
Definition GxStruct.h:951
サイズ
Definition GxStruct.h:730
文字列型クラス
Definition GxString.h:18
Definition GxBase.h:24
2次元ベクトル
Definition GxVector.h:34
3次元ベクトル
Definition GxVector.h:245
32bitブーリアン
Definition GxDefine.h:173