Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_export_dxf/model/model.py')
-rw-r--r--io_export_dxf/model/model.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/io_export_dxf/model/model.py b/io_export_dxf/model/model.py
new file mode 100644
index 00000000..bff37339
--- /dev/null
+++ b/io_export_dxf/model/model.py
@@ -0,0 +1,38 @@
+
+class DxfDrawing(object):
+ """
+ Represents intermediate model of DXF drawing. It is useful in iterating
+ through exported object and for easy change the DXF handling library.
+ """
+ def __init__(self):
+ self._entities = {}
+ self._layers = {}
+ self._views = []
+ self._vports = []
+ self._blocks = []
+
+ def isEmpty(self):
+ return len(self._entities) == 0
+
+ def addEntity(self, type, **kwargs):
+ if type not in self._entities:
+ self._entities[type] = []
+ self._entities[type].append(kwargs)
+
+ def addLayer(self, name, color):
+ self._layers[name] = color
+
+ def containsLayer(self, name):
+ return name in self._layers
+
+ def addBlock(self, block):
+ self._blocks.append(block)
+
+ def containsBlock(self, blockname):
+ return blockname in self._blocks
+
+ def convert(self, **kwargs):
+ """ Converts this drawing into DXF representation object """
+ raise NotImplementedError()
+
+