NDEVR
API Documentation
RockWorksFactoryfinal

IOFactory implementation for reading and writing RockWorks block-model files. More...

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

Public Member Functions

 RockWorksFactory ()
 Constructs a RockWorksFactory and registers supported file formats.
FactoryFeatures factoryFeatures (const FactoryParameters &file, bool is_import) const override
 Returns the factory feature flags for the given file and import/export context.
Public Member Functions inherited from IOFactory
 IOFactory (const StringView &factory_name)
 Constructs an IOFactory with the given factory name.
virtual ~IOFactory ()
 Virtual destructor.
virtual bool canRead (const FactoryParameters &file)
 Checks whether this factory can read using the given FactoryParameters.
virtual bool canRead (const File &file)
 Checks whether this factory can read the given file.
virtual bool canRead (const FileFormat &file)
 Checks whether this factory can read the given file format.
virtual bool canWrite (const FactoryParameters &file)
 Checks whether this factory can write using the given FactoryParameters.
virtual bool canWrite (const File &file)
 Checks whether this factory can write the given file.
virtual bool canWrite (const FileFormat &file)
 Checks whether this factory can write the given file format.
virtual FactoryOptions defaultReadOptions (const FactoryParameters &file) const
 Returns the default read options for the given factory parameters.
virtual FactoryOptions defaultWriteOptions (const FactoryParameters &file) const
 Returns the default write options for the given factory parameters.
virtual bool determineExtension (const File &file, String &extension)
 Attempts to determine the file extension for the given file.
String factoryReadAppFeature () const
 Returns the application feature string required for read operations.
String factoryWriteAppFeature () const
 Returns the application feature string required for write operations.
virtual String getIcon (const File &file)
 Returns the icon name associated with the given file type.
void getSupportedFormats (Buffer< FileFormat > &formats)
 Populates the given buffer with all supported file formats (both read and write).
virtual void getSupportedFormats (Buffer< FileFormat > &formats, const File &file)
 Populates the given buffer with formats supported for the specified file.
virtual void getSupportedFormats (Buffer< FileFormat > &formats, DesignObjectLookup *lookup, const Buffer< UUID > &models)
 Populates the given buffer with formats supported for writing the specified models.
virtual void getSupportedFormatsByModelType (Buffer< FileFormat > &formats, bool is_read, const StringView &model_type)
 Populates the given buffer with formats matching a specific model type.
virtual void getSupportedFormatsForExtension (Buffer< FileFormat > &formats, bool is_read, const StringView &extension)
 Populates the given buffer with formats matching a specific file extension.
virtual bool isAutoEnabled () const
 Checks whether this factory is automatically enabled without requiring a password.
virtual bool isFactoryEnabled (bool is_read) const
 Checks whether this factory is enabled for reading or writing.
const Stringname () const
 Returns the name of this factory.
Buffer< UUIDreadFileWithDefaultSettings (const File &file, DesignObjectLookup *lookup)
 Reads a file using default settings and returns the UUIDs of the created models.
Buffer< ScenereadScenesFromFile (const File &file)
 Reads scenes from a file and returns them as a buffer of Scene objects.
void throwIfNotEnabled (bool is_read)
 Throws an exception if the factory is not enabled for the given operation direction.
virtual bool updateFromFile (const FactoryParameters &file, const FactoryOptions &old_options)
 Updates the factory parameters from a file, comparing against old options.
bool writeScenesToFile (const File &file, const Buffer< Scene > &scene)
 Writes a buffer of scenes to a file.

Static Public Member Functions

static void OutputForSlicerDicer (const SlicerOutputOptions &setup, const RockworksSolidModInfo &info)
 Exports block-model data in a format compatible with the Slicer/Dicer application.
static RockworksSolidModInfo ReadSolidModFile (File file)
 Reads a RockWorks solid model (.mod) file and returns its cell and value data.
static void UpdateModel (Model &model, const RockworksSolidModInfo &info)
 Updates a Model with geometry and data from a RockWorks solid model.
static void WriteGenerateSolidScript (const RockWorksSetup &setup)
 Writes a RockWorks RCL script that generates a solid model from the given setup parameters.
Static Public Member Functions inherited from IOFactory
static void EnableExtension (const StringView &extension, const StringView &read_password, const StringView &write_password)
 Enables a specific file extension with the given read and write passwords.
static void EnableFactory (const StringView &factory, const StringView &read_password, const StringView &write_password)
 Enables a factory by name with the given read and write passwords.
static void EnableFactory (IOFactory *factory, const StringView &read_password, const StringView &write_password)
 Registers an IOFactory instance with the system, enabling it for read and/or write.

Private Member Functions

Buffer< UUIDfilterModelsToExport (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const FileFormat &export_format) const override
 Filters a set of model UUIDs to only those exportable in the given format.
void getSupportedFormats (Buffer< FileFormat > &formats, bool is_read) override
 Populates the buffer with file formats supported by this factory.
bool readFile (FactoryParameters &file) override
 Reads a file using the RockWorks format and populates the factory parameters.
bool writeFile (FactoryParameters &file) override
 Writes data to a file in the RockWorks format.

Detailed Description

IOFactory implementation for reading and writing RockWorks block-model files.


Provides support for importing and exporting BlockModel entities to and from the RockWorks solid model (.mod) format, as well as generating RCL scripts and Slicer/Dicer output.

Definition at line 115 of file RockWorksFactory.h.

Member Function Documentation

◆ factoryFeatures()

FactoryFeatures RockWorksFactory::factoryFeatures ( const FactoryParameters & file,
bool is_import ) const
overridevirtual

Returns the factory feature flags for the given file and import/export context.


Parameters
[in]fileThe factory parameters describing the file context.
[in]is_importWhether the operation is an import (true) or export (false).
Returns
A FactoryFeatures describing the capabilities for this file.

Implements IOFactory.

◆ filterModelsToExport()

Buffer< UUID > RockWorksFactory::filterModelsToExport ( Buffer< UUID > models_to_check,
const DesignObjectLookup * lookup,
const FileFormat & export_format ) const
overrideprivatevirtual

Filters a set of model UUIDs to only those exportable in the given format.


Parameters
[in]models_to_checkThe candidate model UUIDs.
[in]lookupThe design object lookup for resolving models.
[in]export_formatThe target file format for export.
Returns
A buffer containing only the UUIDs of models that can be exported.

Reimplemented from IOFactory.

◆ getSupportedFormats()

void RockWorksFactory::getSupportedFormats ( Buffer< FileFormat > & formats,
bool is_read )
overrideprivatevirtual

Populates the buffer with file formats supported by this factory.


Parameters
[in]formatsThe buffer to fill with supported FileFormat entries.
[in]is_readWhether to return read formats (true) or write formats (false).

Implements IOFactory.

◆ OutputForSlicerDicer()

void RockWorksFactory::OutputForSlicerDicer ( const SlicerOutputOptions & setup,
const RockworksSolidModInfo & info )
static

Exports block-model data in a format compatible with the Slicer/Dicer application.


Parameters
[in]setupThe output file paths and format options.
[in]infoThe block-model data to export.

◆ readFile()

bool RockWorksFactory::readFile ( FactoryParameters & file)
overrideprivatevirtual

Reads a file using the RockWorks format and populates the factory parameters.


Parameters
[in]fileThe factory parameters specifying the file to read and where to store results.
Returns
True if the file was read successfully, false otherwise.

Implements IOFactory.

◆ ReadSolidModFile()

RockworksSolidModInfo RockWorksFactory::ReadSolidModFile ( File file)
static

Reads a RockWorks solid model (.mod) file and returns its cell and value data.


Parameters
[in]fileThe path to the .mod file to read.
Returns
A RockworksSolidModInfo containing the parsed block-model data.

◆ UpdateModel()

void RockWorksFactory::UpdateModel ( Model & model,
const RockworksSolidModInfo & info )
static

Updates a Model with geometry and data from a RockWorks solid model.


Parameters
[in]modelThe Model to update with block-model geometry.
[in]infoThe block-model data to apply.

◆ writeFile()

bool RockWorksFactory::writeFile ( FactoryParameters & file)
overrideprivatevirtual

Writes data to a file in the RockWorks format.


Parameters
[in]fileThe factory parameters specifying the data to write and destination path.
Returns
True if the file was written successfully, false otherwise.

Implements IOFactory.

◆ WriteGenerateSolidScript()

void RockWorksFactory::WriteGenerateSolidScript ( const RockWorksSetup & setup)
static

Writes a RockWorks RCL script that generates a solid model from the given setup parameters.


Parameters
[in]setupThe configuration specifying algorithm, paths, and densities for the script.

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