diff --git a/3d-viewer/3d_cache/sg/ifsg_api.cpp b/3d-viewer/3d_cache/sg/ifsg_api.cpp index 608b2ea86e..6e57520b38 100644 --- a/3d-viewer/3d_cache/sg/ifsg_api.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_api.cpp @@ -234,14 +234,6 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr, SGNODE* np = new SCENEGRAPH( nullptr ); - if( nullptr == np ) - { - wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] failed to instantiate SCENEGRAPH", - __FILE__, __FUNCTION__, __LINE__ ); - - return nullptr; - } - OPEN_ISTREAM( file, aFileName ); if( file.fail() ) diff --git a/3d-viewer/3d_cache/sg/ifsg_appearance.cpp b/3d-viewer/3d_cache/sg/ifsg_appearance.cpp index 91b94c1921..947b0a3922 100644 --- a/3d-viewer/3d_cache/sg/ifsg_appearance.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_appearance.cpp @@ -43,8 +43,7 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( bool create ) m_node = new SGAPPEARANCE( nullptr ); - if( m_node ) - m_node->AssociateWrapper( &m_node ); + m_node->AssociateWrapper( &m_node ); } @@ -52,20 +51,17 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( SGNODE* aParent ) { m_node = new SGAPPEARANCE( nullptr ); - if( m_node ) + if( !m_node->SetParent( aParent ) ) { - if( !m_node->SetParent( aParent ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } @@ -82,20 +78,17 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( IFSG_NODE& aParent ) m_node = new SGAPPEARANCE( nullptr ); - if( m_node ) + if( !m_node->SetParent( pp ) ) { - if( !m_node->SetParent( pp ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } diff --git a/3d-viewer/3d_cache/sg/ifsg_colors.cpp b/3d-viewer/3d_cache/sg/ifsg_colors.cpp index 714f1bd384..1575ecb228 100644 --- a/3d-viewer/3d_cache/sg/ifsg_colors.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_colors.cpp @@ -43,8 +43,7 @@ IFSG_COLORS::IFSG_COLORS( bool create ) m_node = new SGCOLORS( nullptr ); - if( m_node ) - m_node->AssociateWrapper( &m_node ); + m_node->AssociateWrapper( &m_node ); } @@ -52,20 +51,17 @@ IFSG_COLORS::IFSG_COLORS( SGNODE* aParent ) { m_node = new SGCOLORS( nullptr ); - if( m_node ) + if( !m_node->SetParent( aParent ) ) { - if( !m_node->SetParent( aParent ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d", __FILE__, __FUNCTION__, __LINE__ ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d", __FILE__, __FUNCTION__, __LINE__ ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } @@ -83,21 +79,18 @@ IFSG_COLORS::IFSG_COLORS( IFSG_NODE& aParent ) m_node = new SGCOLORS( nullptr ); - if( m_node ) + if( !m_node->SetParent( pp ) ) { - if( !m_node->SetParent( pp ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, - WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, + WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } diff --git a/3d-viewer/3d_cache/sg/ifsg_coordindex.cpp b/3d-viewer/3d_cache/sg/ifsg_coordindex.cpp index 5b3d3c064d..3106537152 100644 --- a/3d-viewer/3d_cache/sg/ifsg_coordindex.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_coordindex.cpp @@ -44,8 +44,7 @@ IFSG_COORDINDEX::IFSG_COORDINDEX( bool create ) m_node = new SGCOORDINDEX( nullptr ); - if( m_node ) - m_node->AssociateWrapper( &m_node ); + m_node->AssociateWrapper( &m_node ); } diff --git a/3d-viewer/3d_cache/sg/ifsg_coords.cpp b/3d-viewer/3d_cache/sg/ifsg_coords.cpp index d8c14c2c8d..3a917f1bb5 100644 --- a/3d-viewer/3d_cache/sg/ifsg_coords.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_coords.cpp @@ -43,8 +43,7 @@ IFSG_COORDS::IFSG_COORDS( bool create ) m_node = new SGCOORDS( nullptr ); - if( m_node ) - m_node->AssociateWrapper( &m_node ); + m_node->AssociateWrapper( &m_node ); } @@ -52,20 +51,17 @@ IFSG_COORDS::IFSG_COORDS( SGNODE* aParent ) { m_node = new SGCOORDS( nullptr ); - if( m_node ) + if( !m_node->SetParent( aParent ) ) { - if( !m_node->SetParent( aParent ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } @@ -82,20 +78,17 @@ IFSG_COORDS::IFSG_COORDS( IFSG_NODE& aParent ) m_node = new SGCOORDS( nullptr ); - if( m_node ) + if( !m_node->SetParent( pp ) ) { - if( !m_node->SetParent( pp ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } diff --git a/3d-viewer/3d_cache/sg/ifsg_faceset.cpp b/3d-viewer/3d_cache/sg/ifsg_faceset.cpp index 517e5ed826..ea599306ff 100644 --- a/3d-viewer/3d_cache/sg/ifsg_faceset.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_faceset.cpp @@ -44,8 +44,7 @@ IFSG_FACESET::IFSG_FACESET( bool create ) m_node = new SGFACESET( nullptr ); - if( m_node ) - m_node->AssociateWrapper( &m_node ); + m_node->AssociateWrapper( &m_node ); } @@ -53,20 +52,17 @@ IFSG_FACESET::IFSG_FACESET( SGNODE* aParent ) { m_node = new SGFACESET( nullptr ); - if( m_node ) + if( !m_node->SetParent( aParent ) ) { - if( !m_node->SetParent( aParent ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } @@ -83,20 +79,17 @@ IFSG_FACESET::IFSG_FACESET( IFSG_NODE& aParent ) m_node = new SGFACESET( nullptr ); - if( m_node ) + if( !m_node->SetParent( pp ) ) { - if( !m_node->SetParent( pp ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } diff --git a/3d-viewer/3d_cache/sg/ifsg_normals.cpp b/3d-viewer/3d_cache/sg/ifsg_normals.cpp index a2d7c313c7..34689880e3 100644 --- a/3d-viewer/3d_cache/sg/ifsg_normals.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_normals.cpp @@ -44,8 +44,7 @@ IFSG_NORMALS::IFSG_NORMALS( bool create ) m_node = new SGNORMALS( nullptr ); - if( m_node ) - m_node->AssociateWrapper( &m_node ); + m_node->AssociateWrapper( &m_node ); } @@ -53,20 +52,17 @@ IFSG_NORMALS::IFSG_NORMALS( SGNODE* aParent ) { m_node = new SGNORMALS( nullptr ); - if( m_node ) + if( !m_node->SetParent( aParent ) ) { - if( !m_node->SetParent( aParent ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } @@ -83,20 +79,17 @@ IFSG_NORMALS::IFSG_NORMALS( IFSG_NODE& aParent ) m_node = new SGNORMALS( nullptr ); - if( m_node ) + if( !m_node->SetParent( pp ) ) { - if( !m_node->SetParent( pp ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } diff --git a/3d-viewer/3d_cache/sg/ifsg_shape.cpp b/3d-viewer/3d_cache/sg/ifsg_shape.cpp index 722740a3b8..2349e5338e 100644 --- a/3d-viewer/3d_cache/sg/ifsg_shape.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_shape.cpp @@ -44,8 +44,7 @@ IFSG_SHAPE::IFSG_SHAPE( bool create ) m_node = new SGSHAPE( nullptr ); - if( m_node ) - m_node->AssociateWrapper( &m_node ); + m_node->AssociateWrapper( &m_node ); } @@ -53,20 +52,17 @@ IFSG_SHAPE::IFSG_SHAPE( SGNODE* aParent ) { m_node = new SGSHAPE( nullptr ); - if( m_node ) + if( !m_node->SetParent( aParent ) ) { - if( !m_node->SetParent( aParent ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } @@ -83,20 +79,17 @@ IFSG_SHAPE::IFSG_SHAPE( IFSG_NODE& aParent ) m_node = new SGSHAPE( nullptr ); - if( m_node ) + if( !m_node->SetParent( pp ) ) { - if( !m_node->SetParent( pp ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); } diff --git a/3d-viewer/3d_cache/sg/ifsg_transform.cpp b/3d-viewer/3d_cache/sg/ifsg_transform.cpp index 71986c7b2e..165e46e79c 100644 --- a/3d-viewer/3d_cache/sg/ifsg_transform.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_transform.cpp @@ -43,8 +43,7 @@ IFSG_TRANSFORM::IFSG_TRANSFORM( bool create ) m_node = new SCENEGRAPH( nullptr ); - if( m_node ) - m_node->AssociateWrapper( &m_node ); + m_node->AssociateWrapper( &m_node ); } @@ -52,20 +51,17 @@ IFSG_TRANSFORM::IFSG_TRANSFORM( SGNODE* aParent ) { m_node = new SCENEGRAPH( nullptr ); - if( m_node ) + if( !m_node->SetParent( aParent ) ) { - if( !m_node->SetParent( aParent ) ) - { - delete m_node; - m_node = nullptr; + delete m_node; + m_node = nullptr; - wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); + wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent ); - return; - } - - m_node->AssociateWrapper( &m_node ); + return; } + + m_node->AssociateWrapper( &m_node ); }