OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / direct3d9 / ProgressiveMesh.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 using System::Runtime::InteropServices::OutAttribute;\r
25 \r
26 namespace SlimDX\r
27 {\r
28         namespace Direct3D9\r
29         {\r
30                 ref class BaseMesh;\r
31                 ref class Mesh;\r
32                 ref class VertexBuffer;\r
33                 ref class IndexBuffer;\r
34 \r
35                 ref class StreamShim : System::Runtime::InteropServices::ComTypes::IStream\r
36                 {\r
37                 private:\r
38                         System::IO::Stream^ m_WrappedStream;\r
39 \r
40                         long long position;\r
41                         void SetSizeToPosition();\r
42 \r
43                 public:\r
44                         StreamShim( System::IO::Stream^ stream );\r
45 \r
46                         virtual void Clone( [Out] System::Runtime::InteropServices::ComTypes::IStream^% ppstm );\r
47                         virtual void Commit( int grfCommitFlags );\r
48                         virtual void CopyTo( System::Runtime::InteropServices::ComTypes::IStream^ pstm, long long cb, System::IntPtr pcbRead, System::IntPtr pcbWritten );\r
49                         virtual void LockRegion( long long libOffset, long long cb, int dwLockType );\r
50                         virtual void Read( [Out] array<unsigned char>^ pv, int cb, System::IntPtr pcbRead );\r
51                         virtual void Revert();\r
52                         virtual void Seek( long long dlibMove, int dwOrigin, System::IntPtr plibNewPosition );\r
53                         virtual void SetSize( long long libNewSize );\r
54                         virtual void Stat( [Out] System::Runtime::InteropServices::ComTypes::STATSTG% pstatstg, int grfStatFlag );\r
55                         virtual void UnlockRegion( long long libOffset, long long cb, int dwLockType );\r
56                         virtual void Write( array<unsigned char>^ pv, int cb, System::IntPtr pcbWritten );\r
57                 };\r
58 \r
59                 public ref class ProgressiveMesh : public BaseMesh\r
60                 {\r
61                         COMOBJECT(ID3DXPMesh, ProgressiveMesh);\r
62 \r
63                 private:\r
64                         array<ExtendedMaterial>^ materials;\r
65                         array<EffectInstance>^ effects;\r
66 \r
67                 public:\r
68                         ProgressiveMesh( Mesh^ mesh, array<AttributeWeights>^ attributeWeights, array<float>^ vertexWeights, int minimumValue, MeshSimplification options );\r
69                         ProgressiveMesh( Mesh^ mesh, array<AttributeWeights>^ attributeWeights, int minimumValue, MeshSimplification options );\r
70                         ProgressiveMesh( Mesh^ mesh, int minimumValue, MeshSimplification options );\r
71                         virtual ~ProgressiveMesh() { }\r
72 \r
73                         static ProgressiveMesh^ FromStream( SlimDX::Direct3D9::Device^ device, System::IO::Stream^ stream, MeshFlags flags );\r
74                         static Result ToStream( ProgressiveMesh^ mesh, System::IO::Stream^ stream );\r
75 \r
76                         ProgressiveMesh^ CloneProgressive( SlimDX::Direct3D9::Device^ device, MeshFlags flags, array<VertexElement>^ vertexDeclaration );\r
77                         ProgressiveMesh^ CloneProgressive( SlimDX::Direct3D9::Device^ device, MeshFlags flags, SlimDX::Direct3D9::VertexFormat format );\r
78 \r
79                         Result GenerateVertexHistory( array<int>^ vertexHistory );\r
80                         array<int>^ GetAdjacency();\r
81                 \r
82                         Mesh^ Optimize( MeshOptimizeFlags flags );\r
83                         Mesh^ Optimize( MeshOptimizeFlags flags, [Out] array<int>^% faceRemap, [Out] array<int>^% vertexRemap );\r
84 \r
85                         Result OptimizeBaseLevelOfDetail( MeshOptimizeFlags flags );\r
86                         Result OptimizeBaseLevelOfDetail( MeshOptimizeFlags flags, [Out] array<int>^% faceRemap );\r
87 \r
88                         Result SetFaceCount( int faceCount );\r
89                         Result SetVertexCount( int vertexCount );\r
90 \r
91                         Result TrimFaces( int newFaceMinimum, int newFaceMaximum );\r
92                         Result TrimFaces( int newFaceMinimum, int newFaceMaximum, [Out] array<int>^% faceRemap, [Out] array<int>^% vertexRemap );\r
93                         Result TrimVertices( int newVertexMinimum, int newVertexMaximum );\r
94                         Result TrimVertices( int newVertexMinimum, int newVertexMaximum, [Out] array<int>^% faceRemap, [Out] array<int>^% vertexRemap );\r
95 \r
96                         array<ExtendedMaterial>^ GetMaterials() { return materials; }\r
97                         void SetMaterials( array<ExtendedMaterial>^ value ) { materials = value; }\r
98 \r
99                         array<EffectInstance>^ GetEffects() { return effects; }\r
100                         void SetEffects( array<EffectInstance>^ value ) { effects = value; }\r
101 \r
102                         property int MaximumFaceCount { int get(); }\r
103                         property int MaximumVertexCount { int get(); }\r
104                         property int MinimumFaceCount { int get(); }\r
105                         property int MinimumVertexCount { int get(); }\r
106                 };\r
107         }\r
108 }