Exemple #1
0
void DatapickerImage::initSceneParameters() {
	setRotationAngle(0.0);
	setminSegmentLength(30);
	setPointSeparation(30);

    ReferencePoints axisPoints = d->axisPoints;
	axisPoints.ternaryScale = 1;
	axisPoints.type = DatapickerImage::Cartesian;
	setAxisPoints(axisPoints);

	EditorSettings settings;
	settings.foregroundThresholdHigh = 90;
	settings.foregroundThresholdLow = 30;
	settings.hueThresholdHigh = 360;
	settings.hueThresholdLow = 0;
	settings.intensityThresholdHigh = 100;
	settings.intensityThresholdLow = 20;
	settings.saturationThresholdHigh = 100;
	settings.saturationThresholdLow = 30;
	settings.valueThresholdHigh = 90;
	settings.valueThresholdLow = 30;
	setSettings(settings);

    DatapickerImage::PointsType plotPointsType = DatapickerImage::AxisPoints;
    setPlotPointsType(plotPointsType);
}
Exemple #2
0
ImageKnob::ImageKnob(const ImageKnob& imageKnob)
    : Widget(imageKnob.getParentWindow()),
      fImage(imageKnob.fImage),
      fMinimum(imageKnob.fMinimum),
      fMaximum(imageKnob.fMaximum),
      fValue(imageKnob.fValue),
      fOrientation(imageKnob.fOrientation),
      fRotationAngle(imageKnob.fRotationAngle),
      fDragging(false),
      fLastX(0),
      fLastY(0),
      fCallback(imageKnob.fCallback),
      fIsImgVertical(imageKnob.fIsImgVertical),
      fImgLayerSize(imageKnob.fImgLayerSize),
      fImgLayerCount(imageKnob.fImgLayerCount),
      fKnobArea(imageKnob.fKnobArea),
      fTextureId(0)
{
    setSize(fImgLayerSize, fImgLayerSize);

    if (fRotationAngle != 0)
    {
        // force new texture creation
        fRotationAngle = 0;
        setRotationAngle(imageKnob.fRotationAngle);
    }
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void RotateSampleRefFrame::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
  reader->openFilterGroup(this, index);
  setCellAttributeMatrixPath( reader->readDataArrayPath("CellAttributeMatrixPath", getCellAttributeMatrixPath() ) );
  setRotationAxis( reader->readFloatVec3("RotationAxis", getRotationAxis() ) );
  setRotationAngle( reader->readValue("RotationAngle", getRotationAngle()) );
  reader->closeFilterGroup();
}
void EllipseScatterer::setParamFromWidget( ) {
    //QLOG_DEBUG() << "EllipseScatterer::setParamFromWidget";
    EllipseParam param = innerState->form.getParam();
    setRect( param.rect );
    setStartAngle( param.startAngle );
    setSpanAngle( param.spanAngle );
    setRotationAngle( param.rotationAngle );
    paint( state->scene, state->xMin, state->xMax, state->yMin, state->yMax );
}
Exemple #5
0
int QPinchGesture::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QGesture::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast<int*>(_v) = QFlag(totalChangeFlags()); break;
        case 1: *reinterpret_cast<int*>(_v) = QFlag(changeFlags()); break;
        case 2: *reinterpret_cast< qreal*>(_v) = totalScaleFactor(); break;
        case 3: *reinterpret_cast< qreal*>(_v) = lastScaleFactor(); break;
        case 4: *reinterpret_cast< qreal*>(_v) = scaleFactor(); break;
        case 5: *reinterpret_cast< qreal*>(_v) = totalRotationAngle(); break;
        case 6: *reinterpret_cast< qreal*>(_v) = lastRotationAngle(); break;
        case 7: *reinterpret_cast< qreal*>(_v) = rotationAngle(); break;
        case 8: *reinterpret_cast< QPointF*>(_v) = startCenterPoint(); break;
        case 9: *reinterpret_cast< QPointF*>(_v) = lastCenterPoint(); break;
        case 10: *reinterpret_cast< QPointF*>(_v) = centerPoint(); break;
        }
        _id -= 11;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setTotalChangeFlags(QFlag(*reinterpret_cast<int*>(_v))); break;
        case 1: setChangeFlags(QFlag(*reinterpret_cast<int*>(_v))); break;
        case 2: setTotalScaleFactor(*reinterpret_cast< qreal*>(_v)); break;
        case 3: setLastScaleFactor(*reinterpret_cast< qreal*>(_v)); break;
        case 4: setScaleFactor(*reinterpret_cast< qreal*>(_v)); break;
        case 5: setTotalRotationAngle(*reinterpret_cast< qreal*>(_v)); break;
        case 6: setLastRotationAngle(*reinterpret_cast< qreal*>(_v)); break;
        case 7: setRotationAngle(*reinterpret_cast< qreal*>(_v)); break;
        case 8: setStartCenterPoint(*reinterpret_cast< QPointF*>(_v)); break;
        case 9: setLastCenterPoint(*reinterpret_cast< QPointF*>(_v)); break;
        case 10: setCenterPoint(*reinterpret_cast< QPointF*>(_v)); break;
        }
        _id -= 11;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 11;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 11;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemple #6
0
ScreenPaintData::ScreenPaintData(const ScreenPaintData &other)
    : PaintData()
{
    translate(other.translation());
    setXScale(other.xScale());
    setYScale(other.yScale());
    setZScale(other.zScale());
    setRotationOrigin(other.rotationOrigin());
    setRotationAxis(other.rotationAxis());
    setRotationAngle(other.rotationAngle());
}
Exemple #7
0
ScreenPaintData &ScreenPaintData::operator=(const ScreenPaintData &rhs)
{
    setXScale(rhs.xScale());
    setYScale(rhs.yScale());
    setZScale(rhs.zScale());
    setXTranslation(rhs.xTranslation());
    setYTranslation(rhs.yTranslation());
    setZTranslation(rhs.zTranslation());
    setRotationOrigin(rhs.rotationOrigin());
    setRotationAxis(rhs.rotationAxis());
    setRotationAngle(rhs.rotationAngle());
    return *this;
}
Exemple #8
0
ScreenPaintData::ScreenPaintData(const ScreenPaintData &other)
    : PaintData()
    , d(new Private())
{
    translate(other.translation());
    setXScale(other.xScale());
    setYScale(other.yScale());
    setZScale(other.zScale());
    setRotationOrigin(other.rotationOrigin());
    setRotationAxis(other.rotationAxis());
    setRotationAngle(other.rotationAngle());
    d->projectionMatrix = other.d->projectionMatrix;
}
Exemple #9
0
	// очищае?сцен?
	void RenderBoxScene::clearScene()
	{
		setRotationAngle(Ogre::Degree(0));

		if (mScene)
		{
			mScene->destroyAllEntities();
			mNode->removeAndDestroyAllChildren();
		}

		mEntity = nullptr;
		mAnimationState = nullptr;
	}
Exemple #10
0
ScreenPaintData &ScreenPaintData::operator=(const ScreenPaintData &rhs)
{
    setXScale(rhs.xScale());
    setYScale(rhs.yScale());
    setZScale(rhs.zScale());
    setXTranslation(rhs.xTranslation());
    setYTranslation(rhs.yTranslation());
    setZTranslation(rhs.zTranslation());
    setRotationOrigin(rhs.rotationOrigin());
    setRotationAxis(rhs.rotationAxis());
    setRotationAngle(rhs.rotationAngle());
    d->projectionMatrix = rhs.d->projectionMatrix;
    d->outputGeometry = rhs.d->outputGeometry;
    return *this;
}
Exemple #11
0
int RenderArea::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setFillRule((*reinterpret_cast< Qt::FillRule(*)>(_a[1]))); break;
        case 1: setFillGradient((*reinterpret_cast< const QColor(*)>(_a[1])),(*reinterpret_cast< const QColor(*)>(_a[2]))); break;
        case 2: setPenWidth((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: setPenColor((*reinterpret_cast< const QColor(*)>(_a[1]))); break;
        case 4: setRotationAngle((*reinterpret_cast< int(*)>(_a[1]))); break;
        }
        _id -= 5;
    }
    return _id;
}
WindowPaintData::WindowPaintData(const WindowPaintData &other)
    : PaintData()
    , quads(other.quads)
    , shader(other.shader)
    , d(new WindowPaintDataPrivate())
{
    setXScale(other.xScale());
    setYScale(other.yScale());
    setZScale(other.zScale());
    translate(other.translation());
    setRotationOrigin(other.rotationOrigin());
    setRotationAxis(other.rotationAxis());
    setRotationAngle(other.rotationAngle());
    setOpacity(other.opacity());
    setDecorationOpacity(other.decorationOpacity());
    setSaturation(other.saturation());
    setBrightness(other.brightness());
}
Exemple #13
0
WindowPaintData::WindowPaintData(const WindowPaintData &other)
    : PaintData()
    , quads(other.quads)
    , shader(other.shader)
    , d(new WindowPaintDataPrivate())
{
    setXScale(other.xScale());
    setYScale(other.yScale());
    setZScale(other.zScale());
    translate(other.translation());
    setRotationOrigin(other.rotationOrigin());
    setRotationAxis(other.rotationAxis());
    setRotationAngle(other.rotationAngle());
    setOpacity(other.opacity());
    setSaturation(other.saturation());
    setBrightness(other.brightness());
    setScreen(other.screen());
    setCrossFadeProgress(other.crossFadeProgress());
    setProjectionMatrix(other.projectionMatrix());
    setModelViewMatrix(other.modelViewMatrix());
    d->screenProjectionMatrix = other.d->screenProjectionMatrix;
}
	// очищает сцену
	void RenderBoxWrap::clearScene()
	{
		setRotationAngle(Ogre::Degree(0));

		//if (mEntity) {
			//Ogre::SkeletonManager::getSingleton().remove();
			//mNode->detachObject(mEntity);
		if (mScene)
		{
			mScene->destroyAllEntities();
			mNode->removeAndDestroyAllChildren();
		}
		mVectorEntity.clear();

		mEntity = 0;
		mEntityState = nullptr;

		mSyncTime = 0.0f;
		mNodeForSync = nullptr;
		mSceneManagerForSync = nullptr;
		//}
	}
Exemple #15
0
void LotteryRotateView::rotatingHandler(float dt){
    m_ftimeGap4 += dt;
//    CCLOG("m_ftimeGap4:%f", m_ftimeGap4);
    float angleGap = 10.0f;
    if (m_hasGetReward)
    {
        angleGap = fabs(m_fEndAngle) * (((100.0f-m_fTimeIdx3*(100.0f/m_fTimeCnt3))*(100.0f-m_fTimeIdx3*(100.0f/m_fTimeCnt3)) - (100.0f-(m_fTimeIdx3+1)*(100.0f/m_fTimeCnt3))*(100.0f-(m_fTimeIdx3+1)*(100.0f/m_fTimeCnt3)))/(100.0f*100.0f));
    }
    
    float rotateToAngle = m_rotateAngle;
    float radians = CC_DEGREES_TO_RADIANS(angleGap);
    
//    CCLOG("cctouchEND:%f, m_fEndTime3:%f, m_fTimeCnt3:%d", m_fEndAngle, m_fEndTime3, m_fTimeCnt3);
//    CCLOG("rotatingHandler-angleGap:%f, rotateToAngle:%f, m_fEndAngle:%f,radians:%f", angleGap, m_rotateAngle, m_fEndAngle,radians);
    if (m_tScrollAngel > 0) {
        
        if (rotateToAngle >= m_fEndAngle && m_hasGetReward) {
            rotateFinished();
            return;
        }
    }
    else {
        angleGap = -angleGap;
        radians = CC_DEGREES_TO_RADIANS(angleGap);
        if (rotateToAngle <= m_fEndAngle && m_hasGetReward) {
            rotateFinished();
            return;
        }
    }
    
    if (m_ftimeGap4 > 2.2f && !m_isSendNotify0)
    {
        m_isSendNotify0 = true;
        CCDictionary* dict = CCDictionary::create();
        dict->setObject(ccs("REMOVEPARTICLE"), "key");
        dict->setObject(ccs("1"), "value");
        CCSafeNotificationCenter::sharedNotificationCenter()->postNotification(LOTTERYROTATEVIEW, dict);
        
        m_startAddCnt2 = m_fTimeCnt3-m_fTimeIdx3;
    }
    if (abs(m_rotateAngle*2.0) > abs(m_fEndAngle) && !m_isSendNotify1)
    {
        m_isSendNotify1 = true;
        CCDictionary* dict = CCDictionary::create();
        dict->setObject(ccs("REMOVEPARTICLE"), "key");
        dict->setObject(ccs("0"), "value");
        CCSafeNotificationCenter::sharedNotificationCenter()->postNotification(LOTTERYROTATEVIEW, dict);
        
        m_startAddCnt1 = m_fTimeCnt3-m_fTimeIdx3;
    }
    int startAddCnt;
    startAddCnt=(m_startAddCnt1>m_startAddCnt2?m_startAddCnt1:m_startAddCnt2);
    
    setRotationAngle(radians);
    m_rotateAngle += angleGap;
    
    if (m_fTimeCnt3 != 0 && startAddCnt > 0 && LotteryController::shared()->rotateType==1 && m_fTimeIdx3 >= (m_fTimeCnt3 - startAddCnt)) {//0-普通,1-连转10次
        for (int i=0; i<10; i++) {
            int idx = (m_fTimeCnt3 - startAddCnt)+(startAddCnt*(0.1*i));
            if(m_fTimeIdx3==idx){
                if(i==0){
                    addRewardsNodeBg();
                }
                addRewardsNodeByIndex(i);
            }
        }
    }
    m_fTimeIdx3 = m_fTimeIdx3 + 1;
    if (m_fTimeIdx3 >= m_fTimeCnt3 && m_hasGetReward)
    {
        rotateFinished();
        addShowItemListView();
        return;
    }
}
Exemple #16
0
void LotteryRotateView::onTouchMoved(CCTouch* touch, CCEvent* event)
{
    if (!this->isVisible())
    {
        return;
    }
    if (m_rotating)
    {
        return;
    }
    if (!m_enabled) {
        return;
    }
    
    if (m_pTouches->containsObject(touch))
    {
        if (m_pTouches->count() == 1 && m_bDragging)
        {
            // scrolling
            CCPoint moveDistance;
            CCPoint lastPoint = touch->getPreviousLocation();
            CCPoint nowPoint = touch->getLocation();
            lastPoint = m_pContainer->convertToNodeSpace(lastPoint);
            nowPoint = m_pContainer->convertToNodeSpace(nowPoint);
            CCPoint lastLine = ccpSub(lastPoint, ccp(0, 0));
            CCPoint nowLine = ccpSub(nowPoint, ccp(0, 0));
            
            CCPoint startPoint = m_pContainer->convertToNodeSpace(touch->getStartLocation());
            float angle = CC_RADIANS_TO_DEGREES(ccpSub(nowPoint, startPoint).getAngle());
            CCLOG("angle:%f", angle);
            if (abs(angle) >= 60 && abs(angle) <= 120)
            {
                return;
            }
            
            moveDistance = ccpSub(nowPoint, m_tTouchPoint);
            if (!m_bTouchMoved)
            {
                moveDistance = CCPointZero;
            }
            
            m_tTouchPoint = nowPoint;
            m_bTouchMoved = true;
            float dis = 0.0f;
            dis = sqrtf(moveDistance.x*moveDistance.x + moveDistance.y*moveDistance.y);

            float inch = convertDistanceFromPointToInch(dis);
            if (!m_bTouchMoved && fabs(inch) < MOVE_INCH )
            {
                CCLOG("Invalid movement, distance = [%f, %f], disInch = %f", moveDistance.x, moveDistance.y, inch);
                m_pTouches->removeObject(touch);
                return;
            }
            m_lastTouchMoveTime = clock() / 1000;
            
            float angleGap = nowLine.getAngle(lastLine);
//            CCLOG("angleGap:%f", angleGap);
            setRotationAngle(-angleGap);
            
            m_tScrollAngel = CC_RADIANS_TO_DEGREES(-angleGap);
            
            if (m_tScrollAngel>=-360 && m_tScrollAngel<=-180) {
                m_tScrollAngel = m_tScrollAngel + 360;
            }
            else if (m_tScrollAngel<=360 && m_tScrollAngel>=180) {
                m_tScrollAngel = 360 - m_tScrollAngel;
            }
            
            this->setContentOffsetForMove();
        }
    }
}
Exemple #17
0
void ImageKnob::onClose()
{
    // delete old texture
    setRotationAngle(0);
}