本文整理汇总了C++中Part::BndBox方法的典型用法代码示例。如果您正苦于以下问题:C++ Part::BndBox方法的具体用法?C++ Part::BndBox怎么用?C++ Part::BndBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::BndBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestContactSpotProcess
void AspMainTest::TestContactSpotProcess(MainFrame * frame, AspMainTool *tool){
auto unitMap = tool->product->GetUnitMap();
auto view = frame->myViewer;
Standard_Real Gap = 0.5;
Handle_AIS_InteractiveContext context = view->getIC();
if (context->HasOpenedContext())
context->CloseAllContexts();
context->EraseAll(true);
Standard_Integer curLC = context->OpenLocalContext();
for (auto iter = unitMap->begin(); iter != unitMap->end(); iter++){
Part *part = dynamic_cast<Part *>(iter->second);
auto subItr = iter;
for (++subItr; subItr != unitMap->end(); subItr++){
Part *obstacle = dynamic_cast<Part *>(subItr->second);
//==========================================
// Visualise current Parts
context->ClearLocalContext(AIS_ClearMode::AIS_CM_Interactive);
Handle_AIS_Shape shape = tool->mapOfShapes.find(part->GetUri())->second;
context->LocalContext()->Display(shape, AIS_Shaded);
context->SetTransparency(shape, 0.2, false);
shape = tool->mapOfShapes.find(obstacle->GetUri())->second;;
context->LocalContext()->Display(shape, AIS_WireFrame);
view->getView()->Redraw();
//==========================================
if (obstacle->BndBox()->Distance(*part->BndBox()) < Gap)
for (auto &sp : *part){
if (sp.myBox.Distance(*obstacle->BndBox())<Gap)
for (auto &obstSp : *obstacle){
if (sp.myBox.Distance(obstSp.myBox)>Gap)
continue;
//==========================================
// Visualise current surface
context->ClearLocalContext(AIS_ClearMode::AIS_CM_Interactive);
tool->ShowSurface(context, sp);
tool->ShowSurface(context, obstSp);
view->getView()->Redraw();
//==========================================
//==========================================
// Launch function Contact Spot
if (asp::DBGBuilder::NotInContact(sp, obstSp, 1, Gap))
continue;
ContactSpot spot(sp, obstSp, part, obstacle);
if (spot.IsDone()){
//==========================================
auto vecArray1 = spot.getF1ContactAxis();
auto vecArray2 = spot.getF2ContactAxis();
if (vecArray1.size() && vecArray2.size()){
for (auto &dir : vecArray1){
Handle_ISession_Direction axis = new ISession_Direction(dir.Location(), dir.Direction(), 10);
context->LocalContext()->Display(axis, AIS_WireFrame);
}
for (auto &dir : vecArray2){
Handle_ISession_Direction axis = new ISession_Direction(dir.Location(), dir.Direction(), 10);
context->LocalContext()->Display(axis, AIS_WireFrame);
}
view->getView()->Redraw();
}
//}
}
}
}
}
}
context->CloseLocalContext(curLC);
}