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


C++ Marker::setID方法代码示例

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


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

示例1: QVariant

void
PlotWidget::loadMarkers (DataBase &db)
{
  // load marker names
  QStringList names;
  db.getTypes(QString("marker"), names);
  
  for (int pos = 0; pos < names.size(); pos++)
  {
    Entity te;
    te.setName(names.at(pos));
    te.set(QString("plugin"), new QVariant(QString()));
    te.set(QString("plot"), new QVariant(QString()));
    te.set(QString("symbol"), new QVariant(QString()));
    
    if (! db.get(&te))
      continue;

    QVariant *tset = te.get(QString("symbol"));
    if (tset->toString() != g_symbol->symbol())
      continue;
    
    tset = te.get(QString("plot"));
    Plot *p = _plots.value(tset->toString());
    if (! p)
    {
      qDebug() << "PlotWidget::loadMarkers: plot not found" << tset->toString();
      continue;
    }
    
    tset = te.get(QString("plugin"));
    
    Marker *m = new Marker(tset->toString());
    m->setID(names.at(pos));
    
    Entity *e = m->settings();
    
    e->setName(names.at(pos));
    db.get(e);

    p->setMarker(m);
  }
}
开发者ID:abhikalitra,项目名称:qtstalker,代码行数:43,代码来源:PlotWidget.cpp

示例2: Marker

Marker *
RSI::newMarker (QColor color, double price)
{
  QString id = QUuid::createUuid().toString();
  id.remove("{");
  id.remove("}");
  id.remove("-");
  
  Marker *m = new Marker(QString("MarkerHLine"));
  m->setID(id);  
  m->setReadOnly(TRUE);
  
  Entity *e = m->settings();
  
  QVariant *tset = e->get(QString("color"));
  tset->setValue(color.name());
  
  tset = e->get(QString("price"));
  tset->setValue(price);

  return m;
}
开发者ID:abhikalitra,项目名称:qtstalker,代码行数:22,代码来源:RSI.cpp

示例3: DataHandler

// DataHandler receives data from the server
void __cdecl DataHandler(sFrameOfMocapData* data, void* pUserData) {
	// Cast user data as ClientHandler
	ClientHandler* pClient = (ClientHandler*) pUserData;

	// Lock the ClientHandler so data isn't changed
	// by another thread.
	if (!pClient->lock())
		return;

	// Unlock the ClientHandler
	pClient->unlock();

	// Rigid Bodies
	for(int i = 0; i < data->nRigidBodies; i++) {
		// Get pointer to Rigid Body
		RigidBody* body = pClient->getRigidBody(data->RigidBodies[i].ID);

		// Check if Rigid Body with the given ID exists
		if ( body ) {
			// Lock the ClientHandler so data isn't changed
			// by another thread.
			if (!pClient->lock())
				continue;

			// Update the Position and Orientation of the Rigid Body
			float x, y, z;
			float qx, qy, qz, qw;

			if (pClient->coordinateSystem()) {
				x = data->RigidBodies[i].x;
				y = data->RigidBodies[i].y;
				z = data->RigidBodies[i].z;

				qx = data->RigidBodies[i].qx;
				qy = data->RigidBodies[i].qy;
				qz = data->RigidBodies[i].qz;
				qw = data->RigidBodies[i].qw;
			} else {
				x = -data->RigidBodies[i].x;
				y = data->RigidBodies[i].z;
				z = data->RigidBodies[i].y;

				qx = -data->RigidBodies[i].qx;
				qy = data->RigidBodies[i].qz;
				qz = data->RigidBodies[i].qy;
				qw = data->RigidBodies[i].qw;
			}
				
			body->addFrame(Eigen::Vector3f(x, y, z),
				Eigen::Quaternionf(qw, qx, qy, qz));

			// Clear all the previous markers that were attached to the Rigid Body
			body->clearMarkers();

			// Gather all the Markers attached to the Rigid Body
			for(int iMarker = 0; iMarker < data->RigidBodies[i].nMarkers; iMarker++) {
				// Create a new marker
				Marker marker;

				// Get the information about the marker
				if(data->RigidBodies[i].MarkerIDs)
					marker.setID(data->RigidBodies[i].MarkerIDs[iMarker]);

				if(data->RigidBodies[i].Markers) {
					if (pClient->coordinateSystem()) {
						x = -data->RigidBodies[i].Markers[iMarker][0];
						y = data->RigidBodies[i].Markers[iMarker][1];
						z = data->RigidBodies[i].Markers[iMarker][2];
					} else {
						x = -data->RigidBodies[i].Markers[iMarker][0];
						z = data->RigidBodies[i].Markers[iMarker][1];
						y = data->RigidBodies[i].Markers[iMarker][2];
					}

					marker.setPosition(Eigen::Vector3f(x, y, z));
				}

				// Add the marker to the Rigid Body
				body->addMarker(marker);
			}

			// Unlock the ClientHandler
			pClient->unlock();
		}
	}

	// Update the OptiTrack data
	pClient->updateData();

}
开发者ID:mdfeist,项目名称:ProjectDR,代码行数:91,代码来源:ClientHandler.cpp


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