File: ccHObjectCaster.h

package info (click to toggle)
cloudcompare 2.10.1-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 55,916 kB
  • sloc: cpp: 219,837; ansic: 29,944; makefile: 67; sh: 45
file content (146 lines) | stat: -rw-r--r-- 5,639 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
//##########################################################################
//#                                                                        #
//#                              CLOUDCOMPARE                              #
//#                                                                        #
//#  This program is free software; you can redistribute it and/or modify  #
//#  it under the terms of the GNU General Public License as published by  #
//#  the Free Software Foundation; version 2 or later of the License.      #
//#                                                                        #
//#  This program is distributed in the hope that it will be useful,       #
//#  but WITHOUT ANY WARRANTY; without even the implied warranty of        #
//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          #
//#  GNU General Public License for more details.                          #
//#                                                                        #
//#          COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI)             #
//#                                                                        #
//##########################################################################

#ifndef CC_HIERARCHY_OBJECT_CASTER_HEADER
#define CC_HIERARCHY_OBJECT_CASTER_HEADER

//Local
#include "qCC_db.h"

class cc2DLabel;
class cc2DViewportLabel;
class cc2DViewportObject;
class ccCameraSensor;
class ccCone;
class ccCylinder;
class ccDish;
class ccExtru;
class ccFacet;
class ccGBLSensor;
class ccGenericMesh;
class ccGenericPointCloud;
class ccGenericPrimitive;
class ccHObject;
class ccImage;
class ccIndexedTransformationBuffer;
class ccKdTree;
class ccMesh;
class ccOctree;
class ccOctreeProxy;
class ccPlanarEntityInterface;
class ccPlane;
class ccPointCloud;
class ccPolyline;
class ccSensor;
class ccShiftedObject;
class ccSphere;
class ccSubMesh;
class ccTorus;

//! Useful class to (try to) statically cast a basic ccHObject to a given type
class QCC_DB_LIB_API ccHObjectCaster
{
public:

	//! Converts current object to 'equivalent' ccPointCloud
	/** Warning: if a mesh is passed, this method returns its vertices.
		\param obj ccHObject to dynamically cast to a ccPointCloud object
		\param isLockedVertices the caller can be warned if the returned cloud corresponds to locked vertices
	**/
	static ccPointCloud* ToPointCloud(ccHObject* obj, bool* isLockedVertices = nullptr);

	//! Converts current object to 'equivalent' ccGenericPointCloud
	/** Warning: if a mesh is passed, this method returns its vertices.
	**/
	static ccGenericPointCloud* ToGenericPointCloud(ccHObject* obj, bool* isLockedVertices = nullptr);

	//! Converts current object to 'equivalent' ccShiftedObject
	/** Warning: if a mesh is passed, this method returns its vertices.
	**/
	static ccShiftedObject* ToShifted(ccHObject* obj, bool* isLockedVertices = nullptr);

	//! Converts current object to ccGenericMesh (if possible)
	static ccGenericMesh* ToGenericMesh(ccHObject* obj);

	//! Converts current object to ccMesh (if possible)
	static ccMesh* ToMesh(ccHObject* obj);

	//! Converts current object to ccSubMesh (if possible)
	static ccSubMesh* ToSubMesh(ccHObject* obj);

	//! Converts current object to ccPolyline (if possible)
	static ccPolyline* ToPolyline(ccHObject* obj);

	//! Converts current object to ccFacet (if possible)
	static ccFacet* ToFacet(ccHObject* obj);

	//! Converts current object to ccPlanarEntityInterface (if possible)
	static ccPlanarEntityInterface* ToPlanarEntity(ccHObject* obj);

	//! Converts current object to ccGenericPrimitive (if possible)
	static ccGenericPrimitive* ToPrimitive(ccHObject* obj);

	//! Converts current object to ccSphere (if possible)
	static ccSphere* ToSphere(ccHObject* obj);
	//! Converts current object to ccCylinder (if possible)
	static ccCylinder* ToCylinder(ccHObject* obj);
	//! Converts current object to ccCone (if possible)
	static ccCone* ToCone(ccHObject* obj);
	//! Converts current object to ccPlane (if possible)
	static ccPlane* ToPlane(ccHObject* obj);
	//! Converts current object to ccDish (if possible)
	static ccDish* ToDish(ccHObject* obj);
	//! Converts current object to ccExtru (if possible)
	static ccExtru* ToExtru(ccHObject* obj);
	//! Converts current object to ccTorus (if possible)
	static ccTorus* ToTorus(ccHObject* obj);

	//! Converts current object to ccOctreeProxy (if possible)
	static ccOctreeProxy* ToOctreeProxy(ccHObject* obj);
	//! Converts current object to ccOctree (if possible)
	static ccOctree* ToOctree(ccHObject* obj);

	//! Converts current object to ccKdTree (if possible)
	static ccKdTree* ToKdTree(ccHObject* obj);

	//! Converts current object to ccSensor (if possible)
	static ccSensor* ToSensor(ccHObject* obj);

	//! Converts current object to ccGBLSensor (if possible)
	static ccGBLSensor* ToGBLSensor(ccHObject* obj);

	//! Converts current object to ccCameraSensor (if possible)
	static ccCameraSensor* ToCameraSensor(ccHObject* obj);

	//! Converts current object to ccImage (if possible)
	static ccImage* ToImage(ccHObject* obj);

	//! Converts current object to cc2DLabel (if possible)
	static cc2DLabel* To2DLabel(ccHObject* obj);

	//! Converts current object to cc2DViewportLabel (if possible)
	static cc2DViewportLabel* To2DViewportLabel(ccHObject* obj);

	//! Converts current object to cc2DViewportObject (if possible)
	static cc2DViewportObject* To2DViewportObject(ccHObject* obj);

	//! Converts current object to ccIndexedTransformationBuffer (if possible)
	static ccIndexedTransformationBuffer* ToTransBuffer(ccHObject* obj);

};

#endif //CC_HIERARCHY_OBJECT_CASTER_HEADER