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


C++ FPoint函数代码示例

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


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

示例1: setGeometry

// private methods of FFileDialog
//----------------------------------------------------------------------
void FFileDialog::init()
{
  static constexpr std::size_t w = 42;
  static constexpr std::size_t h = 15;
  int x, y;

  setGeometry(FPoint(1, 1), FSize(w, h), false);
  auto parent_widget = getParentWidget();

  if ( parent_widget )
  {
    x = 1 + int((parent_widget->getWidth() - w) / 2);
    y = 1 + int((parent_widget->getHeight() - h) / 3);
  }
  else
    x = y = 1;

  if ( dlg_type == FFileDialog::Save )
    FDialog::setText("Save file");
  else
    FDialog::setText("Open file");

  widgetSettings (FPoint(x, y));  // Create widgets
  initCallbacks();
  setModal();
  readDir();
}
开发者ID:gansm,项目名称:finalcut,代码行数:29,代码来源:ffiledialog.cpp

示例2: IPoint

void DestroyChipsOrder::Draw(IPoint pos, bool vertical)
{
	if(_timeAppearText > 0)
	{
		//Текст
		Render::BeginAlphaMul(math::clamp(0.f, 1.f, _timeAppearText));
		if(_drawShowCount > 0.0f && !Completed())
		{
			IPoint textOffset = vertical ? IPoint(40, 14) : IPoint(54, 24);
			Render::FreeType::BindFont("OrderOnLock");
			Render::PrintString(pos + textOffset, utils::lexical_cast(math::ceil(_drawShowCount)), 1.f, CenterAlign, CenterAlign);
		}
		Render::EndAlphaMul();
	}
	if(_timeAppearIcon > 0)
	{
		FPoint iconOffset = vertical ? FPoint(40.0f, 53.0f) : FPoint(24.0f, 24.0f);
		//Иконка
		Render::BeginAlphaMul(math::clamp(0.f, 1.f, _timeAppearIcon));
		FRect rect, frect;
		GetOrderIconRect(_rect_num, rect, frect);
		rect.MoveBy(FPoint(0, 30.f)*(1.f - _timeAppearIcon) + pos + iconOffset);
		Game::ordersTexture->Bind();
		Render::DrawRect(rect, frect);
		Render::EndAlphaMul();
	}
}
开发者ID:code4funnn,项目名称:4-Elements-Test,代码行数:27,代码来源:GameOrder.cpp

示例3: qRound

void CanvasMode_ObjImport::mousePressEvent(QMouseEvent *m)
{
// 	const double mouseX = m->globalX();
// 	const double mouseY = m->globalY();
	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());

	double Rxp = 0, Ryp = 0;
	m_canvas->PaintSizeRect(QRect());
	m_canvas->m_viewMode.m_MouseButtonPressed = true;
	m_canvas->m_viewMode.operItemMoving = false;
	m_view->HaveSelRect = false;
	m_doc->DragP = false;
	m_doc->leaveDrag = false;
//	oldClip = 0;
	m->accept();
	m_view->registerMousePress(m->globalPos());
	Mxp = mousePointDoc.x();
	Myp = mousePointDoc.y();
	Rxp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).x();
	Mxp = qRound(Rxp);
	Ryp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).y();
	Myp = qRound(Ryp);
	if (m->button() == Qt::MidButton)
	{
		m_view->MidButt = true;
		if (m->modifiers() & Qt::ControlModifier)
			m_view->DrawNew();
		return;
	}
}
开发者ID:QuLogic,项目名称:ScribusCTL,代码行数:30,代码来源:canvasmode_objimport.cpp

示例4: zp

void NodePalette::ToggleAbsMode()
{
    if (doc==0)
        return;
    FPoint zp(0.0, 0.0);
    disconnect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
    disconnect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
    FPointArray Clip;
    FPoint np(0.0, 0.0);
    if (EditCont->isChecked())
        Clip = doc->m_Selection->itemAt(0)->ContourLine;
    else
        Clip = doc->m_Selection->itemAt(0)->PoLine;
    if (doc->nodeEdit.SelNode.count() != 0)
        np = Clip.point(doc->nodeEdit.SelNode.at(0));
    if (AbsMode->isChecked())
    {
        XSpin->setMinimum(-16777215);
        YSpin->setMinimum(-16777215);
        if (absToCanvas->isChecked())
            zp = FPoint(doc->m_Selection->itemAt(0)->xPos(), doc->m_Selection->itemAt(0)->yPos());
        else
            zp = FPoint(doc->m_Selection->itemAt(0)->xPos() - doc->currentPage()->xOffset(), doc->m_Selection->itemAt(0)->yPos() - doc->currentPage()->yOffset());
    }
    else
    {
        XSpin->setMinimum(0);
        YSpin->setMinimum(0);
    }
    XSpin->setValue((np.x() + zp.x())*doc->unitRatio());
    YSpin->setValue((np.y() + zp.y())*doc->unitRatio());
    connect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
    connect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
}
开发者ID:pvanek,项目名称:scribus-cuba-trunk,代码行数:34,代码来源:nodeeditpalette.cpp

示例5: Assert

bool EnergyReceiver::AcceptMessage(const Message &message)
{
	if(message.is("DestroyFinished"))
	{
		if(message.getData() == _uid)
		{
			if(_state == ER_ACTIVATED_BREAK) {
				_state = ER_ACTIVATED_BREAK_FINISHFLY;
			} else {
				Assert(false);
			}
			return true;
		}else{
			//На остальных приемниках запускаем акцентирующий эффект реакции на прилет другого приемника в лут
			if(!IsOrdered() && !IsActivatedByEnergy())
			{
				ParticleEffect *eff = 0;
				eff = _effContUp.AddEffect("RecOnLoot");
				eff->SetPos(FPoint(0.0f, 0.0f));
				eff->Reset();
			}
			return false;
		}
	}
	else if(message.is("JumpFinished", _uid))
	{
        ReleaseSquares();
		Match3::RunFallColumn(GetIndex().x);
	}
	else if(message.is("Start"))
	{
		if(_order)
		{
			_order->InitAppear(100.f, 100.f);
		}
		ReleaseEffects();
		if(message.getData() == "from_tutorial")
		{
			_localTime = -GameSettings::gamefield[_index]->_flySquarePauseStore;
		}else{
			_localTime = -gameInfo.getConstFloat("CRISTAL_DELAY_APPEAR_ON_RECIVER", 0.f);
		}

		ParticleEffect *eff1 = _effContDown.AddEffect("RDown");
		eff1->SetPos(FPoint(0.0f, 0.0f));

		_partUp = _effContUpStatic.AddEffect("RUp");
		_partUp->SetPos(FPoint(0.0f, 0.0f));
		_partUp->Reset();

		_firstShowed = false;
		_lockLiveEffectShowed = false;
		_timeAppear = -0.2f;
		_timerForAppearOrder = -1.f;
		_state = ER_APPEAR;
		_hideByThief = false;
	}	
	return false;
}
开发者ID:code4funnn,项目名称:4-Elements-Test,代码行数:59,代码来源:EnergyReceiver.cpp

示例6: GetOrderIconRect

void GetOrderIconRect(int type, FRect &rect, FRect &frect)
{
	const float cell_w = 64.f;
	const float cell_h = 64.f;
	rect = FRect(0.f, cell_w, 0.f, cell_w).MovedTo(FPoint(-0.5f*cell_w, -0.5f*cell_h));
	float u_size = cell_w/512.f;
	float v_size = cell_h/256.f;
	frect = FRect(0.f, u_size, 0.f,  v_size).MovedTo(FPoint(u_size*float(type % 8), v_size*float(3 - (type)/8)));
}
开发者ID:code4funnn,项目名称:4-Elements-Test,代码行数:9,代码来源:GameOrder.cpp

示例7: m_type

VGradientEx::VGradientEx( VGradientEx::Type type ) : m_type( type )
{
	// set up dummy gradient
	addStop( ScColor(255,0,0) , 0.0, 0.5, 1.0 );
	addStop( ScColor(255,255,0) , 1.0, 0.5, 1.0 );

	setOrigin( FPoint( 0, 0 ) );
	setVector( FPoint( 0, 50 ) );
	setRepeatMethod( VGradientEx::reflect );
}
开发者ID:OpenDTP,项目名称:ScribusServer,代码行数:10,代码来源:vgradientex.cpp

示例8: FPoint

FPoint ScFace::ScFaceData::glyphOrigin(gid_type gl, qreal sz) const
{
	if (gl == 0 || gl >= CONTROL_GLYPHS)
		return FPoint(0,0);
	else if (! m_glyphWidth.contains(gl)) {
		loadGlyph(gl);
	}
	const struct GlyphData & res(m_glyphOutline[gl]);
	return FPoint(res.x, res.y) * sz; 
}
开发者ID:Fahad-Alsaidi,项目名称:scribus,代码行数:10,代码来源:scface.cpp

示例9: CanvasMode

MeasurementsMode::MeasurementsMode(ScribusView* view) : CanvasMode(view), m_start(0,0), m_current(0,0)
{
	m_palette = new Measurements(m_view);
	m_palette->startup();
	m_palette->hide();
	connect( m_palette, SIGNAL(paletteShown(bool)), this, SLOT(setActive(bool)));
	m_active = false;
	m_startDoc = FPoint(0,0);
	m_currentDoc = FPoint(0,0);
}
开发者ID:avary,项目名称:scribus,代码行数:10,代码来源:canvasmode_measurements.cpp

示例10: display_time

void display_time(struct tm *tick_time) {
  showing_time = 1;
  unsigned short hour = get_display_hour(tick_time->tm_hour);
  int min = tick_time->tm_min;

  //int particles_per_group = NUM_PARTICLES / 2;

  int hr_digit_tens = hour / 10; 
  int hr_digit_ones = hour % 10; 
  int min_digit_tens = min / 10; 
  int min_digit_ones = min % 10; 
  // GRect window_bounds = layer_get_bounds(window_get_root_layer(window));
  // int w = window_bounds.size.w;
  // int h = window_bounds.size.h;

  // take out 5 particles
  // 2 for colon
  // 3 for floaters
  int save = 5;

  if(hr_digit_tens == 0) {
    int particles_per_group = (NUM_PARTICLES - save)/ 3;
    swarm_to_digit(hr_digit_ones,                          0, particles_per_group,   25, 60);
    swarm_to_digit(min_digit_tens,     particles_per_group, particles_per_group*2,   65, 60);
    swarm_to_digit(min_digit_ones, (particles_per_group*2), NUM_PARTICLES - save,    95, 60);

    // top colon
    particles[NUM_PARTICLES-2].grav_center = FPoint(57, 69);
    particles[NUM_PARTICLES-2].power = TIGHT_POWER;
    particles[NUM_PARTICLES-2].goal_size = 3.0F;

    // bottom colon
    particles[NUM_PARTICLES-1].grav_center = FPoint(57, 89);
    particles[NUM_PARTICLES-1].power = TIGHT_POWER;
    particles[NUM_PARTICLES-1].goal_size = 3.0F;

  } else {
    int particles_per_group = (NUM_PARTICLES - save)/ 4;
    swarm_to_digit(hr_digit_tens,                          0, particles_per_group,   10, 60);
    swarm_to_digit(hr_digit_ones,      particles_per_group, particles_per_group*2, 40, 60);
    swarm_to_digit(min_digit_tens, (particles_per_group*2), particles_per_group*3, 80, 60);
    swarm_to_digit(min_digit_ones, (particles_per_group*3), NUM_PARTICLES - save,  110, 60);

    // top colon
    particles[NUM_PARTICLES-2].grav_center = FPoint(68, 69);
    particles[NUM_PARTICLES-2].power = TIGHT_POWER;
    particles[NUM_PARTICLES-2].goal_size = 3.0F;

    // bottom colon
    particles[NUM_PARTICLES-1].grav_center = FPoint(68, 89);
    particles[NUM_PARTICLES-1].power = TIGHT_POWER;
    particles[NUM_PARTICLES-1].goal_size = 3.0F;
  }

}
开发者ID:phardy,项目名称:pebble-fireflies,代码行数:55,代码来源:pebble-fireflies.c

示例11: CanvasMode

CanvasMode_Rotate::CanvasMode_Rotate(ScribusView* view) : CanvasMode(view)
{
	m_canvasPressCoord.setXY(-1.0, -1.0);
	m_oldRotMode   = 0;
	m_oldRotCenter = FPoint(0.0, 0.0);
	m_angleConstrained = false;
	m_inItemRotation = false;

	m_rotMode    = 0;
	m_rotCenter  = FPoint(0.0, 0.0);
	m_startAngle = 0.0;
}
开发者ID:AlterScribus,项目名称:ece15,代码行数:12,代码来源:canvasmode_rotate.cpp

示例12: svgClosePath

void ShapePlug::svgClosePath(FPointArray *i)
{
    if (PathLen > 2)
    {
        if ((PathLen == 4) || (i->point(i->size()-2).x() != StartX) || (i->point(i->size()-2).y() != StartY))
        {
            i->addPoint(i->point(i->size()-2));
            i->addPoint(i->point(i->size()-3));
            i->addPoint(FPoint(StartX, StartY));
            i->addPoint(FPoint(StartX, StartY));
        }
    }
}
开发者ID:gyuris,项目名称:scribus,代码行数:13,代码来源:importshape.cpp

示例13: FPoint

void VGradientEx::transform( const QTransform &m )
{
	double mx, my;
	mx = m.m11() * m_origin.x() + m.m21() * m_origin.y() + m.dx();
	my = m.m22() * m_origin.y() + m.m12() * m_origin.x() + m.dy();
	m_origin = FPoint(mx, my);
	mx = m.m11() * m_focalPoint.x() + m.m21() * m_focalPoint.y() + m.dx();
	my = m.m22() * m_focalPoint.y() + m.m12() * m_focalPoint.x() + m.dy();
	m_focalPoint = FPoint(mx, my);
	mx = m.m11() * m_vector.x() + m.m21() * m_vector.y() + m.dx();
	my = m.m22() * m_vector.y() + m.m12() * m_vector.x() + m.dy();
	m_vector = FPoint(mx, my);
}
开发者ID:Fahad-Alsaidi,项目名称:scribus-svn,代码行数:13,代码来源:vgradientex.cpp

示例14: qRound

void CanvasMode_ObjImport::mousePressEvent(QMouseEvent *m)
{
// 	const double mouseX = m->globalX();
// 	const double mouseY = m->globalY();
	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());

	double Rxp = 0, Ryp = 0;
	m_canvas->PaintSizeRect(QRect());
	m_canvas->m_viewMode.m_MouseButtonPressed = true;
	m_canvas->m_viewMode.operItemMoving = false;
	m_view->HaveSelRect = false;
	m_doc->DragP = false;
	m_doc->leaveDrag = false;
//	oldClip = 0;
	m->accept();
	m_view->registerMousePress(m->globalPos());
	Mxp = mousePointDoc.x();
	Myp = mousePointDoc.y();
	Rxp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).x();
	Mxp = qRound(Rxp);
	Ryp = m_doc->ApplyGridF(FPoint(Mxp, Myp)).y();
	Myp = qRound(Ryp);
	if (m->button() == Qt::MidButton)
	{
		m_view->MidButt = true;
		if (m->modifiers() & Qt::ControlModifier)
			m_view->DrawNew();
		return;
	}
	if ((m->button() == Qt::LeftButton) && m_mimeData)
	{
		UndoTransaction* undoTransaction = NULL;
		if (m_trSettings && UndoManager::undoEnabled())
		{
			undoTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(*m_trSettings));
		}
		// Creating QDragEnterEvent outside of Qt is not recommended per docs :S
		QPoint dropPos = m_view->widget()->mapFromGlobal(m->globalPos());
		QDropEvent dropEvent(dropPos, Qt::CopyAction|Qt::MoveAction, m_mimeData, m->buttons(), m->modifiers());
		m_view->contentsDropEvent(&dropEvent);
		// Commit undo transaction if necessary
		if (undoTransaction)
		{
			undoTransaction->commit();
			delete undoTransaction;
			undoTransaction = NULL;
		}
		// Return to normal mode
		m_view->requestMode(modeNormal);
	}
}
开发者ID:piksels-and-lines-orchestra,项目名称:scribus,代码行数:51,代码来源:canvasmode_objimport.cpp

示例15: FPoint

void ShapePlug::svgCurveToCubic(FPointArray *i, double x1, double y1, double x2, double y2, double x3, double y3)
{
    if ((!FirstM) && (WasM))
    {
        i->setMarker();
        PathLen += 4;
    }
    FirstM = false;
    WasM = false;
    if (PathLen > 3)
    {
        FPoint b1 = i->point(i->size()-4);
        FPoint b2 = i->point(i->size()-3);
        FPoint b3 = i->point(i->size()-2);
        FPoint b4 = i->point(i->size()-1);
        FPoint n1 = FPoint(CurrX, CurrY);
        FPoint n2 = FPoint(x1, y1);
        FPoint n3 = FPoint(x3, y3);
        FPoint n4 = FPoint(x2, y2);
        if ((b1 == n1) && (b2 == n2) && (b3 == n3) && (b4 == n4))
            return;
    }
    i->addPoint(FPoint(CurrX, CurrY));
    i->addPoint(FPoint(x1, y1));
    i->addPoint(FPoint(x3, y3));
    i->addPoint(FPoint(x2, y2));
    CurrX = x3;
    CurrY = y3;
    PathLen += 4;
}
开发者ID:gyuris,项目名称:scribus,代码行数:30,代码来源:importshape.cpp


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