Commit 01988446 by Sebastian Eichelbaum

[CHANGE] - removed additional clone method from reichenbach and made WMData to use with new one.

parent d494805a
......@@ -119,7 +119,3 @@ boost::shared_ptr< WProperties > WDataSet::getInformationProperties() const
return m_infoProperties;
}
boost::shared_ptr< WDataSet > WDataSet::clone( boost::shared_ptr< WValueSetBase >, boost::shared_ptr< WGrid > ) const
{
return boost::shared_ptr< WDataSet >();
}
......@@ -149,15 +149,6 @@ public:
*/
boost::shared_ptr< WProperties > getInformationProperties() const;
/**
* Returns a new dataset with the given valueset and grid that is of the same type as this dataset.
*
* \param vs The valueset.
* \param grid The grid.
* \return The new dataset.
*/
virtual boost::shared_ptr< WDataSet > clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const;
protected:
/**
......
......@@ -64,8 +64,3 @@ wmath::WTensorSym< 2, 3, float > WDataSetDTI::getTensor( size_t index ) const
return wmath::WTensorSym< 2, 3, float >( values->getWValue( index ) );
}
boost::shared_ptr< WDataSet > WDataSetDTI::clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const
{
return boost::shared_ptr< WDataSet >( new WDataSetDTI( vs, grid ) );
}
......@@ -89,15 +89,6 @@ public:
*/
wmath::WTensorSym< 2, 3, float > getTensor( size_t index ) const;
/**
* Returns a new dataset with the given valueset and grid that is of the same type as this dataset.
*
* \param vs The valueset.
* \param grid The grid.
* \return The new dataset.
*/
virtual boost::shared_ptr< WDataSet > clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const;
protected:
/**
* The prototype as singleton.
......
......@@ -167,7 +167,3 @@ boost::shared_ptr< const WValueSetHistogram > WDataSetScalar::getHistogram( size
return m_histograms[ buckets ];
}
boost::shared_ptr< WDataSet > WDataSetScalar::clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const
{
return boost::shared_ptr< WDataSet >( new WDataSetScalar( vs, grid ) );
}
......@@ -149,15 +149,6 @@ public:
*/
static boost::shared_ptr< WPrototyped > getPrototype();
/**
* Returns a new dataset with the given valueset and grid that is of the same type as this dataset.
*
* \param vs The valueset.
* \param grid The grid.
* \return The new dataset.
*/
virtual boost::shared_ptr< WDataSet > clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const;
protected:
/**
......
......@@ -170,7 +170,3 @@ double WDataSetSingle::getValueAt( size_t id ) const
return 0.0; // should not be reached. Just there to quiet compiler.
}
boost::shared_ptr< WDataSet > WDataSetSingle::clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const
{
return boost::shared_ptr< WDataSet >( new WDataSetSingle( vs, grid ) );
}
......@@ -176,15 +176,6 @@ public:
*/
static boost::shared_ptr< WPrototyped > getPrototype();
/**
* Returns a new dataset with the given valueset and grid that is of the same type as this dataset.
*
* \param vs The valueset.
* \param grid The grid.
* \return The new dataset.
*/
virtual boost::shared_ptr< WDataSet > clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const;
protected:
/**
......
......@@ -151,7 +151,3 @@ bool WDataSetSphericalHarmonics::isTexture() const
return false;
}
boost::shared_ptr< WDataSet > WDataSetSphericalHarmonics::clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const
{
return boost::shared_ptr< WDataSet >( new WDataSetSphericalHarmonics( vs, grid ) );
}
......@@ -137,15 +137,6 @@ public:
*/
virtual bool isTexture() const;
/**
* Returns a new dataset with the given valueset and grid that is of the same type as this dataset.
*
* \param vs The valueset.
* \param grid The grid.
* \return The new dataset.
*/
virtual boost::shared_ptr< WDataSet > clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const;
protected:
/**
......
......@@ -167,7 +167,3 @@ bool WDataSetVector::isTexture() const
return true;
}
boost::shared_ptr< WDataSet > WDataSetVector::clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const
{
return boost::shared_ptr< WDataSet >( new WDataSetVector( vs, grid ) );
}
......@@ -124,15 +124,6 @@ public:
*/
boost::shared_ptr< WDataSetVector > isVectorDataSet();
/**
* Returns a new dataset with the given valueset and grid that is of the same type as this dataset.
*
* \param vs The valueset.
* \param grid The grid.
* \return The new dataset.
*/
virtual boost::shared_ptr< WDataSet > clone( boost::shared_ptr< WValueSetBase > vs, boost::shared_ptr< WGrid > grid ) const;
protected:
/**
......
......@@ -317,6 +317,8 @@ void WMData::moduleMain()
m_output->updateData( m_dataSet );
ready();
WDataSetSingle::SPtr dataSetAsSingle = boost::shared_dynamic_cast< WDataSetSingle >( m_dataSet );
while( !m_shutdownFlag() )
{
m_moduleState.wait();
......@@ -325,13 +327,12 @@ void WMData::moduleMain()
break;
}
// change transform matrix
if( m_matrixSelection->changed() )
// change transform matrix (only if we have a dataset single which contains the grid)
if( m_matrixSelection->changed() && dataSetAsSingle )
{
// a new grid
boost::shared_ptr< WGrid > newGrid;
boost::shared_ptr< WDataSetSingle > ds = boost::shared_dynamic_cast< WDataSetSingle >( m_dataSet );
boost::shared_ptr< WGridRegular3D > oldGrid = boost::shared_dynamic_cast< WGridRegular3D >( ds->getGrid() );
boost::shared_ptr< WGridRegular3D > oldGrid = boost::shared_dynamic_cast< WGridRegular3D >( dataSetAsSingle->getGrid() );
switch( m_matrixSelection->get( true ).getItemIndexOfSelected( 0 ) )
{
......@@ -349,22 +350,7 @@ void WMData::moduleMain()
break;
}
if( boost::shared_dynamic_cast< WDataSetRawHARDI >( m_dataSet ) )
{
typedef std::vector< wmath::WVector3D > OrientationType;
// hardi datasets are a morre difficult case because of additional parameters
boost::shared_ptr< WDataSetRawHARDI > hardi = boost::shared_dynamic_cast< WDataSetRawHARDI >( m_dataSet );
m_dataSet = boost::shared_ptr< WDataSet >(
new WDataSetRawHARDI( hardi->getValueSet(), newGrid,
boost::shared_ptr< OrientationType >( new OrientationType( hardi->getOrientations() ) ),
hardi->getDiffusionBValue() ) );
// TODO( reichenbach ): remove copying orientations
}
else
{
// this creates a dataset of the same type as m_dataSet without explicit knowledge of the correct type
m_dataSet = m_dataSet->clone( ds->getValueSet(), newGrid );
}
m_dataSet = dataSetAsSingle->clone( newGrid );
// the clone() may have returned a zero-pointer, only update if it hasn't
// this may happen if the clone() operation has not been implemented in the derived dataset class
......
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