zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
 
#ifndef _OD_DB_POINTCLOUD_
#define _OD_DB_POINTCLOUD_
 
#include "DbPointCloudObjExports.h"
#include "DbPointCloudClipping.h"
#include "DbPointCloudIntensityStyle.h"
#include "TD_PackPush.h"
 
#include "DbEntity.h"
 
/** \details
    This class represents PointCloud entities in an OdDbDatabase instance.
 
    Library: AcDbPointCloudObj
 
    <group OdDbPointCloud_Classes>
*/
class DBPOINTCLOUDOBJ_EXPORT OdDbPointCloud : public OdDbEntity
{
public:
 
  ODDB_DECLARE_MEMBERS(OdDbPointCloud);
 
  /** \details
    Default constructor.
  */
  OdDbPointCloud();
 
  /** \details
    Destructor.
  */
  ~OdDbPointCloud() {}
 
  // Properties
 
  /** \details
    Returns the transformation matrix for this point cloud entity.
  */
  OdGeMatrix3d transformation() const;
 
 /** \details
    Sets the transformation matrix for this point cloud entity.
 
    \param transformation [in]  The transformation matrix to be applied for this point cloud entity.
 */
  OdResult setTransformation(const OdGeMatrix3d&);
 
  /** \details
    Gets the name of the indexed point cloud file (.pcg or .isd) for this point cloud entity stored in file.
 
    \param fileName [out]  The filename.
  */
  bool  getSavedFileName(OdString &) const;
 
  /** \details
    Sets the name of the indexed point cloud file (.pcg or .isd) for this point cloud entity stored in file.
 
    \param fileName [in]  The filename to be set.
 
    \remarks
    To be deprecated. Updating PointCloudDef object will update all Point Cloud Entities if PointCloudDefReactor is enabled.
  */
  bool  setSavedFileName(const OdString&);
 
  /** \details
    Gets the current file path of the indexed point cloud file (.pcg or .isd) for this point cloud entity located during run-time session (not saved in file).
 
    \param fileName [out]  The filename.
  */
  bool  getIndexFile(OdString &) const;
 
  /** \details
    Sets the current file path of the indexed point cloud file (.pcg or .isd) for this point cloud entity for current run-time session (not saved in file).
 
    \param fileName [in]  The filename to be set.
 
    \remarks
    To be deprecated. Updating PointCloudDef object will update all Point Cloud Entities if PointCloudDefReactor is enabled.
  */
  bool  setIndexFile(const OdString&);
 
  /** \details
    Gets the count of the source point cloud files (.las for example) for this point cloud entity.
  */
  OdUInt32 getSourceFileCount() const;
 
  /** \details
    Gets the name of the source point cloud file for this point cloud entity.
 
    \param fileName [out]  The filename.
    \param index [in]  index of the filenames array
 
    Returns true if name was successfully set and false if index is invalid.
  */
  bool getSourceFile(OdUInt32 index, OdString & fileName) const;
 
  /** \details
    Clears source files for this point cloud entity.
 
  */
  void clearSourceFiles();
 
  /** \details
    Adds the name of the source point cloud file for this point cloud entity.
 
    \param fileName [in]  The filename to be added.
 
  */
  bool addSourceFile(const OdString& fileName );
 
 
  OdString getCoordSys() const;
  void setCoordSys(const OdString&);
 
  /** \details
    Returns true if the point cloud entity is locked or false otherwise.
  */
  bool  locked() const;
 
  /** \details
    Sets the point cloud entity to be locked.
  */
  void  setLocked(bool);
 
  bool useEntityColor()const;
  void setUseEntityColor(bool);
 
  /** \details
    Returns the Object ID of the OdDbPointCloudDef object associated with this point cloud entity.
  */
  OdDbObjectId  pointCloudDefId() const;
 
  /** \details
    Sets the Object ID of the OdDbPointCloudDef object associated with this point cloud entity.
 
    \param pointCloudDefId [in]  Object ID of the point cloud to be associated with this point cloud entity.
  */
  void  setPointCloudDefId(const OdDbObjectId);
 
  /** \details
    Returns the Object ID of the OdDbPointCloudDefReactor object associated with this point cloud entity.
 
    \remarks
    Each OdDbPointCloud object must have an OdDbPointCloudDefReactor associated with the OdDbPointCloudDef object it is using.
 
  */
  OdDbObjectId  reactorId() const;
 
  /** \details
    Sets the Object ID of the OdDbPointCloudDefReactor object associated with this point cloud entity.
 
    \param pointCloudDefReactorId [in]  Object ID of a reactor for this point cloud entity.
 
    \remarks
    Each OdDbPointCloud object must have an OdDbPointCloudDefReactor associated with the OdDbPointCloudDef object it is using.
  */
  void  setReactorId(const OdDbObjectId);
 
 
  /** \details
    Returns the total number of points of this point cloud entity.
  */
  OdInt64 getPointCount();
 
  /** \details
    Sets the total number of points of this point cloud entity.
 
    \param count [in]  Number od points.
 
    \remarks
    To be deprecated. Updating PointCloudDef object will update all Point Cloud Entities if PointCloudDefReactor is enabled.
  */
  void setPointCount(const OdUInt64 count);
 
 
  /** \details
    Returns the extents of this OdDbPointCloud object.
  */
  OdGeExtents3d extents() const;
 
  /** \details
    Sets the extents of this point cloud entity.
 
    \param exts [in]  Extents of this Point Cloud entity.
 
    \remarks
    To be deprecated. Updating PointCloudDef object will update all Point Cloud Entities if PointCloudDefReactor is enabled.
  */
  void setExtents(const OdGeExtents3d & exts);
 
  //Intensity
 
 
  /** \details
    Returns true only if intensity is shown for this point cloud entity.
  */
  bool  showIntensity() const;
 
  /** \details
    Enables/disables showing intensity for this point cloud entity.
 
    \param intensity [in]  Value for option.
    
    \note
    Returns eOk.
  */
  OdResult  setShowIntensity(const bool);
  
  
  //bool hasIntensity() const;
 
 
  /** \details
    Returns an intensity scheme index for this point cloud entity.
  */
  int  getIntensityScheme() const;
 
  /** \details
    Sets an intensity scheme for this point cloud entity.
 
    \param schemeIndex [in]  An intensity scheme index to be set.
    
    \note
    Returns eOk.
  */
  OdResult  setIntensityScheme(const int);
 
  const OdDbPointCloudIntensityStyle& intensityStyle() const;
  OdDbPointCloudIntensityStyle* pIntensityStyle();
  
  // Clipping
  /** \details
    Returns true only if this point cloud entity is displayed as clipped.
  */
  bool  showClipping() const;
 
  /** \details
    Set whether this point cloud entity is displayed as clipped.
 
    \param clipping [in]  Value for option.
 
    \note
    Returns eOk.
  */
  OdResult  setShowClipping(const bool);
 
  /** \details
    Returns the number of clipping boundaries (the size of the clipping boundaries array) for this point cloud entity.
  */
  int  clippingCount() const;
 
 
  /** \details
    Adds a clipping boundary to the clipping boundaries array for this point cloud entity.
 
    \param boundary [in]  An OdDbPointCloudClipping object to be added.
 
    \note
    Returns true if the specified clipping boundary is successfully added or false if the boundary isn't valid.
  */
  bool  addClippingBoundary(OdDbPointCloudClipping const &);
 
  /** \details
    Removes a clipping boundary at the specified position from the clipping boundaries array for this point cloud entity.
 
    \param nInd [in]  An index of the OdDbPointCloudClipping object in the clipping boundaries array to be removed.
 
    \note
    Returns true if the specified clipping boundary is successfully removed or false if the index is out of range.
  */
  bool  removeClippingBoundary(int);
 
  /** \details
    Resets all clipping boundaries for this point cloud entity.
  */
  void  resetClippingBoundary();
 
 
  /** \details
    Returns a pointer to a constant PointCloudClipping object at the specified position in the clipping boundaries array.
    
    \param nInd [in]  An index of the OdDbPointCloudClipping object.
 
    \remarks
    Returns NULL if the index is out of range.
  */
  OdDbPointCloudClipping const*  getConstPointCloudClipping(int) const;
 
  /** \details
    Returns a pointer to a PointCloudClipping object at the specified position in the clipping boundaries array.
 
    \param nInd [in]  An index of the OdDbPointCloudClipping object.
 
    \remarks
    Returns NULL if the index is out of range.
  */
  OdDbPointCloudClipping*  getPointCloudClipping(int);
 
  // File IO
  virtual OdResult  dwgInFields(OdDbDwgFiler *);
  virtual void  dwgOutFields(OdDbDwgFiler *) const;
  virtual OdResult  dxfInFields(OdDbDxfFiler *);
  virtual void  dxfOutFields(OdDbDxfFiler *) const;
 
  // Rendering
  virtual bool subWorldDraw(OdGiWorldDraw* pWd) const;
  virtual void subViewportDraw(OdGiViewportDraw* pVd) const;
 
 
  virtual OdResult subGetGeomExtents(OdGeExtents3d& extents) const;
  virtual OdResult subTransformBy(const OdGeMatrix3d& xfm);
 
#if 0
  // Require investigation
  bool  clearSelection(const OdString&);
  bool  select(PointCloudSelectionDef const &, const OdString &);
  bool  selectNone();
  bool  selectionId(const OdString&, struct _GUID &);
 
  bool  hasIntensity() const;
 
  IPointProcess *  ProcessPoints(IPointProcessor *, OdDbExtents *);
  IPointProcess *  ProcessPoints(IPointProcessor *, OdPointCloudViewFrustum *);
 
  bool  closestPoint(OdGePoint3d const &, OdGePoint3d const &,unsigned long &) const;
  void  UsePointBuffer(IPointCloudDataBuffer *);
 
  IPointCloudEngine *  getEngine() const;
  OdResult  getNativeCloudExtent(OdDbExtents &) const;
  bool  getPointCloudFileVersion(int &,int &) const;
  void  getViewFrustum(OdGiViewport &,OdPointCloudViewFrustum &,bool) const;
  bool  hasProperty(wchar_t const *,bool &) const;
  bool  isValid() const;
  void  markDirty();
  void  onViewChanged();
  IPointCloudDataBuffer *  pointData() const;
  bool  readPoints(OdDbExtents &, unsigned long);
  bool  readPoints(OdPointCloudViewFrustum &, unsigned long);
  bool  readPoints(unsigned long);
  OdResult  setPointCloudFilter(IPointCloudFilter *);
  class IOdPcPointFilter *  setPointFilter(IOdPcPointFilter *);
  void  setVisibleSelType(enum IPointCloudDataFile::selType);
  enum IPointCloudDataFile::selType  visibleSelType() const;
#endif
 
};
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbPointCloud entity pointers.
*/
typedef OdSmartPtr<OdDbPointCloud> OdDbPointCloudPtr;
 
/** \details
  This method performs the whole point cloud entity creation routine: creates the OdDbPointCloud entity, appends it to the database,
  applies specified attributes, creates the OdDbPointCloudDef object (if needed), restores or creates new links to the OdDbPointCloudDef object, adds reactors.
 
  \param pBlockToAdd [in]  Pointer to the block table record to add the point cloud entity to.
  \param newPointCloud [out]  Recieves a pointer to the created point cloud entity.
  \param indexFile [in]  Index file path. 
  \param sourceFile [in]  Source file path.
  \param location [in]  Location of the entity.
  \param scale [in]  Scale factor.
  \param rotation [in]  Rotation angle.
  \param vAxis [in]  Rotation axis.
 
  \note
  Returns eOk. 
*/
DBPOINTCLOUDOBJ_EXPORT OdResult oddbCreatePointCloudEntity(
    OdDbBlockTableRecord* pBlockToAdd,
    OdDbPointCloudPtr& newPointCloud,
    const OdString& indexFile,
    const OdString& sourceFile,
    const OdGePoint3d& location = OdGePoint3d::kOrigin,
    double             scale = 1.0,
    double             rotation = 0.0,
    const OdGeVector3d& vAxis = OdGeVector3d::kZAxis
    );
 
#include "TD_PackPop.h"
 
#endif