def addXMLSection(self, depth, output): "Add the xml section for this object." xml_writer.addBeginXMLTag({}, depth, 'vertices', output) vertices = self.originalVertices if vertices == None: vertices = self.vertices for vertex in vertices: attributeTable = { 'x': str(vertex.x), 'y': str(vertex.y), 'z': str(vertex.z) } xml_writer.addClosedXMLTag(attributeTable, depth + 1, 'vector3', output) xml_writer.addEndXMLTag(depth, 'vertices', output) xml_writer.addBeginXMLTag({}, depth, 'faces', output) for face in self.faces: attributeTable = {} for vertexIndexIndex in xrange(len(face.vertexIndexes)): vertexIndex = face.vertexIndexes[vertexIndexIndex] attributeTable['vertex' + str(vertexIndexIndex)] = str(vertexIndex) xml_writer.addClosedXMLTag(attributeTable, depth + 1, 'face', output) xml_writer.addEndXMLTag(depth, 'faces', output)
def addXMLSection( self, depth, output ): "Add the xml section for this object." xml_writer.addBeginXMLTag( {}, depth, 'vertices', output ) vertices = self.originalVertices if vertices == None: vertices = self.vertices for vertex in vertices: attributeTable = { 'x' : str( vertex.x ), 'y' : str( vertex.y ), 'z' : str( vertex.z ) } xml_writer.addClosedXMLTag( attributeTable, depth + 1, 'vector3', output ) xml_writer.addEndXMLTag( depth, 'vertices', output ) xml_writer.addBeginXMLTag( {}, depth, 'faces', output ) for face in self.faces: attributeTable = {} for vertexIndexIndex in xrange( len( face.vertexIndexes ) ): vertexIndex = face.vertexIndexes[ vertexIndexIndex ] attributeTable[ 'vertex' + str( vertexIndexIndex ) ] = str( vertexIndex ) xml_writer.addClosedXMLTag( attributeTable, depth + 1, 'face', output ) xml_writer.addEndXMLTag( depth, 'faces', output )
def addXML(self, depth, output): "Add xml for this object." attributeTable = self.getAttributeTable() if len(attributeTable) > 0: xml_writer.addClosedXMLTag(attributeTable, depth, self.__class__.__name__.lower(), output)
def addXML( self, depth, output ): "Add xml for this object." attributeTable = self.getAttributeTable() if len( attributeTable ) > 0: xml_writer.addClosedXMLTag( attributeTable, depth, self.__class__.__name__.lower(), output )