mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-16 10:54:53 +03:00
0026959: Visualization - cannot select edge of the shape
- polygonal representation of the edge is used for sensitive entity computation regardless of requested deflection; - test case for issue #26959 Adjusting test case
This commit is contained in:
parent
47e3009da9
commit
3667907665
@ -323,21 +323,13 @@ void StdSelect_BRepSelectionTool
|
|||||||
// Function: GetPointsFromPolygon
|
// Function: GetPointsFromPolygon
|
||||||
// Purpose :
|
// Purpose :
|
||||||
//==================================================
|
//==================================================
|
||||||
static Handle(TColgp_HArray1OfPnt) GetPointsFromPolygon (const TopoDS_Edge& theEdge,
|
static Handle(TColgp_HArray1OfPnt) GetPointsFromPolygon (const TopoDS_Edge& theEdge)
|
||||||
const Standard_Real theDeflection)
|
|
||||||
{
|
{
|
||||||
Handle(TColgp_HArray1OfPnt) aResultPoints;
|
Handle(TColgp_HArray1OfPnt) aResultPoints;
|
||||||
|
|
||||||
Standard_Real fi, la;
|
|
||||||
Handle(Geom_Curve) CC3d = BRep_Tool::Curve (theEdge, fi, la);
|
|
||||||
|
|
||||||
TopLoc_Location aLocation;
|
TopLoc_Location aLocation;
|
||||||
Handle(Poly_Polygon3D) aPolygon = BRep_Tool::Polygon3D (theEdge, aLocation);
|
Handle(Poly_Polygon3D) aPolygon = BRep_Tool::Polygon3D (theEdge, aLocation);
|
||||||
if (!aPolygon.IsNull())
|
if (!aPolygon.IsNull())
|
||||||
{
|
|
||||||
Standard_Boolean isOK = aPolygon->Deflection() <= theDeflection;
|
|
||||||
isOK = isOK || (CC3d.IsNull());
|
|
||||||
if (isOK)
|
|
||||||
{
|
{
|
||||||
const TColgp_Array1OfPnt& aNodes = aPolygon->Nodes();
|
const TColgp_Array1OfPnt& aNodes = aPolygon->Nodes();
|
||||||
aResultPoints = new TColgp_HArray1OfPnt (1, aNodes.Length());
|
aResultPoints = new TColgp_HArray1OfPnt (1, aNodes.Length());
|
||||||
@ -357,16 +349,11 @@ static Handle(TColgp_HArray1OfPnt) GetPointsFromPolygon (const TopoDS_Edge& theE
|
|||||||
}
|
}
|
||||||
return aResultPoints;
|
return aResultPoints;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Handle(Poly_Triangulation) aTriangulation;
|
Handle(Poly_Triangulation) aTriangulation;
|
||||||
Handle(Poly_PolygonOnTriangulation) anHIndices;
|
Handle(Poly_PolygonOnTriangulation) anHIndices;
|
||||||
BRep_Tool::PolygonOnTriangulation (theEdge, anHIndices, aTriangulation, aLocation);
|
BRep_Tool::PolygonOnTriangulation (theEdge, anHIndices, aTriangulation, aLocation);
|
||||||
if (!anHIndices.IsNull())
|
if (!anHIndices.IsNull())
|
||||||
{
|
|
||||||
Standard_Boolean isOK = anHIndices->Deflection() <= theDeflection;
|
|
||||||
isOK = isOK || (CC3d.IsNull());
|
|
||||||
if (isOK)
|
|
||||||
{
|
{
|
||||||
const TColStd_Array1OfInteger& anIndices = anHIndices->Nodes();
|
const TColStd_Array1OfInteger& anIndices = anHIndices->Nodes();
|
||||||
const TColgp_Array1OfPnt& aNodes = aTriangulation->Nodes();
|
const TColgp_Array1OfPnt& aNodes = aTriangulation->Nodes();
|
||||||
@ -389,7 +376,6 @@ static Handle(TColgp_HArray1OfPnt) GetPointsFromPolygon (const TopoDS_Edge& theE
|
|||||||
}
|
}
|
||||||
return aResultPoints;
|
return aResultPoints;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return aResultPoints;
|
return aResultPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +460,7 @@ void StdSelect_BRepSelectionTool
|
|||||||
}
|
}
|
||||||
|
|
||||||
// try to get points from existing polygons
|
// try to get points from existing polygons
|
||||||
Handle(TColgp_HArray1OfPnt) aPoints = GetPointsFromPolygon (anEdge, theDeflection);
|
Handle(TColgp_HArray1OfPnt) aPoints = GetPointsFromPolygon (anEdge);
|
||||||
if (!aPoints.IsNull() && aPoints->Length() > 0)
|
if (!aPoints.IsNull() && aPoints->Length() > 0)
|
||||||
{
|
{
|
||||||
theSensitive = new Select3D_SensitiveCurve (theOwner, aPoints);
|
theSensitive = new Select3D_SensitiveCurve (theOwner, aPoints);
|
||||||
|
@ -28,7 +28,7 @@ set y_edge_new 240
|
|||||||
|
|
||||||
set x_wire_obj 298
|
set x_wire_obj 298
|
||||||
set y_wire_obj 209
|
set y_wire_obj 209
|
||||||
set x_wire_new 55
|
set x_wire_new 56
|
||||||
set y_wire_new 236
|
set y_wire_new 236
|
||||||
|
|
||||||
set x_face_obj 169
|
set x_face_obj 169
|
||||||
|
31
tests/bugs/vis/bug26959
Normal file
31
tests/bugs/vis/bug26959
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR26959"
|
||||||
|
puts "Visualization - cannot select edge of the shape"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload VISUALIZATION MODELING
|
||||||
|
|
||||||
|
restore [locate_data_file bug26959.brep] aFace
|
||||||
|
|
||||||
|
vinit
|
||||||
|
vdisplay aFace
|
||||||
|
fixshape aFace1 aFace
|
||||||
|
|
||||||
|
vremove aFace
|
||||||
|
vdisplay aFace1
|
||||||
|
vaspects aFace1 -setWidth 3
|
||||||
|
vselmode aFace1 2 1
|
||||||
|
|
||||||
|
vfit
|
||||||
|
|
||||||
|
vmoveto 142 127
|
||||||
|
if {[vreadpixel 142 127 name] == "CYAN1 1"} {
|
||||||
|
puts "OK"
|
||||||
|
} elseif {[vreadpixel 142 127 name] == "GREEN 1"} {
|
||||||
|
puts "ERROR: the upper edge cannot be highlighted!"
|
||||||
|
} else {
|
||||||
|
puts "ERROR: the shape was not displayed correctly!"
|
||||||
|
}
|
||||||
|
|
||||||
|
set only_screen 1
|
Loading…
x
Reference in New Issue
Block a user