mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0024430: vviewlist draw command does not added name of viewer created by XShow draw command
Remove ViewerTest_Tool, keep only one unified way to create viewer using ViewerTest - ViewerTest::ViewerInit(). Remove test case bugs/vis/buc60851 and command BUC60851. Added test case bugs/xde/bug24430
This commit is contained in:
@@ -40,7 +40,6 @@
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <ViewerTest.hxx>
|
||||
#include <ViewerTest_Tool.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
|
@@ -16,7 +16,6 @@
|
||||
|
||||
#include <DPrsStd.hxx>
|
||||
|
||||
#include <DPrsStd.hxx>
|
||||
#include <Draw.hxx>
|
||||
#include <Draw_Appli.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
@@ -29,54 +28,44 @@
|
||||
#include <TDF_ChildIterator.hxx>
|
||||
#include <DDF.hxx>
|
||||
#include <DDocStd.hxx>
|
||||
#include <TDocStd_Document.hxx>
|
||||
#include <ViewerTest.hxx>
|
||||
|
||||
#include <V3d_View.hxx>
|
||||
|
||||
// for AIS
|
||||
|
||||
#include <TPrsStd_AISPresentation.hxx>
|
||||
#include <TPrsStd_AISViewer.hxx>
|
||||
#include <ViewerTest.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <ViewerTest.hxx>
|
||||
#include <ViewerTest_Tool.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
|
||||
|
||||
|
||||
extern int ViewerMainLoop (Standard_Integer, const char**);
|
||||
|
||||
//=======================================================================
|
||||
//function : DPrsStd_AISInitViewer
|
||||
//purpose : AISInitViewer (DOC)
|
||||
//=======================================================================
|
||||
extern void ViewerTest_InitViewerTest (const Handle(AIS_InteractiveContext)&);
|
||||
|
||||
static Standard_Integer DPrsStd_AISInitViewer (Draw_Interpretor& di,
|
||||
Standard_Integer nb,
|
||||
const char** arg)
|
||||
static Standard_Integer DPrsStd_AISInitViewer (Draw_Interpretor& theDI,
|
||||
Standard_Integer theArgNb,
|
||||
const char** theArgVec)
|
||||
{
|
||||
if (nb == 2) {
|
||||
Handle(TDocStd_Document) D;
|
||||
if (!DDocStd::GetDocument(arg[1],D)) return 1;
|
||||
TDF_Label acces = D->GetData()->Root();
|
||||
Handle(TPrsStd_AISViewer) viewer;
|
||||
if (!TPrsStd_AISViewer::Find (acces,viewer)) {
|
||||
TCollection_AsciiString title;
|
||||
title.Prepend(arg[1]);
|
||||
title.Prepend("_");
|
||||
title.Prepend("Document");
|
||||
Handle(V3d_Viewer) vw = ViewerTest_Tool::MakeViewer (title.ToCString());
|
||||
viewer = TPrsStd_AISViewer::New (acces,vw);
|
||||
}
|
||||
ViewerTest_Tool::InitViewerTest (viewer->GetInteractiveContext());
|
||||
DDF::ReturnLabel(di,viewer->Label());
|
||||
return 0;
|
||||
if (theArgNb != 2)
|
||||
{
|
||||
std::cout << "DPrsStd_AISInitViewer : Error\n";
|
||||
return 1;
|
||||
}
|
||||
di << "DPrsStd_AISInitViewer : Error" << "\n";
|
||||
return 1;
|
||||
|
||||
Handle(TDocStd_Document) aDoc;
|
||||
if (!DDocStd::GetDocument (theArgVec[1], aDoc))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
TDF_Label aRoot = aDoc->GetData()->Root();
|
||||
Handle(TPrsStd_AISViewer) aDocViewer;
|
||||
TCollection_AsciiString aViewName = TCollection_AsciiString ("Driver1/Document_") + theArgVec[1] + "/View1";
|
||||
if (!TPrsStd_AISViewer::Find (aRoot, aDocViewer))
|
||||
{
|
||||
ViewerTest::ViewerInit (0, 0, 0, 0, aViewName.ToCString(), "");
|
||||
aDocViewer = TPrsStd_AISViewer::New (aRoot, ViewerTest::GetAISContext());
|
||||
}
|
||||
|
||||
DDF::ReturnLabel (theDI, aDocViewer->Label());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user