summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/eraser.cc
blob: a2393ed45c5b1c0cf307f73320b51603aaca2fe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// eraser.cc - Classe Eraser
// robert - Programme du robot APBteam
// Copyright (C) 2005 Olivier Gaillard

/// @file eraser.cc Filtre les objets par leurs tailles

#include <iostream>

#include "eraser.hh"

/// Constructeur
Eraser::Eraser (const std::string &filename, const int resolution)
    : res_ (resolution)
{
    oconfig_ = OConfig::getInstance (); 
    init ();
}

/// Destructeur
Eraser::~Eraser (void)
{
}

/// Ouvre le fichier de donn�es
Eraser::init (std::string &filename)
{
    // Ouverture du fichier de distance
    std::ifstream file (filename); 
    if (!file) {
	throw "<Eraser::init> Error during file opening";
	return;
    }
    // Parcours des lignes et analyse
}

/// Objet � la bonne taille ?
bool
Eraser::killOrNot (const Zone &zone)
{
    int y = zone.ymax % res_;
    if (zone.vertical)
      {
	if ((zone.area > tabVMin[y]) || (zone.area < tabVMax[y]))
	    return true;
      }
    else
      {
	if ((zone.area > tabOMin[y]) || (zone.area < tabOMax[y]))
	    return true;
      }
    return false;
}