ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccNote.cpp
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 #include "ccNote.h"
9 
10 // pass ctors straight to PointPair
11 ccNote::ccNote(ccPointCloud* associatedCloud) : ccPointPair(associatedCloud) {
13 }
14 
16 
18  // add metadata tag defining the ccCompass class type
19  QVariantMap* map = new QVariantMap();
20  map->insert("ccCompassType", "Note");
21  setMetaData(*map, true);
22 
23  // update drawing stuff
24  showNameIn3D(true);
27 }
28 
29 // returns true if object is a lineation
30 bool ccNote::isNote(ccHObject* object) {
31  if (object->hasMetaData("ccCompassType")) {
32  return object->getMetaData("ccCompassType").toString().contains("Note");
33  }
34  return false;
35 }
virtual void showNameIn3D(bool state)
Sets whether name should be displayed in 3D.
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
void setActiveColor(const ecvColor::Rgb &col)
Definition: ccMeasurement.h:29
void setDefaultColor(const ecvColor::Rgb &col)
Definition: ccMeasurement.h:25
ccNote(ccPointCloud *associatedCloud)
Definition: ccNote.cpp:11
void updateMetadata() override
Definition: ccNote.cpp:17
static bool isNote(ccHObject *obj)
Definition: ccNote.cpp:30
void setMetaData(const QString &key, const QVariant &data)
Sets a meta-data element.
bool hasMetaData(const QString &key) const
Returns whether a meta-data element with the given key exists or not.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Colored polyline.
Definition: ecvPolyline.h:24
constexpr Rgb cyan(0, MAX, MAX)
constexpr Rgb red(MAX, 0, 0)