VIS2 SS2013 CVD DVR
 All Classes Namespaces Functions Enumerations Properties
GameProperties.cs
1 #region Using Statements
2 using System;
3 using System.Collections.Generic;
4 using System.Linq;
5 using System.Text;
6 using Microsoft.Xna.Framework;
7 using Microsoft.Xna.Framework.Graphics;
8 #endregion
9 
10 namespace visLU
11 {
15  public struct EngineState
16  {
17  public bool updateCamera;
18  public bool loadData;
19  public bool updateData;
20  public bool drawData;
21 
22  public EngineState(bool _updateCamera, bool _loadData, bool _updateData, bool _drawData)
23  {
24  updateCamera = _updateCamera;
25  loadData = _loadData;
26  updateData = _updateData;
27  drawData = _drawData;
28  }
29 
30  }
31 
35  public enum ViewMode
36  {
37  VolView = 0, //3d view
38  TopView, //top view -> y slice
39  SideView, //side view -> x slice
40  FrontView //front view -> z slice
41  };
42 
46  public enum CVDViewMode
47  {
48  RefView = 0, //3d view
49  RecView, //Recolored image view
50  CVDView, //optimized TF
51  SimView //dichromacy simulation view
52  };
53 
57  public enum ViewportMode
58  {
59  Single = 0,
60  Split4
61  };
62 
66  public enum CVDType
67  {
68  Deuteranopy = 0,
69  Protanopy,
70  Tritanopy
71  };
72 
76  public sealed class GameProperties
77  {
78 
79  static GameProperties instance = new GameProperties();
80 
81  public bool shaderDebugMode = false;
82  public bool debugOutput = false;
83 
84  public string CVD = "deuteranopy";
85  public bool recolor = false;
86 
87 
88 
89  #region engine states
90  //public bool fullscreen = false; //old version -> fullscreen option
91  public EngineState engineState = new EngineState(true, false, false, false);
92  #endregion
93 
94  #region xna draw window
95  public int GuiWindowWidth = 1024;
96  public int GuiWindowHeight = 768;
97  public int XNADrawSurfaceWidth = 690;
98  public int XNADrawSurfaceHeight = 700;
99  public int fullscreenWidth = 1024;
100  public int fullscreenHeight = 786;
101  //public Viewport XNAViewport;
102  public bool showInfoText = true;
103  #endregion
104 
105  #region transfer function
106 
107  public float[] distinctDensityValues;
108  public int[] countDensityValues;
109  public List<TransferControlPoint> colorControlPoints = new List<TransferControlPoint>();
110  public List<TransferControlPoint> alphaControlPoints = new List<TransferControlPoint>();
111  public List<TransferControlPoint> cvdColorControlPoints = new List<TransferControlPoint>();
112  #endregion
113 
114  #region gui input
115  //main menu
116  //initial dataset to load
117  public String dataDir = "Data\\";
118  public String dataFilename = "lobster.dat";
119  //public String dataFilename = "skewed_head.dat";
120  // public String saveFilename = "Data\\Screenshots";
121 
122  public String saveFilename = "scene.png";//for debugging
123  public bool saveView = false;
124 
125  //view panel
126  public ViewMode viewMode = ViewMode.VolView; //initial view: 3d view
127  public CVDViewMode cvdViewMode = CVDViewMode.RefView;
128  public ViewportMode viewportMode = ViewportMode.Split4;
129  //slice setup
130  public int xDataRange = 100;
131  public int yDataRange = 100;
132  public int zDataRange = 100;
133  public float xSliceValue = 0.5f;
134  public float ySliceValue = 0.5f;
135  public float zSliceValue = 0.5f;
136 
137  //transferfunction panel
138  public bool enableTransferFunction = true;
139  public bool enableTransferAlphaValues = false;
140  public bool showDensityValue = true;
141 
142  //cvd functionality
143  //cvd functionality
144  public bool CVDTFOptimized = false; //indicates if the optimization was already processed
145  public CVDType cvdType = CVDType.Deuteranopy;
146  public bool enableCVDView = false;
147  public bool simulate = false;
148  public bool originalView = true; //render original rgb image == ViewMode.VolView
149  public bool recoloredView = false; //render recolored image
150  public bool cvdView = false; //render cvd image
151  public bool simulatedView = false;
152  public float lambda = 0.0f; //default value by paper
153  //trigger recolor, optimize and simulate
154  public bool triggerRecolor = false;
155  public bool triggerOptimize = false;
156  public bool triggerSimulate = false;
157 
158  //clipping plane setup
159  public bool enableClippingPlane = true; //?
160 
161  //projection setup
162  public bool perspectiveProjection = true;
163  public bool maximumIntensityProjection = false;
164 
165  //shader parameters
166  //Blending
167  public bool enableFrontToBackBlend = false;
168 
169  //Shading on/off
170  public bool enableShading = true;
171  public Vector3 directLightPos = new Vector3(1.0f, 4.0f, 1.0f);
172 
173  //Gradient stuff
174  public int gradientSampleSize = 1;
175  public float currSampleDist = 1.0f;
176  public float baseSampleDist = 0.5f; //dataset sample distance
177  public bool enableAvgFilter = false;
178  public bool enableGaussFilter = false;
179 
180  //move camera in 3d view
181  //x,y -> cursor position, z ->scroll step for zooming option
182  public Vector3 position = Vector3.Zero;
183  public Vector3 cameraInput = Vector3.Zero;
184  public Vector3 dataOrigin = Vector3.Zero; //new Vector3(0.5f, 0.5f, 0.0f);
185  #endregion
186 
187  //--------------------------------------------------------------
188  public static GameProperties Instance
189  {
190  get
191  {
192  return instance;
193  }
194  }
195 
196  private static void calculateViewportDimension()
197  {
198 
199  }
200 
201  static GameProperties(){}
202 
203  GameProperties(){}
204  }
205 }