diff --git a/CMakeLists.txt b/CMakeLists.txt index 61b243a4..d193fd6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ PROJECT(GoTools) - CMAKE_MINIMUM_REQUIRED(VERSION 3.5) # Set version info @@ -72,47 +71,6 @@ SET(Boost_ADDITIONAL_VERSIONS ) FIND_PACKAGE(Boost) -# Check if compiler supports c++-0x -INCLUDE(CheckCXXCompilerFlag) -IF(CMAKE_CXX_COMPILER_ID MATCHES GNU OR - CMAKE_CXX_COMPILER_ID MATCHES Clang) - CHECK_CXX_COMPILER_FLAG("-std=gnu++0x" HAVE_0x) - IF(HAVE_0x) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") - ELSE(HAVE_0x) - # C++0x is not supported - check for Boost? - IF(Boost_FOUND) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOOST=1") - SET(GoTools_COMMON_INCLUDE_DIRS - ${GoTools_COMMON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) - ELSE(Boost_FOUND) - MESSAGE(FATAL_ERROR "Either Boost or a compiler with c++0x support is needed") - ENDIF(Boost_FOUND) - ENDIF(HAVE_0x) -ENDIF() #CMAKE_CXX_COMPILER_ID MATCHES GNU or Clang) -IF(CMAKE_CXX_COMPILER_ID MATCHES Intel) - # icpc's c++0x is lacking - IF(Boost_FOUND) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOOST=1") - SET(GoTools_COMMON_INCLUDE_DIRS - ${GoTools_COMMON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) - ELSE(Boost_FOUND) - MESSAGE(FATAL_ERROR "Either Boost or a compiler with c++0x support is needed") - ENDIF(Boost_FOUND) -ENDIF(CMAKE_CXX_COMPILER_ID MATCHES Intel) -IF(CMAKE_CXX_COMPILER_ID MATCHES MSVC) - IF(MSVC90) # Visual Studio 2008 support (c++0x is missing) - IF(Boost_FOUND) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOOST=1") - SET(GoTools_COMMON_INCLUDE_DIRS - ${GoTools_COMMON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) - ELSE(Boost_FOUND) - MESSAGE(FATAL_ERROR "Either Boost or a compiler with c++0x support is needed") - ENDIF(Boost_FOUND) - ENDIF(MSVC90) -ENDIF(CMAKE_CXX_COMPILER_ID MATCHES MSVC) - - # Set install prefix on Windows IF(WIN32) SET(CMAKE_INSTALL_PREFIX CACHE INTERNAL "") @@ -122,16 +80,13 @@ ENDIF(WIN32) # Organize the project in folders (VS only?) SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) - # For newmat/sisl/ttl to know they are compiled as modules SET(GoTools_ALL_COMPILE 1) - # Compile apps and examples OPTION(GoTools_COMPILE_APPS "Compile applications?" ON) - # Compile unit test - depends on Boost IF(Boost_FOUND) OPTION(GoTools_COMPILE_TESTS @@ -146,7 +101,6 @@ IF(Boost_FOUND) ENDIF(GoTools_COMPILE_TESTS) ENDIF(Boost_FOUND) - # Comment out the modules you don't want to build ADD_SUBDIRECTORY(newmat) diff --git a/gotools-core/include/GoTools/geometry/SplineSurface.h b/gotools-core/include/GoTools/geometry/SplineSurface.h index b86b8c8d..96810da9 100644 --- a/gotools-core/include/GoTools/geometry/SplineSurface.h +++ b/gotools-core/include/GoTools/geometry/SplineSurface.h @@ -760,6 +760,16 @@ class GO_API SplineSurface : public ParamSurface const BsplineBasis& basis(int i) const { return (i==0) ? basis_u_ : basis_v_; } + + /// Query the number of control points along the specified parameter direction + /// \param pardir specify whether to return the number of coefs for the first + /// parameter (0) or for the second parameter (1). + /// \return the number of control points along the specified parameter direction + int numCoefs(int pardir) const + { + return (pardir == 0) ? basis_u_.numCoefs() : basis_v_.numCoefs(); + } + /// Query the number of control points along the first parameter direction /// \return the number of control points along the first parameter direction int numCoefs_u() const @@ -771,6 +781,7 @@ class GO_API SplineSurface : public ParamSurface { return basis_v_.numCoefs(); } /// Query the number of elements in the SplineSurface + /// \return the number of 2D elements in the surface int numElem() const { return basis_u_.numElem()*basis_v_.numElem(); @@ -778,10 +789,20 @@ class GO_API SplineSurface : public ParamSurface /// Query the number of elements in one parameter direction of /// the SplineSurface + /// \param pardir specify whether to return the order for the first + /// parameter (0) or for the second parameter (1). int numElem(int pardir) const { - return (pardir == 0) ? basis_u_.numElem() : - basis_v_.numElem(); + return (pardir == 0) ? basis_u_.numElem() : basis_v_.numElem(); + } + + /// Query the order of the BsplineBasis for the specified parameter + /// \param pardir specify whether to return the order for the first + /// parameter (0) or for the second parameter (1). + /// \return the order of the BsplineBasis for the specified parameter direction + int order(int pardir) const + { + return (pardir == 0) ? basis_u_.order() : basis_v_.order(); } /// Query the order of the BsplineBasis for the first parameter @@ -909,6 +930,25 @@ class GO_API SplineSurface : public ParamSurface /// \param v2 new max. value of second parameter span virtual void setParameterDomain(double u1, double u2, double v1, double v2); + /// Insert a new knot in the knotvector of the given parameter direction + /// \param pardir parameter direction in which to insert the knots + /// (u=0, v=1) + /// \param apar the parameter value at which a new knot will be inserted + void insertKnot(int pardir, double apar) + { + (pardir == 0) ? insertKnot_u(apar) : insertKnot_v(apar); + } + + /// Insert new knots in the knotvector of the given parameter direction + /// \param pardir parameter direction in which to insert the knots + /// (u=0, v=1, w=2) + /// \param new_knots a vector containing the parameter values of the + /// new knots to insert. + void insertKnot(int pardir, const std::vector& new_knots) + { + (pardir == 0) ? insertKnot_u(new_knots) : insertKnot_v(new_knots); + } + /// Insert a new knot in the knotvector of the first parameter /// \param apar the parameter value at which a new knot will be inserted void insertKnot_u(double apar); @@ -927,6 +967,14 @@ class GO_API SplineSurface : public ParamSurface /// new knots to insert. void insertKnot_v(const std::vector& new_knots); + /// Remove a knot from the knotvector of the given parameter direction. + /// \param pardir the parameter direction (u=0, v=1) + /// \param tpar the parameter value of the knot to be removed + void removeKnot(int pardir, double tpar) + { + (pardir == 0) ? removeKnot_u(tpar) : removeKnot_v(tpar); + } + /// Remove a knot from the knotvector of the first parameter. /// \param tpar the parameter value of the knot to be removed void removeKnot_u(double tpar); @@ -935,6 +983,14 @@ class GO_API SplineSurface : public ParamSurface /// \param tpar the parameter value of the knot to be removed. void removeKnot_v(double tpar); + /// Inserts knots in the specified knot vector, such that all knots + /// have multiplicity order + /// \param pardir the parameter direction (u=0, v=1) + void makeBernsteinKnots(int pardir) + { + (pardir == 0) ? makeBernsteinKnotsU() : makeBernsteinKnotsV(); + } + /// Inserts knots in the u knot vector, such that all knots /// have multiplicity order void makeBernsteinKnotsU(); @@ -946,6 +1002,15 @@ class GO_API SplineSurface : public ParamSurface /// Ensure k-regularity of this surface in both parameter directions void makeSurfaceKRegular(); + /// Returns the number of knot intervals in the specified knot vector. + /// \param pardir parameter direction (u=0, v=1) + /// \return the number of knot intervals in the knotvector for the + /// specified parameter direction + int numberOfPatches(int pardir) const + { + return (pardir == 0) ? numberOfPatches_u() : numberOfPatches_v(); + } + /// Returns the number of knot intervals in u knot vector. /// \return the number of knot intervals in the knotvector for the first /// parameter diff --git a/gotools-data b/gotools-data index 2f08c26b..50cf659d 160000 --- a/gotools-data +++ b/gotools-data @@ -1 +1 @@ -Subproject commit 2f08c26b4999fb35b06079764a5ad4bdf9558dac +Subproject commit 50cf659dc358cc77ad8a02456a6d67f90c7dc7cf diff --git a/igeslib/cmake/GoIgeslibConfig.cmake.in b/igeslib/cmake/GoIgeslibConfig.cmake.in index d0915a61..4fcf96e6 100644 --- a/igeslib/cmake/GoIgeslibConfig.cmake.in +++ b/igeslib/cmake/GoIgeslibConfig.cmake.in @@ -1,9 +1,9 @@ @PACKAGE_INIT@ -include("${CMAKE_CURRENT_LIST_DIR}/GoIgesLibTargets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/GoIgeslibTargets.cmake") # Legacy compatibility -set(GoIgesLib_LIBRARIES GoIgesLib) +set(GoIgeslib_LIBRARIES GoIgeslib) # Optionally set variables -set(GoIgesLib_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") +set(GoIgeslib_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") diff --git a/lrsplines2D/examples/investigate_Element2D.C b/lrsplines2D/examples/investigate_Element2D.C index 19dff67c..05190145 100644 --- a/lrsplines2D/examples/investigate_Element2D.C +++ b/lrsplines2D/examples/investigate_Element2D.C @@ -146,8 +146,8 @@ int main(int argc, char *argv[]) int dim = surf1->dimension(); // Knot vector for Bezier patch - double knots1[2*(deg1+1)]; - double knots2[2*(deg2+1)]; + vector knots1(2*(deg1+1)); + vector knots2(2*(deg2+1)); for (int ki=0; ki<=deg1; ++ki) { knots1[ki] = 0.0; diff --git a/parametrization/CMakeLists.txt b/parametrization/CMakeLists.txt index 7ded4f5f..679c40be 100644 --- a/parametrization/CMakeLists.txt +++ b/parametrization/CMakeLists.txt @@ -72,7 +72,7 @@ ELSE(WIN32) include(GNUInstallDirs) ENDIF(WIN32) -# Install the GoToolsCore target with export set +# Install the parametrization target with export set install(TARGETS parametrization EXPORT parametrizationTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -90,7 +90,7 @@ install(DIRECTORY include/ # Export the targets to a file install(EXPORT parametrizationTargets FILE parametrizationTargets.cmake - #NAMESPACE GoTools:: # So consumer can do target_link_libraries(... GoTools::GoToolsCore) + #NAMESPACE GoTools:: # So consumer can do target_link_libraries(... GoTools::parametrization) DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/parametrization ) diff --git a/parametrization/cmake/parametrizationConfig.cmake.in b/parametrization/cmake/parametrizationConfig.cmake.in index d00f0c30..5e658fc5 100644 --- a/parametrization/cmake/parametrizationConfig.cmake.in +++ b/parametrization/cmake/parametrizationConfig.cmake.in @@ -1,9 +1,9 @@ @PACKAGE_INIT@ -include("${CMAKE_CURRENT_LIST_DIR}/GoToolsCoreTargets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/parametrizationTargets.cmake") # Legacy compatibility -set(GoTools_LIBRARIES GoToolsCore) +set(GoTools_LIBRARIES parametrization) # Optionally set variables -set(GoToolsCore_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") +set(parametrization_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") diff --git a/sisl b/sisl index c9405f5e..7e55b549 160000 --- a/sisl +++ b/sisl @@ -1 +1 @@ -Subproject commit c9405f5e9a6fd591538094b07d5ba53b7a2d5f3e +Subproject commit 7e55b5495c8e8bb2c93670de52a67fc312bddd7d diff --git a/trivariate/include/GoTools/trivariate/SplineVolume.h b/trivariate/include/GoTools/trivariate/SplineVolume.h index 9aaa68fd..c08829fd 100644 --- a/trivariate/include/GoTools/trivariate/SplineVolume.h +++ b/trivariate/include/GoTools/trivariate/SplineVolume.h @@ -476,6 +476,9 @@ class SplineVolume : public ParamVolume } /// Query the number of control points along the specified parameter direction + /// \param pardir specify whether to return the number of coefs for the first + /// parameter (0), for the second parameter (1) or the third + /// (2) parameter. /// \return the number of control points along the specified parameter direction int numCoefs(int pardir) const { @@ -485,7 +488,7 @@ class SplineVolume : public ParamVolume } /// Query the order of the BsplineBasis for the specified parameter - /// \return the order of the BsplineBasis for the specified parameter + /// \return the order of the BsplineBasis for the specified parameter direction int order(int pardir) const { if (pardir == 0) return basis_u_.order(); @@ -494,6 +497,7 @@ class SplineVolume : public ParamVolume } /// Query the number of elements in the SplineVolume + /// \return the number of 3D elements in the volume int numElem() const { return basis_u_.numElem()*basis_v_.numElem()*basis_w_.numElem(); @@ -501,7 +505,10 @@ class SplineVolume : public ParamVolume /// Query the number of elements in one parameter direction of // the SplineVolume - /// pardir = 0: u-direction, pardir = 1: vdirection, pardir = 2: wdirection + /// \param pardir specify whether to return the number of elements for the first + /// parameter (0), for the second parameter (1) or the third + /// (2) parameter. + /// \return the number of elements for the specified parameter direction int numElem(int pardir) const { if (pardir == 0) return basis_u_.numElem(); @@ -628,17 +635,17 @@ class SplineVolume : public ParamVolume void insertKnot(int pardir, const std::vector& new_knots); /// Remove a knot from the knotvector of the given parameter direction. - /// \param pardir the parameter direction (0, 1 or 2) + /// \param pardir the parameter direction (u=0, v=1, w=2) /// \param tpar the parameter value of the knot to be removed void removeKnot(int pardir, double tpar); /// Inserts knots in the specified knot vector, such that all knots /// have multiplicity order - /// \param pardir the parameter direction (0, 1, or 2) + /// \param pardir the parameter direction (u=0, v=1, w=2) void makeBernsteinKnots(int pardir); /// Returns the number of knot intervals in the specified knot vector. - /// \param pardir parameter direction + /// \param pardir parameter direction (u=0, v=1, w=2) /// \return the number of knot intervals in the knotvector for the /// specified parameter direction int numberOfPatches(int pardir) const; diff --git a/ttl b/ttl index 9988d960..0f57e660 160000 --- a/ttl +++ b/ttl @@ -1 +1 @@ -Subproject commit 9988d96059f088186e50b9211395658ce4cb3f70 +Subproject commit 0f57e660635925851d8646378c462a68ccdc8297