[Rdkit-devel] [PATCH 06/17] Document CanvasBase methods
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Gianluca S. <gi...@gm...> - 2011-03-19 09:44:39
|
---
rdkit/Chem/Draw/canvasbase.py | 44 +++++++++++++++++++++++++++++++++-------
1 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/rdkit/Chem/Draw/canvasbase.py b/rdkit/Chem/Draw/canvasbase.py
index bed4bd5..5ac81da 100644
--- a/rdkit/Chem/Draw/canvasbase.py
+++ b/rdkit/Chem/Draw/canvasbase.py
@@ -9,26 +9,54 @@
class CanvasBase:
- """ Base class for specialized canvas backends """
+ """Base class for specialized canvas backends"""
+
+ def __init__():
+ assert False, 'No objects of this type can be created'
def addCanvasLine(self, p1, p2, color=(0, 0, 0), color2=None, **kwargs):
- """ Draw a single line on the canvas
+ """Draw a single line on the canvas
- This function will draw a line between p1 and p2 with the
- given color.
- If color2 is specified, it will be used to draw the second half
+ This function will draw a line between `p1` and `p2` with the
+ given `color`.
+ If `color2` is specified, it will be used to draw the second half
of the segment
"""
assert False, 'This should be implemented'
- def addCanvasText(self):
+ def addCanvasText(self, text, pos, font, color=(0, 0, 0), **kwargs):
+ """Draw some text
+
+ The provided `text` is drawn at position `pos` using the given
+ `font` and the chosen `color`.
+ """
assert False, 'This should be implemented'
- def addCanvasPolygon(self):
+ def addCanvasPolygon(self, ps, color=(0, 0 ,0), **kwargs):
+ """Draw a polygon
+
+ Draw a polygon identified by vertexes given in `ps` using
+ the given `color`
+ """
assert False, 'This should be implemented'
- def addCanvasDashedWedge(self):
+ def addCanvasDashedWedge(self, p1, p2, p3, dash=(2, 2),
+ color=(0, 0, 0), color2=None, **kwargs):
+ """Draw a dashed wedge
+
+ The wedge is identified by the three points `p1`, `p2`, and `p3`.
+ It will be drawn using the given `color`; if `color2` is specified
+ it will be used for the second half of the wedge
+
+ TODO: fix comment, I'm not sure what `dash` does
+
+ """
assert False, 'This should be implemented'
def flush(self):
+ """Complete any remaining draw operation
+
+ This is supposed to be the last operation on the canvas before
+ saving it
+ """
assert False, 'This should be implemented'
--
1.7.4
|