Skip to content

Commit de3ab6b

Browse files
committed
Add CLI option illustrations
1 parent cf83386 commit de3ab6b

28 files changed

Lines changed: 147 additions & 4 deletions

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ examples/**/*/data/**/* filter=lfs diff=lfs merge=lfs -text
55
examples/**/*/public/**/* filter=lfs diff=lfs merge=lfs -text
66
examples/**/*/baselines/**/* filter=lfs diff=lfs merge=lfs -text
77
.github/baselines/**/* filter=lfs diff=lfs merge=lfs -text
8+
doc/user/images/**/* filter=lfs diff=lfs merge=lfs -text

application/testing/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ if(F3D_PLUGIN_BUILD_PDAL)
4747
endif()
4848

4949
include(tests.watch.cmake)
50+
51+
include(tests.documentation.cmake)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Tests the documentation illustrations in doc/user
2+
3+
## --up
4+
f3d_test(NAME TestDocUpY DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/up_y.png RESOLUTION 800,600 ARGS --no-background --up=y --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa -gx LABELS doc)
5+
f3d_test(NAME TestDocUpZ DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/up_z.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa -gx LABELS doc)
6+
7+
## --axis
8+
f3d_test(NAME TestDocAxisOff DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/axis_off.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa LABELS doc)
9+
f3d_test(NAME TestDocAxisOn DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/axis_on.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa -x LABELS doc)
10+
11+
## --grid
12+
f3d_test(NAME TestDocGridOff DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/grid_off.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa LABELS doc)
13+
f3d_test(NAME TestDocGridOn DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/grid_on.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa -g LABELS doc)
14+
15+
## --axes-grid
16+
f3d_test(NAME TestDocAxesGridOff DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/axes_grid_off.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 LABELS doc)
17+
f3d_test(NAME TestDocAxesGridOn DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/axes_grid_on.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --axes-grid LABELS doc)
18+
19+
## --edges
20+
f3d_test(NAME TestDocEdgesOff DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/edges_off.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 LABELS doc)
21+
f3d_test(NAME TestDocEdgesOn DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/edges_on.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --edges LABELS doc)
22+
23+
## --armature
24+
f3d_test(NAME TestDocArmatureOff DATA RiggedFigure.glb BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/armature_off.png RESOLUTION 800,600 ARGS --no-background --anti-aliasing=fxaa LABELS doc)
25+
f3d_test(NAME TestDocArmatureOn DATA RiggedFigure.glb BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/armature_on.png RESOLUTION 800,600 ARGS --no-background --anti-aliasing=fxaa --armature LABELS doc)
26+
27+
## --font-scale
28+
f3d_test(NAME TestDocFontScale1 DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/font_scale_1.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 -n LABELS doc)
29+
f3d_test(NAME TestDocFontScale2 DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/font_scale_2.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 -n --font-scale=2 LABELS doc)
30+
31+
## --font-color
32+
f3d_test(NAME TestDocFontColorDefault DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/font_color_default.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 -nm LABELS doc)
33+
f3d_test(NAME TestDocFontColorRed DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/font_color_red.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 -nm --font-color=red LABELS doc)
34+
35+
## --backdrop-opacity
36+
f3d_test(NAME TestDocBackdropOpacityDefault DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/backdrop_opacity_default.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 -nm LABELS doc)
37+
f3d_test(NAME TestDocBackdropOpacity02 DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/backdrop_opacity_0.2.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 -nm --backdrop-opacity=0.2 LABELS doc)
38+
39+
## --normal-glyphs
40+
f3d_test(NAME TestDocNormalGlyphsOff DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/normal_glyphs_off.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa LABELS doc)
41+
f3d_test(NAME TestDocNormalGlyphsOn DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/normal_glyphs_on.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa --normal-glyphs LABELS doc)
42+
43+
## --normal-glyphs-scale
44+
f3d_test(NAME TestDocNormalGlyphsScaleDefault DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/normal_glyphs_scale_default.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa --normal-glyphs LABELS doc)
45+
f3d_test(NAME TestDocNormalGlyphsScale2 DATA f3d.vtp BASELINE_PATH ${F3D_SOURCE_DIR}/doc/user/images/normal_glyphs_scale_2.png RESOLUTION 800,600 ARGS --no-background --up=z --scalar-coloring -c --coloring-component=-2 --anti-aliasing=ssaa --normal-glyphs --normal-glyphs-scale=2 LABELS doc)

cmake/f3dTest.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ f3d_test(<NAME> [ARGS...])
3737
Add `piped` test labels.
3838
- `SCRIPT` Mark the test to use a `--script` of the same name as the test
3939
- `NAME` Provide the name of the test, mandatory and must be unique
40+
- `BASELINE_PATH` Provide the path to the baseline to use, instead of the default
4041
- `CONFIG` Provide the `--config` to use, instead of `--no-config`
4142
- `RESOLUTION` Provide the `--resolution` to use, instead of `300,300`
4243
- `PLUGIN` Provide the `--load-plugins` to use, also set test labels accordingly
@@ -55,7 +56,7 @@ f3d_test(<NAME> [ARGS...])
5556

5657
function(f3d_test)
5758

58-
cmake_parse_arguments(F3D_TEST "LONG_TIMEOUT;DEFAULT_HDRI;INTERACTION;INTERACTION_CONFIGURE;NO_BASELINE;NO_RENDER;NO_OUTPUT;WILL_FAIL;NO_DATA_FORCE_RENDER;UI;SCRIPT" "NAME;CONFIG;RESOLUTION;THRESHOLD;REGEXP;REGEXP_FAIL;HDRI;RENDERING_BACKEND;WORKING_DIR;DPI_SCALE;PIPED;PLUGIN" "DATA;DEPENDS;LABELS;ENV;ARGS" ${ARGN})
59+
cmake_parse_arguments(F3D_TEST "LONG_TIMEOUT;DEFAULT_HDRI;INTERACTION;INTERACTION_CONFIGURE;NO_BASELINE;NO_RENDER;NO_OUTPUT;WILL_FAIL;NO_DATA_FORCE_RENDER;UI;SCRIPT" "NAME;BASELINE_PATH;CONFIG;RESOLUTION;THRESHOLD;REGEXP;REGEXP_FAIL;HDRI;RENDERING_BACKEND;WORKING_DIR;DPI_SCALE;PIPED;PLUGIN" "DATA;DEPENDS;LABELS;ENV;ARGS" ${ARGN})
5960

6061
if(F3D_TEST_CONFIG)
6162
list(APPEND F3D_TEST_ARGS "--config=${F3D_TEST_CONFIG}")
@@ -111,7 +112,11 @@ function(f3d_test)
111112
endif()
112113

113114
if(NOT F3D_TEST_NO_BASELINE)
114-
list(APPEND F3D_TEST_ARGS "--reference=${F3D_SOURCE_DIR}/testing/baselines/${F3D_TEST_NAME}.png")
115+
if (DEFINED F3D_TEST_BASELINE_PATH)
116+
list(APPEND F3D_TEST_ARGS "--reference=${F3D_TEST_BASELINE_PATH}")
117+
else()
118+
list(APPEND F3D_TEST_ARGS "--reference=${F3D_SOURCE_DIR}/testing/baselines/${F3D_TEST_NAME}.png")
119+
endif()
115120

116121
if(DEFINED F3D_TEST_THRESHOLD)
117122
list(APPEND F3D_TEST_ARGS "--reference-threshold=${F3D_TEST_THRESHOLD}")

doc/user/03-OPTIONS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ When loading a file group, if they results in an empty scene, remove the file gr
127127

128128
Define the Up direction.
129129

130+
#### Up direction
131+
132+
| +Y | +Z |
133+
|------------------------|------------------------|
134+
| ![](./images/up_y.png) | ![](./images/up_z.png) |
135+
130136
### `-x`, `--axis` (_bool_, default: `false`)
131137

132138
Show _axes_ as a trihedron in the scene.
@@ -179,6 +185,12 @@ Show the _cell edges_.
179185

180186
Show armature if present (glTF only).
181187

188+
#### Armature display
189+
190+
| Disabled | Enable |
191+
|--------------------------------|-------------------------------|
192+
| ![](./images/armature_off.png) | ![](./images/armature_on.png) |
193+
182194
### `--camera-index=<idx>` (_int_)
183195

184196
Select the scene camera to use when available in the file. Automatically computed by default.

doc/user/images/armature_off.png

Lines changed: 3 additions & 0 deletions
Loading

doc/user/images/armature_on.png

Lines changed: 3 additions & 0 deletions
Loading

doc/user/images/axes_grid_off.png

Lines changed: 3 additions & 0 deletions
Loading

doc/user/images/axes_grid_on.png

Lines changed: 3 additions & 0 deletions
Loading

doc/user/images/axis_off.png

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)