コード例 #1
0
void QmitkScalarBarOverlay::SetupCallback( mitk::BaseProperty::Pointer prop )
{

  if ( m_ObservedProperty != prop && m_ObserverTag == 0 )
  {
    if ( prop.IsNotNull() )
    {
      if ( m_ObservedProperty.IsNotNull() )
      {
        m_ObservedProperty->RemoveObserver( m_ObserverTag );
      }

      typedef itk::SimpleMemberCommand< QmitkScalarBarOverlay > MemberCommandType;
      MemberCommandType::Pointer propModifiedCommand;
      propModifiedCommand = MemberCommandType::New();
      propModifiedCommand->SetCallbackFunction( this, &QmitkScalarBarOverlay::SetScaleFactor );
      m_ObserverTag = prop->AddObserver( itk::ModifiedEvent(), propModifiedCommand );
    }

    m_ObservedProperty = prop;
  }
  else
  {
    MITK_DEBUG << "invalid property";
  }
}
コード例 #2
0
void QmitkTextOverlay::SetupCallback( mitk::BaseProperty::Pointer prop )
{
  if ( prop.IsNotNull() )
  {
    typedef itk::SimpleMemberCommand< QmitkTextOverlay > MemberCommandType;
    MemberCommandType::Pointer propModifiedCommand;
    propModifiedCommand = MemberCommandType::New();
    propModifiedCommand->SetCallbackFunction( this, &QmitkTextOverlay::SetText );
    m_ObserverTag = prop->AddObserver( itk::ModifiedEvent(), propModifiedCommand );
  }
  else
  {
    MITK_DEBUG << "invalid property";
  }
}