4#include <NDEVR/Polygon.h>
9 class DesignObjectLookup;
17 class ViewToPrimitiveObjects
19 struct PrimitiveClipRegion
21 Polygon<fltp04> polygon;
22 bool operator==(
const PrimitiveClipRegion& region)
const
24 return region.polygon == polygon;
26 bool operator!=(
const PrimitiveClipRegion& region)
const
28 return region.polygon != polygon;
31 struct PrimitiveDrawObject
33 Buffer<PrimitiveClipRegion> clip_region;
39 struct PrimitiveDrawPoint :
public PrimitiveDrawObject
41 Vector<2, fltp04> point;
43 struct PrimitiveDrawLine :
public PrimitiveDrawObject
45 LineSegment<2, fltp04> segment;
47 struct PrimitiveDrawPolygon :
public PrimitiveDrawObject
49 Polygon<fltp04> polygon;
51 struct PrimitiveDrawImagePolygon :
public PrimitiveDrawPolygon
54 Polygon<fltp04> image_polygon;
56 Matrix<fltp08> image_transform = Matrix<fltp08>(1.0);
58 struct PrimitiveDrawText :
public PrimitiveDrawObject
62 Matrix<fltp04, 3, 2> transform;
64 struct PrimitiveRenderOptions
66 Matrix<fltp08> complete_geo_transform;
67 Bounds<3, fltp04> bounds;
73 Buffer<PrimitiveDrawLine> lines;
74 Buffer<PrimitiveDrawPoint> points;
75 Buffer<PrimitiveDrawPolygon> polygons;
76 Buffer<PrimitiveDrawImagePolygon> image_polygons;
77 Buffer<PrimitiveDrawText> text;
78 Dictionary<String, Font> fonts;
79 Matrix<fltp08> camera_transform;
82 ViewToPrimitiveObjects(
const DesignObjectLookup* lookup);
83 void setDrawGrid(
bool draw_grid);
84 void setTitle(
const String& title,
const String& subject);
85 void setMargins(uint04 margins);
86 virtual void setdpi(fltp08 dpi);
87 void setDrawBorder(
bool border);
88 virtual bool execute(
const Camera& camera,
const Buffer<UUID>& objects_to_render, PrimitiveRenderOptions& options);
91 void sortAndDraw(PrimitiveRenderOptions& draw_options);
92 Buffer<PrimitiveClipRegion> getClipping(
const PrimitiveRenderOptions& primitive_options,
const Model& model);
94 void writeTextToOptions(PrimitiveRenderOptions& primitive_options,
const Matrix<fltp08>& tr, Text text);
96 void writeGeometryToOptions(PrimitiveRenderOptions& pdf_options,
const Matrix<fltp08>& tr,
const Model& model,
const Geometry& geo);
98 std::function<void(
const PrimitiveDrawImagePolygon& image_id,
const PrimitiveRenderOptions& pdf_options)> m_draw_image;
99 std::function<void(
const Font& font,
const PrimitiveRenderOptions& pdf_options)> m_add_font;
100 std::function<void(
const PrimitiveDrawPoint& point,
const PrimitiveRenderOptions& pdf_options)> m_draw_point;
101 std::function<void(
const PrimitiveDrawLine& line,
const PrimitiveRenderOptions& pdf_options)> m_draw_line;
102 std::function<void(
const PrimitiveDrawPolygon& poly,
const PrimitiveRenderOptions& pdf_options)> m_draw_poly;
103 std::function<void(
const PrimitiveDrawImagePolygon& image_poly,
const PrimitiveRenderOptions& pdf_options)> m_draw_image_poly;
104 std::function<void(
const PrimitiveDrawText& text,
const PrimitiveRenderOptions& pdf_options)> m_draw_text;
106 const DesignObjectLookup* m_lookup;
bool operator!=(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
bool operator==(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_type distance(const t_vertex &vertex, const LineSegment< t_dims, t_type, t_vertex > &line)
Definition Distance.hpp:171
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149