ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvCircle.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 "ecvPolyline.h"
12 
14 
17 public:
19 
23  explicit ccCircle(double radius = 0.0,
24  unsigned resolution = 48,
25  unsigned uniqueID = ccUniqueIDGenerator::InvalidUniqueID);
26 
28 
30  ccCircle(const ccCircle& circle);
31 
33  ~ccCircle() override = default;
34 
36  CV_CLASS_ENUM getClassID() const override { return CV_TYPES::CIRCLE; }
37 
38  // inherited methods (ccHObject)
39  void applyGLTransformation(const ccGLMatrix& trans) override;
40 
42  ccCircle* clone() const;
43 
45 
47  void setRadius(double radius);
48 
50  inline double getRadius() const { return m_radius; }
51 
53 
55  void setResolution(unsigned resolution);
56 
58  inline unsigned getResolution() const { return m_resolution; }
59 
60 protected:
62  void updateInternalRepresentation();
63 
64  // inherited from ccHObject
65  bool toFile_MeOnly(QFile& out, short dataVersion) const override;
66  short minimumFileVersion_MeOnly() const override;
67  bool fromFile_MeOnly(QFile& in,
68  short dataVersion,
69  int flags,
70  LoadedIDMap& oldToNewIDMap) override;
71 
73  double m_radius;
74 
76  unsigned m_resolution;
77 };
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
Definition: CVTypes.h:97
#define CV_DB_LIB_API
Definition: CV_db.h:15
Circle (as a polyline)
Definition: ecvCircle.h:16
double m_radius
Radius of the circle.
Definition: ecvCircle.h:73
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
CV_CLASS_ENUM getClassID() const override
Returns class ID.
Definition: ecvCircle.h:36
ccCircle * clone() const
Clones this circle.
void applyGLTransformation(const ccGLMatrix &trans) override
Applies a GL transformation to the entity.
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
double getRadius() const
Returns the radius of the circle.
Definition: ecvCircle.h:50
unsigned getResolution() const
Returns the resolution of the displayed circle.
Definition: ecvCircle.h:58
void setRadius(double radius)
Sets the radius of the circle.
unsigned m_resolution
Resolution of the displayed circle.
Definition: ecvCircle.h:76
~ccCircle() override=default
Destructor.
ccCircle(double radius=0.0, unsigned resolution=48, unsigned uniqueID=ccUniqueIDGenerator::InvalidUniqueID)
Default constructor.
ccCircle(const ccCircle &circle)
Copy constructor.
short minimumFileVersion_MeOnly() const override
void setResolution(unsigned resolution)
Sets the resolution of the displayed circle.
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
Colored polyline.
Definition: ecvPolyline.h:24
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
static constexpr unsigned InvalidUniqueID
Definition: ecvObject.h:24
@ CIRCLE
Definition: CVTypes.h:113