ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvHObjectCaster.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 "CV_db.h"
12 
13 class cc2DLabel;
14 class cc2DViewportLabel;
15 class cc2DViewportObject;
16 class ccCameraSensor;
17 class ccCone;
18 class ccCylinder;
19 class ccDish;
20 class ccExtru;
21 class ccFacet;
22 class ccGBLSensor;
23 class ccGenericMesh;
25 class ccGenericPrimitive;
26 class ccHObject;
27 class ccImage;
29 class ccKdTree;
30 class ccMesh;
31 class ccOctree;
32 class ccOctreeProxy;
34 class ccPlane;
35 class ccPointCloud;
36 class ccPolyline;
37 class ccCircle;
38 class ccDisc;
39 class ccSensor;
40 class ccShiftedObject;
41 class ccSphere;
42 class ccSubMesh;
43 class ccTorus;
44 class ccQuadric;
45 class ccBox;
46 class ccBBox;
47 class ecvOrientedBBox;
48 class ccCoordinateSystem;
49 
50 namespace cloudViewer {
51 namespace geometry {
52 class Image;
53 class RGBDImage;
54 class VoxelGrid;
55 class LineSet;
56 // class Octree;
57 } // namespace geometry
58 } // namespace cloudViewer
59 
60 #include "Octree.h"
61 
64 public:
66 
71  static ccPointCloud* ToPointCloud(ccHObject* obj,
72  bool* isLockedVertices = nullptr);
73 
75 
77  static ccGenericPointCloud* ToGenericPointCloud(
78  ccHObject* obj, bool* isLockedVertices = nullptr);
79 
81 
83  static ccShiftedObject* ToShifted(ccHObject* obj,
84  bool* isLockedVertices = nullptr);
85 
87  static ccGenericMesh* ToGenericMesh(ccHObject* obj);
88 
90  static ccMesh* ToMesh(ccHObject* obj);
91 
93  static ccSubMesh* ToSubMesh(ccHObject* obj);
94 
96  static ccPolyline* ToPolyline(ccHObject* obj);
97 
99  static ccCircle* ToCircle(ccHObject* obj);
100 
102  static ccFacet* ToFacet(ccHObject* obj);
103 
105  static ccPlanarEntityInterface* ToPlanarEntity(ccHObject* obj);
106 
108  static ccGenericPrimitive* ToPrimitive(ccHObject* obj);
109 
111  static ccSphere* ToSphere(ccHObject* obj);
113  static ccCylinder* ToCylinder(ccHObject* obj);
115  static ccCone* ToCone(ccHObject* obj);
117  static ccPlane* ToPlane(ccHObject* obj);
119  static ccQuadric* ToQuadric(ccHObject* obj);
121  static ccBox* ToBox(ccHObject* obj);
123  static ccDisc* ToDisc(ccHObject* obj);
125  static ccDish* ToDish(ccHObject* obj);
127  static ccExtru* ToExtru(ccHObject* obj);
129  static ccTorus* ToTorus(ccHObject* obj);
130 
132  static ccOctreeProxy* ToOctreeProxy(ccHObject* obj);
134  static ccOctree* ToOctree(ccHObject* obj);
135 
137  static ccKdTree* ToKdTree(ccHObject* obj);
138 
140  static ccSensor* ToSensor(ccHObject* obj);
141 
143  static ccGBLSensor* ToGBLSensor(ccHObject* obj);
144 
146  static ccCameraSensor* ToCameraSensor(ccHObject* obj);
147 
149  static ccImage* ToImage(ccHObject* obj);
150 
152  static cc2DLabel* To2DLabel(ccHObject* obj);
153 
155  static cc2DViewportLabel* To2DViewportLabel(ccHObject* obj);
156 
158  static cc2DViewportObject* To2DViewportObject(ccHObject* obj);
159 
161  static ccIndexedTransformationBuffer* ToTransBuffer(ccHObject* obj);
162 
164  static cloudViewer::geometry::Image* ToImage2(ccHObject* obj);
165 
167  static cloudViewer::geometry::RGBDImage* ToRGBDImage(ccHObject* obj);
168 
170  static cloudViewer::geometry::VoxelGrid* ToVoxelGrid(ccHObject* obj);
171 
173  static cloudViewer::geometry::LineSet* ToLineSet(ccHObject* obj);
174 
176  static cloudViewer::geometry::Octree* ToOctree2(ccHObject* obj);
177 
179  static ccBBox* ToBBox(ccHObject* obj);
180 
182  static ecvOrientedBBox* ToOrientedBBox(ccHObject* obj);
183 
185  static ccCoordinateSystem* ToCoordinateSystem(ccHObject* obj);
186 
189 
201  static bool CloneChildren(
202  const ccHObject* sourceEntity,
203  ccHObject* destEntity,
204  std::vector<int>* newPointOrTriangleIndex = nullptr,
205  const ccHObject* sourceEntityProxy = nullptr,
206  ccHObject* destEntityProxy = nullptr);
207 };
#define CV_DB_LIB_API
Definition: CV_db.h:15
2D label (typically attached to points)
Definition: ecv2DLabel.h:22
2D viewport label
2D viewport object
Bounding box structure.
Definition: ecvBBox.h:25
Box (primitive)
Definition: ecvBox.h:16
Camera (projective) sensor.
Circle (as a polyline)
Definition: ecvCircle.h:16
Cone (primitive)
Definition: ecvCone.h:16
Coordinate System (primitive)
Cylinder (primitive)
Definition: ecvCylinder.h:16
Disc (primitive)
Definition: ecvDisc.h:16
Dish.
Definition: ecvDish.h:16
Profile extrusion (primitive)
Definition: ecvExtru.h:17
Facet.
Definition: ecvFacet.h:25
Ground-based Laser sensor.
Definition: ecvGBLSensor.h:26
Generic mesh interface.
A 3D cloud interface with associated features (color, normals, octree, etc.)
Generic primitive interface.
Useful class to (try to) statically cast a basic ccHObject to a given type.
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
Generic image.
Definition: ecvImage.h:19
KD-tree structure.
Definition: ecvKdTree.h:25
Triangular mesh.
Definition: ecvMesh.h:35
Octree structure proxy.
Octree structure.
Definition: ecvOctree.h:27
Interface for a planar entity.
Plane (primitive)
Definition: ecvPlane.h:18
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Colored polyline.
Definition: ecvPolyline.h:24
Quadric (primitive)
Definition: ecvQuadric.h:16
Generic sensor interface.
Definition: ecvSensor.h:27
Shifted entity interface.
Sphere (primitive)
Definition: ecvSphere.h:16
A sub-mesh.
Definition: ecvSubMesh.h:19
Torus (primitive)
Definition: ecvTorus.h:16
The Image class stores image with customizable width, height, num of channels and bytes per channel.
Definition: Image.h:33
LineSet define a sets of lines in 3D. A typical application is to display the point cloud corresponde...
Definition: LineSet.h:29
Octree datastructure.
Definition: Octree.h:250
RGBDImage is for a pair of registered color and depth images,.
Definition: RGBDImage.h:27
VoxelGrid is a collection of voxels which are aligned in grid.
Definition: VoxelGrid.h:64
Generic file read and write utility for python interface.