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

C++ resetTransform函数代码示例

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

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



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


示例16: thememanager

// Main themable function. Called for any theme change. The sprites needs to
// resize and redraw here.
void TextSprite::changeTheme()
{

  // Get scaling change
  double scale    = thememanager()->getScale();
  Themable::setScale(scale);

  // Retrieve theme data from configuration
  KConfigGroup config = thememanager()->config(id());
  QPoint offset = thememanager()->getOffset();

  // Size
  double width  = config.readEntry("width", 1.0);
  double height = config.readEntry("height", 0.0);
  width *= scale;
  height *= scale;

  // Position
  QPointF pos = config.readEntry("pos", QPointF(1.0,1.0));
  pos *= scale;
  setPos(pos.x(), pos.y());

  // z-Value
  double zValue = config.readEntry("zValue", 0.0);
  setZValue(zValue);

  // Text font
  bool bold = config.readEntry("bold", false);
  QFont font;
  font.setPixelSize(int(height));
  font.setBold(bold);
  setFont(font);
  if (width < boundingRect().width())
  {
    setTextWidth(width);   
  }

  // Retrieve font color
  QColor fontColor;
  fontColor = config.readEntry("fontColor", QColor(Qt::white));
  setDefaultTextColor(fontColor);

  // Centering
  bool center = config.readEntry("center", false);
  resetTransform();
  if (center)
  {
    translate(-boundingRect().width()/2.0+offset.x(), 0.0+offset.y());
  }
  else
  {
    translate(offset.x(),offset.y());
  }

  update();
}
开发者ID:jsj2008,项目名称:kdegames,代码行数:58,代码来源:textsprite.cpp


示例17: marked

Pixmap::Pixmap(bool center_as_origin)
    :markable(false), marked(false)
{
    if(center_as_origin)
    {
        resetTransform();
        this->translate(-pixmap.width() / 2, -pixmap.height()/2);
    }
    _m_width = _m_height = 0;
}
开发者ID:gaodayihao,项目名称:GSanguosha,代码行数:10,代码来源:pixmap.cpp


示例18: resetTransform

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


示例19: resetTransform

	void ResizingView::recomputeScale()
	{
		// set transform
		resetTransform();
		const qreal widthScale(0.95*qreal(viewport()->width())/qreal(scene()->width()));
		const qreal heightScale(qreal(viewport()->height()) / qreal(80+410*3));
		computedScale = qMin(widthScale, heightScale);
		scale(computedScale, computedScale);
		wasResized = true;
		QTimer::singleShot(0, this, SLOT(resetResizedFlag()));
	}
开发者ID:pkernevez,项目名称:aseba,代码行数:11,代码来源:ResizingView.cpp


示例20: Fl_Gl_Window

MyWindow::MyWindow() : Fl_Gl_Window(1024, 768, "Pinocchio"), flatShading(false), floor(true), skeleton(false), 
					drawTri(true), drawh(true), drawsph(false), drawline(false), drawskl(false), drawbefore(false),
					onAnimation(true)
{
    size_range(20, 20, 5000, 5000);
    end();

    resetTransform();
    win = this;
    Fl::add_idle(idle);
}
开发者ID:DengzhiLiu,项目名称:CG,代码行数:11,代码来源:MyWindow.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ resetView函数代码示例发布时间:2022-05-30
下一篇:
C++ resetTimer函数代码示例发布时间: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