| 1 |
/*************************************************************************** |
| 2 |
arbreplus.h - description |
| 3 |
------------------- |
| 4 |
begin : Mon Jun 4 2001 |
| 5 |
copyright : (C) 2001 by Olivier Langella |
| 6 |
email : [email protected] |
| 7 |
***************************************************************************/ |
| 8 |
|
| 9 |
/*************************************************************************** |
| 10 |
* * |
| 11 |
* This program is free software; you can redistribute it and/or modify * |
| 12 |
* it under the terms of the GNU General Public License as published by * |
| 13 |
* the Free Software Foundation; either version 2 of the License, or * |
| 14 |
* (at your option) any later version. * |
| 15 |
* * |
| 16 |
***************************************************************************/ |
| 17 |
|
| 18 |
#ifndef ARBREPLUS_H |
| 19 |
#define ARBREPLUS_H |
| 20 |
|
| 21 |
#include "arbre.h" |
| 22 |
#include "couleur.h" |
| 23 |
|
| 24 |
namespace biolib { |
| 25 |
namespace arbres { |
| 26 |
|
| 27 |
/**Arbre + informations sur les groupes d'OTUs |
| 28 |
*@author Olivier Langella |
| 29 |
*/ |
| 30 |
class ArbrePlus; |
| 31 |
|
| 32 |
class ArbrePlGroupes : public vector<ArbreVectUINT> { |
| 33 |
// ArbreGroupe contient des groupes d'individus valables pour 1 ArbrePlus |
| 34 |
public: |
| 35 |
ArbrePlGroupes(const ArbrePlus * Parbre); |
| 36 |
~ArbrePlGroupes(); |
| 37 |
|
| 38 |
const Couleur & get_couleur(unsigned int i) const {return (_tabCouleur[i]);}; |
| 39 |
const string & get_nom(unsigned int i) const {return (_tabNom[i]);}; |
| 40 |
|
| 41 |
void push_back_groupe(const string & nom, const string & couleur); |
| 42 |
|
| 43 |
int RechercheGroupeOTU(unsigned int id) const; |
| 44 |
|
| 45 |
protected: |
| 46 |
|
| 47 |
const ArbrePlus * _Parbre; |
| 48 |
|
| 49 |
vector<Couleur> _tabCouleur; |
| 50 |
vector<string> _tabNom; |
| 51 |
// vector<string> _tabReference; |
| 52 |
|
| 53 |
}; |
| 54 |
|
| 55 |
class ArbrePlus : public Arbre { |
| 56 |
public: |
| 57 |
ArbrePlus(); |
| 58 |
~ArbrePlus(); |
| 59 |
|
| 60 |
const Couleur & get_couleur_neutre () const {return(_couleur_neutre);}; |
| 61 |
const Couleur & get_couleur_otu (unsigned int id) const; |
| 62 |
|
| 63 |
void define_outgroup(const ChaineCar & outgroup); |
| 64 |
void ajouter_groupe(const ChaineCar & groupe, const string & couleur, const string & nom=""); |
| 65 |
|
| 66 |
protected: |
| 67 |
|
| 68 |
virtual void iPhylipDefGroupe(const string &); //définition d'un groupe |
| 69 |
virtual void oPhylipEcritGroupes(ostream &) const; |
| 70 |
|
| 71 |
|
| 72 |
ArbrePlGroupes _tabGroupes; |
| 73 |
|
| 74 |
ArbreVectUINT _Vind_outgroup; |
| 75 |
|
| 76 |
Couleur _couleur_neutre; |
| 77 |
}; |
| 78 |
|
| 79 |
} //namespace biolib { |
| 80 |
} //namespace arbres { |
| 81 |
|
| 82 |
|
| 83 |
#endif |