Skip to content

Commit

Permalink
update CMakelist and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed Dec 20, 2023
1 parent 26c7fb8 commit ea6e245
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 24 deletions.
19 changes: 2 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,6 @@ find_package(PDAL REQUIRED)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install)
set(CMAKE_DEBUG_POSTFIX d)

######### filter - gridDecimation #########

file( GLOB_RECURSE GD_SRCS ${CMAKE_SOURCE_DIR} src/filter_grid_decimation/*.*)

PDAL_CREATE_PLUGIN(
TYPE filter
NAME grid_decimation
VERSION 1.0
SOURCES ${GD_SRCS}
)


######### Install #########

install(TARGETS
pdal_plugin_filter_grid_decimation
)
## add plugin
add_subdirectory(src/filter_grid_decimation)

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM mambaorg/micromamba:latest as build_ign_pdal_plugin
COPY environment.yml /environment.yml
COPY environment_docker.yml /environment_docker.yml

USER root
RUN micromamba env create -f /environment.yml
RUN micromamba env create -f /environment_docker.yml
SHELL ["micromamba", "run", "-n", "pdal_ign_plugin", "/bin/bash", "-c"]

COPY . .
Expand All @@ -14,4 +14,4 @@ RUN make -j4 install

ENV PATH=$PATH:/opt/conda/envs/pdal_ign_plugin/bin/
ENV PROJ_LIB=/opt/conda/envs/pdal_ign_plugin/share/proj/
ENV PDAL_DRIVER_PATH=/tmp/install/lib
ENV PDAL_DRIVER_PATH=/tmp/install/lib
67 changes: 63 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@ run ci/build.sh

todo...

## Architecture of the code

The code is structured as :

```
├── src
│ ├── plugins forlder
│ │ ├── plufinFilter.cpp
│ │ ├── plufinFilter.h
│ │ ├── CMakeLisits.txt
├── doc
│ ├── plufinFilter.md
├── ci
├── test
├── CMakeLisits.txt
├── environment*.yml
├── Dockerfile
├── .github
└── .gitignore
```

## Run the tests

Each plugin should have his own test. To run test :
Expand All @@ -20,12 +41,50 @@ Each plugin should have his own test. To run test :
python -m pytest -s
```

## Architecture
## List of Filters

todo...
[grid decimation](./doc/grid_decimation.md)

## Filters
## Adding a filter

[grid decimation](./doc/grid_decimation.md)
In order to add a filter, you have to add a new folder in the src directory :

```
├── src
│ ├── filter_my_new_PI
│ │ ├── my_new_PI_Filter.cpp
│ │ ├── my_new_PI_Filter.h
│ │ ├── CMakeLisits.txt
```

The name of the folder informs of the plugIN nature (reader, writer, filter).

The code should respect the documentation purpose by pdal : [build a pdal plugin](https://pdal.io/en/2.6.0/development/plugins.html). Be careful to change if the plugIn is a reader, a writer or a filter.

The CMakeList should contains :

```
file( GLOB_RECURSE GD_SRCS ${CMAKE_SOURCE_DIR} src/my_new_PI/*.*)
PDAL_CREATE_PLUGIN(
TYPE filter
NAME my_new_PI
VERSION 1.0
SOURCES ${GD_SRCS}
)
install(TARGETS pdal_plugin_filter_my_new_PI)
```

You should complet the principal CMakeList by adding the new plugIN :

```
add_subdirectory(src/filter_my_new_PI)
```

Each plugIN has his own md file in the doc directory, structured as the [model](./doc/_doc_model_plugIN.md).

D'ont forget to update [the list](#adding-a-filter) with a link with the documentation.



34 changes: 34 additions & 0 deletions doc/_doc_model_plugIN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# filter my_plugIN

Purpose
---------------------------------------------------------------------------------------------------------


The **my_plugIN** explanation...


Example
---------------------------------------------------------------------------------------------------------

*Give an example of a contextual use of the plugIN*


```
[
...
{
"type": "filters.my_plugIN",
"option1":"*",
},
...
]
```

Options
---------------------------------------------------------------------------------------------------------------------------------------------------------------------

*The plugIn's options*

**option1** :
Explanation of the option and its possible(s) value(s). [Default: *]

3 changes: 3 additions & 0 deletions doc/grid_decimation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# filter grid decimation

Purpose
---------------------------------------------------------------------------------------------------------

The **grid decimation filter** transform only one point in each cells of a grid calculated from the points cloud and a resolution therm. The transformation is done by the value information. The selected point could be the highest or the lowest point on the cell. It can be used, for exemple, to quickly filter vegetation points in order to keep only the canopy points. A new attribut is created with the value '1' for the grid, and '0' for the other points.


Expand Down
6 changes: 6 additions & 0 deletions environment_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: pdal_ign_plugin
channels:
- conda-forge
dependencies:
- pdal

14 changes: 14 additions & 0 deletions src/filter_grid_decimation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

file( GLOB_RECURSE GD_SRCS ${CMAKE_SOURCE_DIR} src/filter_grid_decimation/*.*)

PDAL_CREATE_PLUGIN(
TYPE filter
NAME grid_decimation
VERSION 1.0
SOURCES ${GD_SRCS}
)

install(TARGETS
pdal_plugin_filter_grid_decimation
)

0 comments on commit ea6e245

Please sign in to comment.