Convert NOTIFY to OSG_NOTIFY to avoid problems with polution of users apps with the NOTIFY macro

This commit is contained in:
Robert Osfield
2010-02-10 12:44:59 +00:00
parent 6ab51c7c47
commit f17e401347
42 changed files with 884 additions and 884 deletions

View File

@@ -155,7 +155,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & TESSELLATE_GEOMETRY)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TESSELLATE_GEOMETRY"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TESSELLATE_GEOMETRY"<<std::endl;
TessellateVisitor tsv;
node->accept(tsv);
@@ -163,7 +163,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & REMOVE_LOADED_PROXY_NODES)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_LOADED_PROXY_NODES"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_LOADED_PROXY_NODES"<<std::endl;
RemoveLoadedProxyNodesVisitor rlpnv(this);
node->accept(rlpnv);
@@ -173,7 +173,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & COMBINE_ADJACENT_LODS)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COMBINE_ADJACENT_LODS"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COMBINE_ADJACENT_LODS"<<std::endl;
CombineLODsVisitor clv(this);
node->accept(clv);
@@ -182,7 +182,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & OPTIMIZE_TEXTURE_SETTINGS)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing OPTIMIZE_TEXTURE_SETTINGS"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing OPTIMIZE_TEXTURE_SETTINGS"<<std::endl;
TextureVisitor tv(true,true, // unref image
false,false, // client storage
@@ -193,7 +193,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & SHARE_DUPLICATE_STATE)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SHARE_DUPLICATE_STATE"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SHARE_DUPLICATE_STATE"<<std::endl;
bool combineDynamicState = false;
bool combineStaticState = true;
@@ -206,7 +206,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & TEXTURE_ATLAS_BUILDER)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TEXTURE_ATLAS_BUILDER"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TEXTURE_ATLAS_BUILDER"<<std::endl;
// traverse the scene collecting textures into texture atlas.
TextureAtlasVisitor tav(this);
@@ -225,7 +225,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & COPY_SHARED_NODES)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COPY_SHARED_NODES"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COPY_SHARED_NODES"<<std::endl;
CopySharedSubgraphsVisitor cssv(this);
node->accept(cssv);
@@ -234,13 +234,13 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & FLATTEN_STATIC_TRANSFORMS)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS"<<std::endl;
int i=0;
bool result = false;
do
{
NOTIFY(osg::DEBUG_INFO) << "** RemoveStaticTransformsVisitor *** Pass "<<i<<std::endl;
OSG_NOTIFY(osg::DEBUG_INFO) << "** RemoveStaticTransformsVisitor *** Pass "<<i<<std::endl;
FlattenStaticTransformsVisitor fstv(this);
node->accept(fstv);
result = fstv.removeTransforms(node);
@@ -255,7 +255,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS"<<std::endl;
// no combine any adjacent static transforms.
FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor fstdssv(this);
@@ -265,7 +265,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & MERGE_GEODES)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEODES"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEODES"<<std::endl;
osg::Timer_t startTick = osg::Timer::instance()->tick();
@@ -274,12 +274,12 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
osg::Timer_t endTick = osg::Timer::instance()->tick();
NOTIFY(osg::INFO)<<"MERGE_GEODES took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
OSG_NOTIFY(osg::INFO)<<"MERGE_GEODES took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
}
if (options & CHECK_GEOMETRY)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing CHECK_GEOMETRY"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing CHECK_GEOMETRY"<<std::endl;
CheckGeometryVisitor mgv(this);
node->accept(mgv);
@@ -287,7 +287,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & MAKE_FAST_GEOMETRY)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MAKE_FAST_GEOMETRY"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MAKE_FAST_GEOMETRY"<<std::endl;
MakeFastGeometryVisitor mgv(this);
node->accept(mgv);
@@ -295,7 +295,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & MERGE_GEOMETRY)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEOMETRY"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEOMETRY"<<std::endl;
osg::Timer_t startTick = osg::Timer::instance()->tick();
@@ -305,12 +305,12 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
osg::Timer_t endTick = osg::Timer::instance()->tick();
NOTIFY(osg::INFO)<<"MERGE_GEOMETRY took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
OSG_NOTIFY(osg::INFO)<<"MERGE_GEOMETRY took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
}
if (options & TRISTRIP_GEOMETRY)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TRISTRIP_GEOMETRY"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TRISTRIP_GEOMETRY"<<std::endl;
TriStripVisitor tsv(this);
node->accept(tsv);
@@ -319,7 +319,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & REMOVE_REDUNDANT_NODES)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<<std::endl;
RemoveEmptyNodesVisitor renv(this);
node->accept(renv);
@@ -340,7 +340,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & SPATIALIZE_GROUPS)
{
NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SPATIALIZE_GROUPS"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SPATIALIZE_GROUPS"<<std::endl;
SpatializeGroupsVisitor sv(this);
node->accept(sv);
@@ -458,7 +458,7 @@ void Optimizer::StateVisitor::apply(osg::Geode& geode)
void Optimizer::StateVisitor::optimize()
{
NOTIFY(osg::INFO) << "Num of StateSet="<<_statesets.size()<< std::endl;
OSG_NOTIFY(osg::INFO) << "Num of StateSet="<<_statesets.size()<< std::endl;
{
// create map from state attributes to stateset which contain them.
@@ -539,15 +539,15 @@ void Optimizer::StateVisitor::optimize()
// other.
std::sort(attributeList.begin(),attributeList.end(),LessDerefFunctor<osg::StateAttribute>());
NOTIFY(osg::INFO) << "state attribute list"<< std::endl;
OSG_NOTIFY(osg::INFO) << "state attribute list"<< std::endl;
for(AttributeList::iterator aaitr = attributeList.begin();
aaitr!=attributeList.end();
++aaitr)
{
NOTIFY(osg::INFO) << " "<<*aaitr << " "<<(*aaitr)->className()<< std::endl;
OSG_NOTIFY(osg::INFO) << " "<<*aaitr << " "<<(*aaitr)->className()<< std::endl;
}
NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
OSG_NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
// find the duplicates.
AttributeList::iterator first_unique = attributeList.begin();
AttributeList::iterator current = first_unique;
@@ -556,13 +556,13 @@ void Optimizer::StateVisitor::optimize()
{
if (**current==**first_unique)
{
NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
OSG_NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
StateSetList& statesetlist = attributeToStateSetMap[*current];
for(StateSetList::iterator sitr=statesetlist.begin();
sitr!=statesetlist.end();
++sitr)
{
NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
osg::StateSet* stateset = sitr->first;
unsigned int unit = sitr->second;
if (unit==NON_TEXTURE_ATTRIBUTE) stateset->setAttribute(*first_unique);
@@ -591,15 +591,15 @@ void Optimizer::StateVisitor::optimize()
// other.
std::sort(uniformList.begin(),uniformList.end(),LessDerefFunctor<osg::Uniform>());
NOTIFY(osg::INFO) << "state uniform list"<< std::endl;
OSG_NOTIFY(osg::INFO) << "state uniform list"<< std::endl;
for(UniformList::iterator uuitr = uniformList.begin();
uuitr!=uniformList.end();
++uuitr)
{
NOTIFY(osg::INFO) << " "<<*uuitr << " "<<(*uuitr)->getName()<< std::endl;
OSG_NOTIFY(osg::INFO) << " "<<*uuitr << " "<<(*uuitr)->getName()<< std::endl;
}
NOTIFY(osg::INFO) << "searching for duplicate uniforms"<< std::endl;
OSG_NOTIFY(osg::INFO) << "searching for duplicate uniforms"<< std::endl;
// find the duplicates.
UniformList::iterator first_unique_uniform = uniformList.begin();
UniformList::iterator current_uniform = first_unique_uniform;
@@ -608,13 +608,13 @@ void Optimizer::StateVisitor::optimize()
{
if ((**current_uniform)==(**first_unique_uniform))
{
NOTIFY(osg::INFO) << " found duplicate uniform "<<(*current_uniform)->getName()<<" first_unique_uniform="<<*first_unique_uniform<<" current_uniform="<<*current_uniform<< std::endl;
OSG_NOTIFY(osg::INFO) << " found duplicate uniform "<<(*current_uniform)->getName()<<" first_unique_uniform="<<*first_unique_uniform<<" current_uniform="<<*current_uniform<< std::endl;
StateSetSet& statesetset = uniformToStateSetMap[*current_uniform];
for(StateSetSet::iterator sitr=statesetset.begin();
sitr!=statesetset.end();
++sitr)
{
NOTIFY(osg::INFO) << " replace duplicate "<<*current_uniform<<" with "<<*first_unique_uniform<< std::endl;
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current_uniform<<" with "<<*first_unique_uniform<< std::endl;
osg::StateSet* stateset = *sitr;
stateset->addUniform(*first_unique_uniform);
}
@@ -644,7 +644,7 @@ void Optimizer::StateVisitor::optimize()
// other.
std::sort(statesetSortList.begin(),statesetSortList.end(),LessDerefFunctor<osg::StateSet>());
NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
OSG_NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
// find the duplicates.
StateSetSortList::iterator first_unique = statesetSortList.begin();
StateSetSortList::iterator current = first_unique; ++current;
@@ -652,13 +652,13 @@ void Optimizer::StateVisitor::optimize()
{
if (**current==**first_unique)
{
NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
OSG_NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
ObjectSet& objSet = _statesets[*current];
for(ObjectSet::iterator sitr=objSet.begin();
sitr!=objSet.end();
++sitr)
{
NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
osg::Object* obj = *sitr;
osg::Drawable* drawable = dynamic_cast<osg::Drawable*>(obj);
if (drawable)
@@ -1104,9 +1104,9 @@ bool CollectLowestTransformsVisitor::removeTransforms(osg::Node* nodeWeCannotRem
}
else
{
NOTIFY(osg::WARN)<<"Warning:: during Optimize::CollectLowestTransformsVisitor::removeTransforms(Node*)"<<std::endl;
NOTIFY(osg::WARN)<<" unhandled of setting of indentity matrix on "<< titr->first->className()<<std::endl;
NOTIFY(osg::WARN)<<" model will appear in the incorrect position."<<std::endl;
OSG_NOTIFY(osg::WARN)<<"Warning:: during Optimize::CollectLowestTransformsVisitor::removeTransforms(Node*)"<<std::endl;
OSG_NOTIFY(osg::WARN)<<" unhandled of setting of indentity matrix on "<< titr->first->className()<<std::endl;
OSG_NOTIFY(osg::WARN)<<" model will appear in the incorrect position."<<std::endl;
}
}
@@ -1443,7 +1443,7 @@ void Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes()
}
else
{
NOTIFY(osg::WARN)<<"Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
OSG_NOTIFY(osg::WARN)<<"Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
}
}
_redundantNodeList.clear();
@@ -1524,7 +1524,7 @@ void Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes()
}
else
{
NOTIFY(osg::WARN)<<"Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
OSG_NOTIFY(osg::WARN)<<"Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
}
}
_redundantNodeList.clear();
@@ -1825,7 +1825,7 @@ bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode)
if (geode.getNumDrawables()>=2)
{
// NOTIFY(osg::NOTICE)<<"Before "<<geode.getNumDrawables()<<std::endl;
// OSG_NOTIFY(osg::NOTICE)<<"Before "<<geode.getNumDrawables()<<std::endl;
typedef std::vector<osg::Geometry*> DuplicateList;
typedef std::map<osg::Geometry*,DuplicateList,LessGeometry> GeometryDuplicateMap;
@@ -1994,14 +1994,14 @@ bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode)
geode.removeDrawable(rhs);
static int co = 0;
NOTIFY(osg::INFO)<<"merged and removed Geometry "<<++co<<std::endl;
OSG_NOTIFY(osg::INFO)<<"merged and removed Geometry "<<++co<<std::endl;
}
}
}
}
#endif
// NOTIFY(osg::NOTICE)<<"After "<<geode.getNumDrawables()<<std::endl;
// OSG_NOTIFY(osg::NOTICE)<<"After "<<geode.getNumDrawables()<<std::endl;
}
@@ -2281,7 +2281,7 @@ class MergeArrayVisitor : public osg::ArrayVisitor
}
}
virtual void apply(osg::Array&) { NOTIFY(osg::WARN) << "Warning: Optimizer's MergeArrayVisitor cannot merge Array type." << std::endl; }
virtual void apply(osg::Array&) { OSG_NOTIFY(osg::WARN) << "Warning: Optimizer's MergeArrayVisitor cannot merge Array type." << std::endl; }
virtual void apply(osg::ByteArray& rhs) { if (_offset) _mergeAndOffset(rhs); else _merge(rhs); }
virtual void apply(osg::ShortArray& rhs) { if (_offset) _mergeAndOffset(rhs); else _merge(rhs); }
@@ -2642,11 +2642,11 @@ 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;
NOTIFY(osg::INFO)<<"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;
if (!xAxis && !yAxis && !zAxis)
{
NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
OSG_NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
return false;
}
@@ -2810,18 +2810,18 @@ bool Optimizer::SpatializeGroupsVisitor::divide(osg::Geode* geode, unsigned int
bool yAxis = (bb.yMax()-bb.yMin())>divide_distance;
bool zAxis = (bb.zMax()-bb.zMin())>divide_distance;
NOTIFY(osg::INFO)<<"INFO "<<geode->className()<<" num drawables = "<<geode->getNumDrawables()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
OSG_NOTIFY(osg::INFO)<<"INFO "<<geode->className()<<" num drawables = "<<geode->getNumDrawables()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
if (!xAxis && !yAxis && !zAxis)
{
NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
OSG_NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
return false;
}
osg::Node::ParentList parents = geode->getParents();
if (parents.empty())
{
NOTIFY(osg::INFO)<<" Cannot perform spatialize on root Geode, add a Group above it to allow subdivision."<<std::endl;
OSG_NOTIFY(osg::INFO)<<" Cannot perform spatialize on root Geode, add a Group above it to allow subdivision."<<std::endl;
return false;
}
@@ -2866,12 +2866,12 @@ void Optimizer::CopySharedSubgraphsVisitor::apply(osg::Node& node)
void Optimizer::CopySharedSubgraphsVisitor::copySharedNodes()
{
NOTIFY(osg::INFO)<<"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)
{
NOTIFY(osg::INFO)<<" 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)
{
@@ -3038,7 +3038,7 @@ bool Optimizer::MergeGeodesVisitor::mergeGeodes(osg::Group& group)
// if no geodes then just return.
if (geodeDuplicateMap.empty()) return false;
NOTIFY(osg::INFO)<<"mergeGeodes in group '"<<group.getName()<<"' "<<geodeDuplicateMap.size()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"mergeGeodes in group '"<<group.getName()<<"' "<<geodeDuplicateMap.size()<<std::endl;
// merge
for(GeodeDuplicateMap::iterator itr=geodeDuplicateMap.begin();
@@ -3245,7 +3245,7 @@ void Optimizer::TextureAtlasBuilder::buildAtlas()
aitr != _atlasList.end() && !addedSourceToAtlas;
++aitr)
{
NOTIFY(osg::INFO)<<"checking source "<<source->_image->getFileName()<<" to see it it'll fit in atlas "<<aitr->get()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"checking source "<<source->_image->getFileName()<<" to see it it'll fit in atlas "<<aitr->get()<<std::endl;
if ((*aitr)->doesSourceFit(source))
{
addedSourceToAtlas = true;
@@ -3253,13 +3253,13 @@ void Optimizer::TextureAtlasBuilder::buildAtlas()
}
else
{
NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<aitr->get()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<aitr->get()<<std::endl;
}
}
if (!addedSourceToAtlas)
{
NOTIFY(osg::INFO)<<"creating new Atlas for "<<source->_image->getFileName()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"creating new Atlas for "<<source->_image->getFileName()<<std::endl;
osg::ref_ptr<Atlas> atlas = new Atlas(_maximumAtlasWidth,_maximumAtlasHeight,_margin);
_atlasList.push_back(atlas.get());
@@ -3578,7 +3578,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::doesSourceFit(Source* source)
if ((_x + sourceImage->s() + 2*_margin) <= _maximumAtlasWidth)
{
// yes it fits :-)
NOTIFY(osg::INFO)<<"Fits in current row"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Fits in current row"<<std::endl;
return true;
}
@@ -3586,7 +3586,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::doesSourceFit(Source* source)
if ((_height + sourceImage->t() + 2*_margin) <= _maximumAtlasHeight)
{
// yes it fits :-)
NOTIFY(osg::INFO)<<"Fits in next row"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Fits in next row"<<std::endl;
return true;
}
@@ -3599,7 +3599,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
// double check source is compatible
if (!doesSourceFit(source))
{
NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
return false;
}
@@ -3643,7 +3643,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
// yes it fits, so add the source to the atlas's list of sources it contains
_sourceList.push_back(source);
NOTIFY(osg::INFO)<<"current row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
OSG_NOTIFY(osg::INFO)<<"current row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
// set up the source so it knows where it is in the atlas
source->_x = _x + _margin;
@@ -3671,7 +3671,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
// yes it fits, so add the source to the atlas' list of sources it contains
_sourceList.push_back(source);
NOTIFY(osg::INFO)<<"next row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
OSG_NOTIFY(osg::INFO)<<"next row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
// set up the source so it knows where it is in the atlas
source->_x = _x + _margin;
@@ -3685,12 +3685,12 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
_height = _y + sourceImage->t() + 2*_margin;
NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
return true;
}
NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
// shouldn't get here, unless doesSourceFit isn't working...
return false;
@@ -3704,7 +3704,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::clampToNearestPowerOfTwoSize()
unsigned int h = 1;
while (h<_height) h *= 2;
NOTIFY(osg::INFO)<<"Clamping "<<_width<<", "<<_height<<" to "<<w<<","<<h<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Clamping "<<_width<<", "<<_height<<" to "<<w<<","<<h<<std::endl;
_width = w;
_height = h;
@@ -3713,7 +3713,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::clampToNearestPowerOfTwoSize()
void Optimizer::TextureAtlasBuilder::Atlas::copySources()
{
NOTIFY(osg::INFO)<<"Allocated to "<<_width<<","<<_height<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Allocated to "<<_width<<","<<_height<<std::endl;
_image->allocateImage(_width,_height,1,
_image->getPixelFormat(),_image->getDataType(),
_image->getPacking());
@@ -3725,7 +3725,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::copySources()
for(unsigned int i=0; i<size; ++i) *(str++) = 0;
}
NOTIFY(osg::INFO)<<"Atlas::copySources() "<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Atlas::copySources() "<<std::endl;
for(SourceList::iterator itr = _sourceList.begin();
itr !=_sourceList.end();
++itr)
@@ -3735,8 +3735,8 @@ void Optimizer::TextureAtlasBuilder::Atlas::copySources()
if (atlas)
{
NOTIFY(osg::INFO)<<"Copying image "<<source->_image->getFileName()<<" to "<<source->_x<<" ,"<<source->_y<<std::endl;
NOTIFY(osg::INFO)<<" image size "<<source->_image->s()<<","<<source->_image->t()<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Copying image "<<source->_image->getFileName()<<" to "<<source->_x<<" ,"<<source->_y<<std::endl;
OSG_NOTIFY(osg::INFO)<<" image size "<<source->_image->s()<<","<<source->_image->t()<<std::endl;
const osg::Image* sourceImage = source->_image.get();
osg::Image* atlasImage = atlas->_image.get();
@@ -4097,7 +4097,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
if (texturesThatRepeatAndAreOutOfRange.count(texture)==0)
{
// safe to convert into CLAMP wrap mode.
NOTIFY(osg::INFO)<<"Changing wrap mode to CLAMP"<<std::endl;
OSG_NOTIFY(osg::INFO)<<"Changing wrap mode to CLAMP"<<std::endl;
texture->setWrap(osg::Texture2D::WRAP_S, osg::Texture::CLAMP);
texture->setWrap(osg::Texture2D::WRAP_T, osg::Texture::CLAMP);
}
@@ -4206,7 +4206,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
{
if (s_repeat || t_repeat)
{
NOTIFY(osg::NOTICE)<<"Warning!!! shouldn't get here"<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<"Warning!!! shouldn't get here"<<std::endl;
}
stateset->setTextureAttribute(unit, newTexture);
@@ -4237,7 +4237,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
if (canTexMatBeFlattenedToAllDrawables)
{
// NOTIFY(osg::NOTICE)<<"All drawables can be flattened "<<drawables.size()<<std::endl;
// OSG_NOTIFY(osg::NOTICE)<<"All drawables can be flattened "<<drawables.size()<<std::endl;
for(Drawables::iterator ditr = drawables.begin();
ditr != drawables.end();
++ditr)
@@ -4257,13 +4257,13 @@ void Optimizer::TextureAtlasVisitor::optimize()
}
else
{
NOTIFY(osg::NOTICE)<<"Error, Optimizer::TextureAtlasVisitor::optimize() shouldn't ever get here..."<<std::endl;
OSG_NOTIFY(osg::NOTICE)<<"Error, Optimizer::TextureAtlasVisitor::optimize() shouldn't ever get here..."<<std::endl;
}
}
}
else
{
// NOTIFY(osg::NOTICE)<<"Applying TexMat "<<drawables.size()<<std::endl;
// OSG_NOTIFY(osg::NOTICE)<<"Applying TexMat "<<drawables.size()<<std::endl;
stateset->setTextureAttribute(unit, new osg::TexMat(matrix));
}
}
@@ -4343,7 +4343,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
}
else
{
NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
OSG_NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
}
}
else
@@ -4384,7 +4384,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
}
else
{
NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
OSG_NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
}
}
else
@@ -4422,7 +4422,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
traverse(*(new_lod.get()));
}
else
NOTIFY(osg::NOTICE) << "No parent for this LOD" << std::endl;
OSG_NOTIFY(osg::NOTICE) << "No parent for this LOD" << std::endl;
}
else
{
@@ -4460,7 +4460,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
if(parent_group)
parent_group->replaceChild(&geode, new_geode.get());
else
NOTIFY(osg::NOTICE) << "No parent for this Geode" << std::endl;
OSG_NOTIFY(osg::NOTICE) << "No parent for this Geode" << std::endl;
transformGeode(*(new_geode.get()));
}
@@ -4494,7 +4494,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
if(parent_group)
parent_group->replaceChild(&billboard, new_billboard.get());
else
NOTIFY(osg::NOTICE) << "No parent for this Billboard" << std::endl;
OSG_NOTIFY(osg::NOTICE) << "No parent for this Billboard" << std::endl;
transformBillboard(*(new_billboard.get()));
}