jan: thuban/Extensions/importAPR apr.py,1.3,1.3.2.1
cvs@intevation.de
cvs at intevation.de
Mon Jun 27 23:56:32 CEST 2005
Author: jan
Update of /thubanrepository/thuban/Extensions/importAPR
In directory doto:/tmp/cvs-serv30411
Modified Files:
Tag: thuban-1-0-branch
apr.py
Log Message:
(APR_BShSym): Extend by 'Stripple'.
(APR_TClr.GetThubanColor): Fix bug in color interpretation.
Thanks to Frank Koormann who identified this problem.
Index: apr.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/importAPR/apr.py,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -d -r1.3 -r1.3.2.1
--- apr.py 30 Oct 2003 09:14:52 -0000 1.3
+++ apr.py 27 Jun 2005 21:56:30 -0000 1.3.2.1
@@ -88,19 +88,22 @@
return prop
class APR_BShSym(ODBBaseObject):
- """Polygon symbol object.
+ """Polygon symbol object, either filled with a single color or
+ with a pattern.
Always references TClr objects via 'Color', 'OutlineColor' and 'BgColor'.
Always has attributes 'OutlineWidth' and 'Outline'.
OutlineColor is interpreted to be the Thuban line color, OutlineWidth
as the Thuban line width.
'Color' is interpreted to be the Thuban fill color.
- 'BgColor' is not interpreted and it is not clear what this color
- defines.
+ 'BgColor' is not interpreted and probably has something to do with
+ patterns (Stripple).
+ 'Stripple' ist not interpreted in Thuban. It is a pattern definition
+ based on a bitpattern. Thuban has no Patterns yet.
It is unclear what 'Outline' defines and thus is not used for Tuban.
"""
- _obj_refs = [ 'Color', 'OutlineColor', 'BgColor' ]
+ _obj_refs = [ 'Color', 'OutlineColor', 'BgColor', 'Stripple' ]
_values = [ 'OutlineWidth', 'Outline' ]
def GetThubanProp(self):
@@ -203,8 +206,14 @@
for color in [ 'Red', 'Green', 'Blue' ]:
if hasattr(self, color):
s = getattr(self, color)
- while len(s) < 6:
- s = s + '0'
+ # It seems that ArcView sometimes uses only
+ # 2 bytes for a color definition, eg. 0xff.
+ # It is assumed that this is the same as
+ # 0x00ff (and not the same as 0xff00). At
+ # least color comparison shows this.
+ # Thus we do not need to append "00" if length
+ # of s is < 6. The following conversion does is
+ # right even for the short strings.
rgb[color] = int(s, 16)/float(int('0xffff', 16))
return Color(rgb['Red'], rgb['Green'], rgb['Blue'])
elif hasattr(self, 'Name'):
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)