void ActiveImageProxy::activeImageChangedSlot(const QString& uid) { if (mImage && mImage->getUid() == uid) return; if (mImage) { disconnect(mImage.get(), SIGNAL(transformChanged()), this, SIGNAL(transformChanged())); disconnect(mImage.get(), SIGNAL(propertiesChanged()), this, SIGNAL(propertiesChanged())); disconnect(mImage->getLandmarks().get(), SIGNAL(landmarkRemoved(QString)), this, SIGNAL(landmarkRemoved(QString))); disconnect(mImage->getLandmarks().get(), SIGNAL(landmarkAdded(QString)), this, SIGNAL(landmarkAdded(QString))); disconnect(mImage.get(), SIGNAL(vtkImageDataChanged()), this, SIGNAL(vtkImageDataChanged())); disconnect(mImage.get(), SIGNAL(transferFunctionsChanged()), this, SIGNAL(transferFunctionsChanged())); disconnect(mImage.get(), SIGNAL(clipPlanesChanged()), this, SIGNAL(clipPlanesChanged())); disconnect(mImage.get(), SIGNAL(cropBoxChanged()), this, SIGNAL(cropBoxChanged())); } mImage = mActiveData->getActive<Image>(); if (mImage) { connect(mImage.get(), SIGNAL(transformChanged()), this, SIGNAL(transformChanged())); connect(mImage.get(), SIGNAL(propertiesChanged()), this, SIGNAL(propertiesChanged())); connect(mImage->getLandmarks().get(), SIGNAL(landmarkRemoved(QString)), this, SIGNAL(landmarkRemoved(QString))); connect(mImage->getLandmarks().get(), SIGNAL(landmarkAdded(QString)), this, SIGNAL(landmarkAdded(QString))); connect(mImage.get(), SIGNAL(vtkImageDataChanged()), this, SIGNAL(vtkImageDataChanged())); connect(mImage.get(), SIGNAL(transferFunctionsChanged()), this, SIGNAL(transferFunctionsChanged())); connect(mImage.get(), SIGNAL(clipPlanesChanged()), this, SIGNAL(clipPlanesChanged())); connect(mImage.get(), SIGNAL(cropBoxChanged()), this, SIGNAL(cropBoxChanged())); } }
void QPaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::PixmapFragmentHints /*hints*/) { if (pixmap.isNull()) return; qreal oldOpacity = state()->opacity; QTransform oldTransform = state()->matrix; for (int i = 0; i < fragmentCount; ++i) { QTransform transform = oldTransform; transform.translate(fragments[i].x, fragments[i].y); transform.rotate(fragments[i].rotation); state()->opacity = oldOpacity * fragments[i].opacity; state()->matrix = transform; opacityChanged(); transformChanged(); qreal w = fragments[i].scaleX * fragments[i].width; qreal h = fragments[i].scaleY * fragments[i].height; QRectF sourceRect(fragments[i].sourceLeft, fragments[i].sourceTop, fragments[i].width, fragments[i].height); drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, sourceRect); } state()->opacity = oldOpacity; state()->matrix = oldTransform; opacityChanged(); transformChanged(); }
void SphereMetricRep2D::setSliceProxy(SliceProxyPtr sliceProxy) { if (mSliceProxy) disconnect(mSliceProxy.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(setModified())); mSliceProxy = sliceProxy; if (mSliceProxy) connect(mSliceProxy.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(setModified())); this->setModified(); }
void OrientationAnnotationSmartRep::setSliceProxy(SliceProxyPtr slicer) { if (mSlicer) { disconnect(mSlicer.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(transformChangedSlot())); } mSlicer = slicer; if (mSlicer) { connect(mSlicer.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(transformChangedSlot())); this->transformChangedSlot(); } }
void GeometricRep2D::setSliceProxy(SliceProxyPtr slicer) { if (mSlicer) { disconnect(mSlicer.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(transformChangedSlot())); } mSlicer = slicer; if (mSlicer) { connect(mSlicer.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(transformChangedSlot())); this->transformChangedSlot(); } }
/** Called when the moving data in the RegistrationManager has changed. * Update connections. */ void ManualImageRegistrationWidget::movingDataChanged() { if (mConnectedMovingImage) disconnect(mConnectedMovingImage.get(), SIGNAL(transformChanged()), this, SLOT(imageMatrixChanged())); mConnectedMovingImage = mServices->registration()->getMovingData(); if (mConnectedMovingImage) connect(mConnectedMovingImage.get(), SIGNAL(transformChanged()), this, SLOT(imageMatrixChanged())); mLabel->setText(this->getDescription()); mMatrixWidget->setEnabled(mConnectedMovingImage!=0); this->imageMatrixChanged(); }
void FrameTreeWidget::dataLoadedSlot() { for (std::map<QString, DataPtr>::iterator iter=mConnectedData.begin(); iter!=mConnectedData.end(); ++iter) { disconnect(iter->second.get(), SIGNAL(transformChanged()), this, SLOT(setModified())); } mConnectedData = mPatientService->getDatas(); for (std::map<QString, DataPtr>::iterator iter=mConnectedData.begin(); iter!=mConnectedData.end(); ++iter) { connect(iter->second.get(), SIGNAL(transformChanged()), this, SLOT(setModified())); } this->setModified(); }
ResolutionCalculator::ResolutionCalculator(ItemStore<RulerItem>& r, LaueImage* img, QWidget* _parent) : QWidget(_parent), ui(new Ui::ResolutionCalculator), rulers(r), resolutionsLocked(false), image(img) { ui->setupUi(this); hRes = -1.0; vRes = -1.0; ui->rulerView->verticalHeader()->setDefaultSectionSize(ui->rulerView->fontMetrics().lineSpacing()); ui->rulerView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); model = new RulerModel(rulers, img); ui->rulerView->setModel(model); ui->rulerView->setItemDelegate(new NumberEditDelegate); connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotCalcResolution())); connect(image->data(), SIGNAL(transformChanged()), this, SLOT(slotCalcResolution())); connect(ui->rulerView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotSelectionChanged())); connect(&r, SIGNAL(itemClicked(int)), ui->rulerView, SLOT(selectRow(int))); QShortcut* deleteShortcut = new QShortcut(Qt::Key_Delete, ui->rulerView); connect(deleteShortcut, SIGNAL(activated()), this, SLOT(deletePressed())); slotCalcResolution(); }
PhotoKitView::PhotoKitView(QWidget *parent) : QGraphicsView(parent),mPressed(false),mMachine(0),mCanTransform(true),mZoomOnMove(false) { //setDragMode(QGraphicsView::NoDrag); //setAlignment(Qt::AlignBottom); //setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setTransformationAnchor(QGraphicsView::AnchorViewCenter); setResizeAnchor(QGraphicsView::AnchorUnderMouse); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //TODO: always on when debug. setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //setBackgroundBrush(QBrush(Qt::gray)); mScene = new PhotoKitScene(this); setRenderingSystem(); mScene->setSceneRect(qApp->desktop()->rect()); setScene(mScene); mMachine = new TransformMachine;//QGraphicsItemAnimation; connect(mMachine, SIGNAL(transformChanged(QTransform)), SLOT(doTransform(QTransform))); QTimeLine *timer = new QTimeLine(kAniDuration); timer->setEasingCurve(QEasingCurve::OutQuad); timer->setFrameRange(0, 100); mMachine->setTimeLine(timer); }
void SliceProxy::changed() { SlicePlane plane = mCutplane->getPlane(); if (similar(plane, mLastEmittedSlicePlane)) return; mLastEmittedSlicePlane = plane; emit transformChanged(get_sMr()); }
void SlicePlaneClipper::setSlicer(SliceProxyPtr slicer) { if (mSlicer==slicer) return; if (mSlicer) { disconnect(mSlicer.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(changedSlot())); } mSlicer = slicer; if (mSlicer) { connect(mSlicer.get(), SIGNAL(transformChanged(Transform3D)), this, SLOT(changedSlot())); } this->updateClipPlane(); this->changedSlot(); }
void QGraphicsRotation3D::setAxis(const QVector3D &value) { Q_D(QGraphicsRotation3D); if (d->axis != value) { d->axis = value; emit transformChanged(); emit axisChanged(); } }
void GeometricRep2D::setMesh(MeshPtr mesh) { if (mesh == mMesh) return; if (mMesh) { disconnect(mMesh.get(), SIGNAL(meshChanged()), this, SLOT(meshChangedSlot())); disconnect(mMesh.get(), SIGNAL(transformChanged()), this, SLOT(transformChangedSlot())); } mMesh = mesh; if (mMesh) { connect(mMesh.get(), SIGNAL(meshChanged()), this, SLOT(meshChangedSlot())); connect(mMesh.get(), SIGNAL(transformChanged()), this, SLOT(transformChangedSlot())); this->meshChangedSlot(); this->transformChangedSlot(); } }
UnsignedDerivedImage::UnsignedDerivedImage(ImagePtr base) : Image(base->getUid()+"_u", vtkImageDataPtr(), base->getName()) { this->mBase = base; // redirected signals: connect(base.get(), SIGNAL(transformChanged()), this, SIGNAL(transformChanged())); connect(base.get(), SIGNAL(propertiesChanged()), this, SIGNAL(propertiesChanged())); connect(base.get(), SIGNAL(clipPlanesChanged()), this, SIGNAL(clipPlanesChanged())); connect(base.get(), SIGNAL(cropBoxChanged()), this, SIGNAL(cropBoxChanged())); // override signals: connect(base.get(), SIGNAL(transferFunctionsChanged()), this, SLOT(unsignedTransferFunctionsChangedSlot())); connect(base.get(), SIGNAL(vtkImageDataChanged()), this, SLOT(unsignedImageChangedSlot())); connect(this, SIGNAL(transferFunctionsChanged()), this, SLOT(testSlot())); this->unsignedImageChangedSlot(); this->unsignedTransferFunctionsChangedSlot(); }
void QGraphicsRotation3D::setAngle(qreal value) { Q_D(QGraphicsRotation3D); if (d->angle != value) { d->angle = value; emit transformChanged(); emit angleChanged(); } }
void PointMetric::setCoordinate(const Vector3D& p) { if (p == mCoordinate) return; mCoordinate = p; this->resetCachedValues(); emit transformChanged(); }
void QGraphicsTranslation3D::setTranslate(const QVector3D &value) { Q_D(QGraphicsTranslation3D); if (d->translate != value) { d->translate = value; emit transformChanged(); emit translateChanged(); } }
void QGraphicsScale3D::setScale(const QVector3D &value) { Q_D(QGraphicsScale3D); if (d->scale != value) { d->scale = value; emit transformChanged(); emit scaleChanged(); } }
void QGraphicsScale3D::setOrigin(const QVector3D &value) { Q_D(QGraphicsScale3D); if (d->origin != value) { d->origin = value; emit transformChanged(); emit originChanged(); } }
void QGraphicsTranslation3D::setProgress(float value) { Q_D(QGraphicsTranslation3D); if (d->progress != value) { d->progress = value; emit transformChanged(); emit progressChanged(); } }
DonutMetric::DonutMetric(const QString& uid, const QString& name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider) : DataMetric(uid, name, dataManager, spaceProvider) { mArguments.reset(new MetricReferenceArgumentList(QStringList() << "position" << "direction")); connect(mArguments.get(), SIGNAL(argumentsChanged()), this, SIGNAL(transformChanged())); mRadius = 5; mThickness = 2; mHeight = 0; mFlat = true; }
void DataMetricRep::setDataMetric(DataMetricPtr value) { if (mMetric) { disconnect(mMetric.get(), SIGNAL(transformChanged()), this, SLOT(setModified())); disconnect(mMetric.get(), SIGNAL(propertiesChanged()), this, SLOT(setModified())); } mMetric = value; if (mMetric) { connect(mMetric.get(), SIGNAL(propertiesChanged()), this, SLOT(setModified())); connect(mMetric.get(), SIGNAL(transformChanged()), this, SLOT(setModified())); } this->clear(); this->setModified(); }
PointMetric::PointMetric(const QString& uid, const QString& name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider) : DataMetric(uid, name, dataManager, spaceProvider), mCoordinate(0,0,0), mSpace(CoordinateSystem::reference()) { mSpaceListener = mSpaceProvider->createListener(); mSpaceListener->setSpace(mSpace); connect(mSpaceListener.get(), SIGNAL(changed()), this, SLOT(resetCachedValues())); connect(mSpaceListener.get(), SIGNAL(changed()), this, SIGNAL(transformChanged())); }
void MetricReferenceArgumentList::set(int index, DataPtr p) { if (mArgument[index] == p) return; if (mArgument[index]) { disconnect(mArgument[index].get(), SIGNAL(transformChanged()), this, SIGNAL(argumentsChanged())); disconnect(mArgument[index].get(), SIGNAL(propertiesChanged()), this, SIGNAL(argumentsChanged())); } mArgument[index] = p; if (mArgument[index]) { connect(mArgument[index].get(), SIGNAL(transformChanged()), this, SIGNAL(argumentsChanged())); connect(mArgument[index].get(), SIGNAL(propertiesChanged()), this, SIGNAL(argumentsChanged())); } emit argumentsChanged(); }
void MetricNamesRep::setData(std::vector<DataPtr> data) { std::vector<DataMetricPtr> metrics = this->convertToMetrics(data); if (this->equal(metrics, mMetrics)) return; for (unsigned i=0; i<mMetrics.size(); ++i) { disconnect(mMetrics[i].get(), SIGNAL(transformChanged()), this, SLOT(setModified())); disconnect(mMetrics[i].get(), SIGNAL(propertiesChanged()), this, SLOT(setModified())); } mMetrics = metrics; for (unsigned i=0; i<mMetrics.size(); ++i) { connect(mMetrics[i].get(), SIGNAL(transformChanged()), this, SLOT(setModified())); connect(mMetrics[i].get(), SIGNAL(propertiesChanged()), this, SLOT(setModified())); } this->setColoredTextList(this->getAllMetricTexts(), Eigen::Array2d(0.98, 0.98)); }
void Transform::dirty(char matrixDirtyBits) { _matrixDirtyBits |= matrixDirtyBits; if (isTransformChangedSuspended()) { if (!isDirty(DIRTY_NOTIFY)) { suspendTransformChange(this); } } else { transformChanged(); } }
/** * Assign new fiber bundle object */ void FiberBundleRep::setBundle(MeshPtr bundle) { // Already has this bundle assigned if (hasBundle(bundle)) return; std::cout << "New fiber bundle assigned" << std::endl; if (mBundle) { disconnect(mBundle.get(), SIGNAL(transformChanged()), this, SLOT(bundleTransformChanged())); disconnect(mBundle.get(), SIGNAL(meshChanged()), this, SLOT(bundleChanged())); } mBundle = bundle; if (mBundle) { connect(mBundle.get(), SIGNAL(transformChanged()), this, SLOT(bundleTransformChanged())); connect(mBundle.get(), SIGNAL(meshChanged()), this, SLOT(bundleChanged())); } bundleChanged(); this->bundleTransformChanged(); }
ItemAnimation::ItemAnimation(QGraphicsItem *item, QObject *parent) : QObject(parent),mHide(false),mFade(None) { mMachine = new TransformMachine;//QGraphicsItemAnimation; QTimeLine *timer = new QTimeLine(1000); timer->setEasingCurve(QEasingCurve::OutQuad); timer->setFrameRange(0, 100); mMachine->setTimeLine(timer); connect(mMachine, SIGNAL(transformChanged(QTransform)), this, SLOT(setTransform(QTransform))); connect(mMachine, SIGNAL(zValueChanged(qreal)), this, SLOT(setZValue(qreal))); connect(mMachine, SIGNAL(posChanged(QPointF)), this, SLOT(setItemPos(QPointF))); connect(mMachine->timeLine(), SIGNAL(finished()), this, SLOT(tryHide())); connect(mMachine->timeLine(), SIGNAL(finished()), this, SIGNAL(finished())); setItem(item); }
CustomMetric::CustomMetric(const QString& uid, const QString& name, PatientModelServicePtr dataManager, SpaceProviderPtr spaceProvider) : DataMetric(uid, name, dataManager, spaceProvider), mShowDistanceMarkers(false), mDistanceMarkerVisibility(50) { mArguments.reset(new MetricReferenceArgumentList(QStringList() << "position" << "direction")); mArguments->setValidArgumentTypes(QStringList() << "pointMetric" << "frameMetric"); connect(mArguments.get(), SIGNAL(argumentsChanged()), this, SIGNAL(transformChanged())); connect(this, &CustomMetric::propertiesChanged, this, &CustomMetric::onPropertiesChanged); mDefineVectorUpMethod = mDefineVectorUpMethods.table; mModelUid = ""; mScaleToP1 = false; mOffsetFromP0 = 0.0; mOffsetFromP1 = 0.0; mRepeatDistance = 0.0; mTranslationOnly = false; mTextureFollowTool = false; }
void QBlitterPaintEngine::setState(QPainterState *s) { Q_D(QBlitterPaintEngine); d->lock(); QPaintEngineEx::setState(s); d->raster->setState(s); clipEnabledChanged(); penChanged(); brushChanged(); brushOriginChanged(); opacityChanged(); compositionModeChanged(); renderHintsChanged(); transformChanged(); d->updateClip(); }