/[Sims3RigEditor]/trunk/gr2lib_typedefs/typedefs/TriTopology.cs
ViewVC logotype

Contents of /trunk/gr2lib_typedefs/typedefs/TriTopology.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91 - (show annotations) (download)
Thu Aug 19 08:40:05 2010 UTC (9 years, 6 months ago) by william
File size: 6975 byte(s)
update class definitions to include:
Granny_Model
Granny_Mesh (and associated classes)

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace gr2lib.core.typedefs
6 {
7 public interface IGrannyTriAnnotationSet
8 {
9 string Name { get; set; }
10 GrannyDataTypeDefinition TriAnnotationType { get; set; }
11 int TriAnnotationCount { get; }
12 List<byte> TriAnnotations { get; set; }
13 int IndicesMapFromTriToAnnotation { get; set; }
14 int TriAnnotationIndexCount { get; }
15 List<int> TriAnnotationIndices { get; set; }
16 }
17 public class GrannyTriAnnotationSet : IGrannyTriAnnotationSet
18 {
19 public GrannyTriAnnotationSet()
20 {
21 this.init();
22 }
23 private void init()
24 {
25 this.Name = "";
26 this.TriAnnotationType = new GrannyDataTypeDefinition();
27 this.TriAnnotations = new List<byte>();
28 this.IndicesMapFromTriToAnnotation = 0;
29 this.TriAnnotationIndices = new List<int>();
30 }
31
32 #region IGrannyTriAnnotationSet Members
33 private string _Name;
34 public string Name { get { return _Name; } set { _Name = value; } }
35 private GrannyDataTypeDefinition _TriAnnotationType;
36 public GrannyDataTypeDefinition TriAnnotationType { get { return _TriAnnotationType; } set { _TriAnnotationType = value; } }
37 public int TriAnnotationCount { get { return this.TriAnnotations.Count; } }
38 private List<byte> _TriAnnotations;
39 public List<byte> TriAnnotations { get { return _TriAnnotations; } set { _TriAnnotations = value; } }
40 private int _IndicesMapFromTriToAnnotation;
41 public int IndicesMapFromTriToAnnotation { get { return _IndicesMapFromTriToAnnotation; } set { _IndicesMapFromTriToAnnotation = value; } }
42 public int TriAnnotationIndexCount { get { return this.TriAnnotationIndices.Count; } }
43 private List<int> _TriAnnotationIndices;
44 public List<int> TriAnnotationIndices { get { return _TriAnnotationIndices; } set { _TriAnnotationIndices = value; } }
45 #endregion
46 }
47
48 public interface IGrannyTriMaterialGroup
49 {
50 int MaterialIndex { get; set; }
51 int TriFirst { get; set; }
52 int TriCount { get; set; }
53
54 }
55 public class GrannyTriMaterialGroup : IGrannyTriMaterialGroup
56 {
57 public GrannyTriMaterialGroup()
58 {
59 this.init();
60 }
61 private void init()
62 {
63 this.MaterialIndex = 0;
64 this.TriFirst = 0;
65 this.TriCount = 0;
66 }
67
68 #region IGrannyTriMaterialGroup Members
69 private int _MaterialIndex;
70 public int MaterialIndex { get { return _MaterialIndex; } set { _MaterialIndex = value; } }
71 private int _TriFirst;
72 public int TriFirst { get { return _TriFirst; } set { _TriFirst = value; } }
73 private int _TriCount;
74 public int TriCount { get { return _TriCount; } set { _TriCount = value; } }
75 #endregion
76 }
77
78
79 public interface ITriTopology
80 {
81 int GroupCount { get; }
82 List<GrannyTriMaterialGroup> Groups { get; set; }
83
84 int IndexCount { get; }
85 List<int> Indices { get; set; }
86
87 int Index16Count { get; }
88 List<ushort> Indices16 { get; set; }
89
90 int VertexToVertexCount { get; }
91 List<int> VertexToVertexMap { get; set; }
92
93 int VertexToTriangleCount { get; }
94 List<int> VertexToTriangleMap { get; set; }
95
96 int SideToNeighborCount { get; }
97 List<uint> SideToNeighborMap { get; set; }
98
99 int BonesForTriangleCount { get; }
100 List<int> BonesForTriangle { get; set; }
101
102 int TriangleToBoneCount { get; }
103 List<int> TriangleToBoneIndices { get; set; }
104
105 int TriAnnotationSetCount { get; }
106 List<GrannyTriAnnotationSet> TriAnnotationSets { get; set; }
107
108 }
109
110 public class TriTopology : ITriTopology
111 {
112 public TriTopology()
113 {
114 this.init();
115 }
116 private void init()
117 {
118 this.Groups = new List<GrannyTriMaterialGroup>();
119 this.Indices = new List<int>();
120 this.Indices16 = new List<ushort>();
121 this.VertexToVertexMap = new List<int>();
122 this.VertexToTriangleMap = new List<int>();
123 this.SideToNeighborMap = new List<uint>();
124 this.BonesForTriangle = new List<int>();
125 this.TriangleToBoneIndices = new List<int>();
126 this.TriAnnotationSets = new List<GrannyTriAnnotationSet>();
127 }
128
129 #region ITriTopology Members
130 private List<GrannyTriMaterialGroup> _Groups;
131 public int GroupCount { get { return this.Groups.Count; } }
132 public List<GrannyTriMaterialGroup> Groups { get { return _Groups; } set { _Groups = value; } }
133
134 private List<int> _Indices;
135 public int IndexCount { get { return this.Indices.Count; } }
136 public List<int> Indices { get { return _Indices; } set { _Indices = value; } }
137
138 private List<ushort> _Indices16;
139 public int Index16Count { get { return this.Indices16.Count; } }
140 public List<ushort> Indices16 { get { return _Indices16; } set { _Indices16 = value; } }
141
142 private List<int> _VertexToVertexMap;
143 public int VertexToVertexCount { get { return this.VertexToVertexMap.Count; } }
144 public List<int> VertexToVertexMap { get { return _VertexToVertexMap; } set { _VertexToVertexMap = value; } }
145
146 private List<int> _VertexToTriangleMap;
147 public int VertexToTriangleCount { get { return this.VertexToTriangleMap.Count; } }
148 public List<int> VertexToTriangleMap { get { return _VertexToTriangleMap; } set { _VertexToTriangleMap = value; } }
149
150 private List<uint> _SideToNeighborMap;
151 public int SideToNeighborCount { get { return this.SideToNeighborMap.Count; } }
152 public List<uint> SideToNeighborMap { get { return _SideToNeighborMap; } set { _SideToNeighborMap = value; } }
153
154 private List<int> _BonesForTriangle;
155 public int BonesForTriangleCount { get { return this.BonesForTriangle.Count; } }
156 public List<int> BonesForTriangle { get { return _BonesForTriangle; } set { _BonesForTriangle = value; } }
157
158 private List<int> _TriangleToBoneIndices;
159 public int TriangleToBoneCount { get { return this.TriangleToBoneIndices.Count; } }
160 public List<int> TriangleToBoneIndices { get { return _TriangleToBoneIndices; } set { _TriangleToBoneIndices = value; } }
161
162 private List<GrannyTriAnnotationSet> _TriAnnotationSets;
163 public int TriAnnotationSetCount { get { return this.TriAnnotationSets.Count; } }
164 public List<GrannyTriAnnotationSet> TriAnnotationSets { get { return _TriAnnotationSets; } set { _TriAnnotationSets = value; } }
165 #endregion
166 }
167 }

  ViewVC Help
Powered by ViewVC 1.1.22