src/linetypes/cylinder.h

Sun, 10 Jun 2018 16:04:38 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 10 Jun 2018 16:04:38 +0300
changeset 1397
5d5c11af0268
parent 1394
8d9d0532b3df
permissions
-rw-r--r--

cleaned up LDColor constructors

#pragma once
#include "modelobject.h"

class LDCylinder : public LDMatrixObject
{
public:
	static const LDObjectType SubclassType = LDObjectType::Cylinder;

	LDCylinder() = default;
	LDCylinder(int segments, int divisions, const Matrix& transformationMatrix, const Vertex& position);

	virtual LDObjectType type() const override
	{
		return SubclassType;
	}

	virtual QString asText() const override;
	virtual void getVertices(DocumentManager *context, QSet<Vertex>& verts) const override;
	bool isRasterizable() const override { return true; }
	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 { return 2 * m_segments; }
	QString typeName() const override { return "cylinder"; }
	void serialize(class Serializer& serializer) override;

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

	int m_segments;
	int m_divisions;
};

mercurial