13 #include <unordered_map>
14 #include <unordered_set>
52 virtual ccBBox getOwnBB(
bool withGLFeatures =
false)
override;
56 inline virtual unsigned size()
const override {
57 return static_cast<unsigned>(vertices_.size());
68 virtual bool IsEmpty()
const override;
69 virtual Eigen::Vector3d GetMinBound()
const override;
70 virtual Eigen::Vector3d GetMaxBound()
const override;
71 virtual Eigen::Vector3d GetCenter()
const override;
72 virtual ccBBox GetAxisAlignedBoundingBox()
const override;
75 const Eigen::Matrix4d &transformation)
override;
76 virtual ecvMeshBase &Translate(
const Eigen::Vector3d &translation,
77 bool relative =
true)
override;
79 const Eigen::Vector3d ¢er)
override;
80 virtual ecvMeshBase &Rotate(
const Eigen::Matrix3d &R,
81 const Eigen::Vector3d ¢er)
override;
91 return vertices_.size() > 0 &&
92 vertex_normals_.size() == vertices_.size();
97 return vertices_.size() > 0 &&
98 vertex_colors_.size() == vertices_.size();
103 for (
size_t i = 0; i < vertex_normals_.size(); i++) {
104 vertex_normals_[i].normalize();
105 if (std::isnan(vertex_normals_[i](0))) {
106 vertex_normals_[i] = Eigen::Vector3d(0.0, 0.0, 1.0);
116 ResizeAndPaintUniformColor(vertex_colors_, vertices_.size(),
color);
121 std::tuple<std::shared_ptr<ccMesh>, std::vector<size_t>> ComputeConvexHull()
127 const char *
name =
"ecvMeshBase")
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
const QCPVector2D operator+(const QCPVector2D &vec1, const QCPVector2D &vec2)
Hierarchical CLOUDVIEWER Object.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
std::function< void(GenericTriangle &)> genericTriangleAction
Generic function to apply to a triangle (used by foreach)
A generic triangle interface.
virtual void placeIteratorAtBeginning() override
Places the mesh iterator at the beginning.
ecvMeshBase & PaintUniformColor(const Eigen::Vector3d &color)
Assigns each vertex in the TriangleMesh the same color.
ecvMeshBase(const char *name="ecvMeshBase")
Default Constructor.
ecvMeshBase(const std::vector< Eigen::Vector3d > &vertices, const char *name="ecvMeshBase")
virtual bool isSerializable() const override
Returns whether object is serializable of not.
virtual unsigned size() const override
Returns the number of triangles.
bool HasVertices() const
Returns True if the mesh contains vertices.
bool HasVertexColors() const
Returns True if the mesh contains vertex colors.
virtual cloudViewer::GenericTriangle * _getNextTriangle() override
Returns the next triangle (relatively to the global iterator position)
bool HasVertexNormals() const
Returns True if the mesh contains vertex normals.
ecvMeshBase & NormalizeNormals()
Normalize vertex normals to length 1.
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
virtual void forEach(genericTriangleAction action) override
Fast iteration mechanism.
std::vector< Eigen::Vector3d > vertex_normals_
Vertex normals.
std::vector< Eigen::Vector3d > vertices_
Vertex coordinates.
std::vector< Eigen::Vector3d > vertex_colors_
RGB colors of vertices.
void Transform(benchmark::State &state, const core::Device &device)
void operator+=(MiniVec< T, N > &a, const MiniVec< T, N > &b)
Generic file read and write utility for python interface.