1 /**************************************************************************/
2 /*  Copyright 2012 Tim Day                                                */
3 /*                                                                        */
4 /*  This file is part of Evolvotron                                       */
5 /*                                                                        */
6 /*  Evolvotron is free software: you can redistribute it and/or modify    */
7 /*  it under the terms of the GNU General Public License as published by  */
8 /*  the Free Software Foundation, either version 3 of the License, or     */
9 /*  (at your option) any later version.                                   */
10 /*                                                                        */
11 /*  Evolvotron is distributed in the hope that it will be useful,         */
12 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of        */
13 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         */
14 /*  GNU General Public License for more details.                          */
15 /*                                                                        */
16 /*  You should have received a copy of the GNU General Public License     */
17 /*  along with Evolvotron.  If not, see <http://www.gnu.org/licenses/>.   */
18 /**************************************************************************/
19 
20 /*! \file
21   \brief Interfaces and implementation for certain core Function classes.
22   Split out from functions.h as included in mutation_parameters.cpp
23 */
24 
25 #ifndef _function_identity_h_
26 #define _function_identity_h_
27 
28 #include "common.h"
29 
30 #include "function_boilerplate.h"
31 
32 //------------------------------------------------------------------------------------------
33 
34 //! Function class simply returning the position argument.
35 FUNCTION_BEGIN(FunctionIdentity,0,0,false,FnCore)
36 
37   //! Simply return the position argument.
evaluate(const XYZ & p)38   virtual const XYZ evaluate(const XYZ& p) const
39     {
40       return p;
41     }
42 
43 FUNCTION_END(FunctionIdentity)
44 
45 //------------------------------------------------------------------------------------------
46 
47 #endif
48