00001 #region using statements 00002 using System; 00003 using System.Collections.Generic; 00004 using System.Linq; 00005 using System.Text; 00006 using Microsoft.Xna.Framework; 00007 using Microsoft.Xna.Framework.Graphics; 00008 #endregion 00009 00010 namespace visLU 00011 { 00015 public struct EngineState 00016 { 00017 public bool updateCamera; 00018 public bool loadData; 00019 public bool updateData; 00020 public bool drawData; 00021 00022 public EngineState(bool _updateCamera, bool _loadData, bool _updateData, bool _drawdata) 00023 { 00024 updateCamera = _updateCamera; 00025 loadData = _loadData; 00026 updateData = _updateData; 00027 drawData = _drawdata; 00028 } 00029 00030 } 00031 00035 public enum ViewMode 00036 { 00037 //Default = 0, //3d view + slicing views 00038 VolView = 0, //3d view 00039 TopView, //top view -> y slice 00040 SideView, //side view -> x slice 00041 FrontView //front view -> z slice 00042 }; 00043 00047 public sealed class GameProperties 00048 { 00049 00050 static GameProperties instance = new GameProperties(); 00051 00052 #region game and engine states 00053 public bool startGame = false; 00054 public bool exitGame = false; 00055 public bool updateGuiForm = false; 00056 public bool fullscreen = false; 00057 public EngineState engineState = new EngineState(true, false, true, true); 00058 #endregion 00059 00060 #region xna draw window 00061 public int GuiWindowWidth = 1024; 00062 public int GuiWindowHeight = 768; 00063 public int XNADrawSurfaceWidth = 700; 00064 public int XNADrawSurfaceHeight = 700; 00065 public int fullscreenWidth = 1024; 00066 public int fullscreenHeight = 786; 00067 public Viewport XNAViewport; 00068 #endregion 00069 00070 #region transfer function 00071 public bool enableTransferFunction = true; 00072 public bool enableTransferAlphaValues = true; 00073 public float[] distinctDensityValues; 00074 public int[] countDensityValues; 00075 public List<TransferControlPoint> colorControlPoints = new List<TransferControlPoint>(); 00076 public List<TransferControlPoint> alphaControlPoints = new List<TransferControlPoint>(); 00077 public Color[] colorArray; 00078 public float[] alphaArray; 00079 public bool updateColorBar = false; 00080 #endregion 00081 00082 #region gui input 00083 //main menu 00084 public String dataDir = "Data\\"; 00085 public String dataFilename = "lobster.dat"; 00086 //public String dataFilename = "skewed_head.dat"; 00087 public String saveFilename = "Data\\Screenshots"; 00088 public bool saveView = false; 00089 00090 //view panel 00091 public ViewMode viewMode = ViewMode.VolView; //default: 3d view 00092 00093 //slice setup 00094 public int xDataRange = 100; 00095 public int yDataRange = 100; 00096 public int zDataRange = 100; 00097 public float xSliceValue = 0.5f; 00098 public float ySliceValue = 0.5f; 00099 public float zSliceValue = 0.5f; 00100 00101 //clipping plane setup 00102 public bool enableClippingPlane = false; 00103 00104 //projection setup 00105 00106 //shader parameters 00107 00108 public bool perspectiveProjection = true; 00109 public bool maximumIntensityProjection = false; 00110 //public bool frontToBack = true; 00111 //public bool shading = true; 00112 //public bool useAlpha = true; 00113 00114 //Blending 00115 public bool enableFrontToBackBlend = true; 00116 00117 //Shading on/off 00118 public bool enableShading = true; 00119 00120 //Gradient stuff 00121 public int gradientSampleSize = 1; 00122 00123 //move camera in 3d view 00124 //x,y -> cursor position, z ->scroll step for zooming option 00125 public Vector3 position = Vector3.Zero; 00126 public Vector3 dataOrigin = Vector3.Zero; //new Vector3(0.5f, 0.5f, 0.0f); 00127 #endregion 00128 00129 //-------------------------------------------------------------- 00130 public static GameProperties Instance 00131 { 00132 get 00133 { 00134 return instance; 00135 } 00136 } 00137 00138 private static void calculateViewportDimension() 00139 { 00140 00141 } 00142 00143 static GameProperties(){} 00144 00145 GameProperties(){} 00146 } 00147 }