Conversion of osg::notify to OSG_INFO etc.

This commit is contained in:
Robert Osfield
2010-05-28 15:51:00 +00:00
parent a79a8d30f9
commit 3b3e0d7cdd
22 changed files with 385 additions and 379 deletions

View File

@@ -169,17 +169,17 @@ void CullVisitor::computeNearPlane()
++itr)
{
++numTests;
// OSG_NOTIFY(osg::WARN)<<"testing computeNearestPointInFrustum with d_near = "<<itr->first<<std::endl;
// OSG_WARN<<"testing computeNearestPointInFrustum with d_near = "<<itr->first<<std::endl;
value_type d_near = computeNearestPointInFrustum(itr->second._matrix, itr->second._planes,*(itr->second._drawable));
if (d_near<_computed_znear)
{
_computed_znear = d_near;
// OSG_NOTIFY(osg::WARN)<<"updating znear to "<<_computed_znear<<std::endl;
// OSG_WARN<<"updating znear to "<<_computed_znear<<std::endl;
}
}
// osg::Timer_t end_t = osg::Timer::instance()->tick();
// OSG_NOTIFY(osg::NOTICE)<<"Took "<<osg::Timer::instance()->delta_m(start_t,end_t)<<"ms to test "<<numTests<<" out of "<<_nearPlaneCandidateMap.size()<<std::endl;
// OSG_NOTICE<<"Took "<<osg::Timer::instance()->delta_m(start_t,end_t)<<"ms to test "<<numTests<<" out of "<<_nearPlaneCandidateMap.size()<<std::endl;
_nearPlaneCandidateMap.clear();
}
@@ -192,7 +192,7 @@ void CullVisitor::popProjectionMatrix()
if (_computeNearFar && _computed_zfar>=_computed_znear)
{
//OSG_NOTIFY(osg::INFO)<<"clamping "<< "znear="<<_computed_znear << " zfar="<<_computed_zfar<<std::endl;
//OSG_INFO<<"clamping "<< "znear="<<_computed_znear << " zfar="<<_computed_zfar<<std::endl;
// adjust the projection matrix so that it encompases the local coords.
@@ -206,7 +206,7 @@ void CullVisitor::popProjectionMatrix()
}
else
{
//OSG_NOTIFY(osg::INFO)<<"Not clamping "<< "znear="<<_computed_znear << " zfar="<<_computed_zfar<<std::endl;
//OSG_INFO<<"Not clamping "<< "znear="<<_computed_znear << " zfar="<<_computed_zfar<<std::endl;
}
CullStack::popProjectionMatrix();
@@ -218,7 +218,7 @@ bool _clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar
double epsilon = 1e-6;
if (zfar<znear-epsilon)
{
OSG_NOTIFY(osg::INFO)<<"_clampProjectionMatrix not applied, invalid depth range, znear = "<<znear<<" zfar = "<<zfar<<std::endl;
OSG_INFO<<"_clampProjectionMatrix not applied, invalid depth range, znear = "<<znear<<" zfar = "<<zfar<<std::endl;
return false;
}
@@ -229,12 +229,12 @@ bool _clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar
double average = (znear+zfar)*0.5;
znear = average-epsilon;
zfar = average+epsilon;
// OSG_NOTIFY(osg::INFO) << "_clampProjectionMatrix widening znear and zfar to "<<znear<<" "<<zfar<<std::endl;
// OSG_INFO << "_clampProjectionMatrix widening znear and zfar to "<<znear<<" "<<zfar<<std::endl;
}
if (fabs(projection(0,3))<epsilon && fabs(projection(1,3))<epsilon && fabs(projection(2,3))<epsilon )
{
// OSG_NOTIFY(osg::INFO) << "Orthographic matrix before clamping"<<projection<<std::endl;
// OSG_INFO << "Orthographic matrix before clamping"<<projection<<std::endl;
value_type delta_span = (zfar-znear)*0.02;
if (delta_span<1.0) delta_span = 1.0;
@@ -248,12 +248,12 @@ bool _clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar
projection(2,2)=-2.0f/(desired_zfar-desired_znear);
projection(3,2)=-(desired_zfar+desired_znear)/(desired_zfar-desired_znear);
// OSG_NOTIFY(osg::INFO) << "Orthographic matrix after clamping "<<projection<<std::endl;
// OSG_INFO << "Orthographic matrix after clamping "<<projection<<std::endl;
}
else
{
// OSG_NOTIFY(osg::INFO) << "Persepective matrix before clamping"<<projection<<std::endl;
// OSG_INFO << "Persepective matrix before clamping"<<projection<<std::endl;
//std::cout << "_computed_znear"<<_computed_znear<<std::endl;
//std::cout << "_computed_zfar"<<_computed_zfar<<std::endl;
@@ -285,7 +285,7 @@ bool _clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar
0.0f,0.0f,ratio,0.0f,
0.0f,0.0f,center*ratio,1.0f));
// OSG_NOTIFY(osg::INFO) << "Persepective matrix after clamping"<<projection<<std::endl;
// OSG_INFO << "Persepective matrix after clamping"<<projection<<std::endl;
}
return true;
}
@@ -336,7 +336,7 @@ struct ComputeNearestPointFunctor
n2 >= _znear &&
n3 >= _znear)
{
//OSG_NOTIFY(osg::NOTICE)<<"Triangle totally beyond znear"<<std::endl;
//OSG_NOTICE<<"Triangle totally beyond znear"<<std::endl;
return;
}
@@ -345,7 +345,7 @@ struct ComputeNearestPointFunctor
n2 < 0.0 &&
n3 < 0.0)
{
// OSG_NOTIFY(osg::NOTICE)<<"Triangle totally behind eye point"<<std::endl;
// OSG_NOTICE<<"Triangle totally behind eye point"<<std::endl;
return;
}
@@ -366,7 +366,7 @@ struct ComputeNearestPointFunctor
unsigned int numOutside = ((d1<0.0)?1:0) + ((d2<0.0)?1:0) + ((d3<0.0)?1:0);
if (numOutside==3)
{
//OSG_NOTIFY(osg::NOTICE)<<"Triangle totally outside frustum "<<d1<<"\t"<<d2<<"\t"<<d3<<std::endl;
//OSG_NOTICE<<"Triangle totally outside frustum "<<d1<<"\t"<<d2<<"\t"<<d3<<std::endl;
return;
}
unsigned int numInside = ((d1>=0.0)?1:0) + ((d2>=0.0)?1:0) + ((d3>=0.0)?1:0);
@@ -375,7 +375,7 @@ struct ComputeNearestPointFunctor
active_mask = active_mask | selector_mask;
}
//OSG_NOTIFY(osg::NOTICE)<<"Triangle ok w.r.t plane "<<d1<<"\t"<<d2<<"\t"<<d3<<std::endl;
//OSG_NOTICE<<"Triangle ok w.r.t plane "<<d1<<"\t"<<d2<<"\t"<<d3<<std::endl;
selector_mask <<= 1;
}
@@ -385,7 +385,7 @@ struct ComputeNearestPointFunctor
_znear = osg::minimum(_znear,n1);
_znear = osg::minimum(_znear,n2);
_znear = osg::minimum(_znear,n3);
// OSG_NOTIFY(osg::NOTICE)<<"Triangle all inside frustum "<<n1<<"\t"<<n2<<"\t"<<n3<<" number of plane="<<_planes->size()<<std::endl;
// OSG_NOTICE<<"Triangle all inside frustum "<<n1<<"\t"<<n2<<"\t"<<n3<<" number of plane="<<_planes->size()<<std::endl;
return;
}
@@ -394,7 +394,7 @@ struct ComputeNearestPointFunctor
// numPartiallyInside>0) so we have a triangle cutting an frustum wall,
// this means that use brute force methods for deviding up triangle.
//OSG_NOTIFY(osg::NOTICE)<<"Using brute force method of triangle cutting frustum walls"<<std::endl;
//OSG_NOTICE<<"Using brute force method of triangle cutting frustum walls"<<std::endl;
_polygonOriginal.clear();
_polygonOriginal.push_back(DistancePoint(0,v1));
_polygonOriginal.push_back(DistancePoint(0,v2));
@@ -458,7 +458,7 @@ struct ComputeNearestPointFunctor
if (dist < _znear)
{
_znear = dist;
//OSG_NOTIFY(osg::NOTICE)<<"Near plane updated "<<_znear<<std::endl;
//OSG_NOTICE<<"Near plane updated "<<_znear<<std::endl;
}
}
}
@@ -466,7 +466,7 @@ struct ComputeNearestPointFunctor
CullVisitor::value_type CullVisitor::computeNearestPointInFrustum(const osg::Matrix& matrix, const osg::Polytope::PlaneList& planes,const osg::Drawable& drawable)
{
// OSG_NOTIFY(osg::WARN)<<"CullVisitor::computeNearestPointInFrustum("<<getTraversalNumber()<<"\t"<<planes.size()<<std::endl;
// OSG_WARN<<"CullVisitor::computeNearestPointInFrustum("<<getTraversalNumber()<<"\t"<<planes.size()<<std::endl;
osg::TriangleFunctor<ComputeNearestPointFunctor> cnpf;
cnpf.set(_computed_znear, matrix, &planes);
@@ -488,8 +488,8 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::B
std::swap(d_near,d_far);
if ( !EQUAL_F(d_near, d_far) )
{
OSG_NOTIFY(osg::WARN)<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<< std::endl;
OSG_NOTIFY(osg::WARN)<<" correcting by swapping values d_near="<<d_near<<" dfar="<<d_far<< std::endl;
OSG_WARN<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<< std::endl;
OSG_WARN<<" correcting by swapping values d_near="<<d_near<<" dfar="<<d_far<< std::endl;
}
}
@@ -520,7 +520,7 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
static double elapsed_time = 0.0;
if (lastFrameNumber != getTraversalNumber())
{
OSG_NOTIFY(osg::NOTICE)<<"Took "<<elapsed_time<<"ms to test "<<numBillboards<<" billboards"<<std::endl;
OSG_NOTICE<<"Took "<<elapsed_time<<"ms to test "<<numBillboards<<" billboards"<<std::endl;
numBillboards = 0;
elapsed_time = 0.0;
lastFrameNumber = getTraversalNumber();
@@ -539,14 +539,14 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
d_near = distance(bb.corner(bbCornerNear),matrix);
d_far = distance(bb.corner(bbCornerFar),matrix);
OSG_NOTIFY(osg::NOTICE).precision(15);
OSG_NOTICE.precision(15);
if (false)
{
OSG_NOTIFY(osg::NOTICE)<<"TESTING Billboard near/far computation"<<std::endl;
OSG_NOTICE<<"TESTING Billboard near/far computation"<<std::endl;
// OSG_NOTIFY(osg::WARN)<<"Checking corners of billboard "<<std::endl;
// OSG_WARN<<"Checking corners of billboard "<<std::endl;
// deprecated brute force way, use all corners of the bounding box.
value_type nd_near, nd_far;
nd_near = nd_far = distance(bb.corner(0),matrix);
@@ -555,16 +555,16 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
value_type d = distance(bb.corner(i),matrix);
if (d<nd_near) nd_near = d;
if (d>nd_far) nd_far = d;
OSG_NOTIFY(osg::NOTICE)<<"\ti="<<i<<"\td="<<d<<std::endl;
OSG_NOTICE<<"\ti="<<i<<"\td="<<d<<std::endl;
}
if (nd_near==d_near && nd_far==d_far)
{
OSG_NOTIFY(osg::NOTICE)<<"\tBillboard near/far computation correct "<<std::endl;
OSG_NOTICE<<"\tBillboard near/far computation correct "<<std::endl;
}
else
{
OSG_NOTIFY(osg::NOTICE)<<"\tBillboard near/far computation ERROR\n\t\t"<<d_near<<"\t"<<nd_near
OSG_NOTICE<<"\tBillboard near/far computation ERROR\n\t\t"<<d_near<<"\t"<<nd_near
<<"\n\t\t"<<d_far<<"\t"<<nd_far<<std::endl;
}
@@ -590,8 +590,8 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
std::swap(d_near,d_far);
if ( !EQUAL_F(d_near, d_far) )
{
OSG_NOTIFY(osg::WARN)<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<< std::endl;
OSG_NOTIFY(osg::WARN)<<" correcting by swapping values d_near="<<d_near<<" dfar="<<d_far<< std::endl;
OSG_WARN<<"Warning: CullVisitor::updateCalculatedNearFar(.) near>far in range calculation,"<< std::endl;
OSG_WARN<<" correcting by swapping values d_near="<<d_near<<" dfar="<<d_far<< std::endl;
}
}
@@ -610,7 +610,7 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
{
if (isBillboard)
{
// OSG_NOTIFY(osg::WARN)<<"Adding billboard into deffered list"<<std::endl;
// OSG_WARN<<"Adding billboard into deffered list"<<std::endl;
osg::Polytope transformed_frustum;
transformed_frustum.setAndTransformProvidingInverse(getProjectionCullingStack().back().getFrustum(),matrix);
@@ -631,18 +631,18 @@ bool CullVisitor::updateCalculatedNearFar(const osg::Matrix& matrix,const osg::D
if (d_far<_computed_znear)
{
if (d_far>=0.0) _computed_znear = d_far;
else OSG_NOTIFY(osg::WARN)<<" 1) sett near with dnear="<<d_near<<" dfar="<<d_far<< std::endl;
else OSG_WARN<<" 1) sett near with dnear="<<d_near<<" dfar="<<d_far<< std::endl;
}
}
else
{
if (d_near>=0.0) _computed_znear = d_near;
else OSG_NOTIFY(osg::WARN)<<" 2) sett near with d_near="<<d_near<< std::endl;
else OSG_WARN<<" 2) sett near with d_near="<<d_near<< std::endl;
}
}
else
{
//if (d_near<0.0) OSG_NOTIFY(osg::WARN)<<" 3) set near with d_near="<<d_near<< std::endl;
//if (d_near<0.0) OSG_WARN<<" 3) set near with d_near="<<d_near<< std::endl;
_computed_znear = d_near;
}
}
@@ -681,7 +681,7 @@ void CullVisitor::updateCalculatedNearFar(const osg::Vec3& pos)
if (d<_computed_znear)
{
_computed_znear = d;
if (d<0.0) OSG_NOTIFY(osg::WARN)<<"Alerting billboard ="<<d<< std::endl;
if (d<0.0) OSG_WARN<<"Alerting billboard ="<<d<< std::endl;
}
if (d>_computed_zfar) _computed_zfar = d;
}
@@ -772,13 +772,13 @@ void CullVisitor::apply(Geode& node)
if (osg::isNaN(depth))
{
OSG_NOTIFY(osg::NOTICE)<<"CullVisitor::apply(Geode&) detected NaN,"<<std::endl
OSG_NOTICE<<"CullVisitor::apply(Geode&) detected NaN,"<<std::endl
<<" depth="<<depth<<", center=("<<bb.center()<<"),"<<std::endl
<<" matrix="<<matrix<<std::endl;
OSG_NOTIFY(osg::DEBUG_INFO) << " NodePath:" << std::endl;
OSG_DEBUG << " NodePath:" << std::endl;
for (NodePath::const_iterator i = getNodePath().begin(); i != getNodePath().end(); ++i)
{
OSG_NOTIFY(osg::DEBUG_INFO) << " \"" << (*i)->getName() << "\"" << std::endl;
OSG_DEBUG << " \"" << (*i)->getName() << "\"" << std::endl;
}
}
else
@@ -839,7 +839,7 @@ void CullVisitor::apply(Billboard& node)
{
if (d<_computed_znear)
{
if (d<0.0) OSG_NOTIFY(osg::WARN)<<"Alerting billboard handling ="<<d<< std::endl;
if (d<0.0) OSG_WARN<<"Alerting billboard handling ="<<d<< std::endl;
_computed_znear = d;
}
if (d>_computed_zfar) _computed_zfar = d;
@@ -850,13 +850,13 @@ void CullVisitor::apply(Billboard& node)
if (osg::isNaN(depth))
{
OSG_NOTIFY(osg::NOTICE)<<"CullVisitor::apply(Billboard&) detected NaN,"<<std::endl
OSG_NOTICE<<"CullVisitor::apply(Billboard&) detected NaN,"<<std::endl
<<" depth="<<depth<<", pos=("<<pos<<"),"<<std::endl
<<" *billboard_matrix="<<*billboard_matrix<<std::endl;
OSG_NOTIFY(osg::DEBUG_INFO) << " NodePath:" << std::endl;
OSG_DEBUG << " NodePath:" << std::endl;
for (NodePath::const_iterator i = getNodePath().begin(); i != getNodePath().end(); ++i)
{
OSG_NOTIFY(osg::DEBUG_INFO) << " \"" << (*i)->getName() << "\"" << std::endl;
OSG_DEBUG << " \"" << (*i)->getName() << "\"" << std::endl;
}
}
else
@@ -1025,7 +1025,7 @@ void CullVisitor::apply(Projection& node)
ref_ptr<RefMatrix> matrix = createOrReuseMatrix(node.getMatrix());
pushProjectionMatrix(matrix.get());
//OSG_NOTIFY(osg::INFO)<<"Push projection "<<*matrix<<std::endl;
//OSG_INFO<<"Push projection "<<*matrix<<std::endl;
// note do culling check after the frustum has been updated to ensure
// that the node is not culled prematurely.
@@ -1036,7 +1036,7 @@ void CullVisitor::apply(Projection& node)
popProjectionMatrix();
//OSG_NOTIFY(osg::INFO)<<"Pop projection "<<*matrix<<std::endl;
//OSG_INFO<<"Pop projection "<<*matrix<<std::endl;
_computed_znear = previous_znear;
_computed_zfar = previous_zfar;
@@ -1146,7 +1146,7 @@ void CullVisitor::apply(osg::Camera& camera)
#ifdef DEBUG_CULLSETTINGS
if (osg::isNotifyEnabled(osg::NOTICE))
{
notify(osg::NOTICE)<<std::endl<<std::endl<<"CullVisitor, before : ";
OSG_NOTICE<<std::endl<<std::endl<<"CullVisitor, before : ";
write(osg::notify(osg::NOTICE));
}
#endif
@@ -1157,7 +1157,7 @@ void CullVisitor::apply(osg::Camera& camera)
#ifdef DEBUG_CULLSETTINGS
if (osg::isNotifyEnabled(osg::NOTICE))
{
osg::notify(osg::NOTICE)<<"CullVisitor, saved_cull_settings : ";
OSG_NOTICE<<"CullVisitor, saved_cull_settings : ";
saved_cull_settings.write(osg::notify(osg::NOTICE));
}
#endif
@@ -1167,14 +1167,14 @@ void CullVisitor::apply(osg::Camera& camera)
setCullSettings(camera);
#ifdef DEBUG_CULLSETTINGS
osg::notify(osg::NOTICE)<<"CullVisitor, after setCullSettings(camera) : ";
OSG_NOTICE<<"CullVisitor, after setCullSettings(camera) : ";
write(osg::notify(osg::NOTICE));
#endif
// inherit the settings from above
inheritCullSettings(saved_cull_settings, camera.getInheritanceMask());
#ifdef DEBUG_CULLSETTINGS
osg::notify(osg::NOTICE)<<"CullVisitor, after inheritCullSettings(saved_cull_settings,"<<camera.getInheritanceMask()<<") : ";
OSG_NOTICE<<"CullVisitor, after inheritCullSettings(saved_cull_settings,"<<camera.getInheritanceMask()<<") : ";
write(osg::notify(osg::NOTICE));
#endif

View File

@@ -297,7 +297,7 @@ public:
osg::Vec2 vecca=osg::Vec2(cpt.x(), cpt.y())-osg::Vec2(apt.x(), apt.y());
float cprodzba=vp2tp.x()*vecba.y() - vp2tp.y()*vecba.x();
float cprodzca=vp2tp.x()*vecca.y() - vp2tp.y()*vecca.x();
// osg::notify(osg::WARN) << "linebisect test " << " tri " << a_<<","<< b_<<","<< c_<<std::endl;
// OSG_WARN << "linebisect test " << " tri " << a_<<","<< b_<<","<< c_<<std::endl;
if (cprodzba*cprodzca<0)
{
// more tests - check dot products are at least partly parallel to test line.
@@ -381,7 +381,7 @@ bool Sample_point_compare(const osg::Vec3 &p1, const osg::Vec3 &p2)
// errors can occur if the delaunay triangulation specifies 2 points at same XY and different Z
if (p1.x() != p2.x()) return p1.x() < p2.x();
if (p1.y() != p2.y()) return p1.y() < p2.y(); // GWM 30.06.05 - further rule if x coords are same.
osg::notify(osg::INFO) << "Two points are coincident at "<<p1.x() <<","<<p1.y() << std::endl;
OSG_INFO << "Two points are coincident at "<<p1.x() <<","<<p1.y() << std::endl;
return p1.z() < p2.z(); // never get here unless 2 points coincide
}
@@ -454,7 +454,7 @@ Triangle_list fillHole(osg::Vec3Array *points, std::vector<unsigned int> vind
for (std::vector<unsigned int>::iterator itint=vindexlist.begin(); itint!=vindexlist.end(); itint++)
{
// osg::notify(osg::WARN)<< "add point " << (*itint) << " at " << (*points)[*itint].x() << ","<< (*points)[*itint].y() <<std::endl;
// OSG_WARN<< "add point " << (*itint) << " at " << (*points)[*itint].x() << ","<< (*points)[*itint].y() <<std::endl;
constraintverts->push_back((*points)[*itint]);
}
@@ -475,7 +475,7 @@ Triangle_list fillHole(osg::Vec3Array *points, std::vector<unsigned int> vind
{
unsigned int ic;
osg::PrimitiveSet* prset=gtess->getPrimitiveSet(ipr);
// osg::notify(osg::WARN)<< "gtess set " << ipr << " nprims " << prset->getNumPrimitives() <<
// OSG_WARN<< "gtess set " << ipr << " nprims " << prset->getNumPrimitives() <<
// " type " << prset->getMode() << std::endl;
unsigned int pidx,pidx1,pidx2;
switch (prset->getMode()) {
@@ -515,7 +515,7 @@ Triangle_list fillHole(osg::Vec3Array *points, std::vector<unsigned int> vind
pidx2=vindexlist[prset->index(ic+2)];
}
triangles.push_back(Triangle(pidx, pidx1, pidx2, points));
// osg::notify(osg::WARN)<< "vert " << prset->index(ic) << " in array"<<std::endl;
// OSG_WARN<< "vert " << prset->index(ic) << " in array"<<std::endl;
}
break;
case osg::PrimitiveSet::TRIANGLE_STRIP: // 123, 234, 345...
@@ -560,7 +560,7 @@ Triangle_list fillHole(osg::Vec3Array *points, std::vector<unsigned int> vind
{
triangles.push_back(Triangle(pidx1, pidx, pidx2, points));
}
// osg::notify(osg::WARN)<< "vert " << prset->index(ic) << " in array"<<std::endl;
// OSG_WARN<< "vert " << prset->index(ic) << " in array"<<std::endl;
}
break;
@@ -577,7 +577,7 @@ Triangle_list fillHole(osg::Vec3Array *points, std::vector<unsigned int> vind
{
pidx=vindexlist[prset->index(0)];
}
// osg::notify(osg::WARN)<< "tfan has " << prset->getNumIndices() << " indices"<<std::endl;
// OSG_WARN<< "tfan has " << prset->getNumIndices() << " indices"<<std::endl;
for (ic=1; ic<prset->getNumIndices()-1; ic++)
{
if (prset->index(ic)>=npts)
@@ -605,7 +605,7 @@ Triangle_list fillHole(osg::Vec3Array *points, std::vector<unsigned int> vind
}
break;
default:
osg::notify(osg::WARN)<< "WARNING set " << ipr << " nprims " << prset->getNumPrimitives() <<
OSG_WARN<< "WARNING set " << ipr << " nprims " << prset->getNumPrimitives() <<
" type " << prset->getMode() << " Type not triangle, tfan or strip"<< std::endl;
break;
}
@@ -661,7 +661,7 @@ void DelaunayConstraint::removeVerticesInside(const DelaunayConstraint *dco)
removeIndices( *static_cast<osg::DrawElementsUInt *>(prset), idx );
break;
default:
osg::notify(osg::WARN) << "Invalid prset " <<ipr<< " tp " << prset->getType() << " types PrimitiveType,DrawArraysPrimitiveType=1 etc" << std::endl;
OSG_WARN << "Invalid prset " <<ipr<< " tp " << prset->getType() << " types PrimitiveType,DrawArraysPrimitiveType=1 etc" << std::endl;
break;
}
}
@@ -775,7 +775,7 @@ bool DelaunayTriangulator::triangulate()
// check validity of input array
if (!points_.valid())
{
osg::notify(osg::WARN) << "Warning: DelaunayTriangulator::triangulate(): invalid sample point array" << std::endl;
OSG_WARN << "Warning: DelaunayTriangulator::triangulate(): invalid sample point array" << std::endl;
return false;
}
@@ -783,7 +783,7 @@ bool DelaunayTriangulator::triangulate()
if (points->size() < 1)
{
osg::notify(osg::WARN) << "Warning: DelaunayTriangulator::triangulate(): too few sample points" << std::endl;
OSG_WARN << "Warning: DelaunayTriangulator::triangulate(): too few sample points" << std::endl;
return false;
}
@@ -815,16 +815,16 @@ bool DelaunayTriangulator::triangulate()
}
else
{
osg::notify(osg::WARN) << "DelaunayTriangulator: ignore a duplicate point at "<< p1.x()<< " " << p1.y() << std::endl;;
OSG_WARN << "DelaunayTriangulator: ignore a duplicate point at "<< p1.x()<< " " << p1.y() << std::endl;;
}
}
}
// osg::notify(osg::WARN)<< "constraint size "<<vercon->size()<<" " <<nadded<< std::endl;
// OSG_WARN<< "constraint size "<<vercon->size()<<" " <<nadded<< std::endl;
}
// GWM July 2005 end
// pre-sort sample points
osg::notify(osg::INFO) << "DelaunayTriangulator: pre-sorting sample points\n";
OSG_INFO << "DelaunayTriangulator: pre-sorting sample points\n";
std::sort(points->begin(), points->end(), Sample_point_compare);
// 24.12.06 add convex hull of points to force sensible outline.
osg::ref_ptr<osgUtil::DelaunayConstraint> dcconvexhull=getconvexhull(points);
@@ -841,7 +841,7 @@ bool DelaunayTriangulator::triangulate()
float miny = (*points)[0].y();
float maxy = miny;
osg::notify(osg::INFO) << "DelaunayTriangulator: finding minimum and maximum Y values\n";
OSG_INFO << "DelaunayTriangulator: finding minimum and maximum Y values\n";
osg::Vec3Array::const_iterator mmi;
for (mmi=points->begin(); mmi!=points->end(); ++mmi)
{
@@ -870,7 +870,7 @@ bool DelaunayTriangulator::triangulate()
GLuint pidx = 0;
osg::Vec3Array::const_iterator i;
osg::notify(osg::INFO) << "DelaunayTriangulator: triangulating vertex grid (" << (points->size()-3) <<" points)\n";
OSG_INFO << "DelaunayTriangulator: triangulating vertex grid (" << (points->size()-3) <<" points)\n";
for (i=points->begin(); i!=points->end(); ++i, ++pidx)
{
@@ -941,7 +941,7 @@ bool DelaunayTriangulator::triangulate()
// dec 2006 we used to remove supertriangle vertices here, but then we cant strictly use the supertriangle
// vertices to find intersections of constraints with terrain, so moved to later.
osg::notify(osg::INFO) << "DelaunayTriangulator: finalizing and cleaning up structures\n";
OSG_INFO << "DelaunayTriangulator: finalizing and cleaning up structures\n";
// rejoin the two triangle lists
triangles.insert(triangles.begin(), discarded_tris.begin(), discarded_tris.end());
@@ -983,7 +983,7 @@ bool DelaunayTriangulator::triangulate()
//check that the edge ip1-ip2 is not already part of the triangulation.
if (titr->isedge(ip1,ip2)) edgused=true;
if (titr->isedge(ip2,ip1)) edgused=true;
// if (edgused) osg::notify(osg::WARN) << "Edge used in triangle " << it << " " <<
// if (edgused) OSG_WARN << "Edge used in triangle " << it << " " <<
// titr->a()<<","<< titr->b()<<","<< titr->c()<< std::endl;
it++;
}
@@ -1003,7 +1003,7 @@ bool DelaunayTriangulator::triangulate()
for (titr=triangles.begin(); titr!=triangles.end(); )
{
int icut=titr->lineBisects(points_.get(),ip1,p2);
// osg::notify(osg::WARN) << "Testing triangle " << ntr << " "<< ip1 << " ti " <<
// OSG_WARN << "Testing triangle " << ntr << " "<< ip1 << " ti " <<
// titr->a()<< ","<<titr->b() <<"," <<titr->c() << std::endl;
if (icut>0)
{
@@ -1011,7 +1011,7 @@ bool DelaunayTriangulator::triangulate()
std::vector<unsigned int> edgeRight, edgeLeft;
edgeRight.push_back(ip1);
edgeLeft.push_back(ip1);
// osg::notify(osg::WARN) << "hole first " << edgeLeft.back()<< " rt " << edgeRight.back()<< std::endl;
// OSG_WARN << "hole first " << edgeLeft.back()<< " rt " << edgeRight.back()<< std::endl;
trisToDelete.push_back(&(*titr));
// now find the unique triangle that shares the defined edge
unsigned int e1, e2; // indices of ends of test triangle titr
@@ -1030,7 +1030,7 @@ bool DelaunayTriangulator::triangulate()
}
edgeRight.push_back(e2);
edgeLeft.push_back(e1);
// osg::notify(osg::WARN) << icut << "hole edges " << edgeLeft.back()<< " rt " << edgeRight.back()<< std::endl;
// OSG_WARN << icut << "hole edges " << edgeLeft.back()<< " rt " << edgeRight.back()<< std::endl;
const Triangle *tradj=getTriangleWithEdge(e2,e1, &triangles);
if (tradj)
{
@@ -1038,7 +1038,7 @@ bool DelaunayTriangulator::triangulate()
{
trisToDelete.push_back(tradj);
icut=tradj->whichEdge(points_.get(),p1,p2,e1,e2);
// osg::notify(osg::WARN) << ntr << " cur triedge " << icut << " " << ip1 <<
// OSG_WARN << ntr << " cur triedge " << icut << " " << ip1 <<
// " to " << ip2 << " tadj " << tradj->a()<< ","<<tradj->b() <<","
// <<tradj->c() <<std::endl;
if (icut==1) {e1=tradj->b(); e2=tradj->c();} // icut=1 implies vertex a is not involved
@@ -1049,7 +1049,7 @@ bool DelaunayTriangulator::triangulate()
} else if(edgeRight.back()!=e2 && edgeLeft.back()==e1 && e2!=ip2) {
edgeRight.push_back(e2);
} else {
if (!tradj->usesVertex(ip2)) osg::notify(osg::WARN) << "tradj error " << tradj->a()<< " , " << tradj->b()<< " , " << tradj->c()<< std::endl;
if (!tradj->usesVertex(ip2)) OSG_WARN << "tradj error " << tradj->a()<< " , " << tradj->b()<< " , " << tradj->c()<< std::endl;
}
const Triangle *previousTradj = tradj;
tradj=getTriangleWithEdge(e2,e1, &triangles);
@@ -1058,7 +1058,7 @@ bool DelaunayTriangulator::triangulate()
}
}
if (trisToDelete.size()>=900) {
osg::notify(osg::WARN) << " found " << trisToDelete.size() << " adjacent tris " <<std::endl;
OSG_WARN << " found " << trisToDelete.size() << " adjacent tris " <<std::endl;
}
}
@@ -1066,7 +1066,7 @@ bool DelaunayTriangulator::triangulate()
edgeLeft.push_back(ip2);
edgeRight.push_back(ip2);
if (tradj) trisToDelete.push_back(tradj);
// osg::notify(osg::WARN) << icut << "hole last " << edgeLeft.back()<< " rt " << edgeRight.back()<< std::endl;
// OSG_WARN << icut << "hole last " << edgeLeft.back()<< " rt " << edgeRight.back()<< std::endl;
Triangle_list constrainedtris=fillHole(points_.get(),edgeLeft);
triangles.insert(triangles.begin(), constrainedtris.begin(), constrainedtris.end());
constrainedtris=fillHole(points_.get(),edgeRight);
@@ -1138,7 +1138,7 @@ bool DelaunayTriangulator::triangulate()
pt_indices.reserve(triangles.size() * 3);
// build osg primitive
osg::notify(osg::INFO) << "DelaunayTriangulator: building primitive(s)\n";
OSG_INFO << "DelaunayTriangulator: building primitive(s)\n";
Triangle_list::const_iterator ti;
for (ti=triangles.begin(); ti!=triangles.end(); ++ti)
{
@@ -1163,7 +1163,7 @@ bool DelaunayTriangulator::triangulate()
prim_tris_ = new osg::DrawElementsUInt(GL_TRIANGLES, pt_indices.size(), &(pt_indices.front()));
osg::notify(osg::INFO) << "DelaunayTriangulator: process done, " << prim_tris_->getNumPrimitives() << " triangles remain\n";
OSG_INFO << "DelaunayTriangulator: process done, " << prim_tris_->getNumPrimitives() << " triangles remain\n";
return true;
}
@@ -1180,7 +1180,7 @@ void DelaunayTriangulator::removeInternalTriangles(DelaunayConstraint *dc )
if( normals_.valid() )
normitr = normals_->begin();
// osg::notify(osg::WARN) << "DelaunayTriangulator: removeinternals, " << std::endl;
// OSG_WARN << "DelaunayTriangulator: removeinternals, " << std::endl;
for (osg::DrawElementsUInt::iterator triit=prim_tris_->begin(); triit!=prim_tris_->end(); )
{
// triangle joins points_[itr, itr+1, itr+2]
@@ -1188,7 +1188,7 @@ void DelaunayTriangulator::removeInternalTriangles(DelaunayConstraint *dc )
if ( dc->contains(tritest.compute_centroid( points_.get()) ) )
{
// centroid is inside the triangle, so IF inside linear, remove
// osg::notify(osg::WARN) << "DelaunayTriangulator: remove, " << (*triit) << "," << *(triit+1) <<","<<*(triit+2)<< std::endl;
// OSG_WARN << "DelaunayTriangulator: remove, " << (*triit) << "," << *(triit+1) <<","<<*(triit+2)<< std::endl;
dc->addtriangle((*triit), *(triit+1), *(triit+2));
triit=prim_tris_->erase(triit);
triit=prim_tris_->erase(triit);
@@ -1211,7 +1211,7 @@ void DelaunayTriangulator::removeInternalTriangles(DelaunayConstraint *dc )
}
}
osg::notify(osg::INFO) << "end of test dc, deleted " << ndel << std::endl;
OSG_INFO << "end of test dc, deleted " << ndel << std::endl;
}
}
//=== DelaunayConstraint functions

View File

@@ -157,7 +157,7 @@ osg::UIntArray * EdgeCollector::Edgeloop::toIndexArray() const
EdgeCollector::Triangle* EdgeCollector::addTriangle(unsigned int p1, unsigned int p2, unsigned int p3)
{
//osg::notify(osg::NOTICE)<<"addTriangle("<<p1<<","<<p2<<","<<p3<<")"<<std::endl;
//OSG_NOTICE<<"addTriangle("<<p1<<","<<p2<<","<<p3<<")"<<std::endl;
// detect if triangle is degenerate.
if (p1==p2 || p2==p3 || p1==p3) return 0;
@@ -180,7 +180,7 @@ EdgeCollector::Triangle* EdgeCollector::addTriangle(unsigned int p1, unsigned in
EdgeCollector::Triangle* EdgeCollector::addTriangle(Point* p1, Point* p2, Point* p3)
{
// osg::notify(osg::NOTICE)<<" addTriangle("<<p1<<","<<p2<<","<<p3<<")"<<std::endl;
// OSG_NOTICE<<" addTriangle("<<p1<<","<<p2<<","<<p3<<")"<<std::endl;
// detect if triangle is degenerate.
if (p1==p2 || p2==p3 || p1==p3) return 0;
@@ -204,19 +204,19 @@ EdgeCollector::Triangle* EdgeCollector::addTriangle(Point* p1, Point* p2, Point*
EdgeCollector::Edge* EdgeCollector::addEdge(Triangle* triangle, Point* p1, Point* p2)
{
// osg::notify(osg::NOTICE)<<" addEdge("<<p1<<","<<p2<<")"<<std::endl;
// OSG_NOTICE<<" addEdge("<<p1<<","<<p2<<")"<<std::endl;
osg::ref_ptr<Edge> edge = new Edge;
edge->setOrderedPoints(p1,p2);
EdgeSet::iterator itr = _edgeSet.find(edge);
if (itr==_edgeSet.end())
{
// osg::notify(osg::NOTICE)<<" addEdge("<<edge.get()<<") edge->_p1="<<edge->_p1.get()<<" _p2="<<edge->_p2.get()<<std::endl;
// OSG_NOTICE<<" addEdge("<<edge.get()<<") edge->_p1="<<edge->_p1.get()<<" _p2="<<edge->_p2.get()<<std::endl;
_edgeSet.insert(edge);
}
else
{
// osg::notify(osg::NOTICE)<<" reuseEdge("<<edge.get()<<") edge->_p1="<<edge->_p1.get()<<" _p2="<<edge->_p2.get()<<std::endl;
// OSG_NOTICE<<" reuseEdge("<<edge.get()<<") edge->_p1="<<edge->_p1.get()<<" _p2="<<edge->_p2.get()<<std::endl;
edge = *itr;
}
@@ -234,13 +234,13 @@ EdgeCollector::Point* EdgeCollector::addPoint(Triangle* triangle, Point* point)
PointSet::iterator itr = _pointSet.find(point);
if (itr==_pointSet.end())
{
//osg::notify(osg::NOTICE)<<" addPoint("<<point.get()<<")"<<std::endl;
//OSG_NOTICE<<" addPoint("<<point.get()<<")"<<std::endl;
_pointSet.insert(point);
}
else
{
point = const_cast<Point*>(itr->get());
//osg::notify(osg::NOTICE)<<" reusePoint("<<point.get()<<")"<<std::endl;
//OSG_NOTICE<<" reusePoint("<<point.get()<<")"<<std::endl;
}
point->_triangles.insert(triangle);
@@ -288,7 +288,7 @@ bool EdgeCollector::extractBoundaryEdgeloop(EdgeList & el, Edgeloop & edgeloop)
if (!found)
{
osg::notify(osg::WARN) << "extractBoundaryEdgeloop : unable to close edge loop" << std::endl;
OSG_WARN << "extractBoundaryEdgeloop : unable to close edge loop" << std::endl;
return false;
}
else
@@ -452,7 +452,7 @@ void EdgeCollector::setGeometry(osg::Geometry* geometry)
if (_geometry->suitableForOptimization())
{
// removing coord indices
osg::notify(osg::INFO)<<"EdgeCollector::setGeometry(..): Removing attribute indices"<<std::endl;
OSG_INFO<<"EdgeCollector::setGeometry(..): Removing attribute indices"<<std::endl;
_geometry->copyToAndOptimize(*_geometry);
}
@@ -482,7 +482,7 @@ void EdgeCollector::getEdgeloopIndexList(IndexArrayList & ial)
EdgeloopList edgeloopList;
if (extractBoundaryEdgeloopList(edgeList, edgeloopList) == false)
{
osg::notify(osg::WARN) << "EdgeCollector: fail to collect Edgeloop.\n\n\n" << std::endl;
OSG_WARN << "EdgeCollector: fail to collect Edgeloop.\n\n\n" << std::endl;
return;
}

View File

@@ -182,7 +182,7 @@ void GLObjectsOperation::operator () (osg::GraphicsContext* context)
glObjectsVisitor.setState(context->getState());
// osg::notify(osg::NOTICE)<<"GLObjectsOperation::before <<<<<<<<<<<"<<std::endl;
// OSG_NOTICE<<"GLObjectsOperation::before <<<<<<<<<<<"<<std::endl;
if (_subgraph.valid())
{
_subgraph->accept(glObjectsVisitor);
@@ -196,7 +196,7 @@ void GLObjectsOperation::operator () (osg::GraphicsContext* context)
(*itr)->accept(glObjectsVisitor);
}
}
// osg::notify(osg::NOTICE)<<"GLObjectsOperation::after >>>>>>>>>>> "<<std::endl;
// OSG_NOTICE<<"GLObjectsOperation::after >>>>>>>>>>> "<<std::endl;
}

View File

@@ -93,13 +93,13 @@ void IncrementalCompileOperation::removeGraphicsContext(osg::GraphicsContext* gc
void IncrementalCompileOperation::add(osg::Node* subgraphToCompile)
{
osg::notify(osg::INFO)<<"IncrementalCompileOperation::add("<<subgraphToCompile<<")"<<std::endl;
OSG_INFO<<"IncrementalCompileOperation::add("<<subgraphToCompile<<")"<<std::endl;
add(new CompileSet(subgraphToCompile));
}
void IncrementalCompileOperation::add(osg::Group* attachmentPoint, osg::Node* subgraphToCompile)
{
osg::notify(osg::INFO)<<"IncrementalCompileOperation::add("<<attachmentPoint<<", "<<subgraphToCompile<<")"<<std::endl;
OSG_INFO<<"IncrementalCompileOperation::add("<<attachmentPoint<<", "<<subgraphToCompile<<")"<<std::endl;
add(new CompileSet(attachmentPoint, subgraphToCompile));
}
@@ -117,7 +117,7 @@ void IncrementalCompileOperation::add(CompileSet* compileSet, bool callBuildComp
if (callBuildCompileMap) compileSet->buildCompileMap(_contexts);
osg::notify(osg::INFO)<<"IncrementalCompileOperation::add(CompileSet = "<<compileSet<<", "<<", "<<callBuildCompileMap<<")"<<std::endl;
OSG_INFO<<"IncrementalCompileOperation::add(CompileSet = "<<compileSet<<", "<<", "<<callBuildCompileMap<<")"<<std::endl;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_toCompileMutex);
_toCompile.push_back(compileSet);
@@ -125,7 +125,7 @@ void IncrementalCompileOperation::add(CompileSet* compileSet, bool callBuildComp
void IncrementalCompileOperation::mergeCompiledSubgraphs()
{
// osg::notify(osg::INFO)<<"IncrementalCompileOperation::mergeCompiledSubgraphs()"<<std::endl;
// OSG_INFO<<"IncrementalCompileOperation::mergeCompiledSubgraphs()"<<std::endl;
OpenThreads::ScopedLock<OpenThreads::Mutex> compilded_lock(_compiledMutex);
@@ -286,7 +286,7 @@ void IncrementalCompileOperation::CompileSet::buildCompileMap(ContextSet& contex
void IncrementalCompileOperation::operator () (osg::GraphicsContext* context)
{
// osg::notify(osg::NOTICE)<<"IncrementalCompileOperation::operator () ("<<context<<")"<<std::endl;
// OSG_NOTICE<<"IncrementalCompileOperation::operator () ("<<context<<")"<<std::endl;
osg::NotifySeverity level = osg::INFO;
@@ -300,8 +300,8 @@ void IncrementalCompileOperation::operator () (osg::GraphicsContext* context)
double currentElapsedFrameTime = context->getTimeSinceLastClear();
osg::notify(level)<<"currentTime = "<<currentTime<<std::endl;
osg::notify(level)<<"currentElapsedFrameTime = "<<currentElapsedFrameTime<<std::endl;
OSG_NOTIFY(level)<<"currentTime = "<<currentTime<<std::endl;
OSG_NOTIFY(level)<<"currentElapsedFrameTime = "<<currentElapsedFrameTime<<std::endl;
double _flushTimeRatio(0.5);
double _conservativeTimeRatio(0.5);
@@ -313,9 +313,9 @@ void IncrementalCompileOperation::operator () (osg::GraphicsContext* context)
double compileTime = availableTime - flushTime;
#if 1
osg::notify(level)<<"total availableTime = "<<availableTime*1000.0<<std::endl;
osg::notify(level)<<" flushTime = "<<flushTime*1000.0<<std::endl;
osg::notify(level)<<" compileTime = "<<compileTime*1000.0<<std::endl;
OSG_NOTIFY(level)<<"total availableTime = "<<availableTime*1000.0<<std::endl;
OSG_NOTIFY(level)<<" flushTime = "<<flushTime*1000.0<<std::endl;
OSG_NOTIFY(level)<<" compileTime = "<<compileTime*1000.0<<std::endl;
#endif
osg::flushDeletedGLObjects(context->getState()->getContextID(), currentTime, flushTime);
@@ -324,7 +324,7 @@ void IncrementalCompileOperation::operator () (osg::GraphicsContext* context)
if (flushTime>0.0) compileTime += flushTime;
#if 1
osg::notify(level)<<" revised compileTime = "<<compileTime*1000.0<<std::endl;
OSG_NOTIFY(level)<<" revised compileTime = "<<compileTime*1000.0<<std::endl;
#endif
@@ -350,9 +350,9 @@ void IncrementalCompileOperation::operator () (osg::GraphicsContext* context)
if (!cd.empty())
{
osg::notify(level)<<"cd._drawables.size()="<<cd._drawables.size()<<std::endl;
osg::notify(level)<<"cd._textures.size()="<<cd._textures.size()<<std::endl;
osg::notify(level)<<"cd._programs.size()="<<cd._programs.size()<<std::endl;
OSG_NOTIFY(level)<<"cd._drawables.size()="<<cd._drawables.size()<<std::endl;
OSG_NOTIFY(level)<<"cd._textures.size()="<<cd._textures.size()<<std::endl;
OSG_NOTIFY(level)<<"cd._programs.size()="<<cd._programs.size()<<std::endl;
while(!cd._drawables.empty() &&
@@ -398,7 +398,7 @@ void IncrementalCompileOperation::operator () (osg::GraphicsContext* context)
CompileSets::iterator cs_itr = std::find(_toCompile.begin(), _toCompile.end(), *itr);
if (cs_itr != _toCompile.end())
{
osg::notify(level)<<"Erasing from list"<<std::endl;
OSG_NOTIFY(level)<<"Erasing from list"<<std::endl;
// remove from the _toCompile list, note cs won't be deleted here as the tempoary
// toCompile_Copy list will retain a reference.

View File

@@ -213,7 +213,7 @@ float IntersectVisitor::getDistanceToEyePoint(const Vec3& pos, bool /*withLODSca
{
if (_lodSelectionMode==USE_SEGMENT_START_POINT_AS_EYE_POINT_FOR_LOD_LEVEL_SELECTION)
{
// osg::notify(osg::NOTICE)<<"IntersectVisitor::getDistanceToEyePoint)"<<(pos-getEyePoint()).length()<<std::endl;
// OSG_NOTICE<<"IntersectVisitor::getDistanceToEyePoint)"<<(pos-getEyePoint()).length()<<std::endl;
// LODScale is not available to IntersectVisitor, so we ignore the withLODScale argument
//if (withLODScale) return (pos-getEyePoint()).length()*getLODScale();
//else return (pos-getEyePoint()).length();
@@ -247,7 +247,7 @@ osg::Vec3 IntersectVisitor::getEyePoint() const
if (cis->_view_inverse.valid()) eyePoint = eyePoint * (*(cis->_view_inverse));
if (cis->_model_inverse.valid()) eyePoint = eyePoint * (*(cis->_model_inverse));
//osg::notify(osg::NOTICE)<<"IntersectVisitor::getEyePoint()"<<eyePoint<<std::endl;
//OSG_NOTICE<<"IntersectVisitor::getEyePoint()"<<eyePoint<<std::endl;
return eyePoint;
}
@@ -263,8 +263,8 @@ void IntersectVisitor::addLineSegment(LineSegment* seg)
if (!seg->valid())
{
notify(WARN)<<"Warning: invalid line segment passed to IntersectVisitor::addLineSegment(..)"<<std::endl;
notify(WARN)<<" "<<seg->start()<<" "<<seg->end()<<" segment ignored.."<< std::endl;
OSG_WARN<<"Warning: invalid line segment passed to IntersectVisitor::addLineSegment(..)"<<std::endl;
OSG_WARN<<" "<<seg->start()<<" "<<seg->end()<<" segment ignored.."<< std::endl;
return;
}
@@ -272,8 +272,8 @@ void IntersectVisitor::addLineSegment(LineSegment* seg)
if (cis->_segList.size()>=32)
{
notify(WARN)<<"Warning: excessive number of line segmenets passed to IntersectVisitor::addLineSegment(..), maximum permitted is 32 line segments."<<std::endl;
notify(WARN)<<" "<<seg->start()<<" "<<seg->end()<<" segment ignored.."<< std::endl;
OSG_WARN<<"Warning: excessive number of line segmenets passed to IntersectVisitor::addLineSegment(..), maximum permitted is 32 line segments."<<std::endl;
OSG_WARN<<" "<<seg->start()<<" "<<seg->end()<<" segment ignored.."<< std::endl;
return;
}
@@ -547,9 +547,9 @@ struct TriangleIntersect
Vec3 in = v1*r1+v2*r2+v3*r3;
if (!in.valid())
{
osg::notify(WARN)<<"Warning:: Picked up error in TriangleIntersect"<<std::endl;
osg::notify(WARN)<<" ("<<v1<<",\t"<<v2<<",\t"<<v3<<")"<<std::endl;
osg::notify(WARN)<<" ("<<r1<<",\t"<<r2<<",\t"<<r3<<")"<<std::endl;
OSG_WARN<<"Warning:: Picked up error in TriangleIntersect"<<std::endl;
OSG_WARN<<" ("<<v1<<",\t"<<v2<<",\t"<<v3<<")"<<std::endl;
OSG_WARN<<" ("<<r1<<",\t"<<r2<<",\t"<<r3<<")"<<std::endl;
return;
}
@@ -769,7 +769,7 @@ PickVisitor::PickVisitor(const osg::Viewport* viewport, const osg::Matrixd& proj
}
else
{
osg::notify(osg::NOTICE)<<"Warning: PickVisitor not set up correctly, picking errors likely"<<std::endl;
OSG_NOTICE<<"Warning: PickVisitor not set up correctly, picking errors likely"<<std::endl;
}

View File

@@ -118,7 +118,7 @@ void IntersectorGroup::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable
}
}
// osg::notify(osg::NOTICE)<<"Number testing "<<numTested<<std::endl;
// OSG_NOTICE<<"Number testing "<<numTested<<std::endl;
}
@@ -203,11 +203,11 @@ void IntersectionVisitor::reset()
void IntersectionVisitor::apply(osg::Node& node)
{
// osg::notify(osg::NOTICE)<<"apply(Node&)"<<std::endl;
// OSG_NOTICE<<"apply(Node&)"<<std::endl;
if (!enter(node)) return;
// osg::notify(osg::NOTICE)<<"inside apply(Node&)"<<std::endl;
// OSG_NOTICE<<"inside apply(Node&)"<<std::endl;
traverse(node);
@@ -225,11 +225,11 @@ void IntersectionVisitor::apply(osg::Group& group)
void IntersectionVisitor::apply(osg::Geode& geode)
{
// osg::notify(osg::NOTICE)<<"apply(Geode&)"<<std::endl;
// OSG_NOTICE<<"apply(Geode&)"<<std::endl;
if (!enter(geode)) return;
// osg::notify(osg::NOTICE)<<"inside apply(Geode&)"<<std::endl;
// OSG_NOTICE<<"inside apply(Geode&)"<<std::endl;
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
{
@@ -431,12 +431,12 @@ void IntersectionVisitor::apply(osg::Projection& projection)
void IntersectionVisitor::apply(osg::Camera& camera)
{
// osg::notify(osg::NOTICE)<<"apply(Camera&)"<<std::endl;
// OSG_NOTICE<<"apply(Camera&)"<<std::endl;
// note, commenting out right now because default Camera setup is with the culling active. Should this be changed?
// if (!enter(camera)) return;
// osg::notify(osg::NOTICE)<<"inside apply(Camera&)"<<std::endl;
// OSG_NOTICE<<"inside apply(Camera&)"<<std::endl;
osg::RefMatrix* projection = NULL;
osg::RefMatrix* view = NULL;

View File

@@ -166,9 +166,9 @@ namespace LineSegmentIntersectorUtils
osg::Vec3 in = v1*r1+v2*r2+v3*r3;
if (!in.valid())
{
osg::notify(osg::WARN)<<"Warning:: Picked up error in TriangleIntersect"<<std::endl;
osg::notify(osg::WARN)<<" ("<<v1<<",\t"<<v2<<",\t"<<v3<<")"<<std::endl;
osg::notify(osg::WARN)<<" ("<<r1<<",\t"<<r2<<",\t"<<r3<<")"<<std::endl;
OSG_WARN<<"Warning:: Picked up error in TriangleIntersect"<<std::endl;
OSG_WARN<<" ("<<v1<<",\t"<<v2<<",\t"<<v3<<")"<<std::endl;
OSG_WARN<<" ("<<r1<<",\t"<<r2<<",\t"<<r3<<")"<<std::endl;
return;
}
@@ -298,7 +298,7 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr
intersections.reserve(4);
if (kdTree->intersect(s,e,intersections))
{
// osg::notify(osg::NOTICE)<<"Got KdTree intersections"<<std::endl;
// OSG_NOTICE<<"Got KdTree intersections"<<std::endl;
for(osg::KdTree::LineSegmentIntersections::iterator itr = intersections.begin();
itr != intersections.end();
++itr)
@@ -321,7 +321,7 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr
hit.localIntersectionPoint = _start*(1.0-remap_ratio) + _end*remap_ratio;
// osg::notify(osg::NOTICE)<<"KdTree: ratio="<<hit.ratio<<" ("<<hit.localIntersectionPoint<<")"<<std::endl;
// OSG_NOTICE<<"KdTree: ratio="<<hit.ratio<<" ("<<hit.localIntersectionPoint<<")"<<std::endl;
hit.localIntersectionNormal = lsi.intersectionNormal;
@@ -382,7 +382,7 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr
hit.localIntersectionPoint = _start*(1.0-remap_ratio) + _end*remap_ratio;
// osg::notify(osg::NOTICE)<<"Conventional: ratio="<<hit.ratio<<" ("<<hit.localIntersectionPoint<<")"<<std::endl;
// OSG_NOTICE<<"Conventional: ratio="<<hit.ratio<<" ("<<hit.localIntersectionPoint<<")"<<std::endl;
hit.localIntersectionNormal = triHit._normal;
@@ -583,7 +583,7 @@ bool LineSegmentIntersector::intersectAndClip(osg::Vec3d& s, osg::Vec3d& e,const
}
}
// osg::notify(osg::NOTICE)<<"clampped segment "<<s<<" "<<e<<std::endl;
// OSG_NOTICE<<"clampped segment "<<s<<" "<<e<<std::endl;
// if (s==e) return false;

View File

@@ -267,7 +267,7 @@ void IndexMeshVisitor::makeMesh(Geometry& geom)
if (geom.suitableForOptimization())
{
// removing coord indices
osg::notify(osg::INFO)<<"TriStripVisitor::stripify(Geometry&): Removing attribute indices"<<std::endl;
OSG_INFO<<"TriStripVisitor::stripify(Geometry&): Removing attribute indices"<<std::endl;
geom.copyToAndOptimize(geom);
}
@@ -814,7 +814,7 @@ void VertexCacheVisitor::doVertexOptimization(Geometry& geom,
{
// The cache was empty, or all the triangles that use
// vertices in the cache have already been added.
OSG_NOTIFY(osg::DEBUG_INFO) << "VertexCacheVisitor searching all triangles" << std::endl;
OSG_DEBUG << "VertexCacheVisitor searching all triangles" << std::endl;
TriangleList::iterator maxItr
= max_element(triangles.begin(), triangles.end(),
CompareTriangle());

View File

@@ -153,7 +153,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
{
node->accept(stats);
stats.totalUpStats();
osg::notify(osg::NOTICE)<<std::endl<<"Stats before:"<<std::endl;
OSG_NOTICE<<std::endl<<"Stats before:"<<std::endl;
stats.print(osg::notify(osg::NOTICE));
}
@@ -165,7 +165,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & TESSELLATE_GEOMETRY)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TESSELLATE_GEOMETRY"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing TESSELLATE_GEOMETRY"<<std::endl;
TessellateVisitor tsv;
node->accept(tsv);
@@ -173,7 +173,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & REMOVE_LOADED_PROXY_NODES)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_LOADED_PROXY_NODES"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing REMOVE_LOADED_PROXY_NODES"<<std::endl;
RemoveLoadedProxyNodesVisitor rlpnv(this);
node->accept(rlpnv);
@@ -183,7 +183,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & COMBINE_ADJACENT_LODS)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COMBINE_ADJACENT_LODS"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing COMBINE_ADJACENT_LODS"<<std::endl;
CombineLODsVisitor clv(this);
node->accept(clv);
@@ -192,7 +192,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & OPTIMIZE_TEXTURE_SETTINGS)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing OPTIMIZE_TEXTURE_SETTINGS"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing OPTIMIZE_TEXTURE_SETTINGS"<<std::endl;
TextureVisitor tv(true,true, // unref image
false,false, // client storage
@@ -203,7 +203,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & SHARE_DUPLICATE_STATE)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SHARE_DUPLICATE_STATE"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing SHARE_DUPLICATE_STATE"<<std::endl;
bool combineDynamicState = false;
bool combineStaticState = true;
@@ -216,7 +216,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & TEXTURE_ATLAS_BUILDER)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TEXTURE_ATLAS_BUILDER"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing TEXTURE_ATLAS_BUILDER"<<std::endl;
// traverse the scene collecting textures into texture atlas.
TextureAtlasVisitor tav(this);
@@ -235,7 +235,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & COPY_SHARED_NODES)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing COPY_SHARED_NODES"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing COPY_SHARED_NODES"<<std::endl;
CopySharedSubgraphsVisitor cssv(this);
node->accept(cssv);
@@ -244,13 +244,13 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & FLATTEN_STATIC_TRANSFORMS)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS"<<std::endl;
int i=0;
bool result = false;
do
{
OSG_NOTIFY(osg::DEBUG_INFO) << "** RemoveStaticTransformsVisitor *** Pass "<<i<<std::endl;
OSG_DEBUG << "** RemoveStaticTransformsVisitor *** Pass "<<i<<std::endl;
FlattenStaticTransformsVisitor fstv(this);
node->accept(fstv);
result = fstv.removeTransforms(node);
@@ -265,7 +265,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS"<<std::endl;
// no combine any adjacent static transforms.
FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor fstdssv(this);
@@ -275,7 +275,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & MERGE_GEODES)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEODES"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing MERGE_GEODES"<<std::endl;
osg::Timer_t startTick = osg::Timer::instance()->tick();
@@ -284,12 +284,12 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
osg::Timer_t endTick = osg::Timer::instance()->tick();
OSG_NOTIFY(osg::INFO)<<"MERGE_GEODES took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
OSG_INFO<<"MERGE_GEODES took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
}
if (options & CHECK_GEOMETRY)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing CHECK_GEOMETRY"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing CHECK_GEOMETRY"<<std::endl;
CheckGeometryVisitor mgv(this);
node->accept(mgv);
@@ -297,7 +297,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & MAKE_FAST_GEOMETRY)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MAKE_FAST_GEOMETRY"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing MAKE_FAST_GEOMETRY"<<std::endl;
MakeFastGeometryVisitor mgv(this);
node->accept(mgv);
@@ -305,7 +305,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & MERGE_GEOMETRY)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing MERGE_GEOMETRY"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing MERGE_GEOMETRY"<<std::endl;
osg::Timer_t startTick = osg::Timer::instance()->tick();
@@ -315,12 +315,12 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
osg::Timer_t endTick = osg::Timer::instance()->tick();
OSG_NOTIFY(osg::INFO)<<"MERGE_GEOMETRY took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
OSG_INFO<<"MERGE_GEOMETRY took "<<osg::Timer::instance()->delta_s(startTick,endTick)<<std::endl;
}
if (options & TRISTRIP_GEOMETRY)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing TRISTRIP_GEOMETRY"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing TRISTRIP_GEOMETRY"<<std::endl;
TriStripVisitor tsv(this);
node->accept(tsv);
@@ -329,7 +329,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & REMOVE_REDUNDANT_NODES)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<<std::endl;
RemoveEmptyNodesVisitor renv(this);
node->accept(renv);
@@ -350,7 +350,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & SPATIALIZE_GROUPS)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing SPATIALIZE_GROUPS"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing SPATIALIZE_GROUPS"<<std::endl;
SpatializeGroupsVisitor sv(this);
node->accept(sv);
@@ -359,7 +359,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & INDEX_MESH)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing INDEX_MESH"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing INDEX_MESH"<<std::endl;
IndexMeshVisitor imv(this);
node->accept(imv);
imv.makeMesh();
@@ -367,7 +367,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & VERTEX_POSTTRANSFORM)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing VERTEX_POSTTRANSFORM"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing VERTEX_POSTTRANSFORM"<<std::endl;
VertexCacheVisitor vcv;
node->accept(vcv);
vcv.optimizeVertices();
@@ -375,7 +375,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
if (options & VERTEX_PRETRANSFORM)
{
OSG_NOTIFY(osg::INFO)<<"Optimizer::optimize() doing VERTEX_PRETRANSFORM"<<std::endl;
OSG_INFO<<"Optimizer::optimize() doing VERTEX_PRETRANSFORM"<<std::endl;
VertexAccessOrderVisitor vaov;
node->accept(vaov);
vaov.optimizeOrder();
@@ -386,7 +386,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options)
stats.reset();
node->accept(stats);
stats.totalUpStats();
osg::notify(osg::NOTICE)<<std::endl<<"Stats after:"<<std::endl;
OSG_NOTICE<<std::endl<<"Stats after:"<<std::endl;
stats.print(osg::notify(osg::NOTICE));
}
}
@@ -492,7 +492,7 @@ void Optimizer::StateVisitor::apply(osg::Geode& geode)
void Optimizer::StateVisitor::optimize()
{
OSG_NOTIFY(osg::INFO) << "Num of StateSet="<<_statesets.size()<< std::endl;
OSG_INFO << "Num of StateSet="<<_statesets.size()<< std::endl;
{
// create map from state attributes to stateset which contain them.
@@ -573,15 +573,15 @@ void Optimizer::StateVisitor::optimize()
// other.
std::sort(attributeList.begin(),attributeList.end(),LessDerefFunctor<osg::StateAttribute>());
OSG_NOTIFY(osg::INFO) << "state attribute list"<< std::endl;
OSG_INFO << "state attribute list"<< std::endl;
for(AttributeList::iterator aaitr = attributeList.begin();
aaitr!=attributeList.end();
++aaitr)
{
OSG_NOTIFY(osg::INFO) << " "<<*aaitr << " "<<(*aaitr)->className()<< std::endl;
OSG_INFO << " "<<*aaitr << " "<<(*aaitr)->className()<< std::endl;
}
OSG_NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
OSG_INFO << "searching for duplicate attributes"<< std::endl;
// find the duplicates.
AttributeList::iterator first_unique = attributeList.begin();
AttributeList::iterator current = first_unique;
@@ -590,13 +590,13 @@ void Optimizer::StateVisitor::optimize()
{
if (**current==**first_unique)
{
OSG_NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
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)
{
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
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);
@@ -625,15 +625,15 @@ void Optimizer::StateVisitor::optimize()
// other.
std::sort(uniformList.begin(),uniformList.end(),LessDerefFunctor<osg::Uniform>());
OSG_NOTIFY(osg::INFO) << "state uniform list"<< std::endl;
OSG_INFO << "state uniform list"<< std::endl;
for(UniformList::iterator uuitr = uniformList.begin();
uuitr!=uniformList.end();
++uuitr)
{
OSG_NOTIFY(osg::INFO) << " "<<*uuitr << " "<<(*uuitr)->getName()<< std::endl;
OSG_INFO << " "<<*uuitr << " "<<(*uuitr)->getName()<< std::endl;
}
OSG_NOTIFY(osg::INFO) << "searching for duplicate uniforms"<< std::endl;
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;
@@ -642,13 +642,13 @@ void Optimizer::StateVisitor::optimize()
{
if ((**current_uniform)==(**first_unique_uniform))
{
OSG_NOTIFY(osg::INFO) << " found duplicate uniform "<<(*current_uniform)->getName()<<" first_unique_uniform="<<*first_unique_uniform<<" current_uniform="<<*current_uniform<< std::endl;
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)
{
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current_uniform<<" with "<<*first_unique_uniform<< std::endl;
OSG_INFO << " replace duplicate "<<*current_uniform<<" with "<<*first_unique_uniform<< std::endl;
osg::StateSet* stateset = *sitr;
stateset->addUniform(*first_unique_uniform);
}
@@ -678,7 +678,7 @@ void Optimizer::StateVisitor::optimize()
// other.
std::sort(statesetSortList.begin(),statesetSortList.end(),LessDerefFunctor<osg::StateSet>());
OSG_NOTIFY(osg::INFO) << "searching for duplicate attributes"<< std::endl;
OSG_INFO << "searching for duplicate attributes"<< std::endl;
// find the duplicates.
StateSetSortList::iterator first_unique = statesetSortList.begin();
StateSetSortList::iterator current = first_unique; ++current;
@@ -686,13 +686,13 @@ void Optimizer::StateVisitor::optimize()
{
if (**current==**first_unique)
{
OSG_NOTIFY(osg::INFO) << " found duplicate "<<(*current)->className()<<" first="<<*first_unique<<" current="<<*current<< std::endl;
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)
{
OSG_NOTIFY(osg::INFO) << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
OSG_INFO << " replace duplicate "<<*current<<" with "<<*first_unique<< std::endl;
osg::Object* obj = *sitr;
osg::Drawable* drawable = dynamic_cast<osg::Drawable*>(obj);
if (drawable)
@@ -1137,9 +1137,9 @@ bool CollectLowestTransformsVisitor::removeTransforms(osg::Node* nodeWeCannotRem
}
else
{
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;
OSG_WARN<<"Warning:: during Optimize::CollectLowestTransformsVisitor::removeTransforms(Node*)"<<std::endl;
OSG_WARN<<" unhandled of setting of indentity matrix on "<< titr->first->className()<<std::endl;
OSG_WARN<<" model will appear in the incorrect position."<<std::endl;
}
}
@@ -1476,7 +1476,7 @@ void Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes()
}
else
{
OSG_NOTIFY(osg::WARN)<<"Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
OSG_WARN<<"Optimizer::RemoveRedundantNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
}
}
_redundantNodeList.clear();
@@ -1557,7 +1557,7 @@ void Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes()
}
else
{
OSG_NOTIFY(osg::WARN)<<"Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
OSG_WARN<<"Optimizer::RemoveLoadedProxyNodesVisitor::removeRedundantNodes() - failed dynamic_cast"<<std::endl;
}
}
_redundantNodeList.clear();
@@ -1858,7 +1858,7 @@ bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode)
if (geode.getNumDrawables()>=2)
{
// OSG_NOTIFY(osg::NOTICE)<<"Before "<<geode.getNumDrawables()<<std::endl;
// OSG_NOTICE<<"Before "<<geode.getNumDrawables()<<std::endl;
typedef std::vector<osg::Geometry*> DuplicateList;
typedef std::map<osg::Geometry*,DuplicateList,LessGeometry> GeometryDuplicateMap;
@@ -2027,14 +2027,14 @@ bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode)
geode.removeDrawable(rhs);
static int co = 0;
OSG_NOTIFY(osg::INFO)<<"merged and removed Geometry "<<++co<<std::endl;
OSG_INFO<<"merged and removed Geometry "<<++co<<std::endl;
}
}
}
}
#endif
// OSG_NOTIFY(osg::NOTICE)<<"After "<<geode.getNumDrawables()<<std::endl;
// OSG_NOTICE<<"After "<<geode.getNumDrawables()<<std::endl;
}
@@ -2314,7 +2314,7 @@ class MergeArrayVisitor : public osg::ArrayVisitor
}
}
virtual void apply(osg::Array&) { OSG_NOTIFY(osg::WARN) << "Warning: Optimizer's MergeArrayVisitor cannot merge Array type." << std::endl; }
virtual void apply(osg::Array&) { 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); }
@@ -2675,11 +2675,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;
OSG_NOTIFY(osg::INFO)<<"Dividing "<<group->className()<<" num children = "<<group->getNumChildren()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
OSG_INFO<<"Dividing "<<group->className()<<" num children = "<<group->getNumChildren()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
if (!xAxis && !yAxis && !zAxis)
{
OSG_NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
OSG_INFO<<" No axis to divide, stopping division."<<std::endl;
return false;
}
@@ -2843,18 +2843,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;
OSG_NOTIFY(osg::INFO)<<"INFO "<<geode->className()<<" num drawables = "<<geode->getNumDrawables()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
OSG_INFO<<"INFO "<<geode->className()<<" num drawables = "<<geode->getNumDrawables()<<" xAxis="<<xAxis<<" yAxis="<<yAxis<<" zAxis="<<zAxis<<std::endl;
if (!xAxis && !yAxis && !zAxis)
{
OSG_NOTIFY(osg::INFO)<<" No axis to divide, stopping division."<<std::endl;
OSG_INFO<<" No axis to divide, stopping division."<<std::endl;
return false;
}
osg::Node::ParentList parents = geode->getParents();
if (parents.empty())
{
OSG_NOTIFY(osg::INFO)<<" Cannot perform spatialize on root Geode, add a Group above it to allow subdivision."<<std::endl;
OSG_INFO<<" Cannot perform spatialize on root Geode, add a Group above it to allow subdivision."<<std::endl;
return false;
}
@@ -2899,12 +2899,12 @@ void Optimizer::CopySharedSubgraphsVisitor::apply(osg::Node& node)
void Optimizer::CopySharedSubgraphsVisitor::copySharedNodes()
{
OSG_NOTIFY(osg::INFO)<<"Shared node "<<_sharedNodeList.size()<<std::endl;
OSG_INFO<<"Shared node "<<_sharedNodeList.size()<<std::endl;
for(SharedNodeList::iterator itr=_sharedNodeList.begin();
itr!=_sharedNodeList.end();
++itr)
{
OSG_NOTIFY(osg::INFO)<<" No parents "<<(*itr)->getNumParents()<<std::endl;
OSG_INFO<<" No parents "<<(*itr)->getNumParents()<<std::endl;
osg::Node* node = *itr;
for(unsigned int i=node->getNumParents()-1;i>0;--i)
{
@@ -3071,7 +3071,7 @@ bool Optimizer::MergeGeodesVisitor::mergeGeodes(osg::Group& group)
// if no geodes then just return.
if (geodeDuplicateMap.empty()) return false;
OSG_NOTIFY(osg::INFO)<<"mergeGeodes in group '"<<group.getName()<<"' "<<geodeDuplicateMap.size()<<std::endl;
OSG_INFO<<"mergeGeodes in group '"<<group.getName()<<"' "<<geodeDuplicateMap.size()<<std::endl;
// merge
for(GeodeDuplicateMap::iterator itr=geodeDuplicateMap.begin();
@@ -3278,7 +3278,7 @@ void Optimizer::TextureAtlasBuilder::buildAtlas()
aitr != _atlasList.end() && !addedSourceToAtlas;
++aitr)
{
OSG_NOTIFY(osg::INFO)<<"checking source "<<source->_image->getFileName()<<" to see it it'll fit in atlas "<<aitr->get()<<std::endl;
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;
@@ -3286,13 +3286,13 @@ void Optimizer::TextureAtlasBuilder::buildAtlas()
}
else
{
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<aitr->get()<<std::endl;
OSG_INFO<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<aitr->get()<<std::endl;
}
}
if (!addedSourceToAtlas)
{
OSG_NOTIFY(osg::INFO)<<"creating new Atlas for "<<source->_image->getFileName()<<std::endl;
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());
@@ -3611,7 +3611,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::doesSourceFit(Source* source)
if ((_x + sourceImage->s() + 2*_margin) <= _maximumAtlasWidth)
{
// yes it fits :-)
OSG_NOTIFY(osg::INFO)<<"Fits in current row"<<std::endl;
OSG_INFO<<"Fits in current row"<<std::endl;
return true;
}
@@ -3619,7 +3619,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::doesSourceFit(Source* source)
if ((_height + sourceImage->t() + 2*_margin) <= _maximumAtlasHeight)
{
// yes it fits :-)
OSG_NOTIFY(osg::INFO)<<"Fits in next row"<<std::endl;
OSG_INFO<<"Fits in next row"<<std::endl;
return true;
}
@@ -3632,7 +3632,7 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
// double check source is compatible
if (!doesSourceFit(source))
{
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
OSG_INFO<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
return false;
}
@@ -3676,7 +3676,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);
OSG_NOTIFY(osg::INFO)<<"current row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
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;
@@ -3704,7 +3704,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);
OSG_NOTIFY(osg::INFO)<<"next row insertion, source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
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;
@@ -3718,12 +3718,12 @@ bool Optimizer::TextureAtlasBuilder::Atlas::addSource(Source* source)
_height = _y + sourceImage->t() + 2*_margin;
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
OSG_INFO<<"source "<<source->_image->getFileName()<<" "<<_x<<","<<_y<<" fits in row of atlas "<<this<<std::endl;
return true;
}
OSG_NOTIFY(osg::INFO)<<"source "<<source->_image->getFileName()<<" does not fit in atlas "<<this<<std::endl;
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;
@@ -3737,7 +3737,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::clampToNearestPowerOfTwoSize()
unsigned int h = 1;
while (h<_height) h *= 2;
OSG_NOTIFY(osg::INFO)<<"Clamping "<<_width<<", "<<_height<<" to "<<w<<","<<h<<std::endl;
OSG_INFO<<"Clamping "<<_width<<", "<<_height<<" to "<<w<<","<<h<<std::endl;
_width = w;
_height = h;
@@ -3746,7 +3746,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::clampToNearestPowerOfTwoSize()
void Optimizer::TextureAtlasBuilder::Atlas::copySources()
{
OSG_NOTIFY(osg::INFO)<<"Allocated to "<<_width<<","<<_height<<std::endl;
OSG_INFO<<"Allocated to "<<_width<<","<<_height<<std::endl;
_image->allocateImage(_width,_height,1,
_image->getPixelFormat(),_image->getDataType(),
_image->getPacking());
@@ -3758,7 +3758,7 @@ void Optimizer::TextureAtlasBuilder::Atlas::copySources()
for(unsigned int i=0; i<size; ++i) *(str++) = 0;
}
OSG_NOTIFY(osg::INFO)<<"Atlas::copySources() "<<std::endl;
OSG_INFO<<"Atlas::copySources() "<<std::endl;
for(SourceList::iterator itr = _sourceList.begin();
itr !=_sourceList.end();
++itr)
@@ -3768,8 +3768,8 @@ void Optimizer::TextureAtlasBuilder::Atlas::copySources()
if (atlas)
{
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;
OSG_INFO<<"Copying image "<<source->_image->getFileName()<<" to "<<source->_x<<" ,"<<source->_y<<std::endl;
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();
@@ -4130,7 +4130,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
if (texturesThatRepeatAndAreOutOfRange.count(texture)==0)
{
// safe to convert into CLAMP wrap mode.
OSG_NOTIFY(osg::INFO)<<"Changing wrap mode to CLAMP"<<std::endl;
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);
}
@@ -4239,7 +4239,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
{
if (s_repeat || t_repeat)
{
OSG_NOTIFY(osg::NOTICE)<<"Warning!!! shouldn't get here"<<std::endl;
OSG_NOTICE<<"Warning!!! shouldn't get here"<<std::endl;
}
stateset->setTextureAttribute(unit, newTexture);
@@ -4270,7 +4270,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
if (canTexMatBeFlattenedToAllDrawables)
{
// OSG_NOTIFY(osg::NOTICE)<<"All drawables can be flattened "<<drawables.size()<<std::endl;
// OSG_NOTICE<<"All drawables can be flattened "<<drawables.size()<<std::endl;
for(Drawables::iterator ditr = drawables.begin();
ditr != drawables.end();
++ditr)
@@ -4290,13 +4290,13 @@ void Optimizer::TextureAtlasVisitor::optimize()
}
else
{
OSG_NOTIFY(osg::NOTICE)<<"Error, Optimizer::TextureAtlasVisitor::optimize() shouldn't ever get here..."<<std::endl;
OSG_NOTICE<<"Error, Optimizer::TextureAtlasVisitor::optimize() shouldn't ever get here..."<<std::endl;
}
}
}
else
{
// OSG_NOTIFY(osg::NOTICE)<<"Applying TexMat "<<drawables.size()<<std::endl;
// OSG_NOTICE<<"Applying TexMat "<<drawables.size()<<std::endl;
stateset->setTextureAttribute(unit, new osg::TexMat(matrix));
}
}
@@ -4376,7 +4376,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
}
else
{
OSG_NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
OSG_NOTICE << "No parent for this Group" << std::endl;
}
}
else
@@ -4417,7 +4417,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
}
else
{
OSG_NOTIFY(osg::NOTICE) << "No parent for this Group" << std::endl;
OSG_NOTICE << "No parent for this Group" << std::endl;
}
}
else
@@ -4455,7 +4455,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
traverse(*(new_lod.get()));
}
else
OSG_NOTIFY(osg::NOTICE) << "No parent for this LOD" << std::endl;
OSG_NOTICE << "No parent for this LOD" << std::endl;
}
else
{
@@ -4493,7 +4493,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
if(parent_group)
parent_group->replaceChild(&geode, new_geode.get());
else
OSG_NOTIFY(osg::NOTICE) << "No parent for this Geode" << std::endl;
OSG_NOTICE << "No parent for this Geode" << std::endl;
transformGeode(*(new_geode.get()));
}
@@ -4527,7 +4527,7 @@ void Optimizer::FlattenStaticTransformsDuplicatingSharedSubgraphsVisitor::apply(
if(parent_group)
parent_group->replaceChild(&billboard, new_billboard.get());
else
OSG_NOTIFY(osg::NOTICE) << "No parent for this Billboard" << std::endl;
OSG_NOTICE << "No parent for this Billboard" << std::endl;
transformBillboard(*(new_billboard.get()));
}

View File

@@ -97,13 +97,13 @@ namespace PlaneIntersectorUtils
}
else
{
osg::notify(osg::NOTICE)<<"Error: should not get here!"<<std::endl;
OSG_NOTICE<<"Error: should not get here!"<<std::endl;
}
}
else // if (v2_connections==2)
{
// v2 connects to a start and an end - must have a loop in the list!
osg::notify(osg::NOTICE)<<"v2="<<v2<<" must connect to a start and an end - must have a loop!!!!!."<<std::endl;
OSG_NOTICE<<"v2="<<v2<<" must connect to a start and an end - must have a loop!!!!!."<<std::endl;
}
}
else if (v2_connections==0) // v1 is no connected to anything.
@@ -121,13 +121,13 @@ namespace PlaneIntersectorUtils
}
else
{
osg::notify(osg::NOTICE)<<"Error: should not get here!"<<std::endl;
OSG_NOTICE<<"Error: should not get here!"<<std::endl;
}
}
else // if (v1_connections==2)
{
// v1 connects to a start and an end - must have a loop in the list!
osg::notify(osg::NOTICE)<<"v1="<<v1<<" must connect to a start and an end - must have a loop!!!!!."<<std::endl;
OSG_NOTICE<<"v1="<<v1<<" must connect to a start and an end - must have a loop!!!!!."<<std::endl;
}
}
else
@@ -151,7 +151,7 @@ namespace PlaneIntersectorUtils
}
else
{
osg::notify(osg::NOTICE)<<"Error: should not get here!"<<std::endl;
OSG_NOTICE<<"Error: should not get here!"<<std::endl;
}
}
else if (v1_connected_to_end)
@@ -166,12 +166,12 @@ namespace PlaneIntersectorUtils
}
else
{
osg::notify(osg::NOTICE)<<"Error: should not get here!"<<std::endl;
OSG_NOTICE<<"Error: should not get here!"<<std::endl;
}
}
else
{
osg::notify(osg::NOTICE)<<"Error: should not get here!"<<std::endl;
OSG_NOTICE<<"Error: should not get here!"<<std::endl;
}
}
}
@@ -307,35 +307,35 @@ namespace PlaneIntersectorUtils
void report()
{
osg::notify(osg::NOTICE)<<"report()"<<std::endl;
OSG_NOTICE<<"report()"<<std::endl;
osg::notify(osg::NOTICE)<<"start:"<<std::endl;
OSG_NOTICE<<"start:"<<std::endl;
for(PolylineMap::iterator sitr = _startPolylineMap.begin();
sitr != _startPolylineMap.end();
++sitr)
{
osg::notify(osg::NOTICE)<<" line - start = "<<sitr->first<<" polyline size = "<<sitr->second->_polyline.size()<<std::endl;
OSG_NOTICE<<" line - start = "<<sitr->first<<" polyline size = "<<sitr->second->_polyline.size()<<std::endl;
}
osg::notify(osg::NOTICE)<<"ends:"<<std::endl;
OSG_NOTICE<<"ends:"<<std::endl;
for(PolylineMap::iterator eitr = _endPolylineMap.begin();
eitr != _endPolylineMap.end();
++eitr)
{
osg::notify(osg::NOTICE)<<" line - end = "<<eitr->first<<" polyline size = "<<eitr->second->_polyline.size()<<std::endl;
OSG_NOTICE<<" line - end = "<<eitr->first<<" polyline size = "<<eitr->second->_polyline.size()<<std::endl;
}
for(PolylineList::iterator pitr = _polylines.begin();
pitr != _polylines.end();
++pitr)
{
osg::notify(osg::NOTICE)<<"polyline:"<<std::endl;
OSG_NOTICE<<"polyline:"<<std::endl;
RefPolyline::Polyline& polyline = (*pitr)->_polyline;
for(RefPolyline::Polyline::iterator vitr = polyline.begin();
vitr != polyline.end();
++vitr)
{
osg::notify(osg::NOTICE)<<" "<<*vitr<<std::endl;
OSG_NOTICE<<" "<<*vitr<<std::endl;
}
}
@@ -344,7 +344,7 @@ namespace PlaneIntersectorUtils
void fuse()
{
osg::notify(osg::NOTICE)<<"supposed to be doing a fuse..."<<std::endl;
OSG_NOTICE<<"supposed to be doing a fuse..."<<std::endl;
}
@@ -406,31 +406,31 @@ namespace PlaneIntersectorUtils
{
if (de<0.0)
{
// osg::notify(osg::NOTICE)<<"Discard segment "<<std::endl;
// OSG_NOTICE<<"Discard segment "<<std::endl;
return;
}
// osg::notify(osg::NOTICE)<<"Trim start vs="<<vs;
// OSG_NOTICE<<"Trim start vs="<<vs;
double div = 1.0/(de-ds);
vs = vs*(de*div) - ve*(ds*div);
// osg::notify(osg::NOTICE)<<" after vs="<<vs<<std::endl;
// OSG_NOTICE<<" after vs="<<vs<<std::endl;
}
else if (de<0.0)
{
// osg::notify(osg::NOTICE)<<"Trim end ve="<<ve;
// OSG_NOTICE<<"Trim end ve="<<ve;
double div = 1.0/(ds-de);
ve = ve*(ds*div) - vs*(de*div);
// osg::notify(osg::NOTICE)<<" after ve="<<ve<<std::endl;
// OSG_NOTICE<<" after ve="<<ve<<std::endl;
}
}
// osg::notify(osg::NOTICE)<<"Segment fine"<<std::endl;
// OSG_NOTICE<<"Segment fine"<<std::endl;
_polylineConnector.add(vs,ve);
@@ -467,21 +467,21 @@ namespace PlaneIntersectorUtils
if (numOnPlane==3)
{
// triangle lives wholy in the plane
osg::notify(osg::NOTICE)<<"3"<<std::endl;
OSG_NOTICE<<"3"<<std::endl;
return;
}
if (numOnPlane==2)
{
// one edge lives wholy in the plane
osg::notify(osg::NOTICE)<<"2"<<std::endl;
OSG_NOTICE<<"2"<<std::endl;
return;
}
if (numOnPlane==1)
{
// one point lives wholy in the plane
osg::notify(osg::NOTICE)<<"1"<<std::endl;
OSG_NOTICE<<"1"<<std::endl;
return;
}
@@ -548,7 +548,7 @@ namespace PlaneIntersectorUtils
}
else
{
osg::notify(osg::NOTICE)<<"!!! too many intersecting edges found !!!"<<std::endl;
OSG_NOTICE<<"!!! too many intersecting edges found !!!"<<std::endl;
}
}
@@ -648,12 +648,12 @@ void PlaneIntersector::leave()
void PlaneIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable)
{
// osg::notify(osg::NOTICE)<<"PlaneIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable)"<<std::endl;
// OSG_NOTICE<<"PlaneIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable)"<<std::endl;
if ( _plane.intersect( drawable->getBound() )!=0 ) return;
if ( !_polytope.contains( drawable->getBound() ) ) return;
// osg::notify(osg::NOTICE)<<"Succed PlaneIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable)"<<std::endl;
// OSG_NOTICE<<"Succed PlaneIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable)"<<std::endl;
osg::TriangleFunctor<PlaneIntersectorUtils::TriangleIntersector> ti;
ti.set(_plane, _polytope, iv.getModelMatrix(), _recordHeightsAsAttributes, _em.get());

View File

@@ -72,7 +72,7 @@ RenderBin* RenderBin::createRenderBin(const std::string& binName)
if (prototype) return dynamic_cast<RenderBin*>(prototype->clone(osg::CopyOp::DEEP_COPY_ALL));
}
osg::notify(osg::WARN) <<"Warning: RenderBin \""<<binName<<"\" implementation not found, using default RenderBin as a fallback."<<std::endl;
OSG_WARN <<"Warning: RenderBin \""<<binName<<"\" implementation not found, using default RenderBin as a fallback."<<std::endl;
return new RenderBin;
}
@@ -96,13 +96,13 @@ void RenderBin::removeRenderBinPrototype(RenderBin* proto)
{
if (itr->second == proto)
{
// osg::notify(osg::NOTICE)<<"Found protype, now erasing "<<itr->first<<std::endl;
// OSG_NOTICE<<"Found protype, now erasing "<<itr->first<<std::endl;
list->erase(itr);
return;
}
}
}
// osg::notify(osg::NOTICE)<<"Not found protype"<<std::endl;
// OSG_NOTICE<<"Not found protype"<<std::endl;
}
static bool s_defaultBinSortModeInitialized = false;
@@ -257,7 +257,7 @@ struct SortByStateFunctor
void RenderBin::sortByState()
{
//osg::notify(osg::NOTICE)<<"sortByState()"<<std::endl;
//OSG_NOTICE<<"sortByState()"<<std::endl;
// actually we'll do nothing right now, as fine grained sorting by state
// appears to cost more to do than it saves in draw. The contents of
// the StateGraph leaves is already coarse grained sorted, this
@@ -377,7 +377,7 @@ void RenderBin::copyLeavesFromStateGraphListToRenderLeafList()
}
}
if (detectedNaN) osg::notify(osg::NOTICE)<<"Warning: RenderBin::copyLeavesFromStateGraphListToRenderLeafList() detected NaN depth values, database may be corrupted."<<std::endl;
if (detectedNaN) OSG_NOTICE<<"Warning: RenderBin::copyLeavesFromStateGraphListToRenderLeafList() detected NaN depth values, database may be corrupted."<<std::endl;
// empty the render graph list to prevent it being drawn along side the render leaf list (see drawImplementation.)
_stateGraphList.clear();
@@ -426,7 +426,7 @@ void RenderBin::drawImplementation(osg::RenderInfo& renderInfo,RenderLeaf*& prev
{
osg::State& state = *renderInfo.getState();
// osg::notify(osg::NOTICE)<<"begin RenderBin::drawImplementation "<<className()<<" sortMode "<<getSortMode()<<std::endl;
// OSG_NOTICE<<"begin RenderBin::drawImplementation "<<className()<<" sortMode "<<getSortMode()<<std::endl;
unsigned int numToPop = (previous ? StateGraph::numToPop(previous->_parent) : 0);
@@ -514,7 +514,7 @@ void RenderBin::drawImplementation(osg::RenderInfo& renderInfo,RenderLeaf*& prev
}
// osg::notify(osg::NOTICE)<<"end RenderBin::drawImplementation "<<className()<<std::endl;
// OSG_NOTICE<<"end RenderBin::drawImplementation "<<className()<<std::endl;
}
// stats

View File

@@ -86,5 +86,5 @@ void RenderLeaf::render(osg::RenderInfo& renderInfo,RenderLeaf* previous)
state.decrementDynamicObjectCount();
}
// osg::notify(osg::NOTICE)<<"RenderLeaf "<<_drawable->getName()<<" "<<_depth<<std::endl;
// OSG_NOTICE<<"RenderLeaf "<<_drawable->getName()<<" "<<_depth<<std::endl;
}

View File

@@ -249,8 +249,8 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
depth = osg::maximum(depth,itr->second.depth());
}
// OSG_NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp viewport "<<_viewport->x()<<" "<<_viewport->y()<<" "<<_viewport->width()<<" "<<_viewport->height()<<std::endl;
// OSG_NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp computed "<<width<<" "<<height<<" "<<depth<<std::endl;
// OSG_NOTICE<<"RenderStage::runCameraSetUp viewport "<<_viewport->x()<<" "<<_viewport->y()<<" "<<_viewport->width()<<" "<<_viewport->height()<<std::endl;
// OSG_NOTICE<<"RenderStage::runCameraSetUp computed "<<width<<" "<<height<<" "<<depth<<std::endl;
// attach images that need to be copied after the stage is drawn.
for(itr = bufferAttachments.begin();
@@ -342,7 +342,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
if (fbo_supported)
{
OSG_NOTIFY(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER_OBJECT"<<std::endl;
OSG_INFO<<"Setting up osg::Camera::FRAME_BUFFER_OBJECT"<<std::endl;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*(_camera->getDataChangeMutex()));
@@ -521,7 +521,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
{
OSG_NOTIFY(osg::NOTICE)<<"RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x"<<std::hex<<status<<std::dec<<std::endl;
OSG_NOTICE<<"RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x"<<std::hex<<status<<std::dec<<std::endl;
fbo_supported = false;
fbo_ext->glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
@@ -550,7 +550,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
{
notify(NOTICE) << "RenderStage::runCameraSetUp(), "
OSG_NOTICE << "RenderStage::runCameraSetUp(), "
"multisample FBO setup failed, FBO status = 0x"
<< std::hex << status << std::dec << std::endl;
@@ -613,7 +613,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
traits->width = width;
traits->height = height;
// OSG_NOTIFY(osg::NOTICE)<<"traits = "<<traits->width<<" "<<traits->height<<std::endl;
// OSG_NOTICE<<"traits = "<<traits->width<<" "<<traits->height<<std::endl;
traits->pbuffer = (renderTargetImplementation==osg::Camera::PIXEL_BUFFER || renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT);
traits->windowDecoration = (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW);
@@ -695,14 +695,14 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
{
if (renderTargetImplementation==osg::Camera::SEPERATE_WINDOW)
{
OSG_NOTIFY(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Window ";
OSG_NOTICE<<"Warning: RenderStage::runCameraSetUp(State&) Window ";
}
else
{
OSG_NOTIFY(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Pbuffer ";
OSG_NOTICE<<"Warning: RenderStage::runCameraSetUp(State&) Pbuffer ";
}
OSG_NOTIFY(osg::NOTICE)<<"does not support multiple color outputs."<<std::endl;
OSG_NOTICE<<"does not support multiple color outputs."<<std::endl;
break;
}
@@ -743,7 +743,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
if (context.valid() && context->realize())
{
OSG_NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Context has been realized "<<std::endl;
OSG_INFO<<"RenderStage::runCameraSetUp(State&) Context has been realized "<<std::endl;
// successfully set up graphics context as requested,
// will assign this graphics context to the RenderStage and
@@ -758,18 +758,18 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
if (pBufferTexture && renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT)
{
OSG_NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Assign graphis context to Texture"<<std::endl;
OSG_INFO<<"RenderStage::runCameraSetUp(State&) Assign graphis context to Texture"<<std::endl;
pBufferTexture->setReadPBuffer(context.get());
}
else
{
OSG_NOTIFY(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Assigning texture to RenderStage so that it does the copy"<<std::endl;
OSG_INFO<<"RenderStage::runCameraSetUp(State&) Assigning texture to RenderStage so that it does the copy"<<std::endl;
setTexture(pBufferTexture, level, face);
}
}
else
{
OSG_NOTIFY(osg::INFO)<<"Failed to acquire Graphics Context"<<std::endl;
OSG_INFO<<"Failed to acquire Graphics Context"<<std::endl;
if (renderTargetImplementation==osg::Camera::PIXEL_BUFFER_RTT)
{
@@ -791,7 +791,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
// finally if all else has failed, then the frame buffer fallback will come in to play.
if (renderTargetImplementation==osg::Camera::FRAME_BUFFER)
{
OSG_NOTIFY(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER"<<std::endl;
OSG_INFO<<"Setting up osg::Camera::FRAME_BUFFER"<<std::endl;
for(osg::Camera::BufferAttachmentMap::iterator itr = bufferAttachments.begin();
itr != bufferAttachments.end();
@@ -888,7 +888,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
{
if (read_fbo->isMultisample())
{
OSG_NOTIFY(osg::WARN) << "Attempting to read from a"
OSG_WARN << "Attempting to read from a"
" multisampled framebuffer object. Set a resolve"
" framebuffer on the RenderStage to fix this." << std::endl;
}
@@ -940,7 +940,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
GLenum fbstatus = fbo_ext->glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
if ( fbstatus != GL_FRAMEBUFFER_COMPLETE_EXT )
{
OSG_NOTIFY(osg::NOTICE)<<"RenderStage::drawInner(,) FBO status = 0x"<<std::hex<<fbstatus<<std::dec<<std::endl;
OSG_NOTICE<<"RenderStage::drawInner(,) FBO status = 0x"<<std::hex<<fbstatus<<std::dec<<std::endl;
}
}
}
@@ -1086,7 +1086,7 @@ struct DrawInnerOperation : public osg::Operation
osg::GraphicsContext* context = dynamic_cast<osg::GraphicsContext*>(object);
if (!context) return;
// OSG_NOTIFY(osg::NOTICE)<<"DrawInnerOperation operator"<<std::endl;
// OSG_NOTICE<<"DrawInnerOperation operator"<<std::endl;
if (_stage && context)
{
RenderLeaf* previous = 0;
@@ -1143,7 +1143,7 @@ void RenderStage::draw(osg::RenderInfo& renderInfo,RenderLeaf*& previous)
// now as an experiment.
callingContext->releaseContext();
// OSG_NOTIFY(osg::NOTICE)<<" enclosing state before - "<<state.getStateSetStackSize()<<std::endl;
// OSG_NOTICE<<" enclosing state before - "<<state.getStateSetStackSize()<<std::endl;
useState = _graphicsContext->getState();
useContext = _graphicsContext.get();
@@ -1162,7 +1162,7 @@ void RenderStage::draw(osg::RenderInfo& renderInfo,RenderLeaf*& previous)
previous = 0;
useContext->makeCurrent();
// OSG_NOTIFY(osg::NOTICE)<<" nested state before - "<<useState->getStateSetStackSize()<<std::endl;
// OSG_NOTICE<<" nested state before - "<<useState->getStateSetStackSize()<<std::endl;
}
}
@@ -1258,8 +1258,8 @@ void RenderStage::draw(osg::RenderInfo& renderInfo,RenderLeaf*& previous)
previous = saved_previous;
// OSG_NOTIFY(osg::NOTICE)<<" nested state after - "<<useState->getStateSetStackSize()<<std::endl;
// OSG_NOTIFY(osg::NOTICE)<<" enclosing state after - "<<state.getStateSetStackSize()<<std::endl;
// OSG_NOTICE<<" nested state after - "<<useState->getStateSetStackSize()<<std::endl;
// OSG_NOTICE<<" enclosing state after - "<<state.getStateSetStackSize()<<std::endl;
callingContext->makeCurrent();
}
@@ -1283,7 +1283,7 @@ void RenderStage::drawImplementation(osg::RenderInfo& renderInfo,RenderLeaf*& pr
if (!_viewport)
{
notify(FATAL) << "Error: cannot draw stage due to undefined viewport."<< std::endl;
OSG_FATAL << "Error: cannot draw stage due to undefined viewport."<< std::endl;
return;
}
@@ -1444,7 +1444,7 @@ void RenderStage::setMultisampleResolveFramebufferObject(osg::FrameBufferObject*
{
if (fbo && fbo->isMultisample())
{
OSG_NOTIFY(osg::WARN) << "Resolve framebuffer must not be"
OSG_WARN << "Resolve framebuffer must not be"
" multisampled." << std::endl;
}
_resolveFbo = fbo;

View File

@@ -183,7 +183,9 @@ void ReversePrimitiveFunctor::drawElements(GLenum mode,GLsizei count,const GLuin
void ReversePrimitiveFunctor::begin(GLenum mode)
{
if (_running)
osg::notify(osg::WARN) << "ReversePrimitiveFunctor : call \"begin\" without call \"end\"." << std::endl;
{
OSG_WARN << "ReversePrimitiveFunctor : call \"begin\" without call \"end\"." << std::endl;
}
else
{
_running = true;
@@ -195,7 +197,9 @@ void ReversePrimitiveFunctor::begin(GLenum mode)
void ReversePrimitiveFunctor::vertex(unsigned int pos)
{
if (_running == false)
osg::notify(osg::WARN) << "ReversePrimitiveFunctor : call \"vertex(" << pos << ")\" without call \"begin\"." << std::endl;
{
OSG_WARN << "ReversePrimitiveFunctor : call \"vertex(" << pos << ")\" without call \"begin\"." << std::endl;
}
else
{
static_cast<osg::DrawElementsUInt*>(_reversedPrimitiveSet.get())->push_back(pos);
@@ -205,7 +209,9 @@ void ReversePrimitiveFunctor::vertex(unsigned int pos)
void ReversePrimitiveFunctor::end()
{
if (_running == false)
osg::notify(osg::WARN) << "ReversePrimitiveFunctor : call \"end\" without call \"begin\"." << std::endl;
{
OSG_WARN << "ReversePrimitiveFunctor : call \"end\" without call \"begin\"." << std::endl;
}
else
{
_running = false;

View File

@@ -345,7 +345,7 @@ void SceneGraphBuilder::Cylinder(GLfloat aBase,
GLint aSlices,
GLint aStacks)
{
osg::notify(osg::NOTICE)<<"SceneGraphBuilder::Cylinder("<<aBase<<", "<<aTop<<", "<<aHeight<<", "<<aSlices<<", "<<aStacks<<") not implemented yet"<<std::endl;
OSG_NOTICE<<"SceneGraphBuilder::Cylinder("<<aBase<<", "<<aTop<<", "<<aHeight<<", "<<aSlices<<", "<<aStacks<<") not implemented yet"<<std::endl;
}
void SceneGraphBuilder::Disk(GLfloat inner,
@@ -418,8 +418,8 @@ void SceneGraphBuilder::PartialDisk(GLfloat inner,
GLfloat start,
GLfloat sweep)
{
osg::notify(osg::NOTICE)<<"SceneGraphBuilder::PartialDisk("<<inner<<", "<<outer<<", "<<slices<<", "<<loops<<", "<<start<<", "<<sweep<<") not implemented yet."<<std::endl;
osg::notify(osg::NOTICE)<<" quadric("<<_quadricState._drawStyle<<", "<<_quadricState._normals<<", "<<_quadricState._orientation<<", "<<_quadricState._texture<<std::endl;
OSG_NOTICE<<"SceneGraphBuilder::PartialDisk("<<inner<<", "<<outer<<", "<<slices<<", "<<loops<<", "<<start<<", "<<sweep<<") not implemented yet."<<std::endl;
OSG_NOTICE<<" quadric("<<_quadricState._drawStyle<<", "<<_quadricState._normals<<", "<<_quadricState._orientation<<", "<<_quadricState._texture<<std::endl;
}
void SceneGraphBuilder::Sphere(GLfloat radius,

View File

@@ -290,7 +290,7 @@ void SceneView::setCamera(osg::Camera* camera, bool assumeOwnershipOfCamera)
}
else
{
osg::notify(osg::NOTICE)<<"Warning: attempt to assign a NULL camera to SceneView not permitted."<<std::endl;
OSG_NOTICE<<"Warning: attempt to assign a NULL camera to SceneView not permitted."<<std::endl;
}
if (assumeOwnershipOfCamera)
@@ -731,7 +731,7 @@ void SceneView::cull()
if (!_renderInfo.getState())
{
osg::notify(osg::INFO) << "Warning: no valid osgUtil::SceneView::_state attached, creating a default state automatically."<< std::endl;
OSG_INFO << "Warning: no valid osgUtil::SceneView::_state attached, creating a default state automatically."<< std::endl;
// note the constructor for osg::State will set ContextID to 0 which will be fine to single context graphics
// applications which is ok for most apps, but not multiple context/pipe applications.
@@ -754,17 +754,17 @@ void SceneView::cull()
if (!_cullVisitor)
{
osg::notify(osg::INFO) << "Warning: no valid osgUtil::SceneView:: attached, creating a default CullVisitor automatically."<< std::endl;
OSG_INFO << "Warning: no valid osgUtil::SceneView:: attached, creating a default CullVisitor automatically."<< std::endl;
_cullVisitor = CullVisitor::create();
}
if (!_stateGraph)
{
osg::notify(osg::INFO) << "Warning: no valid osgUtil::SceneView:: attached, creating a global default StateGraph automatically."<< std::endl;
OSG_INFO << "Warning: no valid osgUtil::SceneView:: attached, creating a global default StateGraph automatically."<< std::endl;
_stateGraph = new StateGraph;
}
if (!_renderStage)
{
osg::notify(osg::INFO) << "Warning: no valid osgUtil::SceneView::_renderStage attached, creating a default RenderStage automatically."<< std::endl;
OSG_INFO << "Warning: no valid osgUtil::SceneView::_renderStage attached, creating a default RenderStage automatically."<< std::endl;
_renderStage = new RenderStage;
}
@@ -897,7 +897,7 @@ bool SceneView::cullStage(const osg::Matrixd& projection,const osg::Matrixd& mod
_collectOccludersVisitor->removeOccludedOccluders();
osg::notify(osg::DEBUG_INFO) << "finished searching for occluder - found "<<_collectOccludersVisitor->getCollectedOccluderSet().size()<<std::endl;
OSG_DEBUG << "finished searching for occluder - found "<<_collectOccludersVisitor->getCollectedOccluderSet().size()<<std::endl;
cullVisitor->getOccluderList().clear();
std::copy(_collectOccludersVisitor->getCollectedOccluderSet().begin(),_collectOccludersVisitor->getCollectedOccluderSet().end(), std::back_insert_iterator<CullStack::OccluderList>(cullVisitor->getOccluderList()));
@@ -949,11 +949,11 @@ bool SceneView::cullStage(const osg::Matrixd& projection,const osg::Matrixd& mod
{
case(HEADLIGHT):
if (_light.valid()) renderStage->addPositionedAttribute(NULL,_light.get());
else osg::notify(osg::WARN)<<"Warning: no osg::Light attached to ogUtil::SceneView to provide head light.*/"<<std::endl;
else OSG_WARN<<"Warning: no osg::Light attached to ogUtil::SceneView to provide head light.*/"<<std::endl;
break;
case(SKY_LIGHT):
if (_light.valid()) renderStage->addPositionedAttribute(mv.get(),_light.get());
else osg::notify(osg::WARN)<<"Warning: no osg::Light attached to ogUtil::SceneView to provide sky light.*/"<<std::endl;
else OSG_WARN<<"Warning: no osg::Light attached to ogUtil::SceneView to provide sky light.*/"<<std::endl;
break;
default:
break;
@@ -1392,13 +1392,13 @@ void SceneView::draw()
_renderStageRight->draw(_renderInfo,previous);
glDisable(GL_STENCIL_TEST);
#else
osg::notify(osg::NOTICE)<<"Warning: SceneView::draw() - VERTICAL_INTERLACE, HORIZONTAL_INTERLACE, and CHECKERBOARD stereo not supported."<<std::endl;
OSG_NOTICE<<"Warning: SceneView::draw() - VERTICAL_INTERLACE, HORIZONTAL_INTERLACE, and CHECKERBOARD stereo not supported."<<std::endl;
#endif
}
break;
default:
{
osg::notify(osg::NOTICE)<<"Warning: stereo mode not implemented yet."<< std::endl;
OSG_NOTICE<<"Warning: stereo mode not implemented yet."<< std::endl;
}
break;
}
@@ -1466,7 +1466,7 @@ void SceneView::draw()
bom->reportStats();
#endif
// osg::notify(osg::NOTICE)<<"SceneView draw() DynamicObjectCount"<<getState()->getDynamicObjectCount()<<std::endl;
// OSG_NOTICE<<"SceneView draw() DynamicObjectCount"<<getState()->getDynamicObjectCount()<<std::endl;
}
@@ -1519,7 +1519,7 @@ const osg::Matrix SceneView::computeMVPW() const
if (getViewport())
matrix.postMult(getViewport()->computeWindowMatrix());
else
osg::notify(osg::WARN)<<"osg::Matrix SceneView::computeMVPW() - error no viewport attached to SceneView, coords will be computed inccorectly."<<std::endl;
OSG_WARN<<"osg::Matrix SceneView::computeMVPW() - error no viewport attached to SceneView, coords will be computed inccorectly."<<std::endl;
return matrix;
}

View File

@@ -270,8 +270,8 @@ osg::StateSet *ShaderGenCache::createStateSet(int stateMask) const
std::string vertstr = vert.str();
std::string fragstr = frag.str();
osg::notify(osg::DEBUG_INFO) << "ShaderGenCache Vertex shader:\n" << vertstr << std::endl;
osg::notify(osg::DEBUG_INFO) << "ShaderGenCache Fragment shader:\n" << fragstr << std::endl;
OSG_DEBUG << "ShaderGenCache Vertex shader:\n" << vertstr << std::endl;
OSG_DEBUG << "ShaderGenCache Fragment shader:\n" << fragstr << std::endl;
program->addShader(new osg::Shader(osg::Shader::VERTEX, vertstr));
program->addShader(new osg::Shader(osg::Shader::FRAGMENT, fragstr));

View File

@@ -93,7 +93,7 @@ public:
if (p1==0 || p2==0)
{
osg::notify(osg::NOTICE)<<"Error computeInterpolatedPoint("<<edge<<",r) p1 and/or p2==0"<<std::endl;
OSG_NOTICE<<"Error computeInterpolatedPoint("<<edge<<",r) p1 and/or p2==0"<<std::endl;
return 0;
}
@@ -154,7 +154,7 @@ public:
{
if (!edge->_p1 || !edge->_p2)
{
osg::notify(osg::NOTICE)<<"Error updateErrorMetricForEdge("<<edge<<") p1 and/or p2==0"<<std::endl;
OSG_NOTICE<<"Error updateErrorMetricForEdge("<<edge<<") p1 and/or p2==0"<<std::endl;
return;
}
@@ -226,14 +226,14 @@ public:
if (edge->getErrorMetric()==FLT_MAX)
{
osg::notify(osg::INFO)<<"collapseMinimumErrorEdge() return false due to edge->getErrorMetric()==FLT_MAX"<<std::endl;
OSG_INFO<<"collapseMinimumErrorEdge() return false due to edge->getErrorMetric()==FLT_MAX"<<std::endl;
return false;
}
osg::ref_ptr<Point> pNew = edge->_proposedPoint.valid()? edge->_proposedPoint.get() : computeInterpolatedPoint(edge,0.5f);
return (collapseEdge(edge,pNew.get()));
}
osg::notify(osg::INFO)<<"collapseMinimumErrorEdge() return false due to _edgeSet.empty()"<<std::endl;
OSG_INFO<<"collapseMinimumErrorEdge() return false due to _edgeSet.empty()"<<std::endl;
return false;
}
@@ -246,14 +246,14 @@ public:
if (edge->getErrorMetric()==FLT_MAX)
{
osg::notify(osg::INFO)<<"divideLongestEdge() return false due to edge->getErrorMetric()==FLT_MAX"<<std::endl;
OSG_INFO<<"divideLongestEdge() return false due to edge->getErrorMetric()==FLT_MAX"<<std::endl;
return false;
}
osg::ref_ptr<Point> pNew = edge->_proposedPoint.valid()? edge->_proposedPoint.get() : computeInterpolatedPoint(edge,0.5f);
return (divideEdge(edge,pNew.get()));
}
osg::notify(osg::INFO)<<"divideLongestEdge() return false due to _edgeSet.empty()"<<std::endl;
OSG_INFO<<"divideLongestEdge() return false due to _edgeSet.empty()"<<std::endl;
return false;
}
@@ -368,7 +368,7 @@ public:
void addTriangle(Triangle* triangle)
{
_triangles.insert(triangle);
// if (_triangles.size()>2) osg::notify(osg::NOTICE)<<"Warning too many triangles ("<<_triangles.size()<<") sharing edge "<<std::endl;
// if (_triangles.size()>2) OSG_NOTICE<<"Warning too many triangles ("<<_triangles.size()<<") sharing edge "<<std::endl;
}
bool isBoundaryEdge() const
@@ -384,7 +384,7 @@ public:
void updateMaxNormalDeviationOnEdgeCollapse()
{
//osg::notify(osg::NOTICE)<<"updateMaxNormalDeviationOnEdgeCollapse()"<<std::endl;
//OSG_NOTICE<<"updateMaxNormalDeviationOnEdgeCollapse()"<<std::endl;
_maximumDeviation = 0.0f;
for(TriangleSet::iterator itr1=_p1->_triangles.begin();
itr1!=_p1->_triangles.end();
@@ -519,7 +519,7 @@ public:
Triangle* addTriangle(unsigned int p1, unsigned int p2, unsigned int p3)
{
//osg::notify(osg::NOTICE)<<"addTriangle("<<p1<<","<<p2<<","<<p3<<")"<<std::endl;
//OSG_NOTICE<<"addTriangle("<<p1<<","<<p2<<","<<p3<<")"<<std::endl;
// detect if triangle is degenerate.
if (p1==p2 || p2==p3 || p1==p3) return 0;
@@ -553,12 +553,12 @@ public:
Triangle* addTriangle(Point* p1, Point* p2, Point* p3)
{
// osg::notify(osg::NOTICE)<<" addTriangle("<<p1<<","<<p2<<","<<p3<<")"<<std::endl;
// OSG_NOTICE<<" addTriangle("<<p1<<","<<p2<<","<<p3<<")"<<std::endl;
// detect if triangle is degenerate.
if (p1==p2 || p2==p3 || p1==p3)
{
// osg::notify(osg::NOTICE)<<" **** addTriangle failed - p1==p2 || p2==p3 || p1==p3"<<std::endl;
// OSG_NOTICE<<" **** addTriangle failed - p1==p2 || p2==p3 || p1==p3"<<std::endl;
return 0;
}
@@ -630,52 +630,52 @@ public:
unsigned int result = 0;
if (!(triangle->_p1))
{
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _p1==NULL"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _p1==NULL"<<std::endl;
++result;
}
else if (triangle->_p1->_triangles.count(triangle)==0)
{
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _p1->_triangles does not contain triangle"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _p1->_triangles does not contain triangle"<<std::endl;
++result;
}
if (!(triangle->_p2))
{
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _p2==NULL"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _p2==NULL"<<std::endl;
++result;
}
else if (triangle->_p2->_triangles.count(triangle)==0)
{
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _p2->_triangles does not contain triangle"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _p2->_triangles does not contain triangle"<<std::endl;
++result;
}
if (!(triangle->_p3))
{
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _p3==NULL"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _p3==NULL"<<std::endl;
++result;
}
else if (triangle->_p3->_triangles.count(triangle)==0)
{
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _p3->_triangles does not contain triangle"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _p3->_triangles does not contain triangle"<<std::endl;
++result;
}
if (testEdge(triangle->_e1.get()))
{
++result;
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _e1 test failed"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _e1 test failed"<<std::endl;
}
if (testEdge(triangle->_e2.get()))
{
++result;
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _e2 test failed"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _e2 test failed"<<std::endl;
}
if (testEdge(triangle->_e3.get()))
{
osg::notify(osg::NOTICE)<<"testTriangle("<<triangle<<") _e3 test failed"<<std::endl;
OSG_NOTICE<<"testTriangle("<<triangle<<") _e3 test failed"<<std::endl;
++result;
}
@@ -696,7 +696,7 @@ public:
Edge* addEdge(Triangle* triangle, Point* p1, Point* p2)
{
// osg::notify(osg::NOTICE)<<" addEdge("<<p1<<","<<p2<<")"<<std::endl;
// OSG_NOTICE<<" addEdge("<<p1<<","<<p2<<")"<<std::endl;
osg::ref_ptr<Edge> edge = new Edge;
if (dereference_check_less(p1, p2))
{
@@ -714,12 +714,12 @@ public:
EdgeSet::iterator itr = _edgeSet.find(edge);
if (itr==_edgeSet.end())
{
// osg::notify(osg::NOTICE)<<" addEdge("<<edge.get()<<") edge->_p1="<<edge->_p1.get()<<" _p2="<<edge->_p2.get()<<std::endl;
// OSG_NOTICE<<" addEdge("<<edge.get()<<") edge->_p1="<<edge->_p1.get()<<" _p2="<<edge->_p2.get()<<std::endl;
_edgeSet.insert(edge);
}
else
{
// osg::notify(osg::NOTICE)<<" reuseEdge("<<edge.get()<<") edge->_p1="<<edge->_p1.get()<<" _p2="<<edge->_p2.get()<<std::endl;
// OSG_NOTICE<<" reuseEdge("<<edge.get()<<") edge->_p1="<<edge->_p1.get()<<" _p2="<<edge->_p2.get()<<std::endl;
edge = *itr;
}
@@ -795,12 +795,12 @@ public:
#ifdef ORIGIANAL_CODE
if (edge->getMaxNormalDeviationOnEdgeCollapse()>1.0)
{
osg::notify(osg::NOTICE)<<"collapseEdge("<<edge<<") refused due to edge->getMaxNormalDeviationOnEdgeCollapse() = "<<edge->getMaxNormalDeviationOnEdgeCollapse()<<std::endl;
OSG_NOTICE<<"collapseEdge("<<edge<<") refused due to edge->getMaxNormalDeviationOnEdgeCollapse() = "<<edge->getMaxNormalDeviationOnEdgeCollapse()<<std::endl;
return false;
}
else
{
//osg::notify(osg::NOTICE)<<"collapseEdge("<<edge<<") edge->getMaxNormalDeviationOnEdgeCollapse() = "<<edge->getMaxNormalDeviationOnEdgeCollapse()<<std::endl;
//OSG_NOTICE<<"collapseEdge("<<edge<<") edge->getMaxNormalDeviationOnEdgeCollapse() = "<<edge->getMaxNormalDeviationOnEdgeCollapse()<<std::endl;
}
#endif
@@ -881,7 +881,7 @@ public:
removeTriangle(const_cast<Triangle*>(titr_p2->get()));
}
//osg::notify(osg::NOTICE)<<" pNew="<<pNew<<"\tedge_p1"<<edge_p1.get()<<"\tedge_p2"<<edge_p2.get()<<std::endl;
//OSG_NOTICE<<" pNew="<<pNew<<"\tedge_p1"<<edge_p1.get()<<"\tedge_p2"<<edge_p2.get()<<std::endl;
// we copy the edge's _triangles and interate the copy of the triangle set to avoid invalidating iterators.
TriangleSet trianglesToRemove = edge->_triangles;
@@ -967,13 +967,13 @@ public:
edges2UpdateErrorMetric.insert(newEdges.begin(), newEdges.end());
// osg::notify(osg::NOTICE)<<"Edges to recalibarate "<<edges2UpdateErrorMetric.size()<<std::endl;
// OSG_NOTICE<<"Edges to recalibarate "<<edges2UpdateErrorMetric.size()<<std::endl;
for(LocalEdgeList::iterator itr=edges2UpdateErrorMetric.begin();
itr!=edges2UpdateErrorMetric.end();
++itr)
{
//osg::notify(osg::NOTICE)<<"updateErrorMetricForEdge("<<itr->get()<<")"<<std::endl;
//OSG_NOTICE<<"updateErrorMetricForEdge("<<itr->get()<<")"<<std::endl;
updateErrorMetricForEdge(const_cast<Edge*>(itr->get()));
}
@@ -983,13 +983,13 @@ public:
bool divideEdge(Edge* edge, Point* pNew)
{
// osg::notify(osg::NOTICE)<<"divideEdge("<<edge<<") before _edgeSet.size()="<<_edgeSet.size()<<" _triangleSet.size()="<<_triangleSet.size()<<std::endl;
// OSG_NOTICE<<"divideEdge("<<edge<<") before _edgeSet.size()="<<_edgeSet.size()<<" _triangleSet.size()="<<_triangleSet.size()<<std::endl;
// first collect the triangles associaged with edges that need deleting
osg::ref_ptr<Edge> keep_edge_locally_referenced_to_prevent_premature_deletion = edge;
TriangleSet triangles = edge->_triangles;
// osg::notify(osg::NOTICE)<<" numTriangles on edges "<<triangles.size()<<std::endl;
// OSG_NOTICE<<" numTriangles on edges "<<triangles.size()<<std::endl;
// unsigned int numTriangles1 = _triangleSet.size();
// unsigned int numBoundaryEdges1 = computeNumBoundaryEdges();
@@ -1028,27 +1028,27 @@ public:
switch(edgeToReplace)
{
case(0): // error, shouldn't get here.
osg::notify(osg::NOTICE)<<"Error EdgeCollapse::divideEdge(Edge*,Point*) passed invalid edge."<<std::endl;
OSG_NOTICE<<"Error EdgeCollapse::divideEdge(Edge*,Point*) passed invalid edge."<<std::endl;
return false;
case(1): // p1, p2
// osg::notify(osg::NOTICE)<<" // p1, p2 "<<std::endl;
// osg::notify(osg::NOTICE)<<" newTri1 = addTriangle(tri->_p1.get(), pNew, tri->_p3.get());"<<std::endl;
// OSG_NOTICE<<" // p1, p2 "<<std::endl;
// OSG_NOTICE<<" newTri1 = addTriangle(tri->_p1.get(), pNew, tri->_p3.get());"<<std::endl;
newTri1 = addTriangle(tri->_p1.get(), pNew, tri->_p3.get());
// osg::notify(osg::NOTICE)<<" newTri2 = addTriangle(pNew, tri->_p2.get(), tri->_p3.get());"<<std::endl;
// OSG_NOTICE<<" newTri2 = addTriangle(pNew, tri->_p2.get(), tri->_p3.get());"<<std::endl;
newTri2 = addTriangle(pNew, tri->_p2.get(), tri->_p3.get());
break;
case(2): // p2, p3
// osg::notify(osg::NOTICE)<<" // p2, p3"<<std::endl;
// osg::notify(osg::NOTICE)<<" newTri1 = addTriangle(tri->_p1.get(), tri->_p2.get(), pNew);"<<std::endl;
// OSG_NOTICE<<" // p2, p3"<<std::endl;
// OSG_NOTICE<<" newTri1 = addTriangle(tri->_p1.get(), tri->_p2.get(), pNew);"<<std::endl;
newTri1 = addTriangle(tri->_p1.get(), tri->_p2.get(), pNew);
//osg::notify(osg::NOTICE)<<" newTri2 = addTriangle(tri->_p1.get(), pNew, tri->_p3.get());"<<std::endl;
//OSG_NOTICE<<" newTri2 = addTriangle(tri->_p1.get(), pNew, tri->_p3.get());"<<std::endl;
newTri2 = addTriangle(tri->_p1.get(), pNew, tri->_p3.get());
break;
case(3): // p3, p1
// osg::notify(osg::NOTICE)<<" // p3, p1"<<std::endl;
// osg::notify(osg::NOTICE)<<" newTri1 = addTriangle(tri->_p1.get(), tri->_p2.get(), pNew);"<<std::endl;
// OSG_NOTICE<<" // p3, p1"<<std::endl;
// OSG_NOTICE<<" newTri1 = addTriangle(tri->_p1.get(), tri->_p2.get(), pNew);"<<std::endl;
newTri1 = addTriangle(tri->_p1.get(), tri->_p2.get(), pNew);
// osg::notify(osg::NOTICE)<<" newTri2 = addTriangle(pNew, tri->_p2.get(), tri->_p3.get());"<<std::endl;
// OSG_NOTICE<<" newTri2 = addTriangle(pNew, tri->_p2.get(), tri->_p3.get());"<<std::endl;
newTri2 = addTriangle(pNew, tri->_p2.get(), tri->_p3.get());
break;
}
@@ -1083,7 +1083,7 @@ public:
itr!=edges2UpdateErrorMetric.end();
++itr)
{
//osg::notify(osg::NOTICE)<<"updateErrorMetricForEdge("<<itr->get()<<")"<<std::endl;
//OSG_NOTICE<<"updateErrorMetricForEdge("<<itr->get()<<")"<<std::endl;
if (itr->valid()) updateErrorMetricForEdge(const_cast<Edge*>(itr->get()));
}
@@ -1091,10 +1091,10 @@ public:
// unsigned int numEdges3 = _edgeSet.size();
// unsigned int numTriangles3 = _triangleSet.size();
// osg::notify(osg::NOTICE)<<" numTriangles1="<<numTriangles1<<" numTriangles2="<<numTriangles2<<" numTriangles3="<<numTriangles3<<std::endl;
// osg::notify(osg::NOTICE)<<" numEdges1="<<numEdges1<<" numEdges2="<<numEdges2<<" numEdges3="<<numEdges3<<std::endl;
// osg::notify(osg::NOTICE)<<" numBoundaryEdges1="<<numBoundaryEdges1<<" numBoundaryEdges2="<<numBoundaryEdges2<<" numBoundaryEdges3="<<numBoundaryEdges3<<std::endl;
// osg::notify(osg::NOTICE)<<"divideEdge("<<edge<<") after _edgeSet.size()="<<_edgeSet.size()<<" _triangleSet.size()="<<_triangleSet.size()<<std::endl;
// OSG_NOTICE<<" numTriangles1="<<numTriangles1<<" numTriangles2="<<numTriangles2<<" numTriangles3="<<numTriangles3<<std::endl;
// OSG_NOTICE<<" numEdges1="<<numEdges1<<" numEdges2="<<numEdges2<<" numEdges3="<<numEdges3<<std::endl;
// OSG_NOTICE<<" numBoundaryEdges1="<<numBoundaryEdges1<<" numBoundaryEdges2="<<numBoundaryEdges2<<" numBoundaryEdges3="<<numBoundaryEdges3<<std::endl;
// OSG_NOTICE<<"divideEdge("<<edge<<") after _edgeSet.size()="<<_edgeSet.size()<<" _triangleSet.size()="<<_triangleSet.size()<<std::endl;
return true;
}
@@ -1109,17 +1109,17 @@ public:
Triangle* triangle = const_cast<Triangle*>(teitr->get());
if (!(triangle->_e1 == edge || triangle->_e2 == edge || triangle->_e3 == edge))
{
osg::notify(osg::NOTICE)<<"testEdge("<<edge<<"). triangle != point back to this edge"<<std::endl;
osg::notify(osg::NOTICE)<<" triangle->_e1=="<<triangle->_e1.get()<<std::endl;
osg::notify(osg::NOTICE)<<" triangle->_e2=="<<triangle->_e2.get()<<std::endl;
osg::notify(osg::NOTICE)<<" triangle->_e3=="<<triangle->_e3.get()<<std::endl;
OSG_NOTICE<<"testEdge("<<edge<<"). triangle != point back to this edge"<<std::endl;
OSG_NOTICE<<" triangle->_e1=="<<triangle->_e1.get()<<std::endl;
OSG_NOTICE<<" triangle->_e2=="<<triangle->_e2.get()<<std::endl;
OSG_NOTICE<<" triangle->_e3=="<<triangle->_e3.get()<<std::endl;
++numErrors;
}
}
if (edge->_triangles.empty())
{
osg::notify(osg::NOTICE)<<"testEdge("<<edge<<")._triangles is empty"<<std::endl;
OSG_NOTICE<<"testEdge("<<edge<<")._triangles is empty"<<std::endl;
++numErrors;
}
return numErrors;
@@ -1161,13 +1161,13 @@ public:
PointSet::iterator itr = _pointSet.find(point);
if (itr==_pointSet.end())
{
//osg::notify(osg::NOTICE)<<" addPoint("<<point.get()<<")"<<std::endl;
//OSG_NOTICE<<" addPoint("<<point.get()<<")"<<std::endl;
_pointSet.insert(point);
}
else
{
point = const_cast<Point*>(itr->get());
//osg::notify(osg::NOTICE)<<" reusePoint("<<point.get()<<")"<<std::endl;
//OSG_NOTICE<<" reusePoint("<<point.get()<<")"<<std::endl;
}
point->_triangles.insert(triangle);
@@ -1202,10 +1202,10 @@ public:
Triangle* triangle = const_cast<Triangle*>(itr->get());
if (!(triangle->_p1 == point || triangle->_p2 == point || triangle->_p3 == point))
{
osg::notify(osg::NOTICE)<<"testPoint("<<point<<") error, triangle "<<triangle<<" does not point back to this point"<<std::endl;
osg::notify(osg::NOTICE)<<" triangle->_p1 "<<triangle->_p1.get()<<std::endl;
osg::notify(osg::NOTICE)<<" triangle->_p2 "<<triangle->_p2.get()<<std::endl;
osg::notify(osg::NOTICE)<<" triangle->_p3 "<<triangle->_p3.get()<<std::endl;
OSG_NOTICE<<"testPoint("<<point<<") error, triangle "<<triangle<<" does not point back to this point"<<std::endl;
OSG_NOTICE<<" triangle->_p1 "<<triangle->_p1.get()<<std::endl;
OSG_NOTICE<<" triangle->_p2 "<<triangle->_p2.get()<<std::endl;
OSG_NOTICE<<" triangle->_p3 "<<triangle->_p3.get()<<std::endl;
++numErrors;
}
}
@@ -1422,7 +1422,7 @@ void EdgeCollapse::setGeometry(osg::Geometry* geometry, const Simplifier::IndexL
if (_geometry->suitableForOptimization())
{
// removing coord indices
osg::notify(osg::INFO)<<"EdgeCollapse::setGeometry(..): Removing attribute indices"<<std::endl;
OSG_INFO<<"EdgeCollapse::setGeometry(..): Removing attribute indices"<<std::endl;
_geometry->copyToAndOptimize(*_geometry);
}
@@ -1430,7 +1430,7 @@ void EdgeCollapse::setGeometry(osg::Geometry* geometry, const Simplifier::IndexL
if (_geometry->containsSharedArrays())
{
// removing coord indices
osg::notify(osg::INFO)<<"EdgeCollapse::setGeometry(..): Duplicate shared arrays"<<std::endl;
OSG_INFO<<"EdgeCollapse::setGeometry(..): Duplicate shared arrays"<<std::endl;
_geometry->duplicateSharedArrays();
}
@@ -1749,7 +1749,7 @@ void Simplifier::simplify(osg::Geometry& geometry)
void Simplifier::simplify(osg::Geometry& geometry, const IndexList& protectedPoints)
{
osg::notify(osg::INFO)<<"++++++++++++++simplifier************"<<std::endl;
OSG_INFO<<"++++++++++++++simplifier************"<<std::endl;
EdgeCollapse ec;
ec.setComputeErrorMetricUsingLength(getSampleRatio()>=1.0);
@@ -1764,10 +1764,10 @@ void Simplifier::simplify(osg::Geometry& geometry, const IndexList& protectedPoi
continueSimplification((*ec._edgeSet.begin())->getErrorMetric() , numOriginalPrimitives, ec._triangleSet.size()) &&
ec.collapseMinimumErrorEdge())
{
//osg::notify(osg::INFO)<<" Collapsed edge ec._triangleSet.size()="<<ec._triangleSet.size()<<" error="<<(*ec._edgeSet.begin())->getErrorMetric()<<" vs "<<getMaximumError()<<std::endl;
//OSG_INFO<<" Collapsed edge ec._triangleSet.size()="<<ec._triangleSet.size()<<" error="<<(*ec._edgeSet.begin())->getErrorMetric()<<" vs "<<getMaximumError()<<std::endl;
}
osg::notify(osg::INFO)<<"******* AFTER EDGE COLLAPSE *********"<<ec._triangleSet.size()<<std::endl;
OSG_INFO<<"******* AFTER EDGE COLLAPSE *********"<<ec._triangleSet.size()<<std::endl;
}
else
{
@@ -1778,24 +1778,24 @@ void Simplifier::simplify(osg::Geometry& geometry, const IndexList& protectedPoi
// ec._triangleSet.size() < targetNumTriangles &&
ec.divideLongestEdge())
{
//osg::notify(osg::INFO)<<" Edge divided ec._triangleSet.size()="<<ec._triangleSet.size()<<" error="<<(*ec._edgeSet.rbegin())->getErrorMetric()<<" vs "<<getMaximumError()<<std::endl;
//OSG_INFO<<" Edge divided ec._triangleSet.size()="<<ec._triangleSet.size()<<" error="<<(*ec._edgeSet.rbegin())->getErrorMetric()<<" vs "<<getMaximumError()<<std::endl;
}
osg::notify(osg::INFO)<<"******* AFTER EDGE DIVIDE *********"<<ec._triangleSet.size()<<std::endl;
OSG_INFO<<"******* AFTER EDGE DIVIDE *********"<<ec._triangleSet.size()<<std::endl;
}
osg::notify(osg::INFO)<<"Number of triangle errors after edge collapse= "<<ec.testAllTriangles()<<std::endl;
osg::notify(osg::INFO)<<"Number of edge errors before edge collapse= "<<ec.testAllEdges()<<std::endl;
osg::notify(osg::INFO)<<"Number of point errors after edge collapse= "<<ec.testAllPoints()<<std::endl;
osg::notify(osg::INFO)<<"Number of triangles= "<<ec._triangleSet.size()<<std::endl;
osg::notify(osg::INFO)<<"Number of points= "<<ec._pointSet.size()<<std::endl;
osg::notify(osg::INFO)<<"Number of edges= "<<ec._edgeSet.size()<<std::endl;
osg::notify(osg::INFO)<<"Number of boundary edges= "<<ec.computeNumBoundaryEdges()<<std::endl;
OSG_INFO<<"Number of triangle errors after edge collapse= "<<ec.testAllTriangles()<<std::endl;
OSG_INFO<<"Number of edge errors before edge collapse= "<<ec.testAllEdges()<<std::endl;
OSG_INFO<<"Number of point errors after edge collapse= "<<ec.testAllPoints()<<std::endl;
OSG_INFO<<"Number of triangles= "<<ec._triangleSet.size()<<std::endl;
OSG_INFO<<"Number of points= "<<ec._pointSet.size()<<std::endl;
OSG_INFO<<"Number of edges= "<<ec._edgeSet.size()<<std::endl;
OSG_INFO<<"Number of boundary edges= "<<ec.computeNumBoundaryEdges()<<std::endl;
if (!ec._edgeSet.empty())
{
osg::notify(osg::INFO)<<std::endl<<"Simplifier, in = "<<numOriginalPrimitives<<"\tout = "<<ec._triangleSet.size()<<"\terror="<<(*ec._edgeSet.begin())->getErrorMetric()<<"\tvs "<<getMaximumError()<<std::endl<<std::endl;
osg::notify(osg::INFO)<< " !ec._edgeSet.empty() = "<<!ec._edgeSet.empty()<<std::endl;
osg::notify(osg::INFO)<< " continueSimplification(,,) = "<<continueSimplification((*ec._edgeSet.begin())->getErrorMetric() , numOriginalPrimitives, ec._triangleSet.size())<<std::endl;
OSG_INFO<<std::endl<<"Simplifier, in = "<<numOriginalPrimitives<<"\tout = "<<ec._triangleSet.size()<<"\terror="<<(*ec._edgeSet.begin())->getErrorMetric()<<"\tvs "<<getMaximumError()<<std::endl<<std::endl;
OSG_INFO<< " !ec._edgeSet.empty() = "<<!ec._edgeSet.empty()<<std::endl;
OSG_INFO<< " continueSimplification(,,) = "<<continueSimplification((*ec._edgeSet.begin())->getErrorMetric() , numOriginalPrimitives, ec._triangleSet.size())<<std::endl;
}
ec.copyBackToGeometry();

View File

@@ -27,7 +27,7 @@ void TangentSpaceGenerator::generate(osg::Geometry *geo, int normal_map_tex_unit
if (geo->suitableForOptimization())
{
// removing coord indices so we don't have to deal with them in the binormal code.
osg::notify(osg::INFO)<<"TangentSpaceGenerator::generate(Geometry*,int): Removing attribute indices"<<std::endl;
OSG_INFO<<"TangentSpaceGenerator::generate(Geometry*,int): Removing attribute indices"<<std::endl;
geo->copyToAndOptimize(*geo);
}
@@ -127,7 +127,7 @@ void TangentSpaceGenerator::generate(osg::Geometry *geo, int normal_map_tex_unit
case osg::PrimitiveSet::LINE_LOOP:
break;
default: osg::notify(osg::WARN) << "Warning: TangentSpaceGenerator: unknown primitive mode " << pset->getMode() << "\n";
default: OSG_WARN << "Warning: TangentSpaceGenerator: unknown primitive mode " << pset->getMode() << "\n";
}
}
@@ -199,7 +199,7 @@ void TangentSpaceGenerator::compute(osg::PrimitiveSet *pset,
break;
default:
osg::notify(osg::WARN) << "Warning: TangentSpaceGenerator: vertex array must be Vec2Array, Vec3Array or Vec4Array" << std::endl;
OSG_WARN << "Warning: TangentSpaceGenerator: vertex array must be Vec2Array, Vec3Array or Vec4Array" << std::endl;
}
osg::Vec3 N1;
@@ -233,7 +233,7 @@ void TangentSpaceGenerator::compute(osg::PrimitiveSet *pset,
break;
default:
osg::notify(osg::WARN) << "Warning: TangentSpaceGenerator: normal array must be Vec2Array, Vec3Array or Vec4Array" << std::endl;
OSG_WARN << "Warning: TangentSpaceGenerator: normal array must be Vec2Array, Vec3Array or Vec4Array" << std::endl;
}
}
@@ -266,7 +266,7 @@ void TangentSpaceGenerator::compute(osg::PrimitiveSet *pset,
break;
default:
osg::notify(osg::WARN) << "Warning: TangentSpaceGenerator: texture coord array must be Vec2Array, Vec3Array or Vec4Array" << std::endl;
OSG_WARN << "Warning: TangentSpaceGenerator: texture coord array must be Vec2Array, Vec3Array or Vec4Array" << std::endl;
}
if(nx){

View File

@@ -30,7 +30,7 @@ Tessellator::Tessellator() :
_index=0;
#ifndef OSG_GLU_AVAILABLE
osg::notify(osg::NOTICE)<<"Warning: gluTesselation not supported."<<std::endl;
OSG_NOTICE<<"Warning: gluTesselation not supported."<<std::endl;
#endif
}
@@ -55,7 +55,7 @@ void Tessellator::beginTessellation()
gluTessBeginPolygon(_tobj,this);
#else
osg::notify(osg::NOTICE)<<"Warning: gluTesselation not supported."<<std::endl;
OSG_NOTICE<<"Warning: gluTesselation not supported."<<std::endl;
#endif
}
@@ -106,7 +106,7 @@ void Tessellator::endTessellation()
if (_errorCode!=0)
{
const GLubyte *estring = gluErrorString((GLenum)_errorCode);
osg::notify(osg::WARN)<<"Tessellation Error: "<<estring<< std::endl;
OSG_WARN<<"Tessellation Error: "<<estring<< std::endl;
}
}
#endif
@@ -445,7 +445,7 @@ void Tessellator::addContour(osg::PrimitiveSet* primitive, osg::Vec3Array* verti
break;
}
default:
osg::notify(osg::NOTICE)<<"Tessellator::addContour(primitive, vertices) : Primitive type "<<primitive->getType()<<" not handled"<<std::endl;
OSG_NOTICE<<"Tessellator::addContour(primitive, vertices) : Primitive type "<<primitive->getType()<<" not handled"<<std::endl;
break;
}
@@ -789,7 +789,7 @@ void Tessellator::collectTessellation(osg::Geometry &geom, unsigned int original
}
}
}
// osg::notify(osg::WARN)<<"Add: "<< iprim << std::endl;
// OSG_WARN<<"Add: "<< iprim << std::endl;
}
iprim++; // GWM Sep 2002 count which normal we should use
}

View File

@@ -225,7 +225,7 @@ void TriStripVisitor::stripify(Geometry& geom)
if (geom.suitableForOptimization())
{
// removing coord indices
osg::notify(osg::INFO)<<"TriStripVisitor::stripify(Geometry&): Removing attribute indices"<<std::endl;
OSG_INFO<<"TriStripVisitor::stripify(Geometry&): Removing attribute indices"<<std::endl;
geom.copyToAndOptimize(geom);
}
@@ -381,13 +381,13 @@ void TriStripVisitor::stripify(Geometry& geom)
float minimum_ratio_of_indices_to_unique_vertices = 1;
float ratio_of_indices_to_unique_vertices = ((float)taf._in_indices.size()/(float)numUnique);
osg::notify(osg::INFO)<<"TriStripVisitor::stripify(Geometry&): Number of indices"<<taf._in_indices.size()<<" numUnique"<< numUnique << std::endl;
osg::notify(osg::INFO)<<"TriStripVisitor::stripify(Geometry&): ratio indices/numUnique"<< ratio_of_indices_to_unique_vertices << std::endl;
OSG_INFO<<"TriStripVisitor::stripify(Geometry&): Number of indices"<<taf._in_indices.size()<<" numUnique"<< numUnique << std::endl;
OSG_INFO<<"TriStripVisitor::stripify(Geometry&): ratio indices/numUnique"<< ratio_of_indices_to_unique_vertices << std::endl;
// only tri strip if there is point in doing so.
if (!taf._in_indices.empty() && ratio_of_indices_to_unique_vertices>=minimum_ratio_of_indices_to_unique_vertices)
{
osg::notify(osg::INFO)<<"TriStripVisitor::stripify(Geometry&): doing tri strip"<< std::endl;
OSG_INFO<<"TriStripVisitor::stripify(Geometry&): doing tri strip"<< std::endl;
unsigned int in_numVertices = 0;
for(triangle_stripper::indices::iterator itr=taf._in_indices.begin();
@@ -412,14 +412,14 @@ void TriStripVisitor::stripify(Geometry& geom)
stripifier.Strip(&outPrimitives);
if (outPrimitives.empty())
{
osg::notify(osg::WARN)<<"Error: TriStripVisitor::stripify(Geometry& geom) failed."<<std::endl;
OSG_WARN<<"Error: TriStripVisitor::stripify(Geometry& geom) failed."<<std::endl;
return;
}
triangle_stripper::primitive_vector::iterator pitr;
if (_generateFourPointPrimitivesQuads)
{
osg::notify(osg::INFO)<<"Collecting all quads"<<std::endl;
OSG_INFO<<"Collecting all quads"<<std::endl;
typedef triangle_stripper::primitive_vector::iterator prim_iterator;
typedef std::multimap<unsigned int,prim_iterator> QuadMap;
@@ -560,7 +560,7 @@ void TriStripVisitor::stripify(Geometry& geom)
}
else
{
osg::notify(osg::INFO)<<"TriStripVisitor::stripify(Geometry&): not doing tri strip *****************"<< std::endl;
OSG_INFO<<"TriStripVisitor::stripify(Geometry&): not doing tri strip *****************"<< std::endl;
}
}