2 * Copyright (c) 2007-2010 SlimDX Group
\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
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\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
24 using System::Runtime::InteropServices::OutAttribute;
\r
32 ref class VertexBuffer;
\r
33 ref class IndexBuffer;
\r
35 ref class StreamShim : System::Runtime::InteropServices::ComTypes::IStream
\r
38 System::IO::Stream^ m_WrappedStream;
\r
41 void SetSizeToPosition();
\r
44 StreamShim( System::IO::Stream^ stream );
\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
59 public ref class ProgressiveMesh : public BaseMesh
\r
61 COMOBJECT(ID3DXPMesh, ProgressiveMesh);
\r
64 array<ExtendedMaterial>^ materials;
\r
65 array<EffectInstance>^ effects;
\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
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
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
79 Result GenerateVertexHistory( array<int>^ vertexHistory );
\r
80 array<int>^ GetAdjacency();
\r
82 Mesh^ Optimize( MeshOptimizeFlags flags );
\r
83 Mesh^ Optimize( MeshOptimizeFlags flags, [Out] array<int>^% faceRemap, [Out] array<int>^% vertexRemap );
\r
85 Result OptimizeBaseLevelOfDetail( MeshOptimizeFlags flags );
\r
86 Result OptimizeBaseLevelOfDetail( MeshOptimizeFlags flags, [Out] array<int>^% faceRemap );
\r
88 Result SetFaceCount( int faceCount );
\r
89 Result SetVertexCount( int vertexCount );
\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
96 array<ExtendedMaterial>^ GetMaterials() { return materials; }
\r
97 void SetMaterials( array<ExtendedMaterial>^ value ) { materials = value; }
\r
99 array<EffectInstance>^ GetEffects() { return effects; }
\r
100 void SetEffects( array<EffectInstance>^ value ) { effects = value; }
\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