00001 /*************************************************************************** 00002 ** 00003 ** This file is part of TapePositioningSystem. 00004 ** 00005 ** This file may be distributed and/or modified under the terms of the 00006 ** GNU General Public License version 2 or 3 as published by the Free 00007 ** Software Foundation and appearing in the file LICENSE.GPL included 00008 ** in the packaging of this file. 00009 ** 00010 ** This file is distributed in the hope that it will be useful, but WITHOUT 00011 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00013 ** more details. 00014 ** 00015 ** You should have received a copy of the GNU General Public License 00016 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 ** 00018 ** 00019 ** 00020 ** Created: 2012-12-05 00021 ** Authors: 00022 ** Marc Wathelet (ISTerre, Grenoble, France) 00023 ** 00024 ***************************************************************************/ 00025 00026 #ifndef ANCHORING_H 00027 #define ANCHORING_H 00028 00029 #include <QtCore> 00030 00031 #include "TapePositioningSystemDLLExport.h" 00032 00033 namespace TapePositioningSystem { 00034 00035 class Node; 00036 00037 class TAPEPOSITIONINGSYSTEM_EXPORT Anchoring 00038 { 00039 public: 00040 Anchoring() {_newNode=0;} 00041 ~Anchoring() {} 00042 00043 void addAnchor(Node * n) {_anchors.append(n);} 00044 void setNewNode(Node * n) {_newNode=n;} 00045 bool isValidAnchor() const {return _anchors.count()==3;} 00046 00047 Node * n() const {return _newNode;} 00048 Node * a() const {return _anchors.at(0);} 00049 Node * b() const {return _anchors.at(1);} 00050 Node * c() const {return _anchors.at(2);} 00051 private: 00052 QVector<Node *> _anchors; 00053 Node * _newNode; 00054 }; 00055 00056 } // namespace TapePositioningSystem 00057 00058 #endif // ANCHORING_H