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 specific Function class.
22 */
23 
24 #ifndef _function_transform_h_
25 #define _function_transform_h_
26 
27 #include "common.h"
28 
29 #include "function_boilerplate.h"
30 
31 #include "transform.h"
32 
33 //------------------------------------------------------------------------------------------
34 
35 //! Function class returning position transfomed by a 12-component linear transform.
36 FUNCTION_BEGIN(FunctionTransform,12,0,false,FnCore)
37 
38   //! Return the transformed position argument.
evaluate(const XYZ & p)39   virtual const XYZ evaluate(const XYZ& p) const
40   {
41     const Transform transform(params());
42     return transform.transformed(p);
43   }
44 
45 FUNCTION_END(FunctionTransform)
46 
47 //------------------------------------------------------------------------------------------
48 
49 #endif
50