00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Math Library 00005 * Module : IVector2D 00006 * Package : Zeus.ZeusMath.Geometry.Interfaces 00007 * Author : Martin Abbuehl 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef IVector2DHPP 00033 #define IVector2DHPP 00034 00035 #include <zeusmath/System/Interfaces/IAngle.hpp> 00036 #include <zeusmath/System/Interfaces/IVector.hpp> 00037 00038 00039 BEGIN_NAMESPACE_Zeus 00040 00041 00042 /******************************************************************************/ 00046 /******************************************************************************/ 00047 class IVector2D : public IVector 00048 { 00049 HIDE_ASSIGNMENT_OPERATOR(IVector2D) 00050 00051 public: 00052 /*************************************************************************/ 00058 /*************************************************************************/ 00059 virtual void MQUALIFIER assign2D(const IVector2D& rVector) = 0; 00060 00061 /*************************************************************************/ 00070 /*************************************************************************/ 00071 virtual bool MQUALIFIER isParallel(const IVector2D& rVector) const = 0; 00072 00073 /*************************************************************************/ 00082 /*************************************************************************/ 00083 virtual bool MQUALIFIER isCollinear(const IVector2D& rVector) const = 0; 00084 00085 /**************************************************************************/ 00091 /**************************************************************************/ 00092 virtual bool MQUALIFIER isZeroVector() const = 0; 00093 00094 /**************************************************************************/ 00100 /**************************************************************************/ 00101 virtual bool MQUALIFIER isUnitVectorX() const = 0; 00102 00103 /**************************************************************************/ 00109 /**************************************************************************/ 00110 virtual bool MQUALIFIER isUnitVectorY() const = 0; 00111 00112 /**************************************************************************/ 00117 /**************************************************************************/ 00118 virtual const Float& MQUALIFIER getX() const = 0; 00119 00120 /**************************************************************************/ 00125 /**************************************************************************/ 00126 virtual const Float& MQUALIFIER getY() const = 0; 00127 00128 /**************************************************************************/ 00133 /**************************************************************************/ 00134 virtual void MQUALIFIER setX(const Float& fX) = 0; 00135 00136 /**************************************************************************/ 00141 /**************************************************************************/ 00142 virtual void MQUALIFIER setY(const Float& fY) = 0; 00143 00144 /**************************************************************************/ 00152 /**************************************************************************/ 00153 virtual void MQUALIFIER setValues(Float fX, Float fY) = 0; 00154 00155 // Initialization methods. 00156 /**************************************************************************/ 00158 /**************************************************************************/ 00159 virtual void MQUALIFIER initAsZeroVector() = 0; 00160 00161 /**************************************************************************/ 00164 /**************************************************************************/ 00165 virtual void MQUALIFIER initAsUnitVectorX() = 0; 00166 00167 /**************************************************************************/ 00170 /**************************************************************************/ 00171 virtual void MQUALIFIER initAsUnitVectorY() = 0; 00172 00173 // Operator methods. 00174 /**************************************************************************/ 00185 /***************************************************************************/ 00186 virtual void MQUALIFIER calcAngleTo(const IVector2D& rVector, 00187 bool bAbsolute, IAngle& rAngle) const = 0; 00188 00189 /**************************************************************************/ 00196 /**************************************************************************/ 00197 virtual Float MQUALIFIER calcDistanceTo(const IVector2D& rVector) const = 0; 00198 00199 /**************************************************************************/ 00202 /**************************************************************************/ 00203 virtual void MQUALIFIER normalize() = 0; 00204 00206 /**************************************************************************/ 00211 /**************************************************************************/ 00212 virtual void MQUALIFIER getAngle(IAngle& rAngle) const = 0; 00213 00214 /**************************************************************************/ 00218 /**************************************************************************/ 00219 virtual void MQUALIFIER setAngle(const IAngle& rAngle) = 0; 00220 00221 /**************************************************************************/ 00226 /**************************************************************************/ 00227 virtual void MQUALIFIER rotate(const IAngle& rAngle) = 0; 00228 }; 00229 00230 END_NAMESPACE_Zeus 00231 00232 00233 #endif 00234