00001 // ***************************************************************************** 00002 // ***************************************************************************** 00003 // oaOccShape.h 00004 // 00005 // This file contains the definitions for the oaOccShape class and its 00006 // supporting classes. The oaOccShape object represents an unique occurrence 00007 // of an oaShape object in a design hierarchy. Each type of oaShape will have 00008 // corresponding oaOccShape classes, these classes include: 00009 // 00010 // oaOccArc 00011 // oaOccDonut 00012 // oaOccDot 00013 // oaOccEllipse 00014 // oaOccLine 00015 // oaOccPath 00016 // oaOccPathSeg 00017 // oaOccPolygon 00018 // oaOccRect 00019 // oaOccText 00020 // oaOccEvalText 00021 // oaOccTextDisplay 00022 // oaOccPropDisplay 00023 // oaOccAttrDisplay 00024 // oaOccTextOverride 00025 // oaOccInstPropDisplay 00026 // oaOccInstAttrDisplay 00027 // 00028 // The oaOccShape class has read-only interface, this means oaOccShape objects 00029 // cannot be saved persistently, cannot have properties attached to them, and 00030 // cannot be assigned to groups. 00031 // 00032 // oaOccShapes are dynamically generated; applications are responsible for 00033 // notifying OpenAccess to free the resources associated with each oaOccShape 00034 // object. 00035 // 00036 // ***************************************************************************** 00037 // Except as specified in the OpenAccess terms of use of Cadence or Silicon 00038 // Integration Initiative, this material may not be copied, modified, 00039 // re-published, uploaded, executed, or distributed in any way, in any medium, 00040 // in whole or in part, without prior written permission from Cadence. 00041 // 00042 // Copyright 2002-2005 Cadence Design Systems, Inc. 00043 // All Rights Reserved. 00044 // 00045 // $Author: icftcm $ 00046 // $Revision: #1 $ 00047 // $Date: 2010/08/09 $ 00048 // $State: Exp $ 00049 // ***************************************************************************** 00050 // ***************************************************************************** 00051 00052 00053 00054 #if !defined(oaOccShape_P) 00055 #define oaOccShape_P 00056 00057 00058 00059 // ***************************************************************************** 00060 // Nested includes 00061 // ***************************************************************************** 00062 #include "oaLPPHeader.h" 00063 #include "oaPath.h" 00064 #include "oaSegStyle.h" 00065 #include "oaTextDisplay.h" 00066 #include "oaHierPath.h" 00067 #include "oaPin.h" 00068 00069 00070 00071 // ***************************************************************************** 00072 // Declare and define types in the OpenAccess namespace. 00073 // ***************************************************************************** 00074 BEGIN_OA_NAMESPACE 00075 00076 00077 00078 // ***************************************************************************** 00079 // oaOccShape 00080 // ***************************************************************************** 00081 class OA_DESIGN_DLL_API oaOccShape : public oaBlockObject { 00082 public: 00083 static oaOccShape *get(oaShape *shape, 00084 oaDesign *topDesign, 00085 const oaHierPath &hierPath); 00086 00087 oaShape *getShape() const; 00088 void getBBox(oaBox &bBox) const; 00089 void getHierPath(oaHierPath &hierPath) const; 00090 oaLPPHeader *getHeader() const; 00091 oaLayerNum getLayerNum() const; 00092 oaPurposeNum getPurposeNum() const; 00093 oaRouteStatus getRouteStatus() const; 00094 oaBoolean hasPin() const; 00095 oaPin *getPin() const; 00096 oaBoolean hasNet() const; 00097 oaNet *getNet() const; 00098 00099 oaShape *copy(const oaTransform &xform) const; 00100 oaShape *copy(const oaTransform &xform, 00101 oaDesign *design) const; 00102 00103 void release(); 00104 00105 enum {dtIndex = oacOccShapeDataType}; 00106 }; 00107 00108 00109 00110 // ***************************************************************************** 00111 // oaOccArc 00112 // ***************************************************************************** 00113 class OA_DESIGN_DLL_API oaOccArc : public oaOccShape { 00114 public: 00115 00116 void getEllipseBBox(oaBox &bBox) const; 00117 oaDouble getStartAngle() const; 00118 oaDouble getStopAngle() const; 00119 #if !defined(OA_DEPRECATED) 00120 void getEllipseBBox(oaBox &bBox); 00121 oaDouble getStartAngle(); 00122 oaDouble getStopAngle(); 00123 #endif 00124 00125 void getPoints(oaPointArray &points, 00126 oaUInt4 numSegs = 10) const; 00127 }; 00128 00129 00130 00131 // ***************************************************************************** 00132 // oaOccDonut 00133 // ***************************************************************************** 00134 class OA_DESIGN_DLL_API oaOccDonut : public oaOccShape { 00135 public: 00136 void getHoleBBox(oaBox &bBox) const; 00137 void getCenter(oaPoint &point) const; 00138 oaUInt4 getRadius() const; 00139 oaUInt4 getHoleRadius() const; 00140 void getBoundary(oaPointArray &points, 00141 oaUInt4 numSides = 20) const; 00142 }; 00143 00144 00145 00146 // ***************************************************************************** 00147 // oaOccDot 00148 // ***************************************************************************** 00149 class OA_DESIGN_DLL_API oaOccDot : public oaOccShape { 00150 public: 00151 void getLocation(oaPoint &point) const; 00152 oaUInt4 getWidth() const; 00153 oaUInt4 getHeight() const; 00154 }; 00155 00156 00157 00158 // ***************************************************************************** 00159 // oaOccEllipse 00160 // ***************************************************************************** 00161 class OA_DESIGN_DLL_API oaOccEllipse : public oaOccShape { 00162 public: 00163 void getBoundary(oaPointArray &points, 00164 oaUInt4 numSides) const; 00165 }; 00166 00167 00168 00169 // ***************************************************************************** 00170 // oaOccLine 00171 // ***************************************************************************** 00172 class OA_DESIGN_DLL_API oaOccLine : public oaOccShape { 00173 public: 00174 oaUInt4 getNumPoints() const; 00175 void getPoints(oaPointArray &points) const; 00176 }; 00177 00178 00179 00180 // ***************************************************************************** 00181 // oaOccPath 00182 // ***************************************************************************** 00183 class OA_DESIGN_DLL_API oaOccPath : public oaOccShape { 00184 public: 00185 oaUInt4 getWidth() const; 00186 oaUInt4 getNumPoints() const; 00187 void getPoints(oaPointArray &points) const; 00188 oaPathStyle getStyle() const; 00189 oaUInt4 getBeginExt() const; 00190 oaUInt4 getEndExt() const; 00191 void getBoundary(oaPointArray &boundary) const; 00192 oaBoolean isOrthogonal() const; 00193 }; 00194 00195 00196 00197 // ***************************************************************************** 00198 // oaOccPathSeg 00199 // ***************************************************************************** 00200 class OA_DESIGN_DLL_API oaOccPathSeg : public oaOccShape { 00201 public: 00202 void getPoints(oaPoint &beginPoint, 00203 oaPoint &endPoint) const; 00204 void getStyle(oaSegStyle &style) const; 00205 void getBoundary(oaPointArray &boundary) const; 00206 oaBoolean isOrthogonal() const; 00207 }; 00208 00209 00210 00211 // ***************************************************************************** 00212 // oaOccPolygon 00213 // ***************************************************************************** 00214 class OA_DESIGN_DLL_API oaOccPolygon : public oaOccShape { 00215 public: 00216 oaUInt4 getNumPoints() const; 00217 void getPoints(oaPointArray &points) const; 00218 oaBoolean isOrthogonal() const; 00219 }; 00220 00221 00222 00223 // ***************************************************************************** 00224 // oaOccRect 00225 // ***************************************************************************** 00226 class OA_DESIGN_DLL_API oaOccRect : public oaOccShape { 00227 }; 00228 00229 00230 00231 // ***************************************************************************** 00232 // oaOccText 00233 // ***************************************************************************** 00234 class OA_DESIGN_DLL_API oaOccText : public oaOccShape { 00235 public: 00236 void getOrigin(oaPoint &origin) const; 00237 void getText(oaString &text) const; 00238 oaTextAlign getAlignment() const; 00239 oaOrient getOrient() const; 00240 oaFont getFont() const; 00241 oaUInt4 getHeight() const; 00242 oaBoolean hasOverbar() const; 00243 oaBoolean isVisible() const; 00244 oaBoolean isDrafting() const; 00245 }; 00246 00247 00248 00249 // ***************************************************************************** 00250 // oaOccEvalText 00251 // ***************************************************************************** 00252 class OA_DESIGN_DLL_API oaOccEvalText : public oaOccText { 00253 public: 00254 void getExpression(oaString &text) const; 00255 }; 00256 00257 00258 00259 // ***************************************************************************** 00260 // oaOccTextDisplay 00261 // ***************************************************************************** 00262 class OA_DESIGN_DLL_API oaOccTextDisplay : public oaOccShape { 00263 public: 00264 void getOrigin(oaPoint &origin) const; 00265 oaTextAlign getAlignment() const; 00266 oaOrient getOrient() const; 00267 oaFont getFont() const; 00268 oaUInt4 getHeight() const; 00269 oaTextDisplayFormat getFormat() const; 00270 oaBoolean hasOverbar() const; 00271 oaBoolean isVisible() const; 00272 oaBoolean isDrafting() const; 00273 void getText(oaString &text) const; 00274 }; 00275 00276 00277 00278 // ***************************************************************************** 00279 // oaOccPropDisplay 00280 // ***************************************************************************** 00281 class OA_DESIGN_DLL_API oaOccPropDisplay : public oaOccTextDisplay { 00282 public: 00283 oaProp *getProp() const; 00284 }; 00285 00286 00287 00288 // ***************************************************************************** 00289 // oaOccAttrDisplay 00290 // ***************************************************************************** 00291 class OA_DESIGN_DLL_API oaOccAttrDisplay : public oaOccTextDisplay { 00292 public: 00293 void getText(const oaNameSpace &ns, 00294 oaString &text) const; 00295 oaObject *getObject() const; 00296 oaAttrType getAttribute() const; 00297 }; 00298 00299 00300 00301 // ***************************************************************************** 00302 // oaOccTextOverride 00303 // ***************************************************************************** 00304 class OA_DESIGN_DLL_API oaOccTextOverride : public oaOccTextDisplay { 00305 public: 00306 oaText *getMasterText() const; 00307 void getMasterTextText(oaString &text) const; 00308 oaInst *getInst() const; 00309 oaBoolean isBound() const; 00310 }; 00311 00312 00313 00314 // ***************************************************************************** 00315 // oaOccInstPropDisplay 00316 // ***************************************************************************** 00317 class OA_DESIGN_DLL_API oaOccInstPropDisplay : public oaOccTextDisplay { 00318 public: 00319 oaProp *getMasterProp() const; 00320 oaInst *getInst() const; 00321 oaBoolean isBound() const; 00322 }; 00323 00324 00325 00326 // ***************************************************************************** 00327 // oaOccInstAttrDisplay 00328 // ***************************************************************************** 00329 class OA_DESIGN_DLL_API oaOccInstAttrDisplay : public oaOccTextDisplay { 00330 public: 00331 void getText(const oaNameSpace &ns, 00332 oaString &text) const; 00333 oaInst *getInst() const; 00334 oaDesignAttrType getMasterAttribute() const; 00335 oaBoolean isBound() const; 00336 }; 00337 00338 00339 00340 // ***************************************************************************** 00341 // Design Traits. 00342 // ***************************************************************************** 00343 template<> 00344 class oaTraits<oaOccShape> { 00345 public: 00346 typedef oaBlockObject parentType; 00347 enum {domain = oacBlockDomain}; 00348 enum {dbType = oacDesignDBType}; 00349 enum {isMultiDomain = false}; 00350 enum {isConcrete = false}; 00351 enum {abstractTypeEnumVal = oacOccShapeType}; 00352 }; 00353 00354 template<> 00355 class oaTraits<oaOccArc> { 00356 public: 00357 typedef oaOccShape parentType; 00358 enum {domain = oacBlockDomain}; 00359 enum {dbType = oacDesignDBType}; 00360 enum {isMultiDomain = false}; 00361 enum {isConcrete = true}; 00362 enum {objectTypeEnumVal = oacOccArcType}; 00363 enum {dataTypeEnumVal = oacOccShapeDataType}; 00364 }; 00365 00366 template<> 00367 class oaTraits<oaOccDonut> { 00368 public: 00369 typedef oaOccShape parentType; 00370 enum {domain = oacBlockDomain}; 00371 enum {dbType = oacDesignDBType}; 00372 enum {isMultiDomain = false}; 00373 enum {isConcrete = true}; 00374 enum {objectTypeEnumVal = oacOccDonutType}; 00375 enum {dataTypeEnumVal = oacOccShapeDataType}; 00376 }; 00377 00378 template<> 00379 class oaTraits<oaOccDot> { 00380 public: 00381 typedef oaOccShape parentType; 00382 enum {domain = oacBlockDomain}; 00383 enum {dbType = oacDesignDBType}; 00384 enum {isMultiDomain = false}; 00385 enum {isConcrete = true}; 00386 enum {objectTypeEnumVal = oacOccDotType}; 00387 enum {dataTypeEnumVal = oacOccShapeDataType}; 00388 }; 00389 00390 template<> 00391 class oaTraits<oaOccEllipse> { 00392 public: 00393 typedef oaOccShape parentType; 00394 enum {domain = oacBlockDomain}; 00395 enum {dbType = oacDesignDBType}; 00396 enum {isMultiDomain = false}; 00397 enum {isConcrete = true}; 00398 enum {objectTypeEnumVal = oacOccEllipseType}; 00399 enum {dataTypeEnumVal = oacOccShapeDataType}; 00400 }; 00401 00402 template<> 00403 class oaTraits<oaOccLine> { 00404 public: 00405 typedef oaOccShape parentType; 00406 enum {domain = oacBlockDomain}; 00407 enum {dbType = oacDesignDBType}; 00408 enum {isMultiDomain = false}; 00409 enum {isConcrete = true}; 00410 enum {objectTypeEnumVal = oacOccLineType}; 00411 enum {dataTypeEnumVal = oacOccShapeDataType}; 00412 }; 00413 00414 template<> 00415 class oaTraits<oaOccPath> { 00416 public: 00417 typedef oaOccShape parentType; 00418 enum {domain = oacBlockDomain}; 00419 enum {dbType = oacDesignDBType}; 00420 enum {isMultiDomain = false}; 00421 enum {isConcrete = true}; 00422 enum {objectTypeEnumVal = oacOccPathType}; 00423 enum {dataTypeEnumVal = oacOccShapeDataType}; 00424 }; 00425 00426 template<> 00427 class oaTraits<oaOccPathSeg> { 00428 public: 00429 typedef oaOccShape parentType; 00430 enum {domain = oacBlockDomain}; 00431 enum {dbType = oacDesignDBType}; 00432 enum {isMultiDomain = false}; 00433 enum {isConcrete = true}; 00434 enum {objectTypeEnumVal = oacOccPathSegType}; 00435 enum {dataTypeEnumVal = oacOccShapeDataType}; 00436 }; 00437 00438 template<> 00439 class oaTraits<oaOccPolygon> { 00440 public: 00441 typedef oaOccShape parentType; 00442 enum {domain = oacBlockDomain}; 00443 enum {dbType = oacDesignDBType}; 00444 enum {isMultiDomain = false}; 00445 enum {isConcrete = true}; 00446 enum {objectTypeEnumVal = oacOccPolygonType}; 00447 enum {dataTypeEnumVal = oacOccShapeDataType}; 00448 }; 00449 00450 template<> 00451 class oaTraits<oaOccRect> { 00452 public: 00453 typedef oaOccShape parentType; 00454 enum {domain = oacBlockDomain}; 00455 enum {dbType = oacDesignDBType}; 00456 enum {isMultiDomain = false}; 00457 enum {isConcrete = true}; 00458 enum {objectTypeEnumVal = oacOccRectType}; 00459 enum {dataTypeEnumVal = oacOccShapeDataType}; 00460 }; 00461 00462 template<> 00463 class oaTraits<oaOccText> { 00464 public: 00465 typedef oaOccShape parentType; 00466 enum {domain = oacBlockDomain}; 00467 enum {dbType = oacDesignDBType}; 00468 enum {isMultiDomain = false}; 00469 enum {isConcrete = true}; 00470 enum {objectTypeEnumVal = oacOccTextType}; 00471 enum {abstractTypeEnumVal = oacAbstractOccTextType}; 00472 enum {dataTypeEnumVal = oacOccShapeDataType}; 00473 }; 00474 00475 template<> 00476 class oaTraits<oaOccEvalText> { 00477 public: 00478 typedef oaOccText parentType; 00479 enum {domain = oacBlockDomain}; 00480 enum {dbType = oacDesignDBType}; 00481 enum {isMultiDomain = false}; 00482 enum {isConcrete = true}; 00483 enum {objectTypeEnumVal = oacOccEvalTextType}; 00484 enum {dataTypeEnumVal = oacOccShapeDataType}; 00485 }; 00486 00487 template<> 00488 class oaTraits<oaOccTextDisplay> { 00489 public: 00490 typedef oaOccShape parentType; 00491 enum {domain = oacBlockDomain}; 00492 enum {dbType = oacDesignDBType}; 00493 enum {isMultiDomain = false}; 00494 enum {isConcrete = false}; 00495 enum {abstractTypeEnumVal = oacOccTextDisplayType}; 00496 enum {dataTypeEnumVal = oacOccShapeDataType}; 00497 }; 00498 00499 template<> 00500 class oaTraits<oaOccPropDisplay> { 00501 public: 00502 typedef oaOccTextDisplay parentType; 00503 enum {domain = oacBlockDomain}; 00504 enum {dbType = oacDesignDBType}; 00505 enum {isMultiDomain = false}; 00506 enum {isConcrete = true}; 00507 enum {objectTypeEnumVal = oacOccPropDisplayType}; 00508 enum {dataTypeEnumVal = oacOccShapeDataType}; 00509 }; 00510 00511 template<> 00512 class oaTraits<oaOccAttrDisplay> { 00513 public: 00514 typedef oaOccTextDisplay parentType; 00515 enum {domain = oacBlockDomain}; 00516 enum {dbType = oacDesignDBType}; 00517 enum {isMultiDomain = false}; 00518 enum {isConcrete = true}; 00519 enum {objectTypeEnumVal = oacOccAttrDisplayType}; 00520 enum {dataTypeEnumVal = oacOccShapeDataType}; 00521 }; 00522 00523 template<> 00524 class oaTraits<oaOccTextOverride> { 00525 public: 00526 typedef oaOccTextDisplay parentType; 00527 enum {domain = oacBlockDomain}; 00528 enum {dbType = oacDesignDBType}; 00529 enum {isMultiDomain = false}; 00530 enum {isConcrete = true}; 00531 enum {objectTypeEnumVal = oacOccTextOverrideType}; 00532 enum {dataTypeEnumVal = oacOccShapeDataType}; 00533 }; 00534 00535 template<> 00536 class oaTraits<oaOccInstPropDisplay> { 00537 public: 00538 typedef oaOccTextDisplay parentType; 00539 enum {domain = oacBlockDomain}; 00540 enum {dbType = oacDesignDBType}; 00541 enum {isMultiDomain = false}; 00542 enum {isConcrete = true}; 00543 enum {objectTypeEnumVal = oacOccInstPropDisplayType}; 00544 enum {dataTypeEnumVal = oacOccShapeDataType}; 00545 }; 00546 00547 template<> 00548 class oaTraits<oaOccInstAttrDisplay> { 00549 public: 00550 typedef oaOccTextDisplay parentType; 00551 enum {domain = oacBlockDomain}; 00552 enum {dbType = oacDesignDBType}; 00553 enum {isMultiDomain = false}; 00554 enum {isConcrete = true}; 00555 enum {objectTypeEnumVal = oacOccInstAttrDisplayType}; 00556 enum {dataTypeEnumVal = oacOccShapeDataType}; 00557 }; 00558 00559 00560 00561 END_OA_NAMESPACE 00562 00563 #endif
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.