diff --git a/src/Admin/ScrapeRepo.py b/src/Admin/ScrapeRepo.py index 216caa550fa164e69b6c3dd6c56bb6f07bacd311..c350efe121f7f6a9f49d7bb89f839e17b4bfb377 100755 --- a/src/Admin/ScrapeRepo.py +++ b/src/Admin/ScrapeRepo.py @@ -447,18 +447,27 @@ def add_vtk_nightly_doc_link(s, stats): :param stats: Statistics :return: """ - reg1 = re.compile(r'[^\.\/\[s\-?](vtk[^ &:\.][0-9a-zA-Z]+)') - # ? has been used to indicate that no link is to be built. - reg2 = re.compile(r'\?(vtk[0-9a-zA-Z\-]+)\?') + # This is the name of the repository. + repo_name = r'(vtk-examples)' + # ?...? has been used to indicate that no link is to be built. + no_link = r'[\?{1}](vtk[0-9a-zA-Z\-]+)[\?{1}]' + link = r'(vtk[^ &:\.\-][0-9a-zA-Z]+)' + + reg1 = re.compile(repo_name) + reg2 = re.compile(no_link) + reg3 = re.compile(link) + if reg1.findall(s): - stats['doxy_count'] += 1 - s1 = re.sub(r'[^\.\/\[s\-?](vtk[^ &:\.-][0-9a-zA-Z]+)', - r' [\1](' + r'https://www.vtk.org/doc/nightly/html/class' + r'\1.html#details)', s) - if reg2.findall(s1): - s2 = re.sub(r'\?(vtk[0-9a-zA-Z\-]+)\?', r'\1', s1) - return s2 - else: - return s1 + s = re.sub(repo_name, '_ktv' + r'\1', s) + if reg2.findall(s): + s = re.sub(no_link, '_ktv' + r'\1', s) + s = s.replace('_ktvvtk', '_ktv_') + n = len(reg3.findall(s)) + if n > 0: + stats['doxy_count'] += n + s = re.sub(link, + r'[\1](' + r'https://www.vtk.org/doc/nightly/html/class' + r'\1.html#details)', s) + s = s.replace('_ktv_', 'vtk') return s diff --git a/src/Cxx/PolyData/CurvaturesAdjustEdges.md b/src/Cxx/PolyData/CurvaturesAdjustEdges.md index 3e56ee309046a61c418887cc8e79c8c30dabe63d..2f47824e972be46c4aea17d19b76bcf22c737e9f 100644 --- a/src/Cxx/PolyData/CurvaturesAdjustEdges.md +++ b/src/Cxx/PolyData/CurvaturesAdjustEdges.md @@ -8,7 +8,7 @@ A histogram of the frequencies is also output to the console. This is useful if This example was inspired by these discussions: -- [vtkCurvatures yields unreasonably large values along borders](https://discourse.vtk.org/t/vtkcurvatures-yields-unreasonably-large-values-along-borders/2527) +- [?vtkCurvatures? yields unreasonably large values along borders](https://discourse.vtk.org/t/?vtkcurvatures?-yields-unreasonably-large-values-along-borders/2527) - [How to extract the ids of the boundary points of a surface?](https://discourse.vtk.org/t/2530/3) Thanks to everyone involved in these discussions. diff --git a/src/Cxx/Utilities/ForLoop.md b/src/Cxx/Utilities/ForLoop.md index 54d2f2a9b2a03e8ef509b984d7f3fe4be8eba5b0..56f5ef629dfbf721acf5a7aad7063d516e772e9e 100644 --- a/src/Cxx/Utilities/ForLoop.md +++ b/src/Cxx/Utilities/ForLoop.md @@ -46,12 +46,12 @@ It is left as an exercise for the reader to identify best practices in the examp #### Thanks -Special thanks must go to **wangzhezhe** for developing the source code on which this example is based, see this discourse article: [get the raw pointer from the ?vtkPoints?](https://discourse.vtk.org/t/get-the-raw-pointer-from-the-vtkpoints/4894), the original source code is here: [forloops.cpp](https://github.com/wangzhezhe/5MCST/blob/master/vtk_example/array/forloops.cpp). +Special thanks must go to **wangzhezhe** for developing the source code on which this example is based, see this discourse article: [get the raw pointer from the ?vtkPoints?](https://discourse.vtk.org/t/get-the-raw-pointer-from-the-?vtkpoints?/4894), the original source code is here: [forloops.cpp](https://github.com/wangzhezhe/5MCST/blob/master/vtk_example/array/forloops.cpp). #### Further reading For further reading please see: -- [Working with ?vtkDataArrays?: 2019 Edition](https://blog.kitware.com/working-with-vtkdataarrays-2019-edition/) +- [Working with ?vtkDataArrays?: 2019 Edition](https://blog.kitware.com/working-with-?vtkdataarrays?-2019-edition/) - [C++11 for-range support in VTK](https://blog.kitware.com/c11-for-range-support-in-vtk/) - [New Data Array Layouts in VTK 7.1](https://blog.kitware.com/new-data-array-layouts-in-vtk-7-1/) diff --git a/src/Python/PolyData/CurvaturesAdjustEdges.md b/src/Python/PolyData/CurvaturesAdjustEdges.md index 3e56ee309046a61c418887cc8e79c8c30dabe63d..2f47824e972be46c4aea17d19b76bcf22c737e9f 100644 --- a/src/Python/PolyData/CurvaturesAdjustEdges.md +++ b/src/Python/PolyData/CurvaturesAdjustEdges.md @@ -8,7 +8,7 @@ A histogram of the frequencies is also output to the console. This is useful if This example was inspired by these discussions: -- [vtkCurvatures yields unreasonably large values along borders](https://discourse.vtk.org/t/vtkcurvatures-yields-unreasonably-large-values-along-borders/2527) +- [?vtkCurvatures? yields unreasonably large values along borders](https://discourse.vtk.org/t/?vtkcurvatures?-yields-unreasonably-large-values-along-borders/2527) - [How to extract the ids of the boundary points of a surface?](https://discourse.vtk.org/t/2530/3) Thanks to everyone involved in these discussions. diff --git a/src/Python/Utilities/VTKImportsForPython.md b/src/Python/Utilities/VTKImportsForPython.md index b91bf461ad63cfed0357b06c05e02a3536eec986..8a4e9a00c0cb42bbdf9bb8b66e0aee951c80a6e8 100644 --- a/src/Python/Utilities/VTKImportsForPython.md +++ b/src/Python/Utilities/VTKImportsForPython.md @@ -9,7 +9,14 @@ When this script is run against your code, a series of `from ... import` stateme At the end of the list there is a series of commented out statements consisting of imports that you may need to enable. Only enable the ones you really need and include the statement `# noinspection PyUnresolvedReferences` for PyCharm users, as this will prevent the statement from being removed. -e.g The most common ones that you need will be the InteractionStyle and the RenderingOpenGL2 ones. +e.g The most common ones will be: + +``` Python + # noinspection PyUnresolvedReferences + import ?vtkmodules?.?vtkInteractionStyle? + # noinspection PyUnresolvedReferences + import ?vtkmodules?.?vtkRenderingOpenGL2? +``` Make sure that any of these statements are placed after the last `from ... import ...` statement. Also remove any unused ones. @@ -17,4 +24,4 @@ If you are using an IDE make sure these import statements are **not** sorted whe As an example, if you have used `import vtk`, you can replace it with with these statements. This means that only the relevant VTK modules are loaded when the Python program runs. -Of course after adding these statements you may need to edit your code. +Of course after adding these statements you may need to edit your code e.g. changing `x = vtk.?vtkSomeClass?()` to `x = ?vtkSomeClass?()`.