本文整理汇总了C++中cchobject::Container::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ Container::push_back方法的具体用法?C++ Container::push_back怎么用?C++ Container::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cchobject::Container
的用法示例。
在下文中一共展示了Container::push_back方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSelectedEntitiesThatAre
void BaseFilter::getSelectedEntitiesThatAre(CC_CLASS_ENUM kind, ccHObject::Container & entities)
{
ccHObject::Container selected = m_selected;
for (size_t i = 0 ; i < selected.size(); ++i)
{
ccHObject * this_obj = selected[i];
if (this_obj->isA(kind))
{
entities.push_back(this_obj);
}
}
}
示例2: getSelectedEntitiesThatAreCCPointCloud
void BaseFilter::getSelectedEntitiesThatAreCCPointCloud(ccHObject::Container & entities)
{
ccHObject::Container selected = m_selected;
for (size_t i = 0 ; i < selected.size(); ++i)
{
ccHObject * this_obj = selected[i];
if (this_obj->isA(CC_TYPES::POINT_CLOUD))
{
entities.push_back(this_obj);
}
}
}
示例3: getAllEntitiesThatHaveMetaData
void BaseFilter::getAllEntitiesThatHaveMetaData(QString key, ccHObject::Container &entities)
{
entities.clear(); //better be sure
ccHObject::Container tempContainer;
getAllEntitiesOfType(CC_TYPES::HIERARCHY_OBJECT, tempContainer);
for (ccHObject::Container::const_iterator it = tempContainer.begin(); it != tempContainer.end(); ++it )
{
if ((*it)->hasMetaData(key))
entities.push_back(*it);
}
}
示例4: getSelectedEntities
int ccDBRoot::getSelectedEntities(ccHObject::Container& selEntities,
CC_CLASS_ENUM filter/*=CC_OBJECT*/,
dbTreeSelectionInfo* info/*=NULL*/)
{
QItemSelectionModel* qism = m_dbTreeWidget->selectionModel();
QModelIndexList selectedIndexes = qism->selectedIndexes();
int i,selCount = selectedIndexes.size();
for (i=0;i<selCount; ++i)
{
ccHObject* anObject = static_cast<ccHObject*>(selectedIndexes[i].internalPointer());
if (anObject && anObject->isKindOf(filter))
selEntities.push_back(anObject);
}
if (info)
{
info->reset();
info->selCount=selCount;
for (i=0;i<selCount;++i)
{
ccHObject* obj = selEntities[i];
info->sfCount += int(obj->hasScalarFields());
info->colorCount += int(obj->hasColors());
info->normalsCount += int(obj->hasNormals());
if (obj->isKindOf(CC_POINT_CLOUD))
{
ccGenericPointCloud* cloud = ccHObjectCaster::ToGenericPointCloud(obj);
info->cloudCount++;
info->octreeCount += int(cloud->getOctree()!=NULL);
}
if (obj->isKindOf(CC_MESH))
info->meshCount++;
if (obj->isKindOf(CC_SENSOR))
{
info->sensorCount++;
if (obj->isKindOf(CC_GBL_SENSOR))
info->gblSensorCount++;
}
if (obj->isKindOf(CC_POINT_KDTREE))
info->kdTreeCount++;
}
}
return int(selEntities.size());
}
示例5: GetSupportedShapes
void GetSupportedShapes(ccHObject* baseEntity, ccHObject::Container& shapes, ESRI_SHAPE_TYPE& shapeType)
{
shapeType = SHP_NULL_SHAPE;
if (!baseEntity)
{
assert(false);
shapes.clear();
return;
}
switch (baseEntity->getClassID())
{
case CC_TYPES::POINT_CLOUD:
{
unsigned count = ccHObjectCaster::ToGenericPointCloud(baseEntity)->size();
if (count != 0)
{
shapeType = SHP_MULTI_POINT_Z;
shapes.push_back(baseEntity);
}
}
break;
//DGM: TODO
//case CC_MESH:
//case CC_SUB_MESH:
// {
// unsigned count = ccHObjectCaster::ToGenericMesh(baseEntity)->size();
// if (count != 0)
// {
// shapeType = SHP_MULTI_PATCH;
// shapes.push_back(baseEntity);
// }
// }
// break;
case CC_TYPES::POLY_LINE:
{
ccPolyline* poly = static_cast<ccPolyline*>(baseEntity);
shapeType = poly->is2DMode() ? SHP_POLYLINE : SHP_POLYLINE_Z;
shapes.push_back(baseEntity);
break;
}
case CC_TYPES::HIERARCHY_OBJECT:
//we only allow groups with children of the same type!
if (baseEntity->getChildrenNumber())
{
ccHObject* child = baseEntity->getChild(0);
assert(child);
if (!child)
return;
//first we check that all entities have the same type
{
for (unsigned i=1; i<baseEntity->getChildrenNumber(); ++i)
{
if (baseEntity->getChild(i) && baseEntity->getChild(i)->getClassID() != child->getClassID())
{
//mixed shapes are not allowed in shape files (yet?)
return;
}
}
}
//call the same method on the first child so as to get its type
GetSupportedShapes(child,shapes,shapeType/*,closedPolylinesAsPolygons*/);
if (shapeType == SHP_NULL_SHAPE)
return;
//then add the remaining children
{
for (unsigned i=1; i<baseEntity->getChildrenNumber(); ++i)
{
ESRI_SHAPE_TYPE otherShapeType = SHP_NULL_SHAPE;
ccHObject* child = baseEntity->getChild(i);
if (child)
GetSupportedShapes(child,shapes,otherShapeType);
if (otherShapeType != shapeType)
{
if (child)
ccLog::Warning(QString("[SHP] Entity %1 has not the same type (%1) as the others in the selection (%2)! Can't mix types...")
.arg(child->getName())
.arg(ToString(otherShapeType))
.arg(ToString(shapeType)));
//mixed shapes are not allowed in shape files (yet?)
shapes.clear();
return;
}
}
}
}
break;
default:
//nothing to do
break;
}
}
示例6: doAction
//.........这里部分代码省略.........
s_result = false;
break;
}
//*/
}
result = s_result;
progressCb->stop();
QApplication::processEvents();
}
else
{
result = PoissonReconLib::reconstruct(count, points, normals, mesh, depth, &info);
}
delete[] points;
points=0;
delete[] normals;
normals=0;
if (!result || mesh.polygonCount() < 1)
return -4;
unsigned nic = (unsigned)mesh.inCorePoints.size();
unsigned noc = (unsigned)mesh.outOfCorePointCount();
unsigned nr_vertices = nic+noc;
unsigned nr_faces = (unsigned)mesh.polygonCount();
ccPointCloud* newPC = new ccPointCloud("vertices");
newPC->reserve(nr_vertices);
//we enlarge bounding box a little bit (2%)
PointCoordinateType bbMin[3],bbMax[3];
pc->getBoundingBox(bbMin,bbMax);
CCVector3 boxHalfDiag = (CCVector3(bbMax)-CCVector3(bbMin))*0.51f;
CCVector3 boxCenter = (CCVector3(bbMax)+CCVector3(bbMin))*0.5f;
CCVector3 filterMin = boxCenter-boxHalfDiag;
CCVector3 filterMax = boxCenter+boxHalfDiag;
Point3D<float> p;
CCVector3 p2;
for (i=0; i<nic; i++)
{
p = mesh.inCorePoints[i];
p2.x = p.coords[0]*info.scale+info.center[0];
p2.y = p.coords[1]*info.scale+info.center[1];
p2.z = p.coords[2]*info.scale+info.center[2];
newPC->addPoint(p2);
}
for (i=0; i<noc; i++)
{
mesh.nextOutOfCorePoint(p);
p2.x = p.coords[0]*info.scale+info.center[0];
p2.y = p.coords[1]*info.scale+info.center[1];
p2.z = p.coords[2]*info.scale+info.center[2];
newPC->addPoint(p2);
}
ccMesh* newMesh = new ccMesh(newPC);
newMesh->setName(QString("Mesh[%1] (level %2)").arg(pc->getName()).arg(depth));
newMesh->reserve(nr_faces);
newMesh->addChild(newPC);
std::vector<CoredVertexIndex> vertices;
for (i=0; i < nr_faces; i++)
{
mesh.nextPolygon(vertices);
if (vertices.size()!=3)
{
//Can't handle anything else than triangles yet!
assert(false);
}
else
{
for (std::vector<CoredVertexIndex>::iterator it = vertices.begin(); it != vertices.end(); ++it)
if (!it->inCore)
it->idx += nic;
newMesh->addTriangle(vertices[0].idx,
vertices[1].idx,
vertices[2].idx);
}
}
newPC->setVisible(false);
newMesh->setVisible(true);
newMesh->computeNormals();
//output mesh
selectedEntities.push_back(newMesh);
//currently selected entities parameters may have changed!
uiModificationFlags |= CC_PLUGIN_REFRESH_ENTITY_BROWSER;
//currently selected entities appearance may have changed!
uiModificationFlags |= CC_PLUGIN_REFRESH_GL_WINDOWS;
return 1;
}