From eb828a3b71f21d791b95e41049443d5ce1624579 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 9 May 2017 21:35:21 +0200 Subject: [PATCH 1/3] X3DImporter: fix coverity findings. --- code/X3DImporter_Node.hpp | 45 ++++++++++++++------------------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/code/X3DImporter_Node.hpp b/code/X3DImporter_Node.hpp index 7d570d2a5..441d33e9c 100644 --- a/code/X3DImporter_Node.hpp +++ b/code/X3DImporter_Node.hpp @@ -467,42 +467,29 @@ public: /// \class CX3DImporter_NodeElement_Geometry3D /// Three-dimensional body. -class CX3DImporter_NodeElement_Geometry3D : public CX3DImporter_NodeElement -{ - /***********************************************/ - /****************** Variables ******************/ - /***********************************************/ - +class CX3DImporter_NodeElement_Geometry3D : public CX3DImporter_NodeElement { public: + std::list Vertices; ///< Vertices list. + size_t NumIndices;///< Number of indices in one face. + bool Solid; ///< Flag: if true then render must use back-face culling, else render must draw both sides of object. - std::list Vertices;///< Vertices list. - size_t NumIndices;///< Number of indices in one face. - bool Solid;///< Flag: if true then render must use back-face culling, else render must draw both sides of object. - - /***********************************************/ - /****************** Functions ******************/ - /***********************************************/ - -private: - - /// \fn CX3DImporter_NodeElement_Geometry3D(const CX3DImporter_NodeElement_Geometry3D& pNode) - /// Disabled copy constructor. - CX3DImporter_NodeElement_Geometry3D(const CX3DImporter_NodeElement_Geometry3D& pNode); - - /// \fn CX3DImporter_NodeElement_Geometry3D& operator=(const CX3DImporter_NodeElement_Geometry3D& pNode) - /// Disabled assign operator. - CX3DImporter_NodeElement_Geometry3D& operator=(const CX3DImporter_NodeElement_Geometry3D& pNode); - -public: - - /// \fn CX3DImporter_NodeElement_Geometry3D(const EType pType, CX3DImporter_NodeElement* pParent) /// Constructor. /// \param [in] pParent - pointer to parent node. /// \param [in] pType - type of geometry object. CX3DImporter_NodeElement_Geometry3D(const EType pType, CX3DImporter_NodeElement* pParent) - : CX3DImporter_NodeElement(pType, pParent), Solid(true) - {} + : CX3DImporter_NodeElement(pType, pParent) + , Vertices() + , NumIndices( 0 ) + , Solid(true) { + // empty + } +private: + /// Disabled copy constructor. + CX3DImporter_NodeElement_Geometry3D(const CX3DImporter_NodeElement_Geometry3D& pNode); + + /// Disabled assign operator. + CX3DImporter_NodeElement_Geometry3D& operator=(const CX3DImporter_NodeElement_Geometry3D& pNode); };// class CX3DImporter_NodeElement_Geometry3D /// \class CX3DImporter_NodeElement_ElevationGrid From cfb867b5e7f32de7f2a4ac2abb5a15bdf228bb00 Mon Sep 17 00:00:00 2001 From: Squareys Date: Tue, 9 May 2017 21:51:49 +0200 Subject: [PATCH 2/3] Fix config.h not being found during install --- code/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 3f898ebea..fe0b58af6 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -59,7 +59,7 @@ SET( PUBLIC_HEADERS ${HEADER_PATH}/camera.h ${HEADER_PATH}/color4.h ${HEADER_PATH}/color4.inl - ${HEADER_PATH}/config.h + ${CMAKE_BINARY_DIR}/include/assimp/config.h ${HEADER_PATH}/defs.h ${HEADER_PATH}/cfileio.h ${HEADER_PATH}/light.h From 9ef1a4fae0b6360d10244ada03400614562f40b7 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 9 May 2017 22:54:04 +0200 Subject: [PATCH 3/3] X3D: fix coverity findings. --- code/X3DImporter_Node.hpp | 54 ++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/code/X3DImporter_Node.hpp b/code/X3DImporter_Node.hpp index 441d33e9c..7061d06bc 100644 --- a/code/X3DImporter_Node.hpp +++ b/code/X3DImporter_Node.hpp @@ -675,45 +675,35 @@ struct CX3DImporter_NodeElement_Appearance : public CX3DImporter_NodeElement /// \class CX3DImporter_NodeElement_Material /// Material. -class CX3DImporter_NodeElement_Material : public CX3DImporter_NodeElement -{ - /***********************************************/ - /****************** Variables ******************/ - /***********************************************/ - +class CX3DImporter_NodeElement_Material : public CX3DImporter_NodeElement { public: + float AmbientIntensity;///< Specifies how much ambient light from light sources this surface shall reflect. + aiColor3D DiffuseColor; ///< Reflects all X3D light sources depending on the angle of the surface with respect to the light source. + aiColor3D EmissiveColor; ///< Models "glowing" objects. This can be useful for displaying pre-lit models. + float Shininess; ///< Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights. + aiColor3D SpecularColor; ///< The specularColor and shininess fields determine the specular highlights. + float Transparency; ///< Specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque. - float AmbientIntensity;///< Specifies how much ambient light from light sources this surface shall reflect. - aiColor3D DiffuseColor;///< Reflects all X3D light sources depending on the angle of the surface with respect to the light source. - aiColor3D EmissiveColor;///< Models "glowing" objects. This can be useful for displaying pre-lit models. - float Shininess;///< Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights. - aiColor3D SpecularColor;///< The specularColor and shininess fields determine the specular highlights. - float Transparency;///< Specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque. - - /***********************************************/ - /****************** Functions ******************/ - /***********************************************/ - -private: - - /// \fn CX3DImporter_NodeElement_Material(const CX3DImporter_NodeElement_Material& pNode) - /// Disabled copy constructor. - CX3DImporter_NodeElement_Material(const CX3DImporter_NodeElement_Material& pNode); - - /// \fn CX3DImporter_NodeElement_Material& operator=(const CX3DImporter_NodeElement_Material& pNode) - /// Disabled assign operator. - CX3DImporter_NodeElement_Material& operator=(const CX3DImporter_NodeElement_Material& pNode); - -public: - - /// \fn CX3DImporter_NodeElement_Material(const EType pType, CX3DImporter_NodeElement* pParent) /// Constructor. /// \param [in] pParent - pointer to parent node. /// \param [in] pType - type of geometry object. CX3DImporter_NodeElement_Material(CX3DImporter_NodeElement* pParent) - : CX3DImporter_NodeElement(ENET_Material, pParent) - {} + : CX3DImporter_NodeElement(ENET_Material, pParent) + , AmbientIntensity( 0.0f ) + , DiffuseColor() + , EmissiveColor() + , Shininess( 0.0f ) + , SpecularColor() + , Transparency( 1.0f ) { + // empty + } +private: + /// Disabled copy constructor. + CX3DImporter_NodeElement_Material(const CX3DImporter_NodeElement_Material& pNode); + + /// Disabled assign operator. + CX3DImporter_NodeElement_Material& operator=(const CX3DImporter_NodeElement_Material& pNode); };// class CX3DImporter_NodeElement_Material /// \struct CX3DImporter_NodeElement_ImageTexture