HyperspaceExplorer 0.7.1
|
00001 /* 00002 Hyperspace Explorer - visualizing higher-dimensional geometry 00003 Copyright (C) 2010 Lene Preuss <lene.preuss@gmail.com> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 00019 */ 00020 00021 #ifndef DEFINITIONRANGEOFDIMENSION_IMPL_H 00022 #define DEFINITIONRANGEOFDIMENSION_IMPL_H 00023 00024 #include "DefinitionRangeOfDimension.h" 00025 00026 template<unsigned D> 00027 double DefinitionRangeOfDimension<D>::getMinValue(unsigned i) const { 00028 assert(i < D); 00029 return range_[i].getMinValue(); 00030 } 00031 00032 template<unsigned D> 00033 VecMath::Vector<D, double> DefinitionRangeOfDimension<D>::getMinValue() const { 00034 VecMath::Vector<D, double> minValue; 00035 for (unsigned i = 0; i < D; ++i) { 00036 minValue[i] = getMinValue(i); 00037 } 00038 return minValue; 00039 } 00040 00041 template<unsigned D> 00042 void DefinitionRangeOfDimension<D>::setMinValue(unsigned i, double minValue) { 00043 assert(i < D); 00044 range_[i].setMinValue(minValue); 00045 } 00046 00047 template<unsigned D> 00048 double DefinitionRangeOfDimension<D>::getMaxValue(unsigned i) const { 00049 assert(i < D); 00050 return range_[i].getMaxValue(); 00051 } 00052 00053 template<unsigned D> 00054 VecMath::Vector<D, double> DefinitionRangeOfDimension<D>::getMaxValue() const { 00055 VecMath::Vector<D, double> maxValue; 00056 for (unsigned i = 0; i < D; ++i) { 00057 maxValue[i] = getMaxValue(i); 00058 } 00059 return maxValue; 00060 } 00061 00062 template<unsigned D> 00063 void DefinitionRangeOfDimension<D>::setMaxValue(unsigned i, double maxValue) { 00064 assert(i < D); 00065 range_[i].setMaxValue(maxValue); 00066 } 00067 00068 template<unsigned D> 00069 double DefinitionRangeOfDimension<D>::getStepsize(unsigned i) const { 00070 assert(i < D); 00071 return range_[i].getStepsize(); 00072 } 00073 00074 template<unsigned D> 00075 void DefinitionRangeOfDimension<D>::setStepsize(unsigned i, double stepsize) { 00076 assert(i < D); 00077 range_[i].setStepsize(stepsize); 00078 } 00079 00080 template<unsigned D> 00081 unsigned DefinitionRangeOfDimension<D>::getNumSteps(unsigned i) const { 00082 assert(i < D); 00083 return range_[i].getNumSteps(); 00084 } 00085 00086 template<unsigned D> 00087 VecMath::Vector<D, unsigned> DefinitionRangeOfDimension<D>::getNumSteps() const { 00088 VecMath::Vector<D, unsigned> numSteps; 00089 for (unsigned i = 0; i < D; ++i) { 00090 numSteps[i] = getNumSteps(i); 00091 } 00092 return numSteps; 00093 } 00094 00095 template<unsigned D> 00096 void DefinitionRangeOfDimension<D>::setNumSteps(unsigned i, unsigned numSteps) { 00097 assert(i < D); 00098 range_[i].setNumSteps(numSteps); 00099 } 00100 00101 template<unsigned D> 00102 void DefinitionRangeOfDimension<D>::setRange(unsigned i, const DefinitionSpaceRange &range) { 00103 assert(i < D); 00104 range_[i] = range; 00105 } 00106 00107 #endif