<commit_before>/*
 * datasetfibers.cpp
 *
 * Created on: Dec 12, 2012
 * @author <NAME>
 */
#include "datasetfibers.h"

#include "fiberselector.h"
#include "../models.h"

#include "../properties/propertybool.h"
#include "../properties/propertycolor.h"
#include "../properties/propertyint.h"
#include "../properties/propertyfloat.h"
#include "../properties/propertypath.h"
#include "../properties/propertystring.h"
#include "../properties/propertyselection.h"

#include "../loadervtk.h"
#include "../../gui/gl/fiberrenderer.h"
#include "../../gui/gl/tuberenderer.h"

#include <QTimer>


DatasetFibers::DatasetFibers( QDir filename, Fn::DatasetType type ) :
    Dataset( filename, type ),
    m_renderer( 0 ),
    m_tubeRenderer( 0 ),
    m_selector( 0 ),
    m_numPoints( 0 ),
    m_numLines( 0 )
{

}

DatasetFibers::DatasetFibers( QDir filename, QVector< QVector< float > > fibs ) :
    Dataset( filename, Fn::DatasetType::FIBERS ),
    m_fibs( fibs ),
    m_renderer( 0 ),
    m_tubeRenderer( 0 ),
    m_selector( 0 ),
    m_numPoints( 0 ),
    m_numLines( 0 )
{
    QVector<QVector<float> >data0;
    QVector<float>min0;
    QVector<float>max0;
    data0.reserve( fibs.size() );
    for ( int i = 0; i < fibs.size(); ++i )
    {
        data0.push_back( QVector<float>( fibs[i].size() / 3 ) );
    }
    m_data.push_back( data0 );
    m_dataNames.push_back( "no data" );

    createProps();
}

DatasetFibers::DatasetFibers( QDir filename,
                                 QVector< QVector< float > > fibs,
                                 QVector< QVector< QVector< float > > >data,
                                 QVector<QString>dataNames,
                                 QVector< float > mins,
                                 QVector<float> maxes ) :
    Dataset( filename, Fn::DatasetType::FIBERS ),
    m_fibs( fibs ),
    m_data( data ),
    m_dataNames( dataNames ),
    m_dataMins( mins ),
    m_dataMaxes( maxes ),
    m_renderer( 0 ),
    m_tubeRenderer( 0 ),
    m_selector( 0 ),
    m_numPoints( 0 ),
    m_numLines( 0 )
{
    createProps();
}

DatasetFibers::DatasetFibers( QDir filename, LoaderVTK* lv ) :
    Dataset( filename, Fn::DatasetType::FIBERS ),
    m_renderer( 0 ),
    m_tubeRenderer( 0 ),
    m_selector( 0 ),
    m_numPoints( 0 ),
    m_numLines( 0 )
{
    copyFromLoader( lv );

    createProps();
}

DatasetFibers::~DatasetFibers()
{
    m_properties["maingl"]->set( Fn::Property::D_ACTIVE, false );
    m_properties["maingl2"]->set( Fn::Property::D_ACTIVE, false );
    m_fibs.clear();
    m_fibs.squeeze();
    if ( m_renderer != 0 )
    {
        delete m_renderer;
        m_renderer = 0;
    }
    if ( m_tubeRenderer != 0 )
    {
        delete m_tubeRenderer;
        m_tubeRenderer = 0;
    }
}

void DatasetFibers::createProps()
{
    for ( int i = 0; i < m_fibs.size(); ++i )
    {
        m_numPoints += m_fibs[i].size() / 3;
    }
    bool hasData =(  m_dataNames[0] != "no data" );
    qDebug() << "num points:" << m_numPoints << "num lines:" << m_fibs.size();

    m_properties["maingl"]->createInt( Fn::Property::D_NUM_POINTS, m_numPoints );
    m_properties["maingl"]->createInt( Fn::Property::D_NUM_LINES, m_fibs.size() );
    m_properties["maingl"]->createList( Fn::Property::D_FIBER_RENDERMODE, {"lines", "tubes"}, 0, "general" );
    if ( hasData )
    {
        m_properties["maingl"]->createList( Fn::Property::D_COLORMODE, { "global", "local", "user defined", "mri", "data" }, 0, "general" );
        m_properties["maingl"]->createList( Fn::Property::D_DATAMODE, m_dataNames, 0, "general" );
    }
    else
    {
        m_properties["maingl"]->createList( Fn::Property::D_COLORMODE, { "global", "local", "user defined", "mri" }, 0, "general" );
        m_properties["maingl"]->createList( Fn::Property::D_DATAMODE, m_dataNames, 0 );
    }
    m_properties["maingl"]->createColor( Fn::Property::D_COLOR, QColor( 255, 0, 0 ), "color" );
    m_properties["maingl"]->createFloat( Fn::Property::D_ALPHA, 1.f, 0.01f, 1.f, "color" );
    m_properties["maingl"]->createFloat( Fn::Property::D_FIBER_THICKNESS, 1.0f, 0.1f, 5.0f, "general" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MIN, 0.0f );
    m_properties["maingl"]->createFloat( Fn::Property::D_MAX, 1.0f );

    if ( hasData )
    {
        m_properties["maingl"]->createInt( Fn::Property::D_COLORMAP, 1, "general" );
        m_properties["maingl"]->createFloat( Fn::Property::D_SELECTED_MIN, 0.0f, 0.0f, 1.0f, "color" );
        m_properties["maingl"]->createFloat( Fn::Property::D_SELECTED_MAX, 1.0f, 0.0f, 1.0f, "color" );
        m_properties["maingl"]->createFloat( Fn::Property::D_LOWER_THRESHOLD, 0.0f, 0.0f, 1.0f, "color" );
        m_properties["maingl"]->createFloat( Fn::Property::D_UPPER_THRESHOLD, 1.0f, 0.0f, 1.0f, "color" );
    }
    else
    {
        m_properties["maingl"]->createInt( Fn::Property::D_COLORMAP, 1 );
        m_properties["maingl"]->createFloat( Fn::Property::D_SELECTED_MIN, 0.0f, 0.0f, 1.0f );
        m_properties["maingl"]->createFloat( Fn::Property::D_SELECTED_MAX, 1.0f, 0.0f, 1.0f );
        m_properties["maingl"]->createFloat( Fn::Property::D_LOWER_THRESHOLD, 0.0f, 0.0f, 1.0f );
        m_properties["maingl"]->createFloat( Fn::Property::D_UPPER_THRESHOLD, 1.0f, 0.0f, 1.0f );
    }
    m_properties["maingl"]->createFloat( Fn::Property::D_DX, 200.0f, 0.0f, 200.0f, "special" );
    m_properties["maingl"]->createFloat( Fn::Property::D_DY, 200.0f, 0.0f, 200.0f, "special" );
    m_properties["maingl"]->createFloat( Fn::Property::D_DZ, 200.0f, 0.0f, 200.0f, "special" );
    m_properties["maingl"]->createInt( Fn::Property::D_NX, 800, 0, 1600, "special" );
    m_properties["maingl"]->createInt( Fn::Property::D_NY, 1000, 0, 2000, "special" );
    m_properties["maingl"]->createInt( Fn::Property::D_NZ, 800, 0, 1600, "special" );

    m_properties["maingl"]->createBool( Fn::Property::D_LIGHT_SWITCH, true, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_LIGHT_AMBIENT,   0.2f, 0.0f, 1.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_LIGHT_DIFFUSE,   0.45f, 0.0f, 1.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_LIGHT_SPECULAR,  0.5f, 0.0f, 1.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MATERIAL_AMBIENT,   2.0f, 0.0f, 10.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MATERIAL_DIFFUSE,   0.8f, 0.0f, 10.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MATERIAL_SPECULAR,  0.61f, 0.0f, 10.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MATERIAL_SHININESS, 2.0f, 0.0f, 200.0f, "light" );

    int maxLength = 0;
    for ( int i = 0; i < m_fibs.size(); ++i )
    {
        maxLength = qMax( maxLength, m_fibs[i].size() / 3 );
    }

    m_properties["maingl"]->createFloat( Fn::Property::D_FIBER_GROW_LENGTH, (float)maxLength, 0.0f, (float)maxLength, "special" );

    connect( m_properties["maingl"]->getProperty( Fn::Property::D_COLOR ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( colorChanged() ) );

    PropertyGroup* props2 = new PropertyGroup( *( m_properties["maingl"] ) );
    m_properties.insert( "maingl2", props2 );

    if ( hasData )
    {
        connect( m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MIN ), SIGNAL( valueChanged( QVariant ) ),
                      m_properties["maingl"]->getProperty( Fn::Property::D_LOWER_THRESHOLD ), SLOT( setMax( QVariant ) ) );
        connect( m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MAX ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl"]->getProperty( Fn::Property::D_UPPER_THRESHOLD ), SLOT( setMin( QVariant ) ) );

        connect( m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MIN ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MAX ), SLOT( setMin( QVariant ) ) );
        connect( m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MAX ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MIN ), SLOT( setMax( QVariant ) ) );

        connect( m_properties["maingl"]->getProperty( Fn::Property::D_DATAMODE ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( dataModeChanged() ) );

        connect( m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MIN ), SIGNAL( valueChanged( QVariant ) ),
                      m_properties["maingl2"]->getProperty( Fn::Property::D_LOWER_THRESHOLD ), SLOT( setMax( QVariant ) ) );
        connect( m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MAX ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl2"]->getProperty( Fn::Property::D_UPPER_THRESHOLD ), SLOT( setMin( QVariant ) ) );

        connect( m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MIN ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MAX ), SLOT( setMin( QVariant ) ) );
        connect( m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MAX ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MIN ), SLOT( setMax( QVariant ) ) );

        //connect( m_properties["maingl2"]->getProperty( Fn::Property::D_DATAMODE ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( dataModeChanged() ) );
    }

    m_properties["maingl"]->createList( Fn::Property::D_USE_TRANSFORM, { "user defined", "qform", "sform", "qform inverted", "sform inverted" }, 3, "transform" );
    connect( m_properties["maingl"]->getProperty( Fn::Property::D_USE_TRANSFORM ), SIGNAL( valueChanged( QVariant ) ), this,
                SLOT( transformChanged( QVariant ) ) );
    m_properties["maingl"]->createMatrix( Fn::Property::D_TRANSFORM, m_transform, "transform" );
    m_properties["maingl"]->createButton( Fn::Property::D_APPLY_TRANSFORM, "transform" );
    connect( m_properties["maingl"]->getProperty( Fn::Property::D_APPLY_TRANSFORM ), SIGNAL( valueChanged( QVariant ) ), this,
                SLOT( applyTransform() ) );

    m_properties["maingl"]->createBool( Fn::Property::D_AUTOPLAY, false, "autoplay" );
    m_properties["maingl"]->createInt( Fn::Property::D_AUTOPLAY_INTERVAL, 25, 10, 1000, "autoplay" );
    connect( m_properties["maingl"]->getProperty( Fn::Property::D_AUTOPLAY ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( autoplay() ) );

    transformChanged( 3 );
}

QVector< QVector< float > > DatasetFibers::getFibs()
{
    return m_fibs;
}

QVector< QVector< QVector< float > > > DatasetFibers::getData()
{
    return m_data;
}

QVector< QVector< float > > DatasetFibers::getData( int id )
{
    return m_data[id];
}

QVector< QVector< float > > DatasetFibers::getSelectedFibs()
{
    if ( m_renderer == 0 )
    {
        return m_fibs;
    }
    else
    {
        QVector<bool>*selected = m_selector->getSelection();
        QVector<QVector<float> >out;
        int first = 0;<commit_msg>made autoplay properties invisible in fiber dataset<commit_after>/*
 * datasetfibers.cpp
 *
 * Created on: Dec 12, 2012
 * @author <NAME>
 */
#include "datasetfibers.h"

#include "fiberselector.h"
#include "../models.h"

#include "../properties/propertybool.h"
#include "../properties/propertycolor.h"
#include "../properties/propertyint.h"
#include "../properties/propertyfloat.h"
#include "../properties/propertypath.h"
#include "../properties/propertystring.h"
#include "../properties/propertyselection.h"

#include "../loadervtk.h"
#include "../../gui/gl/fiberrenderer.h"
#include "../../gui/gl/tuberenderer.h"

#include <QTimer>


DatasetFibers::DatasetFibers( QDir filename, Fn::DatasetType type ) :
    Dataset( filename, type ),
    m_renderer( 0 ),
    m_tubeRenderer( 0 ),
    m_selector( 0 ),
    m_numPoints( 0 ),
    m_numLines( 0 )
{

}

DatasetFibers::DatasetFibers( QDir filename, QVector< QVector< float > > fibs ) :
    Dataset( filename, Fn::DatasetType::FIBERS ),
    m_fibs( fibs ),
    m_renderer( 0 ),
    m_tubeRenderer( 0 ),
    m_selector( 0 ),
    m_numPoints( 0 ),
    m_numLines( 0 )
{
    QVector<QVector<float> >data0;
    QVector<float>min0;
    QVector<float>max0;
    data0.reserve( fibs.size() );
    for ( int i = 0; i < fibs.size(); ++i )
    {
        data0.push_back( QVector<float>( fibs[i].size() / 3 ) );
    }
    m_data.push_back( data0 );
    m_dataNames.push_back( "no data" );

    createProps();
}

DatasetFibers::DatasetFibers( QDir filename,
                                 QVector< QVector< float > > fibs,
                                 QVector< QVector< QVector< float > > >data,
                                 QVector<QString>dataNames,
                                 QVector< float > mins,
                                 QVector<float> maxes ) :
    Dataset( filename, Fn::DatasetType::FIBERS ),
    m_fibs( fibs ),
    m_data( data ),
    m_dataNames( dataNames ),
    m_dataMins( mins ),
    m_dataMaxes( maxes ),
    m_renderer( 0 ),
    m_tubeRenderer( 0 ),
    m_selector( 0 ),
    m_numPoints( 0 ),
    m_numLines( 0 )
{
    createProps();
}

DatasetFibers::DatasetFibers( QDir filename, LoaderVTK* lv ) :
    Dataset( filename, Fn::DatasetType::FIBERS ),
    m_renderer( 0 ),
    m_tubeRenderer( 0 ),
    m_selector( 0 ),
    m_numPoints( 0 ),
    m_numLines( 0 )
{
    copyFromLoader( lv );

    createProps();
}

DatasetFibers::~DatasetFibers()
{
    m_properties["maingl"]->set( Fn::Property::D_ACTIVE, false );
    m_properties["maingl2"]->set( Fn::Property::D_ACTIVE, false );
    m_fibs.clear();
    m_fibs.squeeze();
    if ( m_renderer != 0 )
    {
        delete m_renderer;
        m_renderer = 0;
    }
    if ( m_tubeRenderer != 0 )
    {
        delete m_tubeRenderer;
        m_tubeRenderer = 0;
    }
}

void DatasetFibers::createProps()
{
    for ( int i = 0; i < m_fibs.size(); ++i )
    {
        m_numPoints += m_fibs[i].size() / 3;
    }
    bool hasData =(  m_dataNames[0] != "no data" );
    qDebug() << "num points:" << m_numPoints << "num lines:" << m_fibs.size();

    m_properties["maingl"]->createInt( Fn::Property::D_NUM_POINTS, m_numPoints );
    m_properties["maingl"]->createInt( Fn::Property::D_NUM_LINES, m_fibs.size() );
    m_properties["maingl"]->createList( Fn::Property::D_FIBER_RENDERMODE, {"lines", "tubes"}, 0, "general" );
    if ( hasData )
    {
        m_properties["maingl"]->createList( Fn::Property::D_COLORMODE, { "global", "local", "user defined", "mri", "data" }, 0, "general" );
        m_properties["maingl"]->createList( Fn::Property::D_DATAMODE, m_dataNames, 0, "general" );
    }
    else
    {
        m_properties["maingl"]->createList( Fn::Property::D_COLORMODE, { "global", "local", "user defined", "mri" }, 0, "general" );
        m_properties["maingl"]->createList( Fn::Property::D_DATAMODE, m_dataNames, 0 );
    }
    m_properties["maingl"]->createColor( Fn::Property::D_COLOR, QColor( 255, 0, 0 ), "color" );
    m_properties["maingl"]->createFloat( Fn::Property::D_ALPHA, 1.f, 0.01f, 1.f, "color" );
    m_properties["maingl"]->createFloat( Fn::Property::D_FIBER_THICKNESS, 1.0f, 0.1f, 5.0f, "general" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MIN, 0.0f );
    m_properties["maingl"]->createFloat( Fn::Property::D_MAX, 1.0f );

    if ( hasData )
    {
        m_properties["maingl"]->createInt( Fn::Property::D_COLORMAP, 1, "general" );
        m_properties["maingl"]->createFloat( Fn::Property::D_SELECTED_MIN, 0.0f, 0.0f, 1.0f, "color" );
        m_properties["maingl"]->createFloat( Fn::Property::D_SELECTED_MAX, 1.0f, 0.0f, 1.0f, "color" );
        m_properties["maingl"]->createFloat( Fn::Property::D_LOWER_THRESHOLD, 0.0f, 0.0f, 1.0f, "color" );
        m_properties["maingl"]->createFloat( Fn::Property::D_UPPER_THRESHOLD, 1.0f, 0.0f, 1.0f, "color" );
    }
    else
    {
        m_properties["maingl"]->createInt( Fn::Property::D_COLORMAP, 1 );
        m_properties["maingl"]->createFloat( Fn::Property::D_SELECTED_MIN, 0.0f, 0.0f, 1.0f );
        m_properties["maingl"]->createFloat( Fn::Property::D_SELECTED_MAX, 1.0f, 0.0f, 1.0f );
        m_properties["maingl"]->createFloat( Fn::Property::D_LOWER_THRESHOLD, 0.0f, 0.0f, 1.0f );
        m_properties["maingl"]->createFloat( Fn::Property::D_UPPER_THRESHOLD, 1.0f, 0.0f, 1.0f );
    }
    m_properties["maingl"]->createFloat( Fn::Property::D_DX, 200.0f, 0.0f, 200.0f, "special" );
    m_properties["maingl"]->createFloat( Fn::Property::D_DY, 200.0f, 0.0f, 200.0f, "special" );
    m_properties["maingl"]->createFloat( Fn::Property::D_DZ, 200.0f, 0.0f, 200.0f, "special" );
    m_properties["maingl"]->createInt( Fn::Property::D_NX, 800, 0, 1600, "special" );
    m_properties["maingl"]->createInt( Fn::Property::D_NY, 1000, 0, 2000, "special" );
    m_properties["maingl"]->createInt( Fn::Property::D_NZ, 800, 0, 1600, "special" );

    m_properties["maingl"]->createBool( Fn::Property::D_LIGHT_SWITCH, true, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_LIGHT_AMBIENT,   0.2f, 0.0f, 1.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_LIGHT_DIFFUSE,   0.45f, 0.0f, 1.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_LIGHT_SPECULAR,  0.5f, 0.0f, 1.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MATERIAL_AMBIENT,   2.0f, 0.0f, 10.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MATERIAL_DIFFUSE,   0.8f, 0.0f, 10.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MATERIAL_SPECULAR,  0.61f, 0.0f, 10.0f, "light" );
    m_properties["maingl"]->createFloat( Fn::Property::D_MATERIAL_SHININESS, 2.0f, 0.0f, 200.0f, "light" );

    int maxLength = 0;
    for ( int i = 0; i < m_fibs.size(); ++i )
    {
        maxLength = qMax( maxLength, m_fibs[i].size() / 3 );
    }

    m_properties["maingl"]->createFloat( Fn::Property::D_FIBER_GROW_LENGTH, (float)maxLength, 0.0f, (float)maxLength, "special" );

    connect( m_properties["maingl"]->getProperty( Fn::Property::D_COLOR ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( colorChanged() ) );

    PropertyGroup* props2 = new PropertyGroup( *( m_properties["maingl"] ) );
    m_properties.insert( "maingl2", props2 );

    if ( hasData )
    {
        connect( m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MIN ), SIGNAL( valueChanged( QVariant ) ),
                      m_properties["maingl"]->getProperty( Fn::Property::D_LOWER_THRESHOLD ), SLOT( setMax( QVariant ) ) );
        connect( m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MAX ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl"]->getProperty( Fn::Property::D_UPPER_THRESHOLD ), SLOT( setMin( QVariant ) ) );

        connect( m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MIN ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MAX ), SLOT( setMin( QVariant ) ) );
        connect( m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MAX ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl"]->getProperty( Fn::Property::D_SELECTED_MIN ), SLOT( setMax( QVariant ) ) );

        connect( m_properties["maingl"]->getProperty( Fn::Property::D_DATAMODE ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( dataModeChanged() ) );

        connect( m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MIN ), SIGNAL( valueChanged( QVariant ) ),
                      m_properties["maingl2"]->getProperty( Fn::Property::D_LOWER_THRESHOLD ), SLOT( setMax( QVariant ) ) );
        connect( m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MAX ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl2"]->getProperty( Fn::Property::D_UPPER_THRESHOLD ), SLOT( setMin( QVariant ) ) );

        connect( m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MIN ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MAX ), SLOT( setMin( QVariant ) ) );
        connect( m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MAX ), SIGNAL( valueChanged( QVariant ) ),
                  m_properties["maingl2"]->getProperty( Fn::Property::D_SELECTED_MIN ), SLOT( setMax( QVariant ) ) );

        //connect( m_properties["maingl2"]->getProperty( Fn::Property::D_DATAMODE ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( dataModeChanged() ) );
    }

    m_properties["maingl"]->createList( Fn::Property::D_USE_TRANSFORM, { "user defined", "qform", "sform", "qform inverted", "sform inverted" }, 3, "transform" );
    connect( m_properties["maingl"]->getProperty( Fn::Property::D_USE_TRANSFORM ), SIGNAL( valueChanged( QVariant ) ), this,
                SLOT( transformChanged( QVariant ) ) );
    m_properties["maingl"]->createMatrix( Fn::Property::D_TRANSFORM, m_transform, "transform" );
    m_properties["maingl"]->createButton( Fn::Property::D_APPLY_TRANSFORM, "transform" );
    connect( m_properties["maingl"]->getProperty( Fn::Property::D_APPLY_TRANSFORM ), SIGNAL( valueChanged( QVariant ) ), this,
                SLOT( applyTransform() ) );

    m_properties["maingl"]->createBool( Fn::Property::D_AUTOPLAY, false );
    m_properties["maingl"]->createInt( Fn::Property::D_AUTOPLAY_INTERVAL, 25, 10, 1000 );
    connect( m_properties["maingl"]->getProperty( Fn::Property::D_AUTOPLAY ), SIGNAL( valueChanged( QVariant ) ), this, SLOT( autoplay() ) );

    transformChanged( 3 );
}

QVector< QVector< float > > DatasetFibers::getFibs()
{
    return m_fibs;
}

QVector< QVector< QVector< float > > > DatasetFibers::getData()
{
    return m_data;
}

QVector< QVector< float > > DatasetFibers::getData( int id )
{
    return m_data[id];
}

QVector< QVector< float > > DatasetFibers::getSelectedFibs()
{
    if ( m_renderer == 0 )
    {
        return m_fibs;
    }
    else
    {
        QVector<bool>*selected = m_selector->getSelection();
        QVector<QVector<float> >out;
        int first = 0;
{'fraction_non_alphanumeric': 0.174294500723589, 'fraction_numerical': 0.02261215629522431, 'mean_word_length': 3.7422260347415826, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3205687', 'n_tokens_mistral': 8535, 'n_tokens_neox': 8173, 'n_words': 1317}