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
37 changes: 23 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,22 @@ if(CARVE_SYSTEM_BOOST)
set(CARVE_SYSTEM_BOOST OFF)
endif(Boost_FOUND)
endif(CARVE_SYSTEM_BOOST)

if(CARVE_BOOST_COLLECTIONS)
set(HAVE_BOOST_UNORDERED_COLLECTIONS TRUE)

else(CARVE_BOOST_COLLECTIONS)
# attempt to work out which unordered collection implementation we can use
try_compile(_HAVE_STD_UNORDERED_COLLECTIONS
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}
"${carve_SOURCE_DIR}/cmake/test_std_unordered.cpp"
OUTPUT_VARIABLE OUTPUT)
try_compile(_HAVE_TR1_UNORDERED_COLLECTIONS
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}
"${carve_SOURCE_DIR}/cmake/test_tr1_unordered.cpp"
OUTPUT_VARIABLE OUTPUT)
try_compile(_HAVE_LIBSTDCPP_UNORDERED_COLLECTIONS
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}
"${carve_SOURCE_DIR}/cmake/test_libstdcpp_unordered.cpp"
OUTPUT_VARIABLE OUTPUT)

Expand Down Expand Up @@ -134,20 +134,20 @@ if(CARVE_WITH_GUI)
if(WIN32)
add_definitions(-DGLEW_STATIC)
endif(WIN32)
add_subdirectory(external/GLEW)
add_subdirectory(external/GLEW)
endif(GLEW_FOUND)

if(WIN32)
add_definitions(-DGLUI_NO_LIB_PRAGMA)
add_definitions(-DGLUI_USE_STATIC_LIB)
endif(WIN32)
add_subdirectory(external/GLUI)
add_subdirectory(external/GLUI)

endif(NOT OPENGL_FOUND)

endif(CARVE_WITH_GUI)

add_subdirectory(external/GLOOP)
add_subdirectory(external/GLOOP)

if (CARVE_GTEST_TESTS)
add_subdirectory(external/gtest-1.5.0)
Expand All @@ -161,13 +161,22 @@ add_definitions(-DCMAKE_BUILD)

include_directories(${carve_BINARY_DIR}/include)

add_subdirectory(lib)
add_subdirectory(include)
add_subdirectory(common)
add_subdirectory(src)
add_subdirectory(examples)
add_subdirectory(tests)

add_subdirectory(lib)
add_subdirectory(include)
add_subdirectory(common)
add_subdirectory(src)
add_subdirectory(examples)
add_subdirectory(tests)

install(
FILES
${carve_BINARY_DIR}/include/carve/config.h
${carve_SOURCE_DIR}/include/carve/gnu_cxx.h
DESTINATION
include/carve
COMPONENT
Devel
)

include(CTest)

Expand Down
16 changes: 16 additions & 0 deletions include/carve/collection/unordered/std_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,19 @@
#include <unordered_set>

#undef UNORDERED_COLLECTIONS_SUPPORT_RESIZE

namespace std {

template <typename A, typename B>
struct hash<std::pair<A, B> > : public std::unary_function<std::pair<A, B>, size_t> {
size_t operator()(const std::pair<A, B> &v) const {
std::size_t seed = 0;

seed ^= hash<A>()(v.first);
seed ^= hash<B>()(v.second) + (seed<<6) + (seed>>2);

return seed;
}
};

}
7 changes: 4 additions & 3 deletions include/carve/exact.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <carve/carve.hpp>

#include <algorithm>
#include <vector>
#include <numeric>

Expand Down Expand Up @@ -154,7 +155,7 @@ namespace carve {
double half;
double check, lastcheck;
int every_other;

every_other = 1;
half = 0.5;
epsilon = 1.0;
Expand All @@ -174,7 +175,7 @@ namespace carve {
check = 1.0 + epsilon;
} while ((check != 1.0) && (check != lastcheck));
splitter += 1.0;

/* Error bounds for orientation and incircle tests. */
resulterrbound = (3.0 + 8.0 * epsilon) * epsilon;
ccwerrboundA = (3.0 + 16.0 * epsilon) * epsilon;
Expand Down Expand Up @@ -704,7 +705,7 @@ namespace carve {
sum_zeroelim(cdet, ddet, cddet);

sum_zeroelim(abdet, cddet, det);

return det[det.size() - 1];
}

Expand Down
36 changes: 19 additions & 17 deletions include/carve/geom2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

#include <carve/geom.hpp>

#include <algorithm>
#include <cstddef>
#include <vector>

#include <math.h>
Expand Down Expand Up @@ -62,15 +64,15 @@ namespace carve {

typedef std::vector<P2> P2Vector;

/**
/**
* \brief Return the orientation of c with respect to the ray defined by a->b.
*
* (Can be implemented exactly)
*
* @param[in] a
* @param[in] b
* @param[in] c
*
*
* @param[in] a
* @param[in] b
* @param[in] c
*
* @return positive, if c to the left of a->b.
* zero, if c is colinear with a->b.
* negative, if c to the right of a->b.
Expand All @@ -89,15 +91,15 @@ namespace carve {
}
#endif

/**
/**
* \brief Determine whether p is internal to the anticlockwise
* angle abc, where b is the apex of the angle.
*
* @param[in] a
* @param[in] b
* @param[in] c
* @param[in] p
*
* @param[in] a
* @param[in] b
* @param[in] c
* @param[in] p
*
* @return true, if p is contained in the anticlockwise angle from
* b->a to b->c. Reflex angles contain p if p lies
* on b->a or on b->c. Acute angles do not contain p
Expand All @@ -118,14 +120,14 @@ namespace carve {
}
}

/**
/**
* \brief Determine whether p is internal to the anticlockwise
* angle ac, with apex at (0,0).
*
* @param[in] a
* @param[in] c
* @param[in] p
*
* @param[in] a
* @param[in] c
* @param[in] p
*
* @return true, if p is contained in a0c.
*/
inline bool internalToAngle(const P2 &a,
Expand Down
Loading