diff --git a/3d-viewer/3d_model_viewer/c3d_model_viewer.cpp b/3d-viewer/3d_model_viewer/c3d_model_viewer.cpp index d2b0854e7c..7fe74ae1d9 100644 --- a/3d-viewer/3d_model_viewer/c3d_model_viewer.cpp +++ b/3d-viewer/3d_model_viewer/c3d_model_viewer.cpp @@ -274,14 +274,14 @@ void C3D_MODEL_VIEWER::OnPaint( wxPaintEvent &event ) double modelunit_to_3d_units_factor = m_BiuTo3Dunits * UNITS3D_TO_UNITSPCB; - const SFVEC3F model_center = m_ogl_3dmodel->GetBBox().GetCenter(); - glTranslatef( model_center.x, model_center.y, model_center.z ); - glScaled( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor, modelunit_to_3d_units_factor); + //const SFVEC3F model_center = m_ogl_3dmodel->GetBBox().GetCenter(); + //glTranslatef( -model_center.x, -model_center.y, -model_center.z ); + m_ogl_3dmodel->Draw_opaque(); //m_ogl_3dmodel->Draw_transparent(); - //m_ogl_3dmodel->Draw_bboxes(); + m_ogl_3dmodel->Draw_bboxes(); glPopMatrix(); } diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.h b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.h index 5f7da4cad9..0f4e163821 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.h +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.h @@ -34,7 +34,7 @@ #include "common_ogl/openGL_includes.h" #include "3d_rendering/3d_render_raytracing/shapes3D/cbbox.h" -/// +/// class GLM_ALIGN(CLASS_ALIGNMENT) C_OGL_3DMODEL { public: diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/cmaterial.h b/3d-viewer/3d_rendering/3d_render_raytracing/cmaterial.h index 8b31b38107..b207ae28b2 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/cmaterial.h +++ b/3d-viewer/3d_rendering/3d_render_raytracing/cmaterial.h @@ -33,7 +33,7 @@ #include "ray.h" #include "hitinfo.h" -/// +/// class GLM_ALIGN(CLASS_ALIGNMENT) CMATERIAL { public: @@ -63,7 +63,7 @@ public: virtual bool isTransparent(Vec3f point){return ((transparentColor.x()>0)||(transparentColor.y()>0)||(transparentColor.z()>0));} */ protected: - SFVEC3F m_ambientColor; + SFVEC3F m_ambientColor; // NOTE: we will not use diffuse color material here, // because it will be stored in object, since there are objects (i.e: triangles) // that can have per vertex color diff --git a/3d-viewer/3d_rendering/cimage.cpp b/3d-viewer/3d_rendering/cimage.cpp index 627706acee..e2135316f1 100644 --- a/3d-viewer/3d_rendering/cimage.cpp +++ b/3d-viewer/3d_rendering/cimage.cpp @@ -92,11 +92,11 @@ bool CIMAGE::wrapCoords( int *aXo, int *aYo ) const default: break; } - + if( (x < 0) || (x >= (int)m_width) || (y < 0) || (y >= (int)m_height) ) return false; - + *aXo = x; *aYo = y; @@ -206,7 +206,7 @@ void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOpe else { if ( (aImgA == NULL) || (aImgB == NULL) ) - return; + return; } switch(aOperation) @@ -281,7 +281,7 @@ void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOpe m_pixels[it] = aImgA->m_pixels[it] ^ aImgB->m_pixels[it]; } break; - + case COPY_BLEND50: for( unsigned int it = 0;it < m_wxh; it++ ) { @@ -332,7 +332,7 @@ static const S_FILTER FILTERS[] = { 7, 255 }, - + // Blur { { { 3, 5, 7, 5, 3}, @@ -457,7 +457,7 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType ) #ifdef USE_OPENMP #pragma omp parallel for #endif /* USE_OPENMP */ - + for( int iy = 0; iy < (int)m_height; iy++) { for( int ix = 0; ix < (int)m_width; ix++ ) @@ -473,7 +473,7 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType ) v += pixelv * factor; } } - + v /= filter.div; v += filter.offset; @@ -500,7 +500,7 @@ void CIMAGE::SetPixelsFromNormalizedFloat( const float * aNormalizedFloatArray ) void CIMAGE::SaveAsPNG( wxString aFileName ) const { unsigned char* pixelbuffer = (unsigned char*) malloc( m_wxh * 3 ); - + wxImage image( m_width, m_height ); for( unsigned int i = 0; i < m_wxh; i++) diff --git a/3d-viewer/3d_rendering/cimage.h b/3d-viewer/3d_rendering/cimage.h index 88e6f8de3e..8781b2f59f 100644 --- a/3d-viewer/3d_rendering/cimage.h +++ b/3d-viewer/3d_rendering/cimage.h @@ -108,7 +108,7 @@ public: * @param aValue value to set the pixel */ void Setpixel( int aX, int aY, unsigned char aValue ); - + /** * Function Getpixel * get the pixel value from pixel position, position is clamped in accord with the diff --git a/3d-viewer/CImage.cpp b/3d-viewer/CImage.cpp index 0315d65e55..157a0762fd 100644 --- a/3d-viewer/CImage.cpp +++ b/3d-viewer/CImage.cpp @@ -80,11 +80,11 @@ bool CIMAGE::wrapCoords( int *aXo, int *aYo ) const default: break; } - + if( (x < 0) || (x >= (int)m_width) || (y < 0) || (y >= (int)m_height) ) return false; - + *aXo = x; *aYo = y; @@ -127,7 +127,7 @@ void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOpe else { if ( (aImgA == NULL) || (aImgB == NULL) ) - return; + return; } switch(aOperation) @@ -202,7 +202,7 @@ void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOpe m_pixels[it] = aImgA->m_pixels[it] ^ aImgB->m_pixels[it]; } break; - + case COPY_BLEND50: for( unsigned int it = 0;it < m_wxh; it++ ) { @@ -253,7 +253,7 @@ static const S_FILTER FILTERS[] = { 7, 255 }, - + // Blur { { { 3, 5, 7, 5, 3}, @@ -378,7 +378,7 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType ) #ifdef USE_OPENMP #pragma omp parallel for #endif /* USE_OPENMP */ - + for( int iy = 0; iy < (int)m_height; iy++) { for( int ix = 0; ix < (int)m_width; ix++ ) @@ -394,7 +394,7 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType ) v += pixelv * factor; } } - + v /= filter.div; v += filter.offset; @@ -421,7 +421,7 @@ void CIMAGE::SetPixelsFromNormalizedFloat( const float * aNormalizedFloatArray ) void CIMAGE::SaveAsPNG( wxString aFileName ) const { unsigned char* pixelbuffer = (unsigned char*) malloc( m_wxh * 3 ); - + wxImage image( m_width, m_height ); for( unsigned int i = 0; i < m_wxh; i++) diff --git a/3d-viewer/CImage.h b/3d-viewer/CImage.h index 9e46cd2d49..16c1a94cac 100644 --- a/3d-viewer/CImage.h +++ b/3d-viewer/CImage.h @@ -99,7 +99,7 @@ public: * @param aValue value to set the pixel */ void Setpixel( int aX, int aY, unsigned char aValue ); - + /** * Function Getpixel * get the pixel value from pixel position, position is clamped in accord with the diff --git a/CMakeModules/FindGLM.cmake b/CMakeModules/FindGLM.cmake index 6a289ae803..bcae08bb9e 100644 --- a/CMakeModules/FindGLM.cmake +++ b/CMakeModules/FindGLM.cmake @@ -8,15 +8,16 @@ if( ${CMAKE_MAJOR_VERSION} STREQUAL "2" AND ${CMAKE_MINOR_VERSION} STREQUAL "8" endif() -find_path( GLM_INCLUDE_DIR glm.hpp PATH_SUFFIXES glm ) +find_path( GLM_INCLUDE_DIR glm/glm.hpp ) -if( NOT ${GLM_INCLUDE_DIR} STREQUAL "" ) +if( NOT ${GLM_INCLUDE_DIR} STREQUAL "GLM_INCLUDE_DIR-NOTFOUND" ) # attempt to extract the GLM Version information from setup.hpp - find_file( GLM_SETUP setup.hpp PATHS ${GLM_INCLUDE_DIR} PATH_SUFFIXES core detail NO_DEFAULT_PATH ) + find_file( GLM_SETUP setup.hpp PATHS ${GLM_INCLUDE_DIR} PATH_SUFFIXES glm/core glm/detail NO_DEFAULT_PATH ) - if( GLM_SETUP ) + if( NOT ${GLM_SETUP} STREQUAL "GLM_SETUP-NOTFOUND" ) + # extract the "#define GLM_VERSION*" lines file( STRINGS ${GLM_SETUP} _version REGEX "^#define.*GLM_VERSION.*" ) @@ -50,14 +51,16 @@ if( NOT ${GLM_INCLUDE_DIR} STREQUAL "" ) set( GLM_VERSION ${_GLM_VERSION_MAJOR}.${_GLM_VERSION_MINOR}.${_GLM_VERSION_PATCH}.${_GLM_VERSION_REVISION} ) unset( GLM_SETUP CACHE ) - endif( GLM_SETUP ) + endif() -endif( NOT ${GLM_INCLUDE_DIR} STREQUAL "" ) +endif() include( FindPackageHandleStandardArgs ) FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLM - REQUIRED_VARS GLM_INCLUDE_DIR + REQUIRED_VARS + GLM_INCLUDE_DIR + GLM_VERSION VERSION_VAR GLM_VERSION ) diff --git a/include/plugins/3dapi/ifsg_api.h b/include/plugins/3dapi/ifsg_api.h index ddd551f232..83fea25950 100644 --- a/include/plugins/3dapi/ifsg_api.h +++ b/include/plugins/3dapi/ifsg_api.h @@ -30,7 +30,7 @@ #define IFSG_API_H #include -#include +#include #include "plugins/3dapi/sg_types.h" #include "plugins/3dapi/sg_base.h" diff --git a/include/plugins/3dapi/xv3d_types.h b/include/plugins/3dapi/xv3d_types.h index 24325ed7fc..aee572f7c2 100644 --- a/include/plugins/3dapi/xv3d_types.h +++ b/include/plugins/3dapi/xv3d_types.h @@ -31,15 +31,15 @@ #define XV3D_TYPES_H #define GLM_FORCE_RADIANS -#include -#include -#include -#include -#include -#include -#include -#include -//#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include typedef glm::uvec2 SFVEC2UI; typedef glm::ivec2 SFVEC2I;