[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Maposmatic-dev] [PATCH 07/22] indexlib: add page_number to IndexItem
From: |
Thomas Petazzoni |
Subject: |
[Maposmatic-dev] [PATCH 07/22] indexlib: add page_number to IndexItem |
Date: |
Fri, 30 Mar 2012 13:00:24 +0200 |
The multi-page renderer needs to know on which page each IndexItem has
been found. Therefore, we introduce a new page_number field in the
IndexItem class. This field remains to None for the single page
renderers, and is used to store an integer by the multi-page renderer.
Signed-off-by: Thomas Petazzoni <address@hidden>
---
ocitysmap2/indexlib/commons.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ocitysmap2/indexlib/commons.py b/ocitysmap2/indexlib/commons.py
index 6bbc88c..5a762f6 100644
--- a/ocitysmap2/indexlib/commons.py
+++ b/ocitysmap2/indexlib/commons.py
@@ -104,6 +104,7 @@ class IndexItem:
endpoint1 = None # coords.Point
endpoint2 = None # coords.Point
location_str = None # str or None
+ page_number = None # integer or None. Only used by multi-page renderer.
def __init__(self, label, endpoint1, endpoint2):
assert label is not None
@@ -111,14 +112,15 @@ class IndexItem:
self.endpoint1 = endpoint1
self.endpoint2 = endpoint2
self.location_str = None
+ self.page_number = None
def __str__(self):
return '%s...%s' % (self.label, self.location_str)
def __repr__(self):
- return ('IndexItem(%s, %s, %s, %s)'
+ return ('IndexItem(%s, %s, %s, %s, %s)'
% (repr(self.label), self.endpoint1, self.endpoint2,
- repr(self.location_str)))
+ repr(self.location_str), repr(self.page_number)))
def draw(self, rtl, ctx, pc, layout, fascent, fheight,
baseline_x, baseline_y):
--
1.7.4.1
- [Maposmatic-dev] Implementation of a multi-page renderer, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 01/22] Initial version of a multi-page renderer, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 03/22] multi-page: add a shape file that greys out the overlayed area between pages, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 06/22] multi-page: add grid and grid labels, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 05/22] multi-page: differentiate overlap margin and grayed margin, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 04/22] multi-page: show page number at the bottom of each page, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 07/22] indexlib: add page_number to IndexItem,
Thomas Petazzoni <=
- [Maposmatic-dev] [PATCH 02/22] coords: add BoundingBox::as_javascript() method, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 08/22] indexlib: do not raise exception when index is empty, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 09/22] indexlib: villages section is not of street type, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 10/22] renderers: pass the db connection to the Renderer class constructor, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 12/22] indexlib: render page number as part of the street/amenity location, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 15/22] indexlib: properly differentiate the page_number=None and page_number=0 cases, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 13/22] multi-page: add in dex rendering with a new MultiPageStreetIndexRenderer cl ass, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 11/22] multi-page: prepare data for index generation, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 14/22] multi-page: remove multiple debugging outputs, Thomas Petazzoni, 2012/03/30
- [Maposmatic-dev] [PATCH 18/22] indexlib: add min_drawing_width() method, Thomas Petazzoni, 2012/03/30