34#include <NDEVR/IOFactory.h>
80 class ASSIMP_INTERFACE_API AssimpFactory :
public IOFactory
static constexpr StringView FactoryID()
Returns the unique identifier string for this factory.
virtual String getIcon(const File &file) override
Returns the icon name associated with the given file type.
FactoryOptions defaultWriteOptions(const FactoryParameters &file) const override
Returns the default write options for the given factory parameters.
static AssimpFactory * DefaultFactory()
Returns the singleton AssimpFactory instance.
virtual void getSupportedFormats(Buffer< FileFormat > &formats, bool is_read) override
Populates the given buffer with supported file formats for reading or writing.
virtual bool writeFile(FactoryParameters &file) override
Writes data from the design object hierarchy to a file.
virtual bool readFile(FactoryParameters &file) override
Reads data from a file into the design object hierarchy.
static bool ConvertFromAiScene(const aiScene *scene, FactoryParameters ¶ms)
Converts an imported Assimp scene into NDEVR design objects.
virtual FactoryFeatures factoryFeatures(const FactoryParameters &file, bool is_read) const override
Returns the features and configurable options for this factory given the parameters.
Buffer< UUID > filterModelsToExport(Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const FileFormat &export_format) const override
Filters a list of model UUIDs to only those that can be exported in the given format.
static bool ConvertToAiScene(AssimpSceneMemory &scene, FactoryParameters ¶ms)
Converts NDEVR design objects into an Assimp scene for export.
virtual void getSupportedFormats(Buffer< FileFormat > &formats, DesignObjectLookup *lookup, const Buffer< UUID > &models) override
Populates the given buffer with formats supported for writing the specified models.
FactoryOptions defaultReadOptions(const FactoryParameters &file) const override
Returns the default read options for the given factory parameters.
The equivelent of std::vector but with a bit more control.
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.
Allows IOFactories to report what features they support to make the import/export dialogs easier to s...
User-defined options that define preferences for importing and exporting using IOFactory objects.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
IOFactory(const StringView &factory_name)
Constructs an IOFactory with the given factory name.
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
A core class that represents a node on model hierarchy.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
The primary namespace for the NDEVR SDK.
Stores all of the objects needed for an aiScene in a way that is efficient and uses native containers...
Buffer< aiMaterial * > ai_materials
All Assimp materials accumulated for the scene.
~AssimpSceneMemory()
Destructor.
Buffer< aiMesh * > ai_meshes
All Assimp meshes accumulated for the scene.
AssimpSceneMemory()
Constructs an empty scene memory container.
Dictionary< UUID, uint04 > mat_offset
Maps model UUIDs to their starting material index offset.
Dictionary< UUID, std::pair< Geometry, uint04 > > mesh_offset
Maps model UUIDs to their geometry and mesh index offset.
bool preserve_memory
Whether to keep memory alive after destruction.
aiScene * scene
The Assimp scene being managed.
AssimpSceneMemory(aiScene *scene)
Constructs scene memory from an existing aiScene pointer.
Dictionary< String, uint04 > material_names
Tracks material names to prevent duplicate entries.
Dictionary< UUID, Buffer< aiNode * > > ai_models
Maps NDEVR model UUIDs to their Assimp scene nodes.
A container of input information that is to be filled with output information by an IOFactory.