# Path: importerUtils.py
# def getFloat64(data, offset):
# 	'''
# 	Returns a double precision float value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the array.
# 	Returns:
# 		The double precision float value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = FLOAT64(data, offset)
# 	return val, offset + 8
# 
# def getUInt32(data, offset):
# 	'''
# 	Returns a single unsingned 32-Bit value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the unsigned 32-Bit value.
# 	Returns:
# 		The unsigned 32-Bit value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = UINT32(data, offset)
# 	return val, offset + 4
# 
# def getUInt16(data, offset):
# 	'''
# 	Returns a single unsingned 16-Bit value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the unsigned 16-Bit value.
# 	Returns:
# 		The unsigned 16-Bit value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = UINT16(data, offset)
# 	return val, offset + 2
# 
# def FloatArr2Str(arr):
# 	return (', '.join(['%g' %(f) for f in arr]))
# 
# def logError(msg, *args):
# 	if (__prmPrefOW__.GetBool("checkError", True)):    _log("logError",   Console.PrintError,   msg, args)


from importerUtils import getFloat64, getUInt32, getUInt16, FloatArr2Str, logError
from FreeCAD         import Rotation as ROT, Vector as VEC, Matrix as MAT
import math

# -*- coding: utf-8 -*-

'''
importerTransformation.py:
Importer for the Document's components
Simple approach to read/analyse Autodesk (R) Invetor (R) part file's (IPT) browser view data.
The importer can read files from Autodesk (R) Invetor (R) Inventro V2010 on. Older versions will fail!
TODO:
'''

__author__     = 'Jens M. Plonka'
__copyright__  = 'Copyright 2018, Germany'
__url__        = "https://www.github.com/jmplonka/InventorLoader"

class Transformation2D(object):
	def __init__(self):
		self.a0 = 0x00000000
		self.m  = [[1,0,0],[0,1,0],[0,0,1]]

	def read(self, data, offset):

# Path: importerUtils.py
# def getFloat64(data, offset):
# 	'''
# 	Returns a double precision float value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the array.
# 	Returns:
# 		The double precision float value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = FLOAT64(data, offset)
# 	return val, offset + 8
# 
# def getUInt32(data, offset):
# 	'''
# 	Returns a single unsingned 32-Bit value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the unsigned 32-Bit value.
# 	Returns:
# 		The unsigned 32-Bit value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = UINT32(data, offset)
# 	return val, offset + 4
# 
# def getUInt16(data, offset):
# 	'''
# 	Returns a single unsingned 16-Bit value.
# 	Args:
# 		data
# 			A binary string.
# 		offset
# 			The zero based offset of the unsigned 16-Bit value.
# 	Returns:
# 		The unsigned 16-Bit value at offset.
# 		The new position in the 'stream'.
# 	'''
# 	val, = UINT16(data, offset)
# 	return val, offset + 2
# 
# def FloatArr2Str(arr):
# 	return (', '.join(['%g' %(f) for f in arr]))
# 
# def logError(msg, *args):
# 	if (__prmPrefOW__.GetBool("checkError", True)):    _log("logError",   Console.PrintError,   msg, args)


# Path: importerTransformation.py
from importerUtils import getFloat64, getUInt32, getUInt16, FloatArr2Str, logError
from FreeCAD         import Rotation as ROT, Vector as VEC, Matrix as MAT
import math

# -*- coding: utf-8 -*-

'''
importerTransformation.py:
Importer for the Document's components
Simple approach to read/analyse Autodesk (R) Invetor (R) part file's (IPT) browser view data.
The importer can read files from Autodesk (R) Invetor (R) Inventro V2010 on. Older versions will fail!
TODO:
'''

__author__     = 'Jens M. Plonka'
__copyright__  = 'Copyright 2018, Germany'
__url__        = "https://www.github.com/jmplonka/InventorLoader"

class Transformation2D(object):
	def __init__(self):
		self.a0 = 0x00000000
		self.m  = [[1,0,0],[0,1,0],[0,0,1]]

	def read(self, data, offset):

		self.a0, i = getUInt32(data, offset)
