14 #include "RGBDImage.h"
15 #include "VoxelGrid.h"
57 *lockedVertices =
false;
71 *lockedVertices = vertices->
isLocked();
84 *lockedVertices =
false;
98 *lockedVertices = vertices->
isLocked();
111 if (cloud)
return cloud;
114 if (lockedVertices) {
115 *lockedVertices =
false;
132 ?
static_cast<ccMesh*
>(obj)
159 return static_cast<ccFacet*
>(obj);
161 return static_cast<ccPlane*
>(obj);
232 return proxy ? proxy->
getOctree().data() :
nullptr;
337 std::vector<int>* newPointOrTriangleIndex ,
340 if (!sourceEntity || !destEntity) {
347 bool sourceAndDestAreCloud = sourceIsCloud && destIsCloud;
351 bool sourceAndDestAreMeshes = sourceIsMesh && destIsMesh;
353 unsigned numberOfPointOrTriangle = 0;
355 numberOfPointOrTriangle =
357 else if (sourceIsMesh)
358 numberOfPointOrTriangle =
361 if (newPointOrTriangleIndex) {
362 if (sourceEntity == destEntity) {
364 "[ccHObjectCaster::CloneChildren] Providing a "
365 "point/triangle correspondance map while the source and "
366 "destination entities are the same");
370 if (!sourceAndDestAreCloud && !sourceAndDestAreMeshes) {
372 "[ccHObjectCaster::CloneChildren] A point/triangle "
373 "correspondance map can only work between 2 entities of "
378 if (newPointOrTriangleIndex->size() != numberOfPointOrTriangle) {
380 "[ccHObjectCaster::CloneChildren] Mismatch between the "
381 "point/triangle correspondance map and the source entity "
387 QMap<ccCameraSensor*, ccCameraSensor*> clonedCameraSensors;
390 (sourceEntityProxy ? sourceEntityProxy : sourceEntity);
392 (destEntityProxy ? destEntityProxy : destEntity);
404 bool keepThisLabel =
true;
405 if (newPointOrTriangleIndex) {
406 for (
unsigned i = 0; i < label->
size(); ++i) {
409 if (pp.
entity() == sourceEntity &&
410 newPointOrTriangleIndex->at(pp.
index) < 0) {
413 keepThisLabel =
false;
422 for (
unsigned i = 0; i < label->
size(); ++i) {
424 if (pp.
entity() == sourceEntity) {
432 if (newPointOrTriangleIndex) {
433 pp.
index =
static_cast<unsigned>(
434 newPointOrTriangleIndex->at(
446 currentDestEntity->
addChild(clonedLabel);
457 if (clonedCameraSensors.contains(camSensor)) {
461 clonedCameraSensors[camSensor]);
466 clonedCameraSensors.insert(camSensor, clonedCamSensor);
469 clonedImage->
addChild(clonedCamSensor);
473 currentDestEntity->
addChild(clonedImage);
481 clonedCameraSensors.insert(camSensor, clonedCamSensor);
483 currentDestEntity->
addChild(clonedCamSensor);
491 currentDestEntity->
addChild(clonedGBLSensor);
502 currentDestEntity->
addChild(clonedViewportObject);
513 currentDestEntity->
addChild(clonedViewportLabel);
520 if (CloneChildren(sourceEntity, destEntity,
521 newPointOrTriangleIndex, child, newGroup)) {
523 currentDestEntity->
addChild(newGroup);
std::shared_ptr< core::Tensor > image
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
2D label (typically attached to points)
bool addPickedPoint(ccGenericPointCloud *cloud, unsigned pointIndex, bool entityCenter=false)
Adds a point to this label.
const PickedPoint & getPickedPoint(unsigned index) const
Returns a given point.
unsigned size() const
Returns current size.
virtual QString getName() const override
Returns object name.
Camera (projective) sensor.
Coordinate System (primitive)
Profile extrusion (primitive)
Ground-based Laser sensor.
A 3D cloud interface with associated features (color, normals, octree, etc.)
Generic primitive interface.
static ccPolyline * ToPolyline(ccHObject *obj)
Converts current object to ccPolyline (if possible)
static cloudViewer::geometry::RGBDImage * ToRGBDImage(ccHObject *obj)
static cloudViewer::geometry::Image * ToImage2(ccHObject *obj)
static ccOctreeProxy * ToOctreeProxy(ccHObject *obj)
Converts current object to ccOctreeProxy (if possible)
static cloudViewer::geometry::Octree * ToOctree2(ccHObject *obj)
static cc2DViewportLabel * To2DViewportLabel(ccHObject *obj)
Converts current object to cc2DViewportLabel (if possible)
static ccGBLSensor * ToGBLSensor(ccHObject *obj)
static ccCoordinateSystem * ToCoordinateSystem(ccHObject *obj)
Converts current object to ccCoordinateSystem (if possible)
static ccPlane * ToPlane(ccHObject *obj)
Converts current object to ccPlane (if possible)
static ccImage * ToImage(ccHObject *obj)
static cloudViewer::geometry::VoxelGrid * ToVoxelGrid(ccHObject *obj)
static ccBox * ToBox(ccHObject *obj)
Converts current object to ccBox (if possible)
static ccCone * ToCone(ccHObject *obj)
Converts current object to ccCone (if possible)
static ccIndexedTransformationBuffer * ToTransBuffer(ccHObject *obj)
Converts current object to ccIndexedTransformationBuffer (if possible)
static ccFacet * ToFacet(ccHObject *obj)
Converts current object to ccFacet (if possible)
static ccDish * ToDish(ccHObject *obj)
Converts current object to ccDish (if possible)
static ccBBox * ToBBox(ccHObject *obj)
static cloudViewer::geometry::LineSet * ToLineSet(ccHObject *obj)
static ccSphere * ToSphere(ccHObject *obj)
Converts current object to ccSphere (if possible)
static ccDisc * ToDisc(ccHObject *obj)
Converts current object to ccDisc (if possible)
static ccTorus * ToTorus(ccHObject *obj)
Converts current object to ccTorus (if possible)
static ccGenericMesh * ToGenericMesh(ccHObject *obj)
Converts current object to ccGenericMesh (if possible)
static ccCircle * ToCircle(ccHObject *obj)
Converts current object to ccCircle (if possible)
static ccQuadric * ToQuadric(ccHObject *obj)
Converts current object to ccQuadric (if possible)
static ecvOrientedBBox * ToOrientedBBox(ccHObject *obj)
static cc2DViewportObject * To2DViewportObject(ccHObject *obj)
Converts current object to cc2DViewportObject (if possible)
static ccSubMesh * ToSubMesh(ccHObject *obj)
Converts current object to ccSubMesh (if possible)
static ccSensor * ToSensor(ccHObject *obj)
Converts current object to ccSensor (if possible)
static ccMesh * ToMesh(ccHObject *obj)
Converts current object to ccMesh (if possible)
static ccGenericPrimitive * ToPrimitive(ccHObject *obj)
Converts current object to ccGenericPrimitive (if possible)
static ccOctree * ToOctree(ccHObject *obj)
Converts current object to ccOctree (if possible)
static ccShiftedObject * ToShifted(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccShiftedObject.
static ccPlanarEntityInterface * ToPlanarEntity(ccHObject *obj)
Converts current object to ccPlanarEntityInterface (if possible)
static ccCameraSensor * ToCameraSensor(ccHObject *obj)
static ccKdTree * ToKdTree(ccHObject *obj)
Converts current object to ccKdTree (if possible)
static ccGenericPointCloud * ToGenericPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccGenericPointCloud.
static bool CloneChildren(const ccHObject *sourceEntity, ccHObject *destEntity, std::vector< int > *newPointOrTriangleIndex=nullptr, const ccHObject *sourceEntityProxy=nullptr, ccHObject *destEntityProxy=nullptr)
static ccExtru * ToExtru(ccHObject *obj)
Converts current object to ccExtru (if possible)
static ccCylinder * ToCylinder(ccHObject *obj)
Converts current object to ccCylinder (if possible)
static cc2DLabel * To2DLabel(ccHObject *obj)
Converts current object to cc2DLabel (if possible)
static ccPointCloud * ToPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccPointCloud.
Hierarchical CLOUDVIEWER Object.
unsigned getChildrenNumber() const
Returns the number of children.
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
ccHObject * getChild(unsigned childPos) const
Returns the ith child.
CV_CLASS_ENUM getClassID() const override
Returns class ID.
void setAssociatedSensor(ccCameraSensor *sensor)
Sets associated sensor.
virtual bool isLocked() const
Returns whether the object is locked or not.
bool isA(CV_CLASS_ENUM type) const
virtual void setName(const QString &name)
Sets object name.
bool isKindOf(CV_CLASS_ENUM type) const
ccOctree::Shared getOctree() const
Returns the associated octree.
Interface for a planar entity.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Generic sensor interface.
Shifted entity interface.
The Image class stores image with customizable width, height, num of channels and bytes per channel.
LineSet define a sets of lines in 3D. A typical application is to display the point cloud corresponde...
RGBDImage is for a pair of registered color and depth images,.
VoxelGrid is a collection of voxels which are aligned in grid.
Generic file read and write utility for python interface.
unsigned index
Point/triangle index.
ccGenericMesh * mesh
Mesh.
ccHObject * entity() const
Returns the associated entity (cloud or mesh)
ccGenericPointCloud * cloud
Cloud.