Commits

Nicolas Saunier committed 47d9970

added plotting of features with object

Comments (0)

Files changed (1)

         self.velocities = velocities
         self.geometry = geometry
         self.userType = userType
-        self.features = None
+        self.features = []
         # compute bounding polygon from trajectory
         
     def getObjectInTimeInterval(self, inter):
     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)