From 6c147de351e2b84f5bdf5b399330876c3dcfc243 Mon Sep 17 00:00:00 2001
From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org>
Date: Sun, 19 Jun 2011 13:49:49 -0700
Subject: [PATCH] ENH: VectorDataTransformFilter uses common methods

---
 .../otbVectorDataTransformFilter.h            |   1 -
 .../otbVectorDataTransformFilter.txx          | 134 ------------------
 2 files changed, 135 deletions(-)

diff --git a/Code/Projections/otbVectorDataTransformFilter.h b/Code/Projections/otbVectorDataTransformFilter.h
index 20901928ef..49142b4720 100644
--- a/Code/Projections/otbVectorDataTransformFilter.h
+++ b/Code/Projections/otbVectorDataTransformFilter.h
@@ -105,7 +105,6 @@ protected:
   PolygonListPointerType ProcessPolygonList(PolygonListPointerType polygonList) const;
   
   void GenerateData(void);
-  void ProcessNode(InputInternalTreeNodeType * source, OutputInternalTreeNodeType * destination);
 
 private:
   VectorDataTransformFilter(const Self&); //purposely not implemented
diff --git a/Code/Projections/otbVectorDataTransformFilter.txx b/Code/Projections/otbVectorDataTransformFilter.txx
index 6dc36e63fe..6a299d20e5 100644
--- a/Code/Projections/otbVectorDataTransformFilter.txx
+++ b/Code/Projections/otbVectorDataTransformFilter.txx
@@ -161,140 +161,6 @@ VectorDataTransformFilter<TInputVectorData, TOutputVectorData>
   chrono.Stop();
 }
 
-
-template <class TInputVectorData, class TOutputVectorData >
-void
-VectorDataTransformFilter<TInputVectorData, TOutputVectorData>
-::ProcessNode(InputInternalTreeNodeType * source, OutputInternalTreeNodeType * destination)
-{
-  // Get the children list from the input node
-  InputChildrenListType children = source->GetChildrenList();
-
-  // For each child
-  typename InputChildrenListType::const_iterator it = children.begin();
-  while (it != children.end())
-    {
-    typename OutputInternalTreeNodeType::Pointer newContainer;
-
-    // Copy input DataNode info
-    InputDataNodePointerType dataNode = (*it)->Get();
-    OutputDataNodePointerType newDataNode   = OutputDataNodeType::New();
-    newDataNode->SetNodeType(dataNode->GetNodeType());
-    newDataNode->SetNodeId(dataNode->GetNodeId());
-    newDataNode->CopyFieldList(dataNode);
-
-    switch(dataNode->GetNodeType())
-      {
-      case ROOT:
-      {
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      ProcessNode((*it), newContainer);
-      break;
-      }
-      case DOCUMENT:
-      {
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      ProcessNode((*it), newContainer);
-      break;
-      }
-      case FOLDER:
-      {
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      ProcessNode((*it), newContainer);
-      break;
-      }
-      case FEATURE_POINT:
-      {
-      PointType point = this->ProcessPoint(dataNode->GetPoint());
-      if (vnl_math_isnan(point[0]) || vnl_math_isnan(point[1]) )
-        {
-        break;
-        }
-      newDataNode->SetPoint(this->ProcessPoint(dataNode->GetPoint()));
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-        
-      break;
-      }
-      case FEATURE_LINE:
-      {
-      LinePointerType line = this->ProcessLine(dataNode->GetLine());
-      if( line->GetVertexList()->Size() == 0 )
-        {
-        break;
-        }
-      newDataNode->SetLine(this->ProcessLine(dataNode->GetLine()));
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      break;
-      }
-      case FEATURE_POLYGON:
-      {
-      PolygonPointerType polyExt = this->ProcessPolygon(dataNode->GetPolygonExteriorRing());
-      PolygonListPointerType polyInt = this->ProcessPolygonList(dataNode->GetPolygonInteriorRings());
-      for (typename PolygonListType::ConstIterator it = polyInt->Begin();
-           it != polyInt->End(); ++it)
-        {
-        if( it.Get()->GetVertexList()->Size() == 0 )
-          break;
-        }
-      if(polyExt->GetVertexList()->Size() == 0)
-        {
-        break;
-        }
-      newDataNode->SetPolygonExteriorRing(this->ProcessPolygon(dataNode->GetPolygonExteriorRing()));
-      newDataNode->SetPolygonInteriorRings(this->ProcessPolygonList(dataNode->GetPolygonInteriorRings()));
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      break;
-      }
-      case FEATURE_MULTIPOINT:
-      {
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      ProcessNode((*it), newContainer);
-      break;
-      }
-      case FEATURE_MULTILINE:
-      {
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      ProcessNode((*it), newContainer);
-      break;
-      }
-      case FEATURE_MULTIPOLYGON:
-      {
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      ProcessNode((*it), newContainer);
-      break;
-      }
-      case FEATURE_COLLECTION:
-      {
-      newContainer = OutputInternalTreeNodeType::New();
-      newContainer->Set(newDataNode);
-      destination->AddChild(newContainer);
-      ProcessNode((*it), newContainer);
-      break;
-      }
-      }
-    ++it;
-    }
-}
-
-
 } // end namespace otb
 
 #endif
-- 
GitLab