+ improve OCC version macro, fix build failure with MinGW, fix build failure with Coin2
This commit is contained in:
parent
5e82febd0a
commit
967566acf1
|
@ -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 ()
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
@ -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();
|
||||
#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)
|
||||
iconSize[1] = iconPtr->height.getValue();
|
||||
return iconSize;
|
||||
}
|
||||
|
||||
void ViewProviderSketch::doBoxSelection(const SbVec2s &startPos, const SbVec2s &endPos,
|
||||
const Gui::View3DInventorViewer *viewer)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user