NDEVR
API Documentation
DXFBlockWriter

A ModelIterator that iterates over each object in the model hierarchy turning them into nested BlockData objects. More...

Inheritance diagram for DXFBlockWriter:
[legend]
Collaboration diagram for DXFBlockWriter:
[legend]

Public Member Functions

 DXFBlockWriter (Dictionary< UUID, BlockData > &block_data, CADGeometryWriter &geo_options)
 Constructs a block writer with the given block data and geometry writer.
void insertObject (const Model &model, uint04 parent_handle=Constant< uint04 >::Invalid)
 Writes a model as a DXF INSERT entity.
ParseResult postProcess (Model &model) final override
 Post-processes a model after child iteration.
ParseResult process (Model &model) final override
 Processes a model during iteration.
Public Member Functions inherited from ModelIterator
 ModelIterator ()
 Default constructor.
 ModelIterator (Buffer< Model > models)
 Constructs an iterator initialized with multiple root models.
 ModelIterator (const Model &model)
 Constructs an iterator initialized with a single root model.
void addToStack (const Model &model)
 Adds a model to the internal traversal stack without starting iteration.
Model currentModel () const
 Returns the model currently at the top of the traversal stack.
void parseAll ()
 Parses all models currently on the internal stack and their descendants.
void parseAll (const Model &model)
 Parses the given model and all of its descendants.
void parseAllChildren (const Model &parent)
 Parses all children of the given parent model, but not the parent itself.
void parseAllModels (const Buffer< Model > &models)
 Parses all models in the given buffer and their descendants.
ParseResult parseNext ()
 Parses the next model on the stack, processing it and optionally its geometry and material.

Public Attributes

const Dictionary< UUID, BlockData > & block_data
 Block definitions from the table-write phase.
CADGeometryWritergeo_options
 The geometry writer for raw geometry output.
const FactoryParametersparams
 The factory parameters.
Buffer< CADWriteModifier * > write_modifiers
 Custom write modifiers.
DXFWriterwriter
 The DXF writer for output.
Public Attributes inherited from ModelIterator
bool depth_first = true
 Whether to traverse depth-first (true) or breadth-first (false).
std::function< bool(const Model &, const Geometry &)> geo_filter
 Optional filter predicate for geometry processing. Returns true to include.
bool is_recursive = true
 Whether to recurse into child models.
std::function< bool(const Model &, const Material &)> material_filter
 Optional filter predicate for material processing. Returns true to include.
std::function< bool(const Model &)> model_filter
 Optional filter predicate for model processing. Returns true to include.
bool post_process_model = false
 Whether to invoke postProcess() after a model's children have been parsed.
bool process_geometry = true
 Whether to invoke process() for each Geometry on a model.
bool process_material = false
 Whether to invoke process() for each Material on a model.
bool process_model = true
 Whether to invoke process() for the model itself.
bool use_unit = false
 Whether to apply unit conversions during processing.

Additional Inherited Members

Public Types inherited from ModelIterator
enum  ParseResult { e_continue_parsing , e_do_not_parse_children , e_finish_parsing }
 The result returned by process functions to control iteration flow. More...
Protected Member Functions inherited from ModelIterator
virtual void _parseAllModels ()
 Internal method that drives the main parsing loop over all stacked models.
Model popNextModel ()
 Pops and returns the next model from the traversal stack.
virtual ParseResult process (Model &model, Geometry &geo)
 Called for each geometry associated with a model.
virtual ParseResult process (Model &model, Material &mat)
 Called for each material associated with a model.
void removeFromPostProcessStack ()
 Removes the current model from the post-process stack.
Protected Attributes inherited from ModelIterator
uint04 m_forward_position = 0U
 Current forward index position used in breadth-first traversal.
Buffer< std::pair< Model, uint04 > > m_model_parent_stack
 Stack tracking parent models and their child indices for post-processing.
Buffer< Modelm_model_stack
 The stack of models pending traversal.

Detailed Description

A ModelIterator that iterates over each object in the model hierarchy turning them into nested BlockData objects.


Definition at line 64 of file DXFBlockWriter.h.

Constructor & Destructor Documentation

◆ DXFBlockWriter()

DXFBlockWriter::DXFBlockWriter ( Dictionary< UUID, BlockData > & block_data,
CADGeometryWriter & geo_options )

Constructs a block writer with the given block data and geometry writer.

Parameters
[in]block_dataThe block definitions.
[in]geo_optionsThe geometry writer.

References block_data, and geo_options.

Member Function Documentation

◆ insertObject()

void DXFBlockWriter::insertObject ( const Model & model,
uint04 parent_handle = Constantuint04 >::Invalid )

Writes a model as a DXF INSERT entity.

Parameters
[in]modelThe model to insert.
[in]parent_handleThe parent entity handle.

◆ postProcess()

ParseResult DXFBlockWriter::postProcess ( Model & model)
finaloverridevirtual

Post-processes a model after child iteration.

Parameters
[in]modelThe model to post-process.
Returns
The parse result.

Reimplemented from ModelIterator.

◆ process()

ParseResult DXFBlockWriter::process ( Model & model)
finaloverridevirtual

Processes a model during iteration.

Parameters
[in]modelThe model to process.
Returns
The parse result.

Reimplemented from ModelIterator.


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