예제 #1
0
void QmitkScalarBarOverlay::GetProperties( mitk::PropertyList::Pointer pl )
{
  if ( pl.IsNull() )
    return;

  QPen pen = QPen();


  mitk::PropertyList::Pointer propertyList = pl;
  QPalette palette = QPalette();

  // get the desired color of the textOverlays
  mitk::ColorProperty::Pointer colorProp =
    dynamic_cast<mitk::ColorProperty*>( propertyList->GetProperty( "overlay.color" ) );

  if ( colorProp.IsNull() )
  {
    MITK_DEBUG << "creating new colorProperty";
    colorProp = mitk::ColorProperty::New( 127.0, 196.0, 232.0 );
  }

  mitk::Color color = colorProp->GetColor();
  pen.setColor( QColor( color[0],color[1],color[2],255 ) );
  pen.setStyle( Qt::SolidLine );
  pen.setCapStyle( Qt::FlatCap );
  pen.setJoinStyle( Qt::MiterJoin );

  m_ScalarBar->SetPen( pen );
}
예제 #2
0
void QmitkTextOverlay::UpdateFontProperties( mitk::PropertyList::Pointer pl )
{
    if ( pl.IsNull() )
        return;

    mitk::PropertyList::Pointer propertyList = pl;
    QPalette palette = QPalette();
    QFont font = QFont();

    // get the desired color of the textOverlays
    mitk::ColorProperty::Pointer colorProp =
        dynamic_cast<mitk::ColorProperty*>( propertyList->GetProperty( "overlay.color" ) );

    if ( colorProp.IsNull() )
    {
        colorProp = mitk::ColorProperty::New( 127.0, 196.0, 232.0 );
    }

    mitk::Color color = colorProp->GetColor();
    palette.setColor( QPalette::Foreground, QColor( color[0],color[1],color[2],255 ) );
    palette.setColor( QPalette::Window, Qt::transparent);
    m_Label->setPalette( palette );

    // get the desired opacity of the overlays
    //mitk::FloatProperty::Pointer opacityProperty =
    //  dynamic_cast<mitk::FloatProperty*>( propertyList->GetProperty( "overlay.opacity" ) );

    //if ( opacityProperty.IsNull() )
    //{
    //  m_Label->setWindowOpacity( 1 );
    //}
    //else
    //{
    //  m_Label->setWindowOpacity( opacityProperty->GetValue() );
    //}

    //set the desired font-size of the overlays
    int fontSize = 0;
    if ( !propertyList->GetIntProperty( "overlay.fontSize", fontSize ) )
    {
        fontSize = 9;
    }
    font.setPointSize( fontSize );

    bool useKerning = false;
    if ( !propertyList->GetBoolProperty( "overlay.kerning", useKerning ) )
    {
        useKerning = true;
    }
    font.setKerning( useKerning );

    std::string fontFamily = "";
    if ( !propertyList->GetStringProperty( "overlay.fontFamily", fontFamily ) )
    {
        fontFamily = "Verdana";
    }
    font.setFamily(  QString(fontFamily.c_str()) );

    m_Label->setFont( font );
}
예제 #3
0
void QmitkScalarBarOverlay::GenerateData( mitk::PropertyList::Pointer pl )
{
  if ( pl.IsNull() )
    return;

  m_PropertyList = pl->Clone();

  if ( m_PropertyList.IsNotNull() )
  {
    this->SetupCallback( m_PropertyList->GetProperty( m_Id ) );

    this->GetProperties( pl );
    this->SetScaleFactor();
  }
  else
  {
    MITK_DEBUG << "invalid propList";
  }

}
예제 #4
0
void QmitkTextOverlay::GenerateData( mitk::PropertyList::Pointer pl )
{
  if ( pl.IsNull() )
    return;

  m_PropertyList = pl;

  if ( m_PropertyList.IsNotNull() )
  {
    this->SetupCallback( m_PropertyList->GetProperty( m_Id ) );

    this->GetTextProperties( pl );
    this->SetText();
  }
  else
  {
    MITK_ERROR << "invalid propList";
  }

}