本文整理汇总了C++中SpMObject类的典型用法代码示例。如果您正苦于以下问题:C++ SpMObject类的具体用法?C++ SpMObject怎么用?C++ SpMObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SpMObject类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getReliability
double DEGU_CORNER::getReliability(SpMObject mobile, Datapool& datapool) {
//Add reliability measure according to minimal corner distance
SpReliabilitySingleModelInterface m = mobile->getSubModel("BaseModel");
if(m.isNull())
return 0;
return (m->dynamics.dynamics["X"].att.VR.RC + m->dynamics.dynamics["Y"].att.VR.RC)/2.0;
}
示例2: sqrt
double V2D::getValue(SpMObject mobile, Datapool& datapool) {
SpReliabilitySingleModelInterface m = mobile->getSubModel("BaseModel");
if(m.isNull())
return 0;
double VX = m->dynamics.dynamics["X"].V.value,
VY = m->dynamics.dynamics["Y"].V.value;
return sqrt(VX*VX+VY*VY);
}
示例3: getValue
std::string DEGU_CORNER::getValue(SpMObject mobile, Datapool& datapool) {
if(checked) {
checked = true;
valid = true;
//First check zones
std::vector< QSharedPointer<world::ZoneH> > &zones = datapool.sceneModel->ZonesH;
if (zones.empty())
valid = false;
else {
int num = 0;
std::vector< QSharedPointer<world::ZoneH> >::iterator zone_it, zone_end = zones.end();
for(zone_it = zones.begin(); zone_it != zone_end; zone_it++ ) {
if(values.count((*zone_it)->name.toStdString()) == 1) {
num++;
DEGU_CORNER::zones[(*zone_it)->name.toStdString()] = (*zone_it);
}
}
if(num != values.size() - 1)
valid = false;
}
}
SpReliabilitySingleModelInterface m = mobile->getSubModel("BaseModel");
if(m.isNull())
return "NONE";
if(valid) {
double dist, X, Y, min_dist = DBL_MAX;
std::string nearest;
if(datapool.sceneModel->hmatrix_filled) {
datapool.sceneModel->imgToHomographyCoords(datapool.sceneModel->h_matrix,
nearbyint(m->dynamics.dynamics["X"].att.value),
nearbyint(m->dynamics.dynamics["Y"].att.value),
&X, &Y);
QSharedPointer<world::ZoneH> z;
std::map< std::string, QSharedPointer<world::ZoneH> >::iterator it, it_end = zones.end();
for(it = zones.begin();it != it_end; it++) {
z = (*it).second;
if(z->pointInZone(X,Y)) {
dist = z->distanceToCenter(X,Y);
if(dist < min_dist) {
min_dist = dist;
nearest = (*it).first;
}
}
}
if(min_dist < DBL_MAX)
return nearest;
}
}
return "NONE";
}
示例4: getValue
double VX::getValue(SpMObject mobile, Datapool& datapool) {
SpReliabilitySingleModelInterface m = mobile->getSubModel("Blob2DFromBGSubstractionModel");
if(m.isNull())
return 0;
return m->dynamics.dynamics["X"].V.value;
}
示例5: getReliability
double Y::getReliability(SpMObject mobile, Datapool& datapool) {
SpReliabilitySingleModelInterface m = mobile->getSubModel("Blob2DFromBGSubstractionModel");
if(m.isNull())
return 0;
return m->dynamics.dynamics["Y"].att.VR.RC;
}