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

@@ -21,6 +21,7 @@
#include "cvfScene.h"
#include "cvfModel.h"
#include "cvfPartRenderHintCollection.h"
#include "cvfTransform.h"
namespace cvf {
@@ -35,15 +36,30 @@ namespace cvf {
///
//==================================================================================================
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Scene::Scene()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Scene::~Scene()
{
}
//--------------------------------------------------------------------------------------------------
/// Compute the visible parts of all models in the scene
//--------------------------------------------------------------------------------------------------
void Scene::findVisibleParts(PartRenderHintCollection* visibleParts, const Camera& camera, const CullSettings& cullSettings, unsigned int enableMask)
void Scene::findVisibleParts(PartRenderHintCollection* visibleParts, const Camera& camera, const CullSettings& cullSettings, uint enableMask)
{
visibleParts->setCountZero();
uint i;
for (i = 0; i < modelCount(); i++)
uint numModels = modelCount();
for (uint i = 0; i < numModels; i++)
{
Model* model = m_models[i].p();
if (model)
@@ -167,5 +183,53 @@ BoundingBox Scene::boundingBox() const
}
} // namespace cvf
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Scene::setTransformTree(Transform* transform)
{
m_tranformTree = transform;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Transform* Scene::transformTree()
{
return m_tranformTree.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Scene::updateTransformTree(const Camera* camera)
{
bool boundingBoxesNeedUpdate = false;
if (m_tranformTree.notNull())
{
m_tranformTree->updateWorldTransform(camera);
boundingBoxesNeedUpdate = true;
}
size_t numModels = m_models.size();
for (size_t i = 0; i < numModels; i++)
{
Model* model = m_models.at(i);
CVF_ASSERT(model);
if (model->transformTree())
{
model->transformTree()->updateWorldTransform(camera);
}
if (model->transformTree() || boundingBoxesNeedUpdate)
{
model->updateBoundingBoxesRecursive();
}
}
}
} // namespace cvf