oaArc.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaArc.h
00004 //
00005 // This file contains the definition for the oaArc class. This class implements
00006 // an arc shape.
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(oaArc_P)
00027 #define oaArc_P
00028 
00029 
00030 
00031 // *****************************************************************************
00032 // Nested includes
00033 // *****************************************************************************
00034 #include "oaPointArray.h"
00035 #include "oaShape.h"
00036 #include "oaBlock.h"
00037 
00038 
00039 
00040 // *****************************************************************************
00041 // Declare and define types in the OpenAccess namespace.
00042 // *****************************************************************************
00043 BEGIN_OA_NAMESPACE
00044 
00045 
00046 
00047 // *****************************************************************************
00048 // oaArc
00049 // *****************************************************************************
00050 class OA_DESIGN_DLL_API oaArc : public oaShape {
00051 public:
00052     static oaArc            *create(oaBlock         *block,
00053                                     oaLayerNum      layerNum,
00054                                     oaPurposeNum    purposeNum,
00055                                     const oaBox     &ellipseBBox,
00056                                     oaDouble        startAngle,
00057                                     oaDouble        stopAngle);
00058 
00059     void                    getEllipseBBox(oaBox &bBox) const;
00060     oaDouble                getStartAngle() const;
00061     oaDouble                getStopAngle() const;
00062     void                    getPoints(oaPointArray  &points,
00063                                       oaUInt4       numSegs = 10) const;
00064 
00065     void                    set(const oaBox &ellipseBBox,
00066                                 oaDouble    startAngle,
00067                                 oaDouble    stopAngle);
00068 
00069     oaLine                  *convertToLine(oaUInt4 numSides = 16);
00070 
00071     static void             calcArc(const oaPoint   &p1,
00072                                     const oaPoint   &p2,
00073                                     const oaPoint   &p3,
00074                                     oaBox           &ellipseBBox,
00075                                     oaDouble        &startAngle,
00076                                     oaDouble        &stopAngle);
00077     static void             calcArc(const oaBox &ellipseBBox,
00078                                     oaBox       &bBox,
00079                                     oaDouble    &startAngle,
00080                                     oaDouble    &stopAngle);
00081 
00082     static void             calcBBox(const oaBox    &ellipseBBox,
00083                                      oaDouble       startAngle,
00084                                      oaDouble       stopAngle,
00085                                      oaBox          &bBox);
00086 
00087     static void             genPoints(const oaBox   &ellipseBBox,
00088                                       oaDouble      startAngle,
00089                                       oaDouble      stopAngle,
00090                                       oaUInt4       numEdges,
00091                                       oaPointArray  &boundary);
00092 };
00093 
00094 
00095 
00096 // *****************************************************************************
00097 // Design Traits.
00098 // *****************************************************************************
00099 template<>
00100 class oaTraits<oaArc> {
00101 public:
00102     typedef oaShapeModTypeEnum  modTypeType;
00103     typedef oaShape             parentType;
00104     enum {dtIndex = oacShapeDataType};
00105     enum {dataTypeEnumVal = oacShapeDataType};
00106     enum {domain = oacBlockDomain};
00107     enum {dbType = oacDesignDBType};
00108     enum {isMultiDomain = false};
00109     enum {isConcrete = true};
00110     enum {objectTypeEnumVal = oacArcType};
00111 };
00112 
00113 
00114 
00115 END_OA_NAMESPACE
00116 
00117 #endif

Return to top of page