mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0030493: Draw, ViewerTest - minor improvement of vdisplay command
vdisplay no longer opens BREP file in case if Draw variable is not found. Draw::Get() unused Complain argument has been removed from method definition. Added Draw::GetExisting() and DBRep::GetExisting() commands never performing picking.
This commit is contained in:
@@ -86,18 +86,26 @@ static Standard_Integer DDataStd_PNT (Draw_Interpretor& di,
|
||||
//purpose : Rmdraw (name)
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer DDataStd_Rmdraw (Draw_Interpretor& di,
|
||||
static Standard_Integer DDataStd_Rmdraw (Draw_Interpretor& ,
|
||||
Standard_Integer nb,
|
||||
const char** arg)
|
||||
{
|
||||
if (nb == 2) {
|
||||
Handle(Draw_Drawable3D) D3D;
|
||||
D3D = Draw::Get(arg[1],Standard_True);
|
||||
if (!D3D.IsNull()) dout.RemoveDrawable(D3D);
|
||||
if (nb != 2)
|
||||
{
|
||||
std::cout << "Syntax error: wrong number of arguments\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (Handle(Draw_Drawable3D) D3D = Draw::Get (arg[1]))
|
||||
{
|
||||
dout.RemoveDrawable (D3D);
|
||||
return 0;
|
||||
}
|
||||
di << "DDataStd_Rmdraw : Error : not done\n";
|
||||
return 1;
|
||||
else
|
||||
{
|
||||
std::cout << "Syntax error: variable '" << arg[1] << "' not found\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -347,8 +347,12 @@ static Standard_Integer DDataStd_OpenNode (Draw_Interpretor& di,
|
||||
{
|
||||
if (n < 2) return 1;
|
||||
|
||||
Handle(DDataStd_TreeBrowser) browser =
|
||||
Handle(DDataStd_TreeBrowser)::DownCast (Draw::Get(a[1], Standard_True));
|
||||
Handle(DDataStd_TreeBrowser) browser = Handle(DDataStd_TreeBrowser)::DownCast (Draw::GetExisting (a[1]));
|
||||
if (browser.IsNull())
|
||||
{
|
||||
std::cout << "Syntax error: browser '" << a[1] << "' not found\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
TDF_Label lab;
|
||||
if (n == 3) TDF_Tool::Label(browser->Label().Data(),a[2],lab);
|
||||
|
Reference in New Issue
Block a user