changeset 517:47d9970ee954

added plotting of features with object
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 06 Jun 2014 17:51:10 -0400
parents bce1fe45d1b2
children 0c86c73f3c09
files python/moving.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/python/moving.py	Fri Jun 06 14:14:01 2014 -0400
+++ b/python/moving.py	Fri Jun 06 17:51:10 2014 -0400
@@ -685,7 +685,7 @@
         self.velocities = velocities
         self.geometry = geometry
         self.userType = userType
-        self.features = None
+        self.features = []
         # compute bounding polygon from trajectory
         
     def getObjectInTimeInterval(self, inter):
@@ -747,8 +747,13 @@
     def getYCoordinates(self):
         return self.positions.getYCoordinates()
     
-    def plot(self, options = '', withOrigin = False, timeStep = 1, **kwargs):
-        self.positions.plot(options, withOrigin, timeStep, **kwargs)
+    def plot(self, options = '', withOrigin = False, timeStep = 1, withFeatures = False, **kwargs):
+        if withFeatures:
+            for f in self.features:
+                f.positions.plot('r', True, timeStep, **kwargs)
+            self.positions.plot('bx-', True, timeStep, **kwargs)
+        else:
+            self.positions.plot(options, withOrigin, timeStep, **kwargs)
 
     def plotOnWorldImage(self, nPixelsPerUnitDistance, imageHeight, options = '', withOrigin = False, timeStep = 1, **kwargs):
         self.positions.plotOnWorldImage(nPixelsPerUnitDistance, imageHeight, options, withOrigin, timeStep, **kwargs)