Sat, 04/02/2022 - 05:55
Forums:
Hi,
I'm trying to make a rubber band selection feature. But I've found a weird situation.
When I drag all shapes in my view, some specific shapes were not selected. It was Cylinder and Cone
Here is my sample test code. I made 5 functions for creating shapes. Box, Sphere, Cylinder, Cone, Torus. Like below..
Handle(AISShape) CreateBox(double width, double height, double length)
{
TopoDS_Shape shape = BRepPrimAPI_MakeBox(width, height, length).Shape();
return new AIS_Shape(shape);
}
Handle(AISShape) CreateSphere(double radius)
{
TopoDS_Shape shape = BRepPrimAPI_MakeSphere(radius).Shape();
return new AIS_Shape(shape);
}
Handle(AISShape) CreateCylinder(double radius, double height)
{
TopoDS_Shape shape = BRepPrimAPI_MakeCylinder(radius, height).Shape();
return new AIS_Shape(shape);
}
Handle(AISShape) CreateCone(double bottomRadius, double topRadius, double height)
{
TopoDS_Shape shape = BRepPrimAPI_MakeCone(bottomRadius, topRadius, height).Shape();
return new AIS_Shape(shape);
}
Handle(AISShape) CreateTorus(double majorRadius, double minorRadius)
{
TopoDS_Shape shape = BRepPrimAPI_MakeTorus(majorRadius, minorRadius).Shape();
return new AIS_Shape(shape);
}
And for testing, I called the below lines. It should select all shapes in the scene.
Graphic3d_Vec2i minPos(-1000000, -1000000);
Graphic3d_Vec2i maxPos(1000000, 1000000);
context->SelectRectangle(minPos, maxPos, view);
But it selects all shapes except Cylinder and Cone !! Box, Sphere, and Torus were selected correctly. Am I doing wrong something? I'm using the OCCT 7.6.1
Sat, 04/02/2022 - 12:41
You code snippet is incomplete. I'm unable to reproduce the problem - cylinder is selected as expected, so maybe your complete scenario has some different elements.
Tue, 10/22/2024 - 11:45
Hello,
I encountered a similar problem.
If the camera is set to perspective, some types of shapes, like cylinder and cone, and shapes built by boolean operations using such shapes are not selected by rectangle selection. I attached a TCL script to reproduce the problem by modifying a sample in the page https://draw.sview.ru/modeling-solids-primitives/.
I would like to know whether some additional settings are required for the perspective camera option or if it is a bug that needs to be fixed.
Tried OCCT Versions were 7.7.0, 7.8.0, and 7.8.1 on Windows 10; the problem was reproduced on all of them.
Thank you in advance.
Tue, 10/22/2024 - 12:20
Hello.thank toy for sharing. I assume issue is related with: 5
https://tracker.dev.opencascade.org/view.php?id=33664
I will increase priority for the issue! The problem resolved, but solution needs improvements.
Best regards, Dmitrii.