![]() |
rtVTK
0.6.0
|
00001 00002 /****************************************************************************** 00003 * Copyright (c) 2012, Grove City College 00004 * All rights reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions are 00008 * met: 00009 * 00010 * * Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 00013 * * Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in 00015 * the documentation and/or other materials provided with the 00016 * distribution. 00017 * 00018 * * Neither the name of Grove City College nor the names of its 00019 * contributors may be used to endorse or promote products derived 00020 * from this software without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00023 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00024 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00025 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00026 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00027 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00028 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00029 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00030 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00031 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00032 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 */ 00035 00036 00037 #ifndef Core_ioCore_Scene_h 00038 #define Core_ioCore_Scene_h 00039 00040 #include <string> 00041 using std::string; 00042 00043 #include <Core/ioCore/Options.h> 00044 00045 #include <Core/Mesh.h> 00046 00047 #include <Math/Math.h> 00048 00049 00050 namespace ioCore 00051 { 00052 00054 // Using declarations 00055 00056 using CoreF::RGB; 00057 00058 using MathF::Point; 00059 using MathF::Vector; 00060 00061 00063 // Class definition 00064 00069 class Scene 00070 { 00071 public: 00076 struct ImageParameters 00077 { 00078 uint xSpp; 00079 uint ySpp; 00080 uint xRes; 00081 uint yRes; 00082 }; // struct ImageParameters 00083 00088 struct ViewParameters 00089 { 00090 Point eye; 00091 Point lookat; 00092 Vector up; 00093 00094 float flength; 00095 float fstop; 00096 float dscale; 00097 float fov; 00098 }; // struct ViewParameters 00099 00100 // Constructor, destructor 00101 Scene(const Options* = 0); 00102 ~Scene(); 00103 00104 // Load a scene file. 00105 00106 bool load(const Options*); 00107 00109 // Accessors 00110 00111 const string& getTitle() const; 00112 const string& getViewFilename() const; 00113 const string& getMeshFilename() const; 00114 const ImageParameters& getImageParameters() const; 00115 const ViewParameters& getViewParameters() const; 00116 const RGB& getSky() const; 00117 const RGB& getGround() const; 00118 float getEpsilon() const; 00119 uint getThreshold() const; 00120 00121 private: 00122 string title; 00123 string vfname; 00124 string mfname; 00125 00126 ImageParameters image; 00127 ViewParameters view; 00128 RGB sky; 00129 RGB ground; 00130 float epsilon; 00131 uint thold; 00132 }; // class Scene 00133 00134 00136 // Inline member definitions 00137 00138 inline const string& Scene::getTitle() const 00139 { 00140 return title; 00141 } 00142 00143 inline const string& Scene::getViewFilename() const 00144 { 00145 return vfname; 00146 } 00147 00148 inline const string& Scene::getMeshFilename() const 00149 { 00150 return mfname; 00151 } 00152 00153 inline const Scene::ImageParameters& Scene::getImageParameters() const 00154 { 00155 return image; 00156 } 00157 00158 inline const Scene::ViewParameters& Scene::getViewParameters() const 00159 { 00160 return view; 00161 } 00162 00163 inline const RGB& Scene::getSky() const 00164 { 00165 return sky; 00166 } 00167 00168 inline const RGB& Scene::getGround() const 00169 { 00170 return ground; 00171 } 00172 00173 inline float Scene::getEpsilon() const 00174 { 00175 return epsilon; 00176 } 00177 00178 inline uint Scene::getThreshold() const 00179 { 00180 return thold; 00181 } 00182 00183 } // namespace ioCore 00184 00185 #endif // Core_ioCore_Scene_h