Overview

The StixMeshXMLExport class provides a flexible interface for applications to convert STEP geometry to a faceted XML format. This class form the basis for the export_product_asm program, as well as some of the WebGL utilities that we have developed. It provides a the framework for asynchronously faceting and then writing the results to secondary storage either as a single big file, or as a set of smaller files.

Constructor

StixMeshXMLExport(
        RoseXMLWriter * x,
        const char * dir,
        StixMeshOptions * o=0,
        RoseMeshXMLOpts * opts=0,
        unsigned sz=0
	);
   
StixMeshXMLExport(
        RoseXMLWriter * x,
        const char * dir,
        unsigned sz
	);

appendRef()

void appendRef(
        RoseXMLWriter * xml,	
        const char * name, 
        RoseObject * val
        );
        

The appendRef() function appends a reference to the specified XML writer xml. This function adds a attribute with the given name to the current element.

appendShell()

void appendShell(
        stp_representation * rep, 
        stp_representation_item * ri
        );

The appendShell() function appends a given shell (the representation item) to the items to be faceted. The faceter immediately begins processing the shell in the background. Once the faceting is completed, the shell will be held in a queue until the flushCompletedShells function is called.

appendShellRefs()

void appendShellRefs(
        RoseXMLWriter * xml,
        stp_representation * sr
        );

The appendShellRefs() function looks in the given representation, (sr) and append a shell= attribute to the XML writer containing references to all the shells in the representation.

appendShells()

void appendShells (
        stp_representation * sr
        );

The appendShells() function writes out the shells in a given shape representation. This calls appendShell() for every shell found in the given representation.

appendVal()

void appendVal (
        RoseXMLWriter * xml,
        const char * name,
        double val
        );

The appendVal() function appends a literal value to an XML attribute. The name parameter specifies the name of the attribute and the value parameter gives the value. This is a convience fucntion since RoseXMLWriter only takes attribute values as a string.

dumpShapeAsm()

void dumpShapeAsm(
        RoseXMLWriter * xml,
        stp_representation * sr,
        rose_uint_vector * roots
        );

void dumpShapeAsm(
        stp_representation * sr,
        rose_uint_vector * roots
        );

The dumpShapeAsm() function writes the assembly tree to the XML file. This includes the transform as well as the shape assembly structure. Any shells refreenced are added as by the appendShell function. Thus, the shells are processed in the background, but are not written until the flushCompletedShells function is called.

flushCompletedShells()

void flushCompletedShells();

The flushCompletedShells() function writes out the shells that have been faceted, but not yet written. The the StixMeshXMLExport object is configuted to write to a directory, each shell is written to its own shell, otherwise, it is appended to the main XML file. This function provides synchronization with the background tasks to insure that the shells are only appended at appropiate places in the output file. This function waits until all background threads are complete.

getMainXML()

RoseXMLWriter * getMainXML();

The getMainXML() function returns the main XML writer. If the output is being written to a single file, this the writer to this file. If the output is being written to multiple files, this will generally by the index.xml file in the output directory. If you are extending the file format, use the object returned by this function to add your custom elements.

getOutputDir()

const char * getOutputDir();

The getOutputDir() function returns the output directory where there are multiple XML files getting written. This function returns null when a single file is written.

getXMLOpts()

RoseMeshXMLOpts * getXMLOpts();

The getXMLOpts() function returns the XML options structure for the exporter object.

reportProgress()

virtual void reportProgress(
        stp_representation_item * it
        );

The reportProgress() function is called after a shell is faceted. This prints a message to standard output indicating the fraction of the shells completed.