Subversion Repositories eFlore/Applications.moissonnage

Rev

Rev 26 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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