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 VIEWPOINTLIST_IMPL_H 00022 #define VIEWPOINTLIST_IMPL_H 00023 00024 #include <ViewpointList.h> 00025 00026 00027 template <unsigned N, unsigned Nnew, typename NUM> 00028 ViewpointList< N, Nnew, NUM >::ViewpointList(): 00029 _elements() { 00030 _elements.first = VecMath::Vector<N, NUM>(); 00031 _elements.second = ViewpointList<N-1, Nnew, NUM>(); 00032 } 00033 00036 template <unsigned N, unsigned Nnew, typename NUM> 00037 ViewpointList< N, Nnew, NUM >::ViewpointList(NUM camW): 00038 _elements() { 00039 _elements.first = VecMath::Vector<N, NUM>(); 00040 _elements.first[N-1] = camW; 00041 _elements.second = ViewpointList<N-1, Nnew, NUM>(camW); 00042 } 00043 00044 template <unsigned N, unsigned Nnew, typename NUM> 00045 ViewpointList< N, Nnew, NUM >::ViewpointList( 00046 const VecMath::Vector<N, NUM> &head, 00047 const ViewpointList<N-1, Nnew, NUM> &tail): 00048 _elements(head, tail) { } 00049 00052 template <unsigned N, unsigned Nnew, typename NUM> 00053 ViewpointList< N, Nnew, NUM > ViewpointList< N, Nnew, NUM >::make( 00054 const VecMath::Vector<N, NUM> &x0) { 00055 return ViewpointList<N, Nnew, NUM>(x0); 00056 } 00057 00061 template <unsigned N, unsigned Nnew, typename NUM> 00062 ViewpointList< N, Nnew, NUM > ViewpointList< N, Nnew, NUM >::make( 00063 const VecMath::Vector<N, NUM> &x0, const VecMath::Vector<N-1, NUM> &x1) { 00064 return ViewpointList<N, Nnew, NUM>(x0, make(x1)); 00065 } 00066 00071 template <unsigned N, unsigned Nnew, typename NUM> 00072 ViewpointList< N, Nnew, NUM > ViewpointList< N, Nnew, NUM >::make( 00073 const VecMath::Vector<N, NUM> &x0, const VecMath::Vector<N-1, NUM> &x1, 00074 const VecMath::Vector<N-2, NUM> &x2) { 00075 return ViewpointList<N, Nnew, NUM>(x0, make(x1, x2)); 00076 } 00077 00083 template <unsigned N, unsigned Nnew, typename NUM> 00084 ViewpointList< N, Nnew, NUM > ViewpointList< N, Nnew, NUM >::make( 00085 const VecMath::Vector<N, NUM> &x0, const VecMath::Vector<N-1, NUM> &x1, 00086 const VecMath::Vector<N-2, NUM> &x2, const VecMath::Vector<N-3, NUM> &x3) { 00087 return ViewpointList<N, Nnew, NUM>(x0, make(x1, x2, x3)); 00088 } 00089 00096 template <unsigned N, unsigned Nnew, typename NUM> 00097 ViewpointList< N, Nnew, NUM > ViewpointList< N, Nnew, NUM >::make( 00098 const VecMath::Vector<N, NUM> &x0, const VecMath::Vector<N-1, NUM> &x1, 00099 const VecMath::Vector<N-2, NUM> &x2, const VecMath::Vector<N-3, NUM> &x3, 00100 const VecMath::Vector<N-4, NUM> &x4) { 00101 return ViewpointList<N, Nnew, NUM>(x0, make(x1, x2, x3, x4)); 00102 } 00103 00111 template <unsigned N, unsigned Nnew, typename NUM> 00112 ViewpointList< N, Nnew, NUM > ViewpointList< N, Nnew, NUM >::make( 00113 const VecMath::Vector<N, NUM> &x0, const VecMath::Vector<N-1, NUM> &x1, 00114 const VecMath::Vector<N-2, NUM> &x2, const VecMath::Vector<N-3, NUM> &x3, 00115 const VecMath::Vector<N-4, NUM> &x4, const VecMath::Vector<N-5, NUM> &x5) { 00116 return ViewpointList<N, Nnew, NUM>(x0, make(x1, x2, x3, x4, x5)); 00117 } 00118 00127 template <unsigned N, unsigned Nnew, typename NUM> 00128 ViewpointList< N, Nnew, NUM > ViewpointList< N, Nnew, NUM >::make( 00129 const VecMath::Vector<N, NUM> &x0, const VecMath::Vector<N-1, NUM> &x1, 00130 const VecMath::Vector<N-2, NUM> &x2, const VecMath::Vector<N-3, NUM> &x3, 00131 const VecMath::Vector<N-4, NUM> &x4, const VecMath::Vector<N-5, NUM> &x5, 00132 const VecMath::Vector<N-6, NUM> &x6) { 00133 return ViewpointList<N, Nnew, NUM>(x0, make(x1, x2, x3, x4, x5, x6)); 00134 } 00135 00145 template <unsigned N, unsigned Nnew, typename NUM> 00146 ViewpointList< N, Nnew, NUM > ViewpointList< N, Nnew, NUM >::make( 00147 const VecMath::Vector<N, NUM> &x0, const VecMath::Vector<N-1, NUM> &x1, 00148 const VecMath::Vector<N-2, NUM> &x2, const VecMath::Vector<N-3, NUM> &x3, 00149 const VecMath::Vector<N-4, NUM> &x4, const VecMath::Vector<N-5, NUM> &x5, 00150 const VecMath::Vector<N-6, NUM> &x6, const VecMath::Vector<N-7, NUM> &x7) { 00151 return ViewpointList<N, Nnew, NUM>(x0, make(x1, x2, x3, x4, x5, x6, x7)); 00152 } 00153 00154 #endif