Cleanup: comment line length (editors)
[blender.git] / source / blender / compositor / nodes / COM_FlipNode.cpp
1 /*
2  * Copyright 2011, Blender Foundation.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * Contributor:
19  *      Jeroen Bakker
20  *      Monique Dewanchand
21  */
22
23 #include "COM_FlipNode.h"
24
25 #include "COM_FlipOperation.h"
26 #include "COM_ExecutionSystem.h"
27
28 FlipNode::FlipNode(bNode *editorNode) : Node(editorNode)
29 {
30         /* pass */
31 }
32
33 void FlipNode::convertToOperations(NodeConverter &converter, const CompositorContext &/*context*/) const
34 {
35         NodeInput *inputSocket = this->getInputSocket(0);
36         NodeOutput *outputSocket = this->getOutputSocket(0);
37         FlipOperation *operation = new FlipOperation();
38         switch (this->getbNode()->custom1) {
39                 case 0: /// \TODO: I didn't find any constants in the old implementation, should I introduce them.
40                         operation->setFlipX(true);
41                         operation->setFlipY(false);
42                         break;
43                 case 1:
44                         operation->setFlipX(false);
45                         operation->setFlipY(true);
46                         break;
47                 case 2:
48                         operation->setFlipX(true);
49                         operation->setFlipY(true);
50                         break;
51         }
52
53         converter.addOperation(operation);
54         converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
55         converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
56 }