Commit 74c70b94 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[FIX] fixed several compilation warnings, mainly related to implicit casts of shared_ptr to bool.

parent 6fe96969
......@@ -61,7 +61,7 @@ std::ostream& operator<<( std::ostream& os, const RealEigenSystem& sys );
*
* \param es Eigensystem consisting of eigenvalues and eigenvectors.
*/
void sortRealEigenSystem( RealEigenSystem* es )
inline void sortRealEigenSystem( RealEigenSystem* es )
{
if( ( *es )[0].first > ( *es )[2].first )
{
......
......@@ -111,7 +111,7 @@ void WMHARDIToSphericalHarmonics::moduleMain()
boost::shared_ptr< WDataSetRawHARDI > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
switch( m_reconstructionTypeProp->get( true ).getItemIndexOfSelected( 0 ) )
{
......
......@@ -121,7 +121,7 @@ void WMAnisotropicFiltering::moduleMain()
boost::shared_ptr< WDataSetSingle > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
if( dataValid )
{
......
......@@ -282,7 +282,7 @@ void WMClusterDisplayVoxels::moduleMain()
boost::shared_ptr< WDataSetSingle > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
if( dataValid )
{
......
......@@ -148,7 +148,7 @@ void WMDatasetProfile::moduleMain()
boost::shared_ptr< WDataSetScalar > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
if( dataValid )
{
......
......@@ -244,7 +244,7 @@ void WMDirectVolumeRendering::moduleMain()
// was there an update?
bool dataUpdated = m_input->updated() || m_gradients->updated();
boost::shared_ptr< WDataSetScalar > dataSet = m_input->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
bool propUpdated = m_localIlluminationAlgo->changed() || m_stochasticJitterEnabled->changed() || m_opacityCorrectionEnabled->changed() ||
m_maximumIntensityProjectionEnabled->changed() || m_depthProjectionEnabled->changed();
......
......@@ -319,7 +319,7 @@ void WMFiberDisplay::moduleMain()
boost::shared_ptr< WDataSetFibers > fibers = m_fiberInput->getData();
boost::shared_ptr< WDataSetFiberClustering > fiberClustering = m_fiberClusteringInput->getData();
bool dataValid = ( fibers );
bool dataValid = ( fibers != NULL );
bool dataPropertiesUpdated = propObserver->updated();
bool propertiesUpdated = m_tubeEnable->changed() || m_plainColorMode->changed() || m_plainColor->changed();
......
......@@ -103,7 +103,7 @@ void WMFiberFilterIndex::moduleMain()
// Remember the above criteria. We now need to check if the data is valid. After a connect-update, it might be NULL.
boost::shared_ptr< WDataSetFibers > dataSet = m_input->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
bool dataChanged = dataSet != m_fibers;
// do something with the data
......
......@@ -101,7 +101,7 @@ void WMFiberFilterROI::moduleMain()
// Remember the above criteria. We now need to check if the data is valid. After a connect-update, it might be NULL.
boost::shared_ptr< WDataSetFibers > dataSet = m_input->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
bool dataChanged = dataSet != m_fibers;
// do something with the data
......
......@@ -150,7 +150,7 @@ void WMFiberParameterColoring::moduleMain()
// To query whether an input was updated, simply ask the input:
bool dataUpdated = m_fiberInput->handledUpdate();
boost::shared_ptr< WDataSetFibers > dataSet = m_fiberInput->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
bool propUpdated = m_baseColor->changed() || m_scaleColor->changed();
// reset everything if input was disconnected/invalid
......
......@@ -130,7 +130,7 @@ void WMFibersToPoints::moduleMain()
// To query whether an input was updated, simply ask the input:
bool dataUpdated = m_fiberInput->handledUpdate();
boost::shared_ptr< WDataSetFibers > dataSet = m_fiberInput->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
bool propsChanged = m_parametersFilterValue->changed() ||
m_parametersFilterWidth->changed() ||
m_color->changed();
......
......@@ -104,7 +104,7 @@ void WMGridRenderer::moduleMain()
m_moduleState.wait();
boost::shared_ptr< WDataSet > dataSet = m_input->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
bool dataChanged = ( dataSet != m_dataSet );
m_dataSet = dataSet;
......
......@@ -1210,7 +1210,7 @@ bool WHtree::writeTree( const std::string &filename, const bool niftiMode ) cons
std::ofstream outFile( filename.c_str() );
if( !outFile )
{
std::cerr << "ERROR: unable to open out file: \"" << outFile << "\"" << std::endl;
std::cerr << "ERROR: unable to open out file: \"" << filename << "\"" << std::endl;
exit( -1 );
}
......@@ -1344,7 +1344,7 @@ bool WHtree::writeTreeDebug( const std::string &filename ) const
std::ofstream outFile( filename.c_str() );
if( !outFile )
{
std::cerr << "ERROR: unable to open out file: \"" << outFile << "\"" << std::endl;
std::cerr << "ERROR: unable to open out file: \"" << filename << "\"" << std::endl;
exit( -1 );
}
......@@ -1380,7 +1380,7 @@ bool WHtree::writeTreeOldWalnut( const std::string &filename ) const
std::ofstream outFile( filename.c_str() );
if( !outFile )
{
std::cerr << "ERROR: unable to open out file: \"" << outFile << "\"" << std::endl;
std::cerr << "ERROR: unable to open out file: \"" << filename << "\"" << std::endl;
exit( -1 );
}
......@@ -1422,7 +1422,7 @@ bool WHtree::writeTreeSimple( const std::string &filename ) const
std::ofstream outFile( filename.c_str() );
if( !outFile )
{
std::cerr << "ERROR: unable to open out file: \"" << outFile << "\"" << std::endl;
std::cerr << "ERROR: unable to open out file: \"" << filename << "\"" << std::endl;
exit( -1 );
}
......
......@@ -879,7 +879,7 @@ void WMHierchClustDisplay::moduleMain()
}
boost::shared_ptr< WDataSetSingle > newDataSet = m_input->getData();
bool dataChanged = ( m_anatomy != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
if( dataValid )
{
if( dataChanged )
......
......@@ -141,7 +141,7 @@ void WMPartition2Mesh::moduleMain()
boost::shared_ptr< WDataSetScalar > newCoordVector = m_coordInput->getData();
bool coordsChanged = ( m_coordinateVector != newCoordVector );
bool coordsValid = ( newCoordVector );
bool coordsValid = ( newCoordVector != NULL );
if( coordsValid )
{
......@@ -154,7 +154,7 @@ void WMPartition2Mesh::moduleMain()
boost::shared_ptr< WDataSetVector > newColorVector = m_colorInput->getData();
bool colorsChanged = ( m_colorVector != newColorVector );
bool colorsValid = ( newColorVector );
bool colorsValid = ( newColorVector != NULL );
if( colorsValid )
{
......@@ -167,7 +167,7 @@ void WMPartition2Mesh::moduleMain()
boost::shared_ptr< WTriangleMesh > newRefMesh = m_meshInput1->getData();
bool refMeshChanged = ( m_referenceMesh != newRefMesh );
bool refMeshValid = ( newRefMesh );
bool refMeshValid = ( newRefMesh != NULL );
if( refMeshValid )
{
......@@ -181,7 +181,7 @@ void WMPartition2Mesh::moduleMain()
boost::shared_ptr< WTriangleMesh > newOutMesh = m_meshInput2->getData();
bool outMeshChanged = ( m_outMesh != newOutMesh );
bool outMeshValid = ( newOutMesh );
bool outMeshValid = ( newOutMesh != NULL );
if( outMeshValid )
{
......
......@@ -128,7 +128,7 @@ void WMImageExtractor::moduleMain()
boost::shared_ptr< WDataSetSingle > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
if( dataValid )
{
......
......@@ -223,7 +223,7 @@ void WMIsosurfaceRaytracer::moduleMain()
// was there an update?
bool dataUpdated = m_input->updated() || m_gradients->updated();
boost::shared_ptr< WDataSetScalar > dataSet = m_input->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
// valid data available?
if( !dataValid )
......
......@@ -180,7 +180,7 @@ void WMMeshToPoints::moduleMain()
// To query whether an input was updated, simply ask the input:
bool dataUpdated = m_meshInput->handledUpdate();
boost::shared_ptr< WTriangleMesh > dataSet = m_meshInput->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
bool propsChanged = m_doRefinement->changed() || m_maxIterations->changed() || m_minDistance->changed();
// reset everything if input was disconnected/invalid
......
......@@ -280,7 +280,7 @@ void WMOpenIGTLinkSender::moduleMain()
{
debugLog() << "prepare sending new data";
WDataSetScalarSPtr dataSet = m_input->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
if( dataValid )
{
......
......@@ -150,7 +150,7 @@ void WMPaintTexture::moduleMain()
boost::shared_ptr< WDataSetSingle > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
if( dataValid )
{
......
......@@ -127,7 +127,7 @@ void WMSampleOnFibers::moduleMain()
// To query whether an input was updated, simply ask the input:
bool dataUpdated = m_fiberInput->handledUpdate();
boost::shared_ptr< WDataSetFibers > dataSet = m_fiberInput->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
bool propsChanged = m_parameter ||
m_color->changed();
......
......@@ -139,7 +139,7 @@ void WMScalarSegmentation::moduleMain()
boost::shared_ptr< WDataSetScalar > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
if( dataChanged && dataValid )
{
......
......@@ -116,7 +116,7 @@ void WMSpatialDerivative::moduleMain()
bool dataUpdated = m_scalarIn->handledUpdate() || m_normalize->changed();
boost::shared_ptr< WDataSetScalar > dataSet = m_scalarIn->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
// reset output if input was reset/disconnected
if( !dataValid )
......
......@@ -440,7 +440,7 @@ void WMSuperquadricGlyphs::moduleMain()
// has the data changes? And even more important: is it valid?
boost::shared_ptr< WDataSetDTI > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
// if data is invalid, remove rendering
if( !dataValid )
......
......@@ -498,7 +498,7 @@ void WMTemplate::moduleMain()
// Remember the above criteria. We now need to check if the data is valid. After a connect-update, it might be NULL.
boost::shared_ptr< WDataSetSingle > dataSet = m_input->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
// After calling getData(), the update flag is reset and false again. Please keep in mind, that the module lives in an multi-threaded
// world where the update flag and data can change at any time. DO NEVER use getData directly in several places of your module as the
// data returned may change between two consecutive calls! Always grab it into a local variable and use this variable.
......
......@@ -132,7 +132,7 @@ void WMTransferFunction1D::moduleMain()
if( m_input->updated() || m_binSize->changed() )
{
boost::shared_ptr< WDataSetSingle > dataSet= m_input->getData();
bool dataValid = ( dataSet );
bool dataValid = ( dataSet != NULL );
if( !dataValid )
{
// FIXME: invalidate histogram in GUI
......
......@@ -141,7 +141,7 @@ void WMVectorPlot::moduleMain()
boost::shared_ptr< WDataSetVector > newDataSet = m_input->getData();
bool dataChanged = ( m_dataSet != newDataSet );
bool dataValid = ( newDataSet );
bool dataValid = ( newDataSet != NULL );
if( dataChanged && dataValid )
{
......
......@@ -167,7 +167,7 @@ void WMVoxelizer::moduleMain()
while( !m_shutdownFlag() ) // loop until the module container requests the module to quit
{
bool selectionPresent = m_clusterIC->getData();
bool selectionPresent = ( m_clusterIC->getData() != NULL );
if( !m_tractIC->getData() )
{
......
......@@ -625,7 +625,7 @@ bool WMWriteTracts::savePOVRay( boost::shared_ptr< const WDataSetFibers > fibers
"}" << std::endl << std::endl;
}
dataFileScene << "// Enable Phong lighting for all the geometry" << std::endl <<
dataFileScene << "// Enable Phong lighting for all the geometry" << std::endl;
dataFileScene << "#default{" << std::endl <<
" finish{" << std::endl <<
" ambient 0" << std::endl <<
......
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