コード例 #1
0
ファイル: datacutslider.cpp プロジェクト: jkriege2/QuickFit3
void DataCutSliders::sliderHighValueChanged(int value){
    userMax=value;
    if (userMax<=userMin) userMax=userMin+1;
    if (userMax>max) userMax=max;
    if (userMax<min) userMax=min;
    if (sliderSignals) {
        emit slidersChanged(userMin, userMax, min, max);
    }
}
コード例 #2
0
ファイル: datacutslider.cpp プロジェクト: jkriege2/QuickFit3
void DataCutSliders::sliderLowValueChanged(int value){
    userMin=value;
    if (userMin>=userMax) userMin=userMax-1;
    if (userMin<min) userMin=min;
    if (userMax>max) userMax=max;
    if (sliderSignals) {
        emit slidersChanged(userMin, userMax, min, max);
    }

}
コード例 #3
0
FormImageProp::FormImageProp(QMainWindow *parent, QGLWidget* qlW_ptr) :
    FormImageBase(parent),
    ui(new Ui::FormImageProp)
{
    ui->setupUi(this);

    bOpenNormalMapMixer   = false;

    imageProp.glWidget_ptr = qlW_ptr;
    
    connect(ui->pushButtonOpenImage,SIGNAL(released()),this,SLOT(open()));
    connect(ui->pushButtonSaveImage,SIGNAL(released()),this,SLOT(save()));
    connect(ui->pushButtonCopyToClipboard,SIGNAL(released()),this,SLOT(copyToClipboard()));
    connect(ui->pushButtonPasteFromClipboard,SIGNAL(released()),this,SLOT(pasteFromClipboard()));

    connect(ui->pushButtonRestoreSettings,SIGNAL(released()),this,SLOT(reloadImageSettings()));

    connect(ui->checkBoxRemoveShading,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    connect(ui->checkBoxGrayScale,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    // gray scale properties
    connect(ui->comboBoxGrayScalePresets,SIGNAL(activated(int)),this,SLOT(updateComboBoxes(int)));
    connect(ui->horizontalSliderGrayScaleR,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderGrayScaleG,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderGrayScaleB,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));


    connect(ui->checkBoxInvertB,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    connect(ui->checkBoxInvertR,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    connect(ui->checkBoxInvertG,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    // standard enchancement
    connect(ui->horizontalSliderRemoveShadingGaussIter,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderAOCancelation         ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderRemoveShadingLFBlending,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderRemoveShadingLFRadius,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));



    connect(ui->horizontalSliderBlurNoPasses          ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSmallDetails          ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderMediumDetails         ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderDetailDepth           ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderColorHue              ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

    // specular manipulation tool
    connect(ui->checkBoxSpecularControl             ,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    connect(ui->horizontalSliderSpeculatW1          ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSpecularW2          ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSpecularRadius      ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSpecularContrast    ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSpecularAmplifier   ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSpecularBrightness  ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

    connect(ui->horizontalSliderSpeculatW1           ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSpecularW2           ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSpecularRadius       ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSpecularRadius       ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSpecularContrast     ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSpecularAmplifier    ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSpecularBrightness   ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));

    connect(ui->horizontalSliderSharpenBlur,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalsStep,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

    // height conversion buttons
    connect(ui->horizontalSliderConversionHNDepth   ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->pushButtonConverToNormal            ,SIGNAL(released()),this,SLOT(applyHeightToNormalConversion()));
    connect(ui->pushButtonShowDepthCalculator       ,SIGNAL(released()),this,SLOT(showHeightCalculatorDialog()));


    // normal convertion buttons and sliders

    connect(ui->horizontalSliderNormalToHeightItersHuge     ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalToHeightItersVeryLarge,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalToHeightItersLarge    ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalToHeightItersMedium   ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalToHeightItersSmall    ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalToHeightItersVerySmall,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

    connect(ui->pushButtonConvertToHeight,SIGNAL(released()),this,SLOT(applyNormalToHeightConversion()));

    // base map convertion
    connect(ui->checkBoxEnableBaseMapToOthers               ,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));


    connect(ui->pushButtonConvertToNormalAndHeight,SIGNAL(released()),this,SLOT(applyBaseConversionConversion()));

    // ssao calculation
    connect(ui->horizontalSliderSSAOBias        ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSSAODepth       ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSSAOIntensity   ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSSAONoIters     ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

    connect(ui->horizontalSliderSSAOBias        ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSSAODepth       ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSSAOIntensity   ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderSSAONoIters     ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));

    connect(ui->pushButtonConvertOcclusionFromHN,SIGNAL(released()),this,SLOT(applyHeightNormalToOcclusionConversion()));



    // levels properties
    connect(ui->horizontalSliderHeightProcMinValue,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));    
    connect(ui->horizontalSliderHeightProcMaxValue,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderHeightAveRadius   ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderHeightOffsetValue ,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->checkBoxHeightProcEnableNormalization ,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));

    connect(ui->horizontalSliderHeightProcMinValue,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderHeightProcMaxValue,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));
    connect(ui->horizontalSliderHeightAveRadius   ,SIGNAL(sliderMoved(int)),this,SLOT(updateGuiSpinBoxesAndLabes(int)));

    // selective blur buttons and sliders
    connect(ui->pushButtonSelectiveBlurPreviewMask,SIGNAL(released()),this,SLOT(updateGuiCheckBoxes()));
    connect(ui->pushButtonSelectiveBlurPreviewMask,SIGNAL(toggled(bool)),this,SLOT(togglePreviewSelectiveBlurMask(bool)));
    connect(ui->checkBoxSelectiveBlurInvertMask,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    connect(ui->checkBoxSelectiveBlurEnable,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));

    connect(ui->comboBoxSelectiveBlurTypes,SIGNAL(activated(int)),this,SLOT(updateComboBoxes(int)));

    connect(ui->horizontalSliderSelectiveBlurBlending,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSelectiveBlurMaskRadius,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSelectiveBlurDOGAmplifier,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSelectiveBlurDOGContrast,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSelectiveBlurDOGOffset,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSelectiveBlurDOGRadius,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

    connect(ui->horizontalSliderSelectiveBlurMinValue,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSelectiveBlurMaxValue,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSelectiveBlurDetails,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderSelectiveBlurOffset,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->comboBoxMaskInputImage,SIGNAL(activated(int)),this,SLOT(updateComboBoxes(int)));
    connect(ui->horizontalSliderSelectiveBlurNoIters,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

    // roughness settings
    connect(ui->horizontalSliderRoughnessDepth,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderRoughnessTreshold,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderRoughnessAmplifier,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));

    connect(ui->radioButtonRoughnessEnable,SIGNAL(clicked()),this,SLOT(cancelColorPicking()));
    connect(ui->radioButtonEnableColorPicking,SIGNAL(clicked()),this,SLOT(cancelColorPicking()));
    connect(ui->radioButtonRoughnessNoneEffect,SIGNAL(clicked()),this,SLOT(cancelColorPicking()));

    connect(ui->radioButtonRoughnessEnable,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    connect(ui->radioButtonEnableColorPicking,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));
    connect(ui->radioButtonRoughnessNoneEffect,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));


    connect(ui->pushButtonRoughnessPickColor,SIGNAL(toggled(bool)),this,SLOT(toggleColorPicking(bool)));
    connect(ui->comboBoxColorPickerMethod,SIGNAL(activated(int)),this,SLOT(updateComboBoxes(int)));
    connect(ui->horizontalSliderRoughnessColorOffset,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderRoughnessColorGlobalOffset,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderRoughnessColorAmplifier,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->checkBoxRoughnessColorInvert,SIGNAL(clicked()),this,SLOT(updateGuiCheckBoxes()));



    // input image boxes
    connect(ui->comboBoxNormalInputImage,SIGNAL(activated(int)),this,SLOT(updateComboBoxes(int)));
    connect(ui->comboBoxSpecularInputImage,SIGNAL(activated(int)),this,SLOT(updateComboBoxes(int)));
    connect(ui->comboBoxOcclusionInputImage,SIGNAL(activated(int)),this,SLOT(updateComboBoxes(int)));
    connect(ui->comboBoxRoughnessInputImage,SIGNAL(activated(int)),this,SLOT(updateComboBoxes(int)));

    // normal map mixer
    connect(ui->pushButtonNormalMixerLoadImage,SIGNAL(released())        ,this,SLOT(openNormalMixerImage()));
    connect(ui->pushButtonNormalMixerPasteFromCB,SIGNAL(released())        ,this,SLOT(pasteNormalFromClipBoard()));

    connect(ui->checkBoxNormalMixerEnable,SIGNAL(clicked())              ,this,SLOT(updateGuiCheckBoxes()));
    connect(ui->horizontalSliderNormalMixerDepth,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalMixerAngle,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalMixerScale,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalMixerScale,SIGNAL(valueChanged(int)),this,SLOT(updateSlidersNow(int)));
    connect(ui->horizontalSliderNormalMixerPosX,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));
    connect(ui->horizontalSliderNormalMixerPosY,SIGNAL(sliderReleased()),this,SLOT(updateSlidersOnRelease()));



    setAcceptDrops(true);
    ui->groupBoxRemoveShading->hide();
    ui->checkBoxRemoveShading->hide();
    ui->groupBoxGrayScale->hide();
    ui->groupBoxSelectiveBlurOptions->hide();
    ui->groupBoxSelectiveBlurLevels->hide();
    heightCalculator = new DialogHeightCalculator;

    ui->labelHue->hide();
    ui->labelHueValue->hide();
    ui->horizontalSliderColorHue->hide();

    ui->groupBoxRoughnessSurfaceFilter->hide();
    ui->groupBoxRoughnessColorFilter_2->hide();
    ui->groupBoxBaseToOthersProcessing->hide();
    ui->groupBoxSpecularProcessing->hide();

    // conversion levels
    for(int i = 0; i < 4 ; i++){
        baseMapConvLevels[i] = new FormBaseMapConversionLevels;
        connect(baseMapConvLevels[i],SIGNAL(slidersChanged()),this,SLOT(updateSlidersOnRelease()));
    }
    ui->verticalLayoutBaseMapConvLevel0->addWidget(baseMapConvLevels[0]);
    ui->verticalLayoutBaseMapConvLevel1->addWidget(baseMapConvLevels[1]);
    ui->verticalLayoutBaseMapConvLevel2->addWidget(baseMapConvLevels[2]);
    ui->verticalLayoutBaseMapConvLevel3->addWidget(baseMapConvLevels[3]);

    for(int i = 0; i < 4 ; i++){
        baseMapConvLevels[i]->show();
    }

    // normal mixer
    ui->groupBoxNormalMixerSettings->hide();
    ui->groupBoxNormalMixer->hide();

    setMouseTracking(true);
    setFocus();
    setFocusPolicy(Qt::ClickFocus);
}