NDEVR
API Documentation
ViewToPrimitiveObjects

Used to convert a view and a DesignObjectLookup of data into a 2D map of primitive data types. More...

Collaboration diagram for ViewToPrimitiveObjects:
[legend]

Public Member Functions

 ViewToPrimitiveObjects (const DesignObjectLookup *lookup)
 Constructs a ViewToPrimitiveObjects with the given design object lookup.
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.
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.
void setDrawGrid (bool draw_grid)
 Sets whether a background grid should be drawn.
void setMargins (uint04 margins)
 Sets the margin size around the rendered content.
void setTitle (const String &title, const String &subject)
 Sets the title and subject metadata for the output.

Protected Member Functions

Buffer< PrimitiveClipRegion > getClipping (const PrimitiveRenderOptions &primitive_options, const Model &model)
 Computes the clip regions for a given model within the render context.
void sortAndDraw (PrimitiveRenderOptions &draw_options)
 Sorts collected primitives by distance and invokes the draw callbacks in order.
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).

Protected Attributes

std::function< void(const Font &font, const PrimitiveRenderOptions &pdf_options)> m_add_font
 Callback for registering a font with the output backend.
fltp08 m_dpi
 The output resolution in dots per inch.
bool m_draw_border
 Whether to draw a border around the output.
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 PrimitiveDrawImagePolygon).
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 PrimitiveDrawLine &line, const PrimitiveRenderOptions &pdf_options)> m_draw_line
 Callback for drawing a line primitive.
std::function< void(const PrimitiveDrawPoint &point, const PrimitiveRenderOptions &pdf_options)> m_draw_point
 Callback for drawing a point primitive.
std::function< void(const PrimitiveDrawPolygon &poly, const PrimitiveRenderOptions &pdf_options)> m_draw_poly
 Callback for drawing a polygon primitive.
std::function< void(const PrimitiveDrawText &text, const PrimitiveRenderOptions &pdf_options)> m_draw_text
 Callback for drawing a text primitive.
const DesignObjectLookupm_lookup
 Pointer to the design object lookup providing scene data access.
uint04 m_margins
 The margin size in pixels.
String m_subject
 The document subject metadata.
String m_title
 The document title metadata.

Detailed Description

Used to convert a view and a DesignObjectLookup of data into a 2D map of primitive data types.


Definition at line 17 of file ViewToPrimitiveObjects.h.

Constructor & Destructor Documentation

◆ ViewToPrimitiveObjects()

ViewToPrimitiveObjects::ViewToPrimitiveObjects ( const DesignObjectLookup * lookup)

Constructs a ViewToPrimitiveObjects with the given design object lookup.

Parameters
[in]lookupPointer to the DesignObjectLookup providing access to scene data.

Member Function Documentation

◆ execute()

virtual bool ViewToPrimitiveObjects::execute ( const Camera & camera,
const Buffer< UUID > & objects_to_render,
PrimitiveRenderOptions & options )
virtual

Executes the conversion of a camera view and set of objects into primitive draw operations.

Parameters
[in]cameraThe camera defining the view projection.
[in]objects_to_renderThe UUIDs of objects to include in the output.
[in]optionsThe render options struct to populate with primitive draw data.
Returns
True if the execution succeeded and primitives were generated.

◆ getClipping()

Buffer< PrimitiveClipRegion > ViewToPrimitiveObjects::getClipping ( const PrimitiveRenderOptions & primitive_options,
const Model & model )
protected

Computes the clip regions for a given model within the render context.

Parameters
[in]primitive_optionsThe current render options providing transform context.
[in]modelThe model to compute clip regions for.
Returns
A buffer of PrimitiveClipRegion objects bounding the model.

◆ setdpi()

virtual void ViewToPrimitiveObjects::setdpi ( fltp08 dpi)
virtual

Sets the output resolution in dots per inch.

Parameters
[in]dpiThe desired DPI value.

◆ setDrawBorder()

void ViewToPrimitiveObjects::setDrawBorder ( bool border)

Sets whether a border should be drawn around the output.

Parameters
[in]borderTrue to enable border drawing.

◆ setDrawGrid()

void ViewToPrimitiveObjects::setDrawGrid ( bool draw_grid)

Sets whether a background grid should be drawn.

Parameters
[in]draw_gridTrue to enable grid drawing.

◆ setMargins()

void ViewToPrimitiveObjects::setMargins ( uint04 margins)

Sets the margin size around the rendered content.

Parameters
[in]marginsThe margin size in pixels.

◆ setTitle()

void ViewToPrimitiveObjects::setTitle ( const String & title,
const String & subject )

Sets the title and subject metadata for the output.

Parameters
[in]titleThe document title.
[in]subjectThe document subject.

◆ sortAndDraw()

void ViewToPrimitiveObjects::sortAndDraw ( PrimitiveRenderOptions & draw_options)
protected

Sorts collected primitives by distance and invokes the draw callbacks in order.

Parameters
[in]draw_optionsThe render options containing primitives to sort and draw.

◆ writeGeometryToOptions()

void ViewToPrimitiveObjects::writeGeometryToOptions ( PrimitiveRenderOptions & pdf_options,
const Matrix< fltp08 > & tr,
const Model & model,
const Geometry & geo )
protected

Converts a Geometry object into primitive draw operations (lines, points, polygons).

Parameters
[in]pdf_optionsThe render options to append geometry primitives to.
[in]trThe transform to apply to the geometry.
[in]modelThe parent model of the geometry.
[in]geoThe Geometry object to convert.

The documentation for this class was generated from the following file: