diff --git a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp index 37e2874def..890df9cef4 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp +++ b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp @@ -175,7 +175,7 @@ bool DLG_SELECT_3DMODEL::TransferDataFromWindow() m_model->rotation.z = 0.0; m_model->offset = m_model->rotation; - m_model->filename.empty(); + m_model->filename.clear(); wxString fname = m_FileTree->GetFilePath(); diff --git a/3d-viewer/3d_cache/sg/scenegraph.cpp b/3d-viewer/3d_cache/sg/scenegraph.cpp index b505b60252..7932d4443c 100644 --- a/3d-viewer/3d_cache/sg/scenegraph.cpp +++ b/3d-viewer/3d_cache/sg/scenegraph.cpp @@ -133,8 +133,19 @@ void SCENEGRAPH::unlinkNode( const SGNODE* aNode, bool isChild ) if( NULL == aNode ) return; - UNLINK_NODE( S3D::SGTYPE_TRANSFORM, SCENEGRAPH, aNode, m_Transforms, m_RTransforms, isChild ); - UNLINK_NODE( S3D::SGTYPE_SHAPE, SGSHAPE, aNode, m_Shape, m_RShape, isChild ); + switch( aNode->GetNodeType() ) + { + case S3D::SGTYPE_TRANSFORM: + UNLINK_NODE( S3D::SGTYPE_TRANSFORM, SCENEGRAPH, aNode, m_Transforms, m_RTransforms, isChild ); + break; + + case S3D::SGTYPE_SHAPE: + UNLINK_NODE( S3D::SGTYPE_SHAPE, SGSHAPE, aNode, m_Shape, m_RShape, isChild ); + break; + + default: + break; + } #ifdef DEBUG do { diff --git a/3d-viewer/3d_cache/sg/sg_helpers.h b/3d-viewer/3d_cache/sg/sg_helpers.h index 650f37426c..064673b333 100644 --- a/3d-viewer/3d_cache/sg/sg_helpers.h +++ b/3d-viewer/3d_cache/sg/sg_helpers.h @@ -82,8 +82,8 @@ class SGCOORDINDEX; std::vector< aType* >::iterator eL; \ if( isChild ) { \ oSL = &aOwnedList; \ - sL = aOwnedList.begin(); \ - eL = aOwnedList.end(); \ + sL = oSL->begin(); \ + eL = oSL->end(); \ while( sL != eL ) { \ if( (SGNODE*)*sL == aNode ) { \ oSL->erase( sL ); \ @@ -93,8 +93,8 @@ class SGCOORDINDEX; } \ } else { \ oSL = &aRefList; \ - sL = aRefList.begin(); \ - eL = aRefList.end(); \ + sL = oSL->begin(); \ + eL = oSL->end(); \ while( sL != eL ) { \ if( (SGNODE*)*sL == aNode ) { \ delNodeRef( this ); \ diff --git a/3d-viewer/3d_model_viewer/c3d_model_viewer.cpp b/3d-viewer/3d_model_viewer/c3d_model_viewer.cpp index 62c4dee3f6..e4fc856976 100644 --- a/3d-viewer/3d_model_viewer/c3d_model_viewer.cpp +++ b/3d-viewer/3d_model_viewer/c3d_model_viewer.cpp @@ -91,6 +91,7 @@ C3D_MODEL_VIEWER::C3D_MODEL_VIEWER( wxWindow *aParent, m_reload_is_needed = false; m_ogl_3dmodel = NULL; m_3d_model = NULL; + m_BiuTo3Dunits = 1.0; // Explicitly create a new rendering context instance for this canvas. m_glRC = new wxGLContext( this ); diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp index 555c16eb61..1ede6e363e 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp @@ -42,6 +42,7 @@ C3D_RENDER_OGL_LEGACY::C3D_RENDER_OGL_LEGACY( CINFO3D_VISU &aSettings, m_ogl_disp_lists_layers.clear(); m_triangles.clear(); m_ogl_disp_list_board = 0; + m_ogl_circle_texture = 0; } diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.cpp index e68a348fe2..8f857a0d91 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c_ogl_3dmodel.cpp @@ -37,6 +37,7 @@ C_OGL_3DMODEL::C_OGL_3DMODEL( const S3DMODEL &a3DModel ) { m_ogl_idx_list_opaque = 0; m_ogl_idx_list_transparent = 0; + m_ogl_idx_list_meshes = 0; m_nr_meshes = 0; m_meshs_bbox = NULL; diff --git a/plugins/3d/vrml/v1/vrml1_shapehints.cpp b/plugins/3d/vrml/v1/vrml1_shapehints.cpp index fe0def4c3f..2b5f1f9d2d 100644 --- a/plugins/3d/vrml/v1/vrml1_shapehints.cpp +++ b/plugins/3d/vrml/v1/vrml1_shapehints.cpp @@ -36,7 +36,6 @@ WRL1SHAPEHINTS::WRL1SHAPEHINTS( NAMEREGISTER* aDictionary ) : WRL1NODE( aDiction { m_order = ORD_UNKNOWN; m_Type = WRL1_SHAPEHINTS; - m_crease = 0.5; m_crease = 0.733; // approx 42 degrees; this is larger than VRML spec. return; } @@ -47,6 +46,7 @@ WRL1SHAPEHINTS::WRL1SHAPEHINTS( NAMEREGISTER* aDictionary, WRL1NODE* aParent ) : { m_order = ORD_UNKNOWN; m_Type = WRL1_SHAPEHINTS; + m_crease = 0.733; // approx 42 degrees; this is larger than VRML spec. m_Parent = aParent; if( NULL != m_Parent ) diff --git a/plugins/3d/vrml/wrlproc.cpp b/plugins/3d/vrml/wrlproc.cpp index 87e6f50346..81b4567f7c 100644 --- a/plugins/3d/vrml/wrlproc.cpp +++ b/plugins/3d/vrml/wrlproc.cpp @@ -52,6 +52,7 @@ WRLPROC::WRLPROC( LINE_READER* aLineReader ) m_eof = false; m_fileline = 0; m_bufpos = 0; + m_file = aLineReader; if( NULL == aLineReader ) { @@ -60,8 +61,6 @@ WRLPROC::WRLPROC( LINE_READER* aLineReader ) } m_error.clear(); - m_file = aLineReader; - wxString tname = m_file->GetSource(); m_filename = tname.ToUTF8(); wxFileName fn( tname ); @@ -166,7 +165,7 @@ bool WRLPROC::getRawLine( void ) while( sS != eS ) { - if( '\xff' == ((*sS) & 0x80) ) + if( ((*sS) & 0x80) ) { m_error = " non-ASCII character sequence in VRML1 file"; return false; diff --git a/plugins/3d/vrml/x3d/x3d_appearance.cpp b/plugins/3d/vrml/x3d/x3d_appearance.cpp index f8d6453f7d..876e49f939 100644 --- a/plugins/3d/vrml/x3d/x3d_appearance.cpp +++ b/plugins/3d/vrml/x3d/x3d_appearance.cpp @@ -117,11 +117,11 @@ void X3DAPP::readFields( wxXmlNode* aNode ) m_MatName = prop->GetValue(); m_Dict->AddName( m_MatName, this ); } - if( pname == "USE" ) + else if( pname == "USE" ) { X3DNODE* np = m_Dict->FindName( prop->GetValue() ); - if( np->GetNodeType() == X3D_APPEARANCE ) + if( NULL != np && np->GetNodeType() == X3D_APPEARANCE ) { X3DAPP* ap = (X3DAPP*) np; diffuseColor = ap->diffuseColor; diff --git a/utils/idftools/dxf2idf.cpp b/utils/idftools/dxf2idf.cpp index 7147cda961..c921365b74 100644 --- a/utils/idftools/dxf2idf.cpp +++ b/utils/idftools/dxf2idf.cpp @@ -280,7 +280,6 @@ bool DXF2IDF::WriteOutline( FILE* aFile, bool isInch ) void DXF2IDF::addHeader( const DRW_Header* data ) { std::map::const_iterator it; - m_scale = 1.0; // assume no scale factor for( it = data->vars.begin(); it != data->vars.end(); ++it ) { diff --git a/utils/idftools/dxf2idf.h b/utils/idftools/dxf2idf.h index 2eb8eada64..bd620a7691 100644 --- a/utils/idftools/dxf2idf.h +++ b/utils/idftools/dxf2idf.h @@ -38,6 +38,7 @@ private: void insertArc( const IDF_POINT& aSegStart, const IDF_POINT& aSegEnd, double aBulge ); public: + DXF2IDF() : m_scale( 1.0 ) {}; ~DXF2IDF(); bool ReadDxf( const std::string aFile );