kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #23984
problems in old 3DViewer with new bbox code
-
To:
Cirilo Bernardo <cirilo.bernardo@xxxxxxxxx>, "kicad-developers@xxxxxxxxxxxxxxxxxxx" <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Mário Luzeiro <mrluzeiro@xxxxx>
-
Date:
Wed, 6 Apr 2016 22:35:22 +0000
-
Accept-language:
en-GB, en-US
-
Authentication-results:
gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=ua.pt;
-
In-reply-to:
<CAHBNN+MDr=B39eVTudR6riVk8PjVzE0MUA6nRyE-LMwt877mXg@mail.gmail.com>
-
Spamdiagnosticmetadata:
NSPM
-
Spamdiagnosticoutput:
1:23
-
Thread-index:
AQHRj53OAz6CWlMWs0m9lQsjSdux7Z98nrwQgADPhYCAABr24A==
-
Thread-topic:
problems in old 3DViewer with new bbox code
Hi all,
Attached is a patch that fixes an assert while displaying the 3D shapes bounding boxes (because of the new merged code)
It also fixes a compile error in my machine because of the order of the include wx/glcanvas.h
Mario Luzeiro
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: mrluzeiro@xxxxx-20160406223038-ybnk3raxdmiv4p25
# target_branch: lp:kicad
# testament_sha1: fdb94b61edeaff6bf32adf2312d45689aaf90547
# timestamp: 2016-04-06 23:31:48 +0100
# base_revision_id: pavlina.chris@xxxxxxxxx-20160406003250-\
# jcfo1x3c17zz4py4
#
# Begin patch
=== modified file '3d-viewer/3d_draw.cpp'
--- 3d-viewer/3d_draw.cpp 2015-12-19 04:02:52 +0000
+++ 3d-viewer/3d_draw.cpp 2016-04-06 22:30:38 +0000
@@ -1129,14 +1129,15 @@
shape3D->Render( aIsRenderingJustNonTransparentObjects,
aIsRenderingJustTransparentObjects );
- if( isEnabled( FL_RENDER_SHOW_MODEL_BBOX ) )
+ const CBBOX &shapeBBox = shape3D->getBBox();
+ if( isEnabled( FL_RENDER_SHOW_MODEL_BBOX ) && shapeBBox.IsInitialized() )
{
// Set the alpha current color to opaque
float currentColor[4];
glGetFloatv( GL_CURRENT_COLOR,currentColor );
currentColor[3] = 1.0f;
glColor4fv( currentColor );
- OGL_draw_bbox( shape3D->getBBox() );
+ OGL_draw_bbox( shapeBBox );
}
glPopMatrix();
=== modified file '3d-viewer/3d_mesh_model.cpp'
--- 3d-viewer/3d_mesh_model.cpp 2015-12-08 22:52:02 +0000
+++ 3d-viewer/3d_mesh_model.cpp 2016-04-06 22:30:38 +0000
@@ -112,24 +112,12 @@
void S3D_MESH::calcBBox( )
{
- CBBOX tmpBBox;
-
- bool firstBBox = true;
+ m_BBox.Reset();
// Calc boudingbox for all coords
for( unsigned int idx = 0; idx < m_CoordIndex.size(); idx++ )
- {
for( unsigned int ii = 0; ii < m_CoordIndex[idx].size(); ii++ )
- if( firstBBox )
- {
- firstBBox = false;
- tmpBBox = CBBOX( m_Point[m_CoordIndex[idx][ii]] ); // Initialize with the first vertex found
- }
- else
- tmpBBox.Union( m_Point[m_CoordIndex[idx][ii]] );
- }
-
- m_BBox = tmpBBox;
+ m_BBox.Union( m_Point[m_CoordIndex[idx][ii]] );
}
=== modified file '3d-viewer/3d_read_mesh.cpp'
--- 3d-viewer/3d_read_mesh.cpp 2015-12-08 22:52:02 +0000
+++ 3d-viewer/3d_read_mesh.cpp 2016-04-06 22:30:38 +0000
@@ -139,15 +139,9 @@
if( m_parser == NULL )
return;
- bool firstBBox = true;
+ m_BBox.Reset();
for( unsigned int idx = 0; idx < m_parser->childs.size(); idx++ )
- if( firstBBox )
- {
- firstBBox = false;
- m_BBox = m_parser->childs[idx]->getBBox();
- }
- else
m_BBox.Union( m_parser->childs[idx]->getBBox() );
// Calc transformation matrix to apply in AABBox
=== modified file '3d-viewer/3d_viewer.h'
--- 3d-viewer/3d_viewer.h 2015-12-21 11:52:00 +0000
+++ 3d-viewer/3d_viewer.h 2016-04-06 22:30:38 +0000
@@ -36,9 +36,9 @@
#error Please build wxWidgets with Opengl support (./configure --with-opengl)
#endif
-#include <wx/glcanvas.h>
#include <3d_struct.h>
#include <info3d_visu.h>
+#include <wx/glcanvas.h>
/// A variable name whose value holds the path of 3D shape files.
/// Currently an environment variable, eventually a project variable.
=== modified file '3d-viewer/info3d_visu.h'
--- 3d-viewer/info3d_visu.h 2016-02-24 19:53:02 +0000
+++ 3d-viewer/info3d_visu.h 2016-04-06 22:30:38 +0000
@@ -32,8 +32,6 @@
#include <layers_id_colors_and_visibility.h> // Layers id definitions
-#include <wx/glcanvas.h>
-
#ifdef __WXMAC__
# ifdef __DARWIN__
# include <OpenGL/glu.h>
# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWfTF6ZsABGtfgEBUW2P//1/n
2sq//9/wYAd3B58FHQkp53XWbo3u8HqKDEqZT9U/VNH6poaNqZPNUBkPSPUABpoNPU9I0ElCaaND
QART9SANGjQAxAAABxkyZMRiYATJgmQA0YRgCGAYiJMSaHkanpppAaAAAAGgNACKiaAKPQNU2Caa
JoeoNNDQyGQA0xBJIBABTNAmKeQmo2hNDR6hiAAEwX25ZZ73cU1jEfT3bQOH1HcUyhqDeuuG9jMU
FzFFkYMAc4TqNskJ1CiCELkWmdqQCGBu88jN+dVhHcRdISQSASKSRHvlJFOaN2hgkKqmhBjBBkaH
hfmkmeqWUISrBM1x3lgHUELPOnP2IOc0fIZWI3ff9h7Th67CPqZJMSOOTg+JIgiah6q8Sbadbbpg
leIrxkWYq31b5BDIkZKyRMDhJFWyIYMON9INEaCsSSDEj9mYzHa79cWAvApoM9akPhyGlSRIx1SC
7ZkBpFyTxiF+l43ta+8hGEYk2V7nlL6ldgaEuIyxYIf4t6ZoQ5gNrGkAUFqhB+xROo6hCJFgFOQ4
4E6nEVESjNI7poD60iBid9BitAWkSjxwRHJWrw8eN9bWImUo5xkanZpEBpsWvHFrki8u3F/zciqZ
eVUrSexSrGBC41DmK0iBekMRtthTKmVCtnM4vR72ZmZ5YTS85M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