Cleanup dead code and stale TODOs.

This commit is contained in:
Jeff Young 2021-12-03 17:44:43 +00:00
parent dabc75bee8
commit b84a85f648
4 changed files with 1 additions and 93 deletions

View File

@ -254,47 +254,6 @@ SFVEC3F BBOX_3D::Offset( const SFVEC3F& p ) const
}
/// @todo Why are we keeping both implementations of Intersect()?
// Intersection code based on the book:
// "Physical Based Ray Tracing" (by Matt Pharr and Greg Humphrey)
// https://github.com/mmp/pbrt-v2/blob/master/src/core/geometry.cpp#L68
#if 0
bool BBOX_3D::Intersect( const RAY& aRay, float* aOutHitt0, float* aOutHitt1 ) const
{
float t0 = 0.0f;
float t1 = FLT_MAX;
for( unsigned int i = 0; i < 3; ++i )
{
// Update interval for _i_th bounding box slab
float tNear = ( m_min[i] - aRay.m_Origin[i] ) * aRay.m_InvDir[i];
float tFar = ( m_max[i] - aRay.m_Origin[i] ) * aRay.m_InvDir[i];
// Update parametric interval from slab intersection
if( tNear > tFar )
{
// Swap
float ftemp = tNear;
tNear = tFar;
tFar = ftemp;
}
t0 = tNear > t0 ? tNear : t0;
t1 = tFar < t1 ? tFar : t1;
if( t0 > t1 )
return false;
}
if( aOutHitt0 )
*aOutHitt0 = t0;
if( aOutHitt1 )
*aOutHitt1 = t1;
return true;
}
#else
// https://github.com/mmp/pbrt-v2/blob/master/src/accelerators/bvh.cpp#L126
bool BBOX_3D::Intersect( const RAY& aRay, float* aOutHitt0, float* aOutHitt1 ) const
{
@ -332,7 +291,6 @@ bool BBOX_3D::Intersect( const RAY& aRay, float* aOutHitt0, float* aOutHitt1 ) c
return true;
}
#endif
void BBOX_3D::ApplyTransformation( glm::mat4 aTransformMatrix )
@ -349,22 +307,3 @@ void BBOX_3D::ApplyTransformation( glm::mat4 aTransformMatrix )
}
void BBOX_3D::ApplyTransformationAA( glm::mat4 aTransformMatrix )
{
wxASSERT( IsInitialized() );
// apply the transformation matrix for each of vertices of the bounding box
// and make a union with all vertices
BBOX_3D tmpBBox = BBOX_3D(
SFVEC3F( aTransformMatrix * glm::vec4( m_min.x, m_min.y, m_min.z, 1.0f ) ) );
tmpBBox.Union( SFVEC3F( aTransformMatrix * glm::vec4( m_max.x, m_min.y, m_min.z, 1.0f ) ) );
tmpBBox.Union( SFVEC3F( aTransformMatrix * glm::vec4( m_min.x, m_max.y, m_min.z, 1.0f ) ) );
tmpBBox.Union( SFVEC3F( aTransformMatrix * glm::vec4( m_min.x, m_min.y, m_max.z, 1.0f ) ) );
tmpBBox.Union( SFVEC3F( aTransformMatrix * glm::vec4( m_min.x, m_max.y, m_max.z, 1.0f ) ) );
tmpBBox.Union( SFVEC3F( aTransformMatrix * glm::vec4( m_max.x, m_max.y, m_min.z, 1.0f ) ) );
tmpBBox.Union( SFVEC3F( aTransformMatrix * glm::vec4( m_max.x, m_min.y, m_max.z, 1.0f ) ) );
tmpBBox.Union( SFVEC3F( aTransformMatrix * glm::vec4( m_max.x, m_max.y, m_max.z, 1.0f ) ) );
m_min = tmpBBox.m_min;
m_max = tmpBBox.m_max;
}

View File

@ -132,14 +132,6 @@ public:
*/
void ApplyTransformation( glm::mat4 aTransformMatrix );
/**
* Apply a transformation matrix to the box points and recalculate it
* to fit an axis aligned bounding box.
*
* @param aTransformMatrix matrix to apply to the points of the bounding box.
*/
void ApplyTransformationAA( glm::mat4 aTransformMatrix );
/**
* Calculate the volume of a bounding box.
*

View File

@ -811,9 +811,6 @@ void DXF_PLOTTER::FlashRegularPolygon( const wxPoint& aShapePos, int aRadius, in
/**
* Check if a given string contains non-ASCII characters.
*
* @fixme The performance of this code is really poor, but in this case it can be
* acceptable because the plot operation is not called very often.
*
* @param string String to check.
* @return true if it contains some non-ASCII character, false if all characters are
* inside ASCII range (<=255).
@ -823,6 +820,7 @@ bool containsNonAsciiChars( const wxString& string )
for( unsigned i = 0; i < string.length(); i++ )
{
wchar_t ch = string[i];
if( ch > 255 )
return true;
}

View File

@ -1080,27 +1080,6 @@ EDEVICE_SET::EDEVICE_SET( wxXmlNode* aDeviceSet )
name = parseRequiredAttribute<wxString>( aDeviceSet, "name" );
prefix = parseOptionalAttribute<wxString>( aDeviceSet, "prefix" );
uservalue = parseOptionalAttribute<bool>( aDeviceSet, "uservalue" );
/* Russell: Parsing of devices and gates moved to sch_eagle_plugin.cpp
*
//TODO: description
NODE_MAP aDeviceSetChildren = MapChildren(aDeviceSet);
wxXmlNode* deviceNode = getChildrenNodes(aDeviceSetChildren, "device");
while(deviceNode){
devices.push_back(EDEVICE(deviceNode));
deviceNode->GetNext();
}
wxXmlNode* gateNode = getChildrenNodes(aDeviceSetChildren, "gate");
while(gateNode){
gates.push_back(EGATE(gateNode));
gateNode->GetNext();
}
*/
}