Skip to content

Commit

Permalink
Merge branch 'comp_arm'
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Gelas committed Apr 19, 2011
2 parents 79ef39c + e9107b5 commit 48fdaed
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 35 deletions.
8 changes: 4 additions & 4 deletions Code/GUI/lib/QGoDBTraceManager.cxx
Expand Up @@ -375,10 +375,10 @@ double * QGoDBTraceManager::GetVectorFromQColor(QColor iColor)

iColor.getRgbF(&r, &g, &b, &a);
double *rgba = new double[4];
rgba[0] = r;
rgba[1] = g;
rgba[2] = b;
rgba[3] = a;
rgba[0] = static_cast< double >( r );
rgba[1] = static_cast< double >( g );
rgba[2] = static_cast< double >( b );
rgba[3] = static_cast< double >( a );
return rgba;
}

Expand Down
31 changes: 22 additions & 9 deletions Code/GUI/lib/QGoImageView.cxx
Expand Up @@ -200,11 +200,13 @@ QGoImageView::SetBackgroundColor(double rgb[3])
void
QGoImageView::SetBackgroundColor(const QColor & iColor)
{
double r, g, b;
qreal r, g, b;

iColor.getRgbF(&r, &g, &b);

this->SetBackgroundColor(r, g, b);
this->SetBackgroundColor( static_cast< double >( r ),
static_cast< double >( g ),
static_cast< double >( b ) );
}

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -704,23 +706,34 @@ QGoImageView::UpdateContourRepresentationProperties(float linewidth, QColor line
m_NodesColor = nodecolor;
m_ActiveNodesColor = activenodecolor;

double rl, gl, bl;
qreal rl, gl, bl;
linecolor.getRgbF(&rl, &gl, &bl);

double rn, gn, bn;
qreal rn, gn, bn;
nodecolor.getRgbF(&rn, &gn, &bn);

double ra, ga, ba;
qreal ra, ga, ba;
activenodecolor.getRgbF(&ra, &ga, &ba);

std::vector< vtkSmartPointer< vtkOrientedGlyphContourRepresentation > >::iterator
it = m_ContourRepresentation.begin();
while ( it != m_ContourRepresentation.end() )
{
( *it )->GetLinesProperty()->SetLineWidth(linewidth);
( *it )->GetLinesProperty()->SetColor(rl, gl, bl);
( *it )->GetProperty()->SetColor(rn, gn, bn);
( *it )->GetActiveProperty()->SetColor(ra, ga, ba);
( *it )->GetLinesProperty()->SetColor(
static_cast< double >( rl ),
static_cast< double >( gl ),
static_cast< double >( bl ) );

( *it )->GetProperty()->SetColor(
static_cast< double >( rn ),
static_cast< double >( gn ),
static_cast< double >( bn ) );

( *it )->GetActiveProperty()->SetColor(
static_cast< double >( ra ),
static_cast< double >( ga ),
static_cast< double >( ba ) );
++it;
}
}
Expand Down Expand Up @@ -761,4 +774,4 @@ QGoImageView::Update()
++it;
++i;
}
}
}
24 changes: 16 additions & 8 deletions Code/GUI/lib/QGoTabImageView4D.cxx
Expand Up @@ -1097,23 +1097,31 @@ QGoTabImageView4D::ChangeContourRepresentationProperty()
QColor activenodecolor; // =
// m_ManualSegmentationWidget->GetActiveNodesColor();

double rl, gl, bl;

qreal rl, gl, bl;
linecolor.getRgbF(&rl, &gl, &bl);

double rn, gn, bn;
qreal rn, gn, bn;
nodecolor.getRgbF(&rn, &gn, &bn);

double ra, ga, ba;
qreal ra, ga, ba;
activenodecolor.getRgbF(&ra, &ga, &ba);

for ( unsigned int i = 0; i < m_ContourRepresentation.size(); i++ )
{
m_ContourRepresentation[i]->GetLinesProperty()->SetLineWidth(linewidth);
m_ContourRepresentation[i]->GetLinesProperty()->SetColor(rl, gl, bl);

m_ContourRepresentation[i]->GetProperty()->SetColor(rn, gn, bn);
m_ContourRepresentation[i]->GetActiveProperty()->SetColor(ra, ga, ba);
m_ContourRepresentation[i]->GetLinesProperty()->SetColor(
static_cast< double >( rl ),
static_cast< double >( gl ),
static_cast< double >( bl ) );

m_ContourRepresentation[i]->GetProperty()->SetColor(
static_cast< double >( rn ),
static_cast< double >( gn ),
static_cast< double >( bn ) );
m_ContourRepresentation[i]->GetActiveProperty()->SetColor(
static_cast< double >( ra ),
static_cast< double >( ga ),
static_cast< double >( ba ) );
}
}

Expand Down
24 changes: 16 additions & 8 deletions Code/GUI/lib/QGoTabImageViewElementBase.cxx
Expand Up @@ -127,23 +127,31 @@ QGoTabImageViewElementBase::ChangeContourRepresentationProperty()
QColor nodecolor = m_NodesColor;
QColor activenodecolor = m_ActiveNodesColor;

double rl, gl, bl;

qreal rl, gl, bl;
linecolor.getRgbF(&rl, &gl, &bl);

double rn, gn, bn;
qreal rn, gn, bn;
nodecolor.getRgbF(&rn, &gn, &bn);

double ra, ga, ba;
qreal ra, ga, ba;
activenodecolor.getRgbF(&ra, &ga, &ba);

for ( unsigned int i = 0; i < m_ContourRepresentation.size(); i++ )
{
m_ContourRepresentation[i]->GetLinesProperty()->SetLineWidth(linewidth);
m_ContourRepresentation[i]->GetLinesProperty()->SetColor(rl, gl, bl);

m_ContourRepresentation[i]->GetProperty()->SetColor(rn, gn, bn);
m_ContourRepresentation[i]->GetActiveProperty()->SetColor(ra, ga, ba);
m_ContourRepresentation[i]->GetLinesProperty()->SetColor(
static_cast< double >( rl ),
static_cast< double >( gl ),
static_cast< double >( bl ) );

m_ContourRepresentation[i]->GetProperty()->SetColor(
static_cast< double >( rn ),
static_cast< double >( gn ),
static_cast< double >( bn ) );
m_ContourRepresentation[i]->GetActiveProperty()->SetColor(
static_cast< double >( ra ),
static_cast< double >( ga ),
static_cast< double >( ba ) );
}
}

Expand Down
12 changes: 6 additions & 6 deletions Code/GUI/lib/TraceContainerBase.txx
Expand Up @@ -466,7 +466,7 @@ TraceContainerBase< TContainer >::UpdateAllHighlightedElementsWithGivenColor(QCo
boost::tuples::tie(it0, it1) =
m_Container.get< Highlighted >().equal_range(true);

double r(1.), g(1.), b(1.), a(1.);
qreal r(1.), g(1.), b(1.), a(1.);

if ( iColor.isValid() )
{
Expand All @@ -478,10 +478,10 @@ TraceContainerBase< TContainer >::UpdateAllHighlightedElementsWithGivenColor(QCo
{
MultiIndexContainerElementType temp(*it0);

temp.rgba[0] = r;
temp.rgba[1] = g;
temp.rgba[2] = b;
temp.rgba[3] = a;
temp.rgba[0] = static_cast< double >( r );
temp.rgba[1] = static_cast< double >( g );
temp.rgba[2] = static_cast< double >( b );
temp.rgba[3] = static_cast< double >( a );

m_Container.get< Highlighted >().replace(it0, temp);

Expand Down Expand Up @@ -993,4 +993,4 @@ TraceContainerBase< TContainer >::GetCollectionIDOfGivenTraceID(unsigned int iTr

//-------------------------------------------------------------------------

#endif
#endif

0 comments on commit 48fdaed

Please sign in to comment.