diff --git a/.gitattributes b/.gitattributes index 1ff0c42..bf0e54a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,63 +1,63 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### -* text=auto - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* -text + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index d1dfddd..eb83a8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,264 +1,34 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/Assets/AssetStoreTools* + +# Visual Studio 2015 cache directory +/.vs/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln *.suo +*.tmp *.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) *.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -project.fragment.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds *.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -#*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -*.lock - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml +*.booproj +*.svd +*.pdb -# CodeRush -.cr/ +# Unity3D generated meta files +*.pidb.meta -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc +# Unity3D Generated File On Crash Reports +sysinfo.txt +# Builds +*.apk +*.unitypackage diff --git a/Docs Diagrams/SymEdges.JPG b/Docs Diagrams/SymEdges.JPG index 3707e6d..4802d08 100644 Binary files a/Docs Diagrams/SymEdges.JPG and b/Docs Diagrams/SymEdges.JPG differ diff --git a/Docs Diagrams/dual.jpeg b/Docs Diagrams/dual.jpeg new file mode 100644 index 0000000..f92d4d2 Binary files /dev/null and b/Docs Diagrams/dual.jpeg differ diff --git a/Docs Diagrams/subdivide.JPG b/Docs Diagrams/subdivide.JPG new file mode 100644 index 0000000..04a2930 Binary files /dev/null and b/Docs Diagrams/subdivide.JPG differ diff --git a/Docs Diagrams/vertexsplit.JPG b/Docs Diagrams/vertexsplit.JPG new file mode 100644 index 0000000..aad64a8 Binary files /dev/null and b/Docs Diagrams/vertexsplit.JPG differ diff --git a/Docs/Game Design/game_design_documentation.pdf b/Docs/Game Design/game_design_documentation.pdf new file mode 100644 index 0000000..4670b65 Binary files /dev/null and b/Docs/Game Design/game_design_documentation.pdf differ diff --git a/Docs/User Manual/user_manual.pdf b/Docs/User Manual/user_manual.pdf new file mode 100644 index 0000000..a9206f1 Binary files /dev/null and b/Docs/User Manual/user_manual.pdf differ diff --git a/Docs/html/SymEdges.jpg b/Docs/html/SymEdges.jpg index 3707e6d..4802d08 100644 Binary files a/Docs/html/SymEdges.jpg and b/Docs/html/SymEdges.jpg differ diff --git a/Docs/html/_cell_8cs_source.html b/Docs/html/_cell_8cs_source.html index 2463217..74c5c68 100644 --- a/Docs/html/_cell_8cs_source.html +++ b/Docs/html/_cell_8cs_source.html @@ -5,7 +5,7 @@ -PlanetCasson: PlanetCasson/Assets/Model/Cell.cs Source File +Planet Casson: Planet Casson/Assets/Model/Cell.cs Source File @@ -21,7 +21,7 @@ -
PlanetCasson +
Planet Casson
@@ -61,7 +61,7 @@
@@ -69,25 +69,40 @@
Cell.cs
-
1 using System.Collections;
2 using System.Collections.Generic;
3 using System.Linq;
4 using Model;
5 using UnityEngine;
6 
10 namespace Model
11 {
16  public class Cell
17  {
18  List<Vertex> verticies;
19  List<Edge> edges;
20  List<Face> faces;
21 
22  //private constructor to initilize a cell
23  private Cell()
24  {
25  verticies = new List<Vertex>();
26  edges = new List<Edge>();
27  faces = new List<Face>();
28  }
29 
30  //make a tetrahedron quad edge graph
31  public static Cell MakePrimitiveCell()
32  {
33  Vertex vx = Vertex.NewVertex(); //Center Vertex
34  Vertex vab = Vertex.NewVertex();
35  Vertex vac = Vertex.NewVertex();
36  Vertex vcb = Vertex.NewVertex();
37 
38  Edge ea = Edge.NewEdge();
39  Edge eb = Edge.NewEdge();
40  Edge ec = Edge.NewEdge();
41  Edge eacx = Edge.NewEdge();
42  Edge ecbx = Edge.NewEdge();
43  Edge eabx = Edge.NewEdge();
44 
45  Face fa = Face.NewFace();
46  Face fb = Face.NewFace();
47  Face fc = Face.NewFace();
48  Face fx = Face.NewFace();
49 
50  ea.ConnectEdge(vac, vab, fx, fa);
51  eb.ConnectEdge(vab, vcb, fx, fb);
52  ec.ConnectEdge(vcb, vac, fx, fc);
53  eacx.ConnectEdge(vac, vx, fa, fc);
54  ecbx.ConnectEdge(vcb, vx, fc, fb);
55  eabx.ConnectEdge(vab, vx, fb, fa);
56 
57  Cell sphereCell = new Cell();
58  sphereCell.verticies.AddRange(new List<Vertex>() { vx, vab, vac, vcb });
59  sphereCell.faces.AddRange(new List<Face>() { fa, fb, fc, fx });
60  sphereCell.edges.AddRange(new List<Edge>() { ea, eb, ec, eacx, ecbx, eabx });
61 
62  return sphereCell;
63  }
64 
65  public void calculatePositions()
66  {
67  for (int i = 0; i < verticies.Count; i++)
68  {
69  verticies[i].pos = new Vector3(i % 2, i % 3, i % 5); //This is a really dumb way to visualize graphs and we need to figure out something better
70  }
71  }
72 
73  public void instantiateGraph(MonoBehaviour obj, GameObject vertexObj, GameObject edgeObj)
74  {
75  GameObject[] vObjs = new GameObject[verticies.Count];
76  GameObject[] eObjs = new GameObject[edges.Count];
77  for (int i = 0; i < verticies.Count; i++)
78  {
79  vObjs[i] = Object.Instantiate(vertexObj, verticies[i].pos, Quaternion.identity, obj.gameObject.transform);
80  }
81  for (int i = 0; i < edges.Count; i++)
82  {
83  eObjs[i] = Object.Instantiate(edgeObj, Vector3.zero, Quaternion.identity, obj.gameObject.transform);
84  LineRenderer lr = eObjs[i].GetComponent<LineRenderer>();
85  lr.positionCount = 2;
86  lr.SetPosition(0, edges[i].Orig.pos);
87  lr.SetPosition(1, edges[i].Dest.pos);
88  }
89  }
90 
91  //splits a vertex and create a new edge in between
92  //preserves euler characteristics
93  //use this to change graph
94  public Edge makeVertexEdge(Vertex v, Face left, Face right)
95  {
96  //all edges are edges that points towards v
97 
98  //find edges that points towards v and boarders left and right
99  Edge[] leftEdges = (Edge[])v.destEdges.Intersect(left.edges);
100  Edge[] rightEdges = (Edge[])v.destEdges.Intersect(right.edges);
101 
102  //checks if there are 2 leftEdges and 2 rightEdges (as there should be)
103  if (leftEdges.Length != 2 && rightEdges.Length != 2)
104  return null;
105 
106  List<Edge> topEdges = new List<Edge>();
107 
108  //tests to see if leftEdges[0] is the bottom edge
109  if (leftEdges[0].Dnext() == leftEdges[1])
110  topEdges.Add(leftEdges[0]);
111  else
112  topEdges.Add(leftEdges[1]);
113 
114  //test to see if rightEdges[0] is the bottom edge
115  if (rightEdges[0].Dprev() == rightEdges[1])
116  topEdges.Add(rightEdges[0]);
117  else
118  topEdges.Add(rightEdges[1]);
119 
120  //fills top edges
121  while (true)
122  {
123  int i = topEdges.Count - 2;
124  Edge temp = topEdges[i].Dprev();
125  if (temp == topEdges.Last())
126  {
127  break;
128  }
129  topEdges.Insert(i + 1, temp);
130  }
131 
132  Vertex newV = Vertex.NewVertex();
133  for (int i = 0; i < topEdges.Count; i++)
134  {
135  topEdges[i].Dest = newV;
136  }
137  Edge newE = Edge.NewEdge();
138  newE.ConnectEdge(v, newV, left, right);
139  verticies.Add(newV);
140  edges.Add(newE);
141  return newE;
142  }
143 
144  //"unsplits" a vertex
145  //preserves euler characteristics
146  //use this to change graph
147  //can create digons(use carefully)
148  public void killVertexEdge(Vertex v, Face left, Face right)
149  {
150  Edge disposedEdge = null;
151  Vertex rebindV;
152 
153  foreach (Edge e in left.edges.Intersect(right.edges))
154  {
155  if (e.Dest == v)
156  {
157  disposedEdge = e;
158  break;
159  }
160  }
161 
162  //check to see if valid deletion
163  if (disposedEdge == null) return;
164 
165  rebindV = disposedEdge.Orig;
166 
167  //disconnect the edge
168  disposedEdge.DisconnectEdge();
169 
170  //rebind edges on v to the vertex at disposedEdge.Orig
171  foreach (Edge e in v.destEdges)
172  {
173  e.Dest = rebindV;
174  }
175 
176  edges.Remove(disposedEdge);
177  verticies.Remove(v);
178  }
179 
180  //subdivide a face
181  //preserves euler characteristics
182  //use this to change graph
183  public Edge makeFaceEdge(Face f, Vertex orig, Vertex dest)
184  {
185  //find an edge pointing away from the starting point and on f
186  List<Edge> fEdges = (List<Edge>)orig.origEdges.Intersect(f.edges);
187  //check that there should be 2
188  if (fEdges.Count != 2)
189  return null;
190  //remove edge pointing left
191  if (fEdges[0].Oprev() == fEdges[1])
192  fEdges.Remove(fEdges[0]);
193  else
194  fEdges.Remove(fEdges[1]);
195 
196  //check to see if already hit dest
197  if (fEdges.Last().Dest != dest)
198  {
199  //accumulate traversed edges until hit dest
200  do
201  {
202  fEdges.Add(fEdges.Last().Lnext());
203  } while (fEdges.Last().Dest != dest);
204  }
205  //fEdges should now contains all edges(pointing in ccw dir) for new face except new edge
206 
207  Face newF = Face.NewFace();
208  for (int i = 0; i < fEdges.Count; i++)
209  {
210  fEdges[i].Left = newF;
211  }
212  Edge newE = Edge.NewEdge();
213  newE.ConnectEdge(orig, dest, f, newF);
214  faces.Add(newF);
215  edges.Add(newE);
216  return newE;
217  }
218 
219  //undos makeFaceEdge
220  public void killFaceEdge(Edge e)
221  {
222 
223  Face rf = e.Right;
224  Face lf = e.Left;
225  e.DisconnectEdge();
226  foreach (Edge e1 in rf.edges)
227  {
228  e1.Left = lf;
229  }
230  edges.Remove(e);
231  faces.Remove(rf);
232  }
233  }
234 }
static Face NewFace()
Definition: Face.cs:30
-
Edge representation in the Quad-Edge data structure.
Definition: Edge.cs:26
-
HashSet< Edge > edges
Definition: Face.cs:16
-
Package defining the implementation of the Quad-Edge data structure
Definition: Cell.cs:10
-
Vertex Dest
Definition: Edge.cs:85
-
Edge Dprev()
Definition: Edge.cs:372
-
Vertex representation in the Quad-Edge data structure.
Definition: Vertex.cs:10
-
Face representation in the Quad-Edge data structure.
Definition: Face.cs:11
-
Face Right
Definition: Edge.cs:149
-
List< Edge > origEdges
Definition: Vertex.cs:19
-
Quad-Edge data structure representing the graph iteself
Definition: Cell.cs:16
-
static Vertex NewVertex()
Definition: Vertex.cs:38
-
void ConnectEdge(Vertex orig, Vertex dest, Face left, Face right)
Definition: Edge.cs:206
-
Face Left
Definition: Edge.cs:116
-
List< Edge > destEdges
Definition: Vertex.cs:23
-
void DisconnectEdge()
Definition: Edge.cs:220
-
Vertex Orig
Definition: Edge.cs:48
+
1 using System.Collections;
2 using System.Collections.Generic;
3 using System.Linq;
4 using UnityEngine;
5 using Model.Objects;
6 
10 namespace Model
11 {
21  public class Cell
22  {
23  //lists to store verticies, edges, and faces in this cell
24  //if an edge is in the list, then it's companion edges are guaranteed not to be in here
25  List<Vertex> verticies;
26  List<Edge> edges;
27  List<Face> faces;
28 
35  public static Cell MakePrimitiveCell()
36  {
37  Cell c = new Cell();
38  c.verticies = new List<Vertex>();
39  c.verticies.Add(Vertex.NewVertex());
40  c.verticies[0].pos = new Vector3(0, 0, 40);
41  c.verticies.Add(Vertex.NewVertex());
42  c.verticies[1].pos = new Vector3(30, 0, 0);
43  c.verticies.Add(Vertex.NewVertex());
44  c.verticies[2].pos = new Vector3(-20, -20, 0);
45  c.verticies.Add(Vertex.NewVertex());
46  c.verticies[3].pos = new Vector3(-20, 20, 0);
47 
48  c.faces = new List<Face>();
49  c.faces.Add(Face.NewFace());
50  c.faces.Add(Face.NewFace());
51  c.faces.Add(Face.NewFace());
52  c.faces.Add(Face.NewFace());
53 
54  c.edges = Edge.ConnectTetraCell(c.verticies, c.faces);
55  //testing stuff
56  c.makeVertexEdge(c.verticies[0], c.faces[1], c.faces[2]);
57  c.makeFaceEdge(c.faces[2], c.verticies.Last(), c.verticies[2]);
58  //c.killFaceEdge(c.faces.Last(), c.verticies.Last(), c.verticies[2]);
59  //c.killVertexEdge(c.verticies.Last(), c.faces[1], c.faces[2]);
60  return c;
61  }
62 
69  public void calculatePositions(GameObject[] vObjs, GameObject[] eObjs, GameObject[] fObjs)
70  {
71  for (int i = 0; i < verticies.Count; i++)
72  {
73  vObjs[i].transform.position = verticies[i].pos;
74  }
75  for (int i = 0; i < edges.Count; i++)
76  {
77  LineRenderer lr = eObjs[i].GetComponent<LineRenderer>();
78  lr.positionCount = 2;
79  Vertex orig = (edges[i].Orig) as Vertex;
80  Vertex dest = (edges[i].Dest) as Vertex;
81  lr.SetPosition(0, orig.pos);
82  lr.SetPosition(1, dest.pos);
83  }
84  for (int i = 0; i < faces.Count; i++)
85  {
86  //computing center of face
87  LinkedList<Vector3> Vpos = new LinkedList<Vector3>();
88  Vector3 sum = new Vector3(0, 0, 0);
89  Edge start = faces[i].EdgeListHead.Onext();
90  Edge current = start;
91  Vertex prev = faces[i].EdgeListHead.Right as Vertex;
92  do
93  {
94  Vpos.AddLast((current.Right as Vertex).pos); //right should be the vertex that's origin of the edge's dual
95  //the edge's dual edge is a CCW pointing edge bordering faces[i]
96  sum += Vpos.Last();
97  current = current.Onext(); //Onext traversal finds the next edge in CCW dir that points out of face
98  } while (current != start);
99  Vector3 avg = sum / Vpos.Count;
100  Vpos.AddFirst(avg);
101 
102  //construct mesh
103  int j;
104  Vector2[] UVs = new Vector2[Vpos.Count];
105  int[] trigs = new int[3 * (Vpos.Count - 1)]; //-1 to get number of verticies surrounding face = #of trigs
106  float UVstep = 2 * Mathf.PI / Vpos.Count;
107  UVs[0] = new Vector2(0.5f, 0.5f);
108  UVs[1] = new Vector2((Mathf.Cos(UVstep) + 1) / 2, (Mathf.Sin(UVstep) + 1) / 2);
109  trigs[0] = 0;
110  trigs[1] = 1;
111  trigs[2] = 2;
112  for (j = 2; j < Vpos.Count; j++)
113  {
114  UVs[j] = new Vector2((Mathf.Cos(j * UVstep) + 1) / 2, (Mathf.Sin(j * UVstep) + 1) / 2);
115  trigs[3 * (j - 2)] = 0;
116  trigs[3 * (j - 2) + 1] = j - 1;
117  trigs[3 * (j - 2) + 2] = j;
118  }
119  trigs[3 * (j - 2)] = 0;
120  trigs[3 * (j - 2) + 1] = j - 1;
121  trigs[3 * (j - 2) + 2] = 1;
122 
123  Mesh mesh = fObjs[i].GetComponent<MeshFilter>().mesh;
124  mesh.Clear();
125  mesh.vertices = Vpos.ToArray<Vector3>();
126  mesh.uv = UVs;
127  mesh.triangles = trigs;
128  }
129  }
130 
139  public GameObject[][] instantiateGraph(SphereKernel kernel, GameObject vertexObj, GameObject edgeObj, GameObject faceObj)
140  {
141  GameObject[] vObjs = new GameObject[verticies.Count];
142  GameObject[] eObjs = new GameObject[edges.Count];
143  GameObject[] fObjs = new GameObject[faces.Count];
144 
145  for (int i = 0; i < verticies.Count; i++)
146  {
147  vObjs[i] = Object.Instantiate(vertexObj, verticies[i].pos, Quaternion.identity, kernel.gameObject.transform);
148  vObjs[i].GetComponent<VertexObject>().graph = this;
149  vObjs[i].GetComponent<VertexObject>().vertex = verticies[i];
150  vObjs[i].GetComponent<VertexObject>().sphereKernel = kernel;
151 
152  }
153  for (int i = 0; i < edges.Count; i++)
154  {
155  eObjs[i] = Object.Instantiate(edgeObj, Vector3.zero, Quaternion.identity, kernel.gameObject.transform);
156  LineRenderer lr = eObjs[i].GetComponent<LineRenderer>();
157  lr.positionCount = 2;
158  Vertex orig = (edges[i].Orig) as Vertex;
159  Vertex dest = (edges[i].Dest) as Vertex;
160  lr.SetPosition(0, orig.pos);
161  lr.SetPosition(1, dest.pos);
162  }
163  for (int i = 0; i < faces.Count; i++)
164  {
165  //computing center of face
166  LinkedList<Vector3> Vpos = new LinkedList<Vector3>();
167  Vector3 sum = new Vector3(0, 0, 0);
168  Edge start = faces[i].EdgeListHead.Onext();
169  Edge current = start;
170  Vertex prev = faces[i].EdgeListHead.Right as Vertex;
171  do
172  {
173  Vpos.AddLast((current.Right as Vertex).pos); //right should be the vertex that's origin of the edge's dual
174  //the edge's dual edge is a CCW pointing edge bordering faces[i]
175  sum += Vpos.Last();
176  current = current.Onext(); //Onext traversal finds the next edge in CCW dir that points out of face
177  } while (current != start);
178  Vector3 avg = sum / Vpos.Count;
179  Vpos.AddFirst(avg);
180 
181  //construct mesh
182  int j;
183  Vector2[] UVs = new Vector2[Vpos.Count];
184  int[] trigs = new int[3*(Vpos.Count - 1)]; //-1 to get number of verticies surrounding face = #of trigs
185  float UVstep = 2 * Mathf.PI / Vpos.Count;
186  UVs[0] = new Vector2(0.5f, 0.5f);
187  UVs[1] = new Vector2((Mathf.Cos(UVstep) + 1) / 2, (Mathf.Sin(UVstep) + 1) / 2);
188  trigs[0] = 0;
189  trigs[1] = 1;
190  trigs[2] = 2;
191  for(j = 2; j < Vpos.Count; j++)
192  {
193  UVs[j] = new Vector2((Mathf.Cos(j*UVstep)+1)/2, (Mathf.Sin(j*UVstep)+1)/2);
194  trigs[3 * (j - 2)] = 0;
195  trigs[3 * (j - 2) + 1] = j - 1;
196  trigs[3 * (j - 2) + 2] = j;
197  }
198  trigs[3 * (j - 2)] = 0;
199  trigs[3 * (j - 2) + 1] = j - 1;
200  trigs[3 * (j - 2) + 2] = 1;
201 
202  fObjs[i] = Object.Instantiate(faceObj, Vector3.zero, Quaternion.identity, kernel.gameObject.transform);
203  Mesh mesh = fObjs[i].GetComponent<MeshFilter>().mesh;
204  mesh.Clear();
205  mesh.vertices = Vpos.ToArray<Vector3>();
206  mesh.uv = UVs;
207  mesh.triangles = trigs;
208  }
209  return new GameObject[3][] { vObjs, eObjs, fObjs };
210  }
215  public void instantiateTraversals(MonoBehaviour obj, GameObject traverserObj)
216  {
217  GameObject[] tObjs = new GameObject[faces.Count];
218 
219  for (int i = 0; i < faces.Count; i++)
220  {
221  //Instantiate new game object
222  tObjs[i] = Object.Instantiate(traverserObj, obj.gameObject.transform);
223  //Obtain the first available edge
224  Edge oneOfTheEdges = faces[i].EdgeListHead.Rot;
225  //create a new traversal object on first availiable edge
226  tObjs[i].AddComponent<TraversalObject>();
227  tObjs[i].GetComponent<TraversalObject>().AssignTraversalValues(oneOfTheEdges, 0.5F, 0.005F);
228  Vector3 position = tObjs[i].GetComponent<TraversalObject>().getVectorPosition(0.5F);
229  //Translate object with to new position
230  tObjs[i].transform.position = position;
231  }
232  }
233 
245  public Edge makeVertexEdge(Vertex v, Face left, Face right)
246  {
247  //finds all edges that needs to be moved
248  List<Edge> moveE = findMoveEdges(v, left, right);
249 
250  if (moveE == null) return null;
251 
252  Vertex newv = Vertex.NewVertex();
253  Edge newe = Edge.SplitFaceVertex(v, newv, left, right, moveE);
254  verticies.Add(newv);
255  edges.Add(newe);
256  return newe;
257  }
258 
271  public void killVertexEdge(Vertex v, Face left, Face right)
272  {
273  List<Edge> moveE = findMoveEdges(v, left, right);
274  Edge delE = moveE.Last().Onext().Sym;
275  Edge.RejoinFaceVertex(delE.Orig, v, left, right, moveE);
276 
277  if (!edges.Remove(delE))
278  edges.Remove(delE.Sym);
279  verticies.Remove(v);
280  }
281 
294  public Edge makeFaceEdge(Face f, Vertex orig, Vertex dest)
295  {
296  //finds all edges that needs to be moved
297  List<Edge> moveE = findMoveEdges(f, dest, orig);
298 
299  Face newf = Face.NewFace();
300  Edge newe = Edge.SplitFaceVertex(f, newf, dest, orig, moveE);
301  faces.Add(newf);
302  edges.Add(newe.Rot);
303  return newe;
304  }
305 
319  public void killFaceEdge(Face f, Vertex orig, Vertex dest)
320  {
321 
322  List<Edge> moveE = findMoveEdges(f, dest, orig);
323  Edge delE = moveE.Last().Onext().Sym;
324  Edge.RejoinFaceVertex(delE.Orig, f, dest, orig, moveE);
325 
326  if (!edges.Remove(delE.Rot))
327  edges.Remove(delE.InvRot);
328  faces.Remove(f);
329  }
330 
331  //find all edges pointing away from fv
332  //that satisfies:
333  //start at an edge bordering right, find an edge pointing out of fv in a CCW rotation step
334  //repeat until accumulated all edges until the edge bordering left
335  private List<Edge> findMoveEdges(FaceVertex fv, FaceVertex left, FaceVertex right)
336  {
337  Edge temp = fv.EdgeListHead;
338  while (temp.Right != right)
339  {
340  temp = temp.Onext();
341  if (temp == fv.EdgeListHead) //made a loop
342  {
343  return null;
344  }
345  }
346  List<Edge> moveE = new List<Edge>();
347  moveE.Add(temp);
348  while (temp.Left != left)
349  {
350  temp = temp.Onext();
351  moveE.Add(temp);
352  if (temp == moveE[0]) //made a loop
353  {
354  return null;
355  }
356  }
357  if (moveE.Last().Left != (FaceVertex)left)
358  moveE.RemoveAt(moveE.Count - 1);
359 
360  return moveE;
361  }
362  }
363 }
Edge Rot
Definition: Edge.cs:59
+ +
static Face NewFace()
Definition: FaceVertex.cs:54
+
Edge representation in the Quad-Edge data structure.
Definition: Edge.cs:31
+
static List< Edge > ConnectTetraCell(List< Vertex > verticies, List< Face > faces)
Definition: Edge.cs:206
+
Package defining the implementation of the modified Quad-Edge data structure
Definition: Cell.cs:10
+ +
Vertex representation in the modified Quad-Edge data structure.
Definition: FaceVertex.cs:64
+
void killFaceEdge(Face f, Vertex orig, Vertex dest)
Definition: Cell.cs:319
+
FaceVertex Orig
Definition: Edge.cs:40
+
GameObject [][] instantiateGraph(SphereKernel kernel, GameObject vertexObj, GameObject edgeObj, GameObject faceObj)
Definition: Cell.cs:139
+
void calculatePositions(GameObject[] vObjs, GameObject[] eObjs, GameObject[] fObjs)
Definition: Cell.cs:69
+
static void RejoinFaceVertex(FaceVertex oldFV, FaceVertex delFV, FaceVertex leftFV, FaceVertex rightFV, List< Edge > movedEdges)
Definition: Edge.cs:172
+
void instantiateTraversals(MonoBehaviour obj, GameObject traverserObj)
Iterate through faces of Cell and create a traversal object for each face
Definition: Cell.cs:215
+
Face representation in the Quad-Edge data structure.
Definition: FaceVertex.cs:45
+
Quad-Edge data structure representing the graph iteself.
Definition: Cell.cs:21
+
Edge Sym
Definition: Edge.cs:64
+
static Cell MakePrimitiveCell()
Definition: Cell.cs:35
+
static Vertex NewVertex()
Definition: FaceVertex.cs:78
+
abstract class for Face and Vertex class.
Definition: FaceVertex.cs:14
+
Edge makeFaceEdge(Face f, Vertex orig, Vertex dest)
Definition: Cell.cs:294
+
FaceVertex Right
Definition: Edge.cs:55
+
Edge Onext()
Definition: Edge.cs:318
+
Edge makeVertexEdge(Vertex v, Face left, Face right)
Definition: Cell.cs:245
+
static Edge SplitFaceVertex(FaceVertex oldFV, FaceVertex newFV, FaceVertex leftFV, FaceVertex rightFV, List< Edge > movedEdges)
Definition: Edge.cs:109
+
Abstract class for objects that will traverse the graph
+ + +
Edge InvRot
Definition: Edge.cs:69
+
Vector3 pos
Definition: FaceVertex.cs:69
+
FaceVertex Left
Definition: Edge.cs:50
-
static Edge NewEdge()
Definition: Edge.cs:184
+
void killVertexEdge(Vertex v, Face left, Face right)
Definition: Cell.cs:271
+
-
1 using System.Collections;
2 using System.Collections.Generic;
3 using System.Linq;
4 using Model;
5 using UnityEngine;
6 
7 namespace Model
8 {
26  public class Edge
27  {
28  private Vertex _orig;
29  private Face _left;
30  private Edge _sym;
31 
47  public Vertex Orig
48  {
49  get { return _orig; }
50  set
51  {
52  if (_orig != null)
53  {
54  _orig.origEdges.Remove(this);
55  _orig.destEdges.Remove(_sym);
56  }
57  _orig = value;
58  if (_orig != null)
59  {
60  _orig.origEdges.Add(this);
61  _orig.destEdges.Add(_sym);
62  }
63  }
64  }
84  public Vertex Dest
85  {
86  get { return _sym._orig; }
87  set
88  {
89  if (_sym._orig != null)
90  {
91  _sym._orig.origEdges.Remove(_sym);
92  _sym._orig.destEdges.Remove(this);
93  }
94  _sym._orig = value;
95  if (_sym._orig != null)
96  {
97  _sym._orig.origEdges.Add(_sym);
98  _sym._orig.destEdges.Add(this);
99  }
100  }
101  }
115  public Face Left
116  {
117  get { return _left; }
118  set
119  {
120  if (_left != null)
121  {
122  _left.edges.Remove(this);
123  _left.edges.Remove(_sym);
124  }
125  _left = value;
126  if (_left != null)
127  {
128  _left.edges.Add(this);
129  _left.edges.Add(_sym);
130  }
131  }
132  }
148  public Face Right
149  {
150  get { return _sym._left; }
151  set
152  {
153  if (_sym._left != null)
154  {
155  _sym._left.edges.Remove(_sym);
156  _sym._left.edges.Remove(this);
157  }
158  _sym._left = value;
159  if (_sym._left != null)
160  {
161  _sym._left.edges.Add(_sym);
162  _sym._left.edges.Add(this);
163  }
164  }
165  }
169  public Edge Sym
170  {
171  get { return _sym; }
172  }
173 
174  //private constructor use NewEdge factory
175  private Edge() { }
176 
184  public static Edge NewEdge()
185  {
186  Edge e1 = new Edge();
187  Edge e2 = new Edge();
188  e1._sym = e2;
189  e2._sym = e1;
190  return e1;
191  }
192 
206  public void ConnectEdge(Vertex orig, Vertex dest, Face left, Face right)
207  {
208  Orig = orig;
209  Dest = dest;
210  Left = left;
211  Right = right;
212  }
213 
220  public void DisconnectEdge()
221  {
222  Orig = null;
223  Dest = null;
224  Left = null;
225  Right = null;
226  }
227 
239  public Edge Rnext()
240  {
241  Right.edges.Remove(Sym);
242  Edge temp = Orig.destEdges.Intersect(Right.edges).FirstOrDefault();
243  Right.edges.Add(Sym);
244  return temp;
245  }
246 
258  public Edge Lnext()
259  {
260  Left.edges.Remove(Sym);
261  Edge temp = Dest.origEdges.Intersect(Left.edges).FirstOrDefault();
262  Left.edges.Add(Sym);
263  return temp;
264  }
265 
277  public Edge Onext()
278  {
279  Left.edges.Remove(this);
280  Edge temp = Orig.origEdges.Intersect(Left.edges).FirstOrDefault();
281  Left.edges.Add(this);
282  return temp;
283  }
284 
296  public Edge Dnext()
297  {
298  Right.edges.Remove(this);
299  Edge temp = Dest.destEdges.Intersect(Right.edges).FirstOrDefault();
300  Right.edges.Add(this);
301  return temp;
302  }
303 
315  public Edge Rprev()
316  {
317  Right.edges.Remove(Sym);
318  Edge temp = Dest.origEdges.Intersect(Right.edges).FirstOrDefault();
319  Right.edges.Add(Sym);
320  return temp;
321  }
322 
334  public Edge Lprev()
335  {
336  Left.edges.Remove(Sym);
337  Edge temp = Orig.destEdges.Intersect(Left.edges).FirstOrDefault();
338  Left.edges.Add(Sym);
339  return temp;
340  }
341 
353  public Edge Oprev()
354  {
355  Right.edges.Remove(this);
356  Edge temp = Orig.origEdges.Intersect(Right.edges).FirstOrDefault();
357  Right.edges.Add(this);
358  return temp;
359  }
360 
372  public Edge Dprev()
373  {
374  Left.edges.Remove(this);
375  Edge temp = Dest.destEdges.Intersect(Left.edges).FirstOrDefault();
376  Left.edges.Add(this);
377  return temp;
378  }
379  }
380 }
Edge Lprev()
Definition: Edge.cs:334
-
Edge Dnext()
Definition: Edge.cs:296
-
Edge representation in the Quad-Edge data structure.
Definition: Edge.cs:26
-
HashSet< Edge > edges
Definition: Face.cs:16
-
Edge Rnext()
Definition: Edge.cs:239
-
Package defining the implementation of the Quad-Edge data structure
Definition: Cell.cs:10
-
Vertex Dest
Definition: Edge.cs:85
-
Edge Dprev()
Definition: Edge.cs:372
-
Vertex representation in the Quad-Edge data structure.
Definition: Vertex.cs:10
-
Edge Lnext()
Definition: Edge.cs:258
-
Face representation in the Quad-Edge data structure.
Definition: Face.cs:11
-
Face Right
Definition: Edge.cs:149
-
List< Edge > origEdges
Definition: Vertex.cs:19
-
Edge Rprev()
Definition: Edge.cs:315
-
Edge Sym
Definition: Edge.cs:170
-
Edge Oprev()
Definition: Edge.cs:353
-
Edge Onext()
Definition: Edge.cs:277
-
void ConnectEdge(Vertex orig, Vertex dest, Face left, Face right)
Definition: Edge.cs:206
-
Face Left
Definition: Edge.cs:116
-
List< Edge > destEdges
Definition: Vertex.cs:23
-
void DisconnectEdge()
Definition: Edge.cs:220
-
Vertex Orig
Definition: Edge.cs:48
- -
static Edge NewEdge()
Definition: Edge.cs:184
+
1 using System.Collections;
2 using System.Collections.Generic;
3 using System.Linq;
4 
5 namespace Model
6 {
31  public class Edge
32  {
33  private FaceVertex _orig;
34  private Edge _rot;
35  private Edge _onext;
36 
40  public FaceVertex Orig { get { return _orig; } }
45  public FaceVertex Dest { get { return Sym._orig; } }
50  public FaceVertex Left { get { return InvRot._orig; } }
55  public FaceVertex Right { get { return Rot._orig; } }
59  public Edge Rot { get { return _rot; } }
64  public Edge Sym { get { return _rot._rot; } }
69  public Edge InvRot { get { return _rot._rot._rot; } }
70 
71  //Helper function for generating an edge that's already linked with its dual edge, symmetric edge, and symmetric dual edge.
72  private static Edge NewEdge()
73  {
74  Edge e1 = new Edge();
75  Edge e2 = new Edge();
76  Edge e3 = new Edge();
77  Edge e4 = new Edge();
78  e1._rot = e3;
79  e2._rot = e4;
80  e3._rot = e2;
81  e4._rot = e1;
82  return e1;
83  }
84 
109  public static Edge SplitFaceVertex(FaceVertex oldFV, FaceVertex newFV, FaceVertex leftFV, FaceVertex rightFV, List<Edge> movedEdges)
110  {
111  //calculating important edges;
112  //movedEdges.Last() should be topLeft
113  //movedEdges[0] should be topRight
114  Edge botLeft = movedEdges.Last().Onext();
115  Edge botRight = movedEdges[0].Oprev();
116  Edge e = NewEdge();
117 
118  //error checking to make sure we don't fuck up the Quad-Edge in Edge insertion
119  if (botLeft.Right != leftFV || botRight.Left != rightFV)
120  throw new System.ArgumentException("inputs presents impossible situation for Vertex Split/Face Subdivide");
121  for (int i = 0; i < movedEdges.Count; i++)
122  {
123  if (movedEdges[i]._orig != oldFV)
124  throw new System.ArgumentException("movedEdges contain invalid edges!");
125  }
126 
127  //moving moveEdges from oldFV to newFV
128  for (int i = 0; i < movedEdges.Count; i++)
129  {
130  movedEdges[i]._orig = newFV;
131  }
132 
133  //linking e with graph
134  e._orig = oldFV;
135  e.Sym._orig = newFV;
136  e.InvRot._orig = leftFV;
137  e.Rot._orig = rightFV;
138 
139  //set EdgeListHead on affected Vertex/Face to eliminate cases where the EdgeListHead is moved from oldFV to newFV
140  oldFV.EdgeListHead = e;
141  newFV.EdgeListHead = e.Sym;
142 
143  //adjusting onext relationship
144  botRight._onext = e;
145  e._onext = botLeft;
146  movedEdges.Last()._onext = e.Sym;
147  e.Sym._onext = movedEdges[0];
148 
149  movedEdges[0].Rot._onext = e.Rot;
150  e.Rot._onext = botRight.InvRot;
151  botLeft.Rot._onext = e.InvRot;
152  e.InvRot._onext = movedEdges.Last().InvRot;
153 
154  return e;
155  }
156 
172  public static void RejoinFaceVertex(FaceVertex oldFV, FaceVertex delFV, FaceVertex leftFV, FaceVertex rightFV, List<Edge> movedEdges)
173  {
174  Edge delE = movedEdges[0].Oprev().Sym;
175  Edge botLeft = delE.Onext();
176  Edge botRight = delE.Oprev();
177 
178  //error checking to make sure we don't fuck up the Quad-Edge in Edge deletion
179  if (botLeft.Right != leftFV || botRight.Left != rightFV)
180  throw new System.ArgumentException("inputs presents impossible situation for Vertex/Face Rejoin");
181  for (int i = 0; i < movedEdges.Count; i++)
182  {
183  if (movedEdges[i]._orig != delFV)
184  throw new System.ArgumentException("movedEdges contain invalid edges!");
185  }
186 
187  for (int i = 0; i < movedEdges.Count; i++)
188  {
189  movedEdges[i]._orig = oldFV;
190  }
191  oldFV.EdgeListHead = movedEdges[0];
192 
193  botRight._onext = movedEdges[0];
194  movedEdges.Last()._onext = botLeft;
195  }
196 
206  public static List<Edge> ConnectTetraCell(List<Vertex> verticies, List<Face> faces)
207  {
208  if (verticies.Count != 4 || faces.Count != 4)
209  throw new System.ArgumentException("Incorrect number of verticies and faces to create a tetrahedron");
210 
211  List<Edge> edges = new List<Edge>();
212  edges.Add(NewEdge());
213  edges.Add(NewEdge());
214  edges.Add(NewEdge());
215  edges.Add(NewEdge());
216  edges.Add(NewEdge());
217  edges.Add(NewEdge());
218 
219  edges[0].ConnectEdge(verticies[0], verticies[1], faces[1], faces[2]);
220  edges[1].ConnectEdge(verticies[0], verticies[2], faces[2], faces[3]);
221  edges[2].ConnectEdge(verticies[0], verticies[3], faces[3], faces[1]);
222 
223  edges[3].ConnectEdge(verticies[1], verticies[2], faces[0], faces[2]);
224  edges[4].ConnectEdge(verticies[2], verticies[3], faces[0], faces[3]);
225  edges[5].ConnectEdge(verticies[3], verticies[1], faces[0], faces[1]);
226 
227  verticies[0].EdgeListHead = edges[2];
228  verticies[1].EdgeListHead = edges[3];
229  verticies[2].EdgeListHead = edges[4];
230  verticies[3].EdgeListHead = edges[5];
231 
232  faces[0].EdgeListHead = edges[3].InvRot;
233  faces[1].EdgeListHead = edges[0].InvRot;
234  faces[2].EdgeListHead = edges[1].InvRot;
235  faces[3].EdgeListHead = edges[2].InvRot;
236 
237  edges[0]._onext = edges[2];
238  edges[2]._onext = edges[1];
239  edges[1]._onext = edges[0];
240 
241  edges[5].Sym._onext = edges[0].Sym;
242  edges[0].Sym._onext = edges[3].Sym;
243  edges[3].Sym._onext = edges[5].Sym;
244 
245  edges[5]._onext = edges[4].Sym;
246  edges[4].Sym._onext = edges[2].Sym;
247  edges[2].Sym._onext = edges[5];
248 
249  edges[3].Sym._onext = edges[1].Sym;
250  edges[1].Sym._onext = edges[4];
251  edges[4]._onext = edges[3].Sym;
252 
253  edges[0].Rot._onext = edges[1].InvRot;
254  edges[1].InvRot._onext = edges[3].Rot;
255  edges[3].Rot._onext = edges[0].Rot;
256 
257  edges[0].InvRot._onext = edges[5].Rot;
258  edges[5].Rot._onext = edges[2].Rot;
259  edges[2].Rot._onext = edges[0].InvRot;
260 
261  edges[2].InvRot._onext = edges[4].Rot;
262  edges[4].Rot._onext = edges[1].Rot;
263  edges[1].Rot._onext = edges[2].InvRot;
264 
265  edges[4].InvRot._onext = edges[5].InvRot;
266  edges[5].InvRot._onext = edges[3].InvRot;
267  edges[3].InvRot._onext = edges[4].InvRot;
268 
269  return edges;
270  }
271 
272  //helper function to link a set of linked edges to its surrounding verticies and faces.
273  private void ConnectEdge(Vertex orig, Vertex dest, Face left, Face right)
274  {
275  _orig = orig;
276  Sym._orig = dest;
277  InvRot._orig = left;
278  Rot._orig = right;
279  }
280 
291  public Edge Rnext()
292  {
293  return Rot.Onext().InvRot;
294  }
295 
306  public Edge Lnext()
307  {
308  return InvRot.Onext().Rot;
309  }
310 
318  public Edge Onext()
319  {
320  return _onext;
321  }
322 
334  public Edge Dnext()
335  {
336  return Rot.Oprev().Rot;
337  }
338 
349  public Edge Rprev()
350  {
351  return Rot.Oprev().InvRot;
352  }
353 
364  public Edge Lprev()
365  {
366  return InvRot.Oprev().Rot;
367  }
368 
379  public Edge Oprev()
380  {
381  return Rot.Onext().Rot;
382  }
383 
394  public Edge Dprev()
395  {
396  return InvRot.Onext().InvRot;
397  }
398  }
399 }
Edge Lprev()
Definition: Edge.cs:364
+
Edge Rot
Definition: Edge.cs:59
+
Edge Dnext()
Definition: Edge.cs:334
+
Edge representation in the Quad-Edge data structure.
Definition: Edge.cs:31
+
Edge Rnext()
Definition: Edge.cs:291
+
static List< Edge > ConnectTetraCell(List< Vertex > verticies, List< Face > faces)
Definition: Edge.cs:206
+
Package defining the implementation of the modified Quad-Edge data structure
Definition: Cell.cs:10
+ +
Edge Dprev()
Definition: Edge.cs:394
+
Vertex representation in the modified Quad-Edge data structure.
Definition: FaceVertex.cs:64
+
FaceVertex Orig
Definition: Edge.cs:40
+
static void RejoinFaceVertex(FaceVertex oldFV, FaceVertex delFV, FaceVertex leftFV, FaceVertex rightFV, List< Edge > movedEdges)
Definition: Edge.cs:172
+
FaceVertex Dest
Definition: Edge.cs:45
+
Edge Lnext()
Definition: Edge.cs:306
+
Face representation in the Quad-Edge data structure.
Definition: FaceVertex.cs:45
+
Edge Rprev()
Definition: Edge.cs:349
+
Edge Sym
Definition: Edge.cs:64
+
Edge Oprev()
Definition: Edge.cs:379
+
abstract class for Face and Vertex class.
Definition: FaceVertex.cs:14
+
FaceVertex Right
Definition: Edge.cs:55
+
Edge Onext()
Definition: Edge.cs:318
+
static Edge SplitFaceVertex(FaceVertex oldFV, FaceVertex newFV, FaceVertex leftFV, FaceVertex rightFV, List< Edge > movedEdges)
Definition: Edge.cs:109
+ +
Edge InvRot
Definition: Edge.cs:69
+
FaceVertex Left
Definition: Edge.cs:50
-
1 using System.Collections;
2 using System.Collections.Generic;
3 using Model;
4 using UnityEngine;
5 
6 namespace Model
7 {
11  public class Face
12  {
16  public HashSet<Edge> edges;
17 
18  private Face()
19  {
20  edges = new HashSet<Edge>();
21  }
22 
30  public static Face NewFace()
31  {
32  return new Face();
33  }
34  }
35 }
static Face NewFace()
Definition: Face.cs:30
-
HashSet< Edge > edges
Definition: Face.cs:16
-
Package defining the implementation of the Quad-Edge data structure
Definition: Cell.cs:10
-
Face representation in the Quad-Edge data structure.
Definition: Face.cs:11
+
1 using System.Collections;
2 using System.Collections.Generic;
3 using Model;
4 using UnityEngine;
5 
6 namespace Model
7 {
11  public class Face : FaceVertex
12  {
16  public Edge EdgeListHead
17  {
18  get { return EdgeListHead.Rot; }
19  set { EdgeListHead = value.InvRot; }
20  }
21 
29  public static Face NewFace()
30  {
31  return new Face();
32  }
33  }
34 }
Edge Rot
Definition: Edge.cs:57
+
static Face NewFace()
Definition: Face.cs:29
+
Edge representation in the modified Quad-Edge data structure.
Definition: Edge.cs:29
+
Package defining the implementation of the modified Quad-Edge data structure
Definition: Cell.cs:10
+ +
Face representation in the modified Quad-Edge data structure.
Definition: Face.cs:11
+
Edge EdgeListHead
Definition: Face.cs:17
+
Interface for Face and Vertex class.
Definition: FaceVertex.cs:12
+
Edge InvRot
Definition: Edge.cs:67
diff --git a/Docs/html/_face_vertex_8cs_source.html b/Docs/html/_face_vertex_8cs_source.html new file mode 100644 index 0000000..85d7062 --- /dev/null +++ b/Docs/html/_face_vertex_8cs_source.html @@ -0,0 +1,91 @@ + + + + + + + +Planet Casson: Planet Casson/Assets/Model/FaceVertex.cs Source File + + + + + + + + + +
+
+ + + + + + +
+
Planet Casson +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
FaceVertex.cs
+
+
+
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using UnityEngine;
6 
7 namespace Model
8 {
14  public abstract class FaceVertex
15  {
16  private Edge _edgeListHead;
28  public Edge EdgeListHead
29  {
30  get { return _edgeListHead; }
31  set
32  {
33  if (value.Orig == this)
34  _edgeListHead = value;
35  else
36  throw new System.ArgumentException("Edge attempting to make EdgeListHead does not satisfy the correct properties.");
37  }
38  }
39  }
40 
45  public class Face : FaceVertex
46  {
54  public static Face NewFace()
55  {
56  return new Face();
57  }
58  }
59 
64  public class Vertex : FaceVertex
65  {
69  public Vector3 pos;
70 
78  public static Vertex NewVertex()
79  {
80  Vertex v = new Vertex();
81  v.pos = Vector3.zero;
82  return v;
83  }
84  }
85 }
static Face NewFace()
Definition: FaceVertex.cs:54
+
Edge representation in the Quad-Edge data structure.
Definition: Edge.cs:31
+
Package defining the implementation of the modified Quad-Edge data structure
Definition: Cell.cs:10
+ +
Vertex representation in the modified Quad-Edge data structure.
Definition: FaceVertex.cs:64
+
Face representation in the Quad-Edge data structure.
Definition: FaceVertex.cs:45
+
static Vertex NewVertex()
Definition: FaceVertex.cs:78
+
abstract class for Face and Vertex class.
Definition: FaceVertex.cs:14
+ +
Vector3 pos
Definition: FaceVertex.cs:69
+ +
+ + + + diff --git a/Docs/html/_sphere_kernel_8cs_source.html b/Docs/html/_sphere_kernel_8cs_source.html index 25b7a00..14b0450 100644 --- a/Docs/html/_sphere_kernel_8cs_source.html +++ b/Docs/html/_sphere_kernel_8cs_source.html @@ -5,7 +5,7 @@ -PlanetCasson: PlanetCasson/Assets/Model/SphereKernel.cs Source File +Planet Casson: Planet Casson/Assets/Model/SphereKernel.cs Source File @@ -21,7 +21,7 @@ -
PlanetCasson +
Planet Casson
@@ -61,7 +61,7 @@
@@ -69,10 +69,17 @@
SphereKernel.cs
-
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using Model;
5 
6 public class SphereKernel : MonoBehaviour
7 {
8  public GameObject vertexObj;
9  public GameObject edgeObj;
10 
11  //public GameObject asdf;
12 
13  Cell SphereKernelCell;
14 
15  // Use this for initialization
16  void Start()
17  {
18  SphereKernelCell = Cell.MakePrimitiveCell();
19  SphereKernelCell.calculatePositions();
20  SphereKernelCell.instantiateGraph(this, vertexObj, edgeObj);
21  /* Example for adding components
22  asdf = new GameObject();
23  asdf.name = "asdf";
24  asdf.AddComponent<LineRenderer>();
25  */
26  }
27 
28  // Update is called once per frame
29  void Update()
30  {
31 
32  }
33 }
-
Package defining the implementation of the Quad-Edge data structure
Definition: Cell.cs:10
-
Quad-Edge data structure representing the graph iteself
Definition: Cell.cs:16
+
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using Model;
5 using Model.Objects;
6 
7 public class SphereKernel : MonoBehaviour
8 {
9  public GameObject vertexObj;
10  public GameObject edgeObj;
11  public GameObject faceObj;
12  public GameObject traverserObj;
13 
14  //public GameObject asdf;
15 
16  private Cell SphereKernelCell;
17  private GameObject[] VertexObjects;
18  private GameObject[] EdgeObjects;
19  private GameObject[] FaceObjects;
20 
21  // Use this for initialization
22  void Start()
23  {
24  SphereKernelCell = Cell.MakePrimitiveCell();
25  GameObject[][] tmp = SphereKernelCell.instantiateGraph(this, vertexObj, edgeObj, faceObj);
26  VertexObjects = tmp[0]; EdgeObjects = tmp[1]; FaceObjects = tmp[2];
27  foreach(GameObject vert in VertexObjects) { vert.GetComponent<VertexObject>().live = true; }
28  SphereKernelCell.calculatePositions(VertexObjects, EdgeObjects, FaceObjects);
29  SphereKernelCell.instantiateTraversals(this, traverserObj);
30  /* Example for adding components
31  asdf = new GameObject();
32  asdf.name = "asdf";
33  asdf.AddComponent<LineRenderer>();
34  */
35  }
36 
37  public void recalc()
38  {
39  SphereKernelCell.calculatePositions(VertexObjects, EdgeObjects, FaceObjects);
40  }
41 
42  // Update is called once per frame
43  void Update()
44  {
45 
46  }
47 }
+
Package defining the implementation of the modified Quad-Edge data structure
Definition: Cell.cs:10
+ +
GameObject [][] instantiateGraph(SphereKernel kernel, GameObject vertexObj, GameObject edgeObj, GameObject faceObj)
Definition: Cell.cs:139
+
void calculatePositions(GameObject[] vObjs, GameObject[] eObjs, GameObject[] fObjs)
Definition: Cell.cs:69
+
void instantiateTraversals(MonoBehaviour obj, GameObject traverserObj)
Iterate through faces of Cell and create a traversal object for each face
Definition: Cell.cs:215
+
Quad-Edge data structure representing the graph iteself.
Definition: Cell.cs:21
+
static Cell MakePrimitiveCell()
Definition: Cell.cs:35
+ +
-
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 
5 namespace Model
6 {
10  public class Vertex
11  {
15  public Vector3 pos;
19  public List<Edge> origEdges;
23  public List<Edge> destEdges;
24 
25  private Vertex()
26  {
27  origEdges = new List<Edge>();
28  destEdges = new List<Edge>();
29  }
30 
38  public static Vertex NewVertex()
39  {
40  return new Vertex();
41  }
42  }
43 }
Package defining the implementation of the Quad-Edge data structure
Definition: Cell.cs:10
-
Vertex representation in the Quad-Edge data structure.
Definition: Vertex.cs:10
-
List< Edge > origEdges
Definition: Vertex.cs:19
-
static Vertex NewVertex()
Definition: Vertex.cs:38
-
List< Edge > destEdges
Definition: Vertex.cs:23
-
Vector3 pos
Definition: Vertex.cs:15
+
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 
5 namespace Model
6 {
10  public class Vertex : FaceVertex
11  {
15  public Edge EdgeListHead
16  {
17  get { return EdgeListHead; }
18  set { EdgeListHead = value; }
19  }
23  public Vector3 pos;
24 
32  public static Vertex NewVertex()
33  {
34  return new Vertex();
35  }
36  }
37 }
Edge EdgeListHead
Definition: Vertex.cs:16
+
Edge representation in the modified Quad-Edge data structure.
Definition: Edge.cs:29
+
Package defining the implementation of the modified Quad-Edge data structure
Definition: Cell.cs:10
+ +
Vertex representation in the modified Quad-Edge data structure.
Definition: Vertex.cs:10
+
static Vertex NewVertex()
Definition: Vertex.cs:32
+
Interface for Face and Vertex class.
Definition: FaceVertex.cs:12
+
Vector3 pos
Definition: Vertex.cs:23
diff --git a/Docs/html/_vertex_object_8cs_source.html b/Docs/html/_vertex_object_8cs_source.html new file mode 100644 index 0000000..4e32e74 --- /dev/null +++ b/Docs/html/_vertex_object_8cs_source.html @@ -0,0 +1,89 @@ + + + + + + + +Planet Casson: Planet Casson/Assets/Prefab/VertexObject.cs Source File + + + + + + + + + +
+
+ + + + + + +
+
Planet Casson +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
VertexObject.cs
+
+
+
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using UnityEditor;
5 using Model;
6 
7 namespace Model.Objects
8 {
9  public class VertexObject : MonoBehaviour
10  {
11  public Cell graph;
12  public Vertex vertex;
13  public bool live = false;
14  public bool selected = false;
15  internal SphereKernel sphereKernel;
16 
17  // Use this for initialization
18  void Start()
19  {
20 
21  }
22 
23  void OnSelectionChange()
24  {
25  selected = !selected;
26  print("Selected a vertex!");
27  }
28 
29  // Update is called once per frame
30  void Update()
31  {
32  if (live && transform.hasChanged)
33  {
34  vertex.pos = this.gameObject.transform.position;
35  sphereKernel.recalc();
36  transform.hasChanged = false;
37  }
38  //if (Selection.Contains(this.gameObject))
39  // Debug.Log("I'm selected!");
40  }
41  }
42 }
+
Package defining the implementation of the modified Quad-Edge data structure
Definition: Cell.cs:10
+ +
Vertex representation in the modified Quad-Edge data structure.
Definition: FaceVertex.cs:64
+ +
Quad-Edge data structure representing the graph iteself.
Definition: Cell.cs:21
+ +
Vector3 pos
Definition: FaceVertex.cs:69
+ +
+ + + + diff --git a/Docs/html/annotated.html b/Docs/html/annotated.html index 5eedb64..080e4e4 100644 --- a/Docs/html/annotated.html +++ b/Docs/html/annotated.html @@ -5,7 +5,7 @@ -PlanetCasson: Class List +Planet Casson: Class List @@ -21,7 +21,7 @@ -
PlanetCasson +
Planet Casson
@@ -66,12 +66,16 @@
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 12]
- - - - - +
[detail level 123]
 NModelPackage defining the implementation of the Quad-Edge data structure
 CCellQuad-Edge data structure representing the graph iteself
 CEdgeEdge representation in the Quad-Edge data structure
 CFaceFace representation in the Quad-Edge data structure.
 CVertexVertex representation in the Quad-Edge data structure.
+ + + + + + + + +
 NModelPackage defining the implementation of the modified Quad-Edge data structure
 NObjects
 CVertexObject
 CCellQuad-Edge data structure representing the graph iteself
 CEdgeEdge representation in the Quad-Edge data structure
 CFaceFace representation in the Quad-Edge data structure
 CFaceVertexabstract class for Face and Vertex class
 CTraversalObjectAbstract class for objects that will traverse the graph
 CVertexVertex representation in the modified Quad-Edge data structure
 CSphereKernel
diff --git a/Docs/html/cellmodification.jpeg b/Docs/html/cellmodification.jpeg new file mode 100644 index 0000000..47447d9 Binary files /dev/null and b/Docs/html/cellmodification.jpeg differ diff --git a/Docs/html/class_model_1_1_cell-members.html b/Docs/html/class_model_1_1_cell-members.html index acd07cc..66b8f2d 100644 --- a/Docs/html/class_model_1_1_cell-members.html +++ b/Docs/html/class_model_1_1_cell-members.html @@ -5,7 +5,7 @@ -PlanetCasson: Member List +Planet Casson: Member List @@ -21,7 +21,7 @@ -
PlanetCasson +
Planet Casson
@@ -72,13 +72,14 @@

This is the complete list of members for Model.Cell, including all inherited members.

- - - - - - - + + + + + + + +
calculatePositions() (defined in Model.Cell)Model.Cell
instantiateGraph(MonoBehaviour obj, GameObject vertexObj, GameObject edgeObj) (defined in Model.Cell)Model.Cell
killFaceEdge(Edge e) (defined in Model.Cell)Model.Cell
killVertexEdge(Vertex v, Face left, Face right) (defined in Model.Cell)Model.Cell
makeFaceEdge(Face f, Vertex orig, Vertex dest) (defined in Model.Cell)Model.Cell
MakePrimitiveCell() (defined in Model.Cell)Model.Cellstatic
makeVertexEdge(Vertex v, Face left, Face right) (defined in Model.Cell)Model.Cell
calculatePositions(GameObject[] vObjs, GameObject[] eObjs, GameObject[] fObjs)Model.Cell
instantiateGraph(SphereKernel kernel, GameObject vertexObj, GameObject edgeObj, GameObject faceObj)Model.Cell
instantiateTraversals(MonoBehaviour obj, GameObject traverserObj)Model.Cell
killFaceEdge(Face f, Vertex orig, Vertex dest)Model.Cell
killVertexEdge(Vertex v, Face left, Face right)Model.Cell
makeFaceEdge(Face f, Vertex orig, Vertex dest)Model.Cell
MakePrimitiveCell()Model.Cellstatic
makeVertexEdge(Vertex v, Face left, Face right)Model.Cell

The documentation for this class was generated from the following file:
    -
  • PlanetCasson/Assets/Model/Edge.cs
  • +
  • Planet Casson/Assets/Model/Edge.cs
diff --git a/Docs/html/class_model_1_1_face-members.html b/Docs/html/class_model_1_1_face-members.html index f0eb0fb..3dd298e 100644 --- a/Docs/html/class_model_1_1_face-members.html +++ b/Docs/html/class_model_1_1_face-members.html @@ -5,7 +5,7 @@ -PlanetCasson: Member List +Planet Casson: Member List @@ -21,7 +21,7 @@ -
PlanetCasson +
Planet Casson
@@ -72,7 +72,7 @@

This is the complete list of members for Model.Face, including all inherited members.

- +
edgesModel.Face
EdgeListHeadModel.FaceVertex
NewFace()Model.Facestatic
diff --git a/Docs/html/class_model_1_1_face.html b/Docs/html/class_model_1_1_face.html index adf1f94..ff8f34d 100644 --- a/Docs/html/class_model_1_1_face.html +++ b/Docs/html/class_model_1_1_face.html @@ -5,7 +5,7 @@ -PlanetCasson: Model.Face Class Reference +Planet Casson: Model.Face Class Reference @@ -21,7 +21,7 @@ -
PlanetCasson +
Planet Casson
@@ -67,7 +67,6 @@
Model.Face Class Reference
@@ -76,21 +75,32 @@

Face representation in the Quad-Edge data structure. More...

+
+Inheritance diagram for Model.Face:
+
+
+ + +Model.FaceVertex + +

Static Public Member Functions

static Face NewFace ()
 
- - - + + + +

-Public Attributes

HashSet< Edgeedges
 

+Additional Inherited Members

- Properties inherited from Model.FaceVertex
Edge EdgeListHead [get, set]
 

Detailed Description

Face representation in the Quad-Edge data structure.

+

To see how the Edge linkage of the Face is managed, see FaceVertex.

-

Definition at line 11 of file Face.cs.

+

Definition at line 45 of file FaceVertex.cs.

Member Function Documentation

◆ NewFace()

@@ -120,32 +130,12 @@

Face f = Face.NewFace();
Returns
The newly created Face
-

Definition at line 30 of file Face.cs.

- -

-
-

Member Data Documentation

- -

◆ edges

- -
-
- - - - -
HashSet<Edge> Model.Face.edges
-
- -

-

The collection of directed edges(see Edge) that surrounds the face.

- -

Definition at line 16 of file Face.cs.

+

Definition at line 54 of file FaceVertex.cs.


The documentation for this class was generated from the following file: diff --git a/Docs/html/class_model_1_1_face.png b/Docs/html/class_model_1_1_face.png new file mode 100644 index 0000000..895bbd1 Binary files /dev/null and b/Docs/html/class_model_1_1_face.png differ diff --git a/Docs/html/class_model_1_1_face_vertex-members.html b/Docs/html/class_model_1_1_face_vertex-members.html new file mode 100644 index 0000000..6fe05e2 --- /dev/null +++ b/Docs/html/class_model_1_1_face_vertex-members.html @@ -0,0 +1,84 @@ + + + + + + + +Planet Casson: Member List + + + + + + + + + +
+
+ + + + + + +
+
Planet Casson +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Model.FaceVertex Member List
+
+
+ +

This is the complete list of members for Model.FaceVertex, including all inherited members.

+ + +
EdgeListHeadModel.FaceVertex
+ + + + diff --git a/Docs/html/class_model_1_1_face_vertex.html b/Docs/html/class_model_1_1_face_vertex.html new file mode 100644 index 0000000..4f8f3ce --- /dev/null +++ b/Docs/html/class_model_1_1_face_vertex.html @@ -0,0 +1,144 @@ + + + + + + + +Planet Casson: Model.FaceVertex Class Reference + + + + + + + + + +
+
+ + + + + + +
+
Planet Casson +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
Model.FaceVertex Class Reference
+
+
+ +

abstract class for Face and Vertex class. + More...

+
+Inheritance diagram for Model.FaceVertex:
+
+
+ + +Model.Face +Model.Vertex + +
+ + + + +

+Properties

Edge EdgeListHead [get, set]
 
+

Detailed Description

+

abstract class for Face and Vertex class.

+

It is used to express the morphability between Faces and Verticies in a graph and its dual graph. A vertex in the graph is simultaneously a face in the dual graph. The same is true for the face where it is a vertex in the dual graph.

+ +

Definition at line 14 of file FaceVertex.cs.

+

Property Documentation

+ +

◆ EdgeListHead

+ +
+
+ + + + + +
+ + + + +
Edge Model.FaceVertex.EdgeListHead
+
+getset
+
+ +

+

When the runtime class is Face:

+

Stores the first dual Edge pointing from the center of the face towards an edge surrounding the face. The dual of this edge is an edge facing CCW direction bordering this face.

+

When the runtime class is Vertex:

+

Stores the first Edge pointing from the center of this vertex.

+

will throw an ArgumentException when the value set for EdgeListHead is not a valid value

+

To find all edges pointing out of the FaceVertex, you can take the edge and traversing in the Onext direction until you encounter the starting edge.

+

Note, this will throw an ArgumentException when the value set for EdgeListHead is not a valid value

+ +

Definition at line 29 of file FaceVertex.cs.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/Docs/html/class_model_1_1_face_vertex.png b/Docs/html/class_model_1_1_face_vertex.png new file mode 100644 index 0000000..a425940 Binary files /dev/null and b/Docs/html/class_model_1_1_face_vertex.png differ diff --git a/Docs/html/class_model_1_1_objects_1_1_vertex_object-members.html b/Docs/html/class_model_1_1_objects_1_1_vertex_object-members.html new file mode 100644 index 0000000..394a264 --- /dev/null +++ b/Docs/html/class_model_1_1_objects_1_1_vertex_object-members.html @@ -0,0 +1,87 @@ + + + + + + + +Planet Casson: Member List + + + + + + + + + +
+
+ + + + + + +
+
Planet Casson +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Model.Objects.VertexObject Member List
+
+
+ +

This is the complete list of members for Model.Objects.VertexObject, including all inherited members.

+ + + + + +
graph (defined in Model.Objects.VertexObject)Model.Objects.VertexObject
live (defined in Model.Objects.VertexObject)Model.Objects.VertexObject
selected (defined in Model.Objects.VertexObject)Model.Objects.VertexObject
vertex (defined in Model.Objects.VertexObject)Model.Objects.VertexObject
+ + + + diff --git a/Docs/html/class_model_1_1_objects_1_1_vertex_object.html b/Docs/html/class_model_1_1_objects_1_1_vertex_object.html new file mode 100644 index 0000000..7ee874e --- /dev/null +++ b/Docs/html/class_model_1_1_objects_1_1_vertex_object.html @@ -0,0 +1,113 @@ + + + + + + + +Planet Casson: Model.Objects.VertexObject Class Reference + + + + + + + + + +
+
+ + + + + + +
+
Planet Casson +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
Model.Objects.VertexObject Class Reference
+
+
+
+Inheritance diagram for Model.Objects.VertexObject:
+
+
+ + + +
+ + + + + + + + + + +

+Public Attributes

+Cell graph
 
+Vertex vertex
 
+bool live = false
 
+bool selected = false
 
+

Detailed Description

+
+

Definition at line 9 of file VertexObject.cs.

+

The documentation for this class was generated from the following file: +
+ + + + diff --git a/Docs/html/class_model_1_1_objects_1_1_vertex_object.png b/Docs/html/class_model_1_1_objects_1_1_vertex_object.png new file mode 100644 index 0000000..e81cd70 Binary files /dev/null and b/Docs/html/class_model_1_1_objects_1_1_vertex_object.png differ diff --git a/Docs/html/class_model_1_1_traversal_object-members.html b/Docs/html/class_model_1_1_traversal_object-members.html new file mode 100644 index 0000000..f81a850 --- /dev/null +++ b/Docs/html/class_model_1_1_traversal_object-members.html @@ -0,0 +1,89 @@ + + + + + + + +Planet Casson: Member List + + + + + + + + + +
+
+ + + + + + +
+
Planet Casson +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
Model.TraversalObject Member List
+
+
+ +

This is the complete list of members for Model.TraversalObject, including all inherited members.

+ + + + + + + +
AssignTraversalValues(Edge currentEdge, float position, float velocity)Model.TraversalObject
CurrentEdge (defined in Model.TraversalObject)Model.TraversalObject
getVectorPosition(float percentPos)Model.TraversalObject
Position (defined in Model.TraversalObject)Model.TraversalObject
Update()Model.TraversalObject
Velocity (defined in Model.TraversalObject)Model.TraversalObject
+ + + + diff --git a/Docs/html/class_model_1_1_traversal_object.html b/Docs/html/class_model_1_1_traversal_object.html new file mode 100644 index 0000000..13eaddc --- /dev/null +++ b/Docs/html/class_model_1_1_traversal_object.html @@ -0,0 +1,220 @@ + + + + + + + +Planet Casson: Model.TraversalObject Class Reference + + + + + + + + + +
+
+ + + + + + +
+
Planet Casson +
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
Model.TraversalObject Class Reference
+
+
+ +

Abstract class for objects that will traverse the graph + More...

+
+Inheritance diagram for Model.TraversalObject:
+
+
+ + + +
+ + + + + + + + + + + +

+Public Member Functions

void AssignTraversalValues (Edge currentEdge, float position, float velocity)
 Method used to construct a new traversal object More...
 
Vector3 getVectorPosition (float percentPos)
 Gives position of object as a Vector3 More...
 
void Update ()
 Called by the Unity Engine at every frame. Adjusts the position of the traversal object More...
 
+ + + + + + + +

+Properties

+Edge CurrentEdge [get, set]
 
+float Position [get, set]
 
+float Velocity [get, set]
 
+

Detailed Description

+

Abstract class for objects that will traverse the graph

+ +

Definition at line 8 of file TraversalObject.cs.

+

Member Function Documentation

+ +

◆ AssignTraversalValues()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void Model.TraversalObject.AssignTraversalValues (Edge currentEdge,
float position,
float velocity 
)
+
+ +

Method used to construct a new traversal object

+
Parameters
+ + + + + +
faceTravelled
currentEdge
position
velocity
+
+
+
Returns
New traversal object with the properties given in the parameters
+ +

Definition at line 25 of file TraversalObject.cs.

+ +
+
+ +

◆ getVectorPosition()

+ +
+
+ + + + + + + + +
Vector3 Model.TraversalObject.getVectorPosition (float percentPos)
+
+ +

Gives position of object as a Vector3

+
Returns
Vector3 position
+ +

Definition at line 61 of file TraversalObject.cs.

+ +
+
+ +

◆ Update()

+ +
+
+ + + + + + + +
void Model.TraversalObject.Update ()
+
+ +

Called by the Unity Engine at every frame. Adjusts the position of the traversal object

+ +

Definition at line 78 of file TraversalObject.cs.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/Docs/html/class_model_1_1_traversal_object.png b/Docs/html/class_model_1_1_traversal_object.png new file mode 100644 index 0000000..73e3053 Binary files /dev/null and b/Docs/html/class_model_1_1_traversal_object.png differ diff --git a/Docs/html/class_model_1_1_vertex-members.html b/Docs/html/class_model_1_1_vertex-members.html index 6544261..adda273 100644 --- a/Docs/html/class_model_1_1_vertex-members.html +++ b/Docs/html/class_model_1_1_vertex-members.html @@ -5,7 +5,7 @@ -PlanetCasson: Member List +Planet Casson: Member List @@ -21,7 +21,7 @@ -
PlanetCasson +
Planet Casson
@@ -72,10 +72,9 @@

This is the complete list of members for Model.Vertex, including all inherited members.

- + - - +
destEdgesModel.Vertex
EdgeListHeadModel.FaceVertex
NewVertex()Model.Vertexstatic
origEdgesModel.Vertex
posModel.Vertex
posModel.Vertex