diff --git a/Code/BasicFilters/otbConcatenateVectorDataFilter.h b/Code/BasicFilters/otbConcatenateVectorDataFilter.h index 3f56dd7f23d9a091cce2e47e43ec8e5be993f33d..23a836e1f43c76afb61f7803198fcec574f1c73d 100644 --- a/Code/BasicFilters/otbConcatenateVectorDataFilter.h +++ b/Code/BasicFilters/otbConcatenateVectorDataFilter.h @@ -1,102 +1,102 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#ifndef __otbConcatenateVectorDataFilter_h -#define __otbConcatenateVectorDataFilter_h - -#include "otbVectorDataToVectorDataFilter.h" -#include "otbVectorData.h" -#include "itkPreOrderTreeIterator.h" - -namespace otb -{ -/** \class ConcatenateVectorDataFilter - * \brief Produces a VectorData from the concatenation - * of several input vectordatas. - * - * This generator produces a unique vector by concatening several - * inputs set via the method AddInput(VectorData *) - * - * Note that the input vectordatas must have the same node type, - * this is due that vectordata creation does not support multiple geomtries - * in a single vectordata. - * - */ -template <class TVectorData> -class ITK_EXPORT ConcatenateVectorDataFilter : - public VectorDataSource<TVectorData> -{ -public: - /** Standard class typedefs */ - typedef ConcatenateVectorDataFilter Self; - typedef VectorDataSource<TVectorData > Superclass; - typedef itk::SmartPointer<Self> Pointer; - typedef itk::SmartPointer<const Self> ConstPointer; - - /** Run-time type information (and related methods). */ - itkTypeMacro(ConcatenateVectorDataFilter, - VectorDataSource); - - /** Method for creation through the object factory. */ - itkNewMacro(Self); - - typedef TVectorData VectorDataType; - typedef typename VectorDataType::Pointer VectorDataPointerType; - typedef typename VectorDataType::DataNodeType DataNodeType; - typedef typename DataNodeType::Pointer DataNodePointerType; - typedef typename DataNodeType::PolygonType::RegionType RegionType; - typedef typename DataNodeType::PointType PointType; - typedef typename DataNodeType::PolygonType::VertexType VertexType; - typedef typename DataNodeType::LineType LineType; - typedef typename VectorDataType::DataTreeType DataTreeType; - typedef typename DataTreeType::TreeNodeType TreeNodeType; - typedef typename TreeNodeType::ChildrenListType ChildrenListType; - - typedef typename std::vector<PointType> PointVectorType; - - /** Connects the VectorDatas from which the localizations are going to be extracted. */ - void AddInput(const VectorDataType *); - - const VectorDataType * GetInput(unsigned int idx) const; - -protected: - ConcatenateVectorDataFilter(); - virtual ~ConcatenateVectorDataFilter() {} - void PrintSelf(std::ostream& os, itk::Indent indent) const; - - /** Triggers the Computation of the sample list */ - void GenerateData(void); - - /** Recursive method to visit efficiently the vectordata*/ - void ProcessNode(TreeNodeType * source); - -private: - ConcatenateVectorDataFilter(const Self &); //purposely not implemented - void operator =(const Self&); //purposely not implemented - - DataNodePointerType m_Folder; - DataNodePointerType m_Document; - -}; - -} // end namespace otb - -#ifndef OTB_MANUAL_INSTANTIATION -#include "otbConcatenateVectorDataFilter.txx" -#endif - -#endif +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbConcatenateVectorDataFilter_h +#define __otbConcatenateVectorDataFilter_h + +#include "otbVectorDataToVectorDataFilter.h" +#include "otbVectorData.h" +#include "itkPreOrderTreeIterator.h" + +namespace otb +{ +/** \class ConcatenateVectorDataFilter + * \brief Produces a VectorData from the concatenation + * of several input vectordatas. + * + * This generator produces a unique vector by concatening several + * inputs set via the method AddInput(VectorData *) + * + * Note that the input vectordatas must have the same node type, + * this is due that vectordata creation does not support multiple geomtries + * in a single vectordata. + * + */ +template <class TVectorData> +class ITK_EXPORT ConcatenateVectorDataFilter : + public VectorDataSource<TVectorData> +{ +public: + /** Standard class typedefs */ + typedef ConcatenateVectorDataFilter Self; + typedef VectorDataSource<TVectorData > Superclass; + typedef itk::SmartPointer<Self> Pointer; + typedef itk::SmartPointer<const Self> ConstPointer; + + /** Run-time type information (and related methods). */ + itkTypeMacro(ConcatenateVectorDataFilter, + VectorDataSource); + + /** Method for creation through the object factory. */ + itkNewMacro(Self); + + typedef TVectorData VectorDataType; + typedef typename VectorDataType::Pointer VectorDataPointerType; + typedef typename VectorDataType::DataNodeType DataNodeType; + typedef typename DataNodeType::Pointer DataNodePointerType; + typedef typename DataNodeType::PolygonType::RegionType RegionType; + typedef typename DataNodeType::PointType PointType; + typedef typename DataNodeType::PolygonType::VertexType VertexType; + typedef typename DataNodeType::LineType LineType; + typedef typename VectorDataType::DataTreeType DataTreeType; + typedef typename DataTreeType::TreeNodeType TreeNodeType; + typedef typename TreeNodeType::ChildrenListType ChildrenListType; + + typedef typename std::vector<PointType> PointVectorType; + + /** Connects the VectorDatas from which the localizations are going to be extracted. */ + void AddInput(const VectorDataType *); + + const VectorDataType * GetInput(unsigned int idx) const; + +protected: + ConcatenateVectorDataFilter(); + virtual ~ConcatenateVectorDataFilter() {} + void PrintSelf(std::ostream& os, itk::Indent indent) const; + + /** Triggers the Computation of the sample list */ + void GenerateData(void); + + /** Recursive method to visit efficiently the vectordata*/ + void ProcessNode(TreeNodeType * source); + +private: + ConcatenateVectorDataFilter(const Self &); //purposely not implemented + void operator =(const Self&); //purposely not implemented + + DataNodePointerType m_Folder; + DataNodePointerType m_Document; + +}; + +} // end namespace otb + +#ifndef OTB_MANUAL_INSTANTIATION +#include "otbConcatenateVectorDataFilter.txx" +#endif + +#endif diff --git a/Code/BasicFilters/otbConcatenateVectorDataFilter.txx b/Code/BasicFilters/otbConcatenateVectorDataFilter.txx index 86fd019bf64a514fc691ad1921b2b14f14b5a83c..c82d7bbd4cd19fa0e85c13ae01fc402f4651a4c5 100644 --- a/Code/BasicFilters/otbConcatenateVectorDataFilter.txx +++ b/Code/BasicFilters/otbConcatenateVectorDataFilter.txx @@ -1,181 +1,181 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#ifndef __otbConcatenateVectorDataFilter_txx -#define __otbConcatenateVectorDataFilter_txx - -#include "otbConcatenateVectorDataFilter.h" - -#include "otbMath.h" - -namespace otb -{ -template<class TVectorData> -ConcatenateVectorDataFilter<TVectorData> -::ConcatenateVectorDataFilter() -{ - this->SetNumberOfRequiredInputs(1); - this->SetNumberOfRequiredOutputs(1); - - m_Folder = DataNodeType::New() ; - m_Folder->SetNodeType(otb::FOLDER); - - m_Document = DataNodeType::New() ; - m_Document->SetNodeType(otb::DOCUMENT); - -} - -template <class TVectorData> -void -ConcatenateVectorDataFilter<TVectorData> -::PrintSelf(std::ostream& os, itk::Indent indent) const -{ - this->Superclass::PrintSelf(os, indent); -} - -template <class TVectorData> -void -ConcatenateVectorDataFilter<TVectorData> -::AddInput(const VectorDataType * vectorData) -{ - this->Superclass::SetNthInput(this->GetNumberOfInputs(), - const_cast<VectorDataType *>(vectorData)); -} - -template <class TVectorData> -const TVectorData * -ConcatenateVectorDataFilter<TVectorData> -::GetInput(unsigned int idx) const -{ - if (this->GetNumberOfInputs() < idx) - { - return 0; - } - return static_cast<const VectorDataType *>(this->Superclass::GetInput(idx)); -} - -template <class TVectorData> -void -ConcatenateVectorDataFilter<TVectorData> -::GenerateData() -{ - // TODO : no checking is done on the inputs, do checking to avoid - // TODO : Check if they are in the same coordinate system (tricky) - - // Start recursive processing - - // Copy the input MetaDataDictionary in the output VectorData - //this->GetOutput()->SetMetaDataDictionary(this->GetInput(0)->GetMetaDataDictionary()); - - // Prepare the output - typename DataNodeType::Pointer outputRoot = this->GetOutput()->GetDataTree()->GetRoot()->Get(); - - // Adding the layer to the data tree - this->GetOutput()->GetDataTree()->Add(m_Folder, outputRoot); - this->GetOutput()->GetDataTree()->Add(m_Document , m_Folder); - - // Retrieve all the inputs - for(unsigned int idx = 0; idx < this->GetNumberOfInputs(); idx++) - { - // Add the current vectordata - TreeNodeType * - inputRoot = const_cast<TreeNodeType *>(this->GetInput(idx)->GetDataTree()->GetRoot()); - // - ProcessNode(inputRoot); - } - -} - - -template <class TVectorData> -void -ConcatenateVectorDataFilter<TVectorData> -::ProcessNode(TreeNodeType * source) -{ - if (source == 0) - return; - - // Get the children list from the input node - ChildrenListType children = source->GetChildrenList(); - - // For each child - typename ChildrenListType::iterator it; - for (it = children.begin(); it != children.end(); ++it) - { - // get the data node - DataNodePointerType dataNode = (*it)->Get(); - - switch (dataNode->GetNodeType()) - { - case ROOT: - { - ProcessNode((*it)); - break; - } - case DOCUMENT: - { - ProcessNode((*it)); - break; - } - case FOLDER: - { - ProcessNode((*it)); - break; - } - case FEATURE_POINT: - { - this->GetOutput()->GetDataTree()->Add(dataNode, m_Document); - break; - } - case FEATURE_LINE: - { - this->GetOutput()->GetDataTree()->Add(dataNode, m_Document); - break; - } - case FEATURE_POLYGON: - { - this->GetOutput()->GetDataTree()->Add(dataNode, m_Document); - break; - } - case FEATURE_MULTIPOINT: - { - ProcessNode((*it)); - break; - } - case FEATURE_MULTILINE: - { - ProcessNode((*it)); - break; - } - case FEATURE_MULTIPOLYGON: - { - ProcessNode((*it)); - break; - } - case FEATURE_COLLECTION: - { - ProcessNode((*it)); - break; - } - } - } -} - - -} // end namespace otb - -#endif +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef __otbConcatenateVectorDataFilter_txx +#define __otbConcatenateVectorDataFilter_txx + +#include "otbConcatenateVectorDataFilter.h" + +#include "otbMath.h" + +namespace otb +{ +template<class TVectorData> +ConcatenateVectorDataFilter<TVectorData> +::ConcatenateVectorDataFilter() +{ + this->SetNumberOfRequiredInputs(1); + this->SetNumberOfRequiredOutputs(1); + + m_Folder = DataNodeType::New(); + m_Folder->SetNodeType(otb::FOLDER); + + m_Document = DataNodeType::New(); + m_Document->SetNodeType(otb::DOCUMENT); + +} + +template <class TVectorData> +void +ConcatenateVectorDataFilter<TVectorData> +::PrintSelf(std::ostream& os, itk::Indent indent) const +{ + this->Superclass::PrintSelf(os, indent); +} + +template <class TVectorData> +void +ConcatenateVectorDataFilter<TVectorData> +::AddInput(const VectorDataType * vectorData) +{ + this->Superclass::SetNthInput(this->GetNumberOfInputs(), + const_cast<VectorDataType *>(vectorData)); +} + +template <class TVectorData> +const TVectorData * +ConcatenateVectorDataFilter<TVectorData> +::GetInput(unsigned int idx) const +{ + if (this->GetNumberOfInputs() < idx) + { + return 0; + } + return static_cast<const VectorDataType *>(this->Superclass::GetInput(idx)); +} + +template <class TVectorData> +void +ConcatenateVectorDataFilter<TVectorData> +::GenerateData() +{ + // TODO : no checking is done on the inputs, do checking to avoid + // TODO : Check if they are in the same coordinate system (tricky) + + // Start recursive processing + + // Copy the input MetaDataDictionary in the output VectorData + //this->GetOutput()->SetMetaDataDictionary(this->GetInput(0)->GetMetaDataDictionary()); + + // Prepare the output + typename DataNodeType::Pointer outputRoot = this->GetOutput()->GetDataTree()->GetRoot()->Get(); + + // Adding the layer to the data tree + this->GetOutput()->GetDataTree()->Add(m_Folder, outputRoot); + this->GetOutput()->GetDataTree()->Add(m_Document , m_Folder); + + // Retrieve all the inputs + for(unsigned int idx = 0; idx < this->GetNumberOfInputs(); idx++) + { + // Add the current vectordata + TreeNodeType * + inputRoot = const_cast<TreeNodeType *>(this->GetInput(idx)->GetDataTree()->GetRoot()); + // + ProcessNode(inputRoot); + } + +} + + +template <class TVectorData> +void +ConcatenateVectorDataFilter<TVectorData> +::ProcessNode(TreeNodeType * source) +{ + if (source == 0) + return; + + // Get the children list from the input node + ChildrenListType children = source->GetChildrenList(); + + // For each child + typename ChildrenListType::iterator it; + for (it = children.begin(); it != children.end(); ++it) + { + // get the data node + DataNodePointerType dataNode = (*it)->Get(); + + switch (dataNode->GetNodeType()) + { + case ROOT: + { + ProcessNode((*it)); + break; + } + case DOCUMENT: + { + ProcessNode((*it)); + break; + } + case FOLDER: + { + ProcessNode((*it)); + break; + } + case FEATURE_POINT: + { + this->GetOutput()->GetDataTree()->Add(dataNode, m_Document); + break; + } + case FEATURE_LINE: + { + this->GetOutput()->GetDataTree()->Add(dataNode, m_Document); + break; + } + case FEATURE_POLYGON: + { + this->GetOutput()->GetDataTree()->Add(dataNode, m_Document); + break; + } + case FEATURE_MULTIPOINT: + { + ProcessNode((*it)); + break; + } + case FEATURE_MULTILINE: + { + ProcessNode((*it)); + break; + } + case FEATURE_MULTIPOLYGON: + { + ProcessNode((*it)); + break; + } + case FEATURE_COLLECTION: + { + ProcessNode((*it)); + break; + } + } + } +} + + +} // end namespace otb + +#endif diff --git a/Code/Common/otbPersistentImageToVectorDataFilter.h b/Code/Common/otbPersistentImageToVectorDataFilter.h index 88fb34dc46566e6b66b582900316af66ab234f9f..e75e83a055522b006c0082dbbcd17334824f6b00 100644 --- a/Code/Common/otbPersistentImageToVectorDataFilter.h +++ b/Code/Common/otbPersistentImageToVectorDataFilter.h @@ -44,12 +44,12 @@ namespace otb */ template<class TImage, class TOutputVectorData> class ITK_EXPORT PersistentImageToVectorDataFilter : - public PersistentImageFilter<TImage,TImage> + public PersistentImageFilter<TImage, TImage> { public: /** Standard Self typedef */ typedef PersistentImageToVectorDataFilter Self; - typedef PersistentImageFilter<TImage,TImage> Superclass; + typedef PersistentImageFilter<TImage, TImage> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; diff --git a/Code/Common/otbPersistentImageToVectorDataFilter.txx b/Code/Common/otbPersistentImageToVectorDataFilter.txx index 785c9ddebcdd98e7f8e7143970455268a1750900..99bd8433096b492b7f6e2002cac38c2bda7843e3 100644 --- a/Code/Common/otbPersistentImageToVectorDataFilter.txx +++ b/Code/Common/otbPersistentImageToVectorDataFilter.txx @@ -84,7 +84,7 @@ PersistentImageToVectorDataFilter<TImage, TOutputVectorData> DataNodePointerType folder = DataNodeType::New(); folder->SetNodeType(otb::FOLDER); - DataNodePointerType document = DataNodeType::New() ; + DataNodePointerType document = DataNodeType::New(); document->SetNodeType(otb::DOCUMENT); this->GetOutputVectorData()->GetDataTree()->Add(folder, this->GetOutputVectorData()->GetDataTree()->GetRoot()->Get()); diff --git a/Code/Fuzzy/otbFuzzyDescriptorsModelManager.cxx b/Code/Fuzzy/otbFuzzyDescriptorsModelManager.cxx index 5b9b0674bdd0ec9f89d017958ff556ac5c6a7bd8..688ce4377a6f69ac93cd7fdc6c13c6c222a3643d 100644 --- a/Code/Fuzzy/otbFuzzyDescriptorsModelManager.cxx +++ b/Code/Fuzzy/otbFuzzyDescriptorsModelManager.cxx @@ -60,7 +60,7 @@ FuzzyDescriptorsModelManager ::AddDescriptor( PairType modelPair, DescriptorsModelType & descModel ) { descModel.push_back(modelPair); -} +} void @@ -70,7 +70,7 @@ FuzzyDescriptorsModelManager { PairType lPair( key, model ); descModel.push_back(lPair); -} +} void FuzzyDescriptorsModelManager @@ -183,7 +183,7 @@ FuzzyDescriptorsModelManager // Iterate through the input for (unsigned int i = 0; i < model.size(); i++) - { + { // The current statistic TiXmlElement * desc = new TiXmlElement("Descriptor"); desc->SetAttribute("name", model[i].first.c_str()); diff --git a/Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.h b/Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.h index d831d691a9b666f5fe8739ed3f701df8cbb72e4e..792d2c93bf1a3f27fa1120ac7ad17932f2d93e10 100644 --- a/Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.h +++ b/Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.h @@ -107,7 +107,7 @@ public: typedef itk::DataObject DataObject; typedef std::pair< std::string, std::vector<double> > PairType; - typedef std::vector< PairType > DescriptorModelsType;; + typedef std::vector< PairType > DescriptorModelsType; ; /** Descriptor model accessors. */ virtual void AddDescriptor(std::string key, std::vector<double> model); diff --git a/Code/Projections/otbVectorDataTransformFilter.h b/Code/Projections/otbVectorDataTransformFilter.h index d8cb9bc205dfd7405e5113375112fc0225711b35..ac925d53bea6a3a2797654489f41d6167c7c8e5d 100644 --- a/Code/Projections/otbVectorDataTransformFilter.h +++ b/Code/Projections/otbVectorDataTransformFilter.h @@ -40,14 +40,14 @@ namespace otb template <class TInputVectorData, class TOutputVectorData> class ITK_EXPORT VectorDataTransformFilter : - public otb::VectorDataToVectorDataFilter<TInputVectorData,TOutputVectorData> + public otb::VectorDataToVectorDataFilter<TInputVectorData, TOutputVectorData> { public: /** Standard class typedefs. */ typedef VectorDataTransformFilter Self; typedef otb::VectorDataToVectorDataFilter - <TInputVectorData,TOutputVectorData> Superclass; + <TInputVectorData, TOutputVectorData> Superclass; typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<const Self> ConstPointer; @@ -94,8 +94,8 @@ public: itkTypeMacro(VectorDataTransformFilter, VectorDataToVectorDataFilter); /** Set The Transform applied to VectorData*/ - itkSetObjectMacro(Transform,GenericTransformType); - itkGetObjectMacro(Transform,GenericTransformType); + itkSetObjectMacro(Transform, GenericTransformType); + itkGetObjectMacro(Transform, GenericTransformType); protected: VectorDataTransformFilter(); diff --git a/Code/Projections/otbVectorDataTransformFilter.txx b/Code/Projections/otbVectorDataTransformFilter.txx index 46481d753a3e0febd4df4624be38709ed84efba0..85bbd48cab56453fa54e792784651e87674ae160 100644 --- a/Code/Projections/otbVectorDataTransformFilter.txx +++ b/Code/Projections/otbVectorDataTransformFilter.txx @@ -37,7 +37,7 @@ namespace otb * Constructor */ template <class TInputVectorData, class TOutputVectorData > -VectorDataTransformFilter<TInputVectorData,TOutputVectorData> +VectorDataTransformFilter<TInputVectorData, TOutputVectorData> ::VectorDataTransformFilter() { m_Transform = GenericTransformType::New(); @@ -47,12 +47,12 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> * Convert point */ template <class TInputVectorData, class TOutputVectorData > -typename VectorDataTransformFilter<TInputVectorData,TOutputVectorData>::PointType -VectorDataTransformFilter<TInputVectorData,TOutputVectorData> +typename VectorDataTransformFilter<TInputVectorData, TOutputVectorData>::PointType +VectorDataTransformFilter<TInputVectorData, TOutputVectorData> ::ReprojectPoint(PointType pointCoord) const { - itk::Point<double,2> point; + itk::Point<double, 2> point; point = m_Transform->TransformPoint(pointCoord); return point; } @@ -62,8 +62,8 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> * Convert line */ template <class TInputVectorData, class TOutputVectorData > -typename VectorDataTransformFilter<TInputVectorData,TOutputVectorData>::LinePointerType -VectorDataTransformFilter<TInputVectorData,TOutputVectorData> +typename VectorDataTransformFilter<TInputVectorData, TOutputVectorData>::LinePointerType +VectorDataTransformFilter<TInputVectorData, TOutputVectorData> ::ReprojectLine(LinePointerType line) const { typedef typename LineType::VertexListType::ConstPointer VertexListConstPointerType; @@ -73,8 +73,8 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> typename LineType::Pointer newLine = LineType::New(); while ( it != vertexList->End()) { - itk::Point<double,2> point; - itk::ContinuousIndex<double,2> index; + itk::Point<double, 2> point; + itk::ContinuousIndex<double, 2> index; typename LineType::VertexType pointCoord = it.Value(); point = m_Transform->TransformPoint(pointCoord); index[0]=point[0]; @@ -91,8 +91,8 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> * Convert polygon */ template <class TInputVectorData, class TOutputVectorData > -typename VectorDataTransformFilter<TInputVectorData,TOutputVectorData>::PolygonPointerType -VectorDataTransformFilter<TInputVectorData,TOutputVectorData> +typename VectorDataTransformFilter<TInputVectorData, TOutputVectorData>::PolygonPointerType +VectorDataTransformFilter<TInputVectorData, TOutputVectorData> ::ReprojectPolygon(PolygonPointerType polygon) const { typedef typename PolygonType::VertexListType::ConstPointer VertexListConstPointerType; @@ -102,8 +102,8 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> typename PolygonType::Pointer newPolygon = PolygonType::New(); while ( it != vertexList->End()) { - itk::Point<double,2> point; - itk::ContinuousIndex<double,2> index; + itk::Point<double, 2> point; + itk::ContinuousIndex<double, 2> index; typename PolygonType::VertexType pointCoord = it.Value(); point = m_Transform->TransformPoint(pointCoord); index[0]=point[0]; @@ -119,8 +119,8 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> * Convert polygon list */ template <class TInputVectorData, class TOutputVectorData > -typename VectorDataTransformFilter<TInputVectorData,TOutputVectorData>::PolygonListPointerType -VectorDataTransformFilter<TInputVectorData,TOutputVectorData> +typename VectorDataTransformFilter<TInputVectorData, TOutputVectorData>::PolygonListPointerType +VectorDataTransformFilter<TInputVectorData, TOutputVectorData> ::ReprojectPolygonList(PolygonListPointerType polygonList) const { @@ -139,7 +139,7 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> */ template <class TInputVectorData, class TOutputVectorData > void -VectorDataTransformFilter<TInputVectorData,TOutputVectorData> +VectorDataTransformFilter<TInputVectorData, TOutputVectorData> ::GenerateData(void) { Superclass::GenerateOutputInformation(); @@ -165,21 +165,21 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> // Start recursive processing itk::TimeProbe chrono; chrono.Start(); - ProcessNode(inputRoot,outputRoot); + ProcessNode(inputRoot, outputRoot); chrono.Stop(); } template <class TInputVectorData, class TOutputVectorData > void -VectorDataTransformFilter<TInputVectorData,TOutputVectorData> +VectorDataTransformFilter<TInputVectorData, TOutputVectorData> ::ProcessNode(InputInternalTreeNodeType * source, OutputInternalTreeNodeType * destination) { // Get the children list from the input node InputChildrenListType children = source->GetChildrenList(); // For each child - for(typename InputChildrenListType::iterator it = children.begin(); it != children.end();++it) + for(typename InputChildrenListType::iterator it = children.begin(); it != children.end(); ++it) { typename OutputInternalTreeNodeType::Pointer newContainer; @@ -196,7 +196,7 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> newContainer = OutputInternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); - ProcessNode((*it),newContainer); + ProcessNode((*it), newContainer); break; } case DOCUMENT: @@ -204,7 +204,7 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> newContainer = OutputInternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); - ProcessNode((*it),newContainer); + ProcessNode((*it), newContainer); break; } case FOLDER: @@ -212,7 +212,7 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> newContainer = OutputInternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); - ProcessNode((*it),newContainer); + ProcessNode((*it), newContainer); break; } case FEATURE_POINT: @@ -265,7 +265,7 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> newContainer = OutputInternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); - ProcessNode((*it),newContainer); + ProcessNode((*it), newContainer); break; } case FEATURE_MULTILINE: @@ -273,7 +273,7 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> newContainer = OutputInternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); - ProcessNode((*it),newContainer); + ProcessNode((*it), newContainer); break; } case FEATURE_MULTIPOLYGON: @@ -281,7 +281,7 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> newContainer = OutputInternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); - ProcessNode((*it),newContainer); + ProcessNode((*it), newContainer); break; } case FEATURE_COLLECTION: @@ -289,7 +289,7 @@ VectorDataTransformFilter<TInputVectorData,TOutputVectorData> newContainer = OutputInternalTreeNodeType::New(); newContainer->Set(newDataNode); destination->AddChild(newContainer); - ProcessNode((*it),newContainer); + ProcessNode((*it), newContainer); break; } } diff --git a/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h b/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h index 2272d821026107787a5c85e57eecbcb4568bbba5..5467db0503cecfe7348a845be2f60a576cbb0a6f 100644 --- a/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h +++ b/Code/SARPolarimetry/otbReciprocalHAlphaImageFilter.h @@ -45,7 +45,7 @@ namespace Functor { * - \f$ p[i] = max(SortedEigenValues[i], 0) / \sum_{i=0}^{2, SortedEigenValues[i]>0}{SortedEigenValues[i]} \f$ * - \f$ \alpha_{i} = \left| SortedEigenVector[i] \right|* \frac{180}{\pi}\f$ * - * With, + * With, * - \f$ if p[i] < 0, p[i]=0 \f$ * - \f$ if p[i] > 1, p[i]=1 \f$ * - \f$ if \alpha_{i} > 90, \alpha_{i}=90 \f$ diff --git a/Code/UtilitiesAdapters/OssimAdapters/otbImageMetadataInterfaceBase.cxx b/Code/UtilitiesAdapters/OssimAdapters/otbImageMetadataInterfaceBase.cxx index d1747f0eea25beeb50f4bbe19ceb67baf5e40964..3e84e5f49bb4e11ba961d12d5aec20e098a3126f 100644 --- a/Code/UtilitiesAdapters/OssimAdapters/otbImageMetadataInterfaceBase.cxx +++ b/Code/UtilitiesAdapters/OssimAdapters/otbImageMetadataInterfaceBase.cxx @@ -367,7 +367,7 @@ ImageMetadataInterfaceBase::GetBandName() const } std::vector<std::string> outputValues; - if (!imageKeywordlist.HasKey("support_data.band_name")) + if (!imageKeywordlist.HasKey("support_data.band_name")) { return outputValues; } diff --git a/Code/UtilitiesAdapters/OssimAdapters/otbRPCProjectionAdapter.cxx b/Code/UtilitiesAdapters/OssimAdapters/otbRPCProjectionAdapter.cxx index 6e4f01f164dbc31eff3bd173ea1cfd3923cf88db..7ca3a1c6963dd59cd88b547f066a945994150521 100644 --- a/Code/UtilitiesAdapters/OssimAdapters/otbRPCProjectionAdapter.cxx +++ b/Code/UtilitiesAdapters/OssimAdapters/otbRPCProjectionAdapter.cxx @@ -126,7 +126,7 @@ RPCProjectionAdapter::Solve(const GCPsContainerType& gcpContainer, void RPCProjectionAdapter -::AddGroundRect( ImageKeywordlist& otb_kwl, +::AddGroundRect( ImageKeywordlist& otb_kwl, itk::Point<double, 2> orig, itk::Size<2> size) { ossimGpt ul, ll, ur, lr; diff --git a/Code/UtilitiesAdapters/OssimAdapters/otbRPCProjectionAdapter.h b/Code/UtilitiesAdapters/OssimAdapters/otbRPCProjectionAdapter.h index 0027bc0473c141d38002f03aab25c9311bd2e270..ae621a98b2ab27fa92d4b3c653423849365d037a 100644 --- a/Code/UtilitiesAdapters/OssimAdapters/otbRPCProjectionAdapter.h +++ b/Code/UtilitiesAdapters/OssimAdapters/otbRPCProjectionAdapter.h @@ -67,8 +67,8 @@ public: void TransformPoint(double x, double y, double z, double& lon, double& lat, double& h) const; - void AddGroundRect( ImageKeywordlist& otb_kwl, - itk::Point<double, 2> orig, itk::Size<2> size); + void AddGroundRect( ImageKeywordlist& otb_kwl, + itk::Point<double, 2> orig, itk::Size<2> size); protected: RPCProjectionAdapter(); diff --git a/Testing/Code/BasicFilters/otbConcatenateVectorDataFilter.cxx b/Testing/Code/BasicFilters/otbConcatenateVectorDataFilter.cxx index a2c53a9ddff41c7faaae4b11966367cd32155115..b4fb360bfbd383544c15f959798f24a2c11ea6b1 100644 --- a/Testing/Code/BasicFilters/otbConcatenateVectorDataFilter.cxx +++ b/Testing/Code/BasicFilters/otbConcatenateVectorDataFilter.cxx @@ -30,7 +30,7 @@ typedef otb::VectorData<> VectorDataType; typedef otb::VectorDataFileReader<VectorDataType> ReaderType; typedef otb::VectorDataFileWriter<VectorDataType> WriterType; -typedef otb::ConcatenateVectorDataFilter<VectorDataType> ConcatenateFilterType; +typedef otb::ConcatenateVectorDataFilter<VectorDataType> ConcatenateFilterType; int otbConcatenateVectorDataFilterNew (int argc, char * argv[]) { @@ -44,14 +44,14 @@ int otbConcatenateVectorDataFilter (int argc, char * argv[]) typedef otb::CommandLineArgumentParser ParserType; ParserType::Pointer parser = ParserType::New(); parser->AddOptionNParams("--InputVectorDatas","Input VectorDatas to concatenate ", "-in", true); - parser->AddOption("--OutputVectorData","Output concatenated VectorData","-out",true); + parser->AddOption("--OutputVectorData","Output concatenated VectorData","-out", true); typedef otb::CommandLineArgumentParseResult ParserResultType; ParserResultType::Pointer parseResult = ParserResultType::New(); try { - parser->ParseCommandLine(argc,argv,parseResult); + parser->ParseCommandLine(argc, argv, parseResult); } catch ( itk::ExceptionObject & err ) { @@ -62,7 +62,7 @@ int otbConcatenateVectorDataFilter (int argc, char * argv[]) // Get number of input vectorDatas unsigned int nbInputs = parseResult->GetNumberOfParameters("--InputVectorDatas"); - // Instanciate a concatenate filter + // Instanciate a concatenate filter // Concatenate the vector datas ConcatenateFilterType::Pointer concatenate = ConcatenateFilterType::New(); @@ -71,13 +71,13 @@ int otbConcatenateVectorDataFilter (int argc, char * argv[]) // Reader object ReaderType::Pointer reader = ReaderType::New(); //std::cout << << std::endl; - reader->SetFileName(parseResult->GetParameterString("--InputVectorDatas",idx )); + reader->SetFileName(parseResult->GetParameterString("--InputVectorDatas", idx )); reader->Update(); concatenate->AddInput(reader->GetOutput()); } - // Write the output + // Write the output WriterType::Pointer writer = WriterType::New(); writer->SetFileName(parseResult->GetParameterString("--OutputVectorData")); writer->SetInput(concatenate->GetOutput()); diff --git a/Testing/Code/Projections/otbVectorDataTransformFilter.cxx b/Testing/Code/Projections/otbVectorDataTransformFilter.cxx index a2dd5842931aa35d94f6eacfddb80fa9c0e59919..28a72777c1c6ebfe7c953bd06a31d25eb15f10f9 100644 --- a/Testing/Code/Projections/otbVectorDataTransformFilter.cxx +++ b/Testing/Code/Projections/otbVectorDataTransformFilter.cxx @@ -40,17 +40,17 @@ int otbVectorDataTransformFilterNew (int argc, char * argv[]) int otbVectorDataTransformFilter (int argc, char * argv[]) { - typedef otb::VectorImage<double,2> ImageType; + typedef otb::VectorImage<double, 2> ImageType; typedef otb::VectorData<> VectorDataType; typedef otb::ImageFileReader<ImageType> ReaderType; typedef otb::VectorDataFileReader<VectorDataType> VectorDataFileReaderType; typedef otb::VectorDataFileWriter<VectorDataType> VectorDataFileWriterType; - typedef otb::VectorDataProjectionFilter<VectorDataType, + typedef otb::VectorDataProjectionFilter<VectorDataType, VectorDataType> VDProjectionFilterType; - // Instanciate the image reader + // Instanciate the image reader ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->UpdateOutputInformation(); @@ -67,7 +67,7 @@ int otbVectorDataTransformFilter (int argc, char * argv[]) vdproj->SetOutputProjectionRef(reader->GetOutput()->GetProjectionRef()); // Test the translation using the ApplyTransformTo - typedef itk::AffineTransform<double,2> TransformType; + typedef itk::AffineTransform<double, 2> TransformType; typedef TransformType::OutputVectorType TranslationParamType; // Set up the transform (Apply a translation of 8 pixels in the y direction) @@ -81,7 +81,7 @@ int otbVectorDataTransformFilter (int argc, char * argv[]) transformFilter->SetInput(vdproj->GetOutput()); transformFilter->SetTransform(transform); - // retransform int the input vector projection + // retransform int the input vector projection VDProjectionFilterType::Pointer reverseVdProj = VDProjectionFilterType::New(); reverseVdProj->SetInput(transformFilter->GetOutput()); reverseVdProj->SetOutputProjectionRef(vdreader->GetOutput()->GetProjectionRef());