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 
72  bool* isLockedVertices = nullptr);
73 
75 
78  ccHObject* obj, bool* isLockedVertices = nullptr);
79 
81 
84  bool* isLockedVertices = nullptr);
85 
88 
90  static ccMesh* ToMesh(ccHObject* obj);
91 
93  static ccSubMesh* ToSubMesh(ccHObject* obj);
94 
97 
99  static ccCircle* ToCircle(ccHObject* obj);
100 
102  static ccFacet* ToFacet(ccHObject* obj);
103 
106 
109 
111  static ccSphere* ToSphere(ccHObject* obj);
115  static ccCone* ToCone(ccHObject* obj);
117  static ccPlane* ToPlane(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 
134  static ccOctree* ToOctree(ccHObject* obj);
135 
137  static ccKdTree* ToKdTree(ccHObject* obj);
138 
140  static ccSensor* ToSensor(ccHObject* obj);
141 
144 
147 
149  static ccImage* ToImage(ccHObject* obj);
150 
153 
156 
159 
162 
165 
168 
171 
174 
177 
179  static ccBBox* ToBBox(ccHObject* obj);
180 
183 
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.
static ccMesh * ToMesh(ccHObject *obj)
Converts current object to ccMesh (if possible)
static ccOctree * ToOctree(ccHObject *obj)
Converts current object to ccOctree (if possible)
static ccDisc * ToDisc(ccHObject *obj)
Converts current object to ccDisc (if possible)
static ccPointCloud * ToPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccPointCloud.
static ccBBox * ToBBox(ccHObject *obj)
static bool CloneChildren(const ccHObject *sourceEntity, ccHObject *destEntity, std::vector< int > *newPointOrTriangleIndex=nullptr, const ccHObject *sourceEntityProxy=nullptr, ccHObject *destEntityProxy=nullptr)
static cc2DViewportLabel * To2DViewportLabel(ccHObject *obj)
Converts current object to cc2DViewportLabel (if possible)
static ccShiftedObject * ToShifted(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccShiftedObject.
static cloudViewer::geometry::Image * ToImage2(ccHObject *obj)
static ccCameraSensor * ToCameraSensor(ccHObject *obj)
static ccCylinder * ToCylinder(ccHObject *obj)
Converts current object to ccCylinder (if possible)
static cloudViewer::geometry::Octree * ToOctree2(ccHObject *obj)
static ccDish * ToDish(ccHObject *obj)
Converts current object to ccDish (if possible)
static ccOctreeProxy * ToOctreeProxy(ccHObject *obj)
Converts current object to ccOctreeProxy (if possible)
static cloudViewer::geometry::LineSet * ToLineSet(ccHObject *obj)
static ccKdTree * ToKdTree(ccHObject *obj)
Converts current object to ccKdTree (if possible)
static cloudViewer::geometry::RGBDImage * ToRGBDImage(ccHObject *obj)
static ccGenericPrimitive * ToPrimitive(ccHObject *obj)
Converts current object to ccGenericPrimitive (if possible)
static ccExtru * ToExtru(ccHObject *obj)
Converts current object to ccExtru (if possible)
static ccPolyline * ToPolyline(ccHObject *obj)
Converts current object to ccPolyline (if possible)
static cc2DLabel * To2DLabel(ccHObject *obj)
Converts current object to cc2DLabel (if possible)
static ccGenericPointCloud * ToGenericPointCloud(ccHObject *obj, bool *isLockedVertices=nullptr)
Converts current object to 'equivalent' ccGenericPointCloud.
static ccSensor * ToSensor(ccHObject *obj)
Converts current object to ccSensor (if possible)
static cc2DViewportObject * To2DViewportObject(ccHObject *obj)
Converts current object to cc2DViewportObject (if possible)
static ccCoordinateSystem * ToCoordinateSystem(ccHObject *obj)
Converts current object to ccCoordinateSystem (if possible)
static ccPlanarEntityInterface * ToPlanarEntity(ccHObject *obj)
Converts current object to ccPlanarEntityInterface (if possible)
static ccBox * ToBox(ccHObject *obj)
Converts current object to ccBox (if possible)
static ccImage * ToImage(ccHObject *obj)
static ccSubMesh * ToSubMesh(ccHObject *obj)
Converts current object to ccSubMesh (if possible)
static ccFacet * ToFacet(ccHObject *obj)
Converts current object to ccFacet (if possible)
static ecvOrientedBBox * ToOrientedBBox(ccHObject *obj)
static ccIndexedTransformationBuffer * ToTransBuffer(ccHObject *obj)
Converts current object to ccIndexedTransformationBuffer (if possible)
static ccSphere * ToSphere(ccHObject *obj)
Converts current object to ccSphere (if possible)
static ccQuadric * ToQuadric(ccHObject *obj)
Converts current object to ccQuadric (if possible)
static ccCone * ToCone(ccHObject *obj)
Converts current object to ccCone (if possible)
static cloudViewer::geometry::VoxelGrid * ToVoxelGrid(ccHObject *obj)
static ccGenericMesh * ToGenericMesh(ccHObject *obj)
Converts current object to ccGenericMesh (if possible)
static ccGBLSensor * ToGBLSensor(ccHObject *obj)
static ccPlane * ToPlane(ccHObject *obj)
Converts current object to ccPlane (if possible)
static ccTorus * ToTorus(ccHObject *obj)
Converts current object to ccTorus (if possible)
static ccCircle * ToCircle(ccHObject *obj)
Converts current object to ccCircle (if possible)
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.