Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PROJECT(GoTools)


CMAKE_MINIMUM_REQUIRED(VERSION 3.5)

# Set version info
Expand Down Expand Up @@ -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 "")
Expand All @@ -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
Expand All @@ -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)
Expand Down
69 changes: 67 additions & 2 deletions gotools-core/include/GoTools/geometry/SplineSurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -771,17 +781,28 @@ 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();
}

/// 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
Expand Down Expand Up @@ -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<double>& 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);
Expand All @@ -927,6 +967,14 @@ class GO_API SplineSurface : public ParamSurface
/// new knots to insert.
void insertKnot_v(const std::vector<double>& 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);
Expand All @@ -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();
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gotools-data
6 changes: 3 additions & 3 deletions igeslib/cmake/GoIgeslibConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -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")
4 changes: 2 additions & 2 deletions lrsplines2D/examples/investigate_Element2D.C
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> knots1(2*(deg1+1));
vector<double> knots2(2*(deg2+1));
for (int ki=0; ki<=deg1; ++ki)
{
knots1[ki] = 0.0;
Expand Down
4 changes: 2 additions & 2 deletions parametrization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
)

Expand Down
6 changes: 3 additions & 3 deletions parametrization/cmake/parametrizationConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 1 addition & 1 deletion sisl
Submodule sisl updated from c9405f to 7e55b5
17 changes: 12 additions & 5 deletions trivariate/include/GoTools/trivariate/SplineVolume.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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();
Expand All @@ -494,14 +497,18 @@ 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();
}

/// 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();
Expand Down Expand Up @@ -628,17 +635,17 @@ class SplineVolume : public ParamVolume
void insertKnot(int pardir, const std::vector<double>& 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;
Expand Down
2 changes: 1 addition & 1 deletion ttl
Submodule ttl updated from 9988d9 to 0f57e6