 |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Go to the documentation of this file.
19 #include <pcl/point_cloud.h>
20 #include <pcl/point_types.h>
23 #include <Eigen/Dense>
26 #include <vtkSmartPointer.h>
48 PCLCloud::Ptr getGenericField(std::string field_name)
const;
50 unsigned getvisibilityNum()
const;
52 PCLCloud::Ptr getXYZ()
const;
53 pcl::PointCloud<pcl::PointXYZ>::Ptr getXYZ2()
const;
55 PCLCloud::Ptr getNormals()
const;
56 PCLCloud::Ptr getPointNormals()
const;
58 PCLCloud::Ptr getColors()
const;
63 enum Fields { COORD_X, COORD_Y, COORD_Z, NORM_X, NORM_Y, NORM_Z };
64 PCLCloud::Ptr getOneOf(Fields field)
const;
66 PCLCloud::Ptr getFloatScalarField(
const std::string& field_name)
const;
68 PCLCloud::Ptr getAsSM(std::list<std::string>& requested_fields)
const;
75 PCLCloud::Ptr getAsSM(
bool ignoreScalars =
false)
const;
76 PCLCloud::Ptr getAsSM(
bool xyz,
79 const QStringList& scalarFields)
const;
82 pcl::PointCloud<pcl::PointXYZ>::Ptr getRawXYZ()
const;
85 pcl::PointCloud<pcl::PointNormal>::Ptr getAsPointNormal()
const;
87 PCLCloud::Ptr getVtkPolyDataAsSM(vtkPolyData*
const polydata)
const;
88 PCLMesh::Ptr getVtkPolyDataAsPclMesh(vtkPolyData*
const polydata)
const;
93 PCLPolygon::Ptr getPclPolygon(
ccPolyline* polyline)
const;
108 bool getVtkPolyDataFromMeshCloud(
123 bool getVtkPolyDataWithTextures(
127 std::vector<std::vector<Eigen::Vector2f>>& tex_coordinates);
129 static std::string GetSimplifiedSFName(
const std::string& ccSfName);
135 bool checkIfFieldExists(
const std::string& field_name)
const;
pcl::PointCloud< pcl::PointNormal >::Ptr getAsPointNormal() const
Converts the ccPointCloud to a 'pcl::PointNormal' cloud.
Definition: cc2sm.cpp:787
PCLCloud::Ptr getFloatScalarField(const std::string &field_name) const
Definition: cc2sm.cpp:495
pcl::PolygonMesh PCLMesh
Definition: PCLCloud.h:31
double colors[3]
Definition: TriangleMeshIO.cpp:53
bool hasColors() const override
Returns whether colors are enabled or not.
Definition: ecvPointCloud.cpp:1689
virtual bool materialsShown() const
Sets whether textures/material should be displayed or not.
Definition: ecvGenericMesh.h:198
2D texture coordinates
Definition: ecvAdvancedTypes.h:138
Type g
Definition: ecvColorTypes.h:150
Definition: MaterialConverter.h:18
QSharedPointer< ccMaterial > Shared
Shared type.
Definition: ecvMaterial.h:33
normal_z rgb
Definition: my_point_types.h:168
const ecvColor::Rgb & getPointColor(unsigned pointIndex) const override
Returns color corresponding to a given point.
Definition: ecvPointCloud.cpp:1535
PCLCloud::Ptr getXYZ() const
Definition: cc2sm.cpp:254
Type x
Definition: CVGeom.h:137
unsigned size() const override
Returns the number of points.
Definition: ReferenceCloud.h:41
virtual unsigned size() const =0
Returns the number of triangles.
unsigned i2
Definition: GenericIndexedMesh.h:19
virtual unsigned size() const =0
Returns the number of points.
virtual bool normalsShown() const
Returns whether normals are shown or not.
Definition: ecvDrawableObject.h:91
virtual bool hasTriNormals() const =0
Returns whether the mesh has per-triangle normals.
virtual int getTriangleMtlIndex(unsigned triangleIndex) const =0
Returns a given triangle material indexes.
Triangle described by the indexes of its 3 vertices.
Definition: GenericIndexedMesh.h:16
bool m_partialVisibility
Definition: cc2sm.h:140
ScalarType & getValue(std::size_t index)
Definition: ScalarField.h:92
virtual const ccMaterialSet * getMaterialSet() const =0
static ccPointCloud * ToPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccPointCloud.
Definition: ecvHObjectCaster.cpp:54
pcl::TexMaterial PCLMaterial
Definition: PCLCloud.h:32
bool checkIfFieldExists(const std::string &field_name) const
Definition: cc2sm.cpp:591
unsigned getvisibilityNum() const
Definition: cc2sm.cpp:111
static PCLCloud::Ptr SetOrAdd(PCLCloud::Ptr firstCloud, PCLCloud::Ptr secondCloud)
Definition: cc2sm.cpp:712
@ NORM_Z
Definition: cc2sm.h:63
unsigned getNumberOfScalarFields() const
Returns the number of associated (and active) scalar fields.
Definition: PointCloudTpl.h:345
const CCVector3 & getPointNormal(unsigned pointIndex) const override
Returns normal corresponding to a given point.
Definition: ecvPointCloud.cpp:1555
PCLCloud::Ptr getOneOf(Fields field) const
Definition: cc2sm.cpp:115
virtual ccGenericPointCloud * getAssociatedCloud() const =0
Returns the vertices cloud.
const CCVector3 * getPoint(unsigned index) const override
Definition: PointCloudTpl.h:143
@ NORM_Y
Definition: cc2sm.h:63
QVariant getMetaData(const QString &key) const
Returns a given associated meta data.
Definition: ecvObject.cpp:208
const CCVector3 * getPoint(unsigned index) const override
Returns the ith point.
Definition: ReferenceCloud.h:79
const CCVector3 * getNormal(unsigned pointIndex) const override
If per-point normals are available, returns the one at a specific index.
Definition: ecvPointCloud.cpp:1561
static const CCVector3 & GetNormal(unsigned normIndex)
Static access to ccNormalVectors::getNormal.
Definition: ecvNormalVectors.h:37
unsigned size() const override
Definition: PointCloudTpl.h:38
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
@ NORM_X
Definition: cc2sm.h:63
@ COORD_Z
Definition: cc2sm.h:63
virtual void getTriangleTexCoordinates(unsigned triIndex, TexCoords2D *&tx1, TexCoords2D *&tx2, TexCoords2D *&tx3) const =0
Returns per-triangle texture coordinates (pointer to)
QSharedPointer< const ccMaterial > CShared
Const + Shared type.
Definition: ecvMaterial.h:31
A simple scalar field (to be associated to a point cloud)
Definition: ScalarField.h:25
Definition: WidgetMap.h:20
NormsIndexesTableType * normals() const
Returns pointer on compressed normals indexes table.
Definition: ecvPointCloud.h:917
Type r
Definition: ecvColorTypes.h:54
static bool PrintDebug(const char *format,...)
Same as Print, but works only in Debug mode.
Definition: CVLog.cpp:153
unsigned m_visibilityNum
Definition: cc2sm.h:141
Compressed normal vectors handler.
Definition: ecvNormalVectors.h:20
virtual bool hasTextures() const =0
Returns whether textures are available for this mesh.
int getScalarFieldIndexByName(const char *name) const
Returns the index of a scalar field represented by its name.
Definition: PointCloudTpl.h:375
virtual bool hasMaterials() const =0
pcl::PCLPointCloud2 PCLCloud
Definition: PCLCloud.h:34
virtual bool hasNormals() const
Returns whether normals are enabled or not.
Definition: ecvDrawableObject.h:89
const ecvColor::Rgb * getValueColor(unsigned index) const
Shortcut to getColor.
Definition: ecvScalarField.h:147
ScalarField * getScalarField(int index) const
Returns a pointer to a specific scalar field.
Definition: PointCloudTpl.h:354
PCLCloud::Ptr getColors() const
Definition: cc2sm.cpp:320
double normals[3]
Definition: TriangleMeshIO.cpp:54
Array of compressed 3D normals (single index)
Definition: ecvAdvancedTypes.h:21
PCLCloud::Ptr getVtkPolyDataAsSM(vtkPolyData *const polydata) const
Definition: cc2sm.cpp:849
@ COORD_Y
Definition: cc2sm.h:63
virtual VisibilityTableType & getTheVisibilityArray()
Returns associated visibility array.
Definition: ecvGenericPointCloud.h:168
Mesh (triangle) material.
Definition: ecvMaterial.h:28
A 3D cloud interface with associated features (color, normals, octree, etc.)
Definition: ecvGenericPointCloud.h:45
PCLTextureMesh::Ptr getPclTextureMesh(ccGenericMesh *mesh)
Definition: cc2sm.cpp:1375
float tx
Definition: ecvAdvancedTypes.h:144
static ccNormalVectors * GetUniqueInstance()
Returns unique instance.
Definition: ecvNormalVectors.cpp:41
const char * getName() const
Returns scalar field name.
Definition: ScalarField.h:43
pcl::PointCloud< PointRGB > PointCloudRGB
Definition: PCLCloud.h:21
static std::string GetSimplifiedSFName(const std::string &ccSfName)
Definition: cc2sm.cpp:432
Type g
Definition: ecvColorTypes.h:54
CC to PCL cloud converter.
Definition: cc2sm.h:43
virtual bool isVisibilityTableInstantiated() const
Returns whether the visibility array is allocated or not.
Definition: ecvGenericPointCloud.cpp:76
normal_z scalar
Definition: my_point_types.h:169
unsigned int getDimension() const
Definition: GenericIndexedMesh.h:31
unsigned i3
Definition: GenericIndexedMesh.h:19
virtual bool hasDisplayedScalarField() const
Returns whether an active scalar field is available or not.
Definition: ecvDrawableObject.h:99
Type r
Definition: ecvColorTypes.h:150
unsigned i[3]
Definition: GenericIndexedMesh.h:21
Fields
Definition: cc2sm.h:63
pcl::TextureMesh PCLTextureMesh
Definition: PCLCloud.h:33
bool hasNormals() const override
Returns whether normals are enabled or not.
Definition: ecvPointCloud.cpp:1693
Generic mesh interface.
Definition: ecvGenericMesh.h:28
virtual bool colorsShown() const
Returns whether colors are shown or not.
Definition: ecvDrawableObject.h:82
const ecvColor::Rgb * getScalarValueColor(ScalarType d) const override
Returns color corresponding to a given scalar value.
Definition: ecvPointCloud.cpp:1521
pcl::PointCloud< PointRGBNormal > PointCloudRGBNormal
Definition: PCLCloud.h:29
bool getvtkScalars(vtkSmartPointer< vtkDataArray > &scalars, bool sfColors) const
Obtain the actual color for the input dataset as vtk scalars.
Definition: cc2sm.cpp:366
ColorsTableType * rgbColors() const
Returns pointer on RGB colors table.
Definition: ecvPointCloud.h:914
constexpr unsigned char POINT_VISIBLE
Definition: CVConst.h:92
std::vector< PCLPointField > fields
Definition: FileIOFactory.cpp:141
Type z
Definition: CVGeom.h:137
Type b
Definition: ecvColorTypes.h:54
PCLCloud::Ptr getNormals() const
Definition: cc2sm.cpp:266
float ty
Definition: ecvAdvancedTypes.h:144
bool hasScalarFields() const override
Returns whether one or more scalar fields are instantiated.
Definition: ecvPointCloud.cpp:1697
pcl::PlanarPolygon< PointT > PCLPolygon
Definition: PCLCloud.h:36
virtual VerticesIndexes * getTriangleVertIndexes(unsigned triangleIndex)=0
Returns the indexes of the vertices of a given triangle.
pcl::PointCloud< pcl::PointXYZ >::Ptr getRawXYZ() const
Converts the ccPointCloud to a 'pcl::PointXYZ' cloud.
Definition: cc2sm.cpp:824
cc2smReader(bool showMode=false)
Definition: cc2sm.cpp:54
PCLCloud::Ptr getPointNormals() const
Definition: cc2sm.cpp:307
Type a
Definition: ecvColorTypes.h:150
bool getVtkPolyDataFromMeshCloud(ccGenericMesh *mesh, vtkSmartPointer< vtkPolyData > &polydata) const
Convert ccGenericMesh to vtkPolyData using same logic as getPclCloud2 Direct conversion without PCL i...
Definition: cc2sm.cpp:1121
virtual NormsIndexesTableType * getTriNormsTable() const =0
Returns per-triangle normals shared array.
PCLCloud::Ptr getGenericField(std::string field_name) const
Definition: cc2sm.cpp:82
int getCurrentDisplayedScalarFieldIndex() const
Returns the currently displayed scalar field index (or -1 if none)
Definition: ecvPointCloud.cpp:3223
const char * getScalarFieldName(int index) const
Returns the name of a specific scalar field.
Definition: PointCloudTpl.h:365
int count
Definition: FileIOFactory.cpp:132
virtual bool sfShown() const
Returns whether active scalar field is visible.
Definition: ecvDrawableObject.h:117
bool getPclCloud2(ccGenericMesh *mesh, PCLCloud &cloud) const
Definition: cc2sm.cpp:933
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
RGB color structure.
Definition: ecvColorTypes.h:49
ccScalarField * getCurrentDisplayedScalarField() const
Returns the currently displayed scalar (or 0 if none)
Definition: ecvPointCloud.cpp:3218
const CCVector3 & getNormal(unsigned normIndex) const
Returns the precomputed normal corresponding to a given compressed index.
Definition: ecvNormalVectors.h:51
static void ConVertToPCLMaterial(ccMaterial::CShared inMaterial, PCLMaterial &outMaterial)
Definition: cc2sm.cpp:438
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 ensur...
Definition: cc2sm.cpp:1566
virtual bool hasColors() const
Returns whether colors are enabled or not.
Definition: ecvDrawableObject.h:80
Mesh (triangle) material.
Definition: ecvMaterialSet.h:16
Type y
Definition: CVGeom.h:137
virtual QString getName() const
Returns object name.
Definition: ecvObject.h:72
const ccPointCloud * m_cc_cloud
Associated cloud.
Definition: cc2sm.h:138
PCLPolygon::Ptr getPclPolygon(ccPolyline *polyline) const
Definition: cc2sm.cpp:1538
virtual void getTriangleNormalIndexes(unsigned triangleIndex, int &i1, int &i2, int &i3) const =0
Returns a triplet of normal indexes for a given triangle (if any)
#define TO_PCL_CLOUD
Definition: PCLConv.h:12
PCLMesh::Ptr getPclMesh(ccGenericMesh *mesh)
Definition: cc2sm.cpp:894
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
virtual bool triNormsShown() const
Returns whether per-triangle normals are shown or not.
Definition: ecvGenericMesh.h:192
Type u[3]
Definition: CVGeom.h:139
bool is2DMode() const
Returns whether the polyline is considered as 2D or 3D.
Definition: ecvPolyline.h:63
pcl::PointCloud< PointNT > PointCloudNormal
Definition: PCLCloud.h:25
Type b
Definition: ecvColorTypes.h:150
std::string to_string(const T &n)
Definition: Common.h:20
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
PCLCloud::Ptr getAsSM(std::list< std::string > &requested_fields) const
Definition: cc2sm.cpp:607
PCLMesh::Ptr getVtkPolyDataAsPclMesh(vtkPolyData *const polydata) const
Definition: cc2sm.cpp:882
pcl::PointCloud< pcl::PointXYZ >::Ptr getXYZ2() const
Definition: cc2sm.cpp:218
unsigned i1
Definition: GenericIndexedMesh.h:19
pcl::PointCloud< PointT > PointCloudT
Definition: PCLCloud.h:17
@ COORD_X
Definition: cc2sm.h:63
RGBA color structure.
Definition: ecvColorTypes.h:145
std::string name
Definition: FileIOFactory.cpp:129
Colored polyline.
Definition: ecvPolyline.h:23
bool m_showMode
Definition: cc2sm.h:139
std::vector< unsigned char > VisibilityTableType
Array of "visibility" information for each point.
Definition: ecvGenericPointCloud.h:165