1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

Compare commits

..

1 Commits

Author SHA1 Message Date
vpa
9e5394288d 0026870: Visualization - deactivated selections are not updated after object's re-computation
- update status in SelectMgr_SelectionManager::RecomputeSelection:
  1) is set to full for all selections;
  2) is switched to none only if selection was actually recomputed;
- test case for issue #26870
2015-11-16 16:42:58 +03:00
9 changed files with 54 additions and 185 deletions

View File

@@ -687,6 +687,7 @@ void SelectMgr_SelectionManager::RecomputeSelection (const Handle(SelectMgr_Sele
for(theObject->Init(); theObject->More(); theObject->Next())
{
const Handle(SelectMgr_Selection)& aSelection = theObject->CurrentSelection();
aSelection->UpdateStatus (SelectMgr_TOU_Full);
Standard_Integer aSelMode = aSelection->Mode();
for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next())
@@ -697,10 +698,10 @@ void SelectMgr_SelectionManager::RecomputeSelection (const Handle(SelectMgr_Sele
ClearSelectionStructures (theObject, aSelMode, aCurSelector);
theObject->RecomputePrimitives(aSelMode);
RestoreSelectionStructures (theObject, aSelMode, aCurSelector);
aSelection->UpdateStatus (SelectMgr_TOU_None);
aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
}
}
aSelection->UpdateStatus (SelectMgr_TOU_None);
aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
}
}

View File

@@ -239,7 +239,12 @@ void StepToTopoDS_TranslateFace::Init
// Standard_Boolean fautcoudre =
// ( (NbBnd == 2) && (GeomSurf->IsUClosed() || GeomSurf->IsVClosed()) );
Standard_Boolean isExistOuter = Standard_False;
for (Standard_Integer i = 1; i <= NbBnd; i++) {
FaceBound = FS->BoundsValue(i);
if (FaceBound->IsKind(STANDARD_TYPE(StepShape_FaceOuterBound)))
isExistOuter = Standard_True;
}
for (Standard_Integer i = 1; i <= NbBnd; i ++) {
#ifdef OCCT_DEBUG
@@ -263,14 +268,13 @@ void StepToTopoDS_TranslateFace::Init
if (GeomSurf->IsKind (STANDARD_TYPE(Geom_SphericalSurface)) ||
GeomSurf->IsKind (STANDARD_TYPE(Geom_BSplineSurface)) )
{
if (NbBnd ==1 || FaceBound->IsKind(STANDARD_TYPE(StepShape_FaceOuterBound))) {
if (!isExistOuter || FaceBound->IsKind(STANDARD_TYPE(StepShape_FaceOuterBound))) {
BRepBuilderAPI_MakeFace mf (GeomSurf, Precision());
for (TopoDS_Iterator it(mf); it.More(); it.Next())
B.Add (F, it.Value());
}
continue;
}
}
if (//GeomSurf->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ||

View File

@@ -1,36 +0,0 @@
puts "========"
puts "OCC24593"
puts "========"
puts ""
#################################
# Missing surfaces from STL output
#################################
pload XDE
set refnbfaces 69
stepread [locate_data_file "285330.stp"] a *
renamevar a_1 result
#1
vinit
vsetdispmode 1
vdisplay result
vfit
vdump ${imagedir}/${casename}.png
#2
set log1 [explode result f]
set nbfaces [llength $log1]
#3
set log2 [tricheck result]
if { $nbfaces != $refnbfaces } {
puts "Error : Shape restored incorrectly - number of faces is different than expected value ($nbfaces != $refnbfaces)"
}
if { [llength $log2] != 0 } {
puts "Error : Some faces has failed to mesh"
}

View File

@@ -1,36 +0,0 @@
puts "========"
puts "OCC24593"
puts "========"
puts ""
#################################
# Missing surfaces from STL output
#################################
pload XDE
set refnbfaces 23
stepread [locate_data_file "281946.stp"] a *
renamevar a_1 result
#1
vinit
vsetdispmode 1
vdisplay result
vfit
vdump ${imagedir}/${casename}.png
#2
set log1 [explode result f]
set nbfaces [llength $log1]
#3
set log2 [tricheck result]
if { $nbfaces != $refnbfaces } {
puts "Error : Shape restored incorrectly - number of faces is different than expected value ($nbfaces != $refnbfaces)"
}
if { [llength $log2] != 0 } {
puts "Error : Some faces has failed to mesh"
}

View File

@@ -1,36 +0,0 @@
puts "========"
puts "OCC25045"
puts "========"
puts ""
#################################
# STEP Import fails to find all surfaces
#################################
pload XDE
set refnbfaces 22
stepread [locate_data_file "284965.stp"] a *
renamevar a_1 result
#1
vinit
vsetdispmode 1
vdisplay result
vfit
vdump ${imagedir}/${casename}.png
#2
set log1 [explode result f]
set nbfaces [llength $log1]
#3
set log2 [tricheck result]
if { $nbfaces != $refnbfaces } {
puts "Error : Shape restored incorrectly - number of faces is different than expected value ($nbfaces != $refnbfaces)"
}
if { [llength $log2] != 0 } {
puts "Error : Some faces has failed to mesh"
}

View File

@@ -1,37 +0,0 @@
puts "========"
puts "OCC25045"
puts "========"
puts ""
#################################
# STEP Import fails to find all surfaces
#################################
pload XDE
set refnbfaces 13
stepread [locate_data_file "ICK 0433.STP"] a *
renamevar a_1 result
#1
vinit
vsetdispmode 1
vbottom
vdisplay result
vfit
vdump ${imagedir}/${casename}.png
#2
set log1 [explode result f]
set nbfaces [llength $log1]
#3
set log2 [tricheck result]
if { $nbfaces != $refnbfaces } {
puts "Error : Shape restored incorrectly - number of faces is different than expected value ($nbfaces != $refnbfaces)"
}
if { [llength $log2] != 0 } {
puts "Error : Some faces has failed to mesh"
}

View File

@@ -1,29 +0,0 @@
puts "================"
puts "OCC24595"
puts "================"
puts ""
#######################################################################################
# STEP import missing surfaces
#######################################################################################
set BugNumber OCC24595
stepread [locate_data_file bug24595_281390.stp] a *
explode a_1 f
set mlog [nbshapes a_1_3]
set status 1
if (![regexp {WIRE[ ]+: 1} $mlog]) {
set status 0
}
set mlog [bounding a_1_3]
if (![regexp {(-7.26623440743389) (-8.0984932752388978) (-150.09849327523889) (7.2662344074338865) (8.0984932752388978) (-141.90150672476111)} $mlog]) {
set status 0
}
if {$status == 1} {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}

37
tests/bugs/vis/bug26870 Normal file
View File

@@ -0,0 +1,37 @@
puts "============"
puts "CR26870"
puts "============"
puts ""
##########################################################################################
puts "Visualization - deactivated selections are not updated after object's re-computation"
##########################################################################################
pload VISUALIZATION MODELING
vinit
box b 1 1 1
vdisplay b
vfit
vselmode b 2 1
vselmode b 4 1
vselmode b 4 0
box b 3 3 3
vdisplay b
vfit
vselmode 4 1
# pick a point onto previously computed face
vmoveto 80 265
if {[vreadpixel 90 206 name] == "CYAN1 1"} {
puts "ERROR: previously computed entities are highlighted! Selection mode 4 was not updated after redisplaying the box."
}
# pick a point onto box
if {[vreadpixel 29 216 name] == "YELLOW 1"} {
puts "ERROR: the box's face is not highlighted! Selection mode 4 was not updated after redisplaying the box."
}
set only_screen 1

View File

@@ -1,13 +1,14 @@
# !!!! This file is generated automatically, do not edit manually! See end script
set filename trj9_b2-ai-214.stp
set ref_data {
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
TPSTAT : Faulties = 0 ( 0 ) Warnings = 7 ( 38 ) Summary = 7 ( 38 )
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
NBSHAPES : Solid = 1 ( 1 ) Shell = 1 ( 1 ) Face = 221 ( 221 ) Summary = 1460 ( 1459 )
STATSHAPE : Solid = 1 ( 1 ) Shell = 1 ( 1 ) Face = 221 ( 221 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 608 ( 608 )
TOLERANCE : MaxTol = 0.004950137219 ( 0.004950137216 ) AvgTol = 0.0003566630364 ( 0.0003615446964 )
TPSTAT : Faulties = 0 ( 0 ) Warnings = 8 ( 38 ) Summary = 8 ( 38 )
CHECKSHAPE : Wires = 1 ( 1 ) Faces = 1 ( 1 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
NBSHAPES : Solid = 1 ( 1 ) Shell = 1 ( 1 ) Face = 221 ( 221 ) Summary = 1465 ( 1463 )
STATSHAPE : Solid = 1 ( 1 ) Shell = 1 ( 1 ) Face = 221 ( 221 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 610 ( 610 )
TOLERANCE : MaxTol = 0.004950186716 ( 0.004950186717 ) AvgTol = 0.0003553188051 ( 0.0003621212346 )
LABELS : N0Labels = 1 ( 1 ) N1Labels = 0 ( 0 ) N2Labels = 0 ( 0 ) TotalLabels = 1 ( 1 ) NameLabels = 1 ( 1 ) ColorLabels = 1 ( 1 ) LayerLabels = 0 ( 0 )
PROPS : Centroid = 1 ( 1 ) Volume = 1 ( 1 ) Area = 1 ( 1 )
NCOLORS : NColors = 1 ( 1 )