Skip to content

Commit 36a6e87

Browse files
RomanMeuschSascha Brandt
authored and
Sascha Brandt
committed
made it compile, export symbols and pass tests using MSVC
1 parent cf39d6b commit 36a6e87

File tree

7 files changed

+34
-26
lines changed

7 files changed

+34
-26
lines changed

BoundingSphere.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,25 @@ namespace BoundingSphere {
4343
* @author Benjamin Eikel
4444
* @date 2012-03-20
4545
*/
46-
Sphere_f computeMiniball(const std::vector<Vec3f> & points);
46+
GEOMETRYAPI Sphere_f computeMiniball(const std::vector<Vec3f> & points);
4747

4848
/**
4949
* @see computeEPOS98()
5050
* @note This version uses 3 normals
5151
*/
52-
Sphere_f computeEPOS6(const std::vector<Vec3f> & points);
52+
GEOMETRYAPI Sphere_f computeEPOS6(const std::vector<Vec3f> & points);
5353

5454
/**
5555
* @see computeEPOS98()
5656
* @note This version uses 7 normals
5757
*/
58-
Sphere_f computeEPOS14(const std::vector<Vec3f> & points);
58+
GEOMETRYAPI Sphere_f computeEPOS14(const std::vector<Vec3f> & points);
5959

6060
/**
6161
* @see computeEPOS98()
6262
* @note This version uses 13 normals
6363
*/
64-
Sphere_f computeEPOS26(const std::vector<Vec3f> & points);
64+
GEOMETRYAPI Sphere_f computeEPOS26(const std::vector<Vec3f> & points);
6565

6666
/**
6767
* Bounding sphere algorithm using an extremal points heuristic.
@@ -73,7 +73,7 @@ Sphere_f computeEPOS26(const std::vector<Vec3f> & points);
7373
* @author Benjamin Eikel
7474
* @date 2012-03-23
7575
*/
76-
Sphere_f computeEPOS98(const std::vector<Vec3f> & points);
76+
GEOMETRYAPI Sphere_f computeEPOS98(const std::vector<Vec3f> & points);
7777
}
7878
}
7979

BoxHelper.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ using Vec3f = _Vec3<float>;
2929
namespace Helper {
3030

3131
//! Return the indices of the corners for the requested @p side.
32-
const corner_t * getCornerIndices(const side_t side);
32+
GEOMETRYAPI const corner_t * getCornerIndices(const side_t side);
3333

3434
//! Return the normal for the requested @p side.
35-
const Vec3f & getNormal(const side_t side);
35+
GEOMETRYAPI const Vec3f & getNormal(const side_t side);
3636

3737
/**
3838
* Create new boxes by splitting up a box along x/y/z axis.
@@ -43,7 +43,7 @@ const Vec3f & getNormal(const side_t side);
4343
* @param partsZ number of resulting boxes along z-axis
4444
* @return Container with the new boxes
4545
*/
46-
std::vector<Box_f> splitUpBox(const Box_f & box, unsigned int partsX, unsigned int partsY, unsigned int partsZ);
46+
GEOMETRYAPI std::vector<Box_f> splitUpBox(const Box_f & box, unsigned int partsX, unsigned int partsY, unsigned int partsZ);
4747

4848
/**
4949
* Split up a box once along up to three axis such that the resulting boxes are
@@ -53,7 +53,7 @@ std::vector<Box_f> splitUpBox(const Box_f & box, unsigned int partsX, unsigned i
5353
* @param box Box that will be used for splitting
5454
* @return Container with the new boxes
5555
*/
56-
std::vector<Box_f> splitBoxCubeLike(const Box_f & box);
56+
GEOMETRYAPI std::vector<Box_f> splitBoxCubeLike(const Box_f & box);
5757

5858
/**
5959
* Take a box and transform it by applying a transformation matrix to the
@@ -63,7 +63,7 @@ std::vector<Box_f> splitBoxCubeLike(const Box_f & box);
6363
* @param matrix Transformation matrix
6464
* @return Axis-aligned box including the transformed corners
6565
*/
66-
Box_f getTransformedBox(const Box_f & box, const Matrix4x4f & matrix);
66+
GEOMETRYAPI Box_f getTransformedBox(const Box_f & box, const Matrix4x4f & matrix);
6767
}
6868
}
6969

BoxIntersection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace Intersection {
4141
\see original source code:
4242
http://jgt.akpeters.com/papers/AkenineMoller01/tribox.html
4343
*/
44-
bool isBoxIntersectingTriangle(const Box_f & box, const Triangle_f & triangle);
44+
GEOMETRYAPI bool isBoxIntersectingTriangle(const Box_f & box, const Triangle_f & triangle);
4545

4646
/**
4747
* Check if two boxes intersect.

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ set_property(TARGET Geometry PROPERTY PUBLIC_HEADER
6262
VecN.h
6363
)
6464

65+
if(MSVC)
66+
target_compile_definitions(Geometry PRIVATE "GEOMETRYAPI=__declspec(dllexport)")
67+
target_compile_definitions(Geometry INTERFACE "GEOMETRYAPI=__declspec(dllimport)")
68+
else()
69+
target_compile_definitions(Geometry PRIVATE "GEOMETRYAPI=")
70+
target_compile_definitions(Geometry INTERFACE "GEOMETRYAPI=")
71+
endif()
72+
6573
# Set version of library
6674
set_target_properties(Geometry PROPERTIES VERSION ${Geometry_VERSION}
6775
SOVERSION ${Geometry_VERSION_MAJOR}

Frustum.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Frustum {
3434
* @name Main
3535
*/
3636
//@{
37-
Frustum();
38-
Frustum(const Angle & angle, float ratio, float nearD, float farD);
37+
GEOMETRYAPI Frustum();
38+
GEOMETRYAPI Frustum(const Angle & angle, float ratio, float nearD, float farD);
3939
//@}
4040

4141
/**
@@ -79,7 +79,7 @@ class Frustum {
7979
return projectionMatrix;
8080
}
8181

82-
intersection_t isBoxInFrustum(const Box & b) const;
82+
GEOMETRYAPI intersection_t isBoxInFrustum(const Box & b) const;
8383
inline bool pointInFrustum(const Vec3 & p) const;
8484
inline Vec3 operator[](corner_t nr) const;
8585
bool operator==(const Frustum & other) const;
@@ -93,17 +93,17 @@ class Frustum {
9393
* @name Modification
9494
*/
9595
//@{
96-
void setPerspective(const Angle & angle, float ratio, float near, float far);
97-
void setFrustum(float left, float right, float bottom, float top, float near, float far, bool orthogonal = false);
98-
void setFrustumFromAngles(const Angle & fovLeft, const Angle & fovRight, const Angle & fovBottom,
96+
GEOMETRYAPI void setPerspective(const Angle & angle, float ratio, float near, float far);
97+
GEOMETRYAPI void setFrustum(float left, float right, float bottom, float top, float near, float far, bool orthogonal = false);
98+
GEOMETRYAPI void setFrustumFromAngles(const Angle & fovLeft, const Angle & fovRight, const Angle & fovBottom,
9999
const Angle & fovTop, float near, float far);
100100
void setOrthogonal(float l, float r, float b, float t, float n, float f) {
101101
setFrustum(l, r, b, t, n, f, true);
102102
}
103-
void setPosition(const Vec3 & pos, const Vec3 & dir, const Vec3 & up);
103+
GEOMETRYAPI void setPosition(const Vec3 & pos, const Vec3 & dir, const Vec3 & up);
104104

105105
protected:
106-
void recalculateCornersAndPlanes();
106+
GEOMETRYAPI void recalculateCornersAndPlanes();
107107
//@}
108108

109109
// ---- Data

RayBoxIntersection.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Slope {
8686

8787
public:
8888
//! Create a new instance and associate it with a ray.
89-
Slope(const ray_t & ray);
89+
GEOMETRYAPI Slope(const ray_t & ray);
9090

9191
/**
9292
* Check if the associated ray intersects a box.
@@ -98,7 +98,7 @@ class Slope {
9898
* @note This function is usually a little bit faster than
9999
* getRayBoxIntersection()
100100
*/
101-
bool isRayIntersectingBox(const box_t & box) const;
101+
GEOMETRYAPI bool isRayIntersectingBox(const box_t & box) const;
102102

103103
/**
104104
* Calculate the intersection between the associated ray and a box.
@@ -113,7 +113,7 @@ class Slope {
113113
* @note This function is usually a little bit slower than
114114
* isRayIntersectingBox()
115115
*/
116-
bool getRayBoxIntersection(const box_t & box, value_t & intersection) const;
116+
GEOMETRYAPI bool getRayBoxIntersection(const box_t & box, value_t & intersection) const;
117117

118118
//! Return the stored ray.
119119
const ray_t & getRay() const {

Tools.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ bool rayPlaneIntersection(const Plane & plane, const Ray3f & ray, Vec3f & inters
5656
}
5757

5858
/*! (intersects?, lineIntersectionValue1, lineIntersectionValue2) */
59-
std::tuple<bool, float, float> normLineSphereIntersections(const Line3f & normalizedLine, const Sphere_f & sphere);
60-
std::tuple<bool, float, float> lineSphereIntersections(const Line3f & line, const Sphere_f & sphere);
59+
GEOMETRYAPI std::tuple<bool, float, float> normLineSphereIntersections(const Line3f & normalizedLine, const Sphere_f & sphere);
60+
GEOMETRYAPI std::tuple<bool, float, float> lineSphereIntersections(const Line3f & line, const Sphere_f & sphere);
6161

6262
/**
6363
* Calculate a pair of points on the given lines @a lineA and @a lineB that is closest to each other.
@@ -180,7 +180,7 @@ inline _Vec3<_T> unProject(const _Vec3<_T> & win, const _Matrix4x4<_T> & worldTo
180180
* @param viewport Viewport
181181
* @return Rect in window coordinates
182182
*/
183-
Rect_f projectBox(const Box & box, const Matrix4x4f & modelView, const Matrix4x4f & projection,
183+
GEOMETRYAPI Rect_f projectBox(const Box & box, const Matrix4x4f & modelView, const Matrix4x4f & projection,
184184
const Rect_f & viewport);
185185

186186
/**
@@ -195,7 +195,7 @@ Rect_f projectBox(const Box & box, const Matrix4x4f & modelView, const Matrix4x4
195195
* @note Example 2: @a box can be given in object coordinates,
196196
* and @a modelView contains the product of a camera matrix and the transformation matrix of the object.
197197
*/
198-
Frustum calcEnclosingOrthoFrustum(const Box & box, const Matrix4x4f & modelView);
198+
GEOMETRYAPI Frustum calcEnclosingOrthoFrustum(const Box & box, const Matrix4x4f & modelView);
199199
}
200200

201201
#endif /* GEOMETRY_TOOLS_H */

0 commit comments

Comments
 (0)