2 Boolean geometry utilities.
6 from __future__ import absolute_import
7 #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
11 from fabmetheus_utilities.geometry.geometry_utilities import evaluate
12 from fabmetheus_utilities import archive
13 from fabmetheus_utilities import gcodec
16 __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
17 __credits__ = 'Art of Illusion <http://www.artofillusion.org/>'
18 __date__ = '$Date: 2008/02/05 $'
19 __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
22 def _getAccessibleAttribute(attributeName, elementNode):
23 'Get the accessible attribute.'
24 functionName = attributeName[len('get') :].lower()
25 if functionName not in evaluate.globalCreationDictionary:
26 print('Warning, functionName not in globalCreationDictionary in _getAccessibleAttribute in creation for:')
30 pluginModule = archive.getModuleWithPath(evaluate.globalCreationDictionary[functionName])
31 if pluginModule == None:
32 print('Warning, _getAccessibleAttribute in creation can not get a pluginModule for:')
36 return Creation(elementNode, pluginModule).getCreation
40 'Class to handle a creation.'
41 def __init__(self, elementNode, pluginModule):
43 self.elementNode = elementNode
44 self.pluginModule = pluginModule
47 "Get the string representation of this creation."
48 return self.elementNode
50 def getCreation(self, *arguments):
52 dictionary = {'_fromCreationEvaluator': 'true'}
54 if len(arguments) > 0:
55 firstArgument = arguments[0]
56 if firstArgument.__class__ == dict:
57 dictionary.update(firstArgument)
58 return self.pluginModule.getGeometryOutput(None, self.elementNode.getCopyShallow(dictionary))
59 copyShallow = self.elementNode.getCopyShallow(dictionary)
60 return self.pluginModule.getGeometryOutputByArguments(arguments, copyShallow)