<?php

class MediaAttachmentParserVehicleTrace extends AbstractMediaAttachmentParser
{
  public function getRectangle()
  {
    //logLine("getRectangle");
  	$topLeft = new Coordinate((int) $this->xml->PlateLeft, (int) $this->xml->PlateTop);
  	$bottomRight = new Coordinate((int) $this->xml->PlateRight, (int) $this->xml->PlateBottom);  
  	$rectangle = new Rectangle($topLeft, $bottomRight);
  	return $rectangle;
  }
  
  public function hasRectangle()
  {
    //logLine("hasRectangle");
  	return (
  	    !empty($this->xml->PlateLeft) &&
  			!empty($this->xml->PlateTop) &&
  			!empty($this->xml->PlateRight) &&
  			!empty($this->xml->PlateBottom)
  	);
  }
  
  public function getExtraAreas()
  {
    //logLine("getExtraAreas");
    return array();    
  }
  
  /*
  <?xml version="1.0" encoding="UTF-8"?>
  <PlateRect>
    <PlateLeft type="int">321</PlateLeft>
    <PlateTop type="int">370</PlateTop>
    <PlateRight type="int">418</PlateRight>
    <PlateBottom type="int">399</PlateBottom>
  </PlateRect>
  */
}