// SpaFEDTe, a Template based C++ library for creating 
// Discontinuous Finite Element Spaces,
// Copyright (C) 2012 Lorenzo Alessio Botti

/* This library is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU Lesser General Public */ 
/* License as published by the Free Software Foundation either */ 
/* version 3.0 of the License, or (at your option) any later version. */

/* This software is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU */
/* Lesser General Public License for more details. */

/* You should have received a copy of the GNU Lesser General Public */
/* License along with this software; if not, a copy of the full */
/* GNU Lesser General Public License can be found at */
/* http://www.gnu.org/licenses/. */

#ifndef __ElemGeometryInfo_h__
#define __ElemGeometryInfo_h__

#include "Eigen/Dense"
#include "MappingBasisFunction.hpp"
#include "Quadrature.hpp"

template<typename MappingBasisFunctionT>
class ElemGeometryInfo
{
public:
  typedef MappingBasisFunctionT MappingBasisFunctionType;
  typedef typename MappingBasisFunctionType::CoordVector CoordVector;
  typedef typename MappingBasisFunctionType::RotationMatrix RotationMatrix;
  typedef typename MappingBasisFunctionType::DistanceVector DistanceVector;

  ElemGeometryInfo() 
  {
    ;
  }
 
  ~ElemGeometryInfo() { }
  
  inline const DistanceVector& getMaxDistance() const { return m_max_distance; }
  
  inline DistanceVector& getMaxDistance() { return m_max_distance; }
  
  inline const CoordVector& getMaxDistanceVertex() const { return m_max_distance_vertex; }
  
  inline CoordVector& getMaxDistanceVertex() { return m_max_distance_vertex; }
  
  inline const CoordVector& getCentroid() const { return m_centroid; }
  
  inline CoordVector& getCentroid() { return m_centroid; }
  
  inline const RotationMatrix& getRotation() const { return m_rotation; }
  
  inline RotationMatrix& getRotation() { return m_rotation; }
  
  inline const double& getSize() const { return m_size; }
  
  inline double& getSize() { return m_size; }
  
  MappingBasisFunctionType& getMapping()
  {
    return mappingFunction;
  }
  Quadrature& getQuadrature()
  {
    return quadrature;
  }
  const MappingBasisFunctionType& getMapping() const 
  {
    return mappingFunction;
  }
  const Quadrature& getQuadrature() const 
  {
    return quadrature;
  }

private:
  MappingBasisFunctionType mappingFunction;

  Quadrature quadrature;

  DistanceVector m_max_distance;
  
  CoordVector m_centroid;
  
  CoordVector m_max_distance_vertex;

  RotationMatrix m_rotation;

  double m_size;
};

#endif


