oaSegStyle.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaSegStyle.h
00004 //
00005 // This file contains the definition for the oaSegStyle and its public
00006 // supporting classes. The oaSegStyle class implements a utility class used to
00007 // retrieve and specify the begin and end styles for an oaPathSeg. The
00008 // supporting classes include:
00009 //
00010 //  oaEndStyle
00011 //      This class implements an enumerated type representing the different
00012 //      styles the end of a path segment may have.
00013 //
00014 // *****************************************************************************
00015 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00016 // Integration Initiative, this material may not be copied, modified,
00017 // re-published, uploaded, executed, or distributed in any way, in any medium,
00018 // in whole or in part, without prior written permission from Cadence.
00019 //
00020 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00021 //                           All Rights Reserved.
00022 //
00023 //  $Author: icftcm $
00024 //  $Revision: #1 $
00025 //  $Date: 2010/08/09 $
00026 //  $State: Exp $
00027 // *****************************************************************************
00028 // *****************************************************************************
00029 
00030 
00031 
00032 #if !defined(oaSegStyle_P)
00033 #define oaSegStyle_P
00034 
00035 
00036 
00037 // *****************************************************************************
00038 // Nested includes
00039 // *****************************************************************************
00040 #include "oaDesignDBTypes.h"
00041 #include "oaPointArray.h"
00042 
00043 
00044 
00045 // *****************************************************************************
00046 // Declare and define types in the OpenAccess namespace.
00047 // *****************************************************************************
00048 BEGIN_OA_NAMESPACE
00049 
00050 
00051 
00052 // *****************************************************************************
00053 // oaEndStyleEnum
00054 // *****************************************************************************
00055 #define oavNumEndStyles     5
00056 
00057 enum oaEndStyleEnum {
00058     oacTruncateEndStyle = 0,
00059     oacExtendEndStyle   = 1,
00060     oacVariableEndStyle = 2,
00061     oacChamferEndStyle  = 3,
00062     oacCustomEndStyle   = 4
00063 };
00064 
00065 
00066 
00067 // *****************************************************************************
00068 // oaEndStyle
00069 // *****************************************************************************
00070 class OA_DESIGN_DLL_API oaEndStyle {
00071 public:
00072                             oaEndStyle(oaEndStyleEnum valueIn);
00073                             oaEndStyle(const oaString &name);
00074 
00075     const oaString          &getName() const;
00076 
00077                             operator                oaEndStyleEnum() const;
00078 
00079 private:
00080     oaEndStyleEnum          value;
00081 
00082     static const oaString   names[];
00083 };
00084 
00085 
00086 
00087 // *****************************************************************************
00088 // oaSegStyle
00089 // *****************************************************************************
00090 class OA_DESIGN_DLL_API oaSegStyle {
00091 public:
00092                             oaSegStyle();
00093                             oaSegStyle(oaDist       width,
00094                                        oaEndStyle   beginStyleIn,
00095                                        oaEndStyle   endStyleIn,
00096                                        oaDist       beginExtIn = 0,
00097                                        oaDist       endExtIn = 0);
00098                             oaSegStyle(oaEndStyle   beginStyleIn,
00099                                        oaEndStyle   endStyleIn,
00100                                        oaDist       endExtIn,
00101                                        oaDist       endLeftDiagExtIn,
00102                                        oaDist       endRightDiagExtIn,
00103                                        oaDist       endRightHalfWidthIn,
00104                                        oaDist       beginExtIn = 0);
00105                             oaSegStyle(oaEndStyle   beginStyleIn,
00106                                        oaDist       beginExtIn,
00107                                        oaDist       beginLeftDiagExtIn,
00108                                        oaDist       beginRightDiagExtIn,
00109                                        oaDist       beginRightHalfWidthIn,
00110                                        oaEndStyle   endStyleIn,
00111                                        oaDist       endExtIn = 0);
00112                             oaSegStyle(oaEndStyle   beginStyleIn,
00113                                        oaDist       beginExtIn,
00114                                        oaDist       beginLeftDiagExtIn,
00115                                        oaDist       beginRightDiagExtIn,
00116                                        oaDist       beginRightHalfWidthIn,
00117                                        oaEndStyle   endStyleIn,
00118                                        oaDist       endExtIn,
00119                                        oaDist       endLeftDiagExtIn,
00120                                        oaDist       endRightDiagExtIn,
00121                                        oaDist       endRightHalfWidthIn);
00122                             oaSegStyle(const oaSegStyle &segStyleIn);
00123 
00124     oaDist                  getWidth() const;
00125     oaEndStyle              getBeginStyle() const;
00126     oaDist                  getBeginExt() const;
00127     void                    getBeginExt(oaDist  &ext,
00128                                         oaDist  &leftDiagExt,
00129                                         oaDist  &rightDiagExt,
00130                                         oaDist  &rightHalfWidth) const;
00131     oaEndStyle              getEndStyle() const;
00132     oaDist                  getEndExt() const;
00133     void                    getEndExt(oaDist    &ext,
00134                                       oaDist    &leftDiagExt,
00135                                       oaDist    &rightDiagExt,
00136                                       oaDist    &rightHalfWidth) const;
00137 
00138     void                    setWidth(oaDist widthIn);
00139     void                    setBeginStyle(oaEndStyle    style,
00140                                           oaDist        ext = 0);
00141     void                    setBeginStyle(oaEndStyle    style,
00142                                           oaDist        ext,
00143                                           oaDist        leftDiagExt,
00144                                           oaDist        rightDiagExt,
00145                                           oaDist        rightHalfWidth);
00146     void                    setEndStyle(oaEndStyle  style,
00147                                         oaDist      ext = 0);
00148     void                    setEndStyle(oaEndStyle  style,
00149                                         oaDist      ext,
00150                                         oaDist      leftDiagExt,
00151                                         oaDist      rightDiagExt,
00152                                         oaDist      rightHalfWidth);
00153 
00154     oaBoolean               operator==(const oaSegStyle &style) const;
00155     oaBoolean               operator!=(const oaSegStyle &style) const;
00156 
00157     void                    genBoundary(oaPointArray &points) const;
00158 
00159 private:
00160     oaDist                  width;
00161     oaDist                  beginExt;
00162     oaDist                  beginLeftDiagExt;
00163     oaDist                  beginRightDiagExt;
00164     oaDist                  beginRightHalfWidth;
00165     oaDist                  endExt;
00166     oaDist                  endLeftDiagExt;
00167     oaDist                  endRightDiagExt;
00168     oaDist                  endRightHalfWidth;
00169     oaEndStyleEnum          beginStyle;
00170     oaEndStyleEnum          endStyle;
00171 };
00172 
00173 
00174 
00175 END_OA_NAMESPACE
00176 
00177 #endif

Return to top of page