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

C++ endPoint函数代码示例

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

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



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

示例1: computeAngle

void ArrowLine::drawShape(QPainter &p)
{
    p.setPen(darkGray);
    QCanvasLine::drawShape(p);

    double angle = computeAngle(startPoint().x(),
                                startPoint().y(),
                                endPoint().x(),
                                endPoint().y());
    QPointArray pts(3);

    QWMatrix m;
    int x, y;
    m.rotate(angle);
    m.map(-5, -2, &x, &y);
    pts.setPoint(0, x, y);
    m.map(-5, 2, &x, &y);
    pts.setPoint(1, x, y);
    m.map(0, 0, &x, &y);
    pts.setPoint(2, x, y);

    pts.translate(endPoint().x(), endPoint().y());

    p.setBrush(QColor(darkGray));
    p.drawPolygon(pts);
}
开发者ID:BackupTheBerlios,项目名称:poa,代码行数:26,代码来源:scheduledialog.cpp


示例2: disconnect

void AMBeamSelectPage::initializePage()
{
	AMViewPage::initializePage();

	disconnect(view(), SIGNAL(mousePressed(QPointF)), viewWizard(), SLOT(addPoint(QPointF)));
	disconnect(view(), SIGNAL(mouseLeftReleased(QPointF)), viewWizard(), SLOT(endPoint()));
	connect(view(), SIGNAL(mousePressed(QPointF)), viewWizard(), SLOT(addPoint(QPointF)));
	connect(view(), SIGNAL(mouseLeftReleased(QPointF)), viewWizard(), SLOT(endPoint()));
}
开发者ID:acquaman,项目名称:acquaman,代码行数:9,代码来源:AMBeamConfigurationWizard.cpp


示例3: m_pathPolyRefs

////////////////// PathInfo //////////////////
PathInfo::PathInfo(const Unit* owner, const float destX, const float destY, const float destZ, bool useStraightPath) :
    m_pathPolyRefs(NULL), m_polyLength(0), m_type(PATHFIND_BLANK), m_useStraightPath(useStraightPath),
    m_sourceUnit(owner), m_navMesh(NULL), m_navMeshQuery(NULL)
{
    PathNode endPoint(destX, destY, destZ);
    setEndPosition(endPoint);

    float x,y,z;
    m_sourceUnit->GetPosition(x, y, z);
    PathNode startPoint(x, y, m_sourceUnit->GetMap()->GetHeight(x,y,z,100.0f));
    setStartPosition(startPoint);

    PATH_DEBUG("++ PathInfo::PathInfo for %u \n", m_sourceUnit->GetGUID());

    uint32 mapId = m_sourceUnit->GetMapId();
    MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager();
    m_navMesh = mmap->GetNavMesh(mapId);
    m_navMeshQuery = mmap->GetNavMeshQuery(mapId);

    if (m_navMesh && m_navMeshQuery)
    {
        BuildPolyPath(startPoint, endPoint);
    }
    else
    {
        BuildShortcut();
        m_type = PathType(PATHFIND_NORMAL | PATHFIND_NOT_USING_PATH);
    }
}
开发者ID:nerzhul,项目名称:MangosFX,代码行数:30,代码来源:PathFinder.cpp


示例4: stPoint

void PD_2DXYPS::DrawXAxes(const double& yVal,
                               const double& yaxOffset)
{
    Point2D stPoint(convXaxisMin, yVal + yaxOffset);
    Point2D endPoint(convXaxisMax, yVal + yaxOffset);
    DrawLine(stPoint, endPoint);
}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:7,代码来源:PD_2DXYPS.cpp


示例5: draw

	void KviCanvasLine::draw(QPainter &p)
	{
		if(isEnabled())
		{
			p.setPen(pen());
			p.drawLine(startPoint(),endPoint());
		}

		if(isSelected())
		{
			p.setRasterOp(NotROP);
			p.setPen(QPen(DotLine));
			p.drawLine(startPoint(),endPoint());
			p.setRasterOp(CopyROP);
		}
	}
开发者ID:netrunner-debian-kde-extras,项目名称:kvirc,代码行数:16,代码来源:canvaswidget.cpp


示例6: Socket

void Tranceiver::connect(String ipAddr) {
	semaphore.Acquire();

	//create socket
	socket=new Socket();
	socket->Construct(NET_SOCKET_AF_IPV4,
			NET_SOCKET_TYPE_STREAM, NET_SOCKET_PROTOCOL_TCP);

	unsigned long blockingModeSocket=0;
	socket->Ioctl(NET_SOCKET_FIONBIO, blockingModeSocket);

	//Connect to TCP Server
	Ip4Address ipAddress(ipAddr);
	NetEndPoint endPoint(ipAddress, PORT);
	result r=socket->Connect(endPoint);

	if(r!=E_SUCCESS) {
		AppLogException("CommandCenter : Connect Error");
	}

	//Create Packet Object
	packetSender=new PacketSender(socket);
	screenSender=new ScreenSender(socket);
	packetReceiver=new PacketReceiver(socket);

	//Start PacketReciever
	packetReceiver->setPacketListener(this);
	packetReceiver->Construct();
	packetReceiver->flag=true;
	packetReceiver->Start();

	//mServerConnectionListener->onServerConnected(ipAddr);

	semaphore.Release();
}
开发者ID:CommandCenter,项目名称:CommandCenter,代码行数:35,代码来源:Tranceiver.cpp


示例7: endPoint

double LikelihoodField::computeWeight(const std::vector<double>& measurement, const std::vector<double>& state, const Grid<double>& map){
	double q = 1;
	//Get location of range finder in global coordinates
	std::vector<double> locationRF = this->rf->getLocation(state);
	std::vector<double> endPoint(2);
	//Temporary variables
	double z,minDist,dist,sample, beamAngle;
	for(int i = 0; i < (int)measurement.size(); i++){
		//Current measurement
		z = measurement[i];
		beamAngle = this->rf->getBeamAngle(i);
		if (z != this->rf->getErrorValue()){
			//Compute end position of current beam
			endPoint[0] = locationRF[0] + z * cos(beamAngle + state[2]);
			endPoint[1] = locationRF[1] + z * sin(beamAngle + state[2]);
			//Find nearest occupied cell in map
			minDist = 0;
			for(int j = 0; j < map.getNumberCells(); j++){
				Cell<double> c = map.getCell(j);
				if(c.value > this->parameters[4]){
					dist = c.getDistanceToCenter(endPoint);
					if(dist < minDist || minDist == 0)
						minDist = dist;
				}
			}
			//Update probability of measurement
			sample = Tools::probNormal(minDist, this->parameters[0]);
			q = q * (this->parameters[1] * sample + this->parameters[2]/this->parameters[3]);
		}
	}
	return q;
}
开发者ID:pmanoonpong,项目名称:gorobots_edu,代码行数:32,代码来源:likelihoodField.cpp


示例8: beginningPoint

RTRVector3D RTRSegment::pointAt(int coordinate, double val) const
{
    //TODO Not finished... I want to sleep!!
    double ratio = (val - beginningPoint(coordinate)) / (endPoint(coordinate) - beginningPoint(coordinate));
    RTRVector3D ret = beginningPoint + (endPoint - beginningPoint) * ratio;
    ret(coordinate) = val;
    return ret;
}
开发者ID:tansinan,项目名称:course_project_ray_trace_renderer,代码行数:8,代码来源:RTRGeometry.cpp


示例9: glColor3f

void
VNode::render() const
{
    glColor3f(0,1,0);
    glLineWidth(MaxWidth);
    DrawLine( m_location, endPoint() );
    int numChildren = (int)m_children.size();
    for(int i=0; i<numChildren; ++i)
        m_children[i]->render();
}
开发者ID:chrishaukap,项目名称:GameDev,代码行数:10,代码来源:VNode.cpp


示例10: startPoint

bool QgsCurve::isClosed() const
{
  if ( numPoints() == 0 )
    return false;

  //don't consider M-coordinates when testing closedness
  QgsPointV2 start = startPoint();
  QgsPointV2 end = endPoint();
  return ( qgsDoubleNear( start.x(), end.x(), 1E-8 ) &&
           qgsDoubleNear( start.y(), end.y(), 1E-8 ) &&
           qgsDoubleNear( start.z(), end.z(), 1E-8 ) );
}
开发者ID:3liz,项目名称:Quantum-GIS,代码行数:12,代码来源:qgscurve.cpp


示例11: server

int server()
{
	printf("Give me the printer Number : 0 or 1");
	int no;
	scanf("%d",&no);

	char buffer[256] = { '\0' };

	    // Create a local endpoint.
	if(no==0)
	    sprintf(buffer, "tcp://58.198.176.121:5555");
	else
		sprintf(buffer, "tcp://58.198.176.121:5557");


	    Theron::EndPoint endPoint("server", buffer);

	    // Connect to the remote endpoint.

	    	sprintf(buffer, "tcp://58.198.176.121:5556");
	    	if (!endPoint.Connect(buffer))
	    	{
	    		printf("ERROR: Connection failed - check networking is enabled.\n");
	    		return 1;
	    	}



	    // The framework and receiver are tied to the endpoint.
	    if(no==0)
	    {
	    	//Theron::Receiver receiver(endPoint, "receiver");

	    	Theron::Framework framework(endPoint);

	    	Printer printer(no,framework, "printer");
	    	Printer1 printer1(no,framework, "printer1");
	    	//receiver.Wait();
	    	while(1);

	    }
	    else
	    {
	    	Theron::Receiver receiver(endPoint, "receiver1");
	    	Theron::Framework framework(endPoint);

	    	Printer printer1(no,framework,"printer");
	    	receiver.Wait();

	    }


}
开发者ID:NagamineLee,项目名称:Claims,代码行数:53,代码来源:boost.cpp


示例12: client

int client()
{
	  char buffer[256] = { '\0' };

	    // Create a local endpoint.
	    sprintf(buffer, "tcp://58.198.176.121:5556");
	    Theron::EndPoint endPoint("client", buffer);

	    // Connect to the remote endpoint.
	    sprintf(buffer, "tcp://58.198.176.121:5555");
	    if (!endPoint.Connect(buffer))
	    {
	        printf("ERROR: Connection failed - check networking is enabled.\n");
	        return 1;
	    }
	    else
	    {
	    	printf("Connected to %s\n",buffer);
	    }
	    sprintf(buffer, "tcp://58.198.176.121:5557");
	    if (!endPoint.Connect(buffer))
	    {
	        printf("ERROR: Connection failed - check networking is enabled.\n");
	        return 1;
	    }
	    else
	    {
	    	printf("Connected to %s\n",buffer);
	    }

	    // The framework is tied to the endpoint.
	    Theron::Framework framework(endPoint);

	    // Send messages to the server in a loop until the user enters 'exit'.
	    // Note that if the server hasn't started listening yet it may miss the first messages!
	    printf("Enter lines of text (max 256 chars per line). Type 'exit' to end.\n");

	    while (strcmp(buffer, "exit") != 0)
	    {
	        // Send the text in a messages to the remote 'printer' actor using its unique name.
	        gets(buffer);
	        framework.Send(
	            TextMessage(buffer),
	            Theron::Address(),
	            Theron::Address("printer"));

	        framework.Send(
	  	            double(28.234),
	  	            Theron::Address(),
	  	            Theron::Address("printer1"));
	    }
}
开发者ID:NagamineLee,项目名称:Claims,代码行数:52,代码来源:boost.cpp


示例13: incrementGrowth

void
VNode::grow(const Vector2& targetPoint, bool& reachedTarget,
            VINENODES& newChildren, VINENODES& staleChildren)
{
    incrementGrowth();
    setEndPoint();

    float distance = sqrt( pow((targetPoint.X - endPoint().X),2) + pow((targetPoint.Y - endPoint().Y),2) );
    reachedTarget = bool(distance <= GrowthIncrement);

    if(!reachedTarget)
    {
        if(maxLengthReached())
        {
            staleChildren.push_back(this);
            addRandomizedChildren(endPoint(), targetPoint);
            int sz = (int)m_children.size();
            for( int i=0; i<sz; ++i )
                newChildren.push_back(m_children[i]);
        }
    }
}
开发者ID:chrishaukap,项目名称:GameDev,代码行数:22,代码来源:VNode.cpp


示例14: QgsMultiPoint

QgsAbstractGeometry *QgsCurve::boundary() const
{
  if ( isEmpty() )
    return nullptr;

  if ( isClosed() )
    return nullptr;

  QgsMultiPoint *multiPoint = new QgsMultiPoint();
  multiPoint->addGeometry( new QgsPoint( startPoint() ) );
  multiPoint->addGeometry( new QgsPoint( endPoint() ) );
  return multiPoint;
}
开发者ID:AlisterH,项目名称:Quantum-GIS,代码行数:13,代码来源:qgscurve.cpp


示例15: startPoint

/**
 * Return whether on seq. line.
 * Takes into account destruction box if shown.
 *
 * @param p The point to investigate.
 * @return  Non-zero if point is on this sequence line.
 */
int SeqLineWidget::onWidget(const QPoint & p)
{
    int nOnWidget = 0;
    QPoint sp = startPoint();
    QPoint ep = endPoint();
    //see if on widget ( for message creation )
    if( sp.x() - m_nMouseDownEpsilonX < p.x()
            && ep.x() + m_nMouseDownEpsilonX > p.x()
            && sp.y() < p.y() && ep.y() + 3 > p.y() )
    {
        nOnWidget = 1;
    }
    return nOnWidget;
}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:21,代码来源:seqlinewidget.cpp


示例16: file

void ReportPrintSetting::drawPosition(int type, QString content, QPainter &painter,
                                      int drawType,QString img,
                                      int fontSize, const QString family,
                                      bool bold)
{
    ReportFormDefinition report;
    // QString file("../tcdstation/reportForm.xml");
    QString file("reportForm.xml");
    report.ReadReportContent(file);
    QRectF rectF;
    report.GetPosition(type,rectF);

    QFont font;
    font.setPointSize(fontSize);
    font.setBold(bold);
    font.setFamily(family);

    painter.setFont(font);
    if(drawType == SPLITTER)
    {
        QPoint startPoint(rectF.x(),rectF.y());
        QPoint endPoint(rectF.x()+rectF.width(),rectF.y()+rectF.height());
        painter.drawLine(startPoint,endPoint);
    }
    else if(drawType == TEXT)
    {
        painter.drawText(rectF,Qt::TextWordWrap,content);
    }
    else if(drawType == IMAGE)
    {
        //QImage image(img);
        QPixmap pixmap;
        pixmap.load(img);
        //painter.drawImage(rectF,image);
        painter.drawPixmap(rectF.x(),rectF.y(),rectF.width(),rectF.height(),pixmap);
    }
    else if(drawType == WIDGET)
    {
        QPixmap grabImage;
        QRect rect;
        rect.setSize(QSize(rectF.width(),rectF.height()));
        m_tableView->resize(rect.size());
        grabImage = m_tableView->grab(QRect(0,0,m_tableView->width(),m_tableView->height()));


        grabImage.scaled(rect.size(),Qt::KeepAspectRatio);
        painter.drawPixmap(rectF.x(),rectF.y(),grabImage);
    }

}
开发者ID:hypermoon,项目名称:TCDstation,代码行数:50,代码来源:reportprintsetting.cpp


示例17: TransformX

void PD_2DXYPS::DrawXTic(const double& xVal,
                              const double& yVal,
                              const double& yaxOffset,
                              const double& ticLen,
                              const double& ticOffset)
{
    double xTran = TransformX(xVal);
    if (Limit::WithinOneLimit(convXaxisMin, convXaxisMax, xTran))
    {
        double ypt = yVal + yaxOffset - ticOffset;
        Point2D stPoint(xTran, ypt);
        Point2D endPoint(xTran, ypt + ticLen);
        DrawLine(stPoint, endPoint);
    }
}
开发者ID:jjayne,项目名称:nSIGHTS,代码行数:15,代码来源:PD_2DXYPS.cpp


示例18: QGraphicsLineItem

/**
 * Arrow class contructor, that creates and arrow from a start item
 * to the endItem
 * @param startItem
 * @param endItem
 * @param parentGroup
 */
Arrow::Arrow(DocBlock *startItem, Block *endItem, BlockGroup *parentGroup)
    : QGraphicsLineItem(parentGroup)
{
    Q_ASSERT(startItem != 0);Q_ASSERT(endItem != 0);Q_ASSERT(parentGroup != 0);
    myStartItem = startItem;
    myEndItem = endItem;
    myColor = Qt::black;
    setPen(QPen(myColor, 0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
    connect(myStartItem, SIGNAL(destroyed()), this, SLOT(deleteLater()));
    connect(myEndItem, SIGNAL(destroyed()), this, SLOT(deleteLater()));
    connect(myEndItem, SIGNAL(visibilityChanged(bool)), this, SLOT(updateVisibility(bool)));

    line1 = QLineF(startPoint(), midPoint());
    line2 = QLineF(midPoint(), endPoint());
}
开发者ID:fejo,项目名称:TrollEdit-1,代码行数:22,代码来源:arrow.cpp


示例19: startPoint

bool QgsCurve::isClosed() const
{
  if ( numPoints() == 0 )
    return false;

  //don't consider M-coordinates when testing closedness
  QgsPoint start = startPoint();
  QgsPoint end = endPoint();

  bool closed = qgsDoubleNear( start.x(), end.x(), 1E-8 ) &&
                qgsDoubleNear( start.y(), end.y(), 1E-8 );
  if ( is3D() && closed )
    closed &= qgsDoubleNear( start.z(), end.z(), 1E-8 ) || ( std::isnan( start.z() ) && std::isnan( end.z() ) );
  return closed;
}
开发者ID:AlisterH,项目名称:Quantum-GIS,代码行数:15,代码来源:qgscurve.cpp


示例20: QLatin1String

/**
 * Loads AssociationLine information saved in \a qElement XMI element.
 */
bool AssociationLine::loadFromXMI(QDomElement &qElement)
{
    QString layout = qElement.attribute(QLatin1String("layout"), QLatin1String("polyline"));
    m_layout = fromString(layout);

    QDomNode node = qElement.firstChild();

    m_points.clear();

    QDomElement startElement = node.toElement();
    if(startElement.isNull() || startElement.tagName() != QLatin1String("startpoint")) {
        return false;
    }
    QString x = startElement.attribute(QLatin1String("startx"), QLatin1String("0"));
    qreal nX = x.toFloat();
    QString y = startElement.attribute(QLatin1String("starty"), QLatin1String("0"));
    qreal nY = y.toFloat();
    QPointF startPoint(nX, nY);

    node = startElement.nextSibling();
    QDomElement endElement = node.toElement();
    if(endElement.isNull() || endElement.tagName() != QLatin1String("endpoint")) {
        return false;
    }
    x = endElement.attribute(QLatin1String("endx"), QLatin1String("0"));
    nX = x.toFloat();
    y = endElement.attribute(QLatin1String("endy"), QLatin1String("0"));
    nY = y.toFloat();
    QPointF endPoint(nX, nY);
    setEndPoints(startPoint, endPoint);
    QPointF point;
    node = endElement.nextSibling();
    QDomElement element = node.toElement();
    int i = 1;
    while(!element.isNull()) {
        if(element.tagName() == QLatin1String("point")) {
            x = element.attribute(QLatin1String("x"), QLatin1String("0"));
            y = element.attribute(QLatin1String("y"), QLatin1String("0"));
            point.setX(x.toFloat());
            point.setY(y.toFloat());
            insertPoint(i++, point);
        }
        node = element.nextSibling();
        element = node.toElement();
    }

    return true;
}
开发者ID:behlingc,项目名称:umbrello-behlingc,代码行数:51,代码来源:associationline.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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