Skip to content

Commit

Permalink
+ improve OCC version macro, fix build failure with MinGW, fix build …
Browse files Browse the repository at this point in the history
…failure with Coin2
  • Loading branch information
wwmayer committed Aug 18, 2014
1 parent 5e82feb commit 967566a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cMake/FreeCadMacros.cmake
Expand Up @@ -255,9 +255,9 @@ MACRO(SET_PYTHON_PREFIX_SUFFIX ProjectName)
ENDMACRO(SET_PYTHON_PREFIX_SUFFIX)

MACRO(CHECK_MINIMUM_OCC_VERSION_HEX MinVersionHex)
message(STATUS "Check for OCC version >= ${MinVersionHex}")
set(CMAKE_REQUIRED_INCLUDES ${OCC_INCLUDE_DIR})
unset(OCC_MIN_VERSION CACHE)
set(OCC_CHECK_VERSION 0x060600)
CHECK_CXX_SOURCE_RUNS("
#include <Standard_Version.hxx>
int main ()
Expand Down
3 changes: 3 additions & 0 deletions src/App/Application.cpp
Expand Up @@ -34,6 +34,9 @@
# include <unistd.h>
# include <pwd.h>
# include <sys/types.h>
# elif defined(__MINGW32__)
# define WINVER 0x502 // needed for SetDllDirectory
# include <Windows.h>
# endif
# include <ctime>
# include <csignal>
Expand Down
14 changes: 12 additions & 2 deletions src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Expand Up @@ -32,6 +32,7 @@
# include <Inventor/actions/SoGetBoundingBoxAction.h>
# include <Inventor/SoPath.h>
# include <Inventor/SbBox3f.h>
# include <Inventor/SbImage.h>
# include <Inventor/SoPickedPoint.h>
# include <Inventor/details/SoLineDetail.h>
# include <Inventor/details/SoPointDetail.h>
Expand Down Expand Up @@ -1685,13 +1686,22 @@ bool ViewProviderSketch::detectPreselection(const SoPickedPoint *Point,

SbVec3s ViewProviderSketch::getDisplayedSize(const SoImage *iconPtr) const
{
#if (COIN_MAJOR_VERSION >= 3)
SbVec3s iconSize = iconPtr->image.getValue().getSize();
if(iconPtr->width.getValue() != -1)
#else
SbVec2s size;
int nc;
const unsigned char * bytes = iconPtr->image.getValue(size, nc);
SbImage img (bytes, size, nc);
SbVec3s iconSize = img.getSize();
#endif
if (iconPtr->width.getValue() != -1)
iconSize[0] = iconPtr->width.getValue();
if(iconPtr->height.getValue() != -1)
if (iconPtr->height.getValue() != -1)
iconSize[1] = iconPtr->height.getValue();
return iconSize;
}

void ViewProviderSketch::doBoxSelection(const SbVec2s &startPos, const SbVec2s &endPos,
const Gui::View3DInventorViewer *viewer)
{
Expand Down

0 comments on commit 967566a

Please sign in to comment.