4#include <NDEVR/Polygon.h>
22 struct PrimitiveClipRegion
29 bool operator==(
const PrimitiveClipRegion& region)
const
31 return region.polygon == polygon;
37 bool operator!=(
const PrimitiveClipRegion& region)
const
39 return region.polygon != polygon;
45 struct PrimitiveDrawObject
56 struct PrimitiveDrawPoint :
public PrimitiveDrawObject
63 struct PrimitiveDrawLine :
public PrimitiveDrawObject
70 struct PrimitiveDrawPolygon :
public PrimitiveDrawObject
77 struct PrimitiveDrawImagePolygon :
public PrimitiveDrawPolygon
87 struct PrimitiveDrawText :
public PrimitiveDrawObject
96 struct PrimitiveRenderOptions
164 void writeTextToOptions(PrimitiveRenderOptions& primitive_options,
const Matrix<fltp08>& tr, Text text);
174 std::function<void(
const PrimitiveDrawImagePolygon& image_id,
const PrimitiveRenderOptions& pdf_options)>
m_draw_image;
175 std::function<void(
const Font& font,
const PrimitiveRenderOptions& pdf_options)>
m_add_font;
176 std::function<void(
const PrimitiveDrawPoint& point,
const PrimitiveRenderOptions& pdf_options)>
m_draw_point;
177 std::function<void(
const PrimitiveDrawLine& line,
const PrimitiveRenderOptions& pdf_options)>
m_draw_line;
178 std::function<void(
const PrimitiveDrawPolygon& poly,
const PrimitiveRenderOptions& pdf_options)>
m_draw_poly;
179 std::function<void(
const PrimitiveDrawImagePolygon& image_poly,
const PrimitiveRenderOptions& pdf_options)>
m_draw_image_poly;
180 std::function<void(
const PrimitiveDrawText& text,
const PrimitiveRenderOptions& pdf_options)>
m_draw_text;
A specification of upper and lower bounds in N-dimensions.
The equivelent of std::vector but with a bit more control.
A core object representing a user view as well as convenience functions for moving this view through ...
A core class where all Design Objects including models, materials, and geometries are stored.
A hash-based key-value store, useful for quick associative lookups.
Information for how to display text data.
A core class within the model hierarchy containing vertex-based data (Usually 3D data) within a set c...
Templated logic for doing matrix multiplication.
A core class that represents a node on model hierarchy.
Represents a color in the RGB space with optional alpha transparency.
The core String class for the NDEVR API.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
std::function< void(const Font &font, const PrimitiveRenderOptions &pdf_options)> m_add_font
Callback for registering a font with the output backend.
uint04 m_margins
The margin size in pixels.
fltp08 m_dpi
The output resolution in dots per inch.
void setTitle(const String &title, const String &subject)
Sets the title and subject metadata for the output.
String m_title
The document title metadata.
void writeGeometryToOptions(PrimitiveRenderOptions &pdf_options, const Matrix< fltp08 > &tr, const Model &model, const Geometry &geo)
Converts a Geometry object into primitive draw operations (lines, points, polygons).
std::function< void(const PrimitiveDrawLine &line, const PrimitiveRenderOptions &pdf_options)> m_draw_line
Callback for drawing a line primitive.
ViewToPrimitiveObjects(const DesignObjectLookup *lookup)
Constructs a ViewToPrimitiveObjects with the given design object lookup.
void sortAndDraw(PrimitiveRenderOptions &draw_options)
Sorts collected primitives by distance and invokes the draw callbacks in order.
String m_subject
The document subject metadata.
Buffer< PrimitiveClipRegion > getClipping(const PrimitiveRenderOptions &primitive_options, const Model &model)
Computes the clip regions for a given model within the render context.
void setMargins(uint04 margins)
Sets the margin size around the rendered content.
std::function< void(const PrimitiveDrawPolygon &poly, const PrimitiveRenderOptions &pdf_options)> m_draw_poly
Callback for drawing a polygon primitive.
bool m_draw_grid
Whether to draw a background grid.
std::function< void(const PrimitiveDrawImagePolygon &image_id, const PrimitiveRenderOptions &pdf_options)> m_draw_image
Callback for drawing an image (NOTE: parameter name 'image_id' may be misleading; receives a full Pri...
virtual void setdpi(fltp08 dpi)
Sets the output resolution in dots per inch.
void setDrawBorder(bool border)
Sets whether a border should be drawn around the output.
const DesignObjectLookup * m_lookup
Pointer to the design object lookup providing scene data access.
void setDrawGrid(bool draw_grid)
Sets whether a background grid should be drawn.
std::function< void(const PrimitiveDrawImagePolygon &image_poly, const PrimitiveRenderOptions &pdf_options)> m_draw_image_poly
Callback for drawing an image polygon primitive.
std::function< void(const PrimitiveDrawPoint &point, const PrimitiveRenderOptions &pdf_options)> m_draw_point
Callback for drawing a point primitive.
bool m_draw_border
Whether to draw a border around the output.
virtual bool execute(const Camera &camera, const Buffer< UUID > &objects_to_render, PrimitiveRenderOptions &options)
Executes the conversion of a camera view and set of objects into primitive draw operations.
std::function< void(const PrimitiveDrawText &text, const PrimitiveRenderOptions &pdf_options)> m_draw_text
Callback for drawing a text primitive.
The primary namespace for the NDEVR SDK.
constexpr bool operator!=(const Vector< t_dims, t_type > &vec_a, const Vector< t_dims, t_type > &vec_b)
Inequality operator.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.