本文整理汇总了C++中CGroup::Add方法的典型用法代码示例。如果您正苦于以下问题:C++ CGroup::Add方法的具体用法?C++ CGroup::Add怎么用?C++ CGroup::Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGroup
的用法示例。
在下文中一共展示了CGroup::Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CutShapes
HeeksObj* CShape::CutShapes(std::list<HeeksObj*> &list_in, bool dodelete)
{
if(list_in.front()->GetType() == GroupType)
{
CGroup* group = (CGroup*)list_in.front();
CGroup* newgroup = new CGroup();
group->HEEKSOBJ_OWNER->Add(newgroup,NULL);
std::list<HeeksObj*> children;
HeeksObj* child = group->GetFirstChild();
while(child)
{
children.push_back(child);
child = group->GetNextChild();
}
std::list<HeeksObj*>::iterator iter = children.begin();
while(iter != children.end())
{
std::list<HeeksObj*> newlist;
std::list<HeeksObj*>::const_iterator it = list_in.begin();
while(it!=list_in.end())
{
newlist.push_back(*it);
++it;
}
newlist.pop_front();
newlist.push_front(*iter);
HeeksObj* newshape = CutShapes(newlist,false);
newshape->HEEKSOBJ_OWNER->Remove(newshape);
newgroup->Add(newshape,NULL);
++iter;
}
group->HEEKSOBJ_OWNER->Remove(group);
wxGetApp().Remove(list_in);
return newgroup;
}
// subtract from the first one in the list all the others
std::list<TopoDS_Shape> shapes;
std::list<HeeksObj*> delete_list;
HeeksObj* first_solid = NULL;
for(std::list<HeeksObj*>::const_iterator It = list_in.begin(); It != list_in.end(); It++){
HeeksObj* object = *It;
if(object->GetType() == SolidType)
{
shapes.push_back(((CSolid*)object)->Shape());
if(first_solid == NULL)first_solid = object;
delete_list.push_back(object);
}
else if(object->GetType() == FaceType)
{
shapes.push_back(((CFace*)object)->Face());
if(first_solid == NULL)first_solid = object;
delete_list.push_back(object);
}
}
TopoDS_Shape new_shape;
if(Cut(shapes, new_shape))
{
HeeksObj* new_object = CShape::MakeObject(new_shape, _("Result of Cut Operation"), SOLID_TYPE_UNKNOWN, ((CShape*)first_solid)->m_color, ((CShape*)first_solid)->m_opacity);
wxGetApp().Add(new_object, NULL);
if(dodelete)
{
wxGetApp().Remove(delete_list);
wxGetApp().Repaint();
}
return new_object;
}
return first_solid;
}