Upgraded visualization libraries

Major refactoring of color legend framework
Added discrete log color legend
p4#: 18989
This commit is contained in:
Magne Sjaastad
2012-10-02 10:17:52 +02:00
parent 082560b2a5
commit 9c1ce7591e
163 changed files with 8917 additions and 3214 deletions

View File

@@ -27,8 +27,8 @@
#include "cvfArrowGenerator.h"
#include "cvfBoundingBox.h"
#include "cvfBoxGenerator.h"
#include "cvfFrustum.h"
#include "cvfEdgeKey.h"
#include "cvfFrustum.h"
#include "cvfGeometryBuilder.h"
#include "cvfGeometryBuilderFaceList.h"
#include "cvfGeometryBuilderTriangles.h"
@@ -37,5 +37,8 @@
#include "cvfOutlineEdgeExtractor.h"
#include "cvfPatchGenerator.h"
#include "cvfRay.h"
#include "cvfTriangleMeshEdgeExtractor.h"
#include "cvfTriangleVertexSplitter.h"
#include "cvfVertexCompactor.h"
#include "cvfVertexWelder.h"

View File

@@ -253,7 +253,10 @@ bool OutlineEdgeExtractor::isFaceAngleAboveThreshold(size_t faceIdx1, size_t fac
return true;
}
double angle = Math::acos(n1*n2);
// Guard acos against out-of-domain input
const double dotProduct = Math::clamp(static_cast<double>(n1*n2), -1.0, 1.0);
const double angle = Math::acos(dotProduct);
if (Math::abs(angle) > m_creaseAngle)
{
return true;

View File

@@ -282,40 +282,28 @@ uint TriangleVertexSplitter::processVertex(uint origVertexIndex, const Vec3f& fa
}
}
//--------------------------------------------------------------------------------------------------
/// Return true if the angle between the two normals are below the current crease angle.
/// Return true if the angle between the two normals is below the current crease angle.
//--------------------------------------------------------------------------------------------------
bool TriangleVertexSplitter::isNormalDifferenceBelowThreshold(const Vec3f& n1, const Vec3f& n2)
{
// If either vector is 0, there is probably some trouble with the triangle
// Return false so that it will be split
if (n1.isZero() || n2.isZero())
{
return false;
}
double dotProduct = n1*n2;
// Guard acos against out-of-domain input
const double dotProduct = Math::clamp(static_cast<double>(n1*n2), -1.0, 1.0);
if (dotProduct <= -1.0)
{
dotProduct = -1.0;
}
else if (dotProduct >= 1.0)
{
dotProduct = 1.0;
}
double angle = Math::acos(dotProduct);
const double angle = Math::acos(dotProduct);
if (Math::abs(angle) < m_creaseAngle)
{
return true;
}
else if (Math::abs(angle) >= m_creaseAngle)
{
return false;
}
return false;
}