ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtk2cc.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // Local
11 #include "qPCL.h"
12 
13 // CV_DB_LIB
14 #include <ecvColorTypes.h>
15 
16 class ccHObject;
17 class ccMesh;
18 class ccPointCloud;
19 class ccPolyline;
20 class vtkPolyData;
21 
24 public:
25  static ccPointCloud* ConvertToPointCloud(vtkPolyData* polydata,
26  bool silent = false);
27  static ccMesh* ConvertToMesh(vtkPolyData* polydata, bool silent = false);
28  static ccPolyline* ConvertToPolyline(vtkPolyData* polydata,
29  bool silent = false);
30 
31  static ccPolyline* ConvertToPolyline(ccPointCloud* vertices);
32  static std::vector<ccHObject*> ConvertToMultiPolylines(
33  vtkPolyData* polydata,
34  QString baseName = "Slice",
36 };
ccPointCloud::addScalarField
int addScalarField(const char *uniqueName) override
Creates a new scalar field and registers it.
Definition: ecvPointCloud.cpp:4210
colors
double colors[3]
Definition: TriangleMeshIO.cpp:53
cloudViewer::ReferenceCloud::reserve
virtual bool reserve(unsigned n)
Reserves some memory for hosting the point references.
Definition: ReferenceCloud.cpp:51
ccObject::isKindOf
bool isKindOf(CV_CLASS_ENUM type) const
Definition: ecvObject.h:128
ccDrawableObject::showNormals
virtual void showNormals(bool state)
Sets normals visibility.
Definition: ecvDrawableObject.h:93
ccScalarField::computeMinAndMax
void computeMinAndMax() override
Determines the min and max values.
Definition: ecvScalarField.cpp:145
cloudViewer::ReferenceCloud::size
unsigned size() const override
Returns the number of points.
Definition: ReferenceCloud.h:41
ecvColorTypes.h
vtk2cc::ConvertToMultiPolylines
static std::vector< ccHObject * > ConvertToMultiPolylines(vtkPolyData *polydata, QString baseName="Slice", const ecvColor::Rgb &color=ecvColor::green)
Definition: vtk2cc.cpp:460
normal
double normal[3]
Definition: FileIOFactory.cpp:53
vtk2cc
CC to PCL cloud converter.
Definition: vtk2cc.h:23
ccHObjectCaster::ToPointCloud
static ccPointCloud * ToPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccPointCloud.
Definition: ecvHObjectCaster.cpp:54
ccObject::setName
virtual void setName(const QString &name)
Sets object name.
Definition: ecvObject.h:75
CV_TYPES::POINT_CLOUD
@ POINT_CLOUD
Definition: CVTypes.h:104
cloudViewer::PointCloudTpl::getPoint
const CCVector3 * getPoint(unsigned index) const override
Definition: PointCloudTpl.h:143
ccObject::setLocked
virtual void setLocked(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:117
CVLog.h
cloudViewer::PointCloudTpl::size
unsigned size() const override
Definition: PointCloudTpl.h:38
ccPointCloud
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Definition: ecvPointCloud.h:146
PCLCloud.h
vtkSmartPointer
Definition: WidgetMap.h:20
color
math::float4 color
Definition: LineSetBuffers.cpp:46
ccMesh::reserve
bool reserve(std::size_t n)
Reserves the memory to store the vertex indexes (3 per triangle)
Definition: ecvMesh.cpp:2475
PCLConv.h
ccHObject::Container
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
Definition: ecvHObject.h:337
ccMesh::shrinkToFit
void shrinkToFit()
Removes unused capacity.
Definition: ecvMesh.h:302
cc2sm.h
ccPointCloud::setCurrentDisplayedScalarField
void setCurrentDisplayedScalarField(int index)
Sets the currently displayed scalar field.
Definition: ecvPointCloud.cpp:3227
normals
double normals[3]
Definition: TriangleMeshIO.cpp:54
CVLog::Error
static bool Error(const char *format,...)
Display an error dialog with formatted message.
Definition: CVLog.cpp:143
NormsIndexesTableType
Array of compressed 3D normals (single index)
Definition: ecvAdvancedTypes.h:21
qPCL.h
ccDrawableObject::showColors
virtual void showColors(bool state)
Sets colors visibility.
Definition: ecvDrawableObject.h:84
cloudViewer::ReferenceCloud::addPointIndex
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
Definition: ReferenceCloud.cpp:84
my_point_types.h
cloudViewer::PointCloudTpl::setPoint
void setPoint(size_t index, const CCVector3 &P)
Definition: PointCloudTpl.h:259
ccMesh::addTriangle
void addTriangle(unsigned i1, unsigned i2, unsigned i3)
Adds a triangle to the mesh.
Definition: ecvMesh.cpp:2428
ccGenericPointCloud::setPointSize
void setPointSize(unsigned size=0)
Sets point size.
Definition: ecvGenericPointCloud.h:275
cloudViewer::ScalarField::resizeSafe
bool resizeSafe(std::size_t count, bool initNewElements=false, ScalarType valueForNewElements=0)
Resizes memory (no exception thrown)
Definition: ScalarField.cpp:81
cloudViewer::ScalarField::reserveSafe
bool reserveSafe(std::size_t count)
Reserves memory (no exception thrown)
Definition: ScalarField.cpp:71
Vector3Tpl< PointCoordinateType >
ccPointCloud::reserveTheNormsTable
bool reserveTheNormsTable()
Reserves memory to store the compressed normals.
Definition: ecvPointCloud.cpp:1253
ccPointCloud::addNorm
void addNorm(const CCVector3 &N)
Pushes a normal vector on stack (shortcut)
Definition: ecvPointCloud.cpp:1754
ecvColor::green
constexpr Rgb green(0, MAX, 0)
ccPointCloud::reserve
bool reserve(unsigned numberOfPoints) override
Reserves memory for all the active features.
Definition: ecvPointCloud.cpp:1452
CCShareable::release
virtual void release()
Decrease counter and deletes object when 0.
Definition: CVShareable.cpp:35
CVGeom.h
ecvMesh.h
ccPointCloud::hasNormals
bool hasNormals() const override
Returns whether normals are enabled or not.
Definition: ecvPointCloud.cpp:1693
ecvScalarField.h
ccDrawableObject::showSF
virtual void showSF(bool state)
Sets active scalarfield visibility.
Definition: ecvDrawableObject.h:108
ccDrawableObject::setVisible
virtual void setVisible(bool state)
Sets entity visibility.
Definition: ecvDrawableObject.h:40
ccPointCloud::addRGBColor
void addRGBColor(const ecvColor::Rgb &C)
Pushes an RGB color on stack.
Definition: ecvPointCloud.cpp:1712
cloudViewer::Polyline::setClosed
void setClosed(bool state)
Sets whether the polyline is closed or not.
Definition: Polyline.h:29
ccPointCloud::resize
bool resize(unsigned numberOfPoints) override
Resizes all the active features arrays.
Definition: ecvPointCloud.cpp:1476
ccPointCloud::hasScalarFields
bool hasScalarFields() const override
Returns whether one or more scalar fields are instantiated.
Definition: ecvPointCloud.cpp:1697
ecvHObjectCaster.h
CVLog::Warning
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
Definition: CVLog.cpp:133
ccMesh::getTriNormsTable
NormsIndexesTableType * getTriNormsTable() const override
Returns per-triangle normals shared array.
Definition: ecvMesh.h:344
QPCL_ENGINE_LIB_API
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15
ecvColor::RgbTpl
RGB color structure.
Definition: ecvColorTypes.h:49
ccMesh
Triangular mesh.
Definition: ecvMesh.h:35
vtk2cc::ConvertToPolyline
static ccPolyline * ConvertToPolyline(vtkPolyData *polydata, bool silent=false)
Definition: vtk2cc.cpp:392
vtk2cc::ConvertToPointCloud
static ccPointCloud * ConvertToPointCloud(vtkPolyData *polydata, bool silent=false)
Definition: vtk2cc.cpp:53
vtk2cc.h
ccHObject
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
ecvPolyline.h
cloudViewer::ScalarField::setValue
void setValue(std::size_t index, ScalarType value)
Definition: ScalarField.h:96
ccDrawableObject::setTempColor
virtual void setTempColor(const ecvColor::Rgb &col, bool autoActivate=true)
Sets current temporary (unique)
Definition: ecvDrawableObject.cpp:74
ccPolyline::set2DMode
void set2DMode(bool state)
Defines if the polyline is considered as 2D or 3D.
Definition: ecvPolyline.cpp:144
ecvColor::red
constexpr Rgb red(MAX, 0, 0)
cloudViewer::PointCloudTpl::addPoint
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
Definition: PointCloudTpl.h:246
PointCoordinateType
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
Tuple3Tpl::u
Type u[3]
Definition: CVGeom.h:139
ccPointCloud::shrinkToFit
void shrinkToFit()
Removes unused capacity.
Definition: ecvPointCloud.h:357
ColorCompType
unsigned char ColorCompType
Default color components type (R,G and B)
Definition: ecvColorTypes.h:29
ccHObject::addChild
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
Definition: ecvHObject.cpp:534
ccObject::setEnabled
virtual void setEnabled(bool state)
Sets the "enabled" property.
Definition: ecvObject.h:102
ecvHObject.h
cloudViewer::LessThanEpsilon
bool LessThanEpsilon(float x)
Test a floating point number against our epsilon (a very small number).
Definition: CVMath.h:23
Vector3Tpl< PointCoordinateType >::fromArray
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
Definition: CVGeom.h:268
sm2cc.h
ecvPointCloud.h
ccScalarField
A scalar field associated to display-related parameters.
Definition: ecvScalarField.h:19
vtk2cc::ConvertToMesh
static ccMesh * ConvertToMesh(vtkPolyData *polydata, bool silent=false)
Definition: vtk2cc.cpp:290
ccPointCloud::reserveTheRGBTable
bool reserveTheRGBTable()
Reserves memory to store the RGB colors.
Definition: ecvPointCloud.cpp:1200
name
std::string name
Definition: FileIOFactory.cpp:129
ccPolyline
Colored polyline.
Definition: ecvPolyline.h:23