Commit 8a2c2a5a authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

STYLE: replacing tab by spaces

parent 6c484d8d
......@@ -143,18 +143,18 @@ BinaryImageToDensityImageFilter<TInputImage, TOutputImage, TCountFunction>
it.GoToBegin();
while(!itOut.IsAtEnd())
{
index = it.GetIndex();
if(outputRegionForThread.IsInside(index))
{
itOut.Set(m_CountFunction->EvaluateAtIndex(index));
}
++itOut;
++it;
progress.CompletedPixel(); // potential exception thrown here
}
{
index = it.GetIndex();
if(outputRegionForThread.IsInside(index))
{
itOut.Set(m_CountFunction->EvaluateAtIndex(index));
}
++itOut;
++it;
progress.CompletedPixel(); // potential exception thrown here
}
}
}
......
......@@ -32,8 +32,8 @@ template< class TListSample,
class THistogramMeasurement,
class TFrequencyContainer>
ListSampleToHistogramListGenerator< TListSample,
THistogramMeasurement,
TFrequencyContainer >
THistogramMeasurement,
TFrequencyContainer >
::ListSampleToHistogramListGenerator() : m_List(), m_Size(), m_MarginalScale(100), m_HistogramMin(), m_HistogramMax(), m_AutoMinMax(true), m_HistogramList()
{
m_HistogramList = HistogramListType::New() ;
......@@ -46,8 +46,8 @@ template< class TListSample,
class TFrequencyContainer >
void
ListSampleToHistogramListGenerator< TListSample,
THistogramMeasurement,
TFrequencyContainer >
THistogramMeasurement,
TFrequencyContainer >
::GenerateData()
{
otbMsgDebugMacro(<<"ListSampleToHistogramListGenerator::GenerateData(): Entering");
......@@ -85,9 +85,9 @@ ListSampleToHistogramListGenerator< TListSample,
if ( !itk::NumericTraits< THistogramMeasurement >::is_integer )
{
margin =
( (THistogramMeasurement)(upper[i] - lower[i]) /
(THistogramMeasurement) m_Size[0] ) /
(THistogramMeasurement) m_MarginalScale ;
( (THistogramMeasurement)(upper[i] - lower[i]) /
(THistogramMeasurement) m_Size[0] ) /
(THistogramMeasurement) m_MarginalScale ;
h_upper[i] = (THistogramMeasurement) (upper[i] + margin) ;
if(h_upper[i] <= upper[i])
{
......@@ -154,15 +154,15 @@ ListSampleToHistogramListGenerator< TListSample,
m_HistogramList->Back()->GetIndex(hvector,index);
if (!m_HistogramList->Back()->IsIndexOutOfBounds(index))
{
// if the measurement vector is out of bound then
// the GetIndex method has returned an index set to the max size of
// the invalid dimension - even if the hvector is less than the minimum
// bin value.
// If the index isn't valid, we don't increase the frequency.
// See the comments in Histogram->GetIndex() for more info.
m_HistogramList->Back()->IncreaseFrequency(index, 1) ;
}
{
// if the measurement vector is out of bound then
// the GetIndex method has returned an index set to the max size of
// the invalid dimension - even if the hvector is less than the minimum
// bin value.
// If the index isn't valid, we don't increase the frequency.
// See the comments in Histogram->GetIndex() for more info.
m_HistogramList->Back()->IncreaseFrequency(index, 1) ;
}
++iter ;
}
}
......@@ -174,8 +174,8 @@ template< class TListSample,
class TFrequencyContainer >
void
ListSampleToHistogramListGenerator< TListSample,
THistogramMeasurement,
TFrequencyContainer >
THistogramMeasurement,
TFrequencyContainer >
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os,indent);
......
......@@ -89,9 +89,9 @@ ListSampleToVariableDimensionHistogramGenerator< TListSample,
if ( !itk::NumericTraits< THistogramMeasurement >::is_integer )
{
margin =
( (THistogramMeasurement)(upper[i] - lower[i]) /
(THistogramMeasurement) m_Sizes[i] ) /
(THistogramMeasurement) m_MarginalScale ;
( (THistogramMeasurement)(upper[i] - lower[i]) /
(THistogramMeasurement) m_Sizes[i] ) /
(THistogramMeasurement) m_MarginalScale ;
h_upper[i] = (THistogramMeasurement) (upper[i] + margin) ;
if(h_upper[i] <= upper[i])
{
......
......@@ -199,53 +199,53 @@ public:
// Can we crop?
for (unsigned int i = 0; i < IndexType::IndexDimension && cropPossible; i++)
{
// Is left edge of current region to the right of the right edge
// of the region to crop with? (if so, we cannot crop)
if (m_Index[i] >= region.GetOrigin()[i]
+ static_cast<Type>(region.GetSize()[i]))
{
cropPossible = false;
}
// If right edge of the current region to the left of the left
// edge of the region to crop with? (if so, we cannot crop)
if (m_Index[i] + static_cast<Type>(m_Size[i]) <= region.GetOrigin()[i])
{
cropPossible = false;
}
}
{
// Is left edge of current region to the right of the right edge
// of the region to crop with? (if so, we cannot crop)
if (m_Index[i] >= region.GetOrigin()[i]
+ static_cast<Type>(region.GetSize()[i]))
{
cropPossible = false;
}
// If right edge of the current region to the left of the left
// edge of the region to crop with? (if so, we cannot crop)
if (m_Index[i] + static_cast<Type>(m_Size[i]) <= region.GetOrigin()[i])
{
cropPossible = false;
}
}
// if we cannot crop, return without changing anythin
if (!cropPossible)
{
return cropPossible;
}
{
return cropPossible;
}
// we can crop, so crop
for (unsigned int i=0; i < IndexType::IndexDimension; i++)
{
// first check the start index
if (m_Index[i] < region.GetOrigin()[i])
{
// how much do we need to adjust
crop = region.GetOrigin()[i] - m_Index[i];
// adjust the start index and the size of the current region
m_Index[i] += crop;
m_Size[i] -= static_cast<Type>(crop);
}
// now check the final size
if (m_Index[i] + static_cast<Type>(m_Size[i])
> region.GetOrigin()[i] + static_cast<Type>(region.GetSize()[i]))
{
// how much do we need to adjust
crop = m_Index[i] + static_cast<Type>(m_Size[i])
- region.GetOrigin()[i] - static_cast<Type>(region.GetSize()[i]);
// adjust the size
m_Size[i] -= static_cast<Type>(crop);
}
}
{
// first check the start index
if (m_Index[i] < region.GetOrigin()[i])
{
// how much do we need to adjust
crop = region.GetOrigin()[i] - m_Index[i];
// adjust the start index and the size of the current region
m_Index[i] += crop;
m_Size[i] -= static_cast<Type>(crop);
}
// now check the final size
if (m_Index[i] + static_cast<Type>(m_Size[i])
> region.GetOrigin()[i] + static_cast<Type>(region.GetSize()[i]))
{
// how much do we need to adjust
crop = m_Index[i] + static_cast<Type>(m_Size[i])
- region.GetOrigin()[i] - static_cast<Type>(region.GetSize()[i]);
// adjust the size
m_Size[i] -= static_cast<Type>(crop);
}
}
return cropPossible;
}
......
......@@ -114,43 +114,43 @@ DrawLineSpatialObjectListFilter<TInputImage, TOutputImage>
/** Crop the segment if it is outside the region in the left*/
if( !(this->IsColumnOutsideOfTheRegion(&indexBeginLine,&indexEndLine,&outputRegionForThread) && this->IsColumnOutsideOfTheRegion(&indexEndLine,&indexBeginLine,&outputRegionForThread)))
{
if(indexEndLine[0] >=static_cast< int>(size[0]))
this->CropRightSegment(&indexEndLine,&indexBeginLine, &outputRegionForThread);
if( indexBeginLine[0] >= static_cast< int>(size[0]) )
this->CropRightSegment(&indexBeginLine,&indexEndLine, &outputRegionForThread);
}
{
if(indexEndLine[0] >=static_cast< int>(size[0]))
this->CropRightSegment(&indexEndLine,&indexBeginLine, &outputRegionForThread);
if( indexBeginLine[0] >= static_cast< int>(size[0]) )
this->CropRightSegment(&indexBeginLine,&indexEndLine, &outputRegionForThread);
}
/**
* If an extremity is under the region
* Technically, the X component of the index is inside the image
*/
if(this->IsDownsideTheImage(&indexBeginLine) && input->GetLargestPossibleRegion().IsInside(indexEndLine))
this->CropSegment(&indexBeginLine,&indexEndLine, &outputRegionForThread);
this->CropSegment(&indexBeginLine,&indexEndLine, &outputRegionForThread);
if(this->IsDownsideTheImage(&indexEndLine) && input->GetLargestPossibleRegion().IsInside(indexBeginLine))
this->CropSegment(&indexEndLine,&indexBeginLine, &outputRegionForThread);
this->CropSegment(&indexEndLine,&indexBeginLine, &outputRegionForThread);
/** If the segments are not in the region (upside or downside the region)*/
if(!(this->IsUpsideTheRegion(&indexBeginLine,&outputRegionForThread) && this->IsUpsideTheRegion(&indexEndLine,&outputRegionForThread)) &&
!(this->IsDownsideTheRegion(&indexBeginLine,&outputRegionForThread) && this->IsDownsideTheRegion(&indexEndLine,&outputRegionForThread)) &&
!(this->IsColumnOutsideOfTheRegion(&indexBeginLine,&indexEndLine, &outputRegionForThread) && this->IsColumnOutsideOfTheRegion(&indexEndLine,&indexBeginLine,&outputRegionForThread))
)
{
!(this->IsDownsideTheRegion(&indexBeginLine,&outputRegionForThread) && this->IsDownsideTheRegion(&indexEndLine,&outputRegionForThread)) &&
!(this->IsColumnOutsideOfTheRegion(&indexBeginLine,&indexEndLine, &outputRegionForThread) && this->IsColumnOutsideOfTheRegion(&indexEndLine,&indexBeginLine,&outputRegionForThread))
)
{
/** Instanciation of the line iterator with begin and ending index*/
LineIteratorFilter itLine(output,indexBeginLine ,indexEndLine );
/** Instanciation of the line iterator with begin and ending index*/
LineIteratorFilter itLine(output,indexBeginLine ,indexEndLine );
/** Iteration over the line and writing white lines */
while(!itLine.IsAtEnd())
{
if(outputRegionForThread.IsInside(itLine.GetIndex()))
itLine.Set(m_Value);
++itLine;
}
}
/** Iteration over the line and writing white lines */
while(!itLine.IsAtEnd())
{
if(outputRegionForThread.IsInside(itLine.GetIndex()))
itLine.Set(m_Value);
++itLine;
}
}
++itList;
}
......
......@@ -96,7 +96,7 @@ namespace otb
/** Constructor */
Rectangle()
{
m_VertexList = VertexListType::New();
m_VertexList = VertexListType::New();
};
/** Destructor */
......
......@@ -149,41 +149,41 @@ Rectangle<TValue>
if ( cornersVertex->Size()>0)
{
x = static_cast<long int>(itCorners.Value()[0]);
y = static_cast<long int>(itCorners.Value()[1]);
index[0] = x;
index[1] = y;
++itCorners;
while (itCorners != cornersVertex->End())
{
x = static_cast<long int>(itCorners.Value()[0]);
y = static_cast<long int>(itCorners.Value()[1]);
// Index search
if ( x < index[0] )
{
index[0] = x;
}
if ( y < index[1] )
{
index[1] = y;
}
// Max Id search for size computation
if ( x > maxId[0] )
{
maxId[0] = x;
}
if ( y > maxId[1] )
{
maxId[1] = y;
}
++itCorners;
x = static_cast<long int>(itCorners.Value()[0]);
y = static_cast<long int>(itCorners.Value()[1]);
index[0] = x;
index[1] = y;
++itCorners;
while (itCorners != cornersVertex->End())
{
x = static_cast<long int>(itCorners.Value()[0]);
y = static_cast<long int>(itCorners.Value()[1]);
// Index search
if ( x < index[0] )
{
index[0] = x;
}
if ( y < index[1] )
{
index[1] = y;
}
// Max Id search for size computation
if ( x > maxId[0] )
{
maxId[0] = x;
}
if ( y > maxId[1] )
{
maxId[1] = y;
}
++itCorners;
}
size[0] = maxId[0] - index[0];
size[1] = maxId[1] - index[1];
size[0] = maxId[0] - index[0];
size[1] = maxId[1] - index[1];
}
region.SetSize(size);
region.SetIndex(index);
......
......@@ -114,135 +114,135 @@ VectorDataExtractROI<TVectorData>
switch (dataNode->GetNodeType())
{
case ROOT:
{
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
tree->SetRoot(newDataNode);
currentContainer = newDataNode;
break;
}
case DOCUMENT:
{
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
tree->Add(newDataNode,currentContainer);
currentContainer = newDataNode;
break;
}
case FOLDER:
{
newDataNodeFolder->SetNodeType(dataNode->GetNodeType());
newDataNodeFolder->SetNodeId(dataNode->GetNodeId());
newFolder = true;
break;
}
case FEATURE_POINT:
{
if(m_GeoROI.IsInside(this->PointToContinuousIndex(dataNode->GetPoint())))
{
if(newFolder)
{
tree->Add(newDataNodeFolder,currentContainer);
currentContainer = newDataNodeFolder;
newFolder = false;
}
if(newMultiFeature)
{
tree->Add(newDataNodeMultiFeature,currentContainer);
currentContainer = newDataNodeMultiFeature;
newMultiFeature = false;
}
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetPoint(dataNode->GetPoint());
tree->Add(newDataNode,currentContainer);
}
break;
}
case FEATURE_LINE:
{
if(this->IsLineIntersectionNotNull(dataNode->GetLine()))
{
if(newFolder)
{
tree->Add(newDataNodeFolder,currentContainer);
currentContainer = newDataNodeFolder;
newFolder = false;
}
if(newMultiFeature)
{
tree->Add(newDataNodeMultiFeature ,currentContainer);
currentContainer = newDataNodeMultiFeature ;
newMultiFeature = false;
}
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetLine(dataNode->GetLine());
tree->Add(newDataNode,currentContainer);
}
break;
}
case FEATURE_POLYGON:
{
if(this->IsPolygonIntersectionNotNull(dataNode->GetPolygonExteriorRing()))
{
if(newFolder)
{
tree->Add(newDataNodeFolder,currentContainer);
currentContainer = newDataNodeFolder;
newFolder = false;
}
if(newMultiFeature)
{
tree->Add(newDataNodeMultiFeature,currentContainer);
currentContainer = newDataNodeMultiFeature ;
newMultiFeature = false;
}
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetPolygonExteriorRing(dataNode->GetPolygonExteriorRing());
newDataNode->SetPolygonInteriorRings(dataNode->GetPolygonInteriorRings());
tree->Add(newDataNode,currentContainer);
}
break;
}
case FEATURE_MULTIPOINT:
{
newDataNodeMultiFeature->SetNodeType(dataNode->GetNodeType());
newDataNodeMultiFeature ->SetNodeId(dataNode->GetNodeId());
newMultiFeature = true;
break;
}
case FEATURE_MULTILINE:
{
newDataNodeMultiFeature ->SetNodeType(dataNode->GetNodeType());
newDataNodeMultiFeature ->SetNodeId(dataNode->GetNodeId());
newMultiFeature = true;
break;
}
case FEATURE_MULTIPOLYGON:
{
newDataNodeMultiFeature ->SetNodeType(dataNode->GetNodeType());
newDataNodeMultiFeature->SetNodeId(dataNode->GetNodeId());
newMultiFeature = true;
break;
}
case FEATURE_COLLECTION:
{
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
tree->Add(newDataNode,currentContainer);
currentContainer = newDataNode;
break;
}
}
{
case ROOT:
{
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
tree->SetRoot(newDataNode);
currentContainer = newDataNode;
break;
}
case DOCUMENT:
{
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
tree->Add(newDataNode,currentContainer);
currentContainer = newDataNode;
break;
}
case FOLDER:
{
newDataNodeFolder->SetNodeType(dataNode->GetNodeType());
newDataNodeFolder->SetNodeId(dataNode->GetNodeId());
newFolder = true;
break;
}
case FEATURE_POINT:
{
if(m_GeoROI.IsInside(this->PointToContinuousIndex(dataNode->GetPoint())))
{
if(newFolder)
{
tree->Add(newDataNodeFolder,currentContainer);
currentContainer = newDataNodeFolder;
newFolder = false;
}
if(newMultiFeature)
{
tree->Add(newDataNodeMultiFeature,currentContainer);
currentContainer = newDataNodeMultiFeature;
newMultiFeature = false;
}
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetPoint(dataNode->GetPoint());
tree->Add(newDataNode,currentContainer);
}
break;
}
case FEATURE_LINE:
{
if(this->IsLineIntersectionNotNull(dataNode->GetLine()))
{
if(newFolder)
{
tree->Add(newDataNodeFolder,currentContainer);
currentContainer = newDataNodeFolder;
newFolder = false;
}
if(newMultiFeature)
{
tree->Add(newDataNodeMultiFeature ,currentContainer);
currentContainer = newDataNodeMultiFeature ;
newMultiFeature = false;
}
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetLine(dataNode->GetLine());
tree->Add(newDataNode,currentContainer);
}
break;
}
case FEATURE_POLYGON:
{
if(this->IsPolygonIntersectionNotNull(dataNode->GetPolygonExteriorRing()))
{
if(newFolder)
{
tree->Add(newDataNodeFolder,currentContainer);
currentContainer = newDataNodeFolder;
newFolder = false;
}
if(newMultiFeature)
{
tree->Add(newDataNodeMultiFeature,currentContainer);
currentContainer = newDataNodeMultiFeature ;
newMultiFeature = false;
}
newDataNode->SetNodeType(dataNode->GetNodeType());
newDataNode->SetNodeId(dataNode->GetNodeId());
newDataNode->SetPolygonExteriorRing(dataNode->GetPolygonExteriorRing());
newDataNode->SetPolygonInteriorRings(dataNode->GetPolygonInteriorRings());
tree->Add(newDataNode,currentContainer);
}
break;
}
case FEATURE_MULTIPOINT:
{
newDataNodeMultiFeature->SetNodeType(dataNode->GetNodeType());
newDataNodeMultiFeature ->SetNodeId(dataNode->GetNodeId());
newMultiFeature = true;
break;
}
case FEATURE_MULTILINE:
{
newDataNodeMultiFeature ->SetNodeType(dataNode->GetNodeType());
newDataNodeMultiFeature ->SetNodeId(dataNode->GetNodeId());
newMultiFeature = true;
break;