当前位置: 首页>>代码示例>>C++>>正文


C++ QTransform::m13方法代码示例

本文整理汇总了C++中QTransform::m13方法的典型用法代码示例。如果您正苦于以下问题:C++ QTransform::m13方法的具体用法?C++ QTransform::m13怎么用?C++ QTransform::m13使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTransform的用法示例。


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

示例1: draw

void RasterImage::draw(QPainter* painter) const
{
    painter->save();
    QSizeF s;
    if (_sizeIsSpatium)
        s = _size * spatium();
    else
        s = _size * MScore::DPMM;
    if (score()->printing()) {
        // use original image size for printing
        painter->scale(s.width() / doc.width(), s.height() / doc.height());
        painter->drawPixmap(QPointF(0, 0), QPixmap::fromImage(doc));
    }
    else {
        QTransform t = painter->transform();
        QSize ss = QSizeF(s.width() * t.m11(), s.height() * t.m22()).toSize();
        t.setMatrix(1.0, t.m12(), t.m13(), t.m21(), 1.0, t.m23(), t.m31(), t.m32(), t.m33());
        painter->setWorldTransform(t);
        if ((buffer.size() != ss || _dirty) && !doc.isNull()) {
            buffer = QPixmap::fromImage(doc.scaled(ss, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
            _dirty = false;
        }
        Image::draw(painter, ss);
    }
    painter->restore();
}
开发者ID:nutmegkat,项目名称:MuseScore,代码行数:26,代码来源:image.cpp

示例2: glDrawElements

void MGLES2Renderer::draw(const QList<QRect>& targets, const QList<QRect>& sources)
{
    GLuint num = d_ptr->setupVertices(d_ptr->m_boundTexSize, sources, targets);


    QTransform transform;
    GLfloat o = 1.0;
    if (d_ptr->m_activePainter) {
        transform = d_ptr->m_activePainter->combinedTransform();
        o = d_ptr->m_activePainter->opacity();
    }

    d_ptr->m_matWorld[0][0] = transform.m11();
    d_ptr->m_matWorld[0][1] = transform.m12();
    d_ptr->m_matWorld[0][3] = transform.m13();
    d_ptr->m_matWorld[1][0] = transform.m21();
    d_ptr->m_matWorld[1][1] = transform.m22();
    d_ptr->m_matWorld[1][3] = transform.m23();
    d_ptr->m_matWorld[3][0] = transform.dx();
    d_ptr->m_matWorld[3][1] = transform.dy();
    d_ptr->m_matWorld[3][3] = transform.m33();
    d_ptr->m_activeProgram->setUniformValue("matWorld", d_ptr->m_matWorld);
    d_ptr->m_activeProgram->setUniformValue("opacity", o);

    glDrawElements(GL_TRIANGLES, num, GL_UNSIGNED_SHORT, d_ptr->m_indices.data());
}
开发者ID:dudochkin-victor,项目名称:libgogootouch,代码行数:26,代码来源:mgles2renderer.cpp

示例3: glDrawArrays

void MGLES2Renderer::draw(const QRect &rectangle)
{
    GLfloat *vertices = d_ptr->m_vertices.data();
    vertices[0] = rectangle.left();  vertices[1] = rectangle.top();
    vertices[2] = rectangle.left();  vertices[3] = rectangle.top() + rectangle.height();
    vertices[4] = rectangle.left() + rectangle.width(); vertices[5] = rectangle.top() + rectangle.height();
    vertices[6] = rectangle.left() + rectangle.width(); vertices[7] = rectangle.top();

    QTransform transform;
    GLfloat o = 1.0;
    if (d_ptr->m_activePainter) {
        transform = d_ptr->m_activePainter->combinedTransform();
        o = d_ptr->m_activePainter->opacity();
    }
    d_ptr->m_matWorld[0][0] = transform.m11();
    d_ptr->m_matWorld[0][1] = transform.m12();
    d_ptr->m_matWorld[0][3] = transform.m13();
    d_ptr->m_matWorld[1][0] = transform.m21();
    d_ptr->m_matWorld[1][1] = transform.m22();
    d_ptr->m_matWorld[1][3] = transform.m23();
    d_ptr->m_matWorld[3][0] = transform.dx();
    d_ptr->m_matWorld[3][1] = transform.dy();
    d_ptr->m_matWorld[3][3] = transform.m33();
    d_ptr->m_activeProgram->setUniformValue("matWorld", d_ptr->m_matWorld);
    d_ptr->m_activeProgram->setUniformValue("opacity", o);

    glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
开发者ID:dudochkin-victor,项目名称:libgogootouch,代码行数:28,代码来源:mgles2renderer.cpp

示例4: init

void TransformEditDialog::init(QTransform aTransform, const PropertyAttributes *aAttributes)
{
    ui->setupUi(this);

    setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);

    ui->m11SpinBox->setValue(aTransform.m11());
    ui->m12SpinBox->setValue(aTransform.m12());
    ui->m13SpinBox->setValue(aTransform.m13());
    ui->m21SpinBox->setValue(aTransform.m21());
    ui->m22SpinBox->setValue(aTransform.m22());
    ui->m23SpinBox->setValue(aTransform.m23());
    ui->m31SpinBox->setValue(aTransform.m31());
    ui->m32SpinBox->setValue(aTransform.m32());
    ui->m33SpinBox->setValue(aTransform.m33());

    if (aAttributes)
    {
        aAttributes->applyToDoubleSpinBox(ui->m11SpinBox);
        aAttributes->applyToDoubleSpinBox(ui->m12SpinBox);
        aAttributes->applyToDoubleSpinBox(ui->m13SpinBox);
        aAttributes->applyToDoubleSpinBox(ui->m21SpinBox);
        aAttributes->applyToDoubleSpinBox(ui->m22SpinBox);
        aAttributes->applyToDoubleSpinBox(ui->m23SpinBox);
        aAttributes->applyToDoubleSpinBox(ui->m31SpinBox);
        aAttributes->applyToDoubleSpinBox(ui->m32SpinBox);
        aAttributes->applyToDoubleSpinBox(ui->m33SpinBox);
    }
}
开发者ID:Gris87,项目名称:ObjectController,代码行数:29,代码来源:transformeditdialog.cpp

示例5: toOctaveFormat

inline QString toOctaveFormat(const QTransform &t)
{
    QString s("T = [%1 %2 %3; %4 %5 %6; %7 %8 %9]");
    s = s
        .arg(t.m11()).arg(t.m12()).arg(t.m13())
        .arg(t.m21()).arg(t.m22()).arg(t.m23())
        .arg(t.m31()).arg(t.m32()).arg(t.m33());

    return s;
}
开发者ID:ChrisJong,项目名称:krita,代码行数:10,代码来源:kis_transform_mask_test.cpp

示例6: draw

void Image::draw(QPainter* painter) const
      {
      bool emptyImage = false;
      if (imageType == ImageType::SVG) {
            if (!svgDoc)
                  emptyImage = true;
            else
                  svgDoc->render(painter, bbox());
            }
      else if (imageType == ImageType::RASTER) {
            if (rasterDoc == nullptr)
                  emptyImage = true;
            else {
                  painter->save();
                  QSizeF s;
                  if (_sizeIsSpatium)
                        s = _size * spatium();
                  else
                        s = _size * MScore::DPMM;
                  if (score()->printing()) {
                        // use original image size for printing
                        painter->scale(s.width() / rasterDoc->width(), s.height() / rasterDoc->height());
                        painter->drawPixmap(QPointF(0, 0), QPixmap::fromImage(*rasterDoc));
                        }
                  else {
                        QTransform t = painter->transform();
                        QSize ss = QSizeF(s.width() * t.m11(), s.height() * t.m22()).toSize();
                        t.setMatrix(1.0, t.m12(), t.m13(), t.m21(), 1.0, t.m23(), t.m31(), t.m32(), t.m33());
                        painter->setWorldTransform(t);
                        if ((buffer.size() != ss || _dirty) && rasterDoc && !rasterDoc->isNull()) {
                              buffer = QPixmap::fromImage(rasterDoc->scaled(ss, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
                              _dirty = false;
                              }
                        if (buffer.isNull())
                              emptyImage = true;
                        else
                              painter->drawPixmap(QPointF(0.0, 0.0), buffer);
                        }
                  painter->restore();
                  }
            }
      if (emptyImage) {
            painter->setBrush(Qt::NoBrush);
            painter->setPen(Qt::black);
            painter->drawRect(bbox());
            painter->drawLine(0.0, 0.0, bbox().width(), bbox().height());
            painter->drawLine(bbox().width(), 0.0, 0.0, bbox().height());
            }
      if (selected() && !(score() && score()->printing())) {
            painter->setBrush(Qt::NoBrush);
            painter->setPen(MScore::selectColor[0]);
            painter->drawRect(bbox());
            }
      }
开发者ID:DannyBehar,项目名称:MuseScore,代码行数:54,代码来源:image.cpp

示例7: qDebug

void
qDebug(QTransform transform)
{
    QString string;
    string =  "m11:" + QString::number(transform.m11()) + "\n";
    string += "m12:" + QString::number(transform.m12()) + "\n";
    string += "m13:" + QString::number(transform.m13()) + "\n";
    string += "m21:" + QString::number(transform.m21()) + "\n";
    string += "m22:" + QString::number(transform.m22()) + "\n";
    string += "m23::" + QString::number(transform.m23()) + "\n";
    qDebug(string);
}
开发者ID:JBonsink,项目名称:GSOC-2013,代码行数:12,代码来源:xdebug.cpp

示例8: updateVertices

 void updateVertices(const QTransform &t) 
 {
     worldMatrix[0][0] = t.m11();
     worldMatrix[0][1] = t.m12();
     worldMatrix[0][3] = t.m13();
     worldMatrix[1][0] = t.m21();
     worldMatrix[1][1] = t.m22();
     worldMatrix[1][3] = t.m23();
     worldMatrix[3][0] = t.dx();
     worldMatrix[3][1] = t.dy();
     worldMatrix[3][3] = t.m33();
 }
开发者ID:arcean,项目名称:meegotouch-compositor,代码行数:12,代码来源:mtexturepixmapitem_p.cpp

示例9: to_sexp

SEXP to_sexp(QTransform tform) {
  SEXP ans = allocMatrix(REALSXP, 3, 3);; 
  REAL(ans)[0] = tform.m11();
  REAL(ans)[1] = tform.m21();
  REAL(ans)[2] = tform.m31();
  REAL(ans)[3] = tform.m12();
  REAL(ans)[4] = tform.m22();
  REAL(ans)[5] = tform.m32();
  REAL(ans)[6] = tform.m13();
  REAL(ans)[7] = tform.m23();
  REAL(ans)[8] = tform.m33();
  return ans;
}
开发者ID:NickSpyrison,项目名称:qtbase,代码行数:13,代码来源:convert.cpp

示例10: draw

void RasterImage::draw(Painter*) const
{
#if 0
    QTransform t = p.worldTransform();
    QSize s      = QSizeF(sz.width() * t.m11(), sz.height() * t.m22()).toSize();
    t.setMatrix(1.0, t.m12(), t.m13(), t.m21(), 1.0, t.m23(), t.m31(), t.m32(), t.m33());
    p.setWorldTransform(t);
    if (buffer.size() != s || _dirty) {
        buffer = QPixmap::fromImage(doc.scaled(s, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
        _dirty = false;
    }
    Image::draw(p, v);
#endif
}
开发者ID:gthomas,项目名称:MuseScore,代码行数:14,代码来源:image.cpp

示例11: UnsetScale

//-------------------------------------------------------------
void GDeviceQt::UnsetScale()
{
#if absoluteTransform1
	QTransform m = mQPainter->worldTransform();
	m.setMatrix (1 / mScaleX, m.m12(), m.m13(), m.m21(), 1 / mScaleY, m.m23(), m.m31(), m.m32(), m.m33()),
	mQPainter->setWorldTransform (m);
#elif absoluteTransform2
	float curxs = GetXScale();
	float curys = GetYScale();
	mQPainter->scale( mPrevScaleX / curxs, mPrevScaleY / curys);
#else
	mQPainter->scale(1 / mScaleX, 1 / mScaleY);
#endif
}
开发者ID:anttirt,项目名称:guidolib,代码行数:15,代码来源:GDeviceQt.cpp

示例12: saveTransform

void GraphicsUtils::saveTransform(QXmlStreamWriter & streamWriter, const QTransform & transform) {
	if (transform.isIdentity()) return;

	streamWriter.writeStartElement("transform");
	streamWriter.writeAttribute("m11", QString::number(transform.m11()));
	streamWriter.writeAttribute("m12", QString::number(transform.m12()));
	streamWriter.writeAttribute("m13", QString::number(transform.m13()));
	streamWriter.writeAttribute("m21", QString::number(transform.m21()));
	streamWriter.writeAttribute("m22", QString::number(transform.m22()));
	streamWriter.writeAttribute("m23", QString::number(transform.m23()));
	streamWriter.writeAttribute("m31", QString::number(transform.m31()));
	streamWriter.writeAttribute("m32", QString::number(transform.m32()));
	streamWriter.writeAttribute("m33", QString::number(transform.m33()));
	streamWriter.writeEndElement();
}
开发者ID:DHaylock,项目名称:fritzing-app,代码行数:15,代码来源:graphicsutils.cpp

示例13: SetScale

//-------------------------------------------------------------
void GDeviceQt::SetScale( float x, float y )
{
    mScaleX = x;
    mScaleY = y;

#if absoluteTransform1
	QTransform m = mQPainter->worldTransform();
	m.setMatrix (x, m.m12(), m.m13(), m.m21(), y, m.m23(), m.m31(), m.m32(), m.m33()),
	mQPainter->setWorldTransform (m);
#elif absoluteTransform2
	float curxs = GetXScale();
	float curys = GetYScale();
	mQPainter->scale( x/curxs, y/curys);
#else
	mQPainter->scale(x, y);
#endif
}
开发者ID:anttirt,项目名称:guidolib,代码行数:18,代码来源:GDeviceQt.cpp

示例14: paint

    void paint(QPainter* painter, const QStyleOptionGraphicsItem* options, QWidget* widget)
    {
        if (!m_layer)
            return;

        GraphicsContext gc(painter);
        const QTransform transform = painter->transform();
        TransformationMatrix matrix(
                transform.m11(), transform.m12(), 0, transform.m13(),
                transform.m21(), transform.m22(), 0, transform.m23(),
                0, 0, 1, 0,
                transform.m31(), transform.m32(), 0, transform.m33()
            );
        painter->beginNativePainting();
        m_layer->paint(&gc, widget->size(), options->rect, options->exposedRect.toAlignedRect(), matrix, painter->opacity());
        painter->endNativePainting();
    }
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:17,代码来源:PageClientQt.cpp

示例15: enu

QVector3D Conversions::xyz2enu(const QVector3D &xyz, qreal reflat, qreal reflon, qreal refalt)
{
    QVector3D refxyz = Conversions::lla2xyz(reflat,reflon,refalt);
    QVector3D diffxyz = xyz - refxyz;

    QTransform R1 = Conversions::rot(90.0 + reflon,3);
    QTransform R2 = Conversions::rot(90.0-reflat,1);
    QTransform R = R2*R1;

    //MAKE THIS MATRIX MULTIPLY
    qreal x = R.m11()*diffxyz.x() + R.m12()*diffxyz.y() + R.m13()*diffxyz.z();
    qreal y = R.m21()*diffxyz.x() + R.m22()*diffxyz.y() + R.m23()*diffxyz.z();
    qreal z = R.m31()*diffxyz.x() + R.m32()*diffxyz.y() + R.m33()*diffxyz.z();

    QVector3D enu(x,y,z);

    return enu;
}
开发者ID:FlavioFalcao,项目名称:Genetic-Planner,代码行数:18,代码来源:Conversions.cpp


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