src/linetypes/circularprimitive.h

Sun, 10 Jun 2018 16:50:14 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 10 Jun 2018 16:50:14 +0300
changeset 1398
1c70d3447d20
parent 1394
src/linetypes/cylinder.h@8d9d0532b3df
child 1399
f52ea4078f5d
permissions
-rw-r--r--

changed LDCylinder to LDCircularPrimitive and moved circles to it

#pragma once
#include "../primitives.h"
#include "modelobject.h"

class LDCircularPrimitive : public LDMatrixObject
{
public:
	static const LDObjectType SubclassType = LDObjectType::CircularPrimitive;

	LDCircularPrimitive() = default;
	LDCircularPrimitive(
		PrimitiveModel::Type type,
		int segments,
		int divisions,
		const Matrix& transformationMatrix,
		const Vertex& position
	);

	LDObjectType type() const override;
	QString asText() const override;
	void getVertices(DocumentManager *context, QSet<Vertex>& verts) const override;
	bool isRasterizable() const override;
	void rasterize(
		DocumentManager* context,
		Winding parentWinding,
		Model& model,
		bool deep,
		bool render
	) override;
	QVector<LDPolygon> rasterizePolygons(DocumentManager* context, Winding parentWinding) override;
	QString objectListText() const override;
	int triangleCount(DocumentManager*) const override;
	QString typeName() const override;
	void serialize(class Serializer& serializer) override;

private:
	QString buildFilename() const;
	void buildPrimitiveBody(Model& model) const;

	PrimitiveModel::Type m_type = PrimitiveModel::Circle;
	int m_segments = MediumResolution;
	int m_divisions = MediumResolution;
};

mercurial