-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bindgen): support typescript mesh interface type
- Loading branch information
Showing
16 changed files
with
4,414 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
emscripten-build/ | ||
typescript/ |
24 changes: 24 additions & 0 deletions
24
test/pipelines/bindgen-interface-types-pipeline/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(bindgen-interface-types-test) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
set(io_components) | ||
if(NOT EMSCRIPTEN) | ||
set(io_components ITKIOMeshVTK) | ||
endif() | ||
find_package(ITK REQUIRED | ||
COMPONENTS | ||
${io_components} | ||
WebAssemblyInterface | ||
) | ||
include(${ITK_USE_FILE}) | ||
|
||
add_executable(bindgen-interface-types-test bindgen-interface-types-test.cxx) | ||
target_link_libraries(bindgen-interface-types-test PUBLIC ${ITK_LIBRARIES}) | ||
|
||
enable_testing() | ||
add_test(NAME bindgen-interface-types-test | ||
COMMAND bindgen-interface-types-test ${CMAKE_CURRENT_SOURCE_DIR}/cow.vtk | ||
${CMAKE_CURRENT_BINARY_DIR}/cow.written.vtk | ||
) |
44 changes: 44 additions & 0 deletions
44
test/pipelines/bindgen-interface-types-pipeline/bindgen-interface-types-test.cxx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/*========================================================================= | ||
* | ||
* Copyright NumFOCUS | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0.txt | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*=========================================================================*/ | ||
#include "itkMesh.h" | ||
#include "itkInputMesh.h" | ||
#include "itkOutputMesh.h" | ||
#include "itkPipeline.h" | ||
|
||
int main( int argc, char * argv[] ) | ||
{ | ||
itk::wasm::Pipeline pipeline("bindgen-interface-types-test", "A test to exercise interface types for bindgen", argc, argv); | ||
|
||
using PixelType = float; | ||
constexpr unsigned int Dimension = 3; | ||
using MeshType = itk::Mesh< PixelType, Dimension >; | ||
|
||
using InputMeshType = itk::wasm::InputMesh<MeshType>; | ||
InputMeshType inputMesh; | ||
pipeline.add_option("input-mesh", inputMesh, "The input mesh")->required()->type_name("INPUT_MESH"); | ||
|
||
using OutputMeshType = itk::wasm::OutputMesh<MeshType>; | ||
OutputMeshType outputMesh; | ||
pipeline.add_option("output-mesh", outputMesh, "The output mesh")->required()->type_name("OUTPUT_MESH"); | ||
|
||
ITK_WASM_PARSE(pipeline); | ||
|
||
outputMesh.Set(inputMesh.Get()); | ||
|
||
return EXIT_SUCCESS; | ||
} |
Oops, something went wrong.