HyperspaceExplorer 0.7.1
VertexHolder.h
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 VertexHolder_H
00022 #define VertexHolder_H
00023 
00024 #include "Displayable.h"
00025 
00026 namespace VecMath {
00027   template <typename T, unsigned D> class MultiDimensionalVector;
00028 }
00029 
00030 template <unsigned N, unsigned P, typename NUM> class ParametricFunction;
00031 template <unsigned N, unsigned P, typename NUM> class VertexGrid;
00032 
00035 
00047 template <unsigned N, unsigned P, typename NUM = double>
00048 class VertexHolder : public Displayable {
00049 
00050   public:
00051 
00053    // typedef ParametricFunction<N, P, NUM> function_type;
00055     typedef VecMath::Vector<N, NUM> vertex_type;
00057     typedef VecMath::Vector<3, NUM> projected_vertex_type;
00058 
00059     VertexHolder(ParameterMap parameters);
00060 
00061     virtual void Transform (const VecMath::Rotation<N, NUM> &R,
00062                             const vertex_type &T,
00063                             const vertex_type &scale = vertex_type(1.));
00064     virtual void Project (double ScrW, double CamW, bool DepthCue4D);
00065 
00066     virtual void calibrateColors();
00067 
00068     virtual unsigned int getDefinitionSpaceDimensions();
00069 
00070     virtual void for_each_vertex(function_on_fourspace_vertex apply);
00071     virtual void for_each_vertex_transformed(function_on_fourspace_and_transformed_vertex apply);
00072     virtual void for_each_vertex_transformed_projected(function_on_fourspace_transformed_and_projected_vertex apply);
00073     virtual void for_each_projected(function_on_projected_vertex apply);
00074 
00075   protected:
00076 
00078     const VecMath::MultiDimensionalVector< vertex_type, P > &X() const;
00080     void setX(const VertexGrid<N, P, NUM>& x);
00082     const VecMath::MultiDimensionalVector< vertex_type, P > &Xtrans() const;
00084     void setXtrans(const VecMath::MultiDimensionalVector< vertex_type, P >& x);
00086     const VecMath::MultiDimensionalVector< projected_vertex_type, P > &Xscr() const;
00088     void setXscr(const VecMath::MultiDimensionalVector< projected_vertex_type, P >& x);
00089 
00091     const VertexGrid<N, P, NUM> &getGrid() const;
00093     VertexGrid<N, P, NUM> &getGridNonConst();
00094     
00096     void setColorCalibrationFunction(function_on_fourspace_vertex calibrate);
00097 
00098   private:
00099 
00100     class Impl;
00101     std::unique_ptr<Impl> pImpl_;
00102 
00103 };
00104 
00105 #endif // VertexHolder_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:16 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo