DebayerParametersControlWidget::DebayerParametersControlWidget(QWidget *parent, bool _autoInit, QString _rootPath) : ParametersControlWidgetBase(parent) , mUi(new Ui::DebayerParametersControlWidget) , autoInit(_autoInit) , rootPath(_rootPath) { mUi->setupUi(this); QObject::connect(mUi->methodComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->bayerPosSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->numBitsOutSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->gains, SIGNAL(valueChanged()), this, SIGNAL(paramsChanged())); QObject::connect(mUi->gamma, SIGNAL(valueChanged()), this, SIGNAL(paramsChanged())); }
FixtureControlWidget::FixtureControlWidget(QWidget *parent) : QWidget(parent), ui(new Ui::FixtureControlWidget) { ui->setupUi(this); /* Fixtures should be in World coordinates */ ui->locationWidget->setPresentationStyle(true); QObject::connect(ui->loadPushButton, SIGNAL(released()), this, SLOT(loadPressed())); QObject::connect(ui->savePushButton, SIGNAL(released()), this, SLOT(savePressed())); QObject::connect(ui->locationWidget, SIGNAL(paramsChanged()) , this, SIGNAL(paramsChanged())); QObject::connect(ui->nameEdit , SIGNAL(textChanged(QString)), this, SIGNAL(paramsChanged())); }
void kore::Camera::transformChanged(const Transform* newTransform) { SceneNodeComponent::transformChanged(newTransform); _matView = glm::inverse(newTransform->getGlobal()); _matViewInverse = newTransform->getGlobal(); paramsChanged(); }
void UsReconstructionImplService::setSettings() { mAlgoOptions.clear(); this->updateFromOriginalFileData(); emit paramsChanged(); emit algorithmChanged(); }
JtvLiveUiTabParams::JtvLiveUiTabParams(JtvLiveChannel *live_channel, QWidget *parent) : QWidget(parent) { p_live_channel = live_channel; lne_rtmp = new QLineEdit; lab_rtmp = new QLabel("RTMP (-r)"); lab_rtmp->setBuddy(lne_rtmp); lne_swf = new QLineEdit; lab_swf = new QLabel("SWF (-s)"); lab_swf->setBuddy(lne_swf); lne_swf_vfy = new QLineEdit; lab_swf_vfy = new QLabel("SWF verif (-W)"); lab_swf_vfy->setBuddy(lne_swf_vfy); lne_web = new QLineEdit; lab_web = new QLabel("Web page (-p)"); lab_web->setBuddy(lne_web); lne_usher_token = new QLineEdit; lab_usher_token = new QLabel("UsherToken (-j)"); lab_usher_token->setBuddy(lne_usher_token); fra_separator = new QFrame; fra_separator->setFrameShape(QFrame::HLine); fra_separator->setFrameShadow(QFrame::Sunken); lab_cli = new QLabel("Command line input firendly :"); pte_cli = new QPlainTextEdit; pte_cli->setReadOnly(true); //Layout layout = new QGridLayout; layout->addWidget(lab_rtmp, 0, 0); layout->addWidget(lne_rtmp, 0, 1); layout->addWidget(lab_swf, 1, 0); layout->addWidget(lne_swf, 1, 1); layout->addWidget(lab_swf_vfy, 2, 0); layout->addWidget(lne_swf_vfy, 2, 1); layout->addWidget(lab_web, 3, 0); layout->addWidget(lne_web, 3, 1); layout->addWidget(lab_usher_token, 4, 0); layout->addWidget(lne_usher_token, 4, 1); layout->addWidget(fra_separator, 5, 0, 1, 2); layout->addWidget(lab_cli, 6, 0, 1, 2); layout->addWidget(pte_cli, 7, 0, 1, 2); setLayout(layout); connect(lne_rtmp, SIGNAL(textEdited(const QString &)), p_live_channel, SLOT(setStreamRtmp(const QString &))); connect(lne_swf, SIGNAL(textEdited(const QString &)), p_live_channel, SLOT(setStreamSwf(const QString &))); connect(lne_swf_vfy, SIGNAL(textEdited(const QString &)), p_live_channel, SLOT(setStreamSwfVfy(const QString &))); connect(lne_web, SIGNAL(textEdited(const QString &)), p_live_channel, SLOT(setStreamWeb(const QString &))); connect(lne_usher_token, SIGNAL(textEdited(const QString &)), p_live_channel, SLOT(setStreamUsherToken(const QString &))); connect(p_live_channel, SIGNAL(streamChanged()), this, SLOT(setParams())); connect(p_live_channel, SIGNAL(paramsChanged()), this, SLOT(updateCli())); }
void ThickeningParametersControlWidget::setParameters(const ThickeningParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->powerSpinBox->setValue(input.power()); blockSignals(wasBlocked); emit paramsChanged(); }
void InputFilterParametersControlWidget::setParameters(const InputFilterParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->inputTypeComboBox->setCurrentIndex(input.inputType()); blockSignals(wasBlocked); emit paramsChanged(); }
void BackgroundFilterParametersControlWidget::setParameters(const BackgroundFilterParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->thresholdSpinBox->setValue(input.threshold()); blockSignals(wasBlocked); emit paramsChanged(); }
void RecorderControlWidget::setParameters(const Recorder &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->pathEdit->setText(QString::fromStdString(input.path())); mUi->fileTemplateEdit->setText(QString::fromStdString(input.fileTemplate())); blockSignals(wasBlocked); emit paramsChanged(); }
void CannyParametersControlWidget::setParameters(const CannyParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->shouldEdgeDetectCheckBox->setChecked(input.shouldEdgeDetect()); mUi->minimumThresholdSpinBox->setValue(input.minimumThreshold()); mUi->maximumThresholdSpinBox->setValue(input.maximumThreshold()); blockSignals(wasBlocked); emit paramsChanged(); }
void kore::Camera::setProjectionOrtho(float fLeft, float fRight, float fBottom, float fTop, float fNear, float fFar) { _matProjection = glm::ortho(fLeft, fRight, fBottom, fTop, fNear, fFar); _fFar = fFar; _fNear = fNear; _fFovDeg = -1.0f; // Not valid in this case -> Mark as negative. _bIsOrtho = true; paramsChanged(); }
void OpenCVFilterParametersControlWidget::setParameters(const OpenCVFilterParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->openCVFilterComboBox->setCurrentIndex(input.openCVFilter()); mUi->param1SpinBox->setValue(input.param1()); mUi->param2SpinBox->setValue(input.param2()); blockSignals(wasBlocked); emit paramsChanged(); }
RecorderControlWidget::RecorderControlWidget(QWidget *parent, bool _autoInit, QString _rootPath) : ParametersControlWidgetBase(parent) , mUi(new Ui::RecorderControlWidget) , autoInit(_autoInit) , rootPath(_rootPath) { mUi->setupUi(this); QObject::connect(mUi->pathEdit, SIGNAL(textChanged(QString)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->fileTemplateEdit, SIGNAL(textChanged(QString)), this, SIGNAL(paramsChanged())); }
void EditableMarksBar::onFieldEdited() { QVector<int> &values = m_marksBar->values(); //Copy the values to the marksBar values[0] = m_fields[0]->getValue(); values[1] = m_fields[1]->getValue() + 1; m_marksBar->conformValues(); emit paramsChanged(); }
void HeadSearchParametersControlWidget::setParameters(const HeadSearchParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->thresholdDistanceSpinBox->setValue(input.thresholdDistance()); mUi->clusterDepthSpinBox->setValue(input.clusterDepth()); mUi->clusterMinSizeSpinBox->setValue(input.clusterMinSize()); mUi->headAreaRadiusSpinBox->setValue(input.headAreaRadius()); mUi->headNumberSpinBox->setValue(input.headNumber()); blockSignals(wasBlocked); emit paramsChanged(); }
void DebayerParametersControlWidget::setParameters(const DebayerParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->methodComboBox->setCurrentIndex(input.method()); mUi->bayerPosSpinBox->setValue(input.bayerPos()); mUi->numBitsOutSpinBox->setValue(input.numBitsOut()); mUi->gains->setValue(input.gains()); mUi->gamma->setValue(input.gamma()); blockSignals(wasBlocked); emit paramsChanged(); }
Draw3dParametersControlWidget::Draw3dParametersControlWidget(QWidget *parent, bool _autoInit, QString _rootPath) : ParametersControlWidgetBase(parent) , mUi(new Ui::Draw3dParametersControlWidget) , autoInit(_autoInit) , rootPath(_rootPath) { mUi->setupUi(this); QObject::connect(mUi->styleComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->colorControlWidget, SIGNAL(paramsChanged()), this, SIGNAL(paramsChanged())); QObject::connect(mUi->secondaryColorControlWidget, SIGNAL(paramsChanged()), this, SIGNAL(paramsChanged())); QObject::connect(mUi->showCaptionCheckBox, SIGNAL(stateChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->fontSizeSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->fontWidthSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->fontColorControlWidget, SIGNAL(paramsChanged()), this, SIGNAL(paramsChanged())); QObject::connect(mUi->textureCorrodinatesComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->textureAlphaSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->textureScaleSpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->decalMatrixTypeSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->decalLeftCamCheckBox, SIGNAL(stateChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->decalLeftAlphaSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->decalRightCamCheckBox, SIGNAL(stateChanged(int)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->decalRightAlphaSpinBox, SIGNAL(valueChanged(int)), this, SIGNAL(paramsChanged())); }
CopterWidget::CopterWidget(QWidget *parent) : QWidget(parent) , mUi(new Ui::CopterWidget) { mUi->setupUi(this); Copter *params = createParameters(); SettingsGetter visitor("cvs.conf"); params->accept<SettingsGetter>(visitor); setParameters(*params); delete params; QObject::connect(mUi->pathEdit, SIGNAL(textEdited(QString)), this, SIGNAL(paramsChanged())); QObject::connect(mUi->fileTemplateEdit, SIGNAL(textEdited(QString)), this, SIGNAL(paramsChanged())); }
EditableMarksBar::EditableMarksBar(QWidget *parent) : QFrame(parent) { QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(2); setLayout(layout); //Add MarksBar m_marksBar = new MarksBar; m_marksBar->setContentsMargins(5, 0, 6, 0); layout->addWidget(m_marksBar); //Customize it m_marksBar->setRange(0, 256, 2); QVector<int> &values = m_marksBar->values(); values.push_back(0); values.push_back(256); QVector<QColor> &colors = m_marksBar->colors(); colors.fill(Qt::black, 2); //MarksBar dominates values change notifications bool ret = connect(m_marksBar, SIGNAL(marksUpdated()), this, SLOT(updateFields())); ret = ret && connect(m_marksBar, SIGNAL(marksUpdated()), this, SIGNAL(paramsChanged())); //Add fields layout QHBoxLayout *hLayout = new QHBoxLayout; hLayout->setMargin(0); hLayout->setContentsMargins(4, 0, 5, 0); layout->addLayout(hLayout); m_fields[0] = new DVGui::IntLineEdit; hLayout->addWidget(m_fields[0]); ret = ret && connect(m_fields[0], SIGNAL(editingFinished()), this, SLOT(onFieldEdited())); hLayout->addStretch(1); m_fields[1] = new DVGui::IntLineEdit; hLayout->addWidget(m_fields[1]); ret = ret && connect(m_fields[1], SIGNAL(editingFinished()), this, SLOT(onFieldEdited())); updateFields(); }
void PresentationParametersControlWidget::setParameters(const PresentationParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->outputComboBox->setCurrentIndex(input.output()); mUi->stereoComboBox->setCurrentIndex(input.stereo()); mUi->flowComboBox->setCurrentIndex(input.flow()); mUi->showClustersCheckBox->setChecked(input.showClusters()); mUi->showHistogramCheckBox->setChecked(input.showHistogram()); mUi->autoUpdateHistogramCheckBox->setChecked(input.autoUpdateHistogram()); mUi->showAreaOfInterestCheckBox->setChecked(input.showAreaOfInterest()); mUi->produce3DCheckBox->setChecked(input.produce3D()); mUi->produce6DCheckBox->setChecked(input.produce6D()); mUi->dump3DCheckBox->setChecked(input.dump3D()); blockSignals(wasBlocked); emit paramsChanged(); }
void UsReconstructionImplService::updateFromOriginalFileData() { if (!mOriginalFileData.isValid()) return; ReconstructPreprocessorPtr preprocessor(new ReconstructPreprocessor(mPatientModelService)); preprocessor->initialize(this->createCoreParameters(), mOriginalFileData); if (preprocessor->getOutputVolumeParams().isValid()) mOutputVolumeParams = preprocessor->getOutputVolumeParams(); else { reportError("Input ultrasound data not valid for reconstruction"); return; } emit paramsChanged(); }
void kore::Camera::setProjectionPersp(float yFov_deg, float fWidth, float fHeight, float fNear, float fFar) { _matProjection = glm::perspectiveFov(yFov_deg, fWidth, fHeight, fNear, fFar); _fNear = fNear; _fFar = fFar; _fFovDeg = yFov_deg; _bIsOrtho = false; _fWidth = fWidth; _fHeight = fHeight; // Calculate focal length float fFovHor2 = glm::atan( getAspectRatio() * glm::tan(getFovRad() / 2.0f)); _fFocalLength = 1.0f / glm::tan(fFovHor2); paramsChanged(); }
void RectifyParametersControlWidget::setParameters(const RectifyParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->matchingMethodComboBox->setCurrentIndex(input.matchingMethod()); mUi->hessianThresholdSpinBox->setValue(input.hessianThreshold()); mUi->octavesSpinBox->setValue(input.octaves()); mUi->octaveLayersSpinBox->setValue(input.octaveLayers()); mUi->extendedCheckBox->setChecked(input.extended()); mUi->filterMinimumLengthSpinBox->setValue(input.filterMinimumLength()); mUi->useKLTCheckBox->setChecked(input.useKLT()); mUi->computeEssentialCheckBox->setChecked(input.computeEssential()); mUi->priorFocalSpinBox->setValue(input.priorFocal()); mUi->priorFocal2SpinBox->setValue(input.priorFocal2()); mUi->baselineLengthSpinBox->setValue(input.baselineLength()); mUi->fovAngleSpinBox->setValue(input.fovAngle()); mUi->estimationMethodComboBox->setCurrentIndex(input.estimationMethod()); mUi->normaliseCheckBox->setChecked(input.normalise()); mUi->ransacIterationsSpinBox->setValue(input.ransacIterations()); mUi->ransacTestSizeSpinBox->setValue(input.ransacTestSize()); mUi->ransacThresholdSpinBox->setValue(input.ransacThreshold()); mUi->baselineXSpinBox->setValue(input.baselineX()); mUi->baselineYSpinBox->setValue(input.baselineY()); mUi->baselineZSpinBox->setValue(input.baselineZ()); mUi->iterativeMethodComboBox->setCurrentIndex(input.iterativeMethod()); mUi->iterativeIterationsSpinBox->setValue(input.iterativeIterations()); mUi->iterativeInitialSigmaSpinBox->setValue(input.iterativeInitialSigma()); mUi->iterativeFactorSigmaSpinBox->setValue(input.iterativeFactorSigma()); mUi->manualXSpinBox->setValue(input.manualX()); mUi->manualYSpinBox->setValue(input.manualY()); mUi->manualZSpinBox->setValue(input.manualZ()); mUi->manualPitchSpinBox->setValue(input.manualPitch()); mUi->manualYawSpinBox->setValue(input.manualYaw()); mUi->manualRollSpinBox->setValue(input.manualRoll()); mUi->zdirXSpinBox->setValue(input.zdirX()); mUi->zdirYSpinBox->setValue(input.zdirY()); mUi->zdirZSpinBox->setValue(input.zdirZ()); mUi->autoZCheckBox->setChecked(input.autoZ()); mUi->autoShiftCheckBox->setChecked(input.autoShift()); mUi->preShiftSpinBox->setValue(input.preShift()); mUi->guessShiftThresholdSpinBox->setValue(input.guessShiftThreshold()); blockSignals(wasBlocked); emit paramsChanged(); }
void kore::Camera::setPosition(const glm::vec3& v3Pos) { // Directly set the position to the inverse view-matirx m_matViewInverse[ 3 ] = glm::vec4(v3Pos, 1.0f); // Now calculate the inverse translation for the // view-matrix as a linear combination of the rotational basis-vectors glm::vec3 v3Side = getSide(); glm::vec3 v3Up = getUp(); glm::vec3 v3Forward = getForward(); glm::vec3 v3ViewSide = glm::vec3(v3Side.x, v3Up.x, v3Forward.x); glm::vec3 v3ViewUp = glm::vec3(v3Side.y, v3Up.y, v3Forward.y); glm::vec3 v3ViewForward = glm::vec3(v3Side.z, v3Up.z, v3Forward.z); m_matView[ 3 ] = glm::vec4(v3ViewSide * -v3Pos.x + v3ViewUp * -v3Pos.y + v3ViewForward * -v3Pos.z, 1.0f); paramsChanged(); }
void Draw3dParametersControlWidget::setParameters(const Draw3dParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->styleComboBox->setCurrentIndex(input.style()); mUi->colorControlWidget->setParameters(input.color()); mUi->secondaryColorControlWidget->setParameters(input.secondaryColor()); mUi->showCaptionCheckBox->setChecked(input.showCaption()); mUi->fontSizeSpinBox->setValue(input.fontSize()); mUi->fontWidthSpinBox->setValue(input.fontWidth()); mUi->fontColorControlWidget->setParameters(input.fontColor()); mUi->textureCorrodinatesComboBox->setCurrentIndex(input.textureCorrodinates()); mUi->textureAlphaSpinBox->setValue(input.textureAlpha()); mUi->textureScaleSpinBox->setValue(input.textureScale()); mUi->decalMatrixTypeSpinBox->setValue(input.decalMatrixType()); mUi->decalLeftCamCheckBox->setChecked(input.decalLeftCam()); mUi->decalLeftAlphaSpinBox->setValue(input.decalLeftAlpha()); mUi->decalRightCamCheckBox->setChecked(input.decalRightCam()); mUi->decalRightAlphaSpinBox->setValue(input.decalRightAlpha()); blockSignals(wasBlocked); emit paramsChanged(); }
void QImWrite::setParams(const QJSValue ¶ms){ m_convertedParams.clear(); if ( params.isObject() ){ QJSValueIterator paramsIt(params); while( paramsIt.hasNext() ){ paramsIt.next(); if ( paramsIt.name() == "jpegQuality" ){ m_convertedParams.push_back(CV_IMWRITE_JPEG_QUALITY); m_convertedParams.push_back(paramsIt.value().toInt()); } else if ( paramsIt.name() == "pngCompression" ){ m_convertedParams.push_back(CV_IMWRITE_PNG_COMPRESSION); m_convertedParams.push_back(paramsIt.value().toInt()); } else if ( paramsIt.name() == "pxmBinary" ){ m_convertedParams.push_back(CV_IMWRITE_PXM_BINARY); m_convertedParams.push_back(paramsIt.value().toInt()); } } } m_params = params; emit paramsChanged(); }
void CalibrationDrawHelpersParametersControlWidget::setParameters(const CalibrationDrawHelpersParameters &input) { // Block signals to send them all at once bool wasBlocked = blockSignals(true); mUi->backendComboBox->setCurrentIndex(input.backend()); mUi->scaleForCamerasSpinBox->setValue(input.scaleForCameras()); mUi->gridStepForCamerasSpinBox->setValue(input.gridStepForCameras()); mUi->useTexturesForCamerasCheckBox->setChecked(input.useTexturesForCameras()); mUi->printNamesCheckBox->setChecked(input.printNames()); mUi->billboardNamesCheckBox->setChecked(input.billboardNames()); mUi->preferReprojectedCheckBox->setChecked(input.preferReprojected()); mUi->forceKnownCheckBox->setChecked(input.forceKnown()); mUi->privateColorCheckBox->setChecked(input.privateColor()); mUi->largePointsCheckBox->setChecked(input.largePoints()); mUi->drawFixtureCamsCheckBox->setChecked(input.drawFixtureCams()); mUi->solidCamerasCheckBox->setChecked(input.solidCameras()); mUi->drawObservationsCheckBox->setChecked(input.drawObservations()); mUi->drawTrueLinesCheckBox->setChecked(input.drawTrueLines()); mUi->projectionRayLengthSpinBox->setValue(input.projectionRayLength()); mUi->drawRaysCheckBox->setChecked(input.drawRays()); blockSignals(wasBlocked); emit paramsChanged(); }
ChartWidget::ChartWidget(MainScope* mainS, QWidget* parent) : QWidget(parent) { Q_ASSERT(mainS != NULL); Q_ASSERT(mainS->chart() != NULL); setMouseTracking(true); setFocusPolicy(Qt::StrongFocus); m_mainS = mainS; m_chartS = mainS->chart(); m_pixmap = m_chartS->pixmap(); m_statusbar = NULL; m_lblStatus = NULL; m_bDragging = false; m_bSelecting = false; m_bForceStatusUpdate = false; m_recordingEadWave = NULL; m_recordingFidWave = NULL; setupWidgets(); //m_timerUpdate = new QTimer(this); connect(m_chartS, SIGNAL(paramsChanged()), this, SLOT(update())); connect(m_chartS, SIGNAL(recordingLabelVisibleChanged(bool)), this, SLOT(on_scope_recordingLabelVisibleChanged(bool))); connect(m_chartS, SIGNAL(recordingLabelTextChanged(QString)), this, SLOT(on_scope_recordingLabelTextChanged(QString))); connect(m_chartS, SIGNAL(timebaseChanged(QString)), this, SLOT(on_scope_timebaseChanged(QString))); connect(m_chartS, SIGNAL(scrollMaxChanged(int)), this, SLOT(on_scope_scrollMaxChanged(int))); connect(m_chartS, SIGNAL(scrollPageStepChanged(int)), this, SLOT(on_scope_scrollPageStepChanged(int))); connect(m_chartS, SIGNAL(scrollSingleStepChanged(int)), this, SLOT(on_scope_scrollSingleStepChanged(int))); connect(m_chartS, SIGNAL(scrollValueChanged(int)), m_scrollbar, SLOT(setValue(int))); connect(m_scrollbar, SIGNAL(valueChanged(int)), m_chartS, SLOT(setSampleOffset(int))); }
//------------------------------------------------------------------------------ View3D::View3D(GeometryCollection* geometries, const QGLFormat& format, QWidget *parent) : QGLWidget(format, parent), m_camera(false, false), m_mouseButton(Qt::NoButton), m_explicitCursorPos(false), m_cursorPos(0), m_prevCursorSnap(0), m_backgroundColor(60, 50, 50), m_drawBoundingBoxes(true), m_drawCursor(true), m_drawAxes(true), m_drawGrid(false), m_badOpenGL(false), m_shaderProgram(), m_geometries(geometries), m_selectionModel(0), m_shaderParamsUI(0), m_incrementalFrameTimer(0), m_incrementalFramebuffer(0), m_incrementalDraw(false), m_drawAxesBackground(QImage(":/resource/axes.png")), m_drawAxesLabelX(QImage(":/resource/x.png")), m_drawAxesLabelY(QImage(":/resource/y.png")), m_drawAxesLabelZ(QImage(":/resource/z.png")), m_cursorVertexArray(0), m_axesVertexArray(0), m_gridVertexArray(0), m_quadVertexArray(0), m_quadLabelVertexArray(0), m_devicePixelRatio(1.0) { connect(m_geometries, SIGNAL(layoutChanged()), this, SLOT(geometryChanged())); //connect(m_geometries, SIGNAL(destroyed()), this, SLOT(modelDestroyed())); connect(m_geometries, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(geometryChanged())); connect(m_geometries, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(geometryInserted(const QModelIndex&, int,int))); connect(m_geometries, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(geometryChanged())); setSelectionModel(new QItemSelectionModel(m_geometries, this)); setFocusPolicy(Qt::StrongFocus); setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); setFocus(); m_camera.setClipFar(FLT_MAX*0.5f); //using FLT_MAX appears to cause issues under OS X for Qt to handle // Setting a good value for the near camera clipping plane is difficult // when trying to show a large variation of length scales: Setting a very // small value allows us to see objects very close to the camera; the // tradeoff is that this reduces the resolution of the z-buffer leading to // z-fighting in the distance. m_camera.setClipNear(1); connect(&m_camera, SIGNAL(projectionChanged()), this, SLOT(restartRender())); connect(&m_camera, SIGNAL(viewChanged()), this, SLOT(restartRender())); makeCurrent(); m_shaderProgram.reset(new ShaderProgram()); connect(m_shaderProgram.get(), SIGNAL(uniformValuesChanged()), this, SLOT(restartRender())); connect(m_shaderProgram.get(), SIGNAL(shaderChanged()), this, SLOT(restartRender())); connect(m_shaderProgram.get(), SIGNAL(paramsChanged()), this, SLOT(setupShaderParamUI())); m_incrementalFrameTimer = new QTimer(this); m_incrementalFrameTimer->setSingleShot(false); connect(m_incrementalFrameTimer, SIGNAL(timeout()), this, SLOT(updateGL())); }
//*************************************************************************** void Kwave::FilterPlugin::run(QStringList params) { Kwave::UndoTransactionGuard *undo_guard = 0; m_pause = false; if (!interpreteParameters(params)) m_params = params; sample_index_t first, last; QList<unsigned int> tracks; selection(&tracks, &first, &last, true); // switch to interactive mode in pre-listen mode Kwave::StreamObject::setInteractive(m_listen); // create all objects Kwave::MultiTrackReader source( (m_listen) ? Kwave::FullSnapshot : Kwave::SinglePassForward, signalManager(), tracks, first, last); Kwave::SampleSource *filter = createFilter(tracks.count()); Q_ASSERT(filter); if (m_listen) { // pre-listen mode Q_ASSERT(m_sink); } else { // normal mode, with undo undo_guard = new(std::nothrow) Kwave::UndoTransactionGuard(*this, actionName()); Q_ASSERT(undo_guard); if (!undo_guard) { if (filter) delete filter; Kwave::StreamObject::setInteractive(false); return; } m_sink = new(std::nothrow) MultiTrackWriter(signalManager(), tracks, Kwave::Overwrite, first, last); Q_ASSERT(m_sink); } if (!filter || !m_sink || m_sink->done()) { if (filter) delete filter; if (undo_guard) delete undo_guard; if (m_sink) delete m_sink; m_sink = 0; Kwave::StreamObject::setInteractive(false); return; } // set up the progress dialog when in processing (not pre-listen) mode if (!m_listen) { connect(&source, SIGNAL(progress(qreal)), this, SLOT(updateProgress(qreal)), Qt::BlockingQueuedConnection); } // force initial update of the filter settings updateFilter(filter, true); // connect them Kwave::connect(source, SIGNAL(output(Kwave::SampleArray)), *filter, SLOT(input(Kwave::SampleArray))); Kwave::connect(*filter, SIGNAL(output(Kwave::SampleArray)), *m_sink, SLOT(input(Kwave::SampleArray))); // transport the samples while (!shouldStop() && (!source.done() || m_listen)) { // process one step source.goOn(); filter->goOn(); // watch out for changed parameters when in // pre-listen mode if (m_listen && paramsChanged()) { updateFilter(filter); } if (m_listen && source.done()) { // start the next loop source.reset(); continue; } // this lets the process wait if the user pressed cancel // and the confirm_cancel dialog is active while (m_pause && !shouldStop()) sleep(1); } // cleanup if (filter) delete filter; if (m_sink) delete m_sink; m_sink = 0; if (undo_guard) delete undo_guard; m_pause = false; m_listen = false; Kwave::StreamObject::setInteractive(false); }