ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccTopologyRelation.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 #include <ecvPointCloud.h>
11 
12 #include "ccPointPair.h"
13 
14 class ccGeoObject;
15 
16 /*
17 Class/object used to define topological (timing) relationships between different
18 ccGeoObjects [WIP]
19 */
21 public:
22  // ctors
23  ccTopologyRelation(ccPointCloud* associatedCloud,
24  int older_id,
25  int younger_id,
26  int type);
28 
29  // call this function to build a visible representation of this relationship
30  void constructGraphic(ccGeoObject* older, ccGeoObject* younger);
31 
32  // write metadata specific to this object
33  void updateMetadata() override;
34 
35  // returns the youuger GeoObject
36  int getYoungerID();
37 
38  // returns the older GeoObject
39  int getOlderID();
40 
41  // return the type of this relationship
42  int getType();
43 
44  // set the type of this relationship
45  void setType(int topologyType);
46 
47  static bool isTopologyRelation(ccHObject* obj);
48 
49  // inverts a topology relation (i.e older_than becomes younger_than)
50  static int invertType(int type);
51 
52 private:
53  int m_older_id = -1; // the older object of this relationship (notation is
54  // arbitrary for "equivalence" relations)
55  int m_younger_id = -1; // the younger object of this relationship
56 
57  int m_type; // the type of this relationship
58 
59 public:
60  // x-cutting relationships and similar
61  static const int YOUNGER_THAN = 2;
62  static const int OLDER_THAN = 4;
63 
64  // conformable relationships and similar
65  static const int IMMEDIATELY_FOLLOWS =
66  8 | YOUNGER_THAN; //(younger than bit set also!)
67  static const int IMMEDIATELY_PRECEDES =
68  16 | OLDER_THAN; //(older than bit set also!)
69 
70  // equivalence
71  static const int EQUIVALENCE = 32;
72 
73  // other (rare relations)
74  static const int NOT_OLDER_THAN = 64; // equivalent to or younger
75  static const int NOT_YOUNGER_THAN = 128; // equivalent to or older
76 
77  static const int UNKNOWN = 2048; // unknown...
78 };
char type
Hierarchical CLOUDVIEWER Object.
Definition: ecvHObject.h:25
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Colored polyline.
Definition: ecvPolyline.h:24
static int invertType(int type)
static const int UNKNOWN
static const int NOT_OLDER_THAN
static const int EQUIVALENCE
static const int IMMEDIATELY_PRECEDES
static const int OLDER_THAN
void updateMetadata() override
static const int YOUNGER_THAN
static const int IMMEDIATELY_FOLLOWS
void constructGraphic(ccGeoObject *older, ccGeoObject *younger)
static const int NOT_YOUNGER_THAN
ccTopologyRelation(ccPointCloud *associatedCloud, int older_id, int younger_id, int type)
static bool isTopologyRelation(ccHObject *obj)
void setType(int topologyType)