Fixup the 3d Viewer code after the last fixup
This commit is contained in:
parent
b9b4618c8e
commit
048900dda7
|
@ -74,8 +74,11 @@ IFSG_COLORS::IFSG_COLORS( IFSG_NODE& aParent )
|
||||||
SGNODE* pp = aParent.GetRawPtr();
|
SGNODE* pp = aParent.GetRawPtr();
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
// Braces needed due to dangling else warning from wxLogTrace macro
|
||||||
if( !pp )
|
if( !pp )
|
||||||
|
{
|
||||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_node = new SGCOLORS( nullptr );
|
m_node = new SGCOLORS( nullptr );
|
||||||
|
|
|
@ -170,23 +170,22 @@ bool CROUNDSEGMENT2D::Intersect( const RAYSEG2D &aSegRay,
|
||||||
{
|
{
|
||||||
if( !start_is_inside )
|
if( !start_is_inside )
|
||||||
{
|
{
|
||||||
if( (hitted == false) || (rightSegT < closerHitT) )
|
if( ( hitted == false ) || ( rightSegT < closerHitT ) )
|
||||||
{
|
{
|
||||||
closerHitT = rightSegT;
|
closerHitT = rightSegT;
|
||||||
closerHitNormal = SFVEC2F( -m_rightDir.y, m_rightDir.x );
|
closerHitNormal = SFVEC2F( -m_rightDir.y, m_rightDir.x );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( start_is_inside )
|
|
||||||
{
|
|
||||||
if( (hitted == false) || (rightSegT > farHitT) )
|
|
||||||
{
|
|
||||||
farHitT = rightSegT;
|
|
||||||
farHitNormal = SFVEC2F( -m_rightDir.y, m_rightDir.x );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hitted = true;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( ( hitted == false ) || ( rightSegT > farHitT ) )
|
||||||
|
{
|
||||||
|
farHitT = rightSegT;
|
||||||
|
farHitNormal = SFVEC2F( -m_rightDir.y, m_rightDir.x );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hitted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
float circleStart_T0;
|
float circleStart_T0;
|
||||||
|
@ -210,8 +209,7 @@ bool CROUNDSEGMENT2D::Intersect( const RAYSEG2D &aSegRay,
|
||||||
closerHitNormal = circleStart_N0;
|
closerHitNormal = circleStart_N0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if( start_is_inside )
|
|
||||||
{
|
{
|
||||||
if( (hitted == false) || (circleStart_T1 > farHitT) )
|
if( (hitted == false) || (circleStart_T1 > farHitT) )
|
||||||
{
|
{
|
||||||
|
@ -253,8 +251,7 @@ bool CROUNDSEGMENT2D::Intersect( const RAYSEG2D &aSegRay,
|
||||||
closerHitNormal = circleEnd_N0;
|
closerHitNormal = circleEnd_N0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if( start_is_inside )
|
|
||||||
{
|
{
|
||||||
if( (hitted == false) || (circleEnd_T1 > farHitT) )
|
if( (hitted == false) || (circleEnd_T1 > farHitT) )
|
||||||
{
|
{
|
||||||
|
@ -323,17 +320,11 @@ INTERSECTION_RESULT CROUNDSEGMENT2D::IsBBoxInside( const CBBOX2D &aBBox ) const
|
||||||
isInside[3] = IsPointInside( v[3] );
|
isInside[3] = IsPointInside( v[3] );
|
||||||
|
|
||||||
// Check if all points are inside the circle
|
// Check if all points are inside the circle
|
||||||
if( isInside[0] &&
|
if( isInside[0] && isInside[1] && isInside[2] && isInside[3] )
|
||||||
isInside[1] &&
|
|
||||||
isInside[2] &&
|
|
||||||
isInside[3] )
|
|
||||||
return INTERSECTION_RESULT::FULL_INSIDE;
|
return INTERSECTION_RESULT::FULL_INSIDE;
|
||||||
|
|
||||||
// Check if any point is inside the circle
|
// Check if any point is inside the circle
|
||||||
if( isInside[0] ||
|
if( isInside[0] || isInside[1] || isInside[2] || isInside[3] )
|
||||||
isInside[1] ||
|
|
||||||
isInside[2] ||
|
|
||||||
isInside[3] )
|
|
||||||
return INTERSECTION_RESULT::INTERSECTS;
|
return INTERSECTION_RESULT::INTERSECTS;
|
||||||
|
|
||||||
return INTERSECTION_RESULT::MISSES;
|
return INTERSECTION_RESULT::MISSES;
|
||||||
|
|
|
@ -157,8 +157,7 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxSt
|
||||||
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
||||||
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
||||||
// the canvas before it will respond to mouse wheel events.
|
// the canvas before it will respond to mouse wheel events.
|
||||||
if( m_canvas )
|
m_canvas->SetFocus();
|
||||||
m_canvas->SetFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue