Standard_Integer aWinCXp = aWinWidth / 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) {
}
}
+//==============================================================================
+//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
"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.",
__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",
"vxrotate",
__FILE__,VXRotate,group);
--- /dev/null
+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