Commit 9e33166e authored by George Zagaris's avatar George Zagaris
Browse files

STYLE: Conform to VTK's coding guidelines

Fixed indentation and one-line if statements.
parent c40c8e66
......@@ -52,7 +52,10 @@ class VTK_AMR_EXPORT vtkAMRBaseReader :
vtkSetMacro( EnableCaching, int );
vtkGetMacro( EnableCaching, int );
vtkBooleanMacro( EnableCaching, int );
inline bool IsCachingEnabled()const{return((EnableCaching)?true:false);};
bool IsCachingEnabled() const
{
return( (this->EnableCaching)?true:false);
};
// Description:
// Set/Get a multiprocess-controller for reading in parallel.
......
......@@ -34,11 +34,12 @@ vtkAMRDataSetCache::~vtkAMRDataSetCache()
AMRCacheType::iterator iter = this->Cache.begin();
for( ; iter != this->Cache.end(); ++iter )
{
if( iter->second != NULL )
iter->second->Delete();
this->Cache.erase( iter );
if( iter->second != NULL )
{
iter->second->Delete();
}
this->Cache.erase( iter );
}
}
//------------------------------------------------------------------------------
......@@ -56,7 +57,7 @@ void vtkAMRDataSetCache::InsertAMRBlock(
vtkTimerLog::MarkStartEvent( "AMRCache::InsertBlock" );
if( !this->HasAMRBlock( compositeIdx ) )
{
this->Cache[ compositeIdx ] = amrGrid;
this->Cache[ compositeIdx ] = amrGrid;
}
vtkTimerLog::MarkEndEvent( "AMRCache::InsertBlock" );
}
......@@ -77,7 +78,9 @@ void vtkAMRDataSetCache::InsertAMRBlockPointData(
assert( "pre: PointData should not be NULL" && ( PD != NULL ) );
if( !PD->HasArray( dataArray->GetName() ) )
{
PD->AddArray( dataArray );
}
vtkTimerLog::MarkEndEvent( "AMRCache::InsertAMRBlockPointData" );
}
......@@ -99,7 +102,9 @@ void vtkAMRDataSetCache::InsertAMRBlockCellData(
assert( "pre: CellData should not be NULL" && (CD != NULL) );
if( !CD->HasArray( dataArray->GetName() ) )
{
CD->AddArray( dataArray );
}
vtkTimerLog::MarkEndEvent( "AMRCache::InsertAMRBlockCellData" );
}
......@@ -110,17 +115,21 @@ vtkDataArray* vtkAMRDataSetCache::GetAMRBlockCellData(
{
if( this->HasAMRBlockCellData( compositeIdx, dataName ) )
{
vtkUniformGrid *amrBlock = this->GetAMRBlock( compositeIdx );
assert( "pre: AMR block should not be NULL" &&
(this->HasAMRBlock( compositeIdx ) ) );
vtkCellData *CD = amrBlock ->GetCellData();
assert( "pre: CellData should not be NULL" && (CD != NULL) );
if( CD->HasArray( dataName ) )
return CD->GetArray( dataName );
else
return NULL;
vtkUniformGrid *amrBlock = this->GetAMRBlock( compositeIdx );
assert( "pre: AMR block should not be NULL" &&
(this->HasAMRBlock( compositeIdx ) ) );
vtkCellData *CD = amrBlock ->GetCellData();
assert( "pre: CellData should not be NULL" && (CD != NULL) );
if( CD->HasArray( dataName ) )
{
return CD->GetArray( dataName );
}
else
{
return NULL;
}
}
return NULL;
}
......@@ -132,16 +141,20 @@ vtkDataArray* vtkAMRDataSetCache::GetAMRBlockPointData(
if( this->HasAMRBlockPointData( compositeIdx, dataName ) )
{
vtkUniformGrid *amrBlock = this->GetAMRBlock( compositeIdx );
assert( "pre: AMR block should not be NULL" && ( amrBlock != NULL ) );
vtkPointData *PD = amrBlock ->GetPointData();
assert( "pre: PointData should not be NULL" && ( PD != NULL ) );
if( PD->HasArray( dataName ) )
return PD->GetArray( dataName );
else
return NULL;
vtkUniformGrid *amrBlock = this->GetAMRBlock( compositeIdx );
assert( "pre: AMR block should not be NULL" && ( amrBlock != NULL ) );
vtkPointData *PD = amrBlock ->GetPointData();
assert( "pre: PointData should not be NULL" && ( PD != NULL ) );
if( PD->HasArray( dataName ) )
{
return PD->GetArray( dataName );
}
else
{
return NULL;
}
}
return NULL;
}
......@@ -151,7 +164,7 @@ vtkUniformGrid* vtkAMRDataSetCache::GetAMRBlock( const int compositeIdx )
{
if( this->HasAMRBlock( compositeIdx ) )
{
return this->Cache[ compositeIdx ];
return this->Cache[ compositeIdx ];
}
return NULL;
}
......@@ -164,16 +177,20 @@ bool vtkAMRDataSetCache::HasAMRBlockCellData(
if( this->HasAMRBlock( compositeIdx ) )
{
vtkUniformGrid *gridPtr = this->GetAMRBlock( compositeIdx );
assert( "pre: cachedk block is NULL!" && (gridPtr != NULL) );
vtkUniformGrid *gridPtr = this->GetAMRBlock( compositeIdx );
assert( "pre: cachedk block is NULL!" && (gridPtr != NULL) );
vtkCellData *CD = gridPtr->GetCellData();
assert( "pre: cell data is NULL" && (CD != NULL) );
vtkCellData *CD = gridPtr->GetCellData();
assert( "pre: cell data is NULL" && (CD != NULL) );
if( CD->HasArray( name ) )
return true;
else
return false;
if( CD->HasArray( name ) )
{
return true;
}
else
{
return false;
}
}
return false;
}
......@@ -186,16 +203,20 @@ bool vtkAMRDataSetCache::HasAMRBlockPointData(
if( this->HasAMRBlock( compositeIdx ) )
{
vtkUniformGrid *gridPtr = this->GetAMRBlock( compositeIdx );
assert( "pre: cachedk block is NULL!" && (gridPtr != NULL) );
vtkUniformGrid *gridPtr = this->GetAMRBlock( compositeIdx );
assert( "pre: cachedk block is NULL!" && (gridPtr != NULL) );
vtkPointData *PD = gridPtr->GetPointData();
assert( "pre: point data is NULL" && (PD != NULL) );
vtkPointData *PD = gridPtr->GetPointData();
assert( "pre: point data is NULL" && (PD != NULL) );
if( PD->HasArray( name ) )
return true;
else
return false;
if( PD->HasArray( name ) )
{
return true;
}
else
{
return false;
}
}
return false;
}
......@@ -207,14 +228,14 @@ bool vtkAMRDataSetCache::HasAMRBlock(int compositeIdx )
if( this->Cache.empty( ) )
{
vtkTimerLog::MarkEndEvent( "AMRCache::CheckIfBlockExists" );
return false;
vtkTimerLog::MarkEndEvent( "AMRCache::CheckIfBlockExists" );
return false;
}
if( this->Cache.find( compositeIdx ) != this->Cache.end() )
{
vtkTimerLog::MarkEndEvent( "AMRCache::CheckIfBlockExists" );
return true;
vtkTimerLog::MarkEndEvent( "AMRCache::CheckIfBlockExists" );
return true;
}
vtkTimerLog::MarkEndEvent( "AMRCache::CheckIfBlockExists" );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment