diff options
author | Hamilton Kibbe <hamilton.kibbe@gmail.com> | 2019-01-26 13:52:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-26 13:52:32 -0500 |
commit | f59d78b7fe92fffcc0afc56c5bec1dd211cc30c6 (patch) | |
tree | 37ea4ae8f0c6936ec7d525c8da19d102f00ae0e9 /gerber/render/render.py | |
parent | 292f74dee92bc8c11e7ad51864ee96c411d14094 (diff) | |
parent | 5245fb925684b4ebe056e6509bfeca6b167903b5 (diff) | |
download | gerbonara-f59d78b7fe92fffcc0afc56c5bec1dd211cc30c6.tar.gz gerbonara-f59d78b7fe92fffcc0afc56c5bec1dd211cc30c6.tar.bz2 gerbonara-f59d78b7fe92fffcc0afc56c5bec1dd211cc30c6.zip |
Merge pull request #92 from curtacircuitos/subclass-bugfix
Fix hard requirement of cairo per #83, and add stubs for required sub…
Diffstat (limited to 'gerber/render/render.py')
-rw-r--r-- | gerber/render/render.py | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/gerber/render/render.py b/gerber/render/render.py index 79f43d6..580a7ea 100644 --- a/gerber/render/render.py +++ b/gerber/render/render.py @@ -139,7 +139,7 @@ class GerberContext(object): if not primitive: return - self._pre_render_primitive(primitive) + self.pre_render_primitive(primitive) color = self.color if isinstance(primitive, Line): @@ -167,16 +167,35 @@ class GerberContext(object): elif isinstance(primitive, TestRecord): self._render_test_record(primitive, color) - self._post_render_primitive(primitive) + self.post_render_primitive(primitive) - def _pre_render_primitive(self, primitive): + def set_bounds(self, bounds, *args, **kwargs): + """Called by the renderer to set the extents of the file to render. + + Parameters + ---------- + bounds: Tuple[Tuple[float, float], Tuple[float, float]] + ( (x_min, x_max), (y_min, y_max) + """ + pass + + def paint_background(self): + pass + + def new_render_layer(self): + pass + + def flatten(self): + pass + + def pre_render_primitive(self, primitive): """ Called before rendering a primitive. Use the callback to perform some action before rendering a primitive, for example adding a comment. """ return - def _post_render_primitive(self, primitive): + def post_render_primitive(self, primitive): """ Called after rendering a primitive. Use the callback to perform some action after rendering a primitive |