00001 // ***************************************************************************** 00002 // ***************************************************************************** 00003 // oaPoint.h 00004 // 00005 // This file contains the definition for the oaPoint class. This class 00006 // implements a 2-D integer point. 00007 // 00008 // ***************************************************************************** 00009 // Except as specified in the OpenAccess terms of use of Cadence or Silicon 00010 // Integration Initiative, this material may not be copied, modified, 00011 // re-published, uploaded, executed, or distributed in any way, in any medium, 00012 // in whole or in part, without prior written permission from Cadence. 00013 // 00014 // Copyright 2002-2005 Cadence Design Systems, Inc. 00015 // All Rights Reserved. 00016 // 00017 // $Author: icftcm $ 00018 // $Revision: #1 $ 00019 // $Date: 2010/08/09 $ 00020 // $State: Exp $ 00021 // ***************************************************************************** 00022 // ***************************************************************************** 00023 00024 00025 00026 #if !defined(oaPoint_P) 00027 #define oaPoint_P 00028 00029 00030 00031 // ***************************************************************************** 00032 // Nested includes 00033 // ***************************************************************************** 00034 #include "oaBaseTypes.h" 00035 00036 00037 00038 // ***************************************************************************** 00039 // Declare and define types in the OpenAccess namespace. 00040 // ***************************************************************************** 00041 BEGIN_OA_NAMESPACE 00042 00043 00044 00045 // ***************************************************************************** 00046 // Forward Public Class Declarations 00047 // ***************************************************************************** 00048 class oaPoint; 00049 class oaTransform; 00050 00051 template <class T> 00052 class oaChecker; 00053 00054 00055 00056 // ***************************************************************************** 00057 // oaPoint 00058 // ***************************************************************************** 00059 class OA_BASE_DLL_API oaPoint { 00060 public: 00061 oaPoint(); 00062 oaPoint(oaCoord xValIn, 00063 oaCoord yValIn); 00064 oaPoint(const oaPoint &point, 00065 const oaTransform &xform); 00066 00067 oaCoord &x(); 00068 oaCoord &y(); 00069 oaCoord x() const; 00070 oaCoord y() const; 00071 00072 void set(oaCoord x, 00073 oaCoord y); 00074 00075 void transform(const oaTransform &xform, 00076 oaPoint &result) const; 00077 void transform(const oaTransform &xform); 00078 void transform(oaDouble scale, 00079 oaDouble angle, 00080 oaPoint &result) const; 00081 void transform(oaDouble scale, 00082 oaDouble angle); 00083 00084 oaDouble distanceFrom2(const oaPoint &point) const; 00085 00086 oaPoint &operator+=(const oaPoint &pt); 00087 oaPoint &operator-=(const oaPoint &pt); 00088 oaPoint operator-() const; 00089 oaPoint operator-(const oaPoint &pt) const; 00090 oaPoint operator+(const oaPoint &pt) const; 00091 oaBoolean operator==(const oaPoint &pt) const; 00092 oaBoolean operator!=(const oaPoint &pt) const; 00093 00094 private: 00095 oaCoord xVal; 00096 oaCoord yVal; 00097 00098 friend class oaChecker<oaPoint>; 00099 }; 00100 00101 00102 00103 END_OA_NAMESPACE 00104 00105 #endif
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.