-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add remove text3d #2088
Add remove text3d #2088
Conversation
I need to fix the sign comparison warnings. |
14ee053
to
9dbe4e9
Compare
Explaining a little the logic behind what was done just for text3D:
"Special cases":
|
// check all or an individual viewport for a similar id | ||
rens_->InitTraversal (); | ||
rens_->GetNextItem (); //discard first because it's not a renderer for the viewps | ||
for (size_t i = std::max (viewport, 1); rens_->GetNextItem () != NULL; ++i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand how this loop works. Could you please elaborate why initializing i
with this value? Also, why breaking on line 690?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If viewport is 0, you're adding it to all viewport, and since they're numbered incrementally their id numbers will be {1, ..., #existing_viewports}
. If viewport is bigger than 0, then you know the user is specifying the specific viewport id to add the text.
So this means that the ids you will be addressing are either from [1, #viewports] or simply the one specified in viewport, as long as its bigger then 0.
Regarding the break, you only cycle all possible ids when viewport = 0. If the user specified a single id, only that id is to be checked, that's why you break after a single iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation, now makes sense.
I did not test this, but I assume you did.
Yeah. The case I tested had 2 viewports and I tried variants of both the Text 3D oriented and non oriented. The cases were roughly set up as following:
|
This supercedes and closes #2062, and fixes #2049.
I think you can do whatever you want with the text3D in terms of adding and removing (except for adding items with ids finishing in
*
). I tried a number of cases with both text3D overloads.