Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gf] Remove TF_FOR_ALL usage. #3476

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions pxr/base/gf/multiInterval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ GfMultiInterval::GfMultiInterval(const GfInterval &i)

GfMultiInterval::GfMultiInterval(const std::vector<GfInterval> &intervals)
{
TF_FOR_ALL(i, intervals)
Add(*i);
for(const auto& i: intervals)
Add(i);
}

size_t
Expand Down Expand Up @@ -94,8 +94,8 @@ GfMultiInterval::Contains(const GfMultiInterval & s) const
if (s.IsEmpty()) {
return false;
}
TF_FOR_ALL(i, s) {
if (!Contains(*i)) {
for(const auto& i: s) {
if (!Contains(i)) {
return false;
}
}
Expand Down Expand Up @@ -178,8 +178,8 @@ GfMultiInterval::GetContainingInterval( double x ) const
void
GfMultiInterval::Add( const GfMultiInterval &intervals )
{
TF_FOR_ALL(i, intervals)
Add(*i);
for(const auto& i: intervals)
Add(i);
}

void
Expand Down Expand Up @@ -231,8 +231,8 @@ GfMultiInterval::Add( const GfInterval & interval )
void
GfMultiInterval::Remove( const GfMultiInterval &intervals )
{
TF_FOR_ALL(i, intervals)
Remove(*i);
for(const auto& i: intervals)
Remove(i);
}

// Remove interval j from interval at iterator i, inserting new intervals
Expand Down Expand Up @@ -284,16 +284,16 @@ GfMultiInterval::GetComplement() const
{
GfMultiInterval r;
GfInterval workingInterval = GfInterval::GetFullInterval();
TF_FOR_ALL(i, _set) {
for(const auto& i: _set) {
// Insert interval prior to *i.
workingInterval.SetMax( i->GetMin(), !i->IsMinClosed() );
workingInterval.SetMax( i.GetMin(), !i.IsMinClosed() );
if (!workingInterval.IsEmpty()) {
r._set.insert(/* hint */ r._set.end(), workingInterval);
}

// Set up next interval.
workingInterval = GfInterval::GetFullInterval();
workingInterval.SetMin( i->GetMax(), !i->IsMaxClosed() );
workingInterval.SetMin( i.GetMax(), !i.IsMaxClosed() );
}
if (!workingInterval.IsEmpty()) {
r._set.insert(/* hint */ r._set.end(), workingInterval);
Expand Down Expand Up @@ -337,8 +337,8 @@ void
GfMultiInterval::ArithmeticAdd( const GfInterval &i )
{
GfMultiInterval result;
TF_FOR_ALL(it, *this) {
result.Add(*it + i);
for(const auto& it: *this) {
result.Add(it + i);
}

swap(result);
Expand All @@ -349,10 +349,10 @@ operator<<(std::ostream &out, const GfMultiInterval &s)
{
out << "[";
bool first = true;
TF_FOR_ALL(interval, s) {
for(const auto& interval: s) {
if (!first)
out << ", ";
out << Gf_OstreamHelperP(*interval);
out << Gf_OstreamHelperP(interval);
first = false;
}
out << "]";
Expand Down
4 changes: 2 additions & 2 deletions pxr/base/gf/wrapMultiInterval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ _Repr(GfMultiInterval const &self)
if (!self.IsEmpty()) {
r += "[";
int count = 0;
TF_FOR_ALL(i, self) {
for(const auto& i : self) {
if (count)
r += ", ";
r += TfPyRepr(*i);
r += TfPyRepr(i);
count++;
}
r += "]";
Expand Down