oaPath.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaPath.h
00004 //
00005 // This file contains the definition for the oaPath class and its supporting
00006 // class: oaPathStyle. The oaPath class implements a path 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(oaPath_P)
00027 #define oaPath_P
00028 
00029 
00030 
00031 // *****************************************************************************
00032 // Nested includes
00033 // *****************************************************************************
00034 #include "oaPolygon.h"
00035 
00036 
00037 
00038 // *****************************************************************************
00039 // Declare and define types in the OpenAccess namespace.
00040 // *****************************************************************************
00041 BEGIN_OA_NAMESPACE
00042 
00043 
00044 
00045 // *****************************************************************************
00046 // oaPathStyleEnum
00047 // *****************************************************************************
00048 #define oavNumPathStyles    4
00049 
00050 enum oaPathStyleEnum {
00051     oacTruncatePathStyle    = 0,
00052     oacExtendPathStyle      = 1,
00053     oacRoundPathStyle       = 2,
00054     oacVariablePathStyle    = 3
00055 };
00056 
00057 
00058 
00059 // *****************************************************************************
00060 // oaPathStyle
00061 // *****************************************************************************
00062 class OA_DESIGN_DLL_API oaPathStyle {
00063 public:
00064                             oaPathStyle(oaPathStyleEnum valueIn);
00065                             oaPathStyle(const oaString &name);
00066                             ~oaPathStyle();
00067 
00068     const oaString          &getName() const;
00069 
00070                             operator                oaPathStyleEnum() const;
00071 
00072 private:
00073     oaPathStyleEnum         value;
00074 
00075     static const oaString   names[];
00076 };
00077 
00078 
00079 // *****************************************************************************
00080 // oaPath
00081 // *****************************************************************************
00082 class OA_DESIGN_DLL_API oaPath : public oaShape {
00083 public:
00084     static oaPath           *create(oaBlock             *block,
00085                                     oaLayerNum          layerNum,
00086                                     oaPurposeNum        purposeNum,
00087                                     oaDist              width,
00088                                     const oaPointArray  &points,
00089                                     oaPathStyle         style = oacTruncatePathStyle,
00090                                     oaDist              beginExt = 0,
00091                                     oaDist              endExt = 0);
00092 
00093     oaDist                  getWidth() const;
00094     oaUInt4                 getNumPoints() const;
00095     void                    getPoints(oaPointArray &points) const;
00096     oaPathStyle             getStyle() const;
00097     oaDist                  getBeginExt() const;
00098     oaDist                  getEndExt() const;
00099     void                    getBoundary(oaPointArray &boundary) const;
00100     oaBoolean               isOrthogonal() const;
00101 
00102     void                    setWidth(oaDist width);
00103     void                    setPoints(const oaPointArray &points);
00104     void                    setStyle(oaPathStyle style);
00105     void                    setBeginExt(oaDist beginExt);
00106     void                    setEndExt(oaDist endExt);
00107 
00108     oaPolygon               *convertToPolygon();
00109 
00110     static void             genBoundary(const oaPointArray  &points,
00111                                         oaDist              width,
00112                                         oaPathStyle         style,
00113                                         oaDist              beginExt,
00114                                         oaDist              endExt,
00115                                         oaPointArray        &boundary);
00116 };
00117 
00118 
00119 
00120 // *****************************************************************************
00121 // Design Traits.
00122 // *****************************************************************************
00123 template<>
00124 class oaTraits<oaPath> {
00125 public:
00126     typedef oaShapeModTypeEnum  modTypeType;
00127     typedef oaShape             parentType;
00128     enum {dtIndex = oacShapeDataType};
00129     enum {dataTypeEnumVal = oacShapeDataType};
00130     enum {domain = oacBlockDomain};
00131     enum {dbType = oacDesignDBType};
00132     enum {isMultiDomain = false};
00133     enum {isConcrete = true};
00134     enum {objectTypeEnumVal = oacPathType};
00135 };
00136 
00137 
00138 
00139 END_OA_NAMESPACE
00140 
00141 #endif

Return to top of page