OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / direct3d9 / AnimationFrame.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
5 * of this software and associated documentation files (the "Software"), to deal\r
6 * in the Software without restriction, including without limitation the rights\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
8 * copies of the Software, and to permit persons to whom the Software is\r
9 * furnished to do so, subject to the following conditions:\r
10\r
11 * The above copyright notice and this permission notice shall be included in\r
12 * all copies or substantial portions of the Software.\r
13\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 #include "XFile.h"\r
25 \r
26 namespace SlimDX\r
27 {\r
28         value class BoundingSphere;\r
29 \r
30         namespace Direct3D9\r
31         {\r
32                 ref class Frame;\r
33                 ref class AnimationController;\r
34                 ref class MeshData;\r
35                 ref class MeshContainer;\r
36                 ref class Device;\r
37 \r
38                 class MeshContainerShim;\r
39 \r
40                 interface struct IAllocateHierarchy;\r
41                 interface struct ISaveUserData;\r
42                 interface struct ILoadUserData;\r
43 \r
44                 class FrameShim : public D3DXFRAME\r
45                 {\r
46                 private:\r
47                         gcroot<Frame^> m_Frame;\r
48 \r
49                 public:\r
50                         FrameShim( Frame^ frame );\r
51                         FrameShim( Frame^ frame, const D3DXFRAME &pFrame );\r
52 \r
53                         Frame^ GetFrame() { return m_Frame; }\r
54                 };\r
55 \r
56                 ///<summary>Describes a transform frame in a transformation hierarchy.</summary>\r
57                 ///<unmanaged>D3DXFRAME</unmanaged>\r
58                 public ref class Frame : System::IEquatable<Frame^>\r
59                 {\r
60                 internal:\r
61                         property D3DXFRAME *Pointer;\r
62 \r
63                         void Destruct();\r
64 \r
65                         System::String^ m_Name;\r
66                         Frame^ m_FirstChild;\r
67                         Frame^ m_Sibling;\r
68                         MeshContainer^ m_MeshContainer;\r
69 \r
70                         static Frame^ BuildHierarchyFromUnmanaged( FrameShim* pFrame );\r
71                         static void BuildManagedFrames( Frame^% frame, FrameShim* pFrame );\r
72                         static void BuildManagedMeshes( MeshContainer^% mesh, MeshContainerShim* pMesh );\r
73                         static void RegisterAnimations( Frame^ frame, LPD3DXANIMATIONCONTROLLER animation );\r
74 \r
75                 private:\r
76                         static Frame^ LoadHierarchyFromX_Internal( Device^ device, const void* memory, DWORD size, MeshFlags options, IAllocateHierarchy^ allocator, ILoadUserData^ userDataLoader, [Out] AnimationController^% animationController );\r
77 \r
78                 public:\r
79                         Frame();\r
80                         virtual ~Frame();\r
81                         !Frame();\r
82 \r
83                         static Frame^ LoadHierarchyFromX( Device^ device, System::String^ fileName, MeshFlags options, IAllocateHierarchy^ allocator, ILoadUserData^ userDataLoader, [Out] AnimationController^% animationController );\r
84                         static Frame^ LoadHierarchyFromX( Device^ device, array<System::Byte>^ memory, MeshFlags options, IAllocateHierarchy^ allocator, ILoadUserData^ userDataLoader, [Out] AnimationController^% animationController );\r
85                         static Frame^ LoadHierarchyFromX( Device^ device, System::IO::Stream^ stream, MeshFlags options, IAllocateHierarchy^ allocator, ILoadUserData^ userDataLoader, [Out] AnimationController^% animationController );\r
86 \r
87                         static Result SaveHierarchyToFile( System::String^ fileName, XFileFormat format, Frame^ root, AnimationController^ animationController, ISaveUserData^ userDataSaver );\r
88                         static Result SaveHierarchyToFile( System::String^ fileName, XFileFormat format, Frame^ root, AnimationController^ animationController );\r
89 \r
90                         Frame^ FindChild( System::String^ name );\r
91                         void AppendChild( Frame^ child );\r
92 \r
93                         static BoundingSphere CalculateBoundingSphere( Frame^ root );\r
94                         static Result DestroyHierarchy( Frame^ root, IAllocateHierarchy^ allocator );\r
95                         static int CountNamedFrames( Frame^ root );\r
96                         static void RegisterNamedMatrices( Frame^ root, AnimationController^ controller );\r
97 \r
98                         property System::String^ Name\r
99                         {\r
100                                 System::String^ get();\r
101                                 void set( System::String^ value );\r
102                         }\r
103 \r
104                         property Matrix TransformationMatrix\r
105                         {\r
106                                 Matrix get();\r
107                                 void set( Matrix value );\r
108                         }\r
109 \r
110                         property MeshContainer^ MeshContainer\r
111                         {\r
112                                 SlimDX::Direct3D9::MeshContainer^ get();\r
113                                 void set( SlimDX::Direct3D9::MeshContainer^ value );\r
114                         }\r
115 \r
116                         property Frame^ Sibling\r
117                         {\r
118                                 Frame^ get();\r
119                                 void set( Frame^ value );\r
120                         }\r
121 \r
122                         property Frame^ FirstChild\r
123                         {\r
124                                 Frame^ get();\r
125                                 void set( Frame^ value );\r
126                         }\r
127 \r
128                         static bool operator == ( Frame^ left, Frame^ right );\r
129                         static bool operator != ( Frame^ left, Frame^ right );\r
130 \r
131                         virtual System::String^ ToString() override;\r
132                         virtual int GetHashCode() override;\r
133                         virtual bool Equals( System::Object^ obj ) override;\r
134                         virtual bool Equals( Frame^ other );\r
135                         static bool Equals( Frame^ value1, Frame^ value2 );\r
136                 };\r
137         }\r
138 }\r