00001 // ***************************************************************************** 00002 // ***************************************************************************** 00003 // oaTextDisplay.h 00004 // 00005 // This file contains the definitions for the oaTextDisplay class and its 00006 // subclasses oaPropDisplay, oaAttrDisplay, oaTextOverride, oaInstPropDisplay, 00007 // and oaInstAttrDisplay. These classes implement the various types of 00008 // textDisplay shapes. 00009 // 00010 // ***************************************************************************** 00011 // Except as specified in the OpenAccess terms of use of Cadence or Silicon 00012 // Integration Initiative, this material may not be copied, modified, 00013 // re-published, uploaded, executed, or distributed in any way, in any medium, 00014 // in whole or in part, without prior written permission from Cadence. 00015 // 00016 // Copyright 2002-2010 Cadence Design Systems, Inc. 00017 // All Rights Reserved. 00018 // 00019 // $Author: icftcm $ 00020 // $Revision: #1 $ 00021 // $Date: 2010/08/09 $ 00022 // $State: Exp $ 00023 // ***************************************************************************** 00024 // ***************************************************************************** 00025 00026 00027 00028 #if !defined(oaTextDisplay_P) 00029 #define oaTextDisplay_P 00030 00031 00032 00033 // ***************************************************************************** 00034 // Nested includes 00035 // ***************************************************************************** 00036 #include "oaProp.h" 00037 #include "oaInst.h" 00038 #include "oaText.h" 00039 00040 00041 00042 // ***************************************************************************** 00043 // Declare and define types in the OpenAccess namespace. 00044 // ***************************************************************************** 00045 BEGIN_OA_NAMESPACE 00046 00047 00048 00049 // ***************************************************************************** 00050 // oaTextDisplayFormatEnum 00051 // ***************************************************************************** 00052 #define oavNumTextDisplayFormats 3 00053 00054 enum oaTextDisplayFormatEnum { 00055 oacNameTextDisplayFormat = 0, 00056 oacValueTextDisplayFormat = 1, 00057 oacNameValueTextDisplayFormat = 2 00058 }; 00059 00060 00061 00062 // ***************************************************************************** 00063 // oaTextDisplayFormat 00064 // ***************************************************************************** 00065 class OA_DESIGN_DLL_API oaTextDisplayFormat { 00066 public: 00067 oaTextDisplayFormat(oaTextDisplayFormatEnum valueIn); 00068 oaTextDisplayFormat(const oaString &name); 00069 ~oaTextDisplayFormat(); 00070 00071 const oaString &getName() const; 00072 00073 operator oaTextDisplayFormatEnum() const; 00074 00075 private: 00076 oaTextDisplayFormatEnum value; 00077 00078 static const oaString names[]; 00079 }; 00080 00081 00082 00083 // ***************************************************************************** 00084 // oaTextDisplay 00085 // ***************************************************************************** 00086 class OA_DESIGN_DLL_API oaTextDisplay : public oaShape { 00087 public: 00088 void getOrigin(oaPoint &origin) const; 00089 oaTextAlign getAlignment() const; 00090 oaOrient getOrient() const; 00091 oaFont getFont() const; 00092 oaDist getHeight() const; 00093 oaTextDisplayFormat getFormat() const; 00094 oaBoolean hasOverbar() const; 00095 oaBoolean isVisible() const; 00096 oaBoolean isDrafting() const; 00097 void getText(oaString &text) const; 00098 00099 void setOrigin(const oaPoint &origin); 00100 void setAlignment(oaTextAlign alignment); 00101 void setOrient(oaOrient orient); 00102 void setFont(oaFont font); 00103 void setHeight(oaDist height); 00104 void setFormat(oaTextDisplayFormat format); 00105 void setOverbar(oaBoolean overbar); 00106 void setVisible(oaBoolean visible); 00107 void setDrafting(oaBoolean drafting); 00108 00109 static oaTextDisplayCollection getTextDisplays(const oaObject *object); 00110 }; 00111 00112 00113 00114 // ***************************************************************************** 00115 // oaPropDisplay 00116 // ***************************************************************************** 00117 class OA_DESIGN_DLL_API oaPropDisplay : public oaTextDisplay { 00118 public: 00119 static oaPropDisplay *create(oaProp *prop, 00120 oaLayerNum layerNum, 00121 oaPurposeNum purposeNum, 00122 const oaPoint &origin, 00123 oaTextAlign alignment, 00124 oaOrient orient, 00125 oaFont font, 00126 oaDist height, 00127 oaTextDisplayFormat format 00128 = oacNameTextDisplayFormat, 00129 oaBoolean overbar = false, 00130 oaBoolean visible = true, 00131 oaBoolean drafting = true); 00132 00133 oaProp *getProp() const; 00134 }; 00135 00136 00137 00138 // ***************************************************************************** 00139 // oaAttrDisplay 00140 // ***************************************************************************** 00141 class OA_DESIGN_DLL_API oaAttrDisplay : public oaTextDisplay { 00142 public: 00143 static oaAttrDisplay *create(oaObject *object, 00144 oaAttrType attribute, 00145 oaLayerNum layerNum, 00146 oaPurposeNum purposeNum, 00147 const oaPoint &origin, 00148 oaTextAlign alignment, 00149 oaOrient orient, 00150 oaFont font, 00151 oaDist height, 00152 oaTextDisplayFormat format 00153 = oacNameTextDisplayFormat, 00154 oaBoolean overbar = false, 00155 oaBoolean visible = true, 00156 oaBoolean drafting = true); 00157 00158 void getText(const oaNameSpace &ns, 00159 oaString &text) const; 00160 oaObject *getObject() const; 00161 oaAttrType getAttribute() const; 00162 00163 void setObject(oaObject *object); 00164 }; 00165 00166 00167 00168 // ***************************************************************************** 00169 // oaTextOverride 00170 // ***************************************************************************** 00171 class OA_DESIGN_DLL_API oaTextOverride : public oaTextDisplay { 00172 public: 00173 static oaTextOverride *create(oaText *masterText, 00174 oaInst *inst, 00175 oaLayerNum layerNum, 00176 oaPurposeNum purposeNum, 00177 const oaPoint &origin, 00178 oaTextAlign alignment, 00179 oaOrient orient, 00180 oaFont font, 00181 oaDist height, 00182 oaTextDisplayFormat format 00183 = oacNameTextDisplayFormat, 00184 oaBoolean overbar = false, 00185 oaBoolean visible = true, 00186 oaBoolean drafting = true); 00187 00188 oaText *getMasterText() const; 00189 void getMasterTextText(oaString &text) const; 00190 oaInst *getInst() const; 00191 00192 oaBoolean isBound() const; 00193 }; 00194 00195 00196 00197 // ***************************************************************************** 00198 // oaInstPropDisplay 00199 // ***************************************************************************** 00200 class OA_DESIGN_DLL_API oaInstPropDisplay : public oaTextDisplay { 00201 public: 00202 static oaInstPropDisplay 00203 *create(oaInst *inst, 00204 oaProp *masterProp, 00205 oaLayerNum layerNum, 00206 oaPurposeNum purposeNum, 00207 const oaPoint &origin, 00208 oaTextAlign alignment, 00209 oaOrient orient, 00210 oaFont font, 00211 oaDist height, 00212 oaTextDisplayFormat format 00213 = oacNameTextDisplayFormat, 00214 oaBoolean overbar = false, 00215 oaBoolean visible = true, 00216 oaBoolean drafting = true); 00217 00218 oaProp *getMasterProp() const; 00219 oaInst *getInst() const; 00220 00221 oaBoolean isBound() const; 00222 }; 00223 00224 00225 00226 // ***************************************************************************** 00227 // oaInstAttrDisplay 00228 // ***************************************************************************** 00229 class OA_DESIGN_DLL_API oaInstAttrDisplay : public oaTextDisplay { 00230 public: 00231 static oaInstAttrDisplay 00232 *create(oaInst *inst, 00233 oaDesignAttrType masterAttribute, 00234 oaLayerNum layerNum, 00235 oaPurposeNum purposeNum, 00236 const oaPoint &origin, 00237 oaTextAlign alignment, 00238 oaOrient orient, 00239 oaFont font, 00240 oaDist height, 00241 oaTextDisplayFormat format 00242 = oacNameTextDisplayFormat, 00243 oaBoolean overbar = false, 00244 oaBoolean visible = true, 00245 oaBoolean drafting = true); 00246 00247 void getText(const oaNameSpace &ns, 00248 oaString &text) const; 00249 oaInst *getInst() const; 00250 oaDesignAttrType getMasterAttribute() const; 00251 00252 oaBoolean isBound() const; 00253 }; 00254 00255 00256 00257 00258 // ***************************************************************************** 00259 // oaTextDisplayIterState 00260 // ***************************************************************************** 00261 class OA_DESIGN_DLL_API oaTextDisplayIterState { 00262 public: 00263 oaTextDisplayIterState(const oaObject *objIn); 00264 00265 00266 virtual oaTextDisplay *getNext() = 0; 00267 virtual void reset() = 0; 00268 virtual oaTextDisplayIterState *copy() = 0; 00269 00270 protected: 00271 const oaObject *object; 00272 00273 friend class oaTextDisplayIter; 00274 }; 00275 00276 00277 00278 // ***************************************************************************** 00279 // oaTextDisplayIter 00280 // ***************************************************************************** 00281 class OA_DESIGN_DLL_API oaTextDisplayIter { 00282 public: 00283 oaTextDisplayIter(oaTextDisplayIterState *sub); 00284 oaTextDisplayIter(oaTextDisplayIter &iterIn); 00285 00286 oaTextDisplayIter &operator=(const oaTextDisplayIter 00287 &iterIn); 00288 00289 ~oaTextDisplayIter(); 00290 00291 oaTextDisplay *getNext(); 00292 void reset(); 00293 00294 protected: 00295 oaTextDisplayIterState *state; 00296 }; 00297 00298 00299 00300 // ***************************************************************************** 00301 // oaTextDisplayCollection 00302 // ***************************************************************************** 00303 class OA_DESIGN_DLL_API oaTextDisplayCollection { 00304 public: 00305 oaTextDisplayCollection(const oaObject *objIn); 00306 00307 operator oaTextDisplayIterState *(); 00308 00309 oaUInt4 getCount(); 00310 oaBoolean isEmpty(); 00311 oaBoolean includes(const oaTextDisplay *td); 00312 00313 protected: 00314 const oaObject *object; 00315 }; 00316 00317 00318 00319 // ***************************************************************************** 00320 // Design Traits. 00321 // ***************************************************************************** 00322 template<> 00323 class oaTraits<oaTextDisplay> { 00324 public: 00325 typedef oaShapeModTypeEnum modTypeType; 00326 typedef oaShape parentType; 00327 enum {dtIndex = oacShapeDataType}; 00328 enum {dataTypeEnumVal = oacShapeDataType}; 00329 enum {domain = oacBlockDomain}; 00330 enum {dbType = oacDesignDBType}; 00331 enum {isMultiDomain = false}; 00332 enum {isConcrete = false}; 00333 enum {abstractTypeEnumVal = oacTextDisplayType}; 00334 }; 00335 00336 template<> 00337 class oaTraits<oaPropDisplay> { 00338 public: 00339 typedef oaShapeModTypeEnum modTypeType; 00340 typedef oaTextDisplay parentType; 00341 enum {dtIndex = oacShapeDataType}; 00342 enum {dataTypeEnumVal = oacShapeDataType}; 00343 enum {domain = oacBlockDomain}; 00344 enum {dbType = oacDesignDBType}; 00345 enum {isMultiDomain = false}; 00346 enum {isConcrete = true}; 00347 enum {objectTypeEnumVal = oacPropDisplayType}; 00348 }; 00349 00350 template<> 00351 class oaTraits<oaAttrDisplay> { 00352 public: 00353 typedef oaShapeModTypeEnum modTypeType; 00354 typedef oaTextDisplay parentType; 00355 enum {dtIndex = oacShapeDataType}; 00356 enum {dataTypeEnumVal = oacShapeDataType}; 00357 enum {domain = oacBlockDomain}; 00358 enum {dbType = oacDesignDBType}; 00359 enum {isMultiDomain = false}; 00360 enum {isConcrete = true}; 00361 enum {objectTypeEnumVal = oacAttrDisplayType}; 00362 }; 00363 00364 template<> 00365 class oaTraits<oaTextOverride> { 00366 public: 00367 typedef oaShapeModTypeEnum modTypeType; 00368 typedef oaTextDisplay parentType; 00369 enum {dtIndex = oacShapeDataType}; 00370 enum {dataTypeEnumVal = oacShapeDataType}; 00371 enum {domain = oacBlockDomain}; 00372 enum {dbType = oacDesignDBType}; 00373 enum {isMultiDomain = false}; 00374 enum {isConcrete = true}; 00375 enum {objectTypeEnumVal = oacTextOverrideType}; 00376 }; 00377 00378 template<> 00379 class oaTraits<oaInstPropDisplay> { 00380 public: 00381 typedef oaShapeModTypeEnum modTypeType; 00382 typedef oaTextDisplay parentType; 00383 enum {dtIndex = oacShapeDataType}; 00384 enum {dataTypeEnumVal = oacShapeDataType}; 00385 enum {domain = oacBlockDomain}; 00386 enum {dbType = oacDesignDBType}; 00387 enum {isMultiDomain = false}; 00388 enum {isConcrete = true}; 00389 enum {objectTypeEnumVal = oacInstPropDisplayType}; 00390 }; 00391 00392 template<> 00393 class oaTraits<oaInstAttrDisplay> { 00394 public: 00395 typedef oaShapeModTypeEnum modTypeType; 00396 typedef oaTextDisplay parentType; 00397 enum {dtIndex = oacShapeDataType}; 00398 enum {dataTypeEnumVal = oacShapeDataType}; 00399 enum {domain = oacBlockDomain}; 00400 enum {dbType = oacDesignDBType}; 00401 enum {isMultiDomain = false}; 00402 enum {isConcrete = true}; 00403 enum {objectTypeEnumVal = oacInstAttrDisplayType}; 00404 }; 00405 00406 00407 00408 END_OA_NAMESPACE 00409 00410 #endif
Copyright © 2002 - 2010 Cadence Design Systems, Inc.
All Rights Reserved.