Skip to content

Commit

Permalink
Merge pull request #154 from SimonRohou/codac2_dev
Browse files Browse the repository at this point in the history
[core] inlining Interval methods and related operators
  • Loading branch information
SimonRohou authored Dec 6, 2024
2 parents e432ca9 + 475592c commit 725adeb
Show file tree
Hide file tree
Showing 19 changed files with 860 additions and 710 deletions.
49 changes: 49 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,53 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mathjax_stmaryrd.js

endif()

endif()

# User manual (Sphinx)

find_package(Sphinx)

if(NOT SPHINX_FOUND)

message(STATUS "Sphinx not found, will not be able to generate the manual.")

else()

# Includes CMake commands in config file:
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/manual/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/manual/conf.py)

set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/manual)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/manual)

# Copying _static files of Sphinx to build directories
foreach(static_file ${CMAKE_CURRENT_SOURCE_DIR}/manual/_static/)
file(COPY ${static_file} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/manual/_static/)
endforeach()

# Copying tmp files
foreach(static_file ${CMAKE_CURRENT_SOURCE_DIR}/manual/tmp/)
file(COPY ${static_file} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/manual/tmp/)
endforeach()

# todo: the SPHINX_EXECUTABLE is already set by FindSphinx.cmake:
# check that it works without the following overload for Win and Linux:
if(WIN32)
set(SPHINX_EXECUTABLE "sphinx-build")
else()
set(SPHINX_EXECUTABLE "python3" "-msphinx")
endif()

add_custom_target(manual
COMMAND
${SPHINX_EXECUTABLE} -b html
# Specifying path to conf.py generated by CMake:
-c ${CMAKE_CURRENT_BINARY_DIR}/manual/
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating the manual website using Sphinx")

install(DIRECTORY ${SPHINX_BUILD}/
DESTINATION share/manual/${CMAKE_PROJECT_NAME}
OPTIONAL)

endif()
10 changes: 10 additions & 0 deletions doc/manual/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
div.rst-content a:visited
{
color: #2980b9;
text-decoration: none;
}

div.rst-content li.toctree-l1 > a
{
font-weight: bold;
}
Empty file added doc/manual/_static/empty.txt
Empty file.
Empty file added doc/manual/_templates/empty.txt
Empty file.
40 changes: 40 additions & 0 deletions doc/manual/conf.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Codac'
copyright = 'Codac Team'
author = 'Codac Team'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'sphinx_rtd_theme',
]

templates_path = ['_templates']
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_static_path = ['_static']
html_theme = "sphinx_rtd_theme"
html_logo = "_static/logos/logo_codac.svg"

# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = [
'css/custom.css',
]

html_theme_options = {
'logo_only': True,
'display_version': True,
}
51 changes: 51 additions & 0 deletions doc/manual/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Codac manual
============


.. toctree::
:caption: Overview of Codac
:maxdepth: 3

Constraint programming and IA <http://codac.io>
The Codac framework <http://codac.io>
Target audience <http://codac.io>


.. toctree::
:caption: User manual
:maxdepth: 3

installation/index.rst
intervals/index.rst
linear/index.rst
functions/index.rst
tubes/index.rst
contractors/index.rst
separators/index.rst
pavers/index.rst
cn/index.rst
geometry/index.rst
ellipsoids/index.rst
topology/index.rst
visualization/index.rst
extensions/index.rst
seealso/index.rst
references/index.rst


.. toctree::
:caption: How-to guides
:maxdepth: 3

howto/robotics/index.rst
howto/geometry/index.rst
howto/dynamical/index.rst


.. toctree::
:caption: Development
:maxdepth: 3

Changelog <http://codac.io>
C++ API <http://codac.io>
Information for developers <http://codac.io>
Empty file added doc/manual/tmp/empty.txt
Empty file.
File renamed without changes.
20 changes: 20 additions & 0 deletions scripts/CMakeModules/FindSphinx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include(FindPackageHandleStandardArgs)

# We are likely to find Sphinx near the Python interpreter
find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
get_filename_component(_PYTHON_DIR "${PYTHON_EXECUTABLE}" DIRECTORY)
set(
_PYTHON_PATHS
"${_PYTHON_DIR}"
"${_PYTHON_DIR}/bin"
"${_PYTHON_DIR}/Scripts")
endif()

find_program(
SPHINX_EXECUTABLE
NAMES sphinx-build sphinx-build.exe
HINTS ${_PYTHON_PATHS})
mark_as_advanced(SPHINX_EXECUTABLE)

find_package_handle_standard_args(Sphinx DEFAULT_MSG SPHINX_EXECUTABLE)
1 change: 0 additions & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

${CMAKE_CURRENT_SOURCE_DIR}/domains/codac2_BoolInterval.h
${CMAKE_CURRENT_SOURCE_DIR}/domains/codac2_Domain.h
${CMAKE_CURRENT_SOURCE_DIR}/domains/interval/codac2_Interval.cpp
${CMAKE_CURRENT_SOURCE_DIR}/domains/interval/codac2_Interval.h
${CMAKE_CURRENT_SOURCE_DIR}/domains/interval/codac2_Interval_operations.cpp
${CMAKE_CURRENT_SOURCE_DIR}/domains/interval/codac2_Interval_operations.h
Expand Down
Loading

0 comments on commit 725adeb

Please sign in to comment.