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
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 );
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 )
{
++*progress;
......
......@@ -212,7 +212,7 @@ void WMArbitraryROIs::createCutDataset()
size_t vDim = ( *m_dataSet ).getValueSet()->dimension();
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() )
{
......@@ -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 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;
for( z = 0; z < nz; ++z )
......
......@@ -153,7 +153,7 @@ boost::shared_ptr< WDataSet > WReaderBiosig::load()
// 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 );
......
......@@ -83,7 +83,7 @@ boost::shared_ptr< WDataSet > WReaderEEGASCII::load()
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 );
return eeg;
}
......@@ -64,11 +64,8 @@ boost::shared_ptr< WDataSetFibers > WReaderFiberVTK::read()
readLines();
readValues();
boost::shared_ptr< WDataSetFibers > fibers = boost::shared_ptr< WDataSetFibers >( new WDataSetFibers( m_points,
m_fiberStartIndices,
m_fiberLengths,
m_pointFiberMapping,
m_fiberParameters ) );
boost::shared_ptr< WDataSetFibers > fibers( new WDataSetFibers( m_points, m_fiberStartIndices,
m_fiberLengths, m_pointFiberMapping, m_fiberParameters ) );
fibers->setFilename( m_fname );
......
......@@ -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,
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 j = 0; j < vDim; ++j )
......@@ -390,7 +390,7 @@ boost::shared_ptr< WDataSet > WReaderNIfTI::load( DataSetType dataSetType )
{
// read gradients, there should be 3 * vDim values in the file
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,
// z-coordinates in line 2
......
......@@ -171,7 +171,7 @@ boost::shared_ptr< std::vector< WVector3d > > WReaderVTK::readGradients()
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 )
{
......
......@@ -105,8 +105,7 @@ public:
template < typename T >
result_type operator()( const WValueSet< T >* const& vals ) const // NOLINT
{
boost::shared_ptr< std::vector< TargetType > > newVals =
boost::shared_ptr< std::vector< TargetType > >( new std::vector< TargetType >( vals->size() ) );
boost::shared_ptr< std::vector< TargetType > > newVals( new std::vector< TargetType >( vals->size() ) );
for( size_t i = 0; i < newVals->size(); ++i )
{
( *newVals )[i] = static_cast< TargetType >( vals->getScalar( i ) );
......
......@@ -151,7 +151,7 @@ template< typename T > boost::shared_ptr< WValueSet< float > > makeFloatValueSet
WAssert( inSet->dimension() == 1, "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 )
{
( *data )[i] = static_cast< float >( inSet->getScalar( i ) );
......
......@@ -563,7 +563,7 @@ void WMFiberDisplay::createFiberGeode( boost::shared_ptr< WDataSetFibers > fiber
endState->setMode( GL_BLEND, osg::StateAttribute::ON );
// 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 );
// for each fiber:
......
......@@ -135,13 +135,13 @@ void WMFiberFilterROI::moduleMain()
void WMFiberFilterROI::updateOutput()
{
// target memory
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< size_t > > lineStartIndexes = boost::shared_ptr< std::vector< size_t > > ( 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 > > verticesReverse = boost::shared_ptr< std::vector< size_t > >( new std::vector< size_t >() );
boost::shared_ptr< std::vector< bool > > active = m_fiberSelector->getBitfield();
boost::shared_ptr< std::vector< float > > vertices( new std::vector< float >() );
boost::shared_ptr< std::vector< size_t > > lineStartIndexes( 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( 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 );
size_t countLines = 0;
......
......@@ -181,10 +181,8 @@ void WMFiberParameterColoring::moduleMain()
m_fibLengthColors->resize( colorMode * ( fibVerts->size() / 3 ), 0.0 ); // create an RGBA coloring
// progress indication
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Coloring fibers.",
fibStart->size() ) );
boost::shared_ptr< WProgress > progress2 = boost::shared_ptr< WProgress >( new WProgress( "Scaling Colors.",
fibStart->size() ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Coloring fibers.", fibStart->size() ) );
boost::shared_ptr< WProgress > progress2( new WProgress( "Scaling Colors.", fibStart->size() ) );
m_progress->addSubProgress( progress1 );
m_progress->addSubProgress( progress2 );
......
......@@ -138,7 +138,7 @@ boost::shared_ptr< WDataSetFibers > WMFiberResampling::resample( boost::shared_p
{
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 );
boost::shared_ptr< WDataSetFiberVector > newDS( new WDataSetFiberVector() );
......
......@@ -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
// progress indication
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Checking fibers against ",
fibStart->size() ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Checking fibers against ", fibStart->size() ) );
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
......@@ -351,17 +350,17 @@ void WMFiberSelection::moduleMain()
// combine it to a new fiber dataset
// 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< size_t > > newFibStart = boost::shared_ptr< std::vector< size_t > >( 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 > > newFibVertsRev = boost::shared_ptr< std::vector< size_t > >( new std::vector< size_t >() );
boost::shared_ptr< std::vector< float > > newFibVerts( new std::vector< float >() );
boost::shared_ptr< std::vector< size_t > > newFibStart( 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( new std::vector< size_t >() );
progress1 = boost::shared_ptr< WProgress >( new WProgress( "Creating Output Dataset.", matches.size() ) );
m_progress->addSubProgress( progress1 );
debugLog() << "Creating new Fiber Dataset and Cluster.";
// 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
size_t curVertIdx = 0; // the current index in the vertex array
......@@ -415,17 +414,14 @@ void WMFiberSelection::moduleMain()
progress1->finish();
// create the new dataset
boost::shared_ptr< WDataSetFibers > newFibers = boost::shared_ptr< WDataSetFibers >(
new WDataSetFibers( newFibVerts, newFibStart, newFibLen, newFibVertsRev )
);
boost::shared_ptr< WDataSetFibers > newFibers( new WDataSetFibers( newFibVerts, newFibStart, newFibLen, newFibVertsRev ) );
// create a WDataSetFiberVector which is needed for the WFiberCluster
progress1 = boost::shared_ptr< WProgress >( new WProgress( "Creating Output Vector Dataset." ) );
m_progress->addSubProgress( progress1 );
debugLog() << "Creating Fiber Vector Dataset.";
boost::shared_ptr< WDataSetFiberVector > newFiberVector = boost::shared_ptr< WDataSetFiberVector >(
new WDataSetFiberVector( newFibers )
boost::shared_ptr< WDataSetFiberVector > newFiberVector( new WDataSetFiberVector( newFibers )
);
newFiberCluster->setDataSetReference( newFiberVector );
newFiberCluster->generateCenterLine();
......
......@@ -159,7 +159,7 @@ void WMHistogramEqualization::moduleMain()
dataUpdated = dataUpdated && dataSet;
// 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 );
// 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()
// update isosurface
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 );
generateSurfacePre( m_isoValueProp->get( true ) );
......
......@@ -151,7 +151,7 @@ void WMMergeComponentsToVector::moduleMain()
}
// 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 );
// 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()
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;
if( !m_metaFile->get() )
{
......
......@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderBrainVISA::operator()( WProgressCombiner::SPtr pa
std::string fileName = file.string();
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 );
std::ifstream ifs;
......
......@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderDIP::operator()( WProgressCombiner::SPtr parentPr
std::string fileName = file.string();
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 );
std::ifstream ifs;
......
......@@ -46,7 +46,7 @@ WTriangleMesh::SPtr WMeshReaderFiberNavigator::operator()( WProgressCombiner::SP
std::string fileName = file.string();
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 );
std::ifstream ifs;
......
......@@ -49,7 +49,7 @@ WTriangleMesh::SPtr WMeshReaderFreesurfer::operator()( WProgressCombiner::SPtr /
std::string fileName = file.string();
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 );
if( !ifs || ifs->bad() )
{
......
......@@ -47,7 +47,7 @@ WTriangleMesh::SPtr WMeshReaderOBJ::operator()( WProgressCombiner::SPtr parentPr
std::string fileName = file.string();
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 );
std::ifstream ifs;
......
......@@ -50,7 +50,7 @@ WTriangleMesh::SPtr WMeshReaderVTK::operator()( WProgressCombiner::SPtr parentPr
std::string fileName = file.string();
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 );
std::ifstream ifs;
......
......@@ -135,7 +135,7 @@ void WMReadRawData::moduleMain()
}
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;
m_dataSet = readData( m_dataFile->get().string() );
++*progress;
......
......@@ -117,7 +117,7 @@ void WMReadVIM::moduleMain()
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 );
// target memory
......
......@@ -106,7 +106,7 @@ private:
template< typename T >
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 upp_threshold = valueset->getMinimumValue() + m_upp_threshold->get( true ) * ( valueset->getMaximumValue() - valueset->getMinimumValue() );
......
......@@ -131,7 +131,7 @@ void WMSpatialDerivative::moduleMain()
}
// 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 );
// loop through each voxel
......
......@@ -252,8 +252,7 @@ void WSurface::execute()
m_renderpointsPerCol = splineSurface.getNumSamplePointsU();
m_renderpointsPerRow = splineSurface.getNumSamplePointsT();
boost::shared_ptr< WTriangleMesh > newMesh = boost::shared_ptr< WTriangleMesh >( new WTriangleMesh( m_splinePoints.size(), 2
* m_renderpointsPerCol * m_renderpointsPerRow ) );
boost::shared_ptr< WTriangleMesh > newMesh( new WTriangleMesh( m_splinePoints.size(), 2 * m_renderpointsPerCol * m_renderpointsPerRow ) );
for( std::vector< WVector3d >::iterator posIt = m_splinePoints.begin(); posIt != m_splinePoints.end(); ++posIt )
{
......
......@@ -464,7 +464,7 @@ void WMSuperquadricGlyphs::moduleMain()
initialTensorUpload = true;
// also provide progress information
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Building Glyph Geometry" ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Building Glyph Geometry" ) );
m_progress->addSubProgress( progress1 );
// get pointers for the new data
......@@ -497,7 +497,7 @@ void WMSuperquadricGlyphs::moduleMain()
if( dataValid && ( m_xPos->changed() || initialTensorUpload ) )
{
// also provide progress information
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Building Glyph Geometry" ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Building Glyph Geometry" ) );
m_progress->addSubProgress( progress1 );
// grab some mem
......@@ -528,7 +528,7 @@ void WMSuperquadricGlyphs::moduleMain()
if( dataValid && ( m_yPos->changed() || initialTensorUpload ) )
{
// also provide progress information
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Building Glyph Geometry" ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Building Glyph Geometry" ) );
m_progress->addSubProgress( progress1 );
// grab some mem
......@@ -559,7 +559,7 @@ void WMSuperquadricGlyphs::moduleMain()
if( dataValid && ( m_zPos->changed() || initialTensorUpload ) )
{
// also provide progress information
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Building Glyph Geometry" ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Building Glyph Geometry" ) );
m_progress->addSubProgress( progress1 );
// grab some mem
......
......@@ -298,7 +298,7 @@ void WMSurfaceIllustrator::renderMesh( boost::shared_ptr< WTriangleMesh > mesh )
}
// start rendering
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Rendering", 3 ) );
boost::shared_ptr< WProgress > progress( new WProgress( "Rendering", 3 ) );
m_progress->addSubProgress( progress );
++*progress;
......
......@@ -620,7 +620,7 @@ void WMTemplate::moduleMain()
// them individually. The m_progress combiner provides this information to the GUI and the user.
// Here is a simple example:
int steps = 10;
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Doing work 1", steps ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Doing work 1", steps ) );
m_progress->addSubProgress( progress1 );
for( int i = 0; i < steps; ++i )
{
......@@ -635,7 +635,7 @@ void WMTemplate::moduleMain()
// Sometimes, the number of steps is not known. WProgress can also handle this. Simply leave away the last parameter (the number of
// steps. As with the other progress, you need to add it to the modules progress combiner and you need to mark it as finished with
// finish() if you are done with your work.
boost::shared_ptr< WProgress > progress2 = boost::shared_ptr< WProgress >( new WProgress( "Doing work 2" ) );
boost::shared_ptr< WProgress > progress2( new WProgress( "Doing work 2" ) );
m_progress->addSubProgress( progress2 );
sleep( 2 );
progress2->finish();
......@@ -670,7 +670,7 @@ void WMTemplate::moduleMain()
// Do something here. As above, do not forget to inform the user about your progress.
int steps = 10;
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Doing something important", steps ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Doing something important", steps ) );
m_progress->addSubProgress( progress1 );
for( int i = 0; i < steps; ++i )
{
......
......@@ -373,7 +373,7 @@ void WMTriangleMeshRenderer::renderMesh( boost::shared_ptr< WTriangleMesh > mesh
getIntervallCenterMiddle( minZ, maxZ ) );
// start rendering
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Rendering", 3 ) );
boost::shared_ptr< WProgress > progress( new WProgress( "Rendering", 3 ) );
m_progress->addSubProgress( progress );
if( m_mainComponentOnly->get( true ) )
......
......@@ -139,7 +139,7 @@ void WMVectorPlot::moduleMain()
break;
}
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Vector Plot", 2 ) );
boost::shared_ptr< WProgress > progress( new WProgress( "Vector Plot", 2 ) );
m_progress->addSubProgress( progress );
boost::shared_ptr< WDataSetVector > newDataSet = m_input->getData();
......
......@@ -183,7 +183,7 @@ private:
template< typename ValueType >
osg::ref_ptr<wosg::Geometry> WMVectorPlot::buildPlotSlices()
{
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Vector Plot", 4 ) );
boost::shared_ptr< WProgress > progress( new WProgress( "Vector Plot", 4 ) );
m_progress->addSubProgress( progress );
WPosition current = WKernel::getRunningKernel()->getSelectionManager()->getCrosshair()->getPosition();
......
......@@ -335,7 +335,7 @@ std::vector< boost::shared_ptr< WTriangleMesh > >WMWriteMesh::splitMesh( boost::
while( currentTri < triMesh->triangleSize() )
{
boost::shared_ptr< WTriangleMesh > newMesh = boost::shared_ptr< WTriangleMesh >( new WTriangleMesh( 0, 0 ) );
boost::shared_ptr< WTriangleMesh > newMesh( new WTriangleMesh( 0, 0 ) );
std::vector<int>newIds( triMesh->vertSize(), -1 );
while( newMesh->vertSize() < targetSize )
{
......
......@@ -156,7 +156,7 @@ void WMWriteRawData::moduleMain()
if( m_dataSet && ( dataSetChanged || m_dataFile->changed() ) )
{
debugLog() << "Writing " << m_dataFile->get().string() << ".";
boost::shared_ptr< WProgress > progress = boost::shared_ptr< WProgress >( new WProgress( "Write File", 2 ) );
boost::shared_ptr< WProgress > progress( new WProgress( "Write File", 2 ) );
m_progress->addSubProgress( progress );
// call visitor for this job
......
......@@ -521,7 +521,7 @@ bool WMWriteTracts::savePOVRay( boost::shared_ptr< const WDataSetFibers > fibers
size_t currentStart = 0;
size_t increment = m_povraySaveOnlyNth->get();
boost::shared_ptr< WProgress > progress1 = boost::shared_ptr< WProgress >( new WProgress( "Converting fibers", fibStart->size() / increment ) );
boost::shared_ptr< WProgress > progress1( new WProgress( "Converting fibers", fibStart->size() / increment ) );
m_progress->addSubProgress( progress1 );
for( size_t fidx = 0; fidx < fibStart->size(); fidx += increment )
{
......
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