diff --git a/hurricane/doc/hviewer/ASIM-bigfonts.css b/hurricane/doc/hviewer/ASIM-bigfonts.css new file mode 100644 index 00000000..f8ec6823 --- /dev/null +++ b/hurricane/doc/hviewer/ASIM-bigfonts.css @@ -0,0 +1,353 @@ + + +/* + * x-----------------------------------------------------------------x + * | HTML Standart Tags | + * x-----------------------------------------------------------------x + */ + + html, body, th, td, tr, p, li, h1, h2, h3, h4, h5, h6 { + font-size: 100%; + font-family: verdana, sans-serif; + } + + body { + color: black; + background: white; + background-color: white; + background-position: top left; + background-attachment: fixed; + background-repeat: no-repeat; + margin-top: 2em; + margin-right: 10%; + margin-left: 10%; + } + + hr { + height: 1px; + border: 0; + color: #004400; + background-color: #004400; + } + + + h1, h2, h3, h4, h5, h6 { + font-family: verdana, sans-serif; + } + + h1 { text-align: center; } + h2, h3, h4, h5, h6 { text-align: left; + padding-top: 2em; + } + h1, h2, h3 { font-family: "Trebuchet MS", sans-serif; + color: #09550B; + } + h1 { font-weight: bold; font-size: 170%; } + h2 { font-weight: bold; font-size: 140%; } + h3 { font-weight: bold; font-size: 118%; } + h4 { font-weight: bold; font-size: 100%; } + h5 { font-style: italic; font-size: 100%; } + h6 { font-variant: small-caps; font-size: 100%; } + + .hide { + display: none; + color: white; + } + + + p { + margin-top: 0.6em; + margin-bottom: 0.6em; + margin-left: 0.0em; + margin-right: 0.0em; + } + + + address { + text-align: right; + font-weight: bold; + font-style: italic; + font-size: 80%; + } + + + caption { font-weight: bold } + + + blockquote { + margin-left: 4em; + margin-right: 4em; + margin-top: 0.8em; + margin-bottom: 0.8em; + font-style: italic; + color: #003300; + } + + blockquote p { + margin-bottom: 0; + } + + blockquote address { + margin: 0; + } + + + table { + border-collapse: collapse; + } + + dt, dd { margin-top: 0; margin-bottom: 0; } + dt { font-weight: bold; } + + + pre, tt, code { + font-family: "andale mono", monospace; + font-size: 100%; + white-space: pre; + } + + pre { + font-size: 80%; + border: solid; + border-width: thin; + border-color: #003300; + background-color: #EEEEEE; + padding: 0.5em; + margin-left: 2em; + margin-right: 2em + } + + tt { color: green; } + em { font-style: italic; font-weight: bold; } + strong { font-weight: bold; } + + span.textit { font-style: italic; } + span.textbf { font-weight: bold; } + + .small { font-size: 90%; } + .white { color: #FFFFFF; } + + + ul.toc { + list-style: disc; + list-style: none; + } + + + a:link img, a:visited img { border-style: none; } + a img { color: white; } + + a:link, a:active, a:visited { + color: #09550B; + text-decoration: none; + } + + a:hover, a:focus { + color: #FF9900; + text-decoration: underline; + } + + + + +/* + * x-----------------------------------------------------------------x + * | Doxygen Specific Classes | + * x-----------------------------------------------------------------x + */ + + +/* ------------------------------------------------------------------- + * Header & Footer Classes (customized top page navigation bar). + */ + + table.header { + width: 100%; + /*background-color: #EEEEEE;*/ + background-color: #CCE6CA; + } + + h1.header { + font-family: times, verdana, sans-serif; + } + + td.header { + /*width: 14%;*/ + text-align: center; + font-weight: bold; + font-family: verdana, sans-serif; + } + + table.footer { + width: 100%; + } + + td.leftFoot1, td.leftFoot2 { + text-align: left; + } + + td.rightFoot1, td.rightFoot2 { + text-align: right; + } + + td.leftFoot2 { + font-family: time; + font-weight: bold; + } + + td.rightFoot2 { + font-weight: bold; + } + + div.ah { + font-family: time; + font-size: 250%; + } + + +/* ------------------------------------------------------------------- + * Quick Index Class (top page navigation bar). + */ + + div.qindex, div.nav { + width: 100%; + /*background-color: #DADAEF;*/ + /*background-color: #eeeeff;*/ + /*background-color: #EEEEEE;*/ + background-color: #CCE6CA; + border: 1px solid #003300; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; + } + + a.qindex, a.qindex:visited, a.qindex:hover, a.qindexHL, a.el, a.elRef { + text-decoration: none; + font-weight: bold; + } + + a.qindex, a.qindex:visited { + color: #09550B; + } + + a.qindex:hover { + background-color: #ddddff; + } + + a.qindexHL, a.qindexHL:hover, a.qindexHL:visited { + background-color: #0c780c; + color: #ffffff; + border: 1px double #9295C2; + } + + a.code:link, a.code:visited, a.codeRef:link, a.codeRef:visited { + text-decoration: none; + font-weight: normal; + color: #0000ff; + } + + .indexkey { + background-color: #eeeeff; + border: 1px solid #b0b0b0; + padding: 2px 15px; + } + + .indexkey, .indexvalue { + background-color: #eeeeff; + border: 1px solid #b0b0b0; + padding: 2px 15px; + } + + .indexkey { + width: 40%; + } + + .indexvalue { + width: 80%; + } + + +/* ------------------------------------------------------------------- + * Verbatim Source Code / Examples. + */ + + pre.fragment { background-color: #EEEEEE; } + + span.keyword { color: #008000 } + span.keywordtype { color: #604020 } + span.keywordflow { color: #e08000 } + span.comment { color: #800000 } + span.preprocessor { color: #806020 } + span.stringliteral { color: #002080 } + span.charliteral { color: #008080 } + + +/* ------------------------------------------------------------------- + * Attributes Listing. + */ + + .mdTable { + /*border: 1px solid #868686;*/ + /*background-color: #DADAEF;*/ + /*background-color: #F4F4FB;*/ + border: 1px none #868686; + /*background-color: #B8E6B8;*/ + background-color: #CCE6CA; + margin-top: 25px; + } + + .mdRow { + padding: 5px 10px; + } + + /* This Mozilla/Firefox bug has been corrected from v1.5. + * .mdname1 { + * padding: 3px 0px 0px 0px; + * } + */ + + .mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + font-size: 12px; + font-style: italic; + /*background-color: #FAFAFA;*/ + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; + } + + .memItemLeft, .memItemRight, .memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #0c0c0c; + border-right-color: #0c0c0c; + border-bottom-color: #0c0c0c; + border-left-color: #0c0c0c; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + /*background-color: #DADAEF;*/ + /*background-color: #eeeeff;*/ + /*background-color: #EEEEEE;*/ + background-color: #CCE6CA; + } + + .memItemLeft { font-size: 12px; } + .memItemRight { font-size: 13px; } + .memTemplItemLeft { font-size: 12px; } + .memTemplItemRight { font-size: 13px; } + + .memTemplParams { + color: #606060; + background-color: #DADAEF; + font-size: 12px; + } + diff --git a/hurricane/doc/hviewer/ASIM.css b/hurricane/doc/hviewer/ASIM.css new file mode 100644 index 00000000..6d92a0c5 --- /dev/null +++ b/hurricane/doc/hviewer/ASIM.css @@ -0,0 +1,485 @@ + + +/* + * x-----------------------------------------------------------------x + * | HTML Standart Tags | + * x-----------------------------------------------------------------x + */ + + html, body, th, td, tr, p, li, h1, h2, h3, h4, h5, h6 { + font-size: 96%; + font-family: verdana, sans-serif; + } + + body { + color: black; + background: white; + background-color: white; + background-position: top left; + background-attachment: fixed; + background-repeat: no-repeat; + margin-top: 2em; + margin-right: 8%; + margin-left: 8%; + } + + hr { + height: 1px; + border: 0; + color: #004400; + background-color: #004400; + } + + + h1, h2, h3, h4, h5, h6 { + font-family: verdana, sans-serif; + } + + h1 { text-align: center; } + h2, h3, h4, h5, h6 { text-align: left; + padding-top: 2em; + } + h1, h2, h3 { font-family: "Trebuchet MS", sans-serif; + color: #09550B; + } + h1 { font-weight: bold; font-size: 170%; } + h2 { font-weight: bold; font-size: 140%; } + h3 { font-weight: bold; font-size: 118%; } + h4 { font-weight: bold; font-size: 100%; } + h5 { font-style: italic; font-size: 100%; } + h6 { font-variant: small-caps; font-size: 100%; } + + h2.classHierarchy { + /*border: 1px none #008500;*/ + border: 1px none #000000; + border-top-width: 2px; + border-top-style: solid; + padding-top: 1em; + } + + + .hide { + display: none; + color: white; + } + + + p { + margin-top: 0.6em; + margin-bottom: 0.6em; + margin-left: 0.0em; + margin-right: 0.0em; + } + + + address { + text-align: right; + font-weight: bold; + font-style: italic; + font-size: 80%; + } + + + caption { font-weight: bold } + + + blockquote { + margin-left: 4em; + margin-right: 4em; + margin-top: 0.8em; + margin-bottom: 0.8em; + font-style: italic; + color: #003300; + } + + blockquote p { + margin-bottom: 0; + } + + blockquote address { + margin: 0; + } + + + table { + border-collapse: collapse; + } + + dt, dd { margin-top: 0; margin-bottom: 0; } + dt { font-weight: bold; } + + + pre, tt, code { + font-family: "andale mono", monospace; + font-size: 100%; + white-space: pre; + } + + pre { + font-size: 80%; + border: dashed; + border-width: thin; + border-color: #003300; + /* + background-color: #EEEEEE; + */ + background-color: #FCFCE1; + padding: 0.5em; + margin-left: 2em; + margin-right: 2em + } + + tt { color: green; } + em { font-style: italic; + font-weight: bold; } + strong { font-weight: bold; } + + span.textit { font-style: italic; } + span.textbf { font-weight: bold; } + + .small { font-size: 90%; } + .white { color: #FFFFFF; } + + + ul.toc { + list-style: disc; + list-style: none; + } + + + a:link img, a:visited img { border-style: none; } + a img { color: white; } + + a:link, a:active, a:visited { + color: #09550B; + text-decoration: none; + } + + a:hover, a:focus { + color: #FF9900; + text-decoration: underline; + } + + + + +/* + * x-----------------------------------------------------------------x + * | Doxygen Specific Classes | + * x-----------------------------------------------------------------x + */ + + +/* ------------------------------------------------------------------- + * Header & Footer Classes (customized top page navigation bar). + */ + + h1.header { + font-size: 200%; + font-family: times, verdana, sans-serif; + } + + center.header { + background-color: #CCE6CA; + } + + table.header { + /*width: 100%;*/ + /*background-color: #EEEEEE;*/ + background-color: #CCE6CA; + } + + table.header td { + padding: 2px 14px; + text-align: center; + font-weight: bold; + font-family: verdana, sans-serif; + font-size: 110%; + } + + table.footer1, table.footer2 { width: 100%; } + td.LFooter { text-align: left; } + td.RFooter { text-align: right; } + td.CFooter { text-align: center;} + table.footer2 td.RFooter { font-weight: bold; width: 35% } + table.footer2 td.CFooter { width: 30% } + table.footer2 td.LFooter { font-weight: bold; width: 35%; font-family: time; } + + table.classHierarchy { + border-collapse: separate; + border-spacing: 5px; + font-size: 110%; + } + + table.classHierarchy tr { + border: 1px solid blue; + } + + table.classHierarchy td.normal { + border: 1px solid #CCE6CA; + width: 140pt; + text-align: center; + font-weight: bold; + background-color: #CCE6CA; + } + + table.classHierarchy td.virtual { + border: 1px solid black; + width: 140pt; + text-align: center; + font-weight: bold; + } + + table.classHierarchy td.wnormal { + border: 1px solid #CCE6CA; + width: 240pt; + text-align: center; + font-weight: bold; + background-color: #CCE6CA; + } + + table.classHierarchy td.wvirtual { + border: 1px solid black; + width: 240pt; + text-align: center; + font-weight: bold; + } + + div.ah { + font-family: time; + font-size: 250%; + } + + +/* ------------------------------------------------------------------- + * Quick Index Class (top page navigation bar). + */ + + div.qindex, div.nav { + width: 100%-4px; + /*background-color: #DADAEF;*/ + /*background-color: #eeeeff;*/ + /*background-color: #EEEEEE;*/ + background-color: #CCE6CA; + border: 0px solid #003300; + text-align: center; + margin: 0px; + padding: 2px; + line-height: 140%; + } + + a.qindex, a.qindex:visited, a.qindex:hover, a.qindexHL, a.el, a.elRef { + text-decoration: none; + font-weight: bold; + } + + a.qindex, a.qindex:visited { + color: #09550B; + } + + a.qindex:hover { + background-color: #ddddff; + } + + a.qindexHL, a.qindexHL:hover, a.qindexHL:visited { + background-color: #0c780c; + color: #ffffff; + border: 1px double #9295C2; + } + + a.code:link, a.code:visited, a.codeRef:link, a.codeRef:visited { + text-decoration: none; + font-weight: normal; + color: #0000ff; + } + + .indexkey { + background-color: #eeeeff; + border: 1px solid #b0b0b0; + padding: 2px 15px; + } + + .indexkey, .indexvalue { + background-color: #eeeeff; + border: 1px solid #b0b0b0; + padding: 2px 15px; + } + + .indexkey { + width: 40%; + } + + .indexvalue { + width: 80%; + } + + h3 a[name="index__"], + h3 a[name="index_a"], + h3 a[name="index_b"], + h3 a[name="index_c"], + h3 a[name="index_d"], + h3 a[name="index_e"], + h3 a[name="index_f"], + h3 a[name="index_g"], + h3 a[name="index_h"], + h3 a[name="index_i"], + h3 a[name="index_j"], + h3 a[name="index_k"], + h3 a[name="index_l"], + h3 a[name="index_m"], + h3 a[name="index_n"], + h3 a[name="index_o"], + h3 a[name="index_p"], + h3 a[name="index_q"], + h3 a[name="index_r"], + h3 a[name="index_s"], + h3 a[name="index_t"], + h3 a[name="index_u"], + h3 a[name="index_v"], + h3 a[name="index_w"], + h3 a[name="index_x"], + h3 a[name="index_y"], + h3 a[name="index_z"], + h3 a[name="index_0"], + h3 a[name="index_1"], + h3 a[name="index_2"], + h3 a[name="index_3"], + h3 a[name="index_4"], + h3 a[name="index_5"], + h3 a[name="index_6"], + h3 a[name="index_7"], + h3 a[name="index_8"], + h3 a[name="index_9"] + { + font-family: time; + font-size: 250%; + } + + +/* ------------------------------------------------------------------- + * Verbatim Source Code / Examples. + */ + + /* pre.fragment { background-color: #EEEEEE; } */ + + span.keyword { color: #008000 } + span.keywordtype { color: #604020 } + span.keywordflow { color: #e08000 } + span.comment { color: #800000 } + span.preprocessor { color: #806020 } + span.stringliteral { color: #002080 } + span.charliteral { color: #008080 } + + +/* ------------------------------------------------------------------- + * Attributes Listing. + */ + + .mdTable { + /*border: 1px solid #868686;*/ + /*background-color: #DADAEF;*/ + /*background-color: #F4F4FB;*/ + border: 1px none #008500; + border-left-width: 1px; + border-left-style: solid; + /*background-color: #B8E6B8;*/ + /*background-color: #CCE6CA;*/ + margin-top: 25px; + font-size: 105%; + } + + .mdRow { + padding: 5px 10px; + } + + /* This Mozilla/Firefox bug has been corrected from v1.5. + * .mdname1 { + * padding: 3px 0px 0px 0px; + * } + */ + + .mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + font-size: 11px; + font-style: italic; + /*background-color: #FAFAFA;*/ + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; + } + + .memitem { + margin-bottom: 30px; + border: 1px none #008500; + } + + .memproto { + background-color: #CCE6CA; + border-left-width: 4px; + border-left-style: solid; + border-color: #008500; + } + + .memname { + white-space: nowrap; + padding-left: 5px; + font-size: 105%; + } + + + .memdoc{ + padding-left: 5px; + /*margin-top: -8px;*/ + border-left-width: 1px; + border-left-style: solid; + border-color: #008500; + } + + .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #0c0c0c; + border-right-color: #0c0c0c; + border-bottom-color: #0c0c0c; + border-left-color: #0c0c0c; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + /*background-color: #DADAEF;*/ + /*background-color: #eeeeff;*/ + /*background-color: #EEEEEE;*/ + background-color: #CCE6CA; + } + + .memTemplItemLeft, .memTemplItemRight { + border-bottom-width: 2px; + border-bottom-style: solid; + font-weight: bold; + } + + .memItemLeft { font-size: 11px; } + .memItemRight { font-size: 12px; } + .memTemplItemLeft { font-size: 11px; } + .memTemplItemRight { font-size: 12px; } + + .memTemplParams { + color: #FFFFFF; + background-color: #000000; + font-size: 11px; + font-weight: bold; + } + + .groupText, .groupHeader { + color: #09550B; + margin-top: 15px; + font-size: 130%; + font-weight: bold; + } + diff --git a/hurricane/doc/hviewer/CMakeLists.txt b/hurricane/doc/hviewer/CMakeLists.txt new file mode 100644 index 00000000..f7041eaa --- /dev/null +++ b/hurricane/doc/hviewer/CMakeLists.txt @@ -0,0 +1,11 @@ + + set ( htmlInstallDir /share/doc/en/html/hviewer ) + set ( latexInstallDir /share/doc/en/latex/hviewer ) + + add_custom_target ( doc ALL cd ${HURRICANE_SOURCE_DIR}/doc/hviewer && ${DOXYGEN_EXECUTABLE} doxyfile ) + + install ( DIRECTORY html/ DESTINATION ${htmlInstallDir} ) + install ( FILES customSummary.html DESTINATION ${htmlInstallDir} ) + + install ( DIRECTORY latex/ DESTINATION ${latexInstallDir} ) + install ( FILES asimbook.cls DESTINATION ${latexInstallDir} ) diff --git a/hurricane/doc/hviewer/CellViewer.dox b/hurricane/doc/hviewer/CellViewer.dox new file mode 100644 index 00000000..ffed697e --- /dev/null +++ b/hurricane/doc/hviewer/CellViewer.dox @@ -0,0 +1,24 @@ + + + // -*- C++ -*- + + + namespace Hurricane { + + /*! \class CellViewer + * \brief A simple top level window embedding the CellWidget. + */ + + + /*! \name Constructors & Destructors + */ + // \{ + + /*! \function CellViewer::CellViewer(QWidget* parent=NULL); + * Construct a CellView window no Cell is actually loaded. + */ + + // \} + + + } diff --git a/hurricane/doc/hviewer/DisplayStyle.dox b/hurricane/doc/hviewer/DisplayStyle.dox new file mode 100644 index 00000000..668ef3b4 --- /dev/null +++ b/hurricane/doc/hviewer/DisplayStyle.dox @@ -0,0 +1,108 @@ + + + // -*- C++ -*- + + + namespace Hurricane { + + /*! \class DisplayStyle + * \brief A complete set of DrawinStyles to uses with the CellWidget. + * + * For a synthetic explanation, have a look to : + * + * Except in configuration parsers that have to builds them + * DisplayStyles shoudn't be manipulated directly but used + * through the Graphics methods. + */ + + + /*! \name Constructors & Destructors + */ + // \{ + + /*! \function DisplayStyle::DisplayStyle(const Name& name); + * Construct a DisplayStyle named \e name. The DisplayStyle + * is populated with a minimal sets of DrawingStyles which + * allows it to be used straight (in CellWidget) but to the + * cost of very ugly rendering. + */ + + /*! \function DisplayStyle::~DisplayStyle(); + * The standart destructor. + */ + + // \} + + + /*! \name Accessors + */ + // \{ + + /*! \function const Name& DisplayStyle::getName() const; + * \Return The name of this DisplayStyle. + */ + + /*! \function const Name& DisplayStyle::getGroup(const Name& key) const; + * \Return The group owning the DrawingStyle of which key is \e key. + */ + + /*! \function const QColor& DisplayStyle::getColor(const Name& key) const; + * \Return The QColor associated to the DrawingStyle \e key. + */ + + /*! \function const QPen& DisplayStyle::getColor(const Name& key) const; + * \Return The QPen associated to the DrawingStyle \e key. + */ + + /*! \function const QBrush& DisplayStyle::getBrush(const Name& key) const; + * \Return The QBrush associated to the DrawingStyle \e key. + */ + + /*! \function const string& DisplayStyle::getPattern(const Name& key) const; + * \Return The pattern associated to the DrawingStyle \e key. + */ + + /*! \function const float DisplayStyle::getThreshold(const Name& key) const; + * \Return The display threshold associated to the DrawingStyle \e key. + */ + + /*! \function vector& DisplayStyle::getDrawingGroups(); + * \Return The vector of groups. + */ + + /*! \function DrawingStyle* DisplayStyle::find(const Name& key) const; + * \Return The DrawingStyle associated with key \e key. If no DrawingStyle + * matches \e key, the \e default DrawingStyle is returned. + */ + + // \} + + + /*! \name Modifiers + */ + // \{ + + /*! \function void DisplayStyle::inheritFrom(const DisplayStyle* base); + * Clone the \e base DisplayStyle into the current one. Any + * previous settings are eraseds. + * + */ + + /*! \function void DisplayStyle::addDrawingStyle(const Name& groupKey, const Name& key, const string& pattern, int red, int green, int blue, int borderWidth, float threshold); + * \param groupKey in which group to insert this DrawinStyle. + * \param key the DrawingStyle's name. + * \param pattern the stipple pattern (for the brush). + * \param red the red color component (for Brush & Pen). + * \param green the green color component (for Brush & Pen). + * \param blue the blue color component (for Brush & Pen). + * \param borderWidth the width of the drawing (for Pen). + * \param threshold the display threshold. + * + * Adds a new DrawingStyle. If any previous DrawingStyle of the same + * name was existing it is erased. + */ + + // \} + + + } diff --git a/hurricane/doc/hviewer/Graphics.dox b/hurricane/doc/hviewer/Graphics.dox new file mode 100644 index 00000000..e3e222ac --- /dev/null +++ b/hurricane/doc/hviewer/Graphics.dox @@ -0,0 +1,139 @@ + + // -*- C++ -*- + + + namespace Hurricane { + + /*! \defgroup graphicsGroup Graphics: Access to Graphical Resources. + * + * \section secGraphicsStructure General Structure of the Graphics Object + * + * First, the Graphics object is a singleton that has to be + * accessed through the static getGraphics methods. + * + * The Graphics object contains a set of DisplayStyles of which + * one is active at a time and so used to do all drawings. + * Each DisplayStyle is identified though a name and can be + * selected with the setStyle() method. + * + * The DisplayStyle itself is a set of DrawingStyle. + * Each DrawingStyle is named and provides a QColor, a QPen + * and a QBrush. QColor, QPen & QBrush are build from the + * \c (red,green,blue) , \c BorderWidth and \c pattern . + * + * Direct access to the DrawingStyle: once a DisplayStyle has + * been selected, the Graphics accessors getColor(), getPen() + * or getBrush() gives you access to the DrawingStyles. + * + * Minimal DisplayStyle: any DisplayStyle contains at least + * the following DrawingStyles : + * + * + * Configuration parsers should create a DrawingStyle for each + * BasicLayer, with the name of the BasicLayer as the key. So the + * following code should be valid : +\code + QBrush layerBrush = Graphics::getBrush ( layer->getName() ); +\endcode + * If no DrawingStyle of that name is defined, the \b Fallback + * will be used. + * + */ + + //! \addtogroup graphicsGroup + //! \{ + + /*! \class Graphics + * \brief Manage basic graphical configuration (\b API) + * + * The Graphics class is a singleton which provides a simplificated + * access to graphical resources from Qt and manages graphics + * styles used to draw all the objects from the CellWidget. + */ + + // !} + + + //! \name Accessors + // \{ + + /*! \function Graphics* Graphics::getGraphics(); + * \Return The Graphics singleton. + */ + + /*! \function const QFont Graphics::getFixedFont(int weight=-1, bool italic=false, bool underline=false); + * \param weight the font's weight (see Qt::Weight). + * \param italic select the italic variant of the font. + * \param underline the font will be underlined. + * \return A QFont, the size of the font is guessed from the system's default. + */ + + /*! \function const Name& Graphics::getGroup(const Name& key); + * \Return The group owning the DrawingStyle of which key is \e key. + */ + + /*! \function const QColor& Graphics::getColor(const Name& key); + * \Return The QColor associated to the DrawingStyle \e key. + */ + + /*! \function const QPen& Graphics::getPen(const Name& key); + * \Return The QPen associated to the DrawingStyle \e key. + */ + + /*! \function const QBrush& Graphics::getBrush(const Name& key); + * \Return The QBrush associated to the DrawingStyle \e key. + */ + + /*! \function const string& Graphics::getPattern(const Name& key); + * \Return The pattern associated to the DrawingStyle \e key. + */ + + /*! \function const float Graphics::getThreshold(const Name& key); + * \Return The display threshold associated to the DrawingStyle \e key. + */ + + // \} + + + //! \name Modifiers + // \{ + + /*! \function const void Graphics::addStyle(DisplayStyle* displayStyle); + * Adds a new DisplayStyle to the Graphics environment. + * The DisplayStyle contains it's name by which it can be + * accessed later. If any previous DisplayStyle of the same + * name was existing it is silently replaced. + */ + + /*! \function void Graphics::setStyle(const Name& key); + * Make the DisplayStyle whose name is \e key the currently + * used one. + */ + + /*! \function DisplayStyle* Graphics::getStyle(const Name& key); + * \Return The DisplayStyle whose name is \e key. + */ + + /*! \function DisplayStyle* Graphics::getStyle(); + * \Return The DisplayStyle which is currently in use. + */ + + // \} + + + } diff --git a/hurricane/doc/hviewer/HInspectorWidget.dox b/hurricane/doc/hviewer/HInspectorWidget.dox new file mode 100644 index 00000000..c47dcd93 --- /dev/null +++ b/hurricane/doc/hviewer/HInspectorWidget.dox @@ -0,0 +1,65 @@ + + + // -*- C++ -*- + + + namespace Hurricane { + + /*! \class HInspectorWidget + * \brief A Widget to browse through the Hurricane objetcs. + * + * \section secInspectorMM Inspector Memory Management + * + * In order to keep the memory footprint of the Inspector as + * small as possible only the currently viewed Record is allocated. + * The only exception is the root Record itself, which we must + * kept for it has not been passed as a Slot but as a Record. + * Be aware however, that the root Record is destroyed the + * moment the Inspector is, so do not uses the root Record in + * context from which the Inspector has been spawned. + * + * The history from the root Record to the deepest reached + * level of the data structure is kept in a vector of Slots. + * We choose Slot over Record because they are lightweight object. + * Slots containts only a name (usually the object's attribute + * name) and a pointer to that attribute. The Record associated + * to the attribute is generated on demand. To have a completly + * uniform history we must create a special Slot from the root + * Record, unlike others this Slot contains directly the Record + * and not the attribute pointer it has been generated from. + * + * When an Inspector windows is closed by the window manager, + * the widget is not simply hidden, it is fully destroyed + * (see the QWidget \c Qt::WA_DeleteOnClose attribute). Thus, pointers + * to an Inspector Widget are not to be kept. + * + * Any number of Inspector could be created simultanously, even + * on the same datas. Slot & Record beeing on demand, expandables, + * objects. + */ + + + //! \name Constructors & Destructors + // \{ + + /*! \function HInspectorWidget::HInspectorWidget(QWidget* parent=NULL); + * Construct a HInspectorWidget. The root Record to browse must + * be sets immediatly afterwards with the setRootRecord() + * method. + */ + + // \} + + + //! \name Modifiers + // \{ + + /*! \function void HInspectorWidget::setRootRecord(Record* record); + * Sets the root record of the Inspector. Note that the + * previous root record is freed. + */ + + // \} + + + } diff --git a/hurricane/doc/hviewer/asimbook.cls b/hurricane/doc/hviewer/asimbook.cls new file mode 100644 index 00000000..54270780 --- /dev/null +++ b/hurricane/doc/hviewer/asimbook.cls @@ -0,0 +1,798 @@ +%% +%% This is file `book.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% classes.dtx (with options: `book') +%% +%% This is a generated file. +%% +%% Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 +%% The LaTeX3 Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file was generated from file(s) of the LaTeX base system. +%% -------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.2 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% base system. You may however distribute the LaTeX base system without +%% such generated files. +%% +%% The list of all files belonging to the LaTeX base distribution is +%% given in the file `manifest.txt'. See also `legal.txt' for additional +%% information. +%% +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesClass{asimbook} + [2005/11/21 v1.0 + ASIM LaTeX document class] +\newcommand\@ptsize{} +\newif\if@restonecol +\newif\if@titlepage +\@titlepagetrue +\newif\if@openright +\newif\if@mainmatter \@mainmattertrue +\if@compatibility\else +\DeclareOption{a4paper} + {\setlength\paperheight {297mm}% + \setlength\paperwidth {210mm}} +\DeclareOption{a5paper} + {\setlength\paperheight {210mm}% + \setlength\paperwidth {148mm}} +\DeclareOption{b5paper} + {\setlength\paperheight {250mm}% + \setlength\paperwidth {176mm}} +\DeclareOption{letterpaper} + {\setlength\paperheight {11in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{legalpaper} + {\setlength\paperheight {14in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{executivepaper} + {\setlength\paperheight {10.5in}% + \setlength\paperwidth {7.25in}} +\DeclareOption{landscape} + {\setlength\@tempdima {\paperheight}% + \setlength\paperheight {\paperwidth}% + \setlength\paperwidth {\@tempdima}} +\fi +\if@compatibility + \renewcommand\@ptsize{0} +\else +\DeclareOption{10pt}{\renewcommand\@ptsize{0}} +\fi +\DeclareOption{11pt}{\renewcommand\@ptsize{1}} +\DeclareOption{12pt}{\renewcommand\@ptsize{2}} +\if@compatibility\else +\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} +\fi +\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} +\DeclareOption{draft}{\setlength\overfullrule{5pt}} +\if@compatibility\else +\DeclareOption{final}{\setlength\overfullrule{0pt}} +\fi +\DeclareOption{titlepage}{\@titlepagetrue} +\if@compatibility\else +\DeclareOption{notitlepage}{\@titlepagefalse} +\fi +\if@compatibility +\@openrighttrue +\else +\DeclareOption{openright}{\@openrighttrue} +\DeclareOption{openany}{\@openrightfalse} +\fi +\if@compatibility\else +\DeclareOption{onecolumn}{\@twocolumnfalse} +\fi +\DeclareOption{twocolumn}{\@twocolumntrue} +\DeclareOption{leqno}{\input{leqno.clo}} +\DeclareOption{fleqn}{\input{fleqn.clo}} +\DeclareOption{openbib}{% + \AtEndOfPackage{% + \renewcommand\@openbib@code{% + \advance\leftmargin\bibindent + \itemindent -\bibindent + \listparindent \itemindent + \parsep \z@ + }% + \renewcommand\newblock{\par}}% +} +\ExecuteOptions{letterpaper,10pt,twoside,onecolumn,final,openright} +\ProcessOptions +\input{bk1\@ptsize.clo} +\setlength\lineskip{1\p@} +\setlength\normallineskip{1\p@} +\renewcommand\baselinestretch{} +\setlength\parskip{0\p@ \@plus \p@} +\@lowpenalty 51 +\@medpenalty 151 +\@highpenalty 301 +\setcounter{topnumber}{2} +\renewcommand\topfraction{.7} +\setcounter{bottomnumber}{1} +\renewcommand\bottomfraction{.3} +\setcounter{totalnumber}{3} +\renewcommand\textfraction{.2} +\renewcommand\floatpagefraction{.5} +\setcounter{dbltopnumber}{2} +\renewcommand\dbltopfraction{.7} +\renewcommand\dblfloatpagefraction{.5} +%%%% Select Chapter font. +\newcommand \textchapter [1] {\textsf{\textbf{#1}}} +\newcommand \fontchapter {\sffamily \bfseries} +\if@twoside + \def\ps@headings{% + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\thepage\hfil\slshape\leftmark}% + \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\chaptermark##1{% + \markboth {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \@chapapp\ \thechapter. \ % + \fi + \fi + ##1}}{}}% + \def\sectionmark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\z@ + \thesection. \ % + \fi + ##1}}}} +\else + \def\ps@headings{% + \let\@oddfoot\@empty + \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% + \let\@mkboth\markboth + \def\chaptermark##1{% + \markright {\MakeUppercase{% + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \@chapapp\ \thechapter. \ % + \fi + \fi + ##1}}}} +\fi +\def\ps@myheadings{% + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\thepage\hfil\slshape\leftmark}% + \def\@oddhead{{\slshape\rightmark}\hfil\thepage}% + \let\@mkboth\@gobbletwo + \let\chaptermark\@gobble + \let\sectionmark\@gobble + } + \if@titlepage + \newcommand\maketitle{\begin{titlepage}% + \let\footnotesize\small + \let\footnoterule\relax + \let \footnote \thanks + \null\vfil + \vskip 60\p@ + \begin{center}% + {\LARGE \@title \par}% + \vskip 3em% + {\large + \lineskip .75em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1.5em% + {\large \@date \par}% % Set date in \large size. + \end{center}\par + \@thanks + \vfil\null + \end{titlepage}% + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax +} +\else +\newcommand\maketitle{\par + \begingroup + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% + \long\def\@makefntext##1{\parindent 1em\noindent + \hb@xt@1.8em{% + \hss\@textsuperscript{\normalfont\@thefnmark}}##1}% + \if@twocolumn + \ifnum \col@number=\@ne + \@maketitle + \else + \twocolumn[\@maketitle]% + \fi + \else + \newpage + \global\@topnum\z@ % Prevents figures from going at top of page. + \@maketitle + \fi + \thispagestyle{plain}\@thanks + \endgroup + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax +} +\def\@maketitle{% + \newpage + \null + \vskip 2em% + \begin{center}% + \let \footnote \thanks + {\LARGE \@title \par}% + \vskip 1.5em% + {\large + \lineskip .5em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1em% + {\large \@date}% + \end{center}% + \par + \vskip 1.5em} +\fi +\newcommand*\chaptermark[1]{} +\setcounter{secnumdepth}{2} +\newcounter {part} +\newcounter {chapter} +\newcounter {section}[chapter] +\newcounter {subsection}[section] +\newcounter {subsubsection}[subsection] +\newcounter {paragraph}[subsubsection] +\newcounter {subparagraph}[paragraph] +\renewcommand \thepart {\@Roman\c@part} +\renewcommand \thechapter {\@arabic\c@chapter} +\renewcommand \thesection {\thechapter.\@arabic\c@section} +\renewcommand\thesubsection {\thesection.\@arabic\c@subsection} +\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection} +\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph} +\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph} +\newcommand\@chapapp{\chaptername} +\newcommand\frontmatter{% + \cleardoublepage + \@mainmatterfalse + \pagenumbering{roman}} +\newcommand\mainmatter{% + \cleardoublepage + \@mainmattertrue + \pagenumbering{arabic}} +\newcommand\backmatter{% + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \@mainmatterfalse} +\newcommand\part{% + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \thispagestyle{plain}% + \if@twocolumn + \onecolumn + \@tempswatrue + \else + \@tempswafalse + \fi + \null\vfil + \secdef\@part\@spart} + +\def\@part[#1]#2{% + \ifnum \c@secnumdepth >-2\relax + \refstepcounter{part}% + \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi + \markboth{}{}% + {\centering + \interlinepenalty \@M + \normalfont + \ifnum \c@secnumdepth >-2\relax + \huge\bfseries \partname\nobreakspace\thepart + \par + \vskip 20\p@ + \fi + \Huge \bfseries #2\par}% + \@endpart} +\def\@spart#1{% + {\centering + \interlinepenalty \@M + \normalfont + \Huge \bfseries #1\par}% + \@endpart} +\def\@endpart{\vfil\newpage + \if@twoside + \if@openright + \null + \thispagestyle{empty}% + \newpage + \fi + \fi + \if@tempswa + \twocolumn + \fi} +\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi + \thispagestyle{plain}% + \global\@topnum\z@ + \@afterindentfalse + \secdef\@chapter\@schapter} +\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \else + \addcontentsline{toc}{chapter}{#1}% + \fi + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +%%%%\def\@makechapterhead#1{% +%%%% \vspace*{50\p@}% +%%%% {\parindent \z@ \raggedright \normalfont +%%%% \ifnum \c@secnumdepth >\m@ne +%%%% \if@mainmatter +%%%% \huge\bfseries \@chapapp\space \thechapter +%%%% \par\nobreak +%%%% \vskip 20\p@ +%%%% \fi +%%%% \fi +%%%% \interlinepenalty\@M +%%%% \Huge \bfseries #1\par\nobreak +%%%% \vskip 40\p@ +%%%% }} + \newlength \titlewidth + \setlength \titlewidth {\textwidth} + \addtolength \titlewidth {\marginparwidth} + \addtolength \titlewidth {\marginparsep} + \def\@makechapterhead#1{% + \vspace*{50\p@}% + {\parindent \z@ \raggedleft \fontchapter + \ifnum \c@secnumdepth >\m@ne + \if@mainmatter + \huge \@chapapp\space \thechapter + \par\nobreak + \vskip 20\p@ + \fi + \fi + \interlinepenalty\@M + \hsize=\titlewidth + \Huge #1 \par\nobreak + \hsize=\textwidth + \vskip 40\p@ + }} +\def\@schapter#1{\if@twocolumn + \@topnewpage[\@makeschapterhead{#1}]% + \else + \@makeschapterhead{#1}% + \@afterheading + \fi} +%%%%\def\@makeschapterhead#1{% +%%%% \vspace*{50\p@}% +%%%% {\parindent \z@ \raggedright +%%%% \normalfont +%%%% \interlinepenalty\@M +%%%% \Huge \bfseries #1\par\nobreak +%%%% \vskip 40\p@ +%%%% }} + \def\@makeschapterhead#1{% + \vspace*{50\p@}% + {\parindent \z@ \raggedright + \normalfont + \interlinepenalty\@M + \hsize=\titlewidth + \flushright + \Huge \bfseries #1\par\nobreak + \hsize=\textwidth + \vskip 40\p@ + }} +\newcommand\section{\@startsection {section}{1}{\z@}% + {-3.5ex \@plus -1ex \@minus -.2ex}% + {2.3ex \@plus.2ex}% + {\normalfont\Large\bfseries}} +\newcommand\subsection{\@startsection{subsection}{2}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\large\bfseries}} +\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-3.25ex\@plus -1ex \@minus -.2ex}% + {1.5ex \@plus .2ex}% + {\normalfont\normalsize\bfseries}} +\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {3.25ex \@plus1ex \@minus.2ex}% + {-1em}% + {\normalfont\normalsize\bfseries}} +\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% + {3.25ex \@plus1ex \@minus .2ex}% + {-1em}% + {\normalfont\normalsize\bfseries}} +\if@twocolumn + \setlength\leftmargini {2em} +\else + \setlength\leftmargini {2.5em} +\fi +\leftmargin \leftmargini +\setlength\leftmarginii {2.2em} +\setlength\leftmarginiii {1.87em} +\setlength\leftmarginiv {1.7em} +\if@twocolumn + \setlength\leftmarginv {.5em} + \setlength\leftmarginvi {.5em} +\else + \setlength\leftmarginv {1em} + \setlength\leftmarginvi {1em} +\fi +\setlength \labelsep {.5em} +\setlength \labelwidth{\leftmargini} +\addtolength\labelwidth{-\labelsep} +\@beginparpenalty -\@lowpenalty +\@endparpenalty -\@lowpenalty +\@itempenalty -\@lowpenalty +\renewcommand\theenumi{\@arabic\c@enumi} +\renewcommand\theenumii{\@alph\c@enumii} +\renewcommand\theenumiii{\@roman\c@enumiii} +\renewcommand\theenumiv{\@Alph\c@enumiv} +\newcommand\labelenumi{\theenumi.} +\newcommand\labelenumii{(\theenumii)} +\newcommand\labelenumiii{\theenumiii.} +\newcommand\labelenumiv{\theenumiv.} +\renewcommand\p@enumii{\theenumi} +\renewcommand\p@enumiii{\theenumi(\theenumii)} +\renewcommand\p@enumiv{\p@enumiii\theenumiii} +\newcommand\labelitemi{\textbullet} +\newcommand\labelitemii{\normalfont\bfseries \textendash} +\newcommand\labelitemiii{\textasteriskcentered} +\newcommand\labelitemiv{\textperiodcentered} +\newenvironment{description} + {\list{}{\labelwidth\z@ \itemindent-\leftmargin + \let\makelabel\descriptionlabel}} + {\endlist} +\newcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont\bfseries #1} +\newenvironment{verse} + {\let\\\@centercr + \list{}{\itemsep \z@ + \itemindent -1.5em% + \listparindent\itemindent + \rightmargin \leftmargin + \advance\leftmargin 1.5em}% + \item\relax} + {\endlist} +\newenvironment{quotation} + {\list{}{\listparindent 1.5em% + \itemindent \listparindent + \rightmargin \leftmargin + \parsep \z@ \@plus\p@}% + \item\relax} + {\endlist} +\newenvironment{quote} + {\list{}{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +\if@compatibility +\newenvironment{titlepage} + {% + \cleardoublepage + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse\newpage + \fi + \thispagestyle{empty}% + \setcounter{page}\z@ + }% + {\if@restonecol\twocolumn \else \newpage \fi + } +\else +\newenvironment{titlepage} + {% + \cleardoublepage + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse\newpage + \fi + \thispagestyle{empty}% + \setcounter{page}\@ne + }% + {\if@restonecol\twocolumn \else \newpage \fi + \if@twoside\else + \setcounter{page}\@ne + \fi + } +\fi +\newcommand\appendix{\par + \setcounter{chapter}{0}% + \setcounter{section}{0}% + \gdef\@chapapp{\appendixname}% + \gdef\thechapter{\@Alph\c@chapter}} +\setlength\arraycolsep{5\p@} +\setlength\tabcolsep{6\p@} +\setlength\arrayrulewidth{.4\p@} +\setlength\doublerulesep{2\p@} +\setlength\tabbingsep{\labelsep} +\skip\@mpfootins = \skip\footins +\setlength\fboxsep{3\p@} +\setlength\fboxrule{.4\p@} +\@addtoreset {equation}{chapter} +\renewcommand\theequation + {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation} +\newcounter{figure}[chapter] +\renewcommand \thefigure + {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure} +\def\fps@figure{tbp} +\def\ftype@figure{1} +\def\ext@figure{lof} +\def\fnum@figure{\figurename\nobreakspace\thefigure} +\newenvironment{figure} + {\@float{figure}} + {\end@float} +\newenvironment{figure*} + {\@dblfloat{figure}} + {\end@dblfloat} +\newcounter{table}[chapter] +\renewcommand \thetable + {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table} +\def\fps@table{tbp} +\def\ftype@table{2} +\def\ext@table{lot} +\def\fnum@table{\tablename\nobreakspace\thetable} +\newenvironment{table} + {\@float{table}} + {\end@float} +\newenvironment{table*} + {\@dblfloat{table}} + {\end@dblfloat} +\newlength\abovecaptionskip +\newlength\belowcaptionskip +\setlength\abovecaptionskip{10\p@} +\setlength\belowcaptionskip{0\p@} +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip + \sbox\@tempboxa{#1: #2}% + \ifdim \wd\@tempboxa >\hsize + #1: #2\par + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip} +\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} +\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} +\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} +\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} +\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} +\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} +\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal} +\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal} +\newcommand\@pnumwidth{1.55em} +\newcommand\@tocrmarg{2.55em} +\newcommand\@dotsep{4.5} +\setcounter{tocdepth}{2} +\newcommand\tableofcontents{% + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter*{\contentsname + \@mkboth{% + \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}% + \@starttoc{toc}% + \if@restonecol\twocolumn\fi + } +\newcommand*\l@part[2]{% + \ifnum \c@tocdepth >-2\relax + \addpenalty{-\@highpenalty}% + \addvspace{2.25em \@plus\p@}% + \setlength\@tempdima{3em}% + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth + {\leavevmode + \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par + \nobreak + \global\@nobreaktrue + \everypar{\global\@nobreakfalse\everypar{}}% + \endgroup + \fi} +%%%%\newcommand*\l@chapter[2]{% +%%%% \ifnum \c@tocdepth >\m@ne +%%%% \addpenalty{-\@highpenalty}% +%%%% \vskip 1.0em \@plus\p@ +%%%% \setlength\@tempdima{1.5em}% +%%%% \begingroup +%%%% \parindent \z@ \rightskip \@pnumwidth +%%%% \parfillskip -\@pnumwidth +%%%% \leavevmode \bfseries +%%%% \advance\leftskip\@tempdima +%%%% \hskip -\leftskip +%%%% #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par +%%%% \penalty\@highpenalty +%%%% \endgroup +%%%% \fi} +\newcommand\l@chapter[2]{% + \ifnum \c@tocdepth >\m@ne + \addpenalty{-\@highpenalty}% + \vskip 1.0em \@plus\p@ + \setlength\@tempdima{1.5em}% + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth + \leavevmode \fontchapter + \advance\leftskip\@tempdima + \hskip -\leftskip + #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \penalty\@highpenalty + \endgroup + \fi} +\newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}} +\newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}} +\newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}} +\newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}} +\newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}} +\newcommand\listoffigures{% + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter*{\listfigurename}% + \@mkboth{\MakeUppercase\listfigurename}% + {\MakeUppercase\listfigurename}% + \@starttoc{lof}% + \if@restonecol\twocolumn\fi + } +\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}} +\newcommand\listoftables{% + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter*{\listtablename}% + \@mkboth{% + \MakeUppercase\listtablename}% + {\MakeUppercase\listtablename}% + \@starttoc{lot}% + \if@restonecol\twocolumn\fi + } +\let\l@table\l@figure +\newdimen\bibindent +\setlength\bibindent{1.5em} +\newenvironment{thebibliography}[1] + {\chapter*{\bibname}% + \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}% + \list{\@biblabel{\@arabic\c@enumiv}}% + {\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth + \advance\leftmargin\labelsep + \@openbib@code + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv}}% + \sloppy + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000% + \sfcode`\.\@m} + {\def\@noitemerr + {\@latex@warning{Empty `thebibliography' environment}}% + \endlist} +\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em} +\let\@openbib@code\@empty +\newenvironment{theindex} + {\if@twocolumn + \@restonecolfalse + \else + \@restonecoltrue + \fi + \columnseprule \z@ + \columnsep 35\p@ + \twocolumn[\@makeschapterhead{\indexname}]% + \@mkboth{\MakeUppercase\indexname}% + {\MakeUppercase\indexname}% + \thispagestyle{plain}\parindent\z@ + \parskip\z@ \@plus .3\p@\relax + \let\item\@idxitem} + {\if@restonecol\onecolumn\else\clearpage\fi} +\newcommand\@idxitem{\par\hangindent 40\p@} +\newcommand\subitem{\@idxitem \hspace*{20\p@}} +\newcommand\subsubitem{\@idxitem \hspace*{30\p@}} +\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax} +\renewcommand\footnoterule{% + \kern-3\p@ + \hrule\@width.4\columnwidth + \kern2.6\p@} +\@addtoreset{footnote}{chapter} +\newcommand\@makefntext[1]{% + \parindent 1em% + \noindent + \hb@xt@1.8em{\hss\@makefnmark}#1} +\newcommand\contentsname{Contents} +\newcommand\listfigurename{List of Figures} +\newcommand\listtablename{List of Tables} +\newcommand\bibname{Bibliography} +\newcommand\indexname{Index} +\newcommand\figurename{Figure} +\newcommand\tablename{Table} +\newcommand\partname{Part} +\newcommand\chaptername{Chapter} +\newcommand\appendixname{Appendix} +\def\today{\ifcase\month\or + January\or February\or March\or April\or May\or June\or + July\or August\or September\or October\or November\or December\fi + \space\number\day, \number\year} +\setlength\columnsep{10\p@} +\setlength\columnseprule{0\p@} +\pagestyle{headings} +\pagenumbering{arabic} +\if@twoside +\else + \raggedbottom +\fi +\if@twocolumn + \twocolumn + \sloppy + \flushbottom +\else + \onecolumn +\fi +\endinput +%% +%% End of file `book.cls'. diff --git a/hurricane/doc/hviewer/customSummary.html b/hurricane/doc/hviewer/customSummary.html new file mode 100644 index 00000000..55a7036c --- /dev/null +++ b/hurricane/doc/hviewer/customSummary.html @@ -0,0 +1,59 @@ + + + + + + Hurricane Documentation + + +

Hurricane Documentation

+
+ + + + + + + + +
SummaryNamespaceClasses IndexClassesMember Index
+
+
+
+ + + +

Hurricane Viewer Concepts

+
+

The classical Doxygen class hierarchy could be accessed here.

+

API documentations

+ +

Implementation Documentations

+ + + +
+ + + + + +
Customized Concepts (a.k.a. modules)Return to top of page
+ + + + + +
Hurricane Viewer DocumentationCopyright © 2008-2008 LIP6/UPMC All rights reserved
+ + diff --git a/hurricane/doc/hviewer/doxyfile b/hurricane/doc/hviewer/doxyfile new file mode 100644 index 00000000..6e080ef4 --- /dev/null +++ b/hurricane/doc/hviewer/doxyfile @@ -0,0 +1,269 @@ +# Doxyfile 1.3.4 + +# -------------------------------------------------------------------- +# Project related configuration options + +PROJECT_NAME = "Hurricane Viewer" +PROJECT_NUMBER = 3.0 +OUTPUT_DIRECTORY = . +OUTPUT_LANGUAGE = English +#USE_WINDOWS_ENCODING = NO +#DOXYFILE_ENCODING = UTF-8 +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = NO +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 2 + +ALIASES = "function=\fn " \ + "important=\par Important:\n " \ + "caution=\par Caution:\n " \ + "remark=\par Remark:\n " \ + "sample=\par Sample:\n " \ + "Return=Returns: " \ + "unsigned=\c unsigned " \ + "POD=\c POD " \ + "True=\b True " \ + "true=\b true " \ + "False=\b False " \ + "false=\b false " \ + "public=\c public " \ + "protected=\c protected " \ + "private=\c private " \ + "static=\c static " \ + "virtual=\c virtual " \ + "this=\c this " \ + "VERTICAL=\b VERTICAL " \ + "HORIZONTAL=\b HORIZONTAL " \ + "NULL=\c NULL " \ + "stream=\c stream " \ + "iostream=\c iostream " \ + "stdin=\c stdin " \ + "stdout=\c stdout " \ + "stderr=\c stderr " \ + "string=\c string " \ + "vector=\c vector " \ + "list=\c list " \ + "map=\c map " \ + "set=\c set " \ + "STL=STL " +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES + +# -------------------------------------------------------------------- +# Build related configuration options + +EXTRACT_ALL = NO +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 1 +SHOW_USED_FILES = YES + +# -------------------------------------------------------------------- +# Configuration options related to warning and progress messages + +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = + +# -------------------------------------------------------------------- +# Configuration options related to the input files + +INPUT = \ + ../../src/hviewer/hurricane/viewer/Graphics.h \ + Graphics.dox \ + ../../src/hviewer/hurricane/viewer/DisplayStyle.h \ + DisplayStyle.dox \ + ../../src/hviewer/hurricane/viewer/CellWidget.h \ + ../../src/hviewer/hurricane/viewer/CellViewer.h \ + CellViewer.dox \ + ../../src/hviewer/hurricane/viewer/HInspectorWidget.h \ + HInspectorWidget.dox + + +FILE_PATTERNS = *.h \ + *.cpp \ + *.dox + +RECURSIVE = YES + +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = images +INPUT_FILTER = +FILTER_SOURCE_FILES = YES + +# -------------------------------------------------------------------- +# Configuration options related to source browsing + +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES + +# -------------------------------------------------------------------- +# Configuration options related to the alphabetical class index + +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 2 +IGNORE_PREFIX = + +# -------------------------------------------------------------------- +# Configuration options related to the HTML output + +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = header.html +HTML_FOOTER = footer.html +HTML_STYLESHEET = ASIM.css +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = YES +ENUM_VALUES_PER_LINE = 1 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 + +# -------------------------------------------------------------------- +# Configuration options related to the LaTeX output + +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = header.tex +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO + +# -------------------------------------------------------------------- +# Configuration options related to the RTF output + +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = + +# -------------------------------------------------------------------- +# Configuration options related to the man page output + +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO + +# -------------------------------------------------------------------- +# Configuration options related to the XML output + +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = + +# -------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output + +GENERATE_AUTOGEN_DEF = NO + +# -------------------------------------------------------------------- +# Configuration options related to the Perl module output + +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = + +# -------------------------------------------------------------------- +# Configuration options related to the preprocessor + +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = __DOXYGEN_PROCESSOR__ +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES + +# -------------------------------------------------------------------- +# Configuration::addtions related to external references + +TAGFILES = "../hurricane/html/hurricane.tag=../hurricane" +GENERATE_TAGFILE = html/hviewer.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl + +# -------------------------------------------------------------------- +# Configuration options related to the dot tool + +CLASS_DIAGRAMS = NO +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = NO +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = NO +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +#MAX_DOT_GRAPH_WIDTH = 512 +#MAX_DOT_GRAPH_HEIGHT = 1024 +#MAX_DOT_GRAPH_DEPTH = 0 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES + +# -------------------------------------------------------------------- +# Configuration::addtions related to the search engine + +SEARCHENGINE = NO diff --git a/hurricane/doc/hviewer/footer.html b/hurricane/doc/hviewer/footer.html new file mode 100644 index 00000000..a52c62f6 --- /dev/null +++ b/hurricane/doc/hviewer/footer.html @@ -0,0 +1,16 @@ +
+
+ + + + + +
Generated by doxygen $doxygenversion on $dateReturn to top of page
+ + + + + +
Hurricane Viewer DocumentationCopyright © 2008-2008 LIP6/UPMC All rights reserved
+ + diff --git a/hurricane/doc/hviewer/header.html b/hurricane/doc/hviewer/header.html new file mode 100644 index 00000000..70e9e997 --- /dev/null +++ b/hurricane/doc/hviewer/header.html @@ -0,0 +1,22 @@ + + + + + Hurricane Viewer Documentation + + +

Hurricane Viewer Documentation

+
+ + + + + + + + +
SummaryNamespaceClassesClasses IndexMember Index
+
+
+
+ diff --git a/hurricane/doc/hviewer/header.tex b/hurricane/doc/hviewer/header.tex new file mode 100644 index 00000000..ec779312 --- /dev/null +++ b/hurricane/doc/hviewer/header.tex @@ -0,0 +1,47 @@ + + + \documentclass[a4paper]{asimbook} + + \usepackage{a4wide} + \usepackage{makeidx} + \usepackage{fancyhdr} + \usepackage{graphicx} + \usepackage{multicol} + \usepackage{float} + \usepackage{textcomp} + \usepackage{alltt} + \usepackage{times} + \ifx\pdfoutput\undefined + \usepackage[ps2pdf,pagebackref=true,colorlinks=true,linkcolor=blue]{hyperref} + \usepackage{pspicture} + \else + \usepackage[pdftex,pagebackref=true,colorlinks=true,linkcolor=blue]{hyperref} + \fi + \usepackage{doxygen} + + \makeindex + \setcounter{tocdepth}{1} + \renewcommand{\footrulewidth}{0.4pt} + \raggedbottom + + + \begin{document} + + \begin{titlepage} + \vspace*{7cm} + \begin{center} + {\Large $projectname Reference Manual\\[1ex]\large $projectnumber }\\ + \vspace*{1cm} + {\large Generated by Doxygen $doxygenversion}\\ + \vspace*{0.5cm} + {\small $datetime}\\ + \end{center} + \end{titlepage} + + \clearemptydoublepage + \pagenumbering{roman} + + \tableofcontents + \clearemptydoublepage + + \pagenumbering{arabic} diff --git a/hurricane/src/hurricane/DbU.cpp b/hurricane/src/hurricane/DbU.cpp index 6096c280..62eb0c02 100644 --- a/hurricane/src/hurricane/DbU.cpp +++ b/hurricane/src/hurricane/DbU.cpp @@ -39,6 +39,7 @@ namespace Hurricane { double DbU::_gridsPerLambda = 10.0; double DbU::_physicalsPerGrid = 1.0; unsigned int DbU::_stringMode = DbU::Symbolic; + DbU::Unit DbU::_snapGridStep = DbU::lambda(1.0); const DbU::Unit DbU::Min = LONG_MIN; const DbU::Unit DbU::Max = LONG_MAX; @@ -106,7 +107,7 @@ namespace Hurricane { _resolution = 1; while ( precision-- ) _resolution /= 10; - //setGridStep(getUnit(1)); + setSnapGridStep ( DbU::lambda(1) ); } @@ -149,6 +150,8 @@ namespace Hurricane { ); _gridsPerLambda = gridsPerLambda; + + setSnapGridStep ( DbU::lambda(1) ); } @@ -156,8 +159,25 @@ namespace Hurricane { { return _gridsPerLambda; } + DbU::Unit DbU::getSnapGridStep () + { + return _snapGridStep; + } + DbU::Unit DbU::getOnSnapGrid ( DbU::Unit u, SnapMode mode ) + { + DbU::Unit inferior = ( u / _snapGridStep ) * _snapGridStep; + DbU::Unit modulo = u % _snapGridStep; + + if ( !modulo ) return u; + + if ( mode == Inferior ) { return inferior; } + else if ( mode == Superior ) { return inferior + _snapGridStep; } + + return inferior + ( (modulo > (_snapGridStep/2)) ? _snapGridStep : 0 ); + } + diff --git a/hurricane/src/hurricane/hurricane/DbU.h b/hurricane/src/hurricane/hurricane/DbU.h index 41c659e9..532e8008 100644 --- a/hurricane/src/hurricane/hurricane/DbU.h +++ b/hurricane/src/hurricane/hurricane/DbU.h @@ -53,6 +53,10 @@ namespace Hurricane { , Symbolic = 4 , SmartTruncate = 8 }; + enum SnapMode { Inferior = 1 + , Superior = 2 + , Nearest = 4 + }; public: // User to DB Converters. @@ -72,7 +76,10 @@ namespace Hurricane { // Lamba Managment. static void setGridsPerLambda ( double gridsPerLambda ); static double getGridsPerLambda (); - // Grid Managment. + // Snap Grid Managment. + static DbU::Unit getSnapGridStep (); + static DbU::Unit getOnSnapGrid ( DbU::Unit u, SnapMode mode=Nearest ); + static inline void setSnapGridStep ( DbU::Unit step ); //static void setGridStep ( const Unit& gridStep ); //static const Unit getGridStep (); //static Unit getOnGridUnit ( const DbU::Unit& unit, int s=0 ); @@ -98,17 +105,19 @@ namespace Hurricane { static double _gridsPerLambda; static double _physicalsPerGrid; static unsigned int _stringMode; + static DbU::Unit _snapGridStep; }; // Inline Functions. - inline DbU::Unit DbU::db ( long value ) { return value; } - inline DbU::Unit DbU::grid ( double value ) { return (long)rint( value/_resolution ); } - inline DbU::Unit DbU::lambda ( double value ) { return grid(value*_gridsPerLambda); } - inline long DbU::getDb ( DbU::Unit u ) { return u; } - inline double DbU::getGrid ( DbU::Unit u ) { return _resolution*(double)u; } - inline double DbU::getLambda ( DbU::Unit u ) { return getGrid(u)/_gridsPerLambda; } - inline void DbU::setStringMode ( unsigned int mode ) { _stringMode = mode; } + inline DbU::Unit DbU::db ( long value ) { return value; } + inline DbU::Unit DbU::grid ( double value ) { return (long)rint( value/_resolution ); } + inline DbU::Unit DbU::lambda ( double value ) { return grid(value*_gridsPerLambda); } + inline long DbU::getDb ( DbU::Unit u ) { return u; } + inline double DbU::getGrid ( DbU::Unit u ) { return _resolution*(double)u; } + inline double DbU::getLambda ( DbU::Unit u ) { return getGrid(u)/_gridsPerLambda; } + inline void DbU::setStringMode ( unsigned int mode ) { _stringMode = mode; } + inline void DbU::setSnapGridStep ( DbU::Unit step ) { _snapGridStep = step; } } // End of Hurricane namespace. diff --git a/hurricane/src/hviewer/CellWidget.cpp b/hurricane/src/hviewer/CellWidget.cpp index 824c1fc8..7597f49f 100644 --- a/hurricane/src/hviewer/CellWidget.cpp +++ b/hurricane/src/hviewer/CellWidget.cpp @@ -34,667 +34,696 @@ namespace Hurricane { -const int CellWidget::_stripWidth = 100; + const int CellWidget::_stripWidth = 100; -CellWidget::CellWidget ( QWidget* parent ) : QWidget(parent) - , _statusBar(NULL) - , _palette(NULL) - , _xPosition(NULL) - , _yPosition(NULL) - , _displayArea(0,0,6*_stripWidth,6*_stripWidth) - , _visibleArea(_stripWidth,_stripWidth,4*_stripWidth,4*_stripWidth) - , _scale(1.0) - , _offsetVA(_stripWidth,_stripWidth) - , _drawingBuffer(6*_stripWidth,6*_stripWidth) - , _painter() - , _lastMousePosition(0,0) - , _cell(NULL) - , _mouseGo(false) - , _showBoundaries(true) - , _redrawRectCount(0) -{ -//setBackgroundRole ( QPalette::Dark ); -//setAutoFillBackground ( false ); - setAttribute ( Qt::WA_OpaquePaintEvent ); -//setAttribute ( Qt::WA_NoSystemBackground ); -//setAttribute ( Qt::WA_PaintOnScreen ); -//setAttribute ( Qt::WA_StaticContents ); - setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding ); - setFocusPolicy ( Qt::StrongFocus ); - setMouseTracking ( true ); + CellWidget::CellWidget ( QWidget* parent ) : QWidget(parent) + , _statusBar(NULL) + , _palette(NULL) + , _xPosition(NULL) + , _yPosition(NULL) + , _displayArea(0,0,6*_stripWidth,6*_stripWidth) + , _visibleArea(_stripWidth,_stripWidth,4*_stripWidth,4*_stripWidth) + , _scale(1.0) + , _offsetVA(_stripWidth,_stripWidth) + , _drawingBuffer(6*_stripWidth,6*_stripWidth) + , _painter() + , _lastMousePosition(0,0) + , _cell(NULL) + , _mouseGo(false) + , _showBoundaries(true) + , _redrawRectCount(0) + { + //setBackgroundRole ( QPalette::Dark ); + //setAutoFillBackground ( false ); + setAttribute ( Qt::WA_OpaquePaintEvent ); + //setAttribute ( Qt::WA_NoSystemBackground ); + //setAttribute ( Qt::WA_PaintOnScreen ); + //setAttribute ( Qt::WA_StaticContents ); + setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding ); + setFocusPolicy ( Qt::StrongFocus ); + setMouseTracking ( true ); - _statusBar = new QStatusBar ( this ); + _statusBar = new QStatusBar ( this ); - _xPosition = new DynamicLabel (); - _xPosition->setStaticText ( "X:" ); - _xPosition->setDynamicText ( "0l" ); + _xPosition = new DynamicLabel (); + _xPosition->setStaticText ( "X:" ); + _xPosition->setDynamicText ( "0l" ); - _yPosition = new DynamicLabel (); - _yPosition->setStaticText ( "Y:" ); - _yPosition->setDynamicText ( "0l" ); + _yPosition = new DynamicLabel (); + _yPosition->setStaticText ( "Y:" ); + _yPosition->setDynamicText ( "0l" ); - _statusBar->addPermanentWidget ( _xPosition ); - _statusBar->addPermanentWidget ( _yPosition ); + _statusBar->addPermanentWidget ( _xPosition ); + _statusBar->addPermanentWidget ( _yPosition ); -//_mapView = new MapView ( this ); - _palette = new Palette ( this ); + //_mapView = new MapView ( this ); + _palette = new Palette ( this ); - fitToContents (); -} + fitToContents (); + } -CellWidget::~CellWidget () -{ - cerr << "CellWidget::~CellWidget()" << endl; -} + CellWidget::~CellWidget () + { + cerr << "CellWidget::~CellWidget()" << endl; + } -void CellWidget::pushCursor ( Qt::CursorShape cursor ) -{ - setCursor ( cursor ); - _cursors.push_back ( cursor ); -} + void CellWidget::pushCursor ( Qt::CursorShape cursor ) + { + setCursor ( cursor ); + _cursors.push_back ( cursor ); + } -void CellWidget::popCursor () -{ - _cursors.pop_back (); - if ( !_cursors.empty() ) - setCursor ( _cursors.back() ); - else - unsetCursor (); -} + void CellWidget::popCursor () + { + _cursors.pop_back (); + if ( !_cursors.empty() ) + setCursor ( _cursors.back() ); + else + unsetCursor (); + } -QSize CellWidget::minimumSizeHint () const -{ - return QSize(_stripWidth*4,_stripWidth*4); -} + QSize CellWidget::minimumSizeHint () const + { + return QSize(_stripWidth*4,_stripWidth*4); + } -void CellWidget::redraw ( QRect redrawArea ) -{ - _redrawRectCount = 0; + void CellWidget::redraw ( QRect redrawArea ) + { + _redrawRectCount = 0; - pushCursor ( Qt::BusyCursor ); + pushCursor ( Qt::BusyCursor ); - _painter.begin ( &_drawingBuffer ); + _painter.begin ( &_drawingBuffer ); - _painter.setPen ( Qt::NoPen ); - _painter.setBackground ( Graphics::getBrush("background") ); - _painter.setClipRect ( redrawArea ); - _painter.eraseRect ( redrawArea ); + _painter.setPen ( Qt::NoPen ); + _painter.setBackground ( Graphics::getBrush("background") ); + _painter.setClipRect ( redrawArea ); + _painter.eraseRect ( redrawArea ); - if ( _cell ) { - Box redrawBox = displayToDbuBox ( redrawArea ); + if ( _cell ) { + Box redrawBox = displayToDbuBox ( redrawArea ); - vector& paletteEntries = _palette->getEntries (); - for ( size_t i=0 ; igetName()) ); - _painter.setBrush ( Graphics::getBrush(paletteEntries[i]->getName()) ); - - if ( paletteEntries[i]->isBasicLayer() && isDrawable(paletteEntries[i]) ) { - drawCell ( _cell, paletteEntries[i]->getBasicLayer(), redrawBox, Transformation() ); - } else if ( (paletteEntries[i]->getName() == DisplayStyle::Boundaries) - && paletteEntries[i]->isChecked() ) { - drawBoundaries ( _cell, redrawBox, Transformation() ); + vector& paletteEntries = _palette->getEntries (); + for ( size_t i=0 ; igetName()) ); + _painter.setBrush ( Graphics::getBrush(paletteEntries[i]->getName()) ); + + if ( paletteEntries[i]->isBasicLayer() && isDrawable(paletteEntries[i]) ) { + drawCell ( _cell, paletteEntries[i]->getBasicLayer(), redrawBox, Transformation() ); + } else if ( (paletteEntries[i]->getName() == DisplayStyle::Boundaries) + && paletteEntries[i]->isChecked() ) { + drawBoundaries ( _cell, redrawBox, Transformation() ); + } + } + } + + _painter.end (); + + update (); + popCursor (); + + //cerr << "Redrawed rectangles: " << _redrawRectCount << endl; + } + + + void CellWidget::drawBoundaries ( const Cell* cell + , const Box& redrawArea + , const Transformation& transformation + ) + { + drawBox ( transformation.getBox(cell->getAbutmentBox()) ); + for_each_instance ( instance, cell->getInstances() ) { + drawBoundaries ( instance, redrawArea, transformation ); + end_for; + } + } + + + void CellWidget::drawBoundaries ( const Instance* instance + , const Box& redrawArea + , const Transformation& transformation + ) + { + Box masterArea = redrawArea; + Transformation masterTransformation = instance->getTransformation(); + + instance->getTransformation().getInvert().applyOn ( masterArea ); + transformation.applyOn ( masterTransformation ); + + drawBoundaries ( instance->getMasterCell(), masterArea, masterTransformation ); + } + + + bool CellWidget::isDrawable ( PaletteEntry* entry ) + { + return entry->isChecked() + && ( Graphics::getThreshold(entry->getName())/DbU::lambda(1.0) < _scale ); + } + + + void CellWidget::drawCell ( const Cell* cell + , const BasicLayer* basicLayer + , const Box& redrawArea + , const Transformation& transformation + ) + { + for_each_instance ( instance, cell->getInstancesUnder(redrawArea) ) { + drawInstance ( instance, basicLayer, redrawArea, transformation ); + end_for; + } + + for_each_slice ( slice, cell->getSlices() ) { + drawSlice ( slice, basicLayer, redrawArea, transformation ); + end_for; + } + } + + + void CellWidget::drawInstance ( const Instance* instance + , const BasicLayer* basicLayer + , const Box& redrawArea + , const Transformation& transformation + ) + { + Box masterArea = redrawArea; + Transformation masterTransformation = instance->getTransformation(); + + instance->getTransformation().getInvert().applyOn ( masterArea ); + transformation.applyOn ( masterTransformation ); + + drawCell ( instance->getMasterCell(), basicLayer, masterArea, masterTransformation ); + } + + + void CellWidget::drawSlice ( const Slice* slice + , const BasicLayer* basicLayer + , const Box& redrawArea + , const Transformation& transformation + ) + { + if ( slice->getLayer()->contains(basicLayer) ) { + if ( slice->getBoundingBox().intersect(redrawArea) ) { + for_each_go ( go, slice->getGosUnder(redrawArea) ) { + drawGo ( go, basicLayer, redrawArea, transformation ); + end_for; + } } } } - _painter.end (); - update (); - popCursor (); + void CellWidget::drawGo ( const Go* go + , const BasicLayer* basicLayer + , const Box& redrawArea + , const Transformation& transformation + ) + { + const Segment* segment = dynamic_cast(go); + if (segment) { + drawSegment ( segment, basicLayer, redrawArea, transformation ); + return; + } - //cerr << "Redrawed rectangles: " << _redrawRectCount << endl; -} + const Contact* contact = dynamic_cast(go); + if (contact) { + drawContact ( contact, basicLayer, redrawArea, transformation ); + return; + } - -void CellWidget::drawBoundaries ( const Cell* cell - , const Box& redrawArea - , const Transformation& transformation - ) -{ - drawBox ( transformation.getBox(cell->getAbutmentBox()) ); - for_each_instance ( instance, cell->getInstances() ) { - drawBoundaries ( instance, redrawArea, transformation ); - end_for; - } -} - - -void CellWidget::drawBoundaries ( const Instance* instance - , const Box& redrawArea - , const Transformation& transformation - ) -{ - Box masterArea = redrawArea; - Transformation masterTransformation = instance->getTransformation(); - - instance->getTransformation().getInvert().applyOn ( masterArea ); - transformation.applyOn ( masterTransformation ); - - drawBoundaries ( instance->getMasterCell(), masterArea, masterTransformation ); -} - - -bool CellWidget::isDrawable ( PaletteEntry* entry ) -{ - return entry->isChecked() - && ( Graphics::getThreshold(entry->getName())/DbU::lambda(1.0) < _scale ); -} - - -void CellWidget::drawCell ( const Cell* cell - , const BasicLayer* basicLayer - , const Box& redrawArea - , const Transformation& transformation - ) -{ - for_each_instance ( instance, cell->getInstancesUnder(redrawArea) ) { - drawInstance ( instance, basicLayer, redrawArea, transformation ); - end_for; + const Pad* pad = dynamic_cast(go); + if (pad) { + drawPad ( pad, basicLayer, redrawArea, transformation ); + return; + } } - for_each_slice ( slice, cell->getSlices() ) { - drawSlice ( slice, basicLayer, redrawArea, transformation ); - end_for; + + void CellWidget::drawSegment ( const Segment* segment + , const BasicLayer* basicLayer + , const Box& redrawArea + , const Transformation& transformation + ) + { + if ( 1 < dbuToDisplayLength(segment->getWidth()) ) { + drawBox ( transformation.getBox(segment->getBoundingBox(basicLayer)) ); + } else { + drawLine ( transformation.getPoint(segment->getSourcePosition()), + transformation.getPoint(segment->getTargetPosition()) ); + } } -} -void CellWidget::drawInstance ( const Instance* instance - , const BasicLayer* basicLayer - , const Box& redrawArea - , const Transformation& transformation - ) -{ - Box masterArea = redrawArea; - Transformation masterTransformation = instance->getTransformation(); + void CellWidget::drawContact ( const Contact* contact + , const BasicLayer* basicLayer + , const Box& redrawArea + , const Transformation& transformation + ) + { + drawBox ( transformation.getBox(contact->getBoundingBox(basicLayer)) ); + } - instance->getTransformation().getInvert().applyOn ( masterArea ); - transformation.applyOn ( masterTransformation ); - - drawCell ( instance->getMasterCell(), basicLayer, masterArea, masterTransformation ); -} - - -void CellWidget::drawSlice ( const Slice* slice + void CellWidget::drawPad ( const Pad* pad , const BasicLayer* basicLayer , const Box& redrawArea , const Transformation& transformation ) -{ - if ( slice->getLayer()->contains(basicLayer) ) { - if ( slice->getBoundingBox().intersect(redrawArea) ) { - for_each_go ( go, slice->getGosUnder(redrawArea) ) { - drawGo ( go, basicLayer, redrawArea, transformation ); - end_for; + { + drawBox ( transformation.getBox(pad->getBoundingBox(basicLayer)) ); + } + + + void CellWidget::drawBox ( const Box& box ) + { + _redrawRectCount++; + _painter.drawRect ( dbuToDisplayRect(box) ); + } + + + void CellWidget::drawLine ( const Point& p1, const Point& p2 ) + { + _painter.drawLine ( dbuToDisplayPoint(p1), dbuToDisplayPoint(p2) ); + } + + + void CellWidget::drawGrid () + { + cerr << "drawGrid()" << endl; + + QPainter painter ( this ); + + painter.setPen ( Graphics::getPen("grid") ); + + DbU::Unit gridStep = DbU::getSnapGridStep(); + DbU::Unit xGrid = DbU::getOnSnapGrid(_visibleArea.getXMin()); + DbU::Unit yGrid = DbU::getOnSnapGrid(_visibleArea.getYMin()); + + for ( ; yGrid < _visibleArea.getYMax() ; yGrid += gridStep ) { + for ( ; xGrid < _visibleArea.getXMax() ; xGrid += gridStep ) { + cerr << xGrid << " " << yGrid << " -> " << dbuToScreenX(xGrid) << " " << dbuToScreenY(yGrid) << endl; + painter.drawPoint ( dbuToScreenPoint(xGrid,yGrid) ); } } } -} -void CellWidget::drawGo ( const Go* go - , const BasicLayer* basicLayer - , const Box& redrawArea - , const Transformation& transformation - ) -{ - const Segment* segment = dynamic_cast(go); - if (segment) { - drawSegment ( segment, basicLayer, redrawArea, transformation ); - return; + void CellWidget::goLeft ( int dx ) + { + if ( !dx ) dx = geometry().size().width() / 4; + if ( _offsetVA.rx() - dx >= 0 ) { + _offsetVA.rx() -= dx; + update (); + } else { + shiftLeft ( dx ); + } } - const Contact* contact = dynamic_cast(go); - if (contact) { - drawContact ( contact, basicLayer, redrawArea, transformation ); - return; + + void CellWidget::goRight ( int dx ) + { + if ( !dx ) dx = geometry().size().width() / 4; + + //cerr << "CellWidget::goRight() - dx: " << dx << " (offset: " << _offsetVA.rx() << ")" << endl; + + if ( _offsetVA.rx() + dx < 2*_stripWidth ) { + _offsetVA.rx() += dx; + update (); + } else { + shiftRight ( dx ); + } } - const Pad* pad = dynamic_cast(go); - if (pad) { - drawPad ( pad, basicLayer, redrawArea, transformation ); - return; + + void CellWidget::goUp ( int dy ) + { + if ( !dy ) dy = geometry().size().height() / 4; + if ( _offsetVA.ry() - dy >= 0 ) { + _offsetVA.ry() -= dy; + update (); + } else { + shiftUp ( dy ); + } } -} -void CellWidget::drawSegment ( const Segment* segment - , const BasicLayer* basicLayer - , const Box& redrawArea - , const Transformation& transformation - ) -{ - if ( 1 < dbuToDisplayLength(segment->getWidth()) ) { - drawBox ( transformation.getBox(segment->getBoundingBox(basicLayer)) ); - } else { - drawLine ( transformation.getPoint(segment->getSourcePosition()), - transformation.getPoint(segment->getTargetPosition()) ); + void CellWidget::goDown ( int dy ) + { + if ( !dy ) dy = geometry().size().height() / 4; + if ( _offsetVA.ry() + dy < 2*_stripWidth ) { + _offsetVA.ry() += dy; + update (); + } else { + shiftDown ( dy ); + } } -} -void CellWidget::drawContact ( const Contact* contact - , const BasicLayer* basicLayer - , const Box& redrawArea - , const Transformation& transformation - ) -{ - drawBox ( transformation.getBox(contact->getBoundingBox(basicLayer)) ); -} + void CellWidget::screenReframe () + { + _offsetVA.rx() = _stripWidth; + _offsetVA.ry() = _stripWidth; -void CellWidget::drawPad ( const Pad* pad - , const BasicLayer* basicLayer - , const Box& redrawArea - , const Transformation& transformation - ) -{ - drawBox ( transformation.getBox(pad->getBoundingBox(basicLayer)) ); -} + DbU::Unit xmin = (DbU::Unit)( _visibleArea.getXMin() - ((float)_offsetVA.x()/_scale) ); + DbU::Unit xmax = (DbU::Unit)( xmin + ((float)_drawingBuffer.width()/_scale) ) ; + DbU::Unit ymax = (DbU::Unit)( _visibleArea.getYMax() + ((float)_offsetVA.y()/_scale) ); + DbU::Unit ymin = (DbU::Unit)( ymax - ((float)_drawingBuffer.height()/_scale) ) ; + _displayArea = Box ( xmin, ymin, xmax, ymax ); -void CellWidget::drawBox ( const Box& box ) -{ - _redrawRectCount++; - _painter.drawRect ( dbuToDisplayRect(box) ); -} - - -void CellWidget::drawLine ( const Point& p1, const Point& p2 ) -{ - _painter.drawLine ( dbuToDisplayPoint(p1), dbuToDisplayPoint(p2) ); -} - - -void CellWidget::goLeft ( int dx ) -{ - if ( !dx ) dx = geometry().size().width() / 4; - if ( _offsetVA.rx() - dx >= 0 ) { - _offsetVA.rx() -= dx; - update (); - } else { - shiftLeft ( dx ); - } -} - - -void CellWidget::goRight ( int dx ) -{ - if ( !dx ) dx = geometry().size().width() / 4; - -//cerr << "CellWidget::goRight() - dx: " << dx << " (offset: " << _offsetVA.rx() << ")" << endl; - - if ( _offsetVA.rx() + dx < 2*_stripWidth ) { - _offsetVA.rx() += dx; - update (); - } else { - shiftRight ( dx ); - } -} - - -void CellWidget::goUp ( int dy ) -{ - if ( !dy ) dy = geometry().size().height() / 4; - if ( _offsetVA.ry() - dy >= 0 ) { - _offsetVA.ry() -= dy; - update (); - } else { - shiftUp ( dy ); - } -} - - -void CellWidget::goDown ( int dy ) -{ - if ( !dy ) dy = geometry().size().height() / 4; - if ( _offsetVA.ry() + dy < 2*_stripWidth ) { - _offsetVA.ry() += dy; - update (); - } else { - shiftDown ( dy ); - } -} - - -void CellWidget::screenReframe () -{ - _offsetVA.rx() = _stripWidth; - _offsetVA.ry() = _stripWidth; - - DbU::Unit xmin = (DbU::Unit)( _visibleArea.getXMin() - ((float)_offsetVA.x()/_scale) ); - DbU::Unit xmax = (DbU::Unit)( xmin + ((float)_drawingBuffer.width()/_scale) ) ; - DbU::Unit ymax = (DbU::Unit)( _visibleArea.getYMax() + ((float)_offsetVA.y()/_scale) ); - DbU::Unit ymin = (DbU::Unit)( ymax - ((float)_drawingBuffer.height()/_scale) ) ; - - _displayArea = Box ( xmin, ymin, xmax, ymax ); - - redraw (); -} - - -void CellWidget::setScale ( float scale ) -{ - _scale = scale; - - Point center = _visibleArea.getCenter(); - - _visibleArea.makeEmpty (); - _visibleArea.merge ( (DbU::Unit)( center.getX() - width () / (_scale*2) ) - , (DbU::Unit)( center.getY() - height() / (_scale*2) ) - , (DbU::Unit)( center.getX() + width () / (_scale*2) ) - , (DbU::Unit)( center.getY() + height() / (_scale*2) ) - ); - -//cerr << "_visibleArea: " << _visibleArea << " (offset: " << _offsetVA.x() << ")" << endl; -//cerr << " " << center << endl; - - screenReframe (); -} - - -void CellWidget::reframe ( const Box& box ) -{ -//cerr << "CellWidget::reframe() - " << box << endl; -//cerr << " widget size := " << _drawingBuffer.width() << "x" << _drawingBuffer.height() << endl; - - int width = this->width (); - int height = this->height (); - - float scaleX = width / (float)box.getWidth (); - float scaleY = height / (float)box.getHeight(); - _scale = min ( scaleX, scaleY ); - - Point center = box.getCenter(); - - width /= 2; - height /= 2; - - _visibleArea = Box ( (DbU::Unit)( center.getX() - width / _scale ) - , (DbU::Unit)( center.getY() - height / _scale ) - , (DbU::Unit)( center.getX() + width / _scale ) - , (DbU::Unit)( center.getY() + height / _scale ) - ); - screenReframe (); - -//cerr << " _displayArea: " << _displayArea << " (offset: " << _offsetVA.x() << ")" << endl; -} - - -void CellWidget::fitToContents () -{ - if ( _cell ) reframe ( _cell->getBoundingBox() ); -} - - -void CellWidget::shiftLeft ( int dx ) -{ -//cerr << "CellWidget::shiftLeft() - " << dx << " (offset: " << _offsetVA.rx() << ")" << endl; - - int leftShift = ( 1 + ( dx - _offsetVA.rx() ) / _stripWidth ) * _stripWidth; - - _displayArea.translate ( - (DbU::Unit)( leftShift / _scale ) , 0 ); - _visibleArea.translate ( - (DbU::Unit)( leftShift / _scale ) , 0 ); - _offsetVA.rx() -= dx - leftShift; - - if ( leftShift >= _drawingBuffer.width() ) { redraw (); - } else { - //cerr << "Left Shift " << leftShift << " (offset: " << _offsetVA.rx() << ")" << endl; - _painter.begin ( &_drawingBuffer ); - _painter.drawPixmap ( leftShift, 0 - , _drawingBuffer - , 0, 0 - , _drawingBuffer.width()-leftShift, _drawingBuffer.height() - ); - _painter.end (); - - redraw ( QRect ( QPoint ( 0, 0 ) - , QSize ( leftShift, _drawingBuffer.height() )) ); } - assert ( _offsetVA.rx() >= 0 ); -} + void CellWidget::setScale ( float scale ) + { + _scale = scale; -void CellWidget::shiftRight ( int dx ) -{ -//cerr << "CellWidget::shiftRight() - " << dx << " (offset: " << _offsetVA.rx() << ")" << endl; + Point center = _visibleArea.getCenter(); - int rightShift = ( ( _offsetVA.rx() + dx ) / _stripWidth ) * _stripWidth; + _visibleArea.makeEmpty (); + _visibleArea.merge ( (DbU::Unit)( center.getX() - width () / (_scale*2) ) + , (DbU::Unit)( center.getY() - height() / (_scale*2) ) + , (DbU::Unit)( center.getX() + width () / (_scale*2) ) + , (DbU::Unit)( center.getY() + height() / (_scale*2) ) + ); - _displayArea.translate ( (DbU::Unit)( rightShift / _scale ) , 0 ); - _visibleArea.translate ( (DbU::Unit)( rightShift / _scale ) , 0 ); - _offsetVA.rx() += dx - rightShift; + //cerr << "_visibleArea: " << _visibleArea << " (offset: " << _offsetVA.x() << ")" << endl; + //cerr << " " << center << endl; -//cerr << " _displayArea: " << _displayArea << endl; - - if ( rightShift >= _drawingBuffer.width() ) { - redraw (); - } else { - //cerr << " Right Shift " << rightShift << " (offset: " << _offsetVA.rx() << ")" << endl; - _painter.begin ( &_drawingBuffer ); - _painter.drawPixmap ( 0, 0 - , _drawingBuffer - , rightShift, 0 - , _drawingBuffer.width()-rightShift, _drawingBuffer.height() - ); - _painter.end (); - - redraw ( QRect ( QPoint ( _drawingBuffer.width()-rightShift, 0 ) - , QSize ( rightShift, _drawingBuffer.height() )) ); + screenReframe (); } - assert ( _offsetVA.rx() >= 0 ); -} + void CellWidget::reframe ( const Box& box ) + { + //cerr << "CellWidget::reframe() - " << box << endl; + //cerr << " widget size := " << _drawingBuffer.width() << "x" << _drawingBuffer.height() << endl; -void CellWidget::shiftUp ( int dy ) -{ -//cerr << "CellWidget::shiftUp() - " << dy << " (offset: " << _offsetVA.ry() << ")" << endl; + int width = this->width (); + int height = this->height (); - int upShift = ( 1 + ( dy - _offsetVA.ry() ) / _stripWidth ) * _stripWidth; + float scaleX = width / (float)box.getWidth (); + float scaleY = height / (float)box.getHeight(); + _scale = min ( scaleX, scaleY ); - _displayArea.translate ( 0, (DbU::Unit)( upShift / _scale ) ); - _visibleArea.translate ( 0, (DbU::Unit)( upShift / _scale ) ); - _offsetVA.ry() -= dy - upShift; + Point center = box.getCenter(); - if ( upShift >= _drawingBuffer.height() ) { - redraw (); - } else { - //cerr << "Left Shift " << upShift << " (offset: " << _offsetVA.ry() << ")" << endl; - _painter.begin ( &_drawingBuffer ); - _painter.drawPixmap ( 0, upShift - , _drawingBuffer - , 0, 0 - , _drawingBuffer.width(), _drawingBuffer.height()-upShift - ); - _painter.end (); + width /= 2; + height /= 2; - redraw ( QRect ( QPoint ( 0, 0 ) - , QSize ( _drawingBuffer.width(), upShift )) ); + _visibleArea = Box ( (DbU::Unit)( center.getX() - width / _scale ) + , (DbU::Unit)( center.getY() - height / _scale ) + , (DbU::Unit)( center.getX() + width / _scale ) + , (DbU::Unit)( center.getY() + height / _scale ) + ); + screenReframe (); + + //cerr << " _displayArea: " << _displayArea << " (offset: " << _offsetVA.x() << ")" << endl; } - assert ( _offsetVA.ry() >= 0 ); -} - -void CellWidget::shiftDown ( int dy ) -{ -//cerr << "CellWidget::shiftDown() - " << dy << " (offset: " << _offsetVA.ry() << ")" << endl; - - int downShift = ( ( _offsetVA.ry() + dy ) / _stripWidth ) * _stripWidth; - - _displayArea.translate ( 0, - (DbU::Unit)( downShift / _scale ) ); - _visibleArea.translate ( 0, - (DbU::Unit)( downShift / _scale ) ); - _offsetVA.ry() += dy - downShift; - - if ( downShift >= _drawingBuffer.height() ) { - redraw (); - } else { - //cerr << "Right Shift " << downShift << " (offset: " << _offsetVA.ry() << ")" << endl; - _painter.begin ( &_drawingBuffer ); - _painter.drawPixmap ( 0, 0 - , _drawingBuffer - , 0, downShift - , _drawingBuffer.width(), _drawingBuffer.height()-downShift - ); - _painter.end (); - - redraw ( QRect ( QPoint ( 0, _drawingBuffer.height()-downShift ) - , QSize ( _drawingBuffer.width(), downShift )) ); + void CellWidget::fitToContents () + { + if ( _cell ) reframe ( _cell->getBoundingBox() ); } - assert ( _offsetVA.ry() >= 0 ); -} + void CellWidget::shiftLeft ( int dx ) + { + //cerr << "CellWidget::shiftLeft() - " << dx << " (offset: " << _offsetVA.rx() << ")" << endl; -void CellWidget::paintEvent ( QPaintEvent* ) -{ -//cerr << "CellWidget::paintEvent()" << endl; + int leftShift = ( 1 + ( dx - _offsetVA.rx() ) / _stripWidth ) * _stripWidth; - QPainter painter ( this ); - painter.drawPixmap ( 0, 0, _drawingBuffer, _offsetVA.rx(), _offsetVA.ry(), width(), height() ); -} + _displayArea.translate ( - (DbU::Unit)( leftShift / _scale ) , 0 ); + _visibleArea.translate ( - (DbU::Unit)( leftShift / _scale ) , 0 ); + _offsetVA.rx() -= dx - leftShift; - -void CellWidget::resizeEvent ( QResizeEvent* ) -{ - QSize uaDelta ( 0, 0 ); - QSize uaSize = geometry().size(); - - uaSize.rwidth () += 2*_stripWidth; - uaSize.rheight() += 2*_stripWidth; - - if ( uaSize.width () > _drawingBuffer.width () ) - uaDelta.rwidth () = uaSize.width () - _drawingBuffer.width (); - - if ( uaSize.height() > _drawingBuffer.height() ) - uaDelta.rheight() = uaSize.height() - _drawingBuffer.height(); - -//cerr << "New UA widget size: " << uaSize.width() << "x" << uaSize.height() << endl; - - if ( uaDelta.width() || uaDelta.height() ) { - _displayArea.inflate ( 0, 0, (DbU::Unit)(uaDelta.width()/_scale), (DbU::Unit)(uaDelta.height()/_scale) ); - _visibleArea.inflate ( 0, 0, (DbU::Unit)(uaDelta.width()/_scale), (DbU::Unit)(uaDelta.height()/_scale) ); - //cerr << "new " << _displayArea << endl; - - //cerr << "Previous buffer size: " << _drawingBuffer.width () << "x" - // << _drawingBuffer.height() << endl; - - QSize bufferSize ( ( ( uaSize.width () / _stripWidth ) + 1 ) * _stripWidth - , ( ( uaSize.height() / _stripWidth ) + 1 ) * _stripWidth ); - _drawingBuffer = QPixmap ( bufferSize ); - - //cerr << "Effective buffer resize to: " << bufferSize.width() << "x" - // << bufferSize.height() << endl; - } - redraw (); -} - - -void CellWidget::keyPressEvent ( QKeyEvent* event ) -{ - switch ( event->key() ) { - case Qt::Key_Up: goUp (); break; - case Qt::Key_Down: goDown (); break; - case Qt::Key_Left: goLeft (); break; - case Qt::Key_Right: goRight (); break; - case Qt::Key_Z: setScale ( _scale*2.0 ); break; - case Qt::Key_M: setScale ( _scale/2.0 ); break; - } -} - - -void CellWidget::mouseMoveEvent ( QMouseEvent* event ) -{ - if ( _mouseGo ) { - int dx = event->x() - _lastMousePosition.x(); - dx <<= 1; - //cerr << "dX (px): " << dx << " _offsetVA.rx() " << _offsetVA.rx() << endl; - if ( dx > 0 ) goLeft ( dx ); - if ( dx < 0 ) goRight ( -dx ); - - int dy = event->y() - _lastMousePosition.y(); - dy <<= 1; - //cerr << "dY (px): " << dy << " _offsetVA.ry() " << _offsetVA.ry() << endl; - if ( dy > 0 ) goUp ( dy ); - if ( dy < 0 ) goDown ( -dy ); - - _lastMousePosition = event->pos(); - } else { - //cerr << "x:" << event->x() << " y:" << event->y() << endl; - _xPosition->setDynamicText ( screenToDbuX(event->x()) ); - _yPosition->setDynamicText ( screenToDbuY(event->y()) ); - } -} - - -void CellWidget::mousePressEvent ( QMouseEvent* event ) -{ - if ( ( event->button() == Qt::LeftButton ) && !_mouseGo ) { - _mouseGo = true; - _lastMousePosition = event->pos(); - pushCursor ( Qt::ClosedHandCursor ); - } -} - - -void CellWidget::mouseReleaseEvent ( QMouseEvent* event ) -{ - if ( ( event->button() == Qt::LeftButton ) && _mouseGo ) { - _mouseGo = false; - popCursor (); - } -} - - -QPoint CellWidget::dbuToDisplayPoint ( DbU::Unit x, DbU::Unit y ) const -{ - return QPoint ( dbuToDisplayX(x), dbuToDisplayY(y) ); -} - - -QPoint CellWidget::dbuToDisplayPoint ( const Point& point ) const -{ - return dbuToDisplayPoint ( point.getX(), point.getY() ); -} - - -QRect CellWidget::dbuToDisplayRect ( DbU::Unit x1, DbU::Unit y1, DbU::Unit x2, DbU::Unit y2 ) const -{ - return QRect ( dbuToDisplayX(x1) - , dbuToDisplayY(y2) - , dbuToDisplayX(x2) - dbuToDisplayX(x1) - , dbuToDisplayY(y1) - dbuToDisplayY(y2) - ); -} - - -QRect CellWidget::dbuToDisplayRect ( const Box& box ) const -{ - return dbuToDisplayRect ( box.getXMin() - , box.getYMin() - , box.getXMax() - , box.getYMax() + if ( leftShift >= _drawingBuffer.width() ) { + redraw (); + } else { + //cerr << "Left Shift " << leftShift << " (offset: " << _offsetVA.rx() << ")" << endl; + _painter.begin ( &_drawingBuffer ); + _painter.drawPixmap ( leftShift, 0 + , _drawingBuffer + , 0, 0 + , _drawingBuffer.width()-leftShift, _drawingBuffer.height() ); -} + _painter.end (); + + redraw ( QRect ( QPoint ( 0, 0 ) + , QSize ( leftShift, _drawingBuffer.height() )) ); + } + + assert ( _offsetVA.rx() >= 0 ); + } -void CellWidget::setShowBoundaries ( bool state ) -{ - if ( _showBoundaries != state ) { - _showBoundaries = state; + void CellWidget::shiftRight ( int dx ) + { + //cerr << "CellWidget::shiftRight() - " << dx << " (offset: " << _offsetVA.rx() << ")" << endl; + + int rightShift = ( ( _offsetVA.rx() + dx ) / _stripWidth ) * _stripWidth; + + _displayArea.translate ( (DbU::Unit)( rightShift / _scale ) , 0 ); + _visibleArea.translate ( (DbU::Unit)( rightShift / _scale ) , 0 ); + _offsetVA.rx() += dx - rightShift; + + //cerr << " _displayArea: " << _displayArea << endl; + + if ( rightShift >= _drawingBuffer.width() ) { + redraw (); + } else { + //cerr << " Right Shift " << rightShift << " (offset: " << _offsetVA.rx() << ")" << endl; + _painter.begin ( &_drawingBuffer ); + _painter.drawPixmap ( 0, 0 + , _drawingBuffer + , rightShift, 0 + , _drawingBuffer.width()-rightShift, _drawingBuffer.height() + ); + _painter.end (); + + redraw ( QRect ( QPoint ( _drawingBuffer.width()-rightShift, 0 ) + , QSize ( rightShift, _drawingBuffer.height() )) ); + } + + assert ( _offsetVA.rx() >= 0 ); + } + + + void CellWidget::shiftUp ( int dy ) + { + //cerr << "CellWidget::shiftUp() - " << dy << " (offset: " << _offsetVA.ry() << ")" << endl; + + int upShift = ( 1 + ( dy - _offsetVA.ry() ) / _stripWidth ) * _stripWidth; + + _displayArea.translate ( 0, (DbU::Unit)( upShift / _scale ) ); + _visibleArea.translate ( 0, (DbU::Unit)( upShift / _scale ) ); + _offsetVA.ry() -= dy - upShift; + + if ( upShift >= _drawingBuffer.height() ) { + redraw (); + } else { + //cerr << "Left Shift " << upShift << " (offset: " << _offsetVA.ry() << ")" << endl; + _painter.begin ( &_drawingBuffer ); + _painter.drawPixmap ( 0, upShift + , _drawingBuffer + , 0, 0 + , _drawingBuffer.width(), _drawingBuffer.height()-upShift + ); + _painter.end (); + + redraw ( QRect ( QPoint ( 0, 0 ) + , QSize ( _drawingBuffer.width(), upShift )) ); + } + + assert ( _offsetVA.ry() >= 0 ); + } + + + void CellWidget::shiftDown ( int dy ) + { + //cerr << "CellWidget::shiftDown() - " << dy << " (offset: " << _offsetVA.ry() << ")" << endl; + + int downShift = ( ( _offsetVA.ry() + dy ) / _stripWidth ) * _stripWidth; + + _displayArea.translate ( 0, - (DbU::Unit)( downShift / _scale ) ); + _visibleArea.translate ( 0, - (DbU::Unit)( downShift / _scale ) ); + _offsetVA.ry() += dy - downShift; + + if ( downShift >= _drawingBuffer.height() ) { + redraw (); + } else { + //cerr << "Right Shift " << downShift << " (offset: " << _offsetVA.ry() << ")" << endl; + _painter.begin ( &_drawingBuffer ); + _painter.drawPixmap ( 0, 0 + , _drawingBuffer + , 0, downShift + , _drawingBuffer.width(), _drawingBuffer.height()-downShift + ); + _painter.end (); + + redraw ( QRect ( QPoint ( 0, _drawingBuffer.height()-downShift ) + , QSize ( _drawingBuffer.width(), downShift )) ); + } + + assert ( _offsetVA.ry() >= 0 ); + } + + + void CellWidget::paintEvent ( QPaintEvent* ) + { + //cerr << "CellWidget::paintEvent()" << endl; + + QPainter painter ( this ); + painter.drawPixmap ( 0, 0, _drawingBuffer, _offsetVA.rx(), _offsetVA.ry(), width(), height() ); + + drawGrid (); + } + + + void CellWidget::resizeEvent ( QResizeEvent* ) + { + QSize uaDelta ( 0, 0 ); + QSize uaSize = geometry().size(); + + uaSize.rwidth () += 2*_stripWidth; + uaSize.rheight() += 2*_stripWidth; + + if ( uaSize.width () > _drawingBuffer.width () ) + uaDelta.rwidth () = uaSize.width () - _drawingBuffer.width (); + + if ( uaSize.height() > _drawingBuffer.height() ) + uaDelta.rheight() = uaSize.height() - _drawingBuffer.height(); + + //cerr << "New UA widget size: " << uaSize.width() << "x" << uaSize.height() << endl; + + if ( uaDelta.width() || uaDelta.height() ) { + _displayArea.inflate ( 0, 0, (DbU::Unit)(uaDelta.width()/_scale), (DbU::Unit)(uaDelta.height()/_scale) ); + _visibleArea.inflate ( 0, 0, (DbU::Unit)(uaDelta.width()/_scale), (DbU::Unit)(uaDelta.height()/_scale) ); + //cerr << "new " << _displayArea << endl; + + //cerr << "Previous buffer size: " << _drawingBuffer.width () << "x" + // << _drawingBuffer.height() << endl; + + QSize bufferSize ( ( ( uaSize.width () / _stripWidth ) + 1 ) * _stripWidth + , ( ( uaSize.height() / _stripWidth ) + 1 ) * _stripWidth ); + _drawingBuffer = QPixmap ( bufferSize ); + + //cerr << "Effective buffer resize to: " << bufferSize.width() << "x" + // << bufferSize.height() << endl; + } redraw (); } -} + + + void CellWidget::keyPressEvent ( QKeyEvent* event ) + { + switch ( event->key() ) { + case Qt::Key_Up: goUp (); break; + case Qt::Key_Down: goDown (); break; + case Qt::Key_Left: goLeft (); break; + case Qt::Key_Right: goRight (); break; + case Qt::Key_Z: setScale ( _scale*2.0 ); break; + case Qt::Key_M: setScale ( _scale/2.0 ); break; + } + } + + + void CellWidget::mouseMoveEvent ( QMouseEvent* event ) + { + if ( _mouseGo ) { + int dx = event->x() - _lastMousePosition.x(); + dx <<= 1; + //cerr << "dX (px): " << dx << " _offsetVA.rx() " << _offsetVA.rx() << endl; + if ( dx > 0 ) goLeft ( dx ); + if ( dx < 0 ) goRight ( -dx ); + + int dy = event->y() - _lastMousePosition.y(); + dy <<= 1; + //cerr << "dY (px): " << dy << " _offsetVA.ry() " << _offsetVA.ry() << endl; + if ( dy > 0 ) goUp ( dy ); + if ( dy < 0 ) goDown ( -dy ); + + _lastMousePosition = event->pos(); + } else { + //cerr << "x:" << event->x() << " y:" << event->y() << endl; + _xPosition->setDynamicText ( screenToDbuX(event->x()) ); + _yPosition->setDynamicText ( screenToDbuY(event->y()) ); + } + } + + + void CellWidget::mousePressEvent ( QMouseEvent* event ) + { + if ( ( event->button() == Qt::LeftButton ) && !_mouseGo ) { + _mouseGo = true; + _lastMousePosition = event->pos(); + pushCursor ( Qt::ClosedHandCursor ); + } + } + + + void CellWidget::mouseReleaseEvent ( QMouseEvent* event ) + { + if ( ( event->button() == Qt::LeftButton ) && _mouseGo ) { + _mouseGo = false; + popCursor (); + } + } + + + QPoint CellWidget::dbuToDisplayPoint ( DbU::Unit x, DbU::Unit y ) const + { + return QPoint ( dbuToDisplayX(x), dbuToDisplayY(y) ); + } + + + QPoint CellWidget::dbuToDisplayPoint ( const Point& point ) const + { + return dbuToDisplayPoint ( point.getX(), point.getY() ); + } + + + QRect CellWidget::dbuToDisplayRect ( DbU::Unit x1, DbU::Unit y1, DbU::Unit x2, DbU::Unit y2 ) const + { + return QRect ( dbuToDisplayX(x1) + , dbuToDisplayY(y2) + , dbuToDisplayX(x2) - dbuToDisplayX(x1) + , dbuToDisplayY(y1) - dbuToDisplayY(y2) + ); + } + + + QRect CellWidget::dbuToDisplayRect ( const Box& box ) const + { + return dbuToDisplayRect ( box.getXMin() + , box.getYMin() + , box.getXMax() + , box.getYMax() + ); + } + + + QPoint CellWidget::dbuToScreenPoint ( DbU::Unit x, DbU::Unit y ) const + { + return QPoint ( dbuToScreenX(x), dbuToScreenY(y) ); + } + + + void CellWidget::setShowBoundaries ( bool state ) + { + if ( _showBoundaries != state ) { + _showBoundaries = state; + redraw (); + } + } void CellWidget::setCell ( Cell* cell ) diff --git a/hurricane/src/hviewer/hurricane/viewer/CellWidget.h b/hurricane/src/hviewer/hurricane/viewer/CellWidget.h index 5efe8a35..3ac365c2 100644 --- a/hurricane/src/hviewer/hurricane/viewer/CellWidget.h +++ b/hurricane/src/hviewer/hurricane/viewer/CellWidget.h @@ -77,6 +77,7 @@ namespace Hurricane { void drawPad ( const Pad* , const BasicLayer*, const Box&, const Transformation& ); void drawBox ( const Box& ); void drawLine ( const Point&, const Point& ); + void drawGrid (); // Geometric conversions. QRect dbuToDisplayRect ( DbU::Unit x1, DbU::Unit y1, DbU::Unit x2, DbU::Unit y2 ) const; QRect dbuToDisplayRect ( const Box& box ) const; @@ -85,6 +86,9 @@ namespace Hurricane { inline int dbuToDisplayX ( DbU::Unit x ) const; inline int dbuToDisplayY ( DbU::Unit y ) const; inline int dbuToDisplayLength ( DbU::Unit length ) const; + inline int dbuToScreenX ( DbU::Unit x ) const; + inline int dbuToScreenY ( DbU::Unit y ) const; + QPoint dbuToScreenPoint ( DbU::Unit x, DbU::Unit y ) const; inline DbU::Unit displayToDbuX ( int x ) const; inline DbU::Unit displayToDbuY ( int y ) const; inline DbU::Unit displayToDbuLength ( int length ) const; @@ -160,6 +164,14 @@ inline int CellWidget::dbuToDisplayLength ( DbU::Unit length ) const { return (int)rint ( (float)length * _scale ); } +inline int CellWidget::dbuToScreenX ( DbU::Unit x ) const +{ return (int)rint ( (float)( x - _displayArea.getXMin() ) * _scale ) - _offsetVA.x(); } + + +inline int CellWidget::dbuToScreenY ( DbU::Unit y ) const +{ return (int)rint ( (float)( _displayArea.getYMax() - y ) * _scale ) - _offsetVA.y(); } + + inline DbU::Unit CellWidget::displayToDbuX ( int x ) const { return (DbU::Unit)(x/_scale) + _displayArea.getXMin(); }