Commit 36adbbbb authored by Mathias Goldau's avatar Mathias Goldau

[CHANGE] Lines containing:

boost::shared_ptr< foo > bar = boost::shared_ptr< foo >( new foo(...) );
are often very long and hard to read. They have changed to:
boost::shared_ptr< foo > bar( new foo(...) );
parent 2c47edf0
...@@ -195,10 +195,10 @@ template< typename T > void WMApplyMask::applyMask( boost::shared_ptr< WValueSet ...@@ -195,10 +195,10 @@ template< typename T > void WMApplyMask::applyMask( boost::shared_ptr< WValueSet
throw WException( std::string( "Mask is not of type float." ) ); throw WException( std::string( "Mask is not of type float." ) );
} }
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Apply Mask", valSet->size() ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Apply Mask", valSet->size() ) );
m_progress->addSubProgress( progress ); m_progress->addSubProgress( progress );
boost::shared_ptr< std::vector< T > > newVals = boost::shared_ptr< std::vector< T > >( new std::vector< T >( valSet->size() ) ); boost::shared_ptr< std::vector< T > > newVals( new std::vector< T >( valSet->size() ) );
for( size_t i = 0; i < valSet->size(); ++i ) for( size_t i = 0; i < valSet->size(); ++i )
{ {
++*progress; ++*progress;
......
...@@ -212,7 +212,7 @@ void WMArbitraryROIs::createCutDataset() ...@@ -212,7 +212,7 @@ void WMArbitraryROIs::createCutDataset()
size_t vDim = ( *m_dataSet ).getValueSet()->dimension(); size_t vDim = ( *m_dataSet ).getValueSet()->dimension();
float threshold = m_threshold->get(); float threshold = m_threshold->get();
boost::shared_ptr< std::vector< float > > data = boost::shared_ptr< std::vector< float > >( new std::vector< float >() ); boost::shared_ptr< std::vector< float > > data( new std::vector< float >() );
switch( ( *m_dataSet ).getValueSet()->getDataType() ) switch( ( *m_dataSet ).getValueSet()->getDataType() )
{ {
...@@ -288,7 +288,7 @@ boost::shared_ptr< std::vector< float > > WMArbitraryROIs::cutArea( boost::share ...@@ -288,7 +288,7 @@ boost::shared_ptr< std::vector< float > > WMArbitraryROIs::cutArea( boost::share
size_t yMax = static_cast<size_t>( m_selectionROI->getMaxPos()[1] / dy ); size_t yMax = static_cast<size_t>( m_selectionROI->getMaxPos()[1] / dy );
size_t zMax = static_cast<size_t>( m_selectionROI->getMaxPos()[2] / dz ); size_t zMax = static_cast<size_t>( m_selectionROI->getMaxPos()[2] / dz );
boost::shared_ptr< std::vector< float > > newVals = boost::shared_ptr< std::vector< float > >( new std::vector< float >( nx * ny * nz, 0 ) ); boost::shared_ptr< std::vector< float > > newVals( new std::vector< float >( nx * ny * nz, 0 ) );
size_t x, y, z; size_t x, y, z;
for( z = 0; z < nz; ++z ) for( z = 0; z < nz; ++z )
......
...@@ -153,7 +153,7 @@ boost::shared_ptr< WDataSet > WReaderBiosig::load() ...@@ -153,7 +153,7 @@ boost::shared_ptr< WDataSet > WReaderBiosig::load()
// TODO(wiebel): set second channel // TODO(wiebel): set second channel
} }
boost::shared_ptr< WEEG > eeg = boost::shared_ptr< WEEG >( new WEEG( segments, lib, labels ) ); boost::shared_ptr< WEEG > eeg( new WEEG( segments, lib, labels ) );
eeg->setFilename( m_fname ); eeg->setFilename( m_fname );
......
...@@ -83,7 +83,7 @@ boost::shared_ptr< WDataSet > WReaderEEGASCII::load() ...@@ -83,7 +83,7 @@ boost::shared_ptr< WDataSet > WReaderEEGASCII::load()
WEEGElectrodeLibrary lib; // TODO(wiebel): this is a dummy WEEGElectrodeLibrary lib; // TODO(wiebel): this is a dummy
boost::shared_ptr< WEEG > eeg = boost::shared_ptr< WEEG >( new WEEG( segments, lib, labels ) ); boost::shared_ptr< WEEG > eeg( new WEEG( segments, lib, labels ) );
eeg->setFilename( m_fname ); eeg->setFilename( m_fname );
return eeg; return eeg;
} }
...@@ -64,11 +64,8 @@ boost::shared_ptr< WDataSetFibers > WReaderFiberVTK::read() ...@@ -64,11 +64,8 @@ boost::shared_ptr< WDataSetFibers > WReaderFiberVTK::read()
readLines(); readLines();
readValues(); readValues();
boost::shared_ptr< WDataSetFibers > fibers = boost::shared_ptr< WDataSetFibers >( new WDataSetFibers( m_points, boost::shared_ptr< WDataSetFibers > fibers( new WDataSetFibers( m_points, m_fiberStartIndices,
m_fiberStartIndices, m_fiberLengths, m_pointFiberMapping, m_fiberParameters ) );
m_fiberLengths,
m_pointFiberMapping,
m_fiberParameters ) );
fibers->setFilename( m_fname ); fibers->setFilename( m_fname );
......
...@@ -61,7 +61,7 @@ WReaderNIfTI::WReaderNIfTI( std::string fileName ) ...@@ -61,7 +61,7 @@ WReaderNIfTI::WReaderNIfTI( std::string fileName )
template< typename T > boost::shared_ptr< std::vector< T > > WReaderNIfTI::copyArray( const T* dataArray, const size_t countVoxels, template< typename T > boost::shared_ptr< std::vector< T > > WReaderNIfTI::copyArray( const T* dataArray, const size_t countVoxels,
const size_t vDim ) const size_t vDim )
{ {
boost::shared_ptr< std::vector< T > > data = boost::shared_ptr< std::vector< T > >( new std::vector< T >( countVoxels * vDim ) ); boost::shared_ptr< std::vector< T > > data( new std::vector< T >( countVoxels * vDim ) );
for( unsigned int i = 0; i < countVoxels; ++i ) for( unsigned int i = 0; i < countVoxels; ++i )
{ {
for( unsigned int j = 0; j < vDim; ++j ) for( unsigned int j = 0; j < vDim; ++j )
...@@ -390,7 +390,7 @@ boost::shared_ptr< WDataSet > WReaderNIfTI::load( DataSetType dataSetType ) ...@@ -390,7 +390,7 @@ boost::shared_ptr< WDataSet > WReaderNIfTI::load( DataSetType dataSetType )
{ {
// read gradients, there should be 3 * vDim values in the file // read gradients, there should be 3 * vDim values in the file
typedef std::vector< WVector3d > GradVec; typedef std::vector< WVector3d > GradVec;
boost::shared_ptr< GradVec > newGradients = boost::shared_ptr< GradVec >( new GradVec( vDim ) ); boost::shared_ptr< GradVec > newGradients( new GradVec( vDim ) );
// the file should contain the x-coordinates in line 0, y-coordinates in line 1, // the file should contain the x-coordinates in line 0, y-coordinates in line 1,
// z-coordinates in line 2 // z-coordinates in line 2
......
...@@ -171,7 +171,7 @@ boost::shared_ptr< std::vector< WVector3d > > WReaderVTK::readGradients() ...@@ -171,7 +171,7 @@ boost::shared_ptr< std::vector< WVector3d > > WReaderVTK::readGradients()
values.resize( values.size() / 3 ); values.resize( values.size() / 3 );
} }
boost::shared_ptr< GradVec > newGradients = boost::shared_ptr< GradVec >( new GradVec( values.size() / 3 ) ); boost::shared_ptr< GradVec > newGradients( new GradVec( values.size() / 3 ) );
for( std::size_t j = 0; j < values.size() / 3; ++j ) for( std::size_t j = 0; j < values.size() / 3; ++j )
{ {
......
...@@ -105,8 +105,7 @@ public: ...@@ -105,8 +105,7 @@ public:
template < typename T > template < typename T >
result_type operator()( const WValueSet< T >* const& vals ) const // NOLINT result_type operator()( const WValueSet< T >* const& vals ) const // NOLINT
{ {
boost::shared_ptr< std::vector< TargetType > > newVals = boost::shared_ptr< std::vector< TargetType > > newVals( new std::vector< TargetType >( vals->size() ) );
boost::shared_ptr< std::vector< TargetType > >( new std::vector< TargetType >( vals->size() ) );
for( size_t i = 0; i < newVals->size(); ++i ) for( size_t i = 0; i < newVals->size(); ++i )
{ {
( *newVals )[i] = static_cast< TargetType >( vals->getScalar( i ) ); ( *newVals )[i] = static_cast< TargetType >( vals->getScalar( i ) );
......
...@@ -151,7 +151,7 @@ template< typename T > boost::shared_ptr< WValueSet< float > > makeFloatValueSet ...@@ -151,7 +151,7 @@ template< typename T > boost::shared_ptr< WValueSet< float > > makeFloatValueSet
WAssert( inSet->dimension() == 1, "Works only for scalar data." ); WAssert( inSet->dimension() == 1, "Works only for scalar data." );
WAssert( inSet->order() == 0, "Works only for scalar data." ); WAssert( inSet->order() == 0, "Works only for scalar data." );
boost::shared_ptr< std::vector< float > > data = boost::shared_ptr< std::vector< float > >( new std::vector< float >( inSet->size() ) ); boost::shared_ptr< std::vector< float > > data( new std::vector< float >( inSet->size() ) );
for( unsigned int i = 0; i < inSet->size(); ++i ) for( unsigned int i = 0; i < inSet->size(); ++i )
{ {
( *data )[i] = static_cast< float >( inSet->getScalar( i ) ); ( *data )[i] = static_cast< float >( inSet->getScalar( i ) );
......
...@@ -563,7 +563,7 @@ void WMFiberDisplay::createFiberGeode( boost::shared_ptr< WDataSetFibers > fiber ...@@ -563,7 +563,7 @@ void WMFiberDisplay::createFiberGeode( boost::shared_ptr< WDataSetFibers > fiber
endState->setMode( GL_BLEND, osg::StateAttribute::ON ); endState->setMode( GL_BLEND, osg::StateAttribute::ON );
// progress indication // progress indication
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Adding fibers to geode", fibStart->size() ) ); boost::shared_ptr< WProgress > progress1( new WProgress( "Adding fibers to geode", fibStart->size() ) );
m_progress->addSubProgress( progress1 ); m_progress->addSubProgress( progress1 );
// for each fiber: // for each fiber:
......
...@@ -135,13 +135,13 @@ void WMFiberFilterROI::moduleMain() ...@@ -135,13 +135,13 @@ void WMFiberFilterROI::moduleMain()
void WMFiberFilterROI::updateOutput() void WMFiberFilterROI::updateOutput()
{ {
// target memory // target memory
boost::shared_ptr< std::vector< bool > > active = m_fiberSelector->getBitfield(); boost::shared_ptr< std::vector< bool > > active = m_fiberSelector->getBitfield();
boost::shared_ptr< std::vector< float > >vertices = boost::shared_ptr< std::vector< float > >( new std::vector< float >() ); boost::shared_ptr< std::vector< float > > vertices( new std::vector< float >() );
boost::shared_ptr< std::vector< size_t > > lineStartIndexes = boost::shared_ptr< std::vector< size_t > > ( new std::vector< size_t >() ); boost::shared_ptr< std::vector< size_t > > lineStartIndexes( new std::vector< size_t >() );
boost::shared_ptr< std::vector< size_t > > lineLengths = boost::shared_ptr< std::vector< size_t > >( new std::vector< size_t >() ); boost::shared_ptr< std::vector< size_t > > lineLengths( new std::vector< size_t >() );
boost::shared_ptr< std::vector< size_t > > verticesReverse = boost::shared_ptr< std::vector< size_t > >( new std::vector< size_t >() ); boost::shared_ptr< std::vector< size_t > > verticesReverse( new std::vector< size_t >() );
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Filtering", active->size() ) ); boost::shared_ptr< WProgress > progress1( new WProgress( "Filtering", active->size() ) );
m_progress->addSubProgress( progress1 ); m_progress->addSubProgress( progress1 );
size_t countLines = 0; size_t countLines = 0;
......
...@@ -181,10 +181,8 @@ void WMFiberParameterColoring::moduleMain() ...@@ -181,10 +181,8 @@ void WMFiberParameterColoring::moduleMain()
m_fibLengthColors->resize( colorMode * ( fibVerts->size() / 3 ), 0.0 ); // create an RGBA coloring m_fibLengthColors->resize( colorMode * ( fibVerts->size() / 3 ), 0.0 ); // create an RGBA coloring
// progress indication // progress indication
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Coloring fibers.", boost::shared_ptr< WProgress > progress1( new WProgress( "Coloring fibers.", fibStart->size() ) );
fibStart->size() ) ); boost::shared_ptr< WProgress > progress2( new WProgress( "Scaling Colors.", fibStart->size() ) );
boost::shared_ptr< WProgress > progress2 = boost::shared_ptr< WProgress >( new WProgress( "Scaling Colors.",
fibStart->size() ) );
m_progress->addSubProgress( progress1 ); m_progress->addSubProgress( progress1 );
m_progress->addSubProgress( progress2 ); m_progress->addSubProgress( progress2 );
......
...@@ -138,7 +138,7 @@ boost::shared_ptr< WDataSetFibers > WMFiberResampling::resample( boost::shared_p ...@@ -138,7 +138,7 @@ boost::shared_ptr< WDataSetFibers > WMFiberResampling::resample( boost::shared_p
{ {
debugLog() << "Start resampling: " << dataSet->getLineStartIndexes()->size() << " tracts"; debugLog() << "Start resampling: " << dataSet->getLineStartIndexes()->size() << " tracts";
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Resampling tracts.", dataSet->getLineStartIndexes()->size() ) ); // NOLINT line length boost::shared_ptr< WProgress > progress1( new WProgress( "Resampling tracts.", dataSet->getLineStartIndexes()->size() ) );
m_progress->addSubProgress( progress1 ); m_progress->addSubProgress( progress1 );
boost::shared_ptr< WDataSetFiberVector > newDS( new WDataSetFiberVector() ); boost::shared_ptr< WDataSetFiberVector > newDS( new WDataSetFiberVector() );
......
...@@ -239,8 +239,7 @@ void WMFiberSelection::moduleMain() ...@@ -239,8 +239,7 @@ void WMFiberSelection::moduleMain()
std::vector< boost::tuple< size_t, size_t, size_t > > matches; // a match contains the fiber ID, the start vertex ID and the stop ID std::vector< boost::tuple< size_t, size_t, size_t > > matches; // a match contains the fiber ID, the start vertex ID and the stop ID
// progress indication // progress indication
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Checking fibers against ", boost::shared_ptr< WProgress > progress1( new WProgress( "Checking fibers against ", fibStart->size() ) );
fibStart->size() ) );
m_progress->addSubProgress( progress1 ); m_progress->addSubProgress( progress1 );
// there are several scenarios possible, how the VOIs can be. They can intersect each other, one being inside the other or they might // there are several scenarios possible, how the VOIs can be. They can intersect each other, one being inside the other or they might
...@@ -351,17 +350,17 @@ void WMFiberSelection::moduleMain() ...@@ -351,17 +350,17 @@ void WMFiberSelection::moduleMain()
// combine it to a new fiber dataset // combine it to a new fiber dataset
// the required arrays: // the required arrays:
boost::shared_ptr< std::vector< float > > newFibVerts = boost::shared_ptr< std::vector< float > >( new std::vector< float >() ); boost::shared_ptr< std::vector< float > > newFibVerts( new std::vector< float >() );
boost::shared_ptr< std::vector< size_t > > newFibStart = boost::shared_ptr< std::vector< size_t > >( new std::vector< size_t >() ); boost::shared_ptr< std::vector< size_t > > newFibStart( new std::vector< size_t >() );
boost::shared_ptr< std::vector< size_t > > newFibLen = boost::shared_ptr< std::vector< size_t > >( new std::vector< size_t >() ); boost::shared_ptr< std::vector< size_t > > newFibLen( new std::vector< size_t >() );
boost::shared_ptr< std::vector< size_t > > newFibVertsRev = boost::shared_ptr< std::vector< size_t > >( new std::vector< size_t >() ); boost::shared_ptr< std::vector< size_t > > newFibVertsRev( new std::vector< size_t >() );
progress1 = boost::shared_ptr< WProgress >( new WProgress( "Creating Output Dataset.", matches.size() ) ); progress1 = boost::shared_ptr< WProgress >( new WProgress( "Creating Output Dataset.", matches.size() ) );
m_progress->addSubProgress( progress1 ); m_progress->addSubProgress( progress1 );
debugLog() << "Creating new Fiber Dataset and Cluster."; debugLog() << "Creating new Fiber Dataset and Cluster.";
// the cluster which gets iteratively build // the cluster which gets iteratively build
boost::shared_ptr< WFiberCluster > newFiberCluster = boost::shared_ptr< WFiberCluster >( new WFiberCluster() ); boost::shared_ptr< WFiberCluster > newFiberCluster( new WFiberCluster() );
// add each match to the above arrays // add each match to the above arrays
size_t curVertIdx = 0; // the current index in the vertex array size_t curVertIdx = 0; // the current index in the vertex array
...@@ -415,17 +414,14 @@ void WMFiberSelection::moduleMain() ...@@ -415,17 +414,14 @@ void WMFiberSelection::moduleMain()
progress1->finish(); progress1->finish();
// create the new dataset // create the new dataset
boost::shared_ptr< WDataSetFibers > newFibers = boost::shared_ptr< WDataSetFibers >( boost::shared_ptr< WDataSetFibers > newFibers( new WDataSetFibers( newFibVerts, newFibStart, newFibLen, newFibVertsRev ) );
new WDataSetFibers( newFibVerts, newFibStart, newFibLen, newFibVertsRev )
);
// create a WDataSetFiberVector which is needed for the WFiberCluster // create a WDataSetFiberVector which is needed for the WFiberCluster
progress1 = boost::shared_ptr< WProgress >( new WProgress( "Creating Output Vector Dataset." ) ); progress1 = boost::shared_ptr< WProgress >( new WProgress( "Creating Output Vector Dataset." ) );
m_progress->addSubProgress( progress1 ); m_progress->addSubProgress( progress1 );
debugLog() << "Creating Fiber Vector Dataset."; debugLog() << "Creating Fiber Vector Dataset.";
boost::shared_ptr< WDataSetFiberVector > newFiberVector = boost::shared_ptr< WDataSetFiberVector >( boost::shared_ptr< WDataSetFiberVector > newFiberVector( new WDataSetFiberVector( newFibers )
new WDataSetFiberVector( newFibers )
); );
newFiberCluster->setDataSetReference( newFiberVector ); newFiberCluster->setDataSetReference( newFiberVector );
newFiberCluster->generateCenterLine(); newFiberCluster->generateCenterLine();
......
...@@ -159,7 +159,7 @@ void WMHistogramEqualization::moduleMain() ...@@ -159,7 +159,7 @@ void WMHistogramEqualization::moduleMain()
dataUpdated = dataUpdated && dataSet; dataUpdated = dataUpdated && dataSet;
// prepare progress indicators // prepare progress indicators
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Processing", 4 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Processing", 4 ) );
m_progress->addSubProgress( progress ); m_progress->addSubProgress( progress );
// The data is valid and we received an update. The data is not NULL but may be the same as in previous loops. // The data is valid and we received an update. The data is not NULL but may be the same as in previous loops.
......
...@@ -185,7 +185,7 @@ void WMIsosurface::moduleMain() ...@@ -185,7 +185,7 @@ void WMIsosurface::moduleMain()
// update isosurface // update isosurface
debugLog() << "Computing surface ..."; debugLog() << "Computing surface ...";
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Marching Cubes", 2 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Marching Cubes", 2 ) );
m_progress->addSubProgress( progress ); m_progress->addSubProgress( progress );
generateSurfacePre( m_isoValueProp->get( true ) ); generateSurfacePre( m_isoValueProp->get( true ) );
......
...@@ -151,7 +151,7 @@ void WMMergeComponentsToVector::moduleMain() ...@@ -151,7 +151,7 @@ void WMMergeComponentsToVector::moduleMain()
} }
// prepare progress indicators // prepare progress indicators
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Processing", dataSetX->getValueSet()->rawSize() ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Processing", dataSetX->getValueSet()->rawSize() ) );
m_progress->addSubProgress( progress ); m_progress->addSubProgress( progress );
// FIXME: this should be done using visitors, making it data type invariant. For now, using doubles all the time is enough // FIXME: this should be done using visitors, making it data type invariant. For now, using doubles all the time is enough
......
...@@ -105,7 +105,7 @@ void WMReadDipoles::moduleMain() ...@@ -105,7 +105,7 @@ void WMReadDipoles::moduleMain()
break; break;
} }
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Read Dipoles", 2 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Read Dipoles", 2 ) );
++*progress; ++*progress;
if( !m_metaFile->get() ) if( !m_metaFile->get() )
{ {
......
...@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderBrainVISA::operator()( WProgressCombiner::SPtr pa ...@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderBrainVISA::operator()( WProgressCombiner::SPtr pa
std::string fileName = file.string(); std::string fileName = file.string();
WAssert( !fileName.empty(), "No filename specified." ); WAssert( !fileName.empty(), "No filename specified." );
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Read Mesh", 3 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Read Mesh", 3 ) );
parentProgress->addSubProgress( progress ); parentProgress->addSubProgress( progress );
std::ifstream ifs; std::ifstream ifs;
......
...@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderDIP::operator()( WProgressCombiner::SPtr parentPr ...@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderDIP::operator()( WProgressCombiner::SPtr parentPr
std::string fileName = file.string(); std::string fileName = file.string();
WAssert( !fileName.empty(), "No filename specified." ); WAssert( !fileName.empty(), "No filename specified." );
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Read Mesh", 3 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Read Mesh", 3 ) );
parentProgress->addSubProgress( progress ); parentProgress->addSubProgress( progress );
std::ifstream ifs; std::ifstream ifs;
......
...@@ -46,7 +46,7 @@ WTriangleMesh::SPtr WMeshReaderFiberNavigator::operator()( WProgressCombiner::SP ...@@ -46,7 +46,7 @@ WTriangleMesh::SPtr WMeshReaderFiberNavigator::operator()( WProgressCombiner::SP
std::string fileName = file.string(); std::string fileName = file.string();
WAssert( !fileName.empty(), "No filename specified." ); WAssert( !fileName.empty(), "No filename specified." );
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Read Mesh", 3 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Read Mesh", 3 ) );
parentProgress->addSubProgress( progress ); parentProgress->addSubProgress( progress );
std::ifstream ifs; std::ifstream ifs;
......
...@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderFreesurfer::operator()( WProgressCombiner::SPtr / ...@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderFreesurfer::operator()( WProgressCombiner::SPtr /
std::string fileName = file.string(); std::string fileName = file.string();
WAssert( !fileName.empty(), "No filename specified." ); WAssert( !fileName.empty(), "No filename specified." );
boost::shared_ptr< std::ifstream > ifs = boost::shared_ptr< std::ifstream >( new std::ifstream() ); boost::shared_ptr< std::ifstream > ifs( new std::ifstream() );
ifs->open( fileName.c_str(), std::ifstream::in | std::ifstream::binary ); ifs->open( fileName.c_str(), std::ifstream::in | std::ifstream::binary );
if( !ifs || ifs->bad() ) if( !ifs || ifs->bad() )
{ {
......
...@@ -47,7 +47,7 @@ WTriangleMesh::SPtr WMeshReaderOBJ::operator()( WProgressCombiner::SPtr parentPr ...@@ -47,7 +47,7 @@ WTriangleMesh::SPtr WMeshReaderOBJ::operator()( WProgressCombiner::SPtr parentPr
std::string fileName = file.string(); std::string fileName = file.string();
WAssert( !fileName.empty(), "No filename specified." ); WAssert( !fileName.empty(), "No filename specified." );
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Read Mesh", 3 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Read Mesh", 3 ) );
parentProgress->addSubProgress( progress ); parentProgress->addSubProgress( progress );
std::ifstream ifs; std::ifstream ifs;
......
...@@ -50,7 +50,7 @@ WTriangleMesh::SPtr WMeshReaderVTK::operator()( WProgressCombiner::SPtr parentPr ...@@ -50,7 +50,7 @@ WTriangleMesh::SPtr WMeshReaderVTK::operator()( WProgressCombiner::SPtr parentPr
std::string fileName = file.string(); std::string fileName = file.string();
WAssert( !fileName.empty(), "No filename specified." ); WAssert( !fileName.empty(), "No filename specified." );
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Read Mesh", 3 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Read Mesh", 3 ) );
parentProgress->addSubProgress( progress ); parentProgress->addSubProgress( progress );
std::ifstream ifs; std::ifstream ifs;
......
...@@ -135,7 +135,7 @@ void WMReadRawData::moduleMain() ...@@ -135,7 +135,7 @@ void WMReadRawData::moduleMain()
} }
debugLog() << "Loading " << m_dataFile->get().string() << "."; debugLog() << "Loading " << m_dataFile->get().string() << ".";
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Read Raw Data", 2 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Read Raw Data", 2 ) );
++*progress; ++*progress;
m_dataSet = readData( m_dataFile->get().string() ); m_dataSet = readData( m_dataFile->get().string() );
++*progress; ++*progress;
......
...@@ -117,7 +117,7 @@ void WMReadVIM::moduleMain() ...@@ -117,7 +117,7 @@ void WMReadVIM::moduleMain()
continue; continue;
} }
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Loading" ) ); boost::shared_ptr< WProgress > progress1( new WProgress( "Loading" ) );
m_progress->addSubProgress( progress1 ); m_progress->addSubProgress( progress1 );
// target memory // target memory
......
...@@ -106,7 +106,7 @@ private: ...@@ -106,7 +106,7 @@ private:
template< typename T > template< typename T >
WSegmentationAlgo::DataSetPtr WSegmentationAlgoThreshold::operator() ( WValueSet< T > const* valueset ) const WSegmentationAlgo::DataSetPtr WSegmentationAlgoThreshold::operator() ( WValueSet< T > const* valueset ) const
{ {
boost::shared_ptr< std::vector< T > > values = boost::shared_ptr< std::vector< T > >( new std::vector< T >( valueset->size() ) ); boost::shared_ptr< std::vector< T > > values( new std::vector< T >( valueset->size() ) );
double low_threshold = valueset->getMinimumValue() + m_low_threshold->get( true ) * ( valueset->getMaximumValue() - valueset->getMinimumValue() ); double low_threshold = valueset->getMinimumValue() + m_low_threshold->get( true ) * ( valueset->getMaximumValue() - valueset->getMinimumValue() );
double upp_threshold = valueset->getMinimumValue() + m_upp_threshold->get( true ) * ( valueset->getMaximumValue() - valueset->getMinimumValue() ); double upp_threshold = valueset->getMinimumValue() + m_upp_threshold->get( true ) * ( valueset->getMaximumValue() - valueset->getMinimumValue() );
......
...@@ -131,7 +131,7 @@ void WMSpatialDerivative::moduleMain() ...@@ -131,7 +131,7 @@ void WMSpatialDerivative::moduleMain()
} }
// prepare progress indicators // prepare progress indicators
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Processing", 0 ) ); boost::shared_ptr< WProgress > progress( new WProgress( "Processing", 0 ) );
m_progress->addSubProgress( progress ); m_progress->addSubProgress( progress );
// loop through each voxel // loop through each voxel
......
...@@ -252,8 +252,7 @@ void WSurface::execute() ...@@ -252,8 +252,7 @@ void WSurface::execute()
m_renderpointsPerCol = splineSurface.getNumSamplePointsU(); m_renderpointsPerCol = splineSurface.getNumSamplePointsU();
m_renderpointsPerRow = splineSurface.getNumSamplePointsT(); m_renderpointsPerRow = splineSurface.getNumSamplePointsT();
boost::shared_ptr< WTriangleMesh > newMesh = boost::shared_ptr< WTriangleMesh >( new WTriangleMesh( m_splinePoints.size(), 2 boost::shared_ptr< WTriangleMesh > newMesh( new WTriangleMesh( m_splinePoints.size(), 2 * m_renderpointsPerCol * m_renderpointsPerRow ) );
* m_renderpointsPerCol * m_renderpointsPerRow ) );
for( std::vector< WVector3d >::iterator posIt = m_splinePoints.begin(); posIt != m_splinePoints.end(); ++posIt ) for( std::vector< WVector3d >::iterator posIt = m_splinePoints.begin(); posIt != m_splinePoints.end(); ++posIt )
{