ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccHObjectCaster Class Reference

Useful class to (try to) statically cast a basic ccHObject to a given type. More...

#include <ecvHObjectCaster.h>

Static Public Member Functions

static ccPointCloud * ToPointCloud (ccHObject *obj, bool *isLockedVertices=nullptr)
 Converts current object to 'equivalent' ccPointCloud. More...
 
static ccGenericPointCloud * ToGenericPointCloud (ccHObject *obj, bool *isLockedVertices=nullptr)
 Converts current object to 'equivalent' ccGenericPointCloud. More...
 
static ccShiftedObject * ToShifted (ccHObject *obj, bool *isLockedVertices=nullptr)
 Converts current object to 'equivalent' ccShiftedObject. More...
 
static ccGenericMesh * ToGenericMesh (ccHObject *obj)
 Converts current object to ccGenericMesh (if possible) More...
 
static ccMesh * ToMesh (ccHObject *obj)
 Converts current object to ccMesh (if possible) More...
 
static ccSubMesh * ToSubMesh (ccHObject *obj)
 Converts current object to ccSubMesh (if possible) More...
 
static ccPolyline * ToPolyline (ccHObject *obj)
 Converts current object to ccPolyline (if possible) More...
 
static ccCircle * ToCircle (ccHObject *obj)
 Converts current object to ccCircle (if possible) More...
 
static ccFacet * ToFacet (ccHObject *obj)
 Converts current object to ccFacet (if possible) More...
 
static ccPlanarEntityInterface * ToPlanarEntity (ccHObject *obj)
 Converts current object to ccPlanarEntityInterface (if possible) More...
 
static ccGenericPrimitive * ToPrimitive (ccHObject *obj)
 Converts current object to ccGenericPrimitive (if possible) More...
 
static ccSphere * ToSphere (ccHObject *obj)
 Converts current object to ccSphere (if possible) More...
 
static ccCylinder * ToCylinder (ccHObject *obj)
 Converts current object to ccCylinder (if possible) More...
 
static ccCone * ToCone (ccHObject *obj)
 Converts current object to ccCone (if possible) More...
 
static ccPlane * ToPlane (ccHObject *obj)
 Converts current object to ccPlane (if possible) More...
 
static ccQuadric * ToQuadric (ccHObject *obj)
 Converts current object to ccQuadric (if possible) More...
 
static ccBox * ToBox (ccHObject *obj)
 Converts current object to ccBox (if possible) More...
 
static ccDisc * ToDisc (ccHObject *obj)
 Converts current object to ccDisc (if possible) More...
 
static ccDish * ToDish (ccHObject *obj)
 Converts current object to ccDish (if possible) More...
 
static ccExtru * ToExtru (ccHObject *obj)
 Converts current object to ccExtru (if possible) More...
 
static ccTorus * ToTorus (ccHObject *obj)
 Converts current object to ccTorus (if possible) More...
 
static ccOctreeProxy * ToOctreeProxy (ccHObject *obj)
 Converts current object to ccOctreeProxy (if possible) More...
 
static ccOctree * ToOctree (ccHObject *obj)
 Converts current object to ccOctree (if possible) More...
 
static ccKdTree * ToKdTree (ccHObject *obj)
 Converts current object to ccKdTree (if possible) More...
 
static ccSensor * ToSensor (ccHObject *obj)
 Converts current object to ccSensor (if possible) More...
 
static ccGBLSensor * ToGBLSensor (ccHObject *obj)
 
static ccCameraSensor * ToCameraSensor (ccHObject *obj)
 
static ccImage * ToImage (ccHObject *obj)
 
static cc2DLabel * To2DLabel (ccHObject *obj)
 Converts current object to cc2DLabel (if possible) More...
 
static cc2DViewportLabel * To2DViewportLabel (ccHObject *obj)
 Converts current object to cc2DViewportLabel (if possible) More...
 
static cc2DViewportObject * To2DViewportObject (ccHObject *obj)
 Converts current object to cc2DViewportObject (if possible) More...
 
static ccIndexedTransformationBuffer * ToTransBuffer (ccHObject *obj)
 Converts current object to ccIndexedTransformationBuffer (if possible) More...
 
static cloudViewer::geometry::Image * ToImage2 (ccHObject *obj)
 
static cloudViewer::geometry::RGBDImage * ToRGBDImage (ccHObject *obj)
 
static cloudViewer::geometry::VoxelGrid * ToVoxelGrid (ccHObject *obj)
 
static cloudViewer::geometry::LineSet * ToLineSet (ccHObject *obj)
 
static cloudViewer::geometry::Octree * ToOctree2 (ccHObject *obj)
 
static ccBBox * ToBBox (ccHObject *obj)
 
static ecvOrientedBBox * ToOrientedBBox (ccHObject *obj)
 
static ccCoordinateSystem * ToCoordinateSystem (ccHObject *obj)
 Converts current object to ccCoordinateSystem (if possible) More...
 
static bool CloneChildren (const ccHObject *sourceEntity, ccHObject *destEntity, std::vector< int > *newPointOrTriangleIndex=nullptr, const ccHObject *sourceEntityProxy=nullptr, ccHObject *destEntityProxy=nullptr)
 

Detailed Description

Useful class to (try to) statically cast a basic ccHObject to a given type.

Member Function Documentation

◆ CloneChildren()

bool ccHObjectCaster::CloneChildren ( const ccHObject *  sourceEntity,
ccHObject *  destEntity,
std::vector< int > *  newPointOrTriangleIndex = nullptr,
const ccHObject *  sourceEntityProxy = nullptr,
ccHObject *  destEntityProxy = nullptr 
)
static

Helper: clones the children of sourceEntity and set the resulting entities as children of destEntity

Warning
: Not all children can be cloned this way. Only simple ones for now (labels, sensors, images, etc.).
Parameters
sourceEntitysource entity
destEntitydestination entity (can be the same as the source entity)
newPointOrTriangleIndexoptional: provides a mapping of the entity elements (points or triangles) between the source and the destination (-1 means no correspondance)
sourceEntityProxyfor internal use
destEntityProxyfor internal use
    \return success

References ccHObject::addChild(), cc2DLabel::addPickedPoint(), CV_TYPES::CAMERA_SENSOR, cc2DLabel::PickedPoint::cloud, cc2DLabel::PickedPoint::entity(), CV_TYPES::GBL_SENSOR, ccHObject::getChild(), ccHObject::getChildrenNumber(), ccHObject::getClassID(), cc2DLabel::getName(), cc2DLabel::getPickedPoint(), CV_TYPES::HIERARCHY_OBJECT, CV_TYPES::IMAGE, image, cc2DLabel::PickedPoint::index, ccObject::isKindOf(), CV_TYPES::LABEL_2D, CV_TYPES::MESH, cc2DLabel::PickedPoint::mesh, CV_TYPES::POINT_CLOUD, ccImage::setAssociatedSensor(), ccObject::setName(), cc2DLabel::size(), size, CV_TYPES::VIEWPORT_2D_LABEL, CV_TYPES::VIEWPORT_2D_OBJECT, and CVLog::Warning().

Referenced by ccMesh::createNewMeshFromSelection(), and ccPointCloud::partialClone().

◆ To2DLabel()

◆ To2DViewportLabel()

cc2DViewportLabel * ccHObjectCaster::To2DViewportLabel ( ccHObject *  obj)
static

◆ To2DViewportObject()

cc2DViewportObject * ccHObjectCaster::To2DViewportObject ( ccHObject *  obj)
static

Converts current object to cc2DViewportObject (if possible)

References ccObject::isKindOf(), and CV_TYPES::VIEWPORT_2D_OBJECT.

Referenced by ccPropertiesTreeDelegate::fillModel().

◆ ToBBox()

ccBBox * ccHObjectCaster::ToBBox ( ccHObject *  obj)
static

◆ ToBox()

ccBox * ccHObjectCaster::ToBox ( ccHObject *  obj)
static

Converts current object to ccBox (if possible)

References CV_TYPES::BOX, and ccObject::isKindOf().

◆ ToCameraSensor()

ccCameraSensor * ccHObjectCaster::ToCameraSensor ( ccHObject *  obj)
static

◆ ToCircle()

ccCircle * ccHObjectCaster::ToCircle ( ccHObject *  obj)
static

Converts current object to ccCircle (if possible)

References CV_TYPES::CIRCLE, and ccObject::isKindOf().

Referenced by ccPropertiesTreeDelegate::setEditorData().

◆ ToCone()

ccCone * ccHObjectCaster::ToCone ( ccHObject *  obj)
static

Converts current object to ccCone (if possible)

References CV_TYPES::CONE, and ccObject::isKindOf().

Referenced by ccPropertiesTreeDelegate::setEditorData().

◆ ToCoordinateSystem()

ccCoordinateSystem * ccHObjectCaster::ToCoordinateSystem ( ccHObject *  obj)
static

◆ ToCylinder()

ccCylinder * ccHObjectCaster::ToCylinder ( ccHObject *  obj)
static

Converts current object to ccCylinder (if possible)

References CV_TYPES::CYLINDER, and ccObject::isA().

◆ ToDisc()

ccDisc * ccHObjectCaster::ToDisc ( ccHObject *  obj)
static

Converts current object to ccDisc (if possible)

References CV_TYPES::DISC, and ccObject::isA().

Referenced by ccPropertiesTreeDelegate::setEditorData().

◆ ToDish()

ccDish * ccHObjectCaster::ToDish ( ccHObject *  obj)
static

Converts current object to ccDish (if possible)

References CV_TYPES::DISH, and ccObject::isA().

◆ ToExtru()

ccExtru * ccHObjectCaster::ToExtru ( ccHObject *  obj)
static

Converts current object to ccExtru (if possible)

References CV_TYPES::EXTRU, and ccObject::isA().

◆ ToFacet()

ccFacet * ccHObjectCaster::ToFacet ( ccHObject *  obj)
static

Converts current object to ccFacet (if possible)

References CV_TYPES::FACET, and ccObject::isA().

Referenced by ccPropertiesTreeDelegate::fillModel(), and ccEntityAction::setColor().

◆ ToGBLSensor()

◆ ToGenericMesh()

◆ ToGenericPointCloud()

ccGenericPointCloud * ccHObjectCaster::ToGenericPointCloud ( ccHObject *  obj,
bool *  isLockedVertices = nullptr 
)
static

Converts current object to 'equivalent' ccGenericPointCloud.

Warning: if a mesh is passed, this method returns its vertices.

References ccObject::isA(), ccObject::isKindOf(), ccObject::isLocked(), CV_TYPES::MESH, and CV_TYPES::POINT_CLOUD.

Referenced by ccPointPairRegistrationDlg::addAlignedPoint(), ccGraphicalSegmentationTool::addEntity(), ccPointPairRegistrationDlg::addReferencePoint(), MainWindow::addToDB(), ccPointPairRegistrationDlg::apply(), ccLibAlgorithms::ApplyCCLibAlgorithm(), ccLibAlgorithms::ApplyScaleMatchingAlgorithm(), ccGraphicalSegmentationTool::applySegmentation(), ccEntityAction::clearProperty(), ccLibAlgorithms::ComputeGeomCharacteristic(), ccEntityAction::computeOctree(), ccEntityAction::convertNormalsTo(), qPCV::doAction(), cc2DLabel::drawMeOnly3D(), ccPropertiesTreeDelegate::fillModel(), ccDBRoot::getSelectedEntities(), ccRegistrationTools::ICP(), ccEntityAction::interpolateColors(), PovFilter::loadFile(), PcdFilter::loadFile(), ccTracePolylineTool::onItemPicked(), ccComparisonDlg::prepareEntitiesForComparison(), ccGraphicalSegmentationTool::prepareEntityForRemoval(), ecvDisplayTools::ProcessPickingResult(), ccGraphicalSegmentationTool::reset(), ccEntityAction::rgbToGreyScale(), PovFilter::saveToFile(), VTKFilter::saveToFile(), PNFilter::saveToFile(), PVFilter::saveToFile(), LASFilter::saveToFile(), DepthMapFileFilter::saveToFile(), AsciiFilter::saveToFile(), ccGraphicalSegmentationTool::segment(), ccEntityAction::setColorGradient(), ccPropertiesTreeDelegate::setEditorData(), ecvFilterByLabelDlg::setInputEntity(), ccHObject::setPointSizeRecursive(), ccEntityAction::sfSetAsCoord(), ecvDisplayTools::StartCPUBasedPointPicking(), ecvDisplayTools::StartOpenGLPicking(), ToShifted(), and VtkUtils::TableModel::updateData().

◆ ToImage()

◆ ToImage2()

geometry::Image * ccHObjectCaster::ToImage2 ( ccHObject *  obj)
static

◆ ToKdTree()

ccKdTree * ccHObjectCaster::ToKdTree ( ccHObject *  obj)
static

Converts current object to ccKdTree (if possible)

References ccObject::isA(), and CV_TYPES::POINT_KDTREE.

Referenced by ccPropertiesTreeDelegate::fillModel(), and ccHObject::getTypeID_recursive().

◆ ToLineSet()

geometry::LineSet * ccHObjectCaster::ToLineSet ( ccHObject *  obj)
static

◆ ToMesh()

◆ ToOctree()

ccOctree * ccHObjectCaster::ToOctree ( ccHObject *  obj)
static

◆ ToOctree2()

geometry::Octree * ccHObjectCaster::ToOctree2 ( ccHObject *  obj)
static

◆ ToOctreeProxy()

ccOctreeProxy * ccHObjectCaster::ToOctreeProxy ( ccHObject *  obj)
static

Converts current object to ccOctreeProxy (if possible)

References ccObject::isA(), and CV_TYPES::POINT_OCTREE.

Referenced by ToOctree().

◆ ToOrientedBBox()

ecvOrientedBBox * ccHObjectCaster::ToOrientedBBox ( ccHObject *  obj)
static

◆ ToPlanarEntity()

ccPlanarEntityInterface * ccHObjectCaster::ToPlanarEntity ( ccHObject *  obj)
static

◆ ToPlane()

ccPlane * ccHObjectCaster::ToPlane ( ccHObject *  obj)
static

Converts current object to ccPlane (if possible)

References ccObject::isA(), and CV_TYPES::PLANE.

◆ ToPointCloud()

ccPointCloud * ccHObjectCaster::ToPointCloud ( ccHObject *  obj,
bool *  isLockedVertices = nullptr 
)
static

Converts current object to 'equivalent' ccPointCloud.

Warning: if a mesh is passed, this method returns its vertices.

Parameters
objccHObject to dynamically cast to a ccPointCloud object
isLockedVerticesthe caller can be warned if the returned cloud corresponds to locked vertices

References ccObject::isA(), ccObject::isKindOf(), ccObject::isLocked(), CV_TYPES::MESH, and CV_TYPES::POINT_CLOUD.

Referenced by ccMesh::addEigenVertices(), PclUtils::PCLVis::addTextureMeshFromCCMesh(), ccMesh::addVertexColor(), ccMesh::addVertexColors(), ccMesh::addVertexNormal(), ccMesh::addVertexNormals(), ccMesh::addVertice(), PclUtils::renders::MeshTextureApplier::ApplyTexturesFromCCMesh(), cloudViewer::io::AutoReadEntity(), ccMesh::ccMesh(), ccEntityAction::changeColorLevels(), PCLDisplayTools::checkEntityNeedUpdate(), ccMesh::clear(), ccEntityAction::computeStatParams(), vtk2cc::ConvertToPolyline(), ccEntityAction::ConvexHull(), G3Point::G3PointAction::createAction(), ccPropertiesTreeDelegate::createEditor(), ccMesh::Crop(), ccEntityAction::DBScanCluster(), qPCV::doAction(), PCLDisplayTools::draw(), ccEntityAction::enhanceRGBWithIntensities(), ccEntityAction::exportCoordToSF(), ccEntityAction::exportNormalToSF(), qFacets::extractFacets(), poisson::ExtractMesh(), cloudViewer::pipelines::integration::UniformTSDFVolume::ExtractTriangleMesh(), ccPropertiesTreeDelegate::fillSFWithPointCloud(), ccMesh::FilterSharpen(), ccMesh::FilterSmoothLaplacian(), ccMesh::FilterSmoothLaplacianHelper(), ccMesh::FilterSmoothSimple(), ccMesh::FilterSmoothTaubin(), ccMesh::GetCenter(), ccLibAlgorithms::GetDefaultCloudKernelSize(), ccMesh::getEigenVertices(), ccMesh::GetMaxBound(), ccMesh::GetMinBound(), cvSliceFilter::getOutput(), cvIsoSurfaceFilter::getOutput(), cvDistanceTool::getOutput(), cvProtractorTool::getOutput(), FastGlobalRegistrationFilter::getParametersFromDialog(), ccDBRoot::getSelectedEntities(), BasePclModule::getSelectedEntityAsCCPointCloud(), ccMesh::getVertexColor(), ccMesh::getVertexColors(), ccMesh::getVertexColorsPtr(), ccMesh::getVertexNormal(), ccMesh::getVertexNormals(), ccMesh::getVertice(), ccMesh::getVertices(), ccMesh::getVerticesPtr(), cc2smReader::getVtkPolyDataFromMeshCloud(), ccRegistrationTools::ICP(), ccEntityAction::importToSF(), ccEntityAction::interpolateSFs(), ccEntityAction::invertNormals(), ccMesh::MergeCloseVertices(), ccMesh::NormalizeNormals(), ccColorLevelsDlg::onApply(), ccMesh::operator=(), ccMesh::PaintUniformColor(), BasePclModule::performAction(), CommandM3C2::process(), PCVCommand::Process(), CommandRANSAC::process(), CommandExtractVertices::process(), CommandColorBanding::process(), CommandSFArithmetic::process(), CommandSFOperation::process(), CommandSFRename::process(), CommandICP::process(), ccEntityAction::RansacSegmentation(), cloudViewer::io::ReadTriangleMeshFromOBJ(), cloudViewer::io::ReadTriangleMeshFromPLY(), ccMesh::RemoveDuplicatedVertices(), ccMesh::RemoveUnreferencedVertices(), ccMesh::RemoveVerticesByMask(), ccMesh::reserveAssociatedCloud(), ccMesh::resizeAssociatedCloud(), ccEntityAction::rgbGaussianFilter(), ccMesh::Rotate(), SimpleBinFilter::saveToFile(), PcdFilter::saveToFile(), LASFWFFilter::saveToFile(), ccMesh::Scale(), ccPropertiesTreeDelegate::setEditorData(), ccMesh::setEigenVertices(), cloudViewer::pipelines::color_map::SetGeometryColorAverage(), cloudViewer::io::rpc::SetTriangleMesh(), ccMesh::setVertexColor(), ccMesh::setVertexColors(), ccMesh::setVertexNormal(), ccMesh::setVertexNormals(), ccMesh::setVertice(), ccEntityAction::sfAddIdField(), ccEntityAction::sfArithmetic(), ccEntityAction::sfConvertToRandomRGB(), ccEntityAction::sfConvertToRGB(), ccEntityAction::sfFromColor(), ccEntityAction::sfGaussianFilter(), ccEntityAction::sfRename(), ccMesh::shrinkVertexToFit(), ccMesh::SimplifyQuadricDecimation(), ccMesh::SimplifyVertexClustering(), ecvPoissonReconDlg::start(), ecvAnnotationsTool::start(), ccEntityAction::statisticalTest(), ccMesh::SubdivideLoop(), ccMesh::SubdivideMidpoint(), colmap::mvs::MvsTexturing::TextureMesh(), ccMesh::Transform(), ccMesh::Translate(), cloudViewer::visualization::VisualizerWithVertexSelection::UpdateGeometry(), and ccEntityAction::VoxelSampling().

◆ ToPolyline()

◆ ToPrimitive()

◆ ToQuadric()

ccQuadric * ccHObjectCaster::ToQuadric ( ccHObject *  obj)
static

Converts current object to ccQuadric (if possible)

References ccObject::isKindOf(), and CV_TYPES::QUADRIC.

◆ ToRGBDImage()

geometry::RGBDImage * ccHObjectCaster::ToRGBDImage ( ccHObject *  obj)
static

◆ ToSensor()

◆ ToShifted()

ccShiftedObject * ccHObjectCaster::ToShifted ( ccHObject *  obj,
bool *  isLockedVertices = nullptr 
)
static

◆ ToSphere()

ccSphere * ccHObjectCaster::ToSphere ( ccHObject *  obj)
static

Converts current object to ccSphere (if possible)

References ccObject::isA(), and CV_TYPES::SPHERE.

Referenced by ccPropertiesTreeDelegate::setEditorData().

◆ ToSubMesh()

ccSubMesh * ccHObjectCaster::ToSubMesh ( ccHObject *  obj)
static

Converts current object to ccSubMesh (if possible)

References ccObject::isA(), and CV_TYPES::SUB_MESH.

Referenced by ecvFilterByLabelDlg::apply().

◆ ToTorus()

ccTorus * ccHObjectCaster::ToTorus ( ccHObject *  obj)
static

Converts current object to ccTorus (if possible)

References ccObject::isA(), and CV_TYPES::TORUS.

◆ ToTransBuffer()

ccIndexedTransformationBuffer * ccHObjectCaster::ToTransBuffer ( ccHObject *  obj)
static

Converts current object to ccIndexedTransformationBuffer (if possible)

References ccObject::isKindOf(), and CV_TYPES::TRANS_BUFFER.

Referenced by ccPropertiesTreeDelegate::setEditorData().

◆ ToVoxelGrid()

geometry::VoxelGrid * ccHObjectCaster::ToVoxelGrid ( ccHObject *  obj)
static

The documentation for this class was generated from the following files: