2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU Lesser General Public License as
4 * published by the Free Software Foundation, either version 3 of the
5 * License, or (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * @file InHalfPlaneBySimple3x3Matrix.ih
19 * @author Tristan Roussillon (\c tristan.roussillon@liris.cnrs.fr )
20 * Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
24 * Implementation of inline methods defined in InHalfPlaneBySimple3x3Matrix.h
26 * This file is part of the DGtal library.
30//////////////////////////////////////////////////////////////////////////////
32//////////////////////////////////////////////////////////////////////////////
34///////////////////////////////////////////////////////////////////////////////
35// IMPLEMENTATION of inline methods.
36///////////////////////////////////////////////////////////////////////////////
38///////////////////////////////////////////////////////////////////////////////
39// ----------------------------------------------------------------------------
40template <typename TP, typename TI>
43DGtal::InHalfPlaneBySimple3x3Matrix<TP,TI>::init( const Point& aP, const Point& aQ )
45 myMatrix.setComponent( 0, 0, static_cast<Integer>( aP[0] ) );
46 myMatrix.setComponent( 0, 1, static_cast<Integer>( aP[1] ) );
47 myMatrix.setComponent( 0, 2, NumberTraits<Integer>::ONE );
48 myMatrix.setComponent( 1, 0, static_cast<Integer>( aQ[0] ) );
49 myMatrix.setComponent( 1, 1, static_cast<Integer>( aQ[1] ) );
50 myMatrix.setComponent( 1, 2, NumberTraits<Integer>::ONE );
53// ----------------------------------------------------------------------------
54template <typename TP, typename TI>
57DGtal::InHalfPlaneBySimple3x3Matrix<TP,TI>::init( const PointArray& aA )
62// ----------------------------------------------------------------------------
63template <typename TP, typename TI>
65typename DGtal::InHalfPlaneBySimple3x3Matrix<TP,TI>::Value
66DGtal::InHalfPlaneBySimple3x3Matrix<TP,TI>::operator()( const Point& aR ) const
68 myMatrix.setComponent( 2, 0, static_cast<Integer>( aR[0] ) );
69 myMatrix.setComponent( 2, 1, static_cast<Integer>( aR[1] ) );
70 myMatrix.setComponent( 2, 2, NumberTraits<Integer>::ONE );
71 return myMatrix.determinant();
74// ----------------------------------------------------------------------------
75template <typename TP, typename TI>
78DGtal::InHalfPlaneBySimple3x3Matrix<TP,TI>::selfDisplay ( std::ostream & out ) const
80 out << "[InHalfPlaneBySimple3x3Matrix]";
83// ----------------------------------------------------------------------------
84template <typename TP, typename TI>
87DGtal::InHalfPlaneBySimple3x3Matrix<TP,TI>::isValid() const
94///////////////////////////////////////////////////////////////////////////////
95// Implementation of inline functions //
97template <typename TP, typename TI>
100DGtal::operator<< ( std::ostream & out,
101 const InHalfPlaneBySimple3x3Matrix<TP,TI> & object )
103 object.selfDisplay( out );
108///////////////////////////////////////////////////////////////////////////////