예제 #1
0
void RootManager::uninitializeRootObject()
{
    SLM_TRACE_FUNC();
    SLM_WARN_IF("(Hack) Sorry, the OSR must be initialized to uninitialize it. ToDo => transform in assert", ! getDefault()->m_isRootInitialized );
    if ( getDefault()->m_isRootInitialized )
    {
        // Setting initialization to false
        getDefault()->m_isRootInitialized = false ;

        assert( getDefault()->m_rootObjectConfigurationName.first ) ;
        // Stop services reported in m_rootObjectConfiguration before stopping everything

        //::fwServices::stopAndUnregister(getDefault()->m_rootObjectConfiguration) ;
        getDefault()->m_ctm->stopAndDestroy();

        OSLM_WARN_IF("Sorry, few services still exist before erasing root object ( cf debug following message )"
                << std::endl << ::fwServices::OSR::getRegistryInformation(),
                ! ::fwServices::OSR::getKSContainer().empty());

        //::fwServices::GlobalEventManager::getDefault()->clearMessages();

        SLM_TRACE("uninitializeRootObject : Reset the last shared_ptr on root object.");

        // Reset the root object: involve complete m_container clearing
        //getDefault()->m_rootObject.reset();
        //assert( getDefault()->m_rootObject.use_count() == 0 );

//        ::fwRuntime::profile::Profile::sptr profile = ::fwRuntime::profile::getCurrentProfile();
//        SLM_TRACE("Stopping Profile");
//        profile->stop();
//        SLM_TRACE("Profile Stopped");
    }
}
예제 #2
0
void TransferFunction::toVtkLookupTable(
        ::fwData::TransferFunction::sptr tf,
         vtkSmartPointer<vtkLookupTable> lt,
        bool allowTransparency,
        unsigned int size )
{
    SLM_WARN_IF( "Sorry, This transfer function conversion not managed clamped TF.", tf->getIsClamped() );

    // Configures basic parameters
    lt->SetNumberOfTableValues( size );
    lt->SetScaleToLinear();


    ::fwData::TransferFunction::TFValuePairType minMax = tf->getMinMaxTFValues();

    lt->SetTableRange( minMax.first, minMax.second );

    double delta = ( minMax.second - minMax.first ) / (double) (size - 1);
    ::fwData::TransferFunction::TFColor interpolatedColor;

    if ( allowTransparency )
    {
        for( unsigned int k=0; k<size; ++k )
        {
            interpolatedColor = tf->getInterpolatedColor( k*delta + minMax.first );
            lt->SetTableValue(k, interpolatedColor.r, interpolatedColor.g, interpolatedColor.b, interpolatedColor.a);
        }
    }
    else
    {
        for( unsigned int k=0; k<size; ++k )
        {
            interpolatedColor = tf->getInterpolatedColor( k*delta + minMax.first );
            lt->SetTableValue(k, interpolatedColor.r, interpolatedColor.g, interpolatedColor.b, 1.0);
        }
    }

    lt->Modified();
}
예제 #3
0
void Application::exit(int returncode)
{
    SLM_WARN_IF("returncode is actually ignored in fwGuiWx", returncode != 0);
    wxExit();
}