Subversion Repositories eFlore/Applications.moissonnage

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
19 delphine 1
<?php
2
 
3
class Maille {
4
 
5
	private $latitudeSud;
6
	private $longitudeOuest;
7
	private $latitudeNord;
8
	private $longitudeEst;
9
	private $points;
10
	private $nombrePoints = NULL;
11
 
12
	private $indexLatitude;
13
	private $indexLongitude;
14
 
15
 
16
	public function __construct($sud, $ouest, $nord, $est, $indexLat, $indexLng) {
17
		$this->latitudeSud = $sud;
18
		$this->longitudeOuest = $ouest;
19
		$this->latitudeNord = $nord;
20
		$this->longitudeEst = $est;
21
		$this->indexLatitude = $indexLat;
22
		$this->indexLongitude = $indexLng;
23
		$this->points = array();
24
	}
25
 
26
	public function ajouterPoint($point) {
27
		$this->points[] = $point;
28
	}
29
 
30
	public function getLatitudeNord() {
31
		return $this->latitudeNord;
32
	}
33
 
34
	public function getLongitudeOuest() {
35
		return $this->longitudeOuest;
36
	}
37
 
38
	public function getLatitudeSud() {
39
		return $this->latitudeSud;
40
	}
41
 
42
	public function getLongitudeEst() {
43
		return $this->longitudeEst;
44
	}
45
 
46
	public function getIndexLatitude() {
47
		return $this->indexLatitude;
48
	}
49
 
50
	public function getIndexLongitude() {
51
		return $this->indexLongitude;
52
	}
53
 
54
	public function getNombrePoints() {
55
		if (!is_null($this->nombrePoints))
56
			return $this->nombrePoints;
57
		return count($this->points);
58
	}
59
 
60
	public function setNombrePoints($nombrePoints) {
61
		$this->nombrePoints = $nombrePoints;
62
	}
63
 
64
	public function getPoint($index = 0) {
65
		return (!isset($this->points[$index])) ? NULL : $this->points[$index];
66
	}
67
 
68
	public function totalNonNul() {
69
		return !is_null($this->nombrePoints);
70
	}
71
 
72
}
73
 
74
?>