21 m_radius(
std::max(0.0, radius)),
22 m_resolution(
std::max(resolution, 4u)) {
24 updateInternalRepresentation();
39 :
ccCircle(circle.m_radius, circle.m_resolution) {
40 updateInternalRepresentation();
58 updateInternalRepresentation();
67 updateInternalRepresentation();
74 updateInternalRepresentation();
79 assert(out.isOpen() && (out.openMode() & QIODevice::WriteOnly));
80 if (dataVersion < 56) {
89 QDataStream outStream(&out);
100 short minVersion = 56;
120 if (dataVersion < 56) {
124 QDataStream inStream(&in);
134 void ccCircle::updateInternalRepresentation() {
137 "[ccCircle::updateInternalRepresentation] Resolution is too "
145 "[ccCircle::updateInternalRepresentation] Invalid vertices");
159 "[ccCircle::updateInternalRepresentation] Not enough memory");
167 sin(i * angleStep_rad) *
m_radius, 0)
Vector3Tpl< double > CCVector3d
Double 3D Vector.
static bool Warning(const char *format,...)
Prints out a formatted warning message in console.
static bool PrintVerbose(const char *format,...)
Prints out a verbose formatted message in console.
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
double m_radius
Radius of the circle.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
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.
void setRadius(double radius)
Sets the radius of the circle.
unsigned m_resolution
Resolution of the displayed circle.
ccCircle * clone() const
Clones this circle.
ccCircle(double radius=0.0, unsigned resolution=48, unsigned uniqueID=ccUniqueIDGenerator::InvalidUniqueID)
Default constructor.
short minimumFileVersion_MeOnly() const override
void setResolution(unsigned resolution)
Sets the resolution of the displayed circle.
virtual void toIdentity()
Sets matrix to identity.
Float version of ccGLMatrixTpl.
ccGLMatrix m_glTransHistory
Cumulative GL transformation.
virtual short minimumFileVersion_MeOnly() const
void applyGLTransformation_recursive(const ccGLMatrix *trans=nullptr)
Applies the active OpenGL transformation to the entity (recursive)
virtual void setGLTransformationHistory(const ccGLMatrix &mat)
Sets the transformation 'history' matrix (handle with care!)
virtual void applyGLTransformation(const ccGLMatrix &trans)
Applies a GL transformation to the entity.
void removeChild(ccHObject *child)
virtual bool addChild(ccHObject *child, int dependencyFlags=DP_PARENT_OF_OTHER, int insertIndex=-1)
Adds a child.
virtual void setLocked(bool state)
Sets the "enabled" property.
virtual QString getName() const
Returns object name.
virtual void setName(const QString &name)
Sets object name.
virtual void setEnabled(bool state)
Sets the "enabled" property.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
bool reserve(unsigned numberOfPoints) override
Reserves memory for all the active features.
void clear() override
Clears the entity from all its points and features.
bool toFile_MeOnly(QFile &out, short dataVersion) const override
Save own object data.
bool fromFile_MeOnly(QFile &in, short dataVersion, int flags, LoadedIDMap &oldToNewIDMap) override
Loads own object data.
QMultiMap< unsigned, unsigned > LoadedIDMap
Map of loaded unique IDs (old ID --> new ID)
void addPoint(const CCVector3 &P)
Adds a 3D point to the database.
void setClosed(bool state)
Sets whether the polyline is closed or not.
virtual bool addPointIndex(unsigned globalIndex)
Point global index insertion mechanism.
void invalidateBoundingBox()
Invalidates the bounding-box.
GenericIndexedCloudPersist * m_theAssociatedCloud
Associated cloud.
virtual bool resize(unsigned n)
Presets the size of the vector used to store point references.