本文整理汇总了C++中Objects::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ Objects::push_back方法的具体用法?C++ Objects::push_back怎么用?C++ Objects::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objects
的用法示例。
在下文中一共展示了Objects::push_back方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: detect
/* -----------------------------------------------------------------------------
* Detection (FAKE)
*/
void SampleDetector::detect( const Mat& rgb, const Mat& depth, Objects& objects, int FLAGS )
{
objects.clear();
// Set a bounding box of a FAKE detection
Object detection;
detection.m_bb.x = 100 + (rand() % 20);
detection.m_bb.y = 100 + (rand() % 20);
detection.m_bb.width = 100 + (rand() % 5);
detection.m_bb.height = 100 + (rand() % 5);
detection.m_pos_2D.x = detection.m_bb.x + (detection.m_bb.width / 2);
detection.m_pos_2D.y = detection.m_bb.y + (detection.m_bb.height / 2);
detection.m_class = unknown;
detection.m_score = 0;
detection.m_angle = 0;
detection.m_mask = Mat(cvSize(0, 0), CV_8U);
detection.m_timestamp = 0;
detection.m_speed = cv::Point3f(0,0,0);
objects.push_back(detection);
}
示例2:
ObjectLayer::Objects
ObjectLayer::get_selection(const CL_Rectf& rect)
{
Objects selection;
for(Objects::iterator i = impl->objects.begin(); i != impl->objects.end(); ++i)
{
// FIXME:
if (rect.is_inside((*i).get_pos()))
{
selection.push_back(*i);
}
}
return selection;
}
示例3: assert
TimelineLayer::Objects
TimelineLayer::get_objects(float selection_start, float selection_end) const
{
assert(selection_start <= selection_end);
Objects objects;
for(const_iterator i = begin(); i != end(); ++i)
{
if (selection_start <= (*i)->get_pos() &&
selection_end > (*i)->get_pos() + (*i)->get_width())
{
objects.push_back(*i);
}
}
return objects;
}
示例4: getOrderedObjects
// NOTE: This is really not at all efficient. However, since there's only a
// small number of objects, it should matter. We really do need a stable
// sort, though, so Common::sort() is out.
SEQFile::Objects SEQFile::getOrderedObjects() {
int16 minOrder = (int16)0x7FFF;
int16 maxOrder = (int16)0x8000;
Objects objects;
// Find the span of order values
for (uint i = 0; i < kObjectCount; i++) {
if (!_objects[i].object)
continue;
minOrder = MIN(minOrder, _objects[i].order);
maxOrder = MAX(maxOrder, _objects[i].order);
}
// Stably sort the objects by order value
for (int16 o = minOrder; o <= maxOrder; o++)
for (uint i = 0; i < kObjectCount; i++)
if (_objects[i].object && (_objects[i].order == o))
objects.push_back(_objects[i]);
return objects;
}
示例5:
PtrTracer(const ManagedHeap& heap)
{
// сформировать список объектов
objects.reserve(heap.allocations.size());
for(Allocations::const_iterator i = heap.allocations.begin(); i != heap.allocations.end(); ++i)
objects.push_back(Object(i->first, i->second.size, i->second.info));
std::sort(objects.begin(), objects.end(), sorter);
// сформировать карту ссылок
for(Ptrs::const_iterator i = heap.ptrs.begin(); i != heap.ptrs.end(); ++i)
{
// найти объект, в котором содержится указатель
Objects::const_iterator j = std::upper_bound(objects.begin(), objects.end(), i->first, sorter);
if(j > objects.begin())
{
--j;
if((size_t)((char*)i->first - (char*)j->data) < j->size)
// да, указатель содержится в этом объекте
// получить объект, на который указывает указатель, и добавить ссылку
links.insert(std::make_pair(j, std::lower_bound(objects.begin(), objects.end(), i->second, sorter)));
}
}
}
示例6: keep
T* keep(T* t)
{
objects.push_back(t);
return t;
}