Skip to content

Commit 866fa38

Browse files
committed
removed has_value, added reader name field in doc, fixed missed formats
1 parent 6a2dad4 commit 866fa38

File tree

5 files changed

+42
-40
lines changed

5 files changed

+42
-40
lines changed

doc/user/OPTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ F3D behavior can be fully controlled from the command line using the following o
1414
| -h, \-\-help | | Print _help_ and exit. Ignore `--verbose`. |
1515
| \-\-version | | Show _version_ information and exit. Ignore `--verbose`. |
1616
| \-\-list-readers | | List available _readers_ and exit. Ignore `--verbose`. |
17-
| \-\-force-reader=\<reader\> | string<br>- | Force a specific reader to be used, disregarding the file extension. |
17+
| \-\-force-reader=\<reader\> | string<br>- | Force a specific [reader](SUPPORTED_FORMATS.md) to be used, disregarding the file extension. |
1818
| \-\-list-bindings | | List available _bindings_ and exit. Ignore `--verbose`. |
1919
| \-\-list-rendering-backends | | List available _rendering backends_ and exit. Ignore `--verbose`. |
2020
| \-\-config=\<config file path/name/stem\> | string<br>config | Specify the [configuration file](CONFIGURATION_FILE.md) to use. Supports absolute/relative path but also filename/filestem to search for in standard configuration file locations. |

doc/user/SUPPORTED_FORMATS.md

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,41 @@
22

33
F3D supports the following file formats:
44

5-
| Name | File Extension(s) | Full scene | Animation Supported? | Plugin |
6-
| ----------------------------------------- | ---------------------------------------------- | ---------- | -------------------- | --------- |
7-
| Legacy VTK | `.vtk` | No | No | `native` |
8-
| VTK XML | `.vtp`, `.vtu`, `.vtr`, `.vti`, `.vts`, `.vtm` | No | No | `native` |
9-
| VTKHDF | `.vtkhdf` | No | Yes | `hdf` |
10-
| EXODUS II | `.e`, `.ex2`, `.exo`, `.g` | No | Yes | `hdf` |
11-
| Polygon File Format | `.ply` | No | No | `native` |
12-
| Standard Triangle Language | `.stl` | No | No | `native` |
13-
| DICOM | `.dcm` | No | No | `native` |
14-
| NRRD ("nearly raw raster data") | `.nrrd`, `.nhrd` | No | No | `native` |
15-
| MetaHeader MetaIO | `.mhd`, `.mha` | No | No | `native` |
16-
| Tag Image File Format 2D/3D | `.tif`, `.tiff` | No | No | `native` |
17-
| QuakeMDL | `.mdl` | Yes | Yes | `native` |
18-
| CityGML | `.gml` | No | No | `native` |
19-
| Point Cloud | `.pts` | No | No | `native` |
20-
| Standard for the Exchange of Product Data | `.step`, `.stp` | No | No | `occt` |
21-
| Initial Graphics Exchange Specification | `.iges`, `.igs` | No | No | `occt` |
22-
| Open CASCADE Technology BRep format | `.brep` | No | No | `native` |
23-
| Alembic | `.abc` | No | Yes | `alembic` |
24-
| Wavefront OBJ | `.obj` | Yes | Yes | `native` |
25-
| GL Transmission Format | `.gltf`, `.glb` | Yes | Yes | `native` |
26-
| Autodesk 3D Studio | `.3ds` | Yes | No | `native` |
27-
| Virtual Reality Modeling Language | `.wrl` | Yes | No | `native` |
28-
| Autodesk Filmbox | `.fbx` | Yes | Yes | `assimp` |
29-
| COLLADA | `.dae` | Yes | Yes | `assimp` |
30-
| Object File Format | `.off` | Yes | No | `assimp` |
31-
| Drawing Exchange Format | `.dxf` | Yes | No | `assimp` |
32-
| DirectX | `.x` | Yes | Yes | `assimp` |
33-
| 3D Manufacturing Format | `.3mf` | Yes | No | `assimp` |
34-
| Universal Scene Description | `.usd`, `.usda`, `.usdc`, `.usdz` | Yes | Yes | `usd` |
35-
| VDB | `.vdb` | No | No | `vdb` |
36-
| 3D Gaussian splatting | `.splat` | No | No | `native` |
37-
| Compressed 3D Gaussian splatting | `.spz` | No | No | `native` |
5+
| Name | File Extension(s) | Full scene | Animation Supported? | Plugin | Reader Name |
6+
| ----------------------------------------- | ---------------------------------------------- | ---------- | -------------------- | ------------------|-------------------------|
7+
| Legacy VTK | `.vtk` | No | No | `native` | `VTKLegacy` |
8+
| VTK XML | `.vtp`, `.vtu`, `.vtr`, `.vti`, `.vts`, `.vtm` | No | No | `native` | `VTKXMLVT<P,U,R,I,S,M>` |
9+
| VTKHDF | `.vtkhdf` | No | Yes | `hdf` | `VTKHDF` |
10+
| EXODUS II | `.e`, `.ex2`, `.exo`, `.g` | No | Yes | `hdf` | `ExodusII` |
11+
| Polygon File Format | `.ply` | No | No | `native` | `PLYReader` |
12+
| Standard Triangle Language | `.stl` | No | No | `native` | `STL` |
13+
| DICOM | `.dcm` | No | No | `native` | `DICOM` |
14+
| NRRD ("nearly raw raster data") | `.nrrd`, `.nhdr` | No | No | `native` | `Nrrd` |
15+
| MetaHeader MetaIO | `.mhd`, `.mha` | No | No | `native` | `MetaImage` |
16+
| Tag Image File Format 2D/3D | `.tif`, `.tiff` | No | No | `native` | `TIFF` |
17+
| QuakeMDL | `.mdl` | Yes | Yes | `native` | `QuakeMDL` |
18+
| CityGML | `.gml` | No | No | `native` | `CityGML` |
19+
| Point Cloud | `.pts` | No | No | `native` | `PTS` |
20+
| Standard for the Exchange of Product Data | `.step`, `.stp`, `.stpnc`, `.p21`, `.210` | No | No | `occt` | `STEP` |
21+
| Initial Graphics Exchange Specification | `.iges`, `.igs` | No | No | `occt` | `IGES` |
22+
| Open CASCADE Technology BRep format | `.brep` | No | No | `native` | `BREP` |
23+
| Open CASCADE Technology XBF format | `.xbf` | No | No | `occt` | `XBF` |
24+
| Alembic | `.abc` | No | Yes | `alembic` | `Alembic` |
25+
| Wavefront OBJ | `.obj` | Yes | Yes | `native` | `OBJ` |
26+
| GL Transmission Format | `.gltf`, `.glb` | Yes | Yes | `native` | `GLTF`, `GLTFDraco` |
27+
| Draco | `.drc` | No | No | `draco` | `Draco` |
28+
| Autodesk 3D Studio | `.3ds` | Yes | No | `native` | `3DS` |
29+
| Virtual Reality Modeling Language | `.wrl`, `.vrml` | Yes | No | `native` | `VRMLReader` |
30+
| Autodesk Filmbox | `.fbx` | Yes | Yes | `assimp` | `FBX` |
31+
| COLLADA | `.dae` | Yes | Yes | `assimp` | `COLLADA` |
32+
| Object File Format | `.off` | Yes | No | `assimp` | `OFF` |
33+
| Drawing Exchange Format | `.dxf` | Yes | No | `assimp` | `DXF` |
34+
| DirectX | `.x` | Yes | Yes | `assimp` | `DirectX` |
35+
| 3D Manufacturing Format | `.3mf` | Yes | No | `assimp` | `3MF` |
36+
| Universal Scene Description | `.usd`, `.usda`, `.usdc`, `.usdz` | Yes | Yes | `usd` | `USD` |
37+
| VDB | `.vdb` | No | No | `vdb` | `VDB` |
38+
| 3D Gaussian splatting | `.splat` | No | No | `native` | `Splat` |
39+
| Compressed 3D Gaussian splatting | `.spz` | No | No | `native` | `SPZ` |
3840

3941
## Reader options
4042

library/src/factory.cxx.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ reader* factory::getReader(const std::string& fileName, std::optional<std::strin
4949
{
5050
for (const auto& reader : plugin->getReaders())
5151
{
52-
if (forceReader.has_value())
52+
if (forceReader)
5353
{
5454
if (reader->getName() == *forceReader)
5555
{

library/src/scene_impl.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ scene& scene_impl::add(const std::vector<fs::path>& filePaths)
238238
{
239239
throw scene::load_failure_exception(filePath.string() + " does not exists");
240240
}
241-
auto forceReader = this->Internals->Options.scene.force_reader;
241+
std::optional<std::string> forceReader = this->Internals->Options.scene.force_reader;
242242
// Recover the importer for the provided file path
243243
f3d::reader* reader = f3d::factory::instance()->getReader(filePath.string(), forceReader);
244244
if (reader)
245245
{
246-
if (forceReader.has_value())
246+
if (forceReader)
247247
{
248248
if (!reader->canRead(filePath.string()))
249249
{
@@ -259,7 +259,7 @@ scene& scene_impl::add(const std::vector<fs::path>& filePaths)
259259
}
260260
else
261261
{
262-
if (forceReader.has_value())
262+
if (forceReader)
263263
{
264264
throw scene::load_failure_exception(*forceReader + " is not a valid force reader");
265265
}

plugins/assimp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ f3d_plugin_declare_reader(
3333
)
3434

3535
f3d_plugin_declare_reader(
36-
NAME Collada
36+
NAME COLLADA
3737
EXTENSIONS dae
3838
MIMETYPES application/vnd.dae
3939
VTK_IMPORTER vtkF3DAssimpImporter
40-
FORMAT_DESCRIPTION "Collada"
40+
FORMAT_DESCRIPTION "COLLADA"
4141
CUSTOM_CODE "${CMAKE_CURRENT_SOURCE_DIR}/collada.inl"
4242
)
4343

0 commit comments

Comments
 (0)