Made progress reports use osg::notify(osg::INFO) instread of std::cout

This commit is contained in:
Robert Osfield
2003-12-12 13:53:04 +00:00
parent 995af47ab9
commit 4bf9347fae
2 changed files with 12 additions and 17 deletions

View File

@@ -1109,7 +1109,7 @@ void Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes()
}
else
{
std::cout<<"failed dynamic_cast"<<std::endl;
osg::notify(osg::WARN)<<"Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
}
}
_redundantNodeList.clear();
@@ -1774,7 +1774,6 @@ bool Optimizer::MergeGeometryVisitor::mergeGeometry(osg::Geometry& lhs,osg::Geom
std::copy(primitiveUByte->begin(),primitiveUByte->end(),std::back_inserter(*new_primitive));
new_primitive->offsetIndices(base);
(*primItr) = new_primitive;
std::cout<<"Remapping to a UInt "<<(*primItr)->className()<<std::endl;
} else if ((base+currentMaximum)>=256)
{
// must promote to a DrawElementsUShort
@@ -1782,11 +1781,9 @@ bool Optimizer::MergeGeometryVisitor::mergeGeometry(osg::Geometry& lhs,osg::Geom
std::copy(primitiveUByte->begin(),primitiveUByte->end(),std::back_inserter(*new_primitive));
new_primitive->offsetIndices(base);
(*primItr) = new_primitive;
std::cout<<"Remapped to a UShort"<<(*primItr)->className()<<std::endl;
}
else
{
std::cout<<"Not Remapping to a UShort"<<std::endl;
primitive->offsetIndices(base);
}
}
@@ -1925,7 +1922,7 @@ bool Optimizer::SpatializeGroupsVisitor::divide(osg::Group* group, unsigned int
bool yAxis = (bb.yMax()-bb.yMin())>divide_distance;
bool zAxis = (bb.zMax()-bb.zMin())>divide_distance;
std::cout<<"Dividing "<<group->className()<<" num children = "<<group->getNumChildren()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
osg::notify(osg::INFO)<<"Dividing "<<group->className()<<" num children = "<<group->getNumChildren()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
unsigned int numChildrenOnEntry = group->getNumChildren();
@@ -2085,12 +2082,12 @@ void Optimizer::CopySharedSubgraphsVisitor::apply(osg::Node& node)
void Optimizer::CopySharedSubgraphsVisitor::copySharedNodes()
{
std::cout<<"Shared node "<<_sharedNodeList.size()<<std::endl;
osg::notify(osg::INFO)<<"Shared node "<<_sharedNodeList.size()<<std::endl;
for(SharedNodeList::iterator itr=_sharedNodeList.begin();
itr!=_sharedNodeList.end();
++itr)
{
std::cout<<" No parents "<<(*itr)->getNumParents()<<std::endl;
osg::notify(osg::INFO)<<" No parents "<<(*itr)->getNumParents()<<std::endl;
osg::Node* node = *itr;
for(unsigned int i=node->getNumParents()-1;i>0;--i)
{

View File

@@ -531,8 +531,6 @@ void TriStripVisitor::stripify(Geometry& geom)
geom.copyToAndOptimize(geom);
}
// check for the existance of surface primitives
unsigned int numSurfacePrimitives = 0;
unsigned int numNonSurfacePrimitives = 0;
@@ -780,13 +778,13 @@ void TriStripVisitor::stripify(Geometry& geom)
{
unsigned int maxValue = *(std::max_element(indices.begin(),indices.end()));
if (maxValue<256)
if (maxValue>=65536)
{
osg::DrawElementsUByte* elements = new osg::DrawElementsUByte(GL_QUADS);
osg::DrawElementsUInt* elements = new osg::DrawElementsUInt(GL_QUADS);
std::copy(indices.begin(),indices.end(),std::back_inserter(*elements));
new_primitives.push_back(elements);
}
else if (maxValue<65536)
else if (maxValue>=256)
{
osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(GL_QUADS);
std::copy(indices.begin(),indices.end(),std::back_inserter(*elements));
@@ -794,7 +792,7 @@ void TriStripVisitor::stripify(Geometry& geom)
}
else
{
osg::DrawElementsUInt* elements = new osg::DrawElementsUInt(GL_QUADS);
osg::DrawElementsUByte* elements = new osg::DrawElementsUByte(GL_QUADS);
std::copy(indices.begin(),indices.end(),std::back_inserter(*elements));
new_primitives.push_back(elements);
}
@@ -826,14 +824,14 @@ void TriStripVisitor::stripify(Geometry& geom)
else
{
unsigned int maxValue = *(std::max_element(pitr->m_Indices.begin(),pitr->m_Indices.end()));
if (maxValue<256)
if (maxValue>=65536)
{
osg::DrawElementsUByte* elements = new osg::DrawElementsUByte(pitr->m_Type);
osg::DrawElementsUInt* elements = new osg::DrawElementsUInt(pitr->m_Type);
elements->reserve(pitr->m_Indices.size());
std::copy(pitr->m_Indices.begin(),pitr->m_Indices.end(),std::back_inserter(*elements));
new_primitives.push_back(elements);
}
else if (maxValue<65536)
else if (maxValue>=256)
{
osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(pitr->m_Type);
elements->reserve(pitr->m_Indices.size());
@@ -842,7 +840,7 @@ void TriStripVisitor::stripify(Geometry& geom)
}
else
{
osg::DrawElementsUInt* elements = new osg::DrawElementsUInt(pitr->m_Type);
osg::DrawElementsUByte* elements = new osg::DrawElementsUByte(pitr->m_Type);
elements->reserve(pitr->m_Indices.size());
std::copy(pitr->m_Indices.begin(),pitr->m_Indices.end(),std::back_inserter(*elements));
new_primitives.push_back(elements);