oaPointArray.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaPointArray.h
00004 //
00005 // This file contains the definition for the oaPointArray class. This class
00006 // implements an array of 2-D integer points. The size of the point array can be
00007 // different than the number of points actually stored. This is useful in
00008 // situtations where the pointArray is being used as a buffer, because it
00009 // reduces the need to re-allocate the array.
00010 //
00011 // *****************************************************************************
00012 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00013 // Integration Initiative, this material may not be copied, modified,
00014 // re-published, uploaded, executed, or distributed in any way, in any medium,
00015 // in whole or in part, without prior written permission from Cadence.
00016 //
00017 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00018 //                           All Rights Reserved.
00019 //
00020 //  $Author: icftcm $
00021 //  $Revision: #1 $
00022 //  $Date: 2010/08/09 $
00023 //  $State: Exp $
00024 // *****************************************************************************
00025 // *****************************************************************************
00026 
00027 
00028 
00029 #if !defined(oaPointArray_P)
00030 #define oaPointArray_P
00031 
00032 
00033 
00034 // *****************************************************************************
00035 // Nested includes
00036 // *****************************************************************************
00037 #include "oaArray.h"
00038 #include "oaBox.h"
00039 
00040 
00041 
00042 // *****************************************************************************
00043 // Declare and define types in the OpenAccess namespace.
00044 // *****************************************************************************
00045 BEGIN_OA_NAMESPACE
00046 
00047 
00048 
00049 // *****************************************************************************
00050 // Forward Public Class Declarations
00051 // *****************************************************************************
00052 class oaPoint;
00053 class oaPointArray;
00054 class oaTransform;
00055 class oaBox;
00056 
00057 
00058 
00059 // *****************************************************************************
00060 // oaPointArray
00061 // *****************************************************************************
00062 class OA_BASE_DLL_API oaPointArray : public oaArray<oaPoint> {
00063 public:
00064                             oaPointArray(oaUInt4 sizeIn = 0);
00065                             oaPointArray(const oaPointArray &pointsIn);
00066                             oaPointArray(const oaPointArray &pointsIn,
00067                                          const oaTransform  &xform);
00068                             oaPointArray(const oaPointArray &pointsIn,
00069                                          const oaPoint      &offset);
00070                             oaPointArray(const oaPoint  pointsIn[],
00071                                          oaUInt4        numPointsIn);
00072                             oaPointArray(const oaBox &rectIn);
00073 
00074     oaBoolean               isSelfIntersecting(oaBoolean isClosed = true) const;
00075     oaBoolean               isOrthogonal(oaBoolean isClosed = true) const;
00076     oaBoolean               isRectangle() const;
00077     oaBoolean               onEdge(const oaPoint    &point,
00078                                    oaBoolean        isClosed = true) const;
00079     oaBoolean               contains(const oaPoint  &point,
00080                                      oaBoolean      includeEdges = true) const;
00081     oaBoolean               contains(const oaBox &box) const;
00082     oaBoolean               overlaps(const oaBox    &box,
00083                                      oaBoolean      closed = true) const;
00084     oaDouble                distanceFrom2(const oaPoint &point) const;
00085     oaDouble                getArea() const;
00086 
00087     oaBoolean               hasExtraPoints(oaBoolean isClosed = true) const;
00088 
00089     void                    compress(oaPointArray   &pointsOut,
00090                                      oaBoolean      isClosed = true) const;
00091     void                    compress(oaBoolean isClosed = true);
00092 
00093     void                    transform(const oaTransform &xform,
00094                                       oaPointArray      &result) const;
00095     void                    transform(const oaTransform &xform);
00096     void                    transform(const oaPoint &offset,
00097                                       oaPointArray  &result) const;
00098     void                    transform(const oaPoint &offset);
00099     void                    transform(oaDouble      scale,
00100                                       oaDouble      angle,
00101                                       oaPointArray  &result) const;
00102     void                    transform(oaDouble  scale,
00103                                       oaDouble  angle);
00104 
00105     void                    getBBox(oaBox &bBox) const;
00106 
00107     friend class oaUndoData;
00108 };
00109 
00110 
00111 
00112 END_OA_NAMESPACE
00113 
00114 #endif

Return to top of page