Hi,
I have a problem generating point groups, more spcifically, GB_PointGroup. As I add points to the groups, it accumulates such that every new group created contains all the points from the previous groups. Does anyone know why this is happening? What am I missing?
Thanks!
Here's a code fragment:
GB_PointGroup *objPointGrpList;
char grp_name;
// Make 4 groups of 4 points each …
for(int cur_grp = 0; cur_grp < 4; cur_grp++) {
sprintf(grp_name, “group #%d”, cur_grp);
cout << “cur_grp: ” << cur_grp << “\tgrp_name: ” << (const char*)grp_name << endl;
objPointGrpList = gdp->newPointGroup((const char*)grp_name);
objPointGrpList->clearEntries();
for(int cur_point = 0; cur_point < 4; cur_point++) {
cout << “cur_point: ” << cur_point << endl;
ppt = gdp->appendPoint();
objPointGrpList->add(ppt);
ppt->getPos().assign((float)cur_point, (float)0,(float)cur_grp, 1);
}
objPointGrpList->setEntries();
cout << “Number of entries: ” << objPointGrpList->entries() << endl;
}
And here's the output:
cur_grp: 0 grp_name: group #0
cur_point: 0
cur_point: 1
cur_point: 2
cur_point: 3
Number of entries: 4
cur_grp: 1 grp_name: group #1
cur_point: 0
cur_point: 1
cur_point: 2
cur_point: 3
Number of entries: 8
cur_grp: 2 grp_name: group #2
cur_point: 0
cur_point: 1
cur_point: 2
cur_point: 3
Number of entries: 12
cur_grp: 3 grp_name: group #3
cur_point: 0
cur_point: 1
cur_point: 2
cur_point: 3
Number of entries: 16
–Mark
Point Groups
4153 3 1- xiondebra
- Member
- 543 posts
- Joined: July 2005
- Offline
- mtucker
- Staff
- 4517 posts
- Joined: July 2005
- Offline
- xiondebra
- Member
- 543 posts
- Joined: July 2005
- Offline
- xiondebra
- Member
- 543 posts
- Joined: July 2005
- Offline
mtuckerHi Mark!
The function “setEntries” (called in the second last line of your loop) adds all points in the GU_Detail to the group. I'm not sure what you thought this function was for, but clearly there was some confusion on this point
Mark
Thanks for the tip. As with much of the HDK I've learned various methods from the examples, somewhere I found that set of calls and used it for a guide. I needed to get this to work so the Real Flow Import SOP can import multiple RBD objects inside their SD file format.
Yep, removed that function call and it's all good now!
Thanks Mark!
–Mark
========================================================
You are no age between space
You are no age between space
-
- Quick Links