From 591e70c76954f0f58ef3dbbce3c36e6c355aa418 Mon Sep 17 00:00:00 2001
From: Norihiro Watanabe <norihiro.watanabe@ufz.de>
Date: Mon, 9 Feb 2015 17:18:40 +0100
Subject: [PATCH] remove unnecessary T_BASE template parameter from
 TemplateElement

---
 MeshLib/Elements/Hex.h                  |  2 +-
 MeshLib/Elements/Line.h                 |  4 +--
 MeshLib/Elements/Prism.h                |  2 +-
 MeshLib/Elements/Pyramid.h              |  2 +-
 MeshLib/Elements/Quad.h                 |  6 ++---
 MeshLib/Elements/TemplateElement-impl.h | 34 ++++++++++++-------------
 MeshLib/Elements/TemplateElement.h      |  4 +--
 MeshLib/Elements/Tet.h                  |  2 +-
 MeshLib/Elements/Tri.h                  |  2 +-
 9 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/MeshLib/Elements/Hex.h b/MeshLib/Elements/Hex.h
index f8f1ff5dabd..41ff206ad27 100644
--- a/MeshLib/Elements/Hex.h
+++ b/MeshLib/Elements/Hex.h
@@ -19,7 +19,7 @@
 #include "HexRule8.h"
 
 namespace MeshLib {
-typedef TemplateElement<Element, HexRule8> Hex;
+typedef TemplateElement<HexRule8> Hex;
 }
 
 #endif /* HEX_H_ */
diff --git a/MeshLib/Elements/Line.h b/MeshLib/Elements/Line.h
index 8e6eea1199b..5616c32120a 100644
--- a/MeshLib/Elements/Line.h
+++ b/MeshLib/Elements/Line.h
@@ -21,8 +21,8 @@
 
 namespace MeshLib {
 
-typedef TemplateElement<Element, LineRule2> Line;
-typedef TemplateElement<Element, LineRule3> Line3;
+typedef TemplateElement<LineRule2> Line;
+typedef TemplateElement<LineRule3> Line3;
 
 }
 
diff --git a/MeshLib/Elements/Prism.h b/MeshLib/Elements/Prism.h
index ad6c2bf58c2..74e27e10180 100644
--- a/MeshLib/Elements/Prism.h
+++ b/MeshLib/Elements/Prism.h
@@ -20,7 +20,7 @@
 
 namespace MeshLib {
 
-typedef TemplateElement<Element, PrismRule6> Prism;
+typedef TemplateElement<PrismRule6> Prism;
 
 }
 
diff --git a/MeshLib/Elements/Pyramid.h b/MeshLib/Elements/Pyramid.h
index 1e4421f500a..3e64caca3d6 100644
--- a/MeshLib/Elements/Pyramid.h
+++ b/MeshLib/Elements/Pyramid.h
@@ -20,7 +20,7 @@
 
 namespace MeshLib {
 
-typedef TemplateElement<Element, PyramidRule5> Pyramid;
+typedef TemplateElement<PyramidRule5> Pyramid;
 
 }
 
diff --git a/MeshLib/Elements/Quad.h b/MeshLib/Elements/Quad.h
index 6be29a91e1e..c8bdb1d05da 100644
--- a/MeshLib/Elements/Quad.h
+++ b/MeshLib/Elements/Quad.h
@@ -23,9 +23,9 @@
 namespace MeshLib
 {
 
-typedef TemplateElement<Element, QuadRule4> Quad;
-typedef TemplateElement<Element, QuadRule8> Quad8;
-typedef TemplateElement<Element, QuadRule9> Quad9;
+typedef TemplateElement<QuadRule4> Quad;
+typedef TemplateElement<QuadRule8> Quad8;
+typedef TemplateElement<QuadRule9> Quad9;
 
 }
 
diff --git a/MeshLib/Elements/TemplateElement-impl.h b/MeshLib/Elements/TemplateElement-impl.h
index 37018153acd..abf632023af 100644
--- a/MeshLib/Elements/TemplateElement-impl.h
+++ b/MeshLib/Elements/TemplateElement-impl.h
@@ -14,19 +14,19 @@ namespace MeshLib
 
 #ifndef WIN32
 /// \todo Windows compiler does not accept this definition and issues a linking error.
-template <class T_BASE, class ELEMENT_RULE>
-const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::n_all_nodes;
+template <class ELEMENT_RULE>
+const unsigned TemplateElement<ELEMENT_RULE>::n_all_nodes;
 
-template <class T_BASE, class ELEMENT_RULE>
-const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::n_base_nodes;
+template <class ELEMENT_RULE>
+const unsigned TemplateElement<ELEMENT_RULE>::n_base_nodes;
 
-template <class T_BASE, class ELEMENT_RULE>
-const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::dimension;
+template <class ELEMENT_RULE>
+const unsigned TemplateElement<ELEMENT_RULE>::dimension;
 #endif // WIN32
 
-template <class T_BASE, class ELEMENT_RULE>
-TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(Node* nodes[n_all_nodes], unsigned value, std::size_t id)
-: T_BASE(value, id)
+template <class ELEMENT_RULE>
+TemplateElement<ELEMENT_RULE>::TemplateElement(Node* nodes[n_all_nodes], unsigned value, std::size_t id)
+: Element(value, id)
 {
 	this->_nodes = nodes;
 	this->_neighbors = new Element*[getNNeighbors()];
@@ -34,9 +34,9 @@ TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(Node* nodes[n_all_nodes],
 	this->_content = ELEMENT_RULE::computeVolume(this->_nodes);
 }
 
-template <class T_BASE, class ELEMENT_RULE>
-TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(std::array<Node*, n_all_nodes> const& nodes, unsigned value, std::size_t id)
-: T_BASE(value, id)
+template <class ELEMENT_RULE>
+TemplateElement<ELEMENT_RULE>::TemplateElement(std::array<Node*, n_all_nodes> const& nodes, unsigned value, std::size_t id)
+: Element(value, id)
 {
 	this->_nodes = new Node*[n_all_nodes];
 	std::copy(nodes.begin(), nodes.end(), this->_nodes);
@@ -45,9 +45,9 @@ TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(std::array<Node*, n_all_n
 	this->_content = ELEMENT_RULE::computeVolume(this->_nodes);
 }
 
-template <class T_BASE, class ELEMENT_RULE>
-TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(const TemplateElement &e)
-: T_BASE(e.getValue(), e.getID())
+template <class ELEMENT_RULE>
+TemplateElement<ELEMENT_RULE>::TemplateElement(const TemplateElement &e)
+: Element(e.getValue(), e.getID())
 {
 	this->_nodes = new Node*[n_all_nodes];
 	for (unsigned i=0; i<n_all_nodes; i++)
@@ -58,8 +58,8 @@ TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(const TemplateElement &e)
 	this->_content = e.getContent();
 }
 
-template <class T_BASE, class ELEMENT_RULE>
-bool TemplateElement<T_BASE, ELEMENT_RULE>::isEdge(unsigned idx1, unsigned idx2) const
+template <class ELEMENT_RULE>
+bool TemplateElement<ELEMENT_RULE>::isEdge(unsigned idx1, unsigned idx2) const
 {
 	for (unsigned i(0); i<getNEdges(); i++)
 	{
diff --git a/MeshLib/Elements/TemplateElement.h b/MeshLib/Elements/TemplateElement.h
index 367f1f3e160..6dc37566079 100644
--- a/MeshLib/Elements/TemplateElement.h
+++ b/MeshLib/Elements/TemplateElement.h
@@ -28,8 +28,8 @@ namespace MeshLib
  * \tparam T_BASE         Base element class, e.g. Face, Cell
  * \tparam ELEMENT_RULE   Geometrical and topological rules of the element
  */
-template <class T_BASE, class ELEMENT_RULE>
-class TemplateElement : public T_BASE
+template <class ELEMENT_RULE>
+class TemplateElement : public Element
 {
 public:
 	/// Constant: The number of all nodes for this element
diff --git a/MeshLib/Elements/Tet.h b/MeshLib/Elements/Tet.h
index b8ce5281e18..f8c9eaeeecf 100644
--- a/MeshLib/Elements/Tet.h
+++ b/MeshLib/Elements/Tet.h
@@ -20,7 +20,7 @@
 
 namespace MeshLib {
 
-typedef TemplateElement<Element,TetRule4> Tet;
+typedef TemplateElement<TetRule4> Tet;
 
 }
 
diff --git a/MeshLib/Elements/Tri.h b/MeshLib/Elements/Tri.h
index 0a43e95c943..7b7cc360329 100644
--- a/MeshLib/Elements/Tri.h
+++ b/MeshLib/Elements/Tri.h
@@ -20,7 +20,7 @@
 
 namespace MeshLib {
 
-typedef TemplateElement<Element,TriRule3> Tri;
+typedef TemplateElement<TriRule3> Tri;
 
 }
 
-- 
GitLab