🛰️航天仿真算法库 SpaceAST 0.3.1
载入中...
搜索中...
未找到
ColoredSurfaceEnrichment.hpp
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#ifdef AST_WITH_QWT
25#include <qwt3d_surfaceplot.h>
26#include <qwt3d_enrichment.h>
27
28
29AST_NAMESPACE_BEGIN
30
40class ColoredSurfaceEnrichment : public Qwt3D::VertexEnrichment {
41public:
42 ColoredSurfaceEnrichment() = default;
43 explicit ColoredSurfaceEnrichment(Qwt3D::PLOTSTYLE plotStyle)
44 : plotStyle_(plotStyle) {}
45 ColoredSurfaceEnrichment(const ColoredSurfaceEnrichment&) = default;
46 ColoredSurfaceEnrichment& operator=(const ColoredSurfaceEnrichment&) = default;
47 ColoredSurfaceEnrichment* clone() const override { return new ColoredSurfaceEnrichment(*this); }
48 void drawBegin() override;
49 void draw(Qwt3D::Triple const &) override;
50public:
52 void setData(const Qwt3D::GridData* grid);
53 void setPlotStyle(Qwt3D::PLOTSTYLE plotStyle){plotStyle_ = plotStyle;}
54 Qwt3D::PLOTSTYLE plotStyle() const {return plotStyle_;}
55 const Qwt3D::SurfacePlot* surface() const;
56
57private:
58 const Qwt3D::GridData* grid_{nullptr};
59 Qwt3D::PLOTSTYLE plotStyle_{Qwt3D::WIREFRAME};
60
61 void drawFaces();
62 void drawColoredMeshLines();
63};
64
65
68AST_NAMESPACE_END
69
70#endif