本文整理汇总了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);
}
}
示例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;
}
示例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();
}