From: abv Date: Thu, 13 Mar 2014 09:20:08 +0000 (+0400) Subject: 0024431: Using svg-images in the documentation X-Git-Tag: V6_8_0_beta~498 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=3d68eaf52b16c65de3bf9b2d0fba9454e4082278 0024431: Using svg-images in the documentation Documentation generator improved to automatically convert SVG images to PDF when PDF documents are generated. This is done with Inkscape thus it becomes necessary for generation of PDF documents. Doxygen alias "figure" added for easy insertion of images with single command for both HTML and PDF output. Documentation is updated. Reviewed documentation.md and added more recommendations on Document Syntax. Introduced existing svg images in the documentation. Description of formatting of plain text, code blocks, and references revised. Snapshot of structure of dox folder is updated. Copyright year is corrected in PDF documents to be always the current one. Some grammar corrections. --- diff --git a/dox/dev_guides/documentation/documentation.md b/dox/dev_guides/documentation/documentation.md index 0e9c46074c..ceebd33dd5 100644 --- a/dox/dev_guides/documentation/documentation.md +++ b/dox/dev_guides/documentation/documentation.md @@ -5,119 +5,123 @@ @section OCCT_DM_SECTION_1 Introduction -This document provides practical guidenes for generation and editing of OCCT user documentation. +This document provides practical guidelines for generation and editing of OCCT user documentation. @section OCCT_DM_SECTION_2 Prerequisites -In order to generate documentation, you need to have the following software installed. +You need to have the following software installed to generate the documentation. -Tcl/Tk +**Tcl/Tk** Version 8.5 or 8.6: http://www.tcl.tk/software/tcltk/download.html -Doxygen +**Doxygen** Version 1.8.4 or above: http://www.stack.nl/~dimitri/doxygen/download.html -MiKTeX or equivalent tool (only needed for PDF document creation): http://miktex.org/download +**MiKTeX** or other package providing **pdflatex** command (only needed for generation of PDF documents): http://miktex.org/download -**Note**: to generate pdf documentation with MiKTeX you should execute gendoc.bat within MiKTeX environment -(run gendoc.bat in MiKTeX command promt or update PATH for MiKTeX bin folder). Also in process of pdf generation -MiKTeX can request you to download missing packages if MiKTeX was installed with option below: +**Inkscape** (only needed for generation of PDF documents containing SVG images): http://www.inkscape.org/download -@image html /dev_guides/documentation/images/documentation_image002.png -@image latex /dev_guides/documentation/images/documentation_image002.png +When generating PDF documentation, **pdflatex** and **inkscape** executables should be accessible by PATH variable. +You can use *custom.bat* file to add necessary paths to the *PATH* variable. -If this option is set to "Yes", MiKTeX will download missing packages automatically. +Note that in the process of PDF generation MiKTeX may need some packages not installed by default. +We recommend setting option "Install missing packages on-the-fly" to "Ask me first" (default) during MiKTeX installation: -MathJax is used for rendering math formulas in browser (HTML and CHM outputs): http://www.mathjax.org. +@figure{/dev_guides/documentation/images/documentation_miktex.png} -By default MathJAX scripts and fonts are taken from http://cdn.mathjax.org/mathjax/latest and no instalation of MathJAX is necessary if Internet is accessible. -If you need to use OCCT documentation while offline, you can install local copy of MatJAX, see http://www.mathjax.org/download/. -See \ref OCCT_DM_SECTION_A_9 paragraph for more details on inserting math. +On the first run of **pdflatex** it will open a dialog window prompting for installation of missing packages. +Follow the instructions to proceed (define proxy settings if needed, select a mirror site to download from, etc.). + +**MathJax** is used for rendering math formulas in browser (HTML and CHM outputs): http://www.mathjax.org. + +By default MathJAX scripts and fonts are taken from http://cdn.mathjax.org/mathjax/latest and no installation of MathJAX is necessary if Internet is accessible. +If you need to use OCCT documentation while off-line, you can install a local copy of MatJAX, see http://www.mathjax.org/download/. +See \ref OCCT_DM_SECTION_A_9 for more details on inserting mathematical expressions. @section OCCT_DM_SECTION_2_1 Documentation Generation -Run gendoc.bat from OCCT directory to generate all articles are defined in FILES.txt: +Run *gendoc.bat* from OCCT directory to generate all documents defined in *FILES.txt*: -gendoc.bat options: +*gendoc.bat* can be started with the following options: - * -html : To generate HTML files (cannot be used with -pdf); - * -pdf : To generate PDF files (cannot be used with -html); - * -m=\ : Specifies list of articles to generate. If it is not specified, all files, mentioned in FILES.txt are processed; - * -l=\ : Specifies the article caption for a single document; - * -mathjax=\ : Specifies path to non-default MathJAX installation - * -h : Prints help message; - * -v : Specifies the Verbose mode (info on all script actions is shown). + * -html : Generates HTML files (cannot be used with -pdf); + * -pdf : Generates PDF files (cannot be used with -html); + * -m=\ : Specifies the list of documents to generate. If it is not specified, all files mentioned in *FILES.txt* are processed; + * -l=\ : Specifies the output document title; + * -mathjax=\ : Specifies the path to a non-default location of MathJAX; + * -h : Prints a help message; + * -v : Toggles the Verbose mode (info on all script actions is shown). -If you run the command without arguments (like example above) it will generate HTML documentation for all articles defined in FILES.txt. +If you run the command without arguments (like in the example above) it will generate HTML documentation for all documents defined in *FILES.txt*. -**Note**: the generation process generates PDF files for each article, -but in html case it generates common Html page with references to the ones. +**Note** -For generation of specific article specify path to corresponding MarkDown file (paths relative to *dox* subfolder can be given), for instance: +* In case of a PDF output the utility generates a separate PDF file for each document; +* In case of an HTML output the utility generates a common Table of contents containing references to all documents. - % gendoc.bat -html -m=dev_guides/documentation/documentation.md +To generate the output for a specific document specify the path to the corresponding MarkDown file (paths relative to *dox* sub-folder can be given), for instance: -Multiple files can be separated with comma: +~~~~ + % gendoc.bat -html -m=dev_guides/documentation/documentation.md +~~~~ +Multiple files can be separated with commas: +~~~~ % gendoc.bat -html -m=MD_FILE_1,MD_FILE_2 +~~~~ -To specify an article name with -l option, use quotes to prevent incorrect interpretation of whitespaces: +Use quotes to specify an article name with -l option, which helps to prevent incorrect interpretation of white spaces: +~~~~ % gendoc.bat -pdf -m=MD_FILE_1 -l="Label of MD_FILE_1 document" +~~~~ @section OCCT_DM_SECTION_3 Documentation Conventions -This section contains information about conventions in the field of OCCT documentation file format, -structure of documentation directories, etc. +This section contains information about file format conventions, directories structure, etc. @subsection OCCT_DM_SECTION_3_1 File Format The format used for documentation is MarkDown with Doxygen extensions. -The MarkDown files have a "*.md" extension and are based on rules desribed in -\ref OCCT_DM_SECTION_A section. +The MarkDown files have a *.md extension and are based on rules described in \ref OCCT_DM_SECTION_A section. @subsection OCCT_DM_SECTION_3_2 Directory Structure -@image html /dev_guides/documentation/images/documentation_image001.png -@image latex /dev_guides/documentation/images/documentation_image001.png +@figure{/dev_guides/documentation/images/documentation_folders.png} -Every separate article has own folder if images are used in it. These images -are stored into "images" subfolder. +Each document has its own folder if there are any images used in it. These images are stored in *images* subfolder. + +If you want to use the same image for several documents, you can place it in *dox/resources* folder. + +**Note**: To avoid incorrect image display, use a relative path to the image (starting from *dox* folder). For instance: -If you want to use the same image for several articles, you can place the one into "dox/resources" folder. -**Note**: Every article can use any image that is used by others articles. To avoid incorrect image -displaying, use relative path to the image (starting from dox folder). For instance @verbatim -@image html /dev_guides/snv/images/snv_image001.svg +@figure{/dev_guides/documentation/images/documentation_test_image.svg} @endverbatim -Result of generation of the documentation is: -%OCCT_DIR% / doc - a folder for generated articles; - * html/ - a directory for generated HTML pages; - * pdf/ - a directory for generated PDF files. +The documentation is generated in subfolder *doc* : +* *html* - a directory for generated HTML pages; +* *pdf* - a directory for generated PDF files. + +@section OCCT_DM_SECTION_4 Adding a New Document + +Place a new document in the folder taking into account its logical position in the documentation hierarchy. For instance, the document *svn.md* about the use of SVN to work with OCCT source code can be placed into /dox/dev_guides/. -@section OCCT_DM_SECTION_4 Adding a New Article +If there are images in the document, it should be placed in its own folder containing a subfolder for images. For instance: +* /dox/dev_guides/svn/ - for *svn.md* file; +* /dox/dev_guides/svn/images/ - for images. - - Place a new article into folder that is chosen taking into account the place of the article -at the hierarchy of the documentation. For instance the article about "using SVN working with OCCT -source code" (svn.md - the file of the article) might be placed into /dox/dev_guides/ . If the article has images then you may create -the own folder of the article and subfolder in it for images. For instance -*/dox/dev_guides/svn/ - for svn.md file -*/dox/dev_guides/svn/images/ - for images +Add a relative path to *svn.md* in file dox/FILES.txt. For instance - - Update dox/FILES.txt to add relative path to svn.md. For instance @verbatim -dev_guides/snv/svn.md +dev_guides/svn/svn.md @endverbatim -**Note**: the place of the relative path to an article is connected with the place -into treeview of html version. +**Note** that the order of paths to documents in *FILES.txt* is reproduced in the Table of Contents in the HTML output. Please, place them logically. - -Note, that you should specify a file tag, not the document name. -See Header section for details. +**Note** that you should specify a file tag, not the document name. See Header section for details. @section OCCT_DOC_SECTION_5 Additional Resources @@ -131,69 +135,60 @@ http://www.stack.nl/~dimitri/doxygen/manual @section OCCT_DM_SECTION_A Appendix 1: Document Syntax -Each OCCT document file in *.md format has a simple structure. -It can contain: +A document file in *.md format must start with a proper header defining a caption and a unique tag. + +@verbatim +Documentation System {#dev_guides__documentation} +===================== +@endverbatim -| Content type | Obligation | -| :---------------- | :-------------------: | -| Header | M | -| Footer | M | -| Plain text | O | -| List | O | -| Table | O | -| Code | O | -| Formula | O | -| Image | O | -| Page numbers | M (auto generation) | -| Table of contents | M (auto generation) | +The document structure is formed by sections that must be defined consistently. -The legend: +The document can contain plain text, lists, tables, code snippets, images, math, etc. +Any specific text elements can be introduced by Markdown language tags or by usual HTML tags. - * M is for Mandatory - * O is for Optional +The table of contents, page numbers (in PDF), and figure numbers (in PDF) are generated automatically. -@subsection OCCT_DM_SECTION_A_1 Text Caption (a header) +@subsection OCCT_DM_SECTION_A_1 Headers and hierarchic document structure -headings of different levels can be specified with the following code: +Headers of different levels can be specified with the following tags: +* \@section - for the first-level headers; +* \@subsection - for the second level headers; +* \@subsubsection - for the third level headers. + +For example: @verbatim -Header 1 {#header1} -======= + @section occt_ocaf_1 Basic Concepts + @subsection occt_ocaf_1_1 Applications and Documents + @subsubsection occt_ocaf_1_1_1 The document and the data framework @endverbatim - to get +Please, note that section names can be used for references within the document and in other documents, so it is necessary to use the common prefix indicative of the document name for all section names in the given document. +For example, *occt_ocaf* for sections in Open CASCADE Application Framework manual. - Header 1 -========= +The remaining part of section names in most documents consists only of numbers, for example *1_1*. Actually, the hierarchical structure of the output table of contents is not based on these numbers and is generated automatically. - and with the following code: +The numbers are only indicative of a section location in the body of the document. However, duplicate section names in a document inevitably cause errors during generation. -@verbatim -Header 2 {#header2} --------- -@endverbatim +If you insert a section in the middle of a big document, do not renumber the document to the end (which is inefficient and error prone), but choose an arbitrary number or letter, not yet used in the document section naming, and base the naming in this section on it. -to get +The section hierarchy is limited to three levels and further levels cannot be presented in the Table of Contents. -Header 2 ---------- +However, the fourth and fifth level headers can be tagged with #### and ##### correspondingly. -Where a word in curly braces is a MarkDown-style reference, which can be used in table of contents. -If you would like to have the table of contents, it is recommended to use \@section, -\@subsection and \@subsubsection pages instead of MarkDown headers as follows: - -@verbatim - @section Section_Name Section Header - @subsection SubSection_Name SubSection Header - @subsubsection SubSubSection_Name SubSubSection Header -@endverbatim +It is also possible to use tags ## and ### for second and third level headers if you do not wish to show them in the table of contents or make references to them. @subsection OCCT_DM_SECTION_A_2 Plain Text -Plain text is a text in a notepad-like format. To insert special symbols, -like \< , \> or \\, prepend them with \\ character: \\\<, \\\>, \\\\ -To emphasize some words, write one pair of asterisks ( * ) or underscores ( _ ) across the word -to make it *italic* and two pairs of these symbols to make a word **Bold**. +A plain text is organized in paragraphs, separated by empty lines in MarkDown source. +The length of lines is not restricted; it is recommended to put each sentence on a separate line -- this is optimal for easier comparison of different versions of the same document. + +To insert special symbols, like \< , \> or \\, prepend them with \\ character: \\\<, \\\>, \\\\, etc. +To emphasize a word or a group of words, wrap the text with one pair of asterisks (*) or underscores (_) to make it *italic* and two pairs of these symbols to make it **Bold**. + +**Note** that if your emphasized text starts or ends with a special symbol, the asterisks may not work. Use explicit HTML tags \\ and \\ instead. + @subsection OCCT_DM_SECTION_A_3 Lists @@ -224,7 +219,7 @@ then a space. Numbered lists can also be nested. Thus this code 1. Sub-item 1 2. Sub-item 2 2. List item 2 -3. List item 3 +4. List item 3 @endverbatim produces this list: @@ -235,6 +230,11 @@ produces this list: 2. List item 2 3. List item 3 +**Note** that numbers of list items in the output are generated so they do not necessarily follow the numbering of source items. + +In some cases automatic generation adversely restarts the numbering, i.e. you get list items 1. 1. 1. instead of 1. 2. 3. in the output. +The use of explicit HTML tags \\ and \\ can help in this case. + Each list item can contain several paragraphs of text; these paragraphs must have the same indentation as text after bullet or number in the numbered list item (otherwise numbering will be broken). @@ -244,29 +244,7 @@ Code blocks can be inserted as paragraphs with additional indentation and their use may cause numeration to be reset. -Example of complex nested list: - -@verbatim -1. ListItem_1 - - Additional paragraph - - code fragment - - One more paragraph - - 1. Sub-item 1 - - code fragment for sub-item 1 - - 2. Sub-item 2 - - Paragraph for sub-item 2 - - Yet one more paragraph for list item 1 - -2. ListItem_2 -@endverbatim +Example of a complex nested list: 1. List item 1 @@ -288,8 +266,6 @@ Example of complex nested list: 2. List item 2 -Note that numbers of paragraphs are regenerated so they do not necessarily -follow numbering of source items. @subsection OCCT_DM_SECTION_A_4 Tables @@ -326,19 +302,19 @@ which will looks as follows: | 10 | 10 | 10 | | 1000 | 1000 | 1000 | -Note that each table raw should be contained in one line of text; complex -tables can be created using HTML tags. +Note that each table row should be contained in one line of text; complex tables can be created using HTML tags. @subsection OCCT_DM_SECTION_A_5 Code Blocks -It is recommended to indent a code lines with 4 spaces. +Paragraphs indented with 4 or more spaces are considered as code fragments and rendered using Courier font. +Example: + + This line is indented by 4 spaces and rendered as a code block. + A fenced code block does not require indentation, and is defined by a pair of "fence lines". Such line consists of 3 or more tilde (~) characters on a line. -The end of the block should have the same number of tildes. Here is an example: - -~~~~~~~~~~~~~~~~~~~~~~~ - a one-line code block -~~~~~~~~~~~~~~~~~~~~~~~ +The end of the block should have the same number of tildes. +Thus it is strongly advised to use only three or four tildes. By default the output is the same as for a normal code block. To highlight the code, the developer has to indicate the typical file extension, @@ -346,68 +322,79 @@ which corresponds to the programming language, after the opening fence. For highlighting according to the C++ language, for instance, write the following code (the curly braces and dot are optional): @verbatim -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} +~~~{.cpp} int func(int a,int b) { return a*b; } -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~ @endverbatim which will produce: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} +~~~{.cpp} int func(int a,int b) { return a*b; } -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~ -Verbatim content can be written by using framing \@verbatim \@endverbatim . For instance - - verbatim text +Smaller code blocks can be inserted by wrapping with tags \@code and \@endcode. +Verbatim content (same as code but without syntax highlighting) can be inserted by wrapping with tags \@verbatim and \@endverbatim. @subsection OCCT_DM_SECTION_A_6 References -To insert a reference to a website, it is proposed to write a URL. For example: http://en.wikipedia.org -To insert a reference to another part of the same document, the developer can write: +To insert a reference to a website, it is sufficient to write an URL. +For example: http://en.wikipedia.org -@verbatim - @htmlonly - Doxygen Configuration file - @endhtmlonly -@endverbatim +To insert a reference to a document or its subsection, use command \@ref followed by the document or section tag name. +For instance, @code @ref OCCT_DM_SECTION_A @endcode will be rendered as @ref OCCT_DM_SECTION_A. -to get a link to paragraph : @htmlonly Doxygen configuration @endhtmlonly +Note that links between documents will not work in PDF output if each document is generated independently. +Hence it is recommended to add a name of the referenced section after the tag name in the \@ref command (in quotes): this will guarantee that the reference is recognizable for the reader even if the cross-link is not instantiated. +For instance: @code @ref occt_modat_1 "Geometry Utilities" @endcode will be rendered as @ref occt_modat_1 "Geometry Utilities". @subsection OCCT_DM_SECTION_A_7 Images -To insert image into document the developer can write the following code(in Doxygen-style): +For inserting images into the document use the command \@figure, as follows: -For HTML document: @verbatim - @image html /relative/path/to/image/image001.png "Image caption" + @figure{/relative/path/to/image/image_file_name.png,"Image caption"} @endverbatim -For latex document: -@verbatim - @image latex /relative/path/to/image/image001.png "Image caption" -@endverbatim +The first argument is a path to the image file, relative to the *dox* folder. +The supported formats for images are PNG, JPG, and SVG. +The file extension must be lowercase and correspond to the file format. +The image file name should have no dots except for the one before extension (names with more than one dot confuse **pdflatex**). + +The second argument is optional, it defines the caption for the image to be inserted. +The caption argument, if given, should be quoted, even if it is a single word. +Captions are included below the image; in PDF output the images with caption are numbered automatically. + +Example: -*Note*: When markdown document is used to generate html document the latex insertion is ignored (and vice versa) -due to this fact you can use image insertions in the pair, like example below: @verbatim - @image html /relative/path/to/image/image001.png "Image caption" - @image latex /relative/path/to/image/image001.png "Image caption" + @figure{/dev_guides/documentation/images/documentation_test_image.svg,"Test SVG image"} @endverbatim -The code below tells Doxygen to insert a picture right in the place this code was written: +is rendered as: + +@figure{/dev_guides/documentation/images/documentation_test_image.svg,"Test SVG image"} + +We recommend using **Inkscape** for creation and edition of vector graphics. +The graphics created in MS Word Draw and some other vector editors can be copy-pasted to Inkscape and saved as SVG images. + +Note that the image that will be included in documentation is the whole page of the Inkscape document; use option "Resize page to content" in menu **File -> Document properties** of Inkscape to fit page dimensions to the picture (adding margins as necessary). + +Note that the *figure* command is an alias to the standard Doxygen command *image* repeated twice: once for HTML and then for Latex output (used for PDF generation). Thus if HTML and PDF outputs should include different images or captions, command "image" can be used: + @verbatim - @image html /resources/occ_logo.png "OCCT logo" - @image latex /resources/occ_logo.png "OCCT logo" + @image html /relative/path/to/image/occ_logo.png + @image latex /relative/path/to/image/occ_logo.png "OCC logo" @endverbatim -@image html /resources/occ_logo.png "OCCT logo" -@image latex /resources/occ_logo.png "OCCT logo" +@image html /resources/occ_logo.png +@image latex /resources/occ_logo.png "OCC logo" @subsection OCCT_DM_SECTION_A_8 Table Of Contents -To get the table of contents at the beginning of the document, write \@tableofcontents tag. -But it is not needed now because TreeView option for HTML is used. +Use \@tableofcontents tag to get the table of contents at the beginning of the document. + +Actually, it is not strictly necessary now because TreeView option for HTML is used. The TOC in the PDF document will be generated automatically. @subsection OCCT_DM_SECTION_A_9 Formulas @@ -445,8 +432,10 @@ gives the following result: \right| @f$ -2.Formulas can also be put between @verbatim \begin{align} @endverbatim and @verbatim \end{align} @endverbatim tags. An example: +2.Formulas can also be put between @verbatim \begin{align} @endverbatim and @verbatim \end{align} @endverbatim tags. + For example: + @verbatim \begin{align} \dot{x} & = \sigma(y-x) \\ diff --git a/dox/dev_guides/documentation/images/documentation_folders.png b/dox/dev_guides/documentation/images/documentation_folders.png new file mode 100644 index 0000000000..6276f2b55b Binary files /dev/null and b/dox/dev_guides/documentation/images/documentation_folders.png differ diff --git a/dox/dev_guides/documentation/images/documentation_image001.png b/dox/dev_guides/documentation/images/documentation_image001.png deleted file mode 100644 index 770587ec3b..0000000000 Binary files a/dox/dev_guides/documentation/images/documentation_image001.png and /dev/null differ diff --git a/dox/dev_guides/documentation/images/documentation_image002.png b/dox/dev_guides/documentation/images/documentation_image002.png deleted file mode 100644 index 3b3c707fed..0000000000 Binary files a/dox/dev_guides/documentation/images/documentation_image002.png and /dev/null differ diff --git a/dox/dev_guides/documentation/images/documentation_miktex.png b/dox/dev_guides/documentation/images/documentation_miktex.png new file mode 100644 index 0000000000..27042971c1 Binary files /dev/null and b/dox/dev_guides/documentation/images/documentation_miktex.png differ diff --git a/dox/dev_guides/documentation/images/documentation_test_image.svg b/dox/dev_guides/documentation/images/documentation_test_image.svg new file mode 100644 index 0000000000..c5e1e13682 --- /dev/null +++ b/dox/dev_guides/documentation/images/documentation_test_image.svg @@ -0,0 +1,91 @@ + + + + + + + + + + image/svg+xml + + + + + + + + Test SVG image + + + diff --git a/dox/occdoc.tcl b/dox/occdoc.tcl index 417f4123be..1ef9bf7bed 100644 --- a/dox/occdoc.tcl +++ b/dox/occdoc.tcl @@ -83,6 +83,10 @@ proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generato # Keep doxygen comments within code blocks puts $doxyFile "STRIP_CODE_COMMENTS = NO" + # Define alias for inserting images to both HRML and PDF at once + puts $doxyFile "ALIASES += figure\{1\}=\"\\image html \\1 \\n \\image latex \\1\"" + puts $doxyFile "ALIASES += figure\{2\}=\"\\image html \\1 \\2 \\n \\image latex \\1 \\2\"" + set PARAM_INPUT "INPUT =" set PARAM_IMAGEPATH "IMAGE_PATH = $inputDir/resources/ " @@ -311,6 +315,9 @@ proc OverviewDoc_MakeRefmanTex {fileName latexDir docLabel verboseMode} { if {[file exists $DOCNAME] == 1} { file delete -force $DOCNAME } + + set year [clock format [clock seconds] -format {%Y}] + set texfile [open $DOCNAME w] puts $texfile "\\batchmode" @@ -385,8 +392,8 @@ proc OverviewDoc_MakeRefmanTex {fileName latexDir docLabel verboseMode} { puts $texfile "\\fancyhead\[RO\]{\\fancyplain{}{\\bfseries\\thepage}}" puts $texfile "\\fancyfoot\[LE\]{\\fancyplain{}{}}" puts $texfile "\\fancyfoot\[CE\]{\\fancyplain{}{}}" - puts $texfile "\\fancyfoot\[RE\]{\\fancyplain{}{\\bfseries\\scriptsize (c) Open CASCADE 2001\-2013}}" - puts $texfile "\\fancyfoot\[LO\]{\\fancyplain{}{\\bfseries\\scriptsize (c) Open CASCADE 2001\-2013}}" + puts $texfile "\\fancyfoot\[RE\]{\\fancyplain{}{\\bfseries\\scriptsize Copyright (c) Open CASCADE $year}}" + puts $texfile "\\fancyfoot\[LO\]{\\fancyplain{}{\\bfseries\\scriptsize Copyright (c) Open CASCADE $year}}" puts $texfile "\\fancyfoot\[CO\]{\\fancyplain{}{}}" puts $texfile "\\fancyfoot\[RO\]{\\fancyplain{}{}}" puts $texfile "\\renewcommand{\\footrulewidth}{0.4pt}" @@ -484,6 +491,8 @@ proc OverviewDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} { while {1} { set line [gets $IN_F] if { [string first "\\includegraphics" $line] != -1 } { + # replace svg extension by pdf + set line [regsub {[.]svg} $line ".pdf"] # Center images in TeX files set line "\\begin{center}\n $line\n\\end{center}" } elseif { [string first "\\subsection" $line] != -1 } { @@ -509,6 +518,25 @@ proc OverviewDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} { } } +# Convert SVG files to PDF format to allow including them to PDF +# (requires InkScape to be in PATH) +proc OverviewDoc_ProcessSvg {latexDir verboseMode} { + + foreach file [glob -nocomplain $latexDir/*.svg] { + if {$verboseMode == "YES"} { + puts "INFO: Converting file $file" + } + + set pdffile "[file rootname $file].pdf" + if { [catch {exec inkscape -z -D --file=$file --export-pdf=$pdffile} res] } { + puts "Error: $res" + puts "Conversion failed; check that Inkscape is in PATH!" + puts "SVG images will be lost in PDF documents" + return + } + } +} + # Main procedure for documents compilation proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchMode hhcPath mathjaxLocation} { @@ -556,16 +584,17 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM OverviewDoc_MakeDoxyfile $CASROOT "$OUTDIR/overview" $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $verboseMode $searchMode $hhcPath $mathjax_relative_location # Run doxygen tool + set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}] if { $generatorMode == "HTML_ONLY"} { - puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating HTML files..." + puts "$starttimestamp Generating HTML files..." } elseif { $generatorMode == "CHM_ONLY" } { - puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating CHM file..." + puts "$starttimestamp Generating CHM file..." } set RESULT [catch {exec doxygen $DOXYFILE > $OUTDIR/doxygen_out.log} DOX_ERROR] if {$RESULT != 0} { if {[llength [split $DOX_ERROR "\n"]] > 1} { if {$verboseMode == "YES"} { - puts "See Doxygen log in $OUTDIR/doxygen_warnings_and_errors.log" + puts "Error running Doxygen; see log in\n$OUTDIR/doxygen_warnings_and_errors.log" } set DOX_ERROR_FILE [open "$OUTDIR/doxygen_warnings_and_errors.log" "w"] puts $DOX_ERROR_FILE $DOX_ERROR @@ -607,6 +636,11 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM } OverviewDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode + if {$verboseMode == "YES"} { + puts "Converting SVG images to PNG format..." + } + OverviewDoc_ProcessSvg $LATEXDIR $verboseMode + if {$verboseMode == "YES"} { puts "Generating PDF files from TeX files..." } @@ -624,7 +658,7 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM if {$RESULT != 0} { if {[llength [split $LaTeX_ERROR "\n"]] > 1} { if {$verboseMode == "YES"} { - puts "See Latex log in $OUTDIR/pdflatex_warnings_and_errors.log" + puts "Errors running Latex; see log in \n$OUTDIR/pdflatex_warnings_and_errors.log" } set LaTeX_ERROR_FILE [open "$OUTDIR/pdflatex_warnings_and_errors.log" "w"] puts $LaTeX_ERROR_FILE $LaTeX_ERROR @@ -640,7 +674,7 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM } if {![file exists "$LATEXDIR/refman.pdf"]} { - puts "Error: file $LATEXDIR/refman.pdf does not exist" + puts "Error: Latex failed to create $LATEXDIR/refman.pdf" return } @@ -651,13 +685,12 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM cd $INDIR puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed" if { $generatorMode == "HTML_ONLY" } { - puts "View generated HTML documentation by opening: " - set RESFILE $OUTDIR/overview/html/index.html - puts "$RESFILE" + puts "View generated HTML documentation by opening:" + puts "$OUTDIR/overview/html/index.html" } if { $generatorMode == "PDF_ONLY" } { - puts "PDF files are generated in: " - puts "$OUTDIR/overview/pdf folder" + puts "PDF files are generated in folder:" + puts "$OUTDIR/overview/pdf" } } diff --git a/dox/tutorial/images/tutorial_image003.png b/dox/tutorial/images/tutorial_image003.png deleted file mode 100644 index b08eeb88be..0000000000 Binary files a/dox/tutorial/images/tutorial_image003.png and /dev/null differ diff --git a/dox/tutorial/images/tutorial_image003.svg b/dox/tutorial/images/tutorial_image003.svg new file mode 100644 index 0000000000..a0131914ce --- /dev/null +++ b/dox/tutorial/images/tutorial_image003.svg @@ -0,0 +1,512 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + +  + ( + - + myWidth / 2., 0 , 0) + + + + + + +  + (myWidth / + 2 + ., + 0 + + , + 0 + ) + +  + ( + - + myWidth / 2., + - + myThickness / 4. + + , 0) + + + +  + (myWidth / 2., + myThickne + ss / 4. + + , 0) + +  + + (0 , + - + myThickness / 2. , 0) + + + + + + + + + + diff --git a/dox/tutorial/tutorial.md b/dox/tutorial/tutorial.md index 10e43f4af7..397ef25dac 100644 --- a/dox/tutorial/tutorial.md +++ b/dox/tutorial/tutorial.md @@ -52,8 +52,7 @@ This modeling requires four steps: To create the bottle's profile, you first create characteristic points with their coordinates as shown below in the (XOY) plane. These points will be the supports that define the geometry of the profile. -@image html /tutorial/images/tutorial_image003.png -@image latex /tutorial/images/tutorial_image003.png +@figure{/tutorial/images/tutorial_image003.svg} There are two classes to describe a 3D Cartesian point from its X, Y and Z coordinates in Open CASCADE Technology: @@ -67,7 +66,7 @@ To choose the best class for this application, consider the following: * *Geom_CartesianPoint* is manipulated by handle and may have multiple references and a long lifetime. Since all the points you will define are only used to create the profile's curves, an object with a limited lifetime will do. Choose the *gp_Pnt* class. -To instantiate a *gp_Pnt* object, just specify the X, Y, and Z coordinates of the points in the global cartesian coordinate system: +To instantiate a *gp_Pnt* object, just specify the X, Y, and Z coordinates of the points in the global Cartesian coordinate system: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} gp_Pnt aPnt1(-myWidth / 2., 0, 0); diff --git a/dox/user_guides/ocaf/images/ocaf_image003.png b/dox/user_guides/ocaf/images/ocaf_image003.png deleted file mode 100644 index bffcbc4f4d..0000000000 Binary files a/dox/user_guides/ocaf/images/ocaf_image003.png and /dev/null differ diff --git a/dox/user_guides/ocaf/images/ocaf_image003.svg b/dox/user_guides/ocaf/images/ocaf_image003.svg new file mode 100644 index 0000000000..782f5da1b2 --- /dev/null +++ b/dox/user_guides/ocaf/images/ocaf_image003.svg @@ -0,0 +1,504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + Visualization + + + + Shape + + + Graphic + + Kernel + + + + + + + + + + + + + + + + + + + + + OCAF (Open CASCADE Application Framework) + + + + OCCT + + Object Libraries required by OCAF + + + + diff --git a/dox/user_guides/ocaf/ocaf.md b/dox/user_guides/ocaf/ocaf.md index e137f36b06..1c649c3912 100644 --- a/dox/user_guides/ocaf/ocaf.md +++ b/dox/user_guides/ocaf/ocaf.md @@ -44,8 +44,7 @@ The table below contrasts the design of a modeling application using object libr The relationship between OCAF and the Open CASCADE Technology (**OCCT**) Object Libraries can be seen in the image below. -@image html /user_guides/ocaf/images/ocaf_image003.png "OCAF Architecture" -@image latex /user_guides/ocaf/images/ocaf_image003.png "OCAF Architecture" +@figure{/user_guides/ocaf/images/ocaf_image003.svg, "OCAF Architecture"} In the image, the OCAF (Open CASCADE Application Framework) is shown with black rectangles and OCCT Object Libraries required by OCAF are shown with white rectangles. @@ -80,7 +79,7 @@ OCAF documents are in turn managed by an OCAF application, which is in charge of Apart from their role as a container of application data, documents can refer to each other; Document A, for example, can refer to a specific label in Document B. This functionality is made possible by means of the reference key. -@subsection occt_ocaf_23 The document and the data framework +@subsection occt_ocaf_2_3 The document and the data framework Inside a document, there is a data framework, a model, for example. This is a set of labels organized in a tree structure characterized by the following features: * The first label in a framework is the root of the tree; diff --git a/dox/user_guides/shape_healing/images/shape_healing_image009.png b/dox/user_guides/shape_healing/images/shape_healing_image009.png deleted file mode 100644 index 34a998dc7b..0000000000 Binary files a/dox/user_guides/shape_healing/images/shape_healing_image009.png and /dev/null differ diff --git a/dox/user_guides/shape_healing/images/shape_healing_image009.svg b/dox/user_guides/shape_healing/images/shape_healing_image009.svg new file mode 100644 index 0000000000..4b27b062c0 --- /dev/null +++ b/dox/user_guides/shape_healing/images/shape_healing_image009.svg @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + ShapeFix + + + + ShapeUpgrade + + + + ShapeCustom + + + + ShapeExtend + + + + ShapeAnalysis + + + + + + + + + + + + Message + + + + + + + + + diff --git a/dox/user_guides/shape_healing/shape_healing.md b/dox/user_guides/shape_healing/shape_healing.md index 831687255d..e7cd871bce 100644 --- a/dox/user_guides/shape_healing/shape_healing.md +++ b/dox/user_guides/shape_healing/shape_healing.md @@ -14,8 +14,8 @@ The **Shape Healing** toolkit provides a set of tools to work on the geometry an * upgrade shape characteristics for users needs, for example a C0 supporting surface can be upgraded so that it becomes C1 continuous. The following diagram shows dependencies of API packages: -@image html /user_guides/shape_healing/images/shape_healing_image009.png "Shape Healing packages" -@image latex /user_guides/shape_healing/images/shape_healing_image009.png "Shape Healing packages" + +@figure{/user_guides/shape_healing/images/shape_healing_image009.svg, "Shape Healing packages"} Each sub-domain has its own scope of functionality: * analysis - exploring shape properties, computing shape features, detecting violation of OCCT requirements (shape itself is not modified);