Skip to content

Commit

Permalink
#20 Remove mesh from shapes example
Browse files Browse the repository at this point in the history
  • Loading branch information
kwabenantim committed Oct 16, 2024
1 parent c07ea2d commit 6e4bd48
Show file tree
Hide file tree
Showing 26 changed files with 34 additions and 508 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: python -m flake8

- name: Test wrapper generation
run: python -m unittest tests/test_wrapper_generation.py
run: python -m unittest test/test_wrapper_generation.py

- name: Generate new wrappers
run: |
Expand All @@ -52,7 +52,7 @@ jobs:
cppwg src/cpp \
--wrapper_root wrapper/ \
--package_info wrapper/package_info.yaml \
--includes src/cpp/*/ extern/*/ \
--includes src/cpp/*/ \
--std c++17 \
--logfile cppwg.log
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ cd examples/shapes
cppwg src/cpp \
--wrapper_root wrapper \
--package_info wrapper/package_info.yaml \
--includes src/cpp/geometry src/cpp/math_funcs src/cpp/mesh src/cpp/primitives extern/meshgen
--includes src/cpp/geometry src/cpp/math_funcs src/cpp/mesh src/cpp/primitives
```

For the `Rectangle` class, this creates two files in
Expand Down
8 changes: 1 addition & 7 deletions examples/shapes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(pybind11)

# Add external library
add_subdirectory(extern/meshgen meshgen_build)

# Add a shared library for the main C++ source
file(GLOB_RECURSE SHAPES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/*.cpp)
add_library(shapes SHARED ${SHAPES_SOURCES})
Expand All @@ -28,10 +25,8 @@ target_include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src/cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/geometry
${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/math_funcs
${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/mesh
${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/primitives
)
target_link_libraries(shapes PUBLIC meshgen::meshgen)

# Copy the Python source and test trees to the build location
file(
Expand All @@ -44,7 +39,7 @@ file(
)

# Create a shared library for each wrapper module
foreach(MODULE geometry math_funcs mesh primitives)
foreach(MODULE geometry math_funcs primitives)
# Add the autogenerated wrappers to the module target
file(GLOB MODULE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/wrapper/${MODULE}/*.cpp)

Expand All @@ -63,7 +58,6 @@ foreach(MODULE geometry math_funcs mesh primitives)
${CMAKE_CURRENT_SOURCE_DIR}/wrapper
${CMAKE_CURRENT_SOURCE_DIR}/wrapper/geometry
${CMAKE_CURRENT_SOURCE_DIR}/wrapper/math_funcs
${CMAKE_CURRENT_SOURCE_DIR}/wrapper/mesh
${CMAKE_CURRENT_SOURCE_DIR}/wrapper/primitives
)

Expand Down
6 changes: 0 additions & 6 deletions examples/shapes/extern/meshgen/CMakeLists.txt

This file was deleted.

16 changes: 0 additions & 16 deletions examples/shapes/extern/meshgen/MeshGen.cpp

This file was deleted.

24 changes: 0 additions & 24 deletions examples/shapes/extern/meshgen/MeshGen.hpp

This file was deleted.

31 changes: 0 additions & 31 deletions examples/shapes/src/cpp/mesh/AbstractMesh.cpp

This file was deleted.

50 changes: 0 additions & 50 deletions examples/shapes/src/cpp/mesh/AbstractMesh.hpp

This file was deleted.

19 changes: 0 additions & 19 deletions examples/shapes/src/cpp/mesh/ConcreteMesh.cpp

This file was deleted.

29 changes: 0 additions & 29 deletions examples/shapes/src/cpp/mesh/ConcreteMesh.hpp

This file was deleted.

16 changes: 0 additions & 16 deletions examples/shapes/src/cpp/mesh/MeshFactory.cpp

This file was deleted.

27 changes: 0 additions & 27 deletions examples/shapes/src/cpp/mesh/MeshFactory.hpp

This file was deleted.

13 changes: 0 additions & 13 deletions examples/shapes/src/py/test/test_classes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import unittest

import pyshapes.geometry
import pyshapes.mesh
import pyshapes.primitives


Expand Down Expand Up @@ -36,25 +35,13 @@ def testGeometry(self):
cuboid = pyshapes.primitives.Cuboid(5.0, 10.0, 20.0)
self.assertTrue(len(cuboid.rGetVertices()) == 8)

def testMesh(self):

cmesh = pyshapes.mesh.ConcreteMesh_2()
self.assertTrue(cmesh.GetIndex() == 0)

cmesh.SetIndex(1)
self.assertTrue(cmesh.GetIndex() == 1)

def testSyntax(self):

self.assertEqual(pyshapes.geometry.Point[2], pyshapes.geometry.Point_2)

point = pyshapes.geometry.Point[3](0.0, 1.0, 2.0)
self.assertTrue(point.GetLocation() == [0.0, 1.0, 2.0])

self.assertEqual(
pyshapes.mesh.AbstractMesh[2, 2], pyshapes.mesh.AbstractMesh_2_2
)


if __name__ == "__main__":
unittest.main()
45 changes: 0 additions & 45 deletions examples/shapes/wrapper/mesh/AbstractMesh_2_2.cppwg.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions examples/shapes/wrapper/mesh/AbstractMesh_2_2.cppwg.hpp

This file was deleted.

Loading

0 comments on commit 6e4bd48

Please sign in to comment.