3MF XML Document parser.
More...
#include <TMF.hpp>
|
enum | TMFNodeType {
NODE_TYPE_UNKNOWN,
NODE_TYPE_MODEL,
NODE_TYPE_METADATA,
NODE_TYPE_RESOURCES,
NODE_TYPE_OBJECT,
NODE_TYPE_MESH,
NODE_TYPE_VERTICES,
NODE_TYPE_VERTEX,
NODE_TYPE_TRIANGLES,
NODE_TYPE_TRIANGLE,
NODE_TYPE_COMPONENTS,
NODE_TYPE_COMPONENT,
NODE_TYPE_BUILD,
NODE_TYPE_ITEM,
NODE_TYPE_SLIC3R_METADATA,
NODE_TYPE_SLIC3R_VOLUMES,
NODE_TYPE_SLIC3R_VOLUME,
NODE_TYPE_SLIC3R_OBJECT_CONFIG
} |
|
|
static void XMLCALL | startElement (void *userData, const char *name, const char **atts) |
|
static void XMLCALL | endElement (void *userData, const char *name) |
|
static void XMLCALL | characters (void *userData, const XML_Char *s, int len) |
|
static const char * | get_attribute (const char **atts, const char *id) |
|
◆ TMFNodeType
Enumerator |
---|
NODE_TYPE_UNKNOWN | |
NODE_TYPE_MODEL | |
NODE_TYPE_METADATA | |
NODE_TYPE_RESOURCES | |
NODE_TYPE_OBJECT | |
NODE_TYPE_MESH | |
NODE_TYPE_VERTICES | |
NODE_TYPE_VERTEX | |
NODE_TYPE_TRIANGLES | |
NODE_TYPE_TRIANGLE | |
NODE_TYPE_COMPONENTS | |
NODE_TYPE_COMPONENT | |
NODE_TYPE_BUILD | |
NODE_TYPE_ITEM | |
NODE_TYPE_SLIC3R_METADATA | |
NODE_TYPE_SLIC3R_VOLUMES | |
NODE_TYPE_SLIC3R_VOLUME | |
NODE_TYPE_SLIC3R_OBJECT_CONFIG | |
◆ TMFParserContext()
Slic3r::IO::TMFParserContext::TMFParserContext |
( |
XML_Parser |
parser, |
|
|
Model * |
model |
|
) |
| |
◆ add_volume()
ModelVolume * Slic3r::IO::TMFParserContext::add_volume |
( |
int |
start_offset, |
|
|
int |
end_offset, |
|
|
bool |
modifier |
|
) |
| |
Add a new volume to the current object.
- Parameters
-
start_offset | size_t the start index in the m_volume_facets vector. |
end_offset | size_t the end index in the m_volume_facets vector. |
modifier | bool whether the volume is modifier or not. |
- Returns
- ModelVolume* a pointer to the newly added volume.
◆ apply_transformation() [1/2]
void Slic3r::IO::TMFParserContext::apply_transformation |
( |
ModelObject * |
object, |
|
|
std::vector< double > & |
transformations |
|
) |
| |
Apply scale, rotate & translate to the given object.
- Parameters
-
object | ModelObject* |
transfornmations | vector<int> |
◆ apply_transformation() [2/2]
void Slic3r::IO::TMFParserContext::apply_transformation |
( |
ModelInstance * |
instance, |
|
|
std::vector< double > & |
transformations |
|
) |
| |
Apply scale, rotate & translate to the given instance.
- Parameters
-
instance | ModelInstance* |
transfornmations | vector<int> |
◆ characters() [1/2]
void XMLCALL Slic3r::IO::TMFParserContext::characters |
( |
void * |
userData, |
|
|
const XML_Char * |
s, |
|
|
int |
len |
|
) |
| |
|
static |
◆ characters() [2/2]
void Slic3r::IO::TMFParserContext::characters |
( |
const XML_Char * |
s, |
|
|
int |
len |
|
) |
| |
◆ endDocument()
void Slic3r::IO::TMFParserContext::endDocument |
( |
| ) |
|
◆ endElement() [1/2]
void XMLCALL Slic3r::IO::TMFParserContext::endElement |
( |
void * |
userData, |
|
|
const char * |
name |
|
) |
| |
|
static |
◆ endElement() [2/2]
void Slic3r::IO::TMFParserContext::endElement |
( |
| ) |
|
◆ get_attribute()
const char * Slic3r::IO::TMFParserContext::get_attribute |
( |
const char ** |
atts, |
|
|
const char * |
id |
|
) |
| |
|
static |
◆ get_transformations()
bool Slic3r::IO::TMFParserContext::get_transformations |
( |
std::string |
matrix, |
|
|
std::vector< double > & |
transformations |
|
) |
| |
Get scale, rotation and scale transformation from affine matrix.
- Parameters
-
matrix | string the 3D matrix where elements are separated by space. |
- Returns
- vector<double> a vector contains [translation, scale factor, xRotation, yRotation, zRotation].
◆ startElement() [1/2]
void XMLCALL Slic3r::IO::TMFParserContext::startElement |
( |
void * |
userData, |
|
|
const char * |
name, |
|
|
const char ** |
atts |
|
) |
| |
|
static |
◆ startElement() [2/2]
void Slic3r::IO::TMFParserContext::startElement |
( |
const char * |
name, |
|
|
const char ** |
atts |
|
) |
| |
◆ stop()
void Slic3r::IO::TMFParserContext::stop |
( |
| ) |
|
◆ m_model
Model& Slic3r::IO::TMFParserContext::m_model |
Model to receive objects extracted from an 3MF file.
◆ m_object
Current object allocated for an model/object XML subtree.
◆ m_object_vertices
std::vector<float> Slic3r::IO::TMFParserContext::m_object_vertices |
Vertices parsed for the current m_object.
◆ m_objects_indices
std::map<std::string, int> Slic3r::IO::TMFParserContext::m_objects_indices |
Mapping the object id in the document to the index in the model objects vector.
◆ m_output_objects
std::vector<bool> Slic3r::IO::TMFParserContext::m_output_objects |
a vector determines whether each read object should be ignored (1) or not (0). Ignored objects are the ones not referenced in build items.
◆ m_parser
XML_Parser Slic3r::IO::TMFParserContext::m_parser |
Current Expat XML parser instance.
◆ m_path
std::vector<TMFNodeType> Slic3r::IO::TMFParserContext::m_path |
Current parsing path in the XML file.
◆ m_value
std::string Slic3r::IO::TMFParserContext::m_value[3] |
Generic string buffer for metadata, etc.
◆ m_volume
Volume allocated for an model/object/mesh.
◆ m_volume_facets
std::vector<int> Slic3r::IO::TMFParserContext::m_volume_facets |
Faces collected for all volumes of the current object.
The documentation for this struct was generated from the following files: