00001 /* This file is part of Rocs, 00002 Copyright (C) 2008 by: 00003 Tomaz Canabrava <tomaz.canabrava@gmail.com> 00004 Ugo Sangiori <ugorox@gmail.com> 00005 00006 Rocs is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 Rocs is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Step; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 #ifndef GENERICS_H 00022 #define GENERICS_H 00023 00024 #include "../GraphicsItem/NodeItem.h" 00029 bool leftLessThan( NodeItem* n1, NodeItem* n2 ) 00030 { 00031 return n1->x() < n2->x(); 00032 } 00033 00038 bool rightLessThan( NodeItem* n1, NodeItem* n2 ) 00039 { 00040 return n1->x() > n2->x(); 00041 } 00042 00047 bool topLessThan( NodeItem* n1, NodeItem* n2 ) 00048 { 00049 return n1->y() < n2->y(); 00050 } 00051 00056 bool bottomLessThan( NodeItem* n1, NodeItem* n2 ) 00057 { 00058 return n1->y() > n2->y(); 00059 } 00060 00061 #endif