mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0025507: Visualization - the method V3d_View::Place() is incorrect
Test was updated Correction of test case for issue CR25507
This commit is contained in:
parent
aa627f0805
commit
49e1a5c7e9
@ -176,7 +176,7 @@ void V3d_View::Place (const Standard_Integer theXp,
|
|||||||
|
|
||||||
Standard_Integer aWinCXp = aWinWidth / 2;
|
Standard_Integer aWinCXp = aWinWidth / 2;
|
||||||
Standard_Integer aWinCYp = aWinHeight / 2;
|
Standard_Integer aWinCYp = aWinHeight / 2;
|
||||||
Pan (aWinCXp - theXp, aWinCYp - theYp, theZoomFactor / Scale());
|
Pan (aWinCXp - theXp, -(aWinCYp - theYp), theZoomFactor / Scale());
|
||||||
}
|
}
|
||||||
|
|
||||||
void V3d_View::Translate(const Standard_Real theLength, const Standard_Boolean theStart) {
|
void V3d_View::Translate(const Standard_Real theLength, const Standard_Boolean theStart) {
|
||||||
|
@ -3011,6 +3011,29 @@ static int VPan( Draw_Interpretor& di, Standard_Integer argc, const char** argv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
//function : VPlace
|
||||||
|
//purpose : Place the point (in pixels) at the center of the window
|
||||||
|
//==============================================================================
|
||||||
|
static int VPlace (Draw_Interpretor& /*theDi*/, Standard_Integer theArgNb, const char** theArgs)
|
||||||
|
{
|
||||||
|
Handle(V3d_View) aView = ViewerTest::CurrentView();
|
||||||
|
if (aView.IsNull())
|
||||||
|
{
|
||||||
|
std::cerr << theArgs[0] << "Error: no active view." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (theArgNb != 3)
|
||||||
|
{
|
||||||
|
std::cerr << theArgs[0] << "Error: invalid number of arguments." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
aView->Place (Draw::Atoi (theArgs[1]), Draw::Atoi (theArgs[2]), aView->Scale());
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
//function : VExport
|
//function : VExport
|
||||||
@ -7506,8 +7529,10 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
|
|||||||
"vhighlightselected [0|1] or vhighlightselected [on|off]: enables/disables highlighting of selected objects.\n"
|
"vhighlightselected [0|1] or vhighlightselected [on|off]: enables/disables highlighting of selected objects.\n"
|
||||||
"Without arguments it shows if highlighting of selected objects is enabled now.",
|
"Without arguments it shows if highlighting of selected objects is enabled now.",
|
||||||
__FILE__,VHighlightSelected,group);
|
__FILE__,VHighlightSelected,group);
|
||||||
|
theCommands.Add ("vplace",
|
||||||
|
"vplace dx dy"
|
||||||
|
"\n\t\t: Places the point (in pixels) at the center of the window",
|
||||||
|
__FILE__, VPlace, group);
|
||||||
theCommands.Add("vxrotate",
|
theCommands.Add("vxrotate",
|
||||||
"vxrotate",
|
"vxrotate",
|
||||||
__FILE__,VXRotate,group);
|
__FILE__,VXRotate,group);
|
||||||
|
25
tests/bugs/vis/bug25507
Normal file
25
tests/bugs/vis/bug25507
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR25507"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Visualization - the method V3d_View::Place() is incorrect
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
vinit View1
|
||||||
|
vsetdispmode 1
|
||||||
|
|
||||||
|
box b1 2 1 1
|
||||||
|
vdisplay b1
|
||||||
|
box b2 1 1 1
|
||||||
|
vdisplay b2
|
||||||
|
vsetlocation b2 5 0 0
|
||||||
|
vfit
|
||||||
|
|
||||||
|
vselect 80 140
|
||||||
|
vplace 80 140
|
||||||
|
|
||||||
|
vmoveto 200 180
|
||||||
|
checkcolor 200 180 0.78 0.55 0.09
|
||||||
|
|
||||||
|
set only_screen 1
|
Loading…
x
Reference in New Issue
Block a user