ivl 679
ivl/details/corefunc/pnt.hpp
00001 /* This file is part of the ivl C++ library <http://image.ntua.gr/ivl>.
00002    A C++ template library extending syntax towards mathematical notation.
00003 
00004    Copyright (C) 2012 Yannis Avrithis <iavr@image.ntua.gr>
00005    Copyright (C) 2012 Kimon Kontosis <kimonas@image.ntua.gr>
00006 
00007    ivl is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU Lesser General Public License 
00009    version 3 as published by the Free Software Foundation.
00010 
00011    Alternatively, you can redistribute it and/or modify it under the terms 
00012    of the GNU General Public License version 2 as published by the Free 
00013    Software Foundation.
00014 
00015    ivl is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00018    See the GNU General Public License for more details.
00019 
00020    You should have received a copy of the GNU General Public License 
00021    and a copy of the GNU Lesser General Public License along 
00022    with ivl. If not, see <http://www.gnu.org/licenses/>. */
00023 
00024 #ifndef IVL_COREFUNC_PNT
00025 #define IVL_COREFUNC_PNT
00026 
00027 namespace ivl {
00028 
00029 namespace core_details {
00030 
00031 template <class J, class J1, class J2>
00032 struct pnt_
00033 {
00034         typedef types::number<0> cost;
00035         static inline point<int> elem_op(int y, int x)
00036         {
00037                 return ivl::point<int>(y, x);
00038         }
00039 };
00040 
00041 } // namespace core_details
00042 static __attribute__ ((unused)) struct pnt_impl : public ivl_func<pnt_impl>,
00043         public binary_elem_base<point<int>, int, int, core_details::pnt_>
00044 {
00045         typedef binary_elem_base<point<int>, int, int, core_details::pnt_> pnt_base;
00046         
00047         using pnt_base::operator();
00048         using pnt_base::operator[];
00049         
00050         //TODO: proper elem func
00051         /*
00052         template <class T>
00053         point<T, 2> operator()(const T& x, const T& y)
00054         {
00055                 return point<T, 2>(x, y);
00056         }
00057         */
00058         
00059         template <class T>
00060         point<T, 3> operator()(const T& x, const T& y, const T& z)
00061         {
00062                 return point<T, 3>(x, y, z);
00063         }
00064 
00065 } pnt;
00066 
00067 
00068 } /* namespace ivl */
00069 
00070 #endif // IVL_COREFUNC_PNT
 All Classes Namespaces Files Functions Variables Typedefs Enumerations