![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
CC to PCL cloud converter. More...
#include <cc2sm.h>

Public Types | |
| enum | Fields { COORD_X , COORD_Y , COORD_Z , NORM_X , NORM_Y , NORM_Z } |
Public Member Functions | |
| cc2smReader (bool showMode=false) | |
| cc2smReader (const ccPointCloud *cc_cloud, bool showMode=false) | |
| PCLCloud::Ptr | getGenericField (std::string field_name) const |
| unsigned | getvisibilityNum () const |
| PCLCloud::Ptr | getXYZ () const |
| pcl::PointCloud< pcl::PointXYZ >::Ptr | getXYZ2 () const |
| PCLCloud::Ptr | getNormals () const |
| PCLCloud::Ptr | getPointNormals () const |
| PCLCloud::Ptr | getColors () const |
| bool | getvtkScalars (vtkSmartPointer< vtkDataArray > &scalars, bool sfColors) const |
| Obtain the actual color for the input dataset as vtk scalars. More... | |
| PCLCloud::Ptr | getOneOf (Fields field) const |
| PCLCloud::Ptr | getFloatScalarField (const std::string &field_name) const |
| PCLCloud::Ptr | getAsSM (std::list< std::string > &requested_fields) const |
| PCLCloud::Ptr | getAsSM (bool ignoreScalars=false) const |
| Converts all the data in a ccPointCloud to a sesor_msgs::PointCloud2. More... | |
| PCLCloud::Ptr | getAsSM (bool xyz, bool normals, bool rgbColors, const QStringList &scalarFields) const |
| pcl::PointCloud< pcl::PointXYZ >::Ptr | getRawXYZ () const |
| Converts the ccPointCloud to a 'pcl::PointXYZ' cloud. More... | |
| pcl::PointCloud< pcl::PointNormal >::Ptr | getAsPointNormal () const |
| Converts the ccPointCloud to a 'pcl::PointNormal' cloud. More... | |
| PCLCloud::Ptr | getVtkPolyDataAsSM (vtkPolyData *const polydata) const |
| PCLMesh::Ptr | getVtkPolyDataAsPclMesh (vtkPolyData *const polydata) const |
| PCLMesh::Ptr | getPclMesh (ccGenericMesh *mesh) |
| PCLTextureMesh::Ptr | getPclTextureMesh (ccGenericMesh *mesh) |
| PCLPolygon::Ptr | getPclPolygon (ccPolyline *polyline) const |
| bool | getPclCloud2 (ccGenericMesh *mesh, PCLCloud &cloud) const |
| bool | getVtkPolyDataFromMeshCloud (ccGenericMesh *mesh, vtkSmartPointer< vtkPolyData > &polydata) const |
| Convert ccGenericMesh to vtkPolyData using same logic as getPclCloud2 Direct conversion without PCL intermediate format for efficiency. More... | |
| bool | getVtkPolyDataWithTextures (ccGenericMesh *mesh, vtkSmartPointer< vtkPolyData > &polydata, vtkSmartPointer< vtkMatrix4x4 > &transformation, std::vector< std::vector< Eigen::Vector2f >> &tex_coordinates) |
| Convert ccGenericMesh to vtkPolyData with texture coordinates Reuses getPclTextureMesh logic to ensure consistency. More... | |
Static Public Member Functions | |
| static std::string | GetSimplifiedSFName (const std::string &ccSfName) |
| static void | ConVertToPCLMaterial (ccMaterial::CShared inMaterial, PCLMaterial &outMaterial) |
Protected Member Functions | |
| bool | checkIfFieldExists (const std::string &field_name) const |
Protected Attributes | |
| const ccPointCloud * | m_cc_cloud |
| Associated cloud. More... | |
| bool | m_showMode |
| bool | m_partialVisibility |
| unsigned | m_visibilityNum |
| enum cc2smReader::Fields |
|
explicit |
Definition at line 60 of file cc2sm.cpp.
References count, ccGenericPointCloud::getTheVisibilityArray(), ccGenericPointCloud::isVisibilityTableInstantiated(), m_cc_cloud, m_partialVisibility, m_visibilityNum, POINT_VISIBLE, and cloudViewer::PointCloudTpl< T >::size().
|
protected |
Definition at line 591 of file cc2sm.cpp.
References cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), m_cc_cloud, and cloudViewer::PointCloudTpl< T >::size().
Referenced by getAsSM().
|
static |
Definition at line 438 of file cc2sm.cpp.
References ecvColor::RgbaTpl< Type >::a, ecvColor::RgbaTpl< Type >::b, CVTools::ExtractDigitAlpha(), CVTools::FromQString(), ecvColor::RgbaTpl< Type >::g, CVLog::PrintDebug(), ecvColor::RgbaTpl< Type >::r, and patch::to_string().
Referenced by getPclTextureMesh().
| pcl::PointCloud< pcl::PointNormal >::Ptr cc2smReader::getAsPointNormal | ( | ) | const |
Converts the ccPointCloud to a 'pcl::PointNormal' cloud.
Definition at line 787 of file cc2sm.cpp.
References ccPointCloud::getNormal(), cloudViewer::PointCloudTpl< T >::getPoint(), ccPointCloud::hasNormals(), m_cc_cloud, cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by ComputeFeatures().
| PCLCloud::Ptr cc2smReader::getAsSM | ( | bool | ignoreScalars = false | ) | const |
Converts all the data in a ccPointCloud to a sesor_msgs::PointCloud2.
This is useful for saving a ccPointCloud into a PCD file. For pcl filters other methods are suggested (to get only the necessary bits of data)
Definition at line 684 of file cc2sm.cpp.
References fields, getAsSM(), cloudViewer::ScalarField::getName(), cloudViewer::PointCloudTpl< T >::getNumberOfScalarFields(), cloudViewer::PointCloudTpl< T >::getScalarField(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), m_cc_cloud, and cloudViewer::PointCloudTpl< T >::size().
| PCLCloud::Ptr cc2smReader::getAsSM | ( | bool | xyz, |
| bool | normals, | ||
| bool | rgbColors, | ||
| const QStringList & | scalarFields | ||
| ) | const |
Definition at line 733 of file cc2sm.cpp.
References getColors(), getFloatScalarField(), getNormals(), getXYZ(), ccPointCloud::hasColors(), ccPointCloud::hasNormals(), m_cc_cloud, normals, SetOrAdd(), and cloudViewer::PointCloudTpl< T >::size().
| PCLCloud::Ptr cc2smReader::getAsSM | ( | std::list< std::string > & | requested_fields | ) | const |
Definition at line 607 of file cc2sm.cpp.
References checkIfFieldExists(), and getGenericField().
Referenced by ExtractSIFT::compute(), GeneralFilters::compute(), MLSSmoothingUpsampling::compute(), StatisticalOutliersRemover::compute(), MinimumCutSegmentation::compute(), RegionGrowingSegmentation::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), PoissonReconstruction::compute(), getAsSM(), PcdFilter::saveToFile(), and PclAnnotationTool::setInputCloud().
| PCLCloud::Ptr cc2smReader::getColors | ( | ) | const |
Definition at line 320 of file cc2sm.cpp.
References ccPointCloud::getPointColor(), ccGenericPointCloud::getTheVisibilityArray(), ccPointCloud::hasColors(), m_cc_cloud, m_partialVisibility, m_visibilityNum, POINT_VISIBLE, ecvColor::RgbTpl< Type >::r, rgb, cloudViewer::PointCloudTpl< T >::size(), and TO_PCL_CLOUD.
Referenced by getAsSM(), and getGenericField().
| PCLCloud::Ptr cc2smReader::getFloatScalarField | ( | const std::string & | field_name | ) | const |
Definition at line 495 of file cc2sm.cpp.
References ecvColor::RgbTpl< Type >::b, ecvColor::RgbTpl< Type >::g, ccPointCloud::getCurrentDisplayedScalarFieldIndex(), cloudViewer::PointCloudTpl< T >::getScalarField(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), ccPointCloud::getScalarValueColor(), GetSimplifiedSFName(), ccGenericPointCloud::getTheVisibilityArray(), cloudViewer::ScalarField::getValue(), m_cc_cloud, m_partialVisibility, m_showMode, m_visibilityNum, POINT_VISIBLE, ecvColor::RgbTpl< Type >::r, scalar, ccDrawableObject::sfShown(), cloudViewer::PointCloudTpl< T >::size(), and TO_PCL_CLOUD.
Referenced by getAsSM(), and getGenericField().
| PCLCloud::Ptr cc2smReader::getGenericField | ( | std::string | field_name | ) | const |
Definition at line 82 of file cc2sm.cpp.
References COORD_X, COORD_Y, getColors(), getFloatScalarField(), getNormals(), getOneOf(), getXYZ(), NORM_X, NORM_Y, and NORM_Z.
Referenced by getAsSM().
| PCLCloud::Ptr cc2smReader::getNormals | ( | ) | const |
Definition at line 266 of file cc2sm.cpp.
References ccPointCloud::getPointNormal(), ccGenericPointCloud::getTheVisibilityArray(), ccPointCloud::hasNormals(), m_cc_cloud, m_partialVisibility, m_visibilityNum, POINT_VISIBLE, cloudViewer::PointCloudTpl< T >::size(), TO_PCL_CLOUD, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by ProjectionFilter::compute(), getAsSM(), getGenericField(), and getPointNormals().
| PCLCloud::Ptr cc2smReader::getOneOf | ( | Fields | field | ) | const |
Definition at line 115 of file cc2sm.cpp.
References COORD_X, COORD_Y, COORD_Z, cloudViewer::PointCloudTpl< T >::getPoint(), ccPointCloud::getPointNormal(), ccGenericPointCloud::getTheVisibilityArray(), ccPointCloud::hasNormals(), m_cc_cloud, m_partialVisibility, m_visibilityNum, name, NORM_X, NORM_Y, NORM_Z, POINT_VISIBLE, cloudViewer::PointCloudTpl< T >::size(), TO_PCL_CLOUD, and Tuple3Tpl< Type >::u.
Referenced by getGenericField().
| bool cc2smReader::getPclCloud2 | ( | ccGenericMesh * | mesh, |
| PCLCloud & | cloud | ||
| ) | const |
Definition at line 933 of file cc2sm.cpp.
References ccDrawableObject::colorsShown(), ccGenericMesh::getAssociatedCloud(), ccPointCloud::getCurrentDisplayedScalarField(), cloudViewer::VerticesIndexes::getDimension(), ccGenericMesh::getMaterialSet(), ccNormalVectors::GetNormal(), ccNormalVectors::getNormal(), cloudViewer::PointCloudTpl< T >::getPoint(), ccGenericPointCloud::getTheVisibilityArray(), ccGenericMesh::getTriangleNormalIndexes(), cloudViewer::GenericIndexedMesh::getTriangleVertIndexes(), ccGenericMesh::getTriNormsTable(), ccNormalVectors::GetUniqueInstance(), ccScalarField::getValueColor(), ccDrawableObject::hasColors(), ccDrawableObject::hasDisplayedScalarField(), ccDrawableObject::hasNormals(), ccGenericMesh::hasTriNormals(), cloudViewer::VerticesIndexes::i, cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_cc_cloud, ccPointCloud::normals(), ccDrawableObject::normalsShown(), POINT_VISIBLE, ecvColor::RgbTpl< Type >::r, rgb, ccPointCloud::rgbColors(), ccDrawableObject::sfShown(), cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), TO_PCL_CLOUD, ccGenericMesh::triNormsShown(), Tuple3Tpl< Type >::u, CVLog::Warning(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by getPclMesh(), and getPclTextureMesh().
| PCLMesh::Ptr cc2smReader::getPclMesh | ( | ccGenericMesh * | mesh | ) |
Definition at line 894 of file cc2sm.cpp.
References ccGenericMesh::getAssociatedCloud(), getPclCloud2(), ccGenericPointCloud::getTheVisibilityArray(), cloudViewer::GenericIndexedMesh::getTriangleVertIndexes(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, POINT_VISIBLE, cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), and CVLog::Warning().
| PCLPolygon::Ptr cc2smReader::getPclPolygon | ( | ccPolyline * | polyline | ) | const |
Definition at line 1538 of file cc2sm.cpp.
References Vector3Tpl< double >::fromArray(), cloudViewer::ReferenceCloud::getPoint(), ccPolyline::is2DMode(), cloudViewer::ReferenceCloud::size(), ecvDisplayTools::TheInstance(), ecvGenericDisplayTools::toWorldPoint(), Tuple3Tpl< Type >::u, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
| PCLTextureMesh::Ptr cc2smReader::getPclTextureMesh | ( | ccGenericMesh * | mesh | ) |
Definition at line 1375 of file cc2sm.cpp.
References ConVertToPCLMaterial(), ccGenericMesh::getAssociatedCloud(), ccGenericMesh::getMaterialSet(), getPclCloud2(), ccGenericPointCloud::getTheVisibilityArray(), ccGenericMesh::getTriangleMtlIndex(), ccGenericMesh::getTriangleTexCoordinates(), cloudViewer::GenericIndexedMesh::getTriangleVertIndexes(), ccGenericMesh::hasMaterials(), ccGenericMesh::hasTextures(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccGenericMesh::materialsShown(), POINT_VISIBLE, cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), TexCoords2D::tx, TexCoords2D::ty, and CVLog::Warning().
| PCLCloud::Ptr cc2smReader::getPointNormals | ( | ) | const |
Definition at line 307 of file cc2sm.cpp.
References getNormals(), getXYZ(), and normals.
| pcl::PointCloud< pcl::PointXYZ >::Ptr cc2smReader::getRawXYZ | ( | ) | const |
Converts the ccPointCloud to a 'pcl::PointXYZ' cloud.
Definition at line 824 of file cc2sm.cpp.
References cloudViewer::PointCloudTpl< T >::getPoint(), m_cc_cloud, cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
static |
Definition at line 432 of file cc2sm.cpp.
Referenced by MLSSmoothingUpsampling::compute(), and getFloatScalarField().
| unsigned cc2smReader::getvisibilityNum | ( | ) | const |
Definition at line 111 of file cc2sm.cpp.
References m_cc_cloud, m_partialVisibility, m_visibilityNum, and cloudViewer::PointCloudTpl< T >::size().
Referenced by PCLDisplayTools::checkEntityNeedUpdate().
| PCLMesh::Ptr cc2smReader::getVtkPolyDataAsPclMesh | ( | vtkPolyData *const | polydata | ) | const |
| PCLCloud::Ptr cc2smReader::getVtkPolyDataAsSM | ( | vtkPolyData *const | polydata | ) | const |
Definition at line 849 of file cc2sm.cpp.
References colors, normals, and TO_PCL_CLOUD.
| bool cc2smReader::getVtkPolyDataFromMeshCloud | ( | ccGenericMesh * | mesh, |
| vtkSmartPointer< vtkPolyData > & | polydata | ||
| ) | const |
Convert ccGenericMesh to vtkPolyData using same logic as getPclCloud2 Direct conversion without PCL intermediate format for efficiency.
| mesh | Input mesh |
| polydata | Output VTK polydata (will be created) |
Definition at line 1121 of file cc2sm.cpp.
References colors, ccDrawableObject::colorsShown(), ccGenericMesh::getAssociatedCloud(), ccPointCloud::getCurrentDisplayedScalarField(), ccPointCloud::getCurrentDisplayedScalarFieldIndex(), cloudViewer::VerticesIndexes::getDimension(), ccObject::getName(), ccNormalVectors::GetNormal(), ccNormalVectors::getNormal(), cloudViewer::PointCloudTpl< T >::getPoint(), cloudViewer::PointCloudTpl< T >::getScalarFieldName(), ccGenericPointCloud::getTheVisibilityArray(), ccGenericMesh::getTriangleNormalIndexes(), cloudViewer::GenericIndexedMesh::getTriangleVertIndexes(), ccGenericMesh::getTriNormsTable(), ccNormalVectors::GetUniqueInstance(), ccScalarField::getValueColor(), ccDrawableObject::hasColors(), ccDrawableObject::hasDisplayedScalarField(), ccDrawableObject::hasNormals(), ccGenericMesh::hasTriNormals(), cloudViewer::VerticesIndexes::i, cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, m_cc_cloud, ccPointCloud::normals(), normals, ccDrawableObject::normalsShown(), POINT_VISIBLE, CVLog::PrintDebug(), rgb, ccPointCloud::rgbColors(), ccDrawableObject::sfShown(), cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), ccHObjectCaster::ToPointCloud(), ccGenericMesh::triNormsShown(), Tuple3Tpl< Type >::u, CVLog::Warning(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by getVtkPolyDataWithTextures().
| bool cc2smReader::getVtkPolyDataWithTextures | ( | ccGenericMesh * | mesh, |
| vtkSmartPointer< vtkPolyData > & | polydata, | ||
| vtkSmartPointer< vtkMatrix4x4 > & | transformation, | ||
| std::vector< std::vector< Eigen::Vector2f >> & | tex_coordinates | ||
| ) |
Convert ccGenericMesh to vtkPolyData with texture coordinates Reuses getPclTextureMesh logic to ensure consistency.
| mesh | Input mesh |
| polydata | Output VTK polydata (will be created) |
| transformation | Output transformation matrix (will be created) |
| tex_coordinates | Output texture coordinates grouped by material index |
Definition at line 1566 of file cc2sm.cpp.
References ccGenericMesh::getAssociatedCloud(), cloudViewer::VerticesIndexes::getDimension(), ccGenericMesh::getMaterialSet(), ccObject::getMetaData(), ccObject::getName(), ccGenericPointCloud::getTheVisibilityArray(), ccGenericMesh::getTriangleMtlIndex(), ccGenericMesh::getTriangleTexCoordinates(), cloudViewer::GenericIndexedMesh::getTriangleVertIndexes(), getVtkPolyDataFromMeshCloud(), ccGenericMesh::hasMaterials(), ccGenericMesh::hasTextures(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccGenericMesh::materialsShown(), POINT_VISIBLE, cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), TexCoords2D::tx, TexCoords2D::ty, and CVLog::Warning().
Referenced by PclUtils::PCLVis::addTextureMeshFromCCMesh(), and PclUtils::renders::MeshTextureApplier::ApplyTexturesFromCCMesh().
| bool cc2smReader::getvtkScalars | ( | vtkSmartPointer< vtkDataArray > & | scalars, |
| bool | sfColors | ||
| ) | const |
Obtain the actual color for the input dataset as vtk scalars.
| [out] | scalars | the output scalars containing the color for the dataset |
Definition at line 366 of file cc2sm.cpp.
References colors, ccPointCloud::getCurrentDisplayedScalarFieldIndex(), ccPointCloud::getPointColor(), cloudViewer::PointCloudTpl< T >::getScalarField(), ccPointCloud::getScalarValueColor(), ccGenericPointCloud::getTheVisibilityArray(), cloudViewer::ScalarField::getValue(), ccPointCloud::hasColors(), ccPointCloud::hasScalarFields(), m_cc_cloud, m_partialVisibility, m_visibilityNum, POINT_VISIBLE, rgb, and cloudViewer::PointCloudTpl< T >::size().
| PCLCloud::Ptr cc2smReader::getXYZ | ( | ) | const |
Definition at line 254 of file cc2sm.cpp.
References getXYZ2(), and TO_PCL_CLOUD.
Referenced by getAsSM(), getGenericField(), and getPointNormals().
| PointCloud< PointXYZ >::Ptr cc2smReader::getXYZ2 | ( | ) | const |
Definition at line 218 of file cc2sm.cpp.
References cloudViewer::PointCloudTpl< T >::getPoint(), ccGenericPointCloud::getTheVisibilityArray(), m_cc_cloud, m_partialVisibility, m_visibilityNum, POINT_VISIBLE, cloudViewer::PointCloudTpl< T >::size(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by NormalEstimation::compute(), ProjectionFilter::compute(), CorrespondenceMatching::compute(), TemplateAlignment::compute(), DONSegmentation::compute(), EuclideanClusterSegmentation::compute(), SACSegmentation::compute(), ConvexConcaveHullReconstruction::compute(), GreedyTriangulation::compute(), MarchingCubeReconstruction::compute(), NurbsCurveFitting::compute(), NurbsSurfaceReconstruction::compute(), PoissonReconstruction::compute(), and getXYZ().
|
protected |
Associated cloud.
Definition at line 138 of file cc2sm.h.
Referenced by cc2smReader(), checkIfFieldExists(), getAsPointNormal(), getAsSM(), getColors(), getFloatScalarField(), getNormals(), getOneOf(), getPclCloud2(), getRawXYZ(), getvisibilityNum(), getVtkPolyDataFromMeshCloud(), getvtkScalars(), and getXYZ2().
|
protected |
Definition at line 140 of file cc2sm.h.
Referenced by cc2smReader(), getColors(), getFloatScalarField(), getNormals(), getOneOf(), getvisibilityNum(), getvtkScalars(), and getXYZ2().
|
protected |
Definition at line 139 of file cc2sm.h.
Referenced by getFloatScalarField().
|
protected |
Definition at line 141 of file cc2sm.h.
Referenced by cc2smReader(), getColors(), getFloatScalarField(), getNormals(), getOneOf(), getvisibilityNum(), getvtkScalars(), and getXYZ2().