• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setTransform函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setTransform函数的典型用法代码示例。如果您正苦于以下问题:C++ setTransform函数的具体用法?C++ setTransform怎么用?C++ setTransform使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setTransform函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setFlag

void CardItem::_initialize() {
    setFlag(QGraphicsItem::ItemIsMovable);
    m_opacityAtHome = 1.0;
    m_currentAnimation = NULL;
    _m_width = G_COMMON_LAYOUT.m_cardNormalWidth;
    _m_height = G_COMMON_LAYOUT.m_cardNormalHeight;
    _m_showFootnote = true;
    m_isSelected = false;
    _m_isUnknownGeneral = false;
    auto_back = true;
    frozen = false;
    resetTransform();
    setTransform(QTransform::fromTranslate(-_m_width / 2, -_m_height / 2), true);
    outerGlowEffectEnabled = false;
    outerGlowEffect = NULL;
    outerGlowColor = Qt::white;
    _transferButton = NULL;
    _transferable = false;
    _skinId = 0;
}
开发者ID:Holdlen2DH,项目名称:QSanguosha,代码行数:20,代码来源:carditem.cpp


示例2: setOccupied

void CoverPoint::unpackUpdate(NetConnection *conn, BitStream *stream)
{
   Parent::unpackUpdate(conn, stream);

   mSize = (Size)stream->readInt(4);

   setOccupied(stream->readFlag());

   mPeekLeft = stream->readFlag();
   mPeekRight = stream->readFlag();
   mPeekOver = stream->readFlag();

   if(stream->readFlag()) // TransformMask
   {
      mathRead(*stream, &mObjToWorld);
      mathRead(*stream, &mObjScale);

      setTransform(mObjToWorld);
   }
}
开发者ID:03050903,项目名称:Torque3D,代码行数:20,代码来源:coverPoint.cpp


示例3: tr

void DrawableImage::recalculateCoordinates (Expression::Scope* scope)
{
    if (image.isValid())
    {
        Point<float> resolved[3];
        bounds.resolveThreePoints (resolved, scope);

        const Point<float> tr (resolved[0] + (resolved[1] - resolved[0]) / (float) image.getWidth());
        const Point<float> bl (resolved[0] + (resolved[2] - resolved[0]) / (float) image.getHeight());

        AffineTransform t (AffineTransform::fromTargetPoints (resolved[0].x, resolved[0].y,
                                                              tr.x, tr.y,
                                                              bl.x, bl.y));

        if (t.isSingularity())
            t = AffineTransform();

        setTransform (t);
    }
}
开发者ID:COx2,项目名称:PizzaKnobFilter,代码行数:20,代码来源:juce_DrawableImage.cpp


示例4: ProxyComponent

        ProxyComponent (Component& c)
        {
            setWantsKeyboardFocus (false);
            setBounds (c.getBounds());
            setTransform (c.getTransform());
            setAlpha (c.getAlpha());
            setInterceptsMouseClicks (false, false);

            if (Component* const parent = c.getParentComponent())
                parent->addAndMakeVisible (this);
            else if (c.isOnDesktop() && c.getPeer() != nullptr)
                addToDesktop (c.getPeer()->getStyleFlags() | ComponentPeer::windowIgnoresKeyPresses);
            else
                jassertfalse; // seem to be trying to animate a component that's not visible..

            image = c.createComponentSnapshot (c.getLocalBounds(), false, getDesktopScaleFactor());

            setVisible (true);
            toBehind (&c);
        }
开发者ID:MartinHH,项目名称:JUCE,代码行数:20,代码来源:juce_ComponentAnimator.cpp


示例5: DiagramItem

//! [0]
DiagramDrawItem::DiagramDrawItem(const DiagramDrawItem& diagram)
	: DiagramItem(diagram.myContextMenu,diagram.parentItem(),0)
{

	myDiagramType=diagram.myDiagramType;
	// copy from general GraphcsItem
	setBrush(diagram.brush());
	setPen(diagram.pen());
	setTransform(diagram.transform());
	myPos2=diagram.myPos2;
	myPolygon=createPath();
	setPolygon(myPolygon);
	setFlag(QGraphicsItem::ItemIsMovable, true);
	setFlag(QGraphicsItem::ItemIsSelectable, true);
	setAcceptHoverEvents(true);
	myHoverPoint=-1;
	mySelPoint=-1;
	myHandlerWidth=2.0;

}
开发者ID:autoscatto,项目名称:retroshare,代码行数:21,代码来源:diagramdrawitem.cpp


示例6: QgsDebugMsg

void QgsGrassPlugin::mapsetChanged()
{
  QgsDebugMsg( "entered" );
  if ( !QgsGrass::activeMode() )
  {
    mRegionAction->setEnabled( false );
    mRegionBand->reset();
    mCloseMapsetAction->setEnabled( false );
  }
  else
  {
    mRegionAction->setEnabled( true );
    mCloseMapsetAction->setEnabled( true );

    QSettings settings;
    bool on = settings.value( "/GRASS/region/on", true ).toBool();
    mRegionAction->setChecked( on );
    switchRegion( on );

    QString gisdbase = QgsGrass::getDefaultGisdbase();
    QString location = QgsGrass::getDefaultLocation();
    try
    {
      mCrs = QgsGrass::crsDirect( gisdbase, location );
    }
    catch ( QgsGrass::Exception &e )
    {
      Q_UNUSED( e );
      QgsDebugMsg( "Cannot read GRASS CRS : " + QString( e.what() ) );
      mCrs = QgsCoordinateReferenceSystem();
    }
    QgsDebugMsg( "mCrs: " + mCrs.toWkt() );
    setTransform();
    redrawRegion();
  }

  if ( mTools )
  {
    mTools->mapsetChanged();
  }
}
开发者ID:yellow-sky,项目名称:QGIS,代码行数:41,代码来源:qgsgrassplugin.cpp


示例7: mathRead

void RenderMeshExample::unpackUpdate(NetConnection *conn, BitStream *stream)
{
   // Let the Parent read any info it sent
   Parent::unpackUpdate(conn, stream);

   if ( stream->readFlag() )  // TransformMask
   {
      mathRead(*stream, &mObjToWorld);
      mathRead(*stream, &mObjScale);

      setTransform( mObjToWorld );
   }

   if ( stream->readFlag() )  // UpdateMask
   {
      stream->read( &mMaterialName );

      if ( isProperlyAdded() )
         updateMaterial();
   }
}
开发者ID:fr1tz,项目名称:alux3d,代码行数:21,代码来源:renderMeshExample.cpp


示例8: draw

	virtual void draw(const GLMatrix4 &parentTransform, const GLMatrix4 &parentNormalTransform) 
	{
		if(tornado)
		{
			for(int i = 0; i < 4; i++)
				vertices[i].color = 0xFF0033CC;
		}
		else
		{
			for(int i = 0; i < 4; i++)
				vertices[i].color = 0xFFCC3300;
		}
		const GLMatrix4 &t = parentTransform * transform,
		&nt = parentNormalTransform * normTransform;
		bindVertexArray(vertices);
		setTransform(t, nt);

		glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
		
		drawChildren(t, nt);
	}
开发者ID:verngutz,项目名称:DNA,代码行数:21,代码来源:geometries.hpp


示例9: animateMove

void QQHuntPixmapItem::loadNextPixMap()
{
	if(! m_listPixmapProp.isEmpty())
	{
		m_animPixmapTimer.stop();
		QQPixmapProp pixmapProp = m_listPixmapProp.at(0);
		m_listPixmapProp.remove(0);
		m_currPixmapName = BASE_ANIM_PIX.append(pixmapProp.m_pixmapName);

		animateMove();
		QPixmap p = pixmap();

		int scaleX = pixmapProp.m_mirrorX ? -1 : 1;
		int scaleY = pixmapProp.m_mirrorY ? -1 : 1;
		setTransformOriginPoint(p.width() / 2, p.height() / 2);
		setTransform(QTransform().scale(scaleX, scaleY).rotateRadians(pixmapProp.m_rotationAngle, Qt::ZAxis));
		setPixmap(p);
		if(m_animPixmapTimerEnabled)
			m_animPixmapTimer.start();
	}
}
开发者ID:claudex,项目名称:quteqoin,代码行数:21,代码来源:qqhuntpixmapitem.cpp


示例10: rect

void ColorSchemeGraphicsItem::updateBrushes()
{
    const auto parent = dynamic_cast<QWidget*>(parentWidget());
    const auto penWidthF = 1.0 / DpiAware::devicePixelRatio(parent);

    for (uint i = 0; i < m_classes; ++i)
    {
        auto rect(m_rects[i]);

        auto color = m_scheme.colors(m_classes)[m_classes - i - 1];
        color = daltonize(color, m_deficiency);

        auto brush = RGBABrush(color);

        // this aligns the brush pattern with the rect (since there is no way to directly set the brush origin similar to a painter)
        brush.setTransform(QTransform::fromTranslate( // who cares ... :P
            m_margin + 1, (m_padding + penWidthF) * static_cast<qreal>(i) + m_margin + 1));

        rect->setBrush(brush);
    }
}
开发者ID:cginternals,项目名称:libzeug,代码行数:21,代码来源:ColorSchemeGraphicsItem.cpp


示例11: setCacheMode

void AbstractDesktopWidget::setRotation(float angle)
{
    d->mAngle = angle;
    setCacheMode(ItemCoordinateCache);
    QPointF center = boundingRect().center();
    QTransform mat = QTransform();
    mat.translate(center.x(), center.y());
    mat.rotate(d->mAngle, Qt::YAxis);
    mat.translate(-center.x(), -center.y());
    setTransform(mat);
    if (d->mAngle >= 180) {
        if (state() == ROTATED) {
            setState(VIEW);
        } else {
            setState(ROTATED);
        }
        resetMatrix();
        //setCacheMode(DeviceCoordinateCache);
        d->mAngle = 0;
    }
}
开发者ID:algometrix,项目名称:plexydesk,代码行数:21,代码来源:abstractdesktopwidget.cpp


示例12: basisForNormal

void TextureProjection::fitTexture (std::size_t width, std::size_t height, const Vector3& normal, const Winding& w,
		float s_repeat, float t_repeat)
{
	if (w.size() < 3) {
		return;
	}

	Matrix4 st2tex = m_texdef.getTransform((float) width, (float) height);

	// the current texture transform
	Matrix4 local2tex = st2tex;
	{
		Matrix4 xyz2st;
		basisForNormal(normal, xyz2st);
		matrix4_multiply_by_matrix4(local2tex, xyz2st);
	}

	// the bounds of the current texture transform
	AABB bounds;
	for (Winding::const_iterator i = w.begin(); i != w.end(); ++i) {
		Vector3 texcoord = matrix4_transformed_point(local2tex, (*i).vertex);
		aabb_extend_by_point_safe(bounds, texcoord);
	}
	bounds.origin.z() = 0;
	bounds.extents.z() = 1;

	// the bounds of a perfectly fitted texture transform
	AABB perfect(Vector3(s_repeat * 0.5, t_repeat * 0.5, 0), Vector3(s_repeat * 0.5, t_repeat * 0.5, 1));

	// the difference between the current texture transform and the perfectly fitted transform
	Matrix4 matrix(Matrix4::getTranslation(bounds.origin - perfect.origin));
	matrix4_pivoted_scale_by_vec3(matrix, bounds.extents / perfect.extents, perfect.origin);
	matrix4_affine_invert(matrix);

	// apply the difference to the current texture transform
	matrix4_premultiply_by_matrix4(st2tex, matrix);

	setTransform((float) width, (float) height, st2tex);
	m_texdef.normalise((float) width, (float) height);
}
开发者ID:AresAndy,项目名称:ufoai,代码行数:40,代码来源:TextureProjection.cpp


示例13: doUpdateTexImage

bool DeferredLayerUpdater::apply() {
    bool success = true;
    // These properties are applied the same to both layer types
    mLayer->setColorFilter(mColorFilter);
    mLayer->setAlpha(mAlpha, mMode);

    if (mSurfaceTexture.get()) {
        if (mNeedsGLContextAttach) {
            mNeedsGLContextAttach = false;
            mSurfaceTexture->attachToContext(mLayer->getTexture());
        }
        if (mUpdateTexImage) {
            mUpdateTexImage = false;
            doUpdateTexImage();
        }
        if (mTransform) {
            mLayer->getTransform().load(*mTransform);
            setTransform(0);
        }
    }
    return success;
}
开发者ID:AdrianoMartins,项目名称:platform_frameworks_base,代码行数:22,代码来源:DeferredLayerUpdater.cpp


示例14: setCacheMode

void DesktopWidget::spin()
{
    d->angle += 18;
    setCacheMode(ItemCoordinateCache);
    QPointF center = boundingRect().center();
    QTransform mat = QTransform();
    mat.translate(center.x() ,  center.y());
    mat.rotate(d->angle, Qt::YAxis);
    mat.translate(- center.x() ,  - center.y());
    setTransform(mat);
    if (d->angle >= 180) {
        if (state() == BACKSIDE) {
            setState(NORMALSIDE);
        } else {
            setState(BACKSIDE);
        }
        d->spintimer->stop();
        resetMatrix();
        setCacheMode(DeviceCoordinateCache);
        d->angle = 0;
    }
}
开发者ID:chanux,项目名称:plexydesk,代码行数:22,代码来源:desktopwidget.cpp


示例15: resizeEvent

    virtual void resizeEvent(QResizeEvent *event) {
        QGraphicsView::resizeEvent(event);
        QGraphicsScene *scene = this->scene();
        if (scene) {
            QRectF newSceneRect(0, 0, event->size().width(), event->size().height());
            scene->setSceneRect(newSceneRect);
            if (scene->sceneRect().size() != event->size()) {
                QSizeF from(scene->sceneRect().size());
                QSizeF to(event->size());
                QTransform transform;
                transform.scale(to.width() / from.width(), to.height() / from.height());
                setTransform(transform);
            } else {
                resetTransform();
            }
            setSceneRect(scene->sceneRect());
        }

        MainWindow *main_window = qobject_cast<MainWindow *>(parentWidget());
        if (main_window)
            main_window->fitBackgroundBrush();
    }
开发者ID:kissthink,项目名称:QSanguosha-For-Hegemony,代码行数:22,代码来源:mainwindow.cpp


示例16: P1

void LabelItem::applyDataLockedDimensions() {
  PlotRenderItem *render_item = dynamic_cast<PlotRenderItem *>(parentViewItem());
  if (render_item) {
    qreal parentWidth = render_item->width();
    qreal parentHeight = render_item->height();
    qreal parentX = render_item->rect().x();
    qreal parentY = render_item->rect().y();
    qreal parentDX = render_item->plotItem()->xMax() - render_item->plotItem()->xMin();
    qreal parentDY = render_item->plotItem()->yMax() - render_item->plotItem()->yMin();

    QPointF drP1 = _dataRelativeRect.topLeft();
    QPointF drP2 = _dataRelativeRect.bottomRight();

    QPointF P1(parentX + parentWidth*(drP1.x()-render_item->plotItem()->xMin())/parentDX,
                       parentY + parentHeight*(render_item->plotItem()->yMax() - drP1.y())/parentDY);
    QPointF P2(parentX + parentWidth*(drP2.x()-render_item->plotItem()->xMin())/parentDX,
                       parentY + parentHeight*(render_item->plotItem()->yMax() - drP2.y())/parentDY);

    qreal theta = atan2(P2.y() - P1.y(), P2.x() - P1.x());
    qreal height = rect().height();
    qreal width = rect().width();

    if (_fixleft) {
      setPos(P1);
      setViewRect(0, -height, width, height);
    } else {
      setPos(P2);
      setViewRect(-width, -height, width, height);
    }
    QTransform transform;
    transform.rotateRadians(theta);

    setTransform(transform);
    updateRelativeSize();

  } else {
    qDebug() << "apply data locked dimensions called without a render item (!)";
  }
}
开发者ID:jmlee4301,项目名称:kst,代码行数:39,代码来源:labelitem.cpp


示例17: clearNotify

void Player::setMountObject (GameBase *object, int in_mountPoint)
{
   if(mount)
      clearNotify(mount);

   setMaskBits(MountMask);
   mount = object;
   mountPoint = in_mountPoint;
   if(mount)
		{
	      deleteNotify(mount);

		   TMat3F tmat;
			mount->getObjectMountTransform(mountPoint, &tmat);
			if (!mountPoint)
				{
					Point3F rot = getRot ();
					tmat.set (EulerF (rot.x, rot.y, rot.z), tmat.p);
				}
		   setTransform(tmat);
			EulerF angles;
			tmat.angles(&angles);
			if (mountPoint < 1)
				setRot (Point3F (0, 0, angles.z));
			else
				if (mountPoint == 1)
					setRot (Point3F (0, 0, 0));
				else
					{
						Point3F rot = getRot ();
						rot.z -= angles.z;
						setRot (rot);
					}

         setImageTriggerUp(0);

			setLinearVelocity (Point3F (0, 0, 0));
		}
}
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:39,代码来源:player.cpp


示例18: setTransform

//==============================================================================
void FreeJoint::setSpatialMotion(const Eigen::Isometry3d* newTransform,
                                 const Frame* withRespectTo,
                                 const Eigen::Vector6d* newSpatialVelocity,
                                 const Frame* velRelativeTo,
                                 const Frame* velInCoordinatesOf,
                                 const Eigen::Vector6d* newSpatialAcceleration,
                                 const Frame* accRelativeTo,
                                 const Frame* accInCoordinatesOf)
{
  if (newTransform)
    setTransform(*newTransform, withRespectTo);

  if (newSpatialVelocity)
    setSpatialVelocity(*newSpatialVelocity, velRelativeTo, velInCoordinatesOf);

  if (newSpatialAcceleration)
  {
    setSpatialAcceleration(*newSpatialAcceleration,
                           accRelativeTo,
                           accInCoordinatesOf);
  }
}
开发者ID:jslee02,项目名称:wafr2016,代码行数:23,代码来源:FreeJoint.cpp


示例19: addPartAtPositiveAndNegativeTranslation

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellFracturePartMgr::addPartAtPositiveAndNegativeTranslation(cvf::ModelBasicList* model,
                                                                     cvf::Part*           part,
                                                                     const cvf::Vec3d&    translation)
{
    {
        cvf::ref<cvf::Transform> partTransform = RivWellFracturePartMgr::createLocalTransformFromTranslation(translation);

        part->setTransform(partTransform.p());
        model->addPart(part);
    }

    {
        // Create a copy of the part to be able to assign a transformation matrix representing the translation in the opposite
        // direction

        cvf::ref<cvf::Transform> partTransform = RivWellFracturePartMgr::createLocalTransformFromTranslation(-translation);

        auto copy = part->shallowCopy();
        copy->setTransform(partTransform.p());
        model->addPart(copy.p());
    }
}
开发者ID:OPM,项目名称:ResInsight,代码行数:25,代码来源:RivWellFracturePartMgr.cpp


示例20: setPos

void MyShip::updt_pos() {
	setPos(pos().x() + MyRes::vw_mvmnt, pos().y());
	setTransform(QTransform().translate(pixmap().size().width() / 2, pixmap().size().height() / 2).rotate(-rtn,
	                                                                                                      Qt::XAxis).translate(
			-pixmap().size().width() / 2, -pixmap().size().height() / 2));

	QPointF tplft(scene()->views().first()->viewport()->mapToParent(
			scene()->views().first()->mapFromScene(mapToScene(boundingRect().topLeft()))));
	QPointF bttmrght(scene()->views().first()->viewport()->mapToParent(
			scene()->views().first()->mapFromScene(mapToScene(boundingRect().bottomRight()))));
	QRectF vw_rct(scene()->views().first()->viewport()->rect());

	if (tplft.x() + vlc->x() >= MyRes::x_offset && bttmrght.x() + vlc->x() <= vw_rct.width() - MyRes::x_offset) {
		setPos(pos().x() + vlc->x(), pos().y());
	}
	if ((tplft.y() + vlc->y() >= MyRes::y_offset && bttmrght.y() + vlc->y() <= vw_rct.height() - MyRes::y_offset) ||
	    (tplft.y() + vlc->y() < MyRes::y_offset && vlc->y() > 0) ||
			((bttmrght.y() + vlc->y() > vw_rct.height() - MyRes::y_offset) && vlc->y() < 0)) {
		setPos(pos().x(), pos().y() + vlc->y());
	}
	cnstrct_shldpxmp();
}
开发者ID:kahrabian,项目名称:Shooter-AP93UT,代码行数:22,代码来源:MyShip.cpp



注:本文中的setTransform函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setTypeSize函数代码示例发布时间:2022-05-30
下一篇:
C++ setTrafficGraphRange函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap