mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0031440: Visualization - Impossible to make common behaviour for multi-selection in viewer
A special mode for the selecting by polygon is added to select only completely overlapping objects. In order to track the sensitives that were included completely by defined polygon, the boundary points of the polygonal frustrum are stored in the variable myBoundaryPoints. If an sensitive intersects with at least one of the frustrums from myFrustums, then checking whether this object intersects with borders using the isIntersectBoundary method; if not, then the sensitive were included completely by defined polygon. Because the polygon can be concave, then to check the sensitive were included completely by defined polygon, it is not enough to check of all its points, it is necessary that the edges of the sensitive do not intersect polygonal frustrum. To do this, for polygonal selection, a call to the Overlaps method for a point was replaced by a call to a segment where necessary. bugs/vis/bug31440: test case added
This commit is contained in:
@@ -7635,12 +7635,7 @@ static Standard_Integer VSelect (Draw_Interpretor& ,
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (toAllowOverlap
|
||||
&& aPnts.Length() != 2)
|
||||
{
|
||||
std::cout << "Syntax error: -allowoverlap key is applied only for rectangle selection\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (toAllowOverlap)
|
||||
{
|
||||
aCtx->MainSelector()->AllowOverlapDetection (toAllowOverlap);
|
||||
@@ -14279,10 +14274,10 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
|
||||
"- 1) single click selection\n"
|
||||
"- 2) selection with rectangle having corners at pixel positions (x1,y1) and (x2,y2)\n"
|
||||
"- 3) selection with polygon having corners in pixel positions (x1,y1), (x2,y2),...,(xn,yn)\n"
|
||||
"- 4) -allowoverlap manages overlap and inclusion detection in rectangular selection.\n"
|
||||
" If the flag is set to 1, both sensitives that were included completely and overlapped partially by defined rectangle will be detected,\n"
|
||||
" otherwise algorithm will chose only fully included sensitives. Default behavior is to detect only full inclusion. "
|
||||
" (partial inclusion - overlap - is not allowed by default)\n"
|
||||
"- 4) -allowoverlap manages overlap and inclusion detection in rectangular and polygonal selection.\n"
|
||||
" If the flag is set to 1, both sensitives that were included completely and overlapped partially by defined \n"
|
||||
" rectangle or polygon will be detected, otherwise algorithm will chose only fully included sensitives.\n"
|
||||
" Default behavior is to detect only full inclusion. (partial inclusion - overlap - is not allowed by default)\n"
|
||||
"- 5) any of these selections with shift button pressed",
|
||||
__FILE__, VSelect, group);
|
||||
theCommands.Add ("vmoveto",
|
||||
|
Reference in New Issue
Block a user