return( -1 );
this->m_Blender->AddInputConnection( aout );
this->_ConfigureBinaryImage( r, g, b );
- return( this->m_Blender->GetNumberOfInputPorts( ) - 1 );
+ return( this->m_Blender->GetNumberOfInputs( ) - 1 );
}
// -------------------------------------------------------------------------
return( -1 );
this->m_Blender->AddInputData( data );
this->_ConfigureBinaryImage( r, g, b );
- return( this->m_Blender->GetNumberOfInputPorts( ) - 1 );
+ return( this->m_Blender->GetNumberOfInputs( ) - 1 );
}
// -------------------------------------------------------------------------
#include <QTreeWidgetItem>
#include <vtkRendererCollection.h>
+double cpPlugins::Interface::BaseMPRWidget::
+cm_Colors[ 8 ][ 3 ] =
+{
+ { 1.0, 0.0, 0.0 },
+ { 0.0, 1.0, 0.0 },
+ { 0.0, 0.0, 1.0 },
+ { 0.0, 1.0, 1.0 },
+ { 1.0, 0.0, 1.0 },
+ { 1.0, 1.0, 0.0 },
+ { 1.0, 0.5, 0.0 },
+ { 1.0, 0.0, 0.5 }
+};
+
// -------------------------------------------------------------------------
cpPlugins::Interface::BaseMPRWidget::
BaseMPRWidget( QWidget* parent )
this->m_MPRObjects->SetInputImage( iIt->second.Image );
else
{
- std::cout << this->m_MPRObjects->GetNumberOfImages( ) << std::endl;
-
-
- this->m_MPRObjects->AddBinaryImage( iIt->second.Image, 1, 0, 0 );
+ unsigned int i = ( this->m_MPRObjects->GetNumberOfImages( ) - 1 ) % 8;
+ this->m_MPRObjects->AddBinaryImage(
+ iIt->second.Image,
+ Self::cm_Colors[ i ][ 0 ],
+ Self::cm_Colors[ i ][ 1 ],
+ Self::cm_Colors[ i ][ 2 ]
+ );
}
this->m_MPRObjects->Show( );
}
Q_OBJECT;
public:
+ typedef BaseMPRWidget Self;
typedef cpExtensions::Visualization::MPRObjects TMPRObjects;
typedef TMPRObjects::TStyle TStyle;
if( i != this->m_Parameters.end( ) )
{
if( i->second.first == Self::Real )
- return( TReal( std::atof( i->second.second.second.c_str( ) ) ) );
+ {
+ std::istringstream tok_str( i->second.second.second );
+ float v;
+ tok_str >> v;
+ return( TReal( v ) );
+
+ } // fi
} // fi
return( TReal( 0 ) );
std::istringstream str( i->second.second.second );
std::string token;
while( std::getline( str, token, '#' ) )
- lst.push_back( TReal( std::atof( token.c_str( ) ) ) );
+ {
+ std::istringstream tok_str( token );
+ float v;
+ tok_str >> v;
+ lst.push_back( TReal( v ) );
+
+ } // elihw
}
// -------------------------------------------------------------------------
unsigned int d = 0;
while( std::getline( str, token, ';' ) && d < dim )
{
- v[ d ] = std::atof( token.c_str( ) );
+ std::istringstream tok_str( token );
+ tok_str >> v[ d ];
d++;
} // elihw
unsigned int d = 0;
while( std::getline( str, token, ';' ) && d < dim )
{
- v[ d ] = std::atof( token.c_str( ) );
+ std::istringstream tok_str( token );
+ tok_str >> v[ d ];
d++;
} // elihw
P v;
while( std::getline( str2, token2, ';' ) && d < dim )
{
- v[ d ] = std::atof( token.c_str( ) );
+ std::istringstream tok_str( token );
+ tok_str >> v[ d ];
d++;
} // elihw
V v;
while( std::getline( str2, token2, ';' ) && d < dim )
{
- v[ d ] = std::atof( token.c_str( ) );
+ std::istringstream tok_str( token );
+ tok_str >> v[ d ];
d++;
} // elihw
double center[ 3 ], normal[ 3 ];
wdg->GetCenter( center );
wdg->GetNormal( normal );
+
this->m_Filter->GetParameters( )->SetPoint( "PlaneCenter", 3, center );
this->m_Filter->GetParameters( )->SetVector( "PlaneNormal", 3, normal );