<commit_before>/*
* medViewerToolBoxViewProperties.cpp
*
*  Created on: 15 févr. 2011
*      Author: aabadie
*/

#include <medViewerToolBoxViewProperties.h>

#include <dtkCore/dtkAbstractData.h>

#include <medStorage.h>
#include <medSettingsManager.h>
#include <medMetaDataKeys.h>
#include <medAbstractView.h>
#include <medToolBoxTab.h>
#include <medMeshAbstractViewInteractor.h>

class medViewerToolBoxViewPropertiesPrivate
{
public:

    QTreeWidget * propertiesTree;
    QWidget * propertiesView;
    QWidget * propView;
    QStringList lutList;
    QStringList attributeList;
    QStringList presetList;
    QStringList renderingList;
    int currentLayer;
    QWidget * twoLayersWidget;
    QSlider * slider;
    QString thumbnailLocation;
    QString textLayer0;
    QString textLayer1;
    QPushButton * switchLayersButton;
    QList<medMeshAbstractViewInteractor*> interactors;
    medAbstractView *view;

    QPushButton *windowingPushButton;
    QPushButton *zoomingPushButton;
    QPushButton *slicingPushButton;
    QPushButton *measuringPushButton;

    QCheckBox *scalarBarVisibilityCheckBox;
    QCheckBox *axisVisibilityCheckBox;
    QCheckBox *rulerVisibilityCheckBox;
    QCheckBox *annotationsVisibilityCheckBox;

    QComboBox * view3dModeComboBox;
    QComboBox * view3dVRModeComboBox;
    QSlider * view3dLODSlider;
    QPushButton * croppingPushButton;
    QWidget * view3dToolBoxWidget;

    QString thumbLocation;

    QTreeWidgetItem * layerItem;
    bool isMesh;
    int currentInteractor;

    QList <QComboBox *> meshLutBoxList;
};

medViewerToolBoxViewProperties::medViewerToolBoxViewProperties(QWidget *parent) :
medToolBox(parent), d(new medViewerToolBoxViewPropertiesPrivate)
{

    d->view = 0;
    d->currentLayer = 0;
    d->textLayer0 = tr("Switch to layer 0 only");
    d->textLayer1 = tr("Switch to layer 1 only");
    d->isMesh = false;
    d->currentInteractor = 0;
    d->lutList << "Default" << "Black & White" << "Black & White Inversed" << "Spectrum" << "Hot Metal" << "Hot Green"
        << "Hot Iron" << "GE" << "Flow" << "Loni" << "Loni 2" << "Asymmetry" << "P-Value" << "Red Black Alpha"
        << "Green Black Alpha" << "Blue Black Alpha" << "Muscles & Bones" << "Bones" << "Red Vessels"
        << "Cardiac" << "Gray Rainbow" << "Stern" << "Black Body";
    d->presetList << "None" << "VR Muscles&Bones" << "Vascular I" << "Vascular II" << "Vascular III" << "Vascular IV"
        << "Standard" << "Soft" << "Soft on White" << "Soft on Blue" << "Red on White" << "Glossy" ;
    d->renderingList << "wireframe"<<"surface"<<"points";
    d->attributeList << "Solid";
    //lutBox = new QComboBox();

    d->propertiesTree = new QTreeWidget(this);
    d->propertiesTree->setFocusPolicy(Qt::NoFocus);

    d->propertiesTree->setColumnCount(3);
    d->propertiesTree->setColumnWidth(0,50);
    d->propertiesTree->setSelectionMode(QAbstractItemView::NoSelection);
    QStringList headers;
    headers << "Object" << "Name" << "Value";
    d->propertiesTree->setHeaderLabels(headers);
    d->propertiesTree->setAnimated(true);
    d->propertiesTree->setAlternatingRowColors(true);
    d->propertiesTree->setRootIsDecorated(false);
    d->propertiesTree->setContextMenuPolicy(Qt::CustomContextMenu);

    this->setTitle("View Properties");

    QObject::connect(d->propertiesTree, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(onItemClicked(QTreeWidgetItem *, int)));
    QObject::connect(d->propertiesTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextTreeMenu(QPoint)));

    d->propertiesView = new QWidget(this);

    d->windowingPushButton = new QPushButton("", this);
    d->windowingPushButton->setFocusPolicy(Qt::NoFocus);
    d->windowingPushButton->setIcon (QIcon (":/icons/wlww.png"));
    d->windowingPushButton->setCheckable (true);
    d->windowingPushButton->setMinimumWidth ( 20 );
    d->windowingPushButton->setToolTip (tr("Windowing"));
    d->zoomingPushButton   = new QPushButton("", this);
    d->zoomingPushButton->setFocusPolicy(Qt::NoFocus);
    d->zoomingPushButton->setIcon (QIcon (":/icons/magnify.png"));
    d->zoomingPushButton->setCheckable (true);
    d->zoomingPushButton->setToolTip (tr("Zooming"));
    d->slicingPushButton   = new QPushButton("", this);
    d->slicingPushButton->setFocusPolicy(Qt::NoFocus);
    d->slicingPushButton->setIcon (QIcon (":/icons/stack.png"));
    d->slicingPushButton->setCheckable (true);
    d->slicingPushButton->setToolTip (tr("Slicing"));
    d->measuringPushButton = new QPushButton("", this);
    d->measuringPushButton->setFocusPolicy(Qt::NoFocus);
    d->measuringPushButton->setIcon (QIcon (":/icons/length.png"));
    d->measuringPushButton->setCheckable (true);
    d->measuringPushButton->setToolTip (tr("Measuring"));

    QButtonGroup *mouseGroup = new QButtonGroup (this);
    mouseGroup->addButton ( d->windowingPushButton );
    mouseGroup->addButton ( d->zoomingPushButton );
    mouseGroup->addButton ( d->slicingPushButton );
    mouseGroup->addButton ( d->measuringPushButton );
    mouseGroup->setExclusive (true);

    setCurrentInteractionFromSettings();

    d->propView = new QWidget(this);
    QHBoxLayout * propLayout = new QHBoxLayout;

    d->scalarBarVisibilityCheckBox = new QCheckBox(this);
    d->scalarBarVisibilityCheckBox->setFocusPolicy(Qt::NoFocus);
    d->scalarBarVisibilityCheckBox->setToolTip(tr("Show scalar bar"));
    d->axisVisibilityCheckBox = new QCheckBox(this);
    d->axisVisibilityCheckBox->setFocusPolicy(Qt::NoFocus);
    d->axisVisibilityCheckBox->setToolTip(tr("Show axis"));
    d->rulerVisibilityCheckBox = new QCheckBox(this);
    d->rulerVisibilityCheckBox->setFocusPolicy(Qt::NoFocus);
    d->annotationsVisibilityCheckBox = new QCheckBox(this);
    d->annotationsVisibilityCheckBox->setFocusPolicy(Qt::NoFocus);

    propLayout->addWidget(d->scalarBarVisibilityCheckBox);
    propLayout->addWidget(d->annotationsVisibilityCheckBox);
    d->propView->setLayout(propLayout);
    propLayout->setAlignment(Qt::AlignJustify);
    d->scalarBarVisibilityCheckBox->setText(tr("Scalar Bar"));
    d->axisVisibilityCheckBox->setText(tr("Axis"));
    d->rulerVisibilityCheckBox->setText(tr("Ruler"));
    d->rulerVisibilityCheckBox->setToolTip(tr("Show ruler"));
    d->annotationsVisibilityCheckBox->setText("Annotations");
    d->annotationsVisibilityCheckBox->setToolTip(tr("Show annotations"));
    d->annotationsVisibilityCheckBox->setChecked(true);
    d->rulerVisibilityCheckBox->setChecked(true);

    QHBoxLayout *mouseLayout = new QHBoxLayout;
    mouseLayout->addWidget(d->axisVisibilityCheckBox);<commit_msg>ViewProperties toolbox: Changed 'axis' to plural 'axes'.<commit_after>/*
* medViewerToolBoxViewProperties.cpp
*
*  Created on: 15 févr. 2011
*      Author: aabadie
*/

#include <medViewerToolBoxViewProperties.h>

#include <dtkCore/dtkAbstractData.h>

#include <medStorage.h>
#include <medSettingsManager.h>
#include <medMetaDataKeys.h>
#include <medAbstractView.h>
#include <medToolBoxTab.h>
#include <medMeshAbstractViewInteractor.h>

class medViewerToolBoxViewPropertiesPrivate
{
public:

    QTreeWidget * propertiesTree;
    QWidget * propertiesView;
    QWidget * propView;
    QStringList lutList;
    QStringList attributeList;
    QStringList presetList;
    QStringList renderingList;
    int currentLayer;
    QWidget * twoLayersWidget;
    QSlider * slider;
    QString thumbnailLocation;
    QString textLayer0;
    QString textLayer1;
    QPushButton * switchLayersButton;
    QList<medMeshAbstractViewInteractor*> interactors;
    medAbstractView *view;

    QPushButton *windowingPushButton;
    QPushButton *zoomingPushButton;
    QPushButton *slicingPushButton;
    QPushButton *measuringPushButton;

    QCheckBox *scalarBarVisibilityCheckBox;
    QCheckBox *axisVisibilityCheckBox;
    QCheckBox *rulerVisibilityCheckBox;
    QCheckBox *annotationsVisibilityCheckBox;

    QComboBox * view3dModeComboBox;
    QComboBox * view3dVRModeComboBox;
    QSlider * view3dLODSlider;
    QPushButton * croppingPushButton;
    QWidget * view3dToolBoxWidget;

    QString thumbLocation;

    QTreeWidgetItem * layerItem;
    bool isMesh;
    int currentInteractor;

    QList <QComboBox *> meshLutBoxList;
};

medViewerToolBoxViewProperties::medViewerToolBoxViewProperties(QWidget *parent) :
medToolBox(parent), d(new medViewerToolBoxViewPropertiesPrivate)
{

    d->view = 0;
    d->currentLayer = 0;
    d->textLayer0 = tr("Switch to layer 0 only");
    d->textLayer1 = tr("Switch to layer 1 only");
    d->isMesh = false;
    d->currentInteractor = 0;
    d->lutList << "Default" << "Black & White" << "Black & White Inversed" << "Spectrum" << "Hot Metal" << "Hot Green"
        << "Hot Iron" << "GE" << "Flow" << "Loni" << "Loni 2" << "Asymmetry" << "P-Value" << "Red Black Alpha"
        << "Green Black Alpha" << "Blue Black Alpha" << "Muscles & Bones" << "Bones" << "Red Vessels"
        << "Cardiac" << "Gray Rainbow" << "Stern" << "Black Body";
    d->presetList << "None" << "VR Muscles&Bones" << "Vascular I" << "Vascular II" << "Vascular III" << "Vascular IV"
        << "Standard" << "Soft" << "Soft on White" << "Soft on Blue" << "Red on White" << "Glossy" ;
    d->renderingList << "wireframe"<<"surface"<<"points";
    d->attributeList << "Solid";
    //lutBox = new QComboBox();

    d->propertiesTree = new QTreeWidget(this);
    d->propertiesTree->setFocusPolicy(Qt::NoFocus);

    d->propertiesTree->setColumnCount(3);
    d->propertiesTree->setColumnWidth(0,50);
    d->propertiesTree->setSelectionMode(QAbstractItemView::NoSelection);
    QStringList headers;
    headers << "Object" << "Name" << "Value";
    d->propertiesTree->setHeaderLabels(headers);
    d->propertiesTree->setAnimated(true);
    d->propertiesTree->setAlternatingRowColors(true);
    d->propertiesTree->setRootIsDecorated(false);
    d->propertiesTree->setContextMenuPolicy(Qt::CustomContextMenu);

    this->setTitle("View Properties");

    QObject::connect(d->propertiesTree, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(onItemClicked(QTreeWidgetItem *, int)));
    QObject::connect(d->propertiesTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextTreeMenu(QPoint)));

    d->propertiesView = new QWidget(this);

    d->windowingPushButton = new QPushButton("", this);
    d->windowingPushButton->setFocusPolicy(Qt::NoFocus);
    d->windowingPushButton->setIcon (QIcon (":/icons/wlww.png"));
    d->windowingPushButton->setCheckable (true);
    d->windowingPushButton->setMinimumWidth ( 20 );
    d->windowingPushButton->setToolTip (tr("Windowing"));
    d->zoomingPushButton   = new QPushButton("", this);
    d->zoomingPushButton->setFocusPolicy(Qt::NoFocus);
    d->zoomingPushButton->setIcon (QIcon (":/icons/magnify.png"));
    d->zoomingPushButton->setCheckable (true);
    d->zoomingPushButton->setToolTip (tr("Zooming"));
    d->slicingPushButton   = new QPushButton("", this);
    d->slicingPushButton->setFocusPolicy(Qt::NoFocus);
    d->slicingPushButton->setIcon (QIcon (":/icons/stack.png"));
    d->slicingPushButton->setCheckable (true);
    d->slicingPushButton->setToolTip (tr("Slicing"));
    d->measuringPushButton = new QPushButton("", this);
    d->measuringPushButton->setFocusPolicy(Qt::NoFocus);
    d->measuringPushButton->setIcon (QIcon (":/icons/length.png"));
    d->measuringPushButton->setCheckable (true);
    d->measuringPushButton->setToolTip (tr("Measuring"));

    QButtonGroup *mouseGroup = new QButtonGroup (this);
    mouseGroup->addButton ( d->windowingPushButton );
    mouseGroup->addButton ( d->zoomingPushButton );
    mouseGroup->addButton ( d->slicingPushButton );
    mouseGroup->addButton ( d->measuringPushButton );
    mouseGroup->setExclusive (true);

    setCurrentInteractionFromSettings();

    d->propView = new QWidget(this);
    QHBoxLayout * propLayout = new QHBoxLayout;

    d->scalarBarVisibilityCheckBox = new QCheckBox(this);
    d->scalarBarVisibilityCheckBox->setFocusPolicy(Qt::NoFocus);
    d->scalarBarVisibilityCheckBox->setToolTip(tr("Show scalar bar"));
    d->axisVisibilityCheckBox = new QCheckBox(this);
    d->axisVisibilityCheckBox->setFocusPolicy(Qt::NoFocus);
    d->axisVisibilityCheckBox->setToolTip(tr("Show axes"));
    d->rulerVisibilityCheckBox = new QCheckBox(this);
    d->rulerVisibilityCheckBox->setFocusPolicy(Qt::NoFocus);
    d->annotationsVisibilityCheckBox = new QCheckBox(this);
    d->annotationsVisibilityCheckBox->setFocusPolicy(Qt::NoFocus);

    propLayout->addWidget(d->scalarBarVisibilityCheckBox);
    propLayout->addWidget(d->annotationsVisibilityCheckBox);
    d->propView->setLayout(propLayout);
    propLayout->setAlignment(Qt::AlignJustify);
    d->scalarBarVisibilityCheckBox->setText(tr("Scalar Bar"));
    d->axisVisibilityCheckBox->setText(tr("Axes"));
    d->rulerVisibilityCheckBox->setText(tr("Ruler"));
    d->rulerVisibilityCheckBox->setToolTip(tr("Show ruler"));
    d->annotationsVisibilityCheckBox->setText("Annotations");
    d->annotationsVisibilityCheckBox->setToolTip(tr("Show annotations"));
    d->annotationsVisibilityCheckBox->setChecked(true);
    d->rulerVisibilityCheckBox->setChecked(true);

    QHBoxLayout *mouseLayout = new QHBoxLayout;
    mouseLayout->addWidget(d->axisVisibilityCheckBox);
{'fraction_non_alphanumeric': 0.14183435074233175, 'fraction_numerical': 0.003918908734644661, 'mean_word_length': 4.918822479928635, 'pattern_counts': {'":': 8, '<': 191, '<?xml version=': 0, '>': 267, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3830728', 'n_tokens_mistral': 4231, 'n_tokens_neox': 4135, 'n_words': 687}