/****************************************************************************
*
* Copyright (c) 2006 by JIA Pei, all rights reserved.
* Copyright (c) 2006 by Longer Vision Working Group.
* http://www.longervision.com/
*
* Author: JIA Pei
* Contact: jp4work@gmail.com
* He owns Longer Vision Working Group: http://www.longervision.com/
* His private webpage: http://privatewww.essex.ac.uk/~pjia
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* This software is partly based on the following open source:
*
* - Boost
* - OpenCV
*
* This software is using IMM Face Database, which can be downloaded from
* http://www2.imm.dtu.dk/~aam/.
*
* M. B. Stegmann, B. K. Ersb{\o}ll, and R. Larsen. FAME - a flexible appearance
* modelling environment. IEEE Trans. on Medical Imaging, 22(10):1319-1331, 2003
*
****************************************************************************/
// $Id: lv_aamtriangle2d.h,v 1.1.1.1 2006-09-03 17:49:04 JIA Pei Exp $
#ifndef __lv_aamtriangle2d__
#define __lv_aamtriangle2d__
#include <vector>
#include "cv.h"
#include "highgui.h"
#include "lv_triangle2d.h"
using namespace std;
/**
@author JIA Pei
@version 2006-09-13
@brief This class is a simple triangle structure defined by 3 indexes
and the positions of the 3 vertexes.
*/
class lv_aamtriangle2d : public lv_triangle2d
{
public:
// Indexes of 3 triangle vertexes (according to the subscripts -- sequence of all the indexes)
vector<int> m_iIndexes;
lv_aamtriangle2d() {this->m_iIndexes.resize(3);}
lv_aamtriangle2d(const vector<CvPoint2D32f> &iVertexes):lv_triangle2d(iVertexes)
{
this->m_iIndexes.resize(3);
}
lv_aamtriangle2d(const CvMat* iVertexes):lv_triangle2d(iVertexes)
{
this->m_iIndexes.resize (3);
}
lv_aamtriangle2d( const vector<CvPoint2D32f> &iVertexes, const vector<int> &iIndexes )
:lv_triangle2d(iVertexes)
{
assert (iIndexes.size () == 3); this->m_iIndexes = iIndexes;
}
lv_aamtriangle2d( const CvMat* iVertexes, const vector<int> &iIndexes )
:lv_triangle2d(iVertexes)
{
assert (iIndexes.size () == 3); this->m_iIndexes = iIndexes;
}
// operators
lv_aamtriangle2d& operator=(const lv_aamtriangle2d &s)
{
this->m_iIndexes = s.m_iIndexes;
this->m_dD = s.m_dD;
this->m_vVertexes = s.m_vVertexes;
return (*this);
}
~lv_aamtriangle2d() {this->m_iIndexes.clear ();}
};
#endif // __lv_aamtriangle2d__