# Path: importerConstants.py
# MIN_0   = 0.0
# 
# MIN_PI  = -pi
# 
# MIN_PI2 = -pi / 2
# 
# MIN_INF = float('-inf')
# 
# MAX_2PI = 2 * pi
# 
# MAX_PI  = pi
# 
# MAX_PI2 = pi / 2
# 
# MAX_INF = float('inf')
# 
# MAX_LEN = 2e+100
# 
# Path: importerConstants.py
# CENTER = VEC(0, 0, 0)
# 
# DIR_X  = VEC(1, 0, 0)
# 
# DIR_Y  = VEC(0, 1, 0)
# 
# DIR_Z  = VEC(0, 0, 1)
# 
# ENCODING_FS      = 'utf8'


import traceback, Part, Draft, os, FreeCAD, re
from importerUtils              import *
from FreeCAD                    import Vector as VEC, Rotation as ROT, Placement as PLC, Matrix as MAT, Base
from math                       import pi, fabs, degrees, asin, sin, cos, tan, atan2, ceil, e, cosh, sinh, tanh, acos, acosh, asin, asinh, atan, atanh, log, sqrt, exp, log10
from importerConstants          import MIN_0, MIN_PI, MIN_PI2, MIN_INF, MAX_2PI, MAX_PI, MAX_PI2, MAX_INF, MAX_LEN
from importerConstants          import CENTER, DIR_X, DIR_Y, DIR_Z, ENCODING_FS

		i = super(Curve, self).set(entity)
		i = self.setSubtype(entity.chunks, i)
		return i
	def build(self, start, end): # by default: return a line-segment!
		logWarning(u"    ... '%s' not yet supported - forced to straight-curve!", self.__class__.__name__)
		if (self.__ready_to_build__):
			self.__ready_to_build__ = False
			# force everything else to straight line!
			if (isinstance(start, VEC)):
				self.shape = createLine(start, end)
		return self.shape
class CurveComp(Curve):    # compound curve "compcurv-curve"
	def __init__(self):
		super(CurveComp, self).__init__('compcurv')
	def setSubtype(self, chunks, index):
		return index
class CurveDegenerate(Curve):    # degenerate curve "degenerate-curve"
	def __init__(self):
		super(CurveDegenerate, self).__init__('degenerate')
	def getSatTextGeometry(self, index):  return u"%s %s" %(self.start, self.range)
	def __repr__(self): return u"Curve-Degenerate %s %s #" %s(self.start, self.range)
	def setSubtype(self, chunks, index):
		self.start, i = getLocation(chunks, index)
		self.range, i = getInterval(chunks, i, MIN_INF, MAX_INF, 1.0)
		return i
class CurveEllipse(Curve): # ellyptical curve "ellipse-curve"
	def __init__(self):
		super(CurveEllipse, self).__init__('ellipse')
		self.center = CENTER
		self.axis   = DIR_Z

# Path: importerConstants.py
# MIN_0   = 0.0
# 
# MIN_PI  = -pi
# 
# MIN_PI2 = -pi / 2
# 
# MIN_INF = float('-inf')
# 
# MAX_2PI = 2 * pi
# 
# MAX_PI  = pi
# 
# MAX_PI2 = pi / 2
# 
# MAX_INF = float('inf')
# 
# MAX_LEN = 2e+100
# 
# Path: importerConstants.py
# CENTER = VEC(0, 0, 0)
# 
# DIR_X  = VEC(1, 0, 0)
# 
# DIR_Y  = VEC(0, 1, 0)
# 
# DIR_Z  = VEC(0, 0, 1)
# 
# ENCODING_FS      = 'utf8'


# Path: Acis.py
import traceback, Part, Draft, os, FreeCAD, re
from importerUtils              import *
from FreeCAD                    import Vector as VEC, Rotation as ROT, Placement as PLC, Matrix as MAT, Base
from math                       import pi, fabs, degrees, asin, sin, cos, tan, atan2, ceil, e, cosh, sinh, tanh, acos, acosh, asin, asinh, atan, atanh, log, sqrt, exp, log10
from importerConstants          import MIN_0, MIN_PI, MIN_PI2, MIN_INF, MAX_2PI, MAX_PI, MAX_PI2, MAX_INF, MAX_LEN
from importerConstants          import CENTER, DIR_X, DIR_Y, DIR_Z, ENCODING_FS

		i = super(Curve, self).set(entity)
		i = self.setSubtype(entity.chunks, i)
		return i
	def build(self, start, end): # by default: return a line-segment!
		logWarning(u"    ... '%s' not yet supported - forced to straight-curve!", self.__class__.__name__)
		if (self.__ready_to_build__):
			self.__ready_to_build__ = False
			# force everything else to straight line!
			if (isinstance(start, VEC)):
				self.shape = createLine(start, end)
		return self.shape
class CurveComp(Curve):    # compound curve "compcurv-curve"
	def __init__(self):
		super(CurveComp, self).__init__('compcurv')
	def setSubtype(self, chunks, index):
		return index
class CurveDegenerate(Curve):    # degenerate curve "degenerate-curve"
	def __init__(self):
		super(CurveDegenerate, self).__init__('degenerate')
	def getSatTextGeometry(self, index):  return u"%s %s" %(self.start, self.range)
	def __repr__(self): return u"Curve-Degenerate %s %s #" %s(self.start, self.range)
	def setSubtype(self, chunks, index):
		self.start, i = getLocation(chunks, index)
		self.range, i = getInterval(chunks, i, MIN_INF, MAX_INF, 1.0)
		return i
class CurveEllipse(Curve): # ellyptical curve "ellipse-curve"
	def __init__(self):
		super(CurveEllipse, self).__init__('ellipse')
		self.center = CENTER
		self.axis   = DIR_Z

		self.major  = DIR_X
