ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvSphere.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 "ecvGenericPrimitive.h"
12 
14 
17 public:
19 
25  const ccGLMatrix* transMat = 0,
26  QString name = QString("Sphere"),
27  unsigned precision = 24);
28 
30 
32  ccSphere(QString name = QString("Sphere"));
33 
35  virtual CV_CLASS_ENUM getClassID() const override {
36  return CV_TYPES::SPHERE;
37  }
38 
39  // inherited from ccGenericPrimitive
40  virtual QString getTypeName() const override { return "Sphere"; }
41  virtual bool hasDrawingPrecision() const override { return true; }
42  virtual ccGenericPrimitive* clone() const override;
43 
45  inline PointCoordinateType getRadius() const { return m_radius; }
47 
51 
52 protected:
53  // inherited from ccGenericPrimitive
54  bool toFile_MeOnly(QFile& out, short dataVersion) const override;
55  short minimumFileVersion_MeOnly() const override;
56  bool fromFile_MeOnly(QFile& in,
57  short dataVersion,
58  int flags,
59  LoadedIDMap& oldToNewIDMap) override;
60  virtual bool buildUp() override;
61 
62  // inherited from ccHObject
63  virtual void drawNameIn3D() override;
64 
67 };
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
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
std::string name
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
Generic primitive interface.
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
Sphere (primitive)
Definition: ecvSphere.h:16
virtual CV_CLASS_ENUM getClassID() const override
Returns class ID.
Definition: ecvSphere.h:35
virtual ccGenericPrimitive * clone() const override
Clones primitive.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
ccSphere(PointCoordinateType radius, const ccGLMatrix *transMat=0, QString name=QString("Sphere"), unsigned precision=24)
Default constructor.
virtual bool buildUp() override
Builds primitive.
virtual void drawNameIn3D() override
Draws the entity name in 3D.
virtual QString getTypeName() const override
Returns type name (sphere, cylinder, etc.)
Definition: ecvSphere.h:40
void setRadius(PointCoordinateType radius)
Sets radius.
PointCoordinateType getRadius() const
Returns radius.
Definition: ecvSphere.h:45
virtual bool hasDrawingPrecision() const override
Whether drawing is dependent on 'precision' parameter.
Definition: ecvSphere.h:41
ccSphere(QString name=QString("Sphere"))
Simplified constructor.
short minimumFileVersion_MeOnly() const override
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
PointCoordinateType m_radius
Radius.
Definition: ecvSphere.h:66
@ SPHERE
Definition: CVTypes.h:121