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


C++ resetTransform函数代码示例

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


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

示例1: QGraphicsView

SchemaEditor::SchemaEditor(QWidget *parent, SchemaGui *schemaGui, Engine * engine, PanelScrollView *panelScrollView) :
  QGraphicsView(schemaGui, parent),
  _contextMenuPos(0,0),
  _contextGear(NULL),
  _engine(engine),
  _schemaGui(schemaGui),
  _scale(1),
  _panelScrollView(panelScrollView),
  _maxZValue(1),
  _selectionChangeBypass(false)
  

{
  _schemaGui->setSchemaEditor(this);
  setDragMode(QGraphicsView::RubberBandDrag);
  setRenderHint(QPainter::Antialiasing, true);

  setFrameStyle(Sunken | StyledPanel);
  setOptimizationFlags(QGraphicsView::DontSavePainterState | QGraphicsView::IndirectPainting);
  setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
  setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
  
  // render with OpenGL
  if(0)
    setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));

  resetTransform();
  setAcceptDrops(TRUE);
}
开发者ID:jukea,项目名称:drone,代码行数:29,代码来源:SchemaEditor.cpp

示例2: QRect

void TablePile::setSize(double width, double height) 
{
    m_cardsDisplayRegion = QRect(0, 0, width, height);
    m_numCardsVisible = width / G_COMMON_LAYOUT.m_cardNormalHeight + 1;
    resetTransform();
    translate(-width / 2, -height / 2);
}
开发者ID:Death-,项目名称:QSanguosha,代码行数:7,代码来源:TablePile.cpp

示例3: resetTransform

void
AnimatorView::systemReset ()
{
    m_currentZoomFactor = 1;

    resetTransform ();
}
开发者ID:cozos,项目名称:networks-a2,代码行数:7,代码来源:animatorview.cpp

示例4: reader

bool QSanSelectableItem::_load(const QString &filename, QSize size, bool useNewSize, bool center_as_origin)
{
    bool success = _m_mainPixmap.load(filename);

    if (!success) {
        QImageReader reader(filename);
        QString error_string = reader.errorString();
        QString warning = tr("Can not load image %1[%2], error string is %3")
            .arg(filename).arg(metaObject()->className()).arg(error_string);
        QMessageBox::warning(NULL, tr("Warning"), warning);
    } else {
        if (useNewSize) {
            _m_width = size.width();
            _m_height = size.height();
        } else {
            _m_width = _m_mainPixmap.width();
            _m_height = _m_mainPixmap.height();
        }
        if (center_as_origin) {
            resetTransform();
            setTransform(QTransform::fromTranslate(-_m_width / 2, -_m_height / 2), true);
        } else
            this->prepareGeometryChange();
    }
    return success;
}
开发者ID:DGAH,项目名称:QSanguosha-v2,代码行数:26,代码来源:qsan-selectable-item.cpp

示例5: scene

void ProfileGraphicsView::clear()
{
	scene()->clear();
	resetTransform();
	zoomLevel = 0;
	toolTip = 0;
}
开发者ID:richardsonlima,项目名称:subsurface,代码行数:7,代码来源:profilegraphics.cpp

示例6: resetTransform

void ImageView::setScaleFactor(double factor) {
  if(factor != scaleFactor_) {
    scaleFactor_ = factor;
    resetTransform();
    scale(factor, factor);
    queueGenerateCache();
  }
}
开发者ID:Pr0Wolf29,项目名称:lximage-qt,代码行数:8,代码来源:imageview.cpp

示例7: changeScale

PathBlock* PathBlock::scale(float scaleX, float scaleY)
{
    changeScale(scaleX, scaleY);

    resetTransform();

    return this;
}
开发者ID:rookes,项目名称:orthogon,代码行数:8,代码来源:Path.cpp

示例8: resetTransform

PathBlock* PathBlock::rotate(const Angle& angle)
{
    rotation += angle;

    resetTransform();

    return this;
}
开发者ID:rookes,项目名称:orthogon,代码行数:8,代码来源:Path.cpp

示例9: resetTransform

void SceneView::setScene(Scene * scene)
{
	if (m_scene != NULL) delete m_scene;

	m_scene = scene;
	resetTransform();
	emit updateGL();
}
开发者ID:odalet,项目名称:qshaderedit,代码行数:8,代码来源:qglview.cpp

示例10: resetTransform

void MainRSTView::rePort()
{
    resetTransform();
    centerOn(father_->fx_, father_->fy_);
    scale(father_->sc_, father_->sc_);

    emit portChanged(width() / father_->sc_, height() / father_->sc_);
}
开发者ID:xunkai55-ood,项目名称:SolveRST,代码行数:8,代码来源:mainrstview.cpp

示例11: scene

void FormView::showForm(AbstractForm * form)
{

    QGraphicsScene *s = scene();

    s->clear();
    resetTransform();

    if(form == 0){
        return;
    }
    if(form->get_number_of_points() <= 0) {
        return;
    }

    int factor = 100;

    QPolygonF polygon;
    for(int i=0; i<form->get_number_of_points(); ++i){
        Point point = form->get_point_at_index(i);
        polygon.push_back(QPointF(point.get_x()*factor, point.get_y()*factor));
    }



    s->addPolygon(polygon, QPen(), QBrush(Qt::SolidPattern));

    QRectF bound = polygon.boundingRect();

    s->setSceneRect(bound);



    float realwidth = container->width() - 50;
    float width = bound.width();
    float realheight = container->height() - 50;
    float height = bound.height();

    float relw = 1;
    if(width > 0){
        relw =  realwidth / width;
    }

    float relh = 1;
    if(height > 0){
        relh = realheight / height;
    }

    float rel = relw;
    if(relh < relw){
        rel = relh;
    }

    scale(rel,rel);



}
开发者ID:CSNWEB,项目名称:gi-2015,代码行数:58,代码来源:formview.cpp

示例12: Fl_Gl_Window

MyWindow::MyWindow() : Fl_Gl_Window(1024, 768, "Pinocchio"), flatShading(true), floor(true), skeleton(false)
{
    size_range(20, 20, 5000, 5000);
    end();

    resetTransform();
    win = this;
    Fl::add_idle(idle);
}
开发者ID:T-R-I-P,项目名称:Pinocchio,代码行数:9,代码来源:MyWindow.cpp

示例13: resetTransform

void RenderArea::openFile(QFile &svgFile)
{
    graphicsScene->clear();
    resetTransform();

    QGraphicsItem *loadItem;
    loadItem = new QGraphicsSvgItem(svgFile.fileName());
    graphicsScene->addItem(loadItem);
}
开发者ID:keshpo,项目名称:vge,代码行数:9,代码来源:renderarea.cpp

示例14: resetTransform

void PianoKeybd::setRotation(int r)
{
    if (r != m_rotation) {
        m_rotation = r;
        resetTransform();
        rotate(m_rotation);
        fitInView(m_scene->sceneRect(), Qt::KeepAspectRatio);
    }
}
开发者ID:svn2github,项目名称:vmpk,代码行数:9,代码来源:pianokeybd.cpp

示例15: markable

QSanSelectableItem::QSanSelectableItem(bool center_as_origin)
    : markable(false), marked(false)
{
    if (center_as_origin) {
        resetTransform();
        setTransform(QTransform::fromTranslate(-_m_mainPixmap.width() / 2, -_m_mainPixmap.height() / 2), true);
    }
    _m_width = _m_height = 0;
}
开发者ID:DGAH,项目名称:QSanguosha-v2,代码行数:9,代码来源:qsan-selectable-item.cpp


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