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
#include <OSD_Path.hxx>
#include <TDocStd_PathParser.hxx>
-//#include <TPrsStd_AISViewer.hxx>
-//#include <AIS_InteractiveContext.hxx>
-#ifndef WNT
+#include <AIS_InteractiveContext.hxx>
+#include <TPrsStd_AISViewer.hxx>
+#include <ViewerTest.hxx>
+#include <V3d_Viewer.hxx>
+
+#ifndef _WIN32
extern Draw_Viewer dout;
#else
Standard_IMPORT Draw_Viewer dout;
#endif
-extern int ViewerMainLoop (Standard_Integer, const char**);
-#include <ViewerTest_Tool.hxx>
-
//=======================================================================
//function : ListDocuments
//purpose :
return 1;
}
-//=======================================================================
-//function : InitViewer
-//purpose :
-//=======================================================================
-
-// static Standard_Integer DDocStd_InitViewer (Draw_Interpretor& di,
-// Standard_Integer nb,
-// const char** arg)
-// {
-// if (nb == 2) {
-// Handle(TDocStd_Application) A;
-// if (!DDocStd::Find(A)) return 1;
-// Handle(TDocStd_Document) D;
-// if (!DDocStd::GetDocument(arg[1],D)) return 1;
-// Handle(TPrsStd_AISViewer) viewer;
-// if (!TPrsStd_AISViewer::Find (D->Main(),viewer)) {
-// TCollection_AsciiString title;
-// title.Prepend(arg[1]);
-// title.Prepend("_");
-// title.Prepend("Document");
-// Handle(V3d_Viewer) vw = ViewerTest_Tool::MakeViewer (title.ToCString());
-// Handle(AIS_InteractiveContext) IC = new AIS_InteractiveContext(vw);
-// A->SetViewer (D,IC);
-// }
-// ViewerTest_Tool::InitViewerTest (viewer->GetInteractiveContext());
-// return 0;
-// }
-// cout << "DDocStd_InitViewer : Error" << endl;
-// return 1;
-// }
-
-
//=======================================================================
//function : Open
//purpose :
//purpose :
//=======================================================================
-static Standard_Integer DDocStd_Close (Draw_Interpretor& di,
- Standard_Integer nb,
- const char** a)
+static Standard_Integer DDocStd_Close (Draw_Interpretor& /*theDI*/,
+ Standard_Integer theArgNb,
+ const char** theArgVec)
{
- if (nb == 2) {
- Handle(TDocStd_Document) D;
- if (!DDocStd::GetDocument(a[1],D)) return 1;
- Handle(TDocStd_Application) A;
- if (!DDocStd::Find(A)) return 1;
- A->Close(D);
+ if (theArgNb != 2)
+ {
+ std::cout << "DDocStd_Close : Error\n";
+ return 1;
+ }
- Handle(Draw_Drawable3D) DD = Draw::Get(a[1],Standard_False);
- dout.RemoveDrawable (DD);
- Handle(Draw_Drawable3D) aDNull;
- Draw::Set(a[1], aDNull);
- return 0;
+ Handle(TDocStd_Document) aDoc;
+ Standard_CString aDocName = theArgVec[1];
+ if (!DDocStd::GetDocument (aDocName, aDoc))
+ {
+ return 1;
}
- di << "DDocStd_Close : Error" << "\n";
- return 1;
+
+ TDF_Label aRoot = aDoc->GetData()->Root();
+ Handle(TPrsStd_AISViewer) aDocViewer;
+ if (TPrsStd_AISViewer::Find (aRoot, aDocViewer)
+ && !aDocViewer->GetInteractiveContext().IsNull())
+ {
+ Handle(V3d_Viewer) aViewer = aDocViewer->GetInteractiveContext()->CurrentViewer();
+ for (aViewer->InitDefinedViews(); aViewer->MoreDefinedViews(); aViewer->NextDefinedViews())
+ {
+ Handle(V3d_View) aView = aViewer->DefinedView();
+ ViewerTest::RemoveView (aView);
+ }
+ }
+
+ Handle(TDocStd_Application) aDocApp;
+ if (!DDocStd::Find (aDocApp))
+ {
+ return 1;
+ }
+
+ aDocApp->Close (aDoc);
+
+ Handle(Draw_Drawable3D) aDrawable = Draw::Get (aDocName, Standard_False);
+ dout.RemoveDrawable (aDrawable);
+ Draw::Set (theArgVec[1], Handle(Draw_Drawable3D)());
+ return 0;
}
//=======================================================================
const char* g = "DDocStd application commands";
// user application commands
-
-
theCommands.Add("ListDocuments",
"ListDocuments",
__FILE__, DDocStd_ListDocuments, g);
"NewDocument docname format",
__FILE__, DDocStd_NewDocument, g);
- //theCommands.Add("InitViewer",
- // "InitViewer DOC",
- // __FILE__, DDocStd_InitViewer, g);
-
theCommands.Add("Open",
"Open path docname",
__FILE__, DDocStd_Open, g);
theCommands.Add("PrintComments",
"PrintComments Doc",
__FILE__, DDocStd_PrintComments, g);
-
- // active document
-
- //theCommands.Add("Active",
- // "Active [D]",
- // __FILE__, DDocStd_Active, g);
-
}
#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>
#include <DPrsStd.hxx>
-#include <DPrsStd.hxx>
#include <Draw.hxx>
#include <Draw_Appli.hxx>
#include <Draw_Interpretor.hxx>
#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;
}
#include <ShapeFix_Wireframe.hxx>
#include <ShapeBuild_ReShape.hxx>
-#include <ViewerTest_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
//#include <QAModTopOpe_ReShaper.hxx>
static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
- //Handle(AIS_InteractiveContext) context= ViewerTest_Tool::MakeContext ("OCC301");
- //ViewerTest_Tool::InitViewerTest (context);
Handle(AIS_InteractiveContext) context = ViewerTest::GetAISContext();
if(context.IsNull()) {
di << "use 'vinit' command before " << argv[0] << "\n";
#include <AIS_Trihedron.hxx>
#include <Geom_Axis2Placement.hxx>
#include <V3d_View.hxx>
-#include <ViewerTest_Tool.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <AIS_LengthDimension.hxx>
#include <AIS_RadiusDimension.hxx>
#include <AIS_InteractiveContext.hxx>
#include <ViewerTest.hxx>
#include <AIS_Shape.hxx>
-#include <TopoDS_Shape.hxx>
-#include <ViewerTest_Tool.hxx>
-#include <V3d_Viewer.hxx>
-#include <V3d_View.hxx>
-
-#include <ViewerTest_Tool.hxx>
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
#include <PCollection_HExtendedString.hxx>
#define DEFAULT_COLOR Quantity_NOC_GOLDENROD
-static Standard_Integer BUC60851 (Draw_Interpretor& /*di*/, Standard_Integer /*argc*/, const char ** /*argv*/)
-{
- Handle(AIS_InteractiveContext) context= ViewerTest_Tool::MakeContext ("buc60851");
- ViewerTest_Tool::InitViewerTest (context);
- Handle(V3d_Viewer) aV3dViewer= context->CurrentViewer();
- Handle(V3d_View) aV3d_View = aV3dViewer->ActiveView();
- for (Standard_Integer i=0;i<1000;++i) {
- aV3d_View->TriedronDisplay();
- aV3d_View->TriedronErase();
- }
- aV3d_View->TriedronDisplay();
-
- return 0;
-}
-
static Standard_Integer OCC216 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/)
{
Handle(PCollection_HExtendedString) HExtendedString = new PCollection_HExtendedString("");
void QABugs::Commands_18(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
- theCommands.Add("BUC60851", "BUC60851", __FILE__, BUC60851, group);
theCommands.Add("OCC216", "OCC216", __FILE__, OCC216, group);
theCommands.Add("OCC267", "OCC267 DOC path", __FILE__, OCC267, group);
theCommands.Add("OCC181", "OCC181 FileName path1 path2 verbose=0/1", __FILE__, OCC181, group);
is
- class Tool;
- ---Purpose: to build a context and set a given context as current
- -- for ViewerTest.
-
-
-
class EventManager;
---Purpose: used to manage mouse event (move,select,shiftselect)
-- By default the events are transmitted to interactive context.
GetCurrentViewName returns AsciiString from TCollection;
---Category: Delete the viewer....
- RemoveView (theViewName:AsciiString from TCollection;
- isContextRemoved:Boolean from Standard= Standard_True);
+ RemoveView (theViewName : AsciiString from TCollection;
+ theToRemoveContext : Boolean from Standard = Standard_True);
+ ---Purpose: Removes view and clear all maps
+ -- with information about its resources if neccessary
+
+ ---Category: Delete the viewer....
+ RemoveView (theView : View from V3d;
+ theToRemoveContext : Boolean from Standard = Standard_True);
---Purpose: Removes view and clear all maps
-- with information about its resources if neccessary
#include <Font_NameOfFont.hxx>
#include <Visual3d_ViewManager.hxx>
-#include <ViewerTest_Tool.ixx>
#include <Standard_DefineHandle.hxx>
+++ /dev/null
--- Created on: 1998-10-15
--- Created by: Denis PASCAL
--- Copyright (c) 1998-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class Tool from ViewerTest
-
- ---Purpose: to build and initialize ViewerTest static variables.
- -- ====================================================
-
-uses Viewer from V3d,
- InteractiveContext from AIS
-
-
-is
-
- MakeViewer (myclass; title : CString from Standard)
- ---Purpose: create a new <context>. ViewerTest variables are not initialized;
- returns Viewer from V3d;
-
- MakeContext (myclass; title : CString from Standard)
- ---Purpose: create a new <context>. ViewerTest variables are not initialized;
- returns InteractiveContext from AIS;
-
- InitViewerTest (myclass; current : InteractiveContext from AIS);
- ---Purpose: init variables of ViewerTest with <current>
-
-end Tool;
+++ /dev/null
-// Created on: 1998-10-15
-// Created by: Denis PASCAL
-// Copyright (c) 1998-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifdef WNT
-#include <windows.h>
-#endif
-
-#include <ViewerTest_Tool.ixx>
-
-#include <V3d_View.hxx>
-#include <AIS_InteractiveContext.hxx>
-#include <ViewerTest.hxx>
-#include <string.h>
-#include <Draw_Interpretor.hxx>
-#include <Draw.hxx>
-#include <Draw_Appli.hxx>
-#include <DBRep.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <V3d_Viewer.hxx>
-#include <V3d_View.hxx>
-#include <V3d.hxx>
-#include <AIS_DisplayMode.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <AIS_MapOfInteractive.hxx>
-#include <ViewerTest_DoubleMapOfInteractiveAndName.hxx>
-#include <ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName.hxx>
-#include <ViewerTest_EventManager.hxx>
-#include <Draw_Window.hxx>
-#include <AIS_ListIteratorOfListOfInteractive.hxx>
-#include <AIS_ListOfInteractive.hxx>
-#include <Aspect_Window.hxx>
-#include <Aspect_DisplayConnection.hxx>
-#include <Graphic3d.hxx>
-#include <Graphic3d_GraphicDriver.hxx>
-
-#if defined(_WIN32) || defined(__WIN32__)
-#include <WNT_WClass.hxx>
-#include <WNT_Window.hxx>
-#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
-#include <Cocoa_Window.hxx>
-#else
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <Xw_Window.hxx>
-#endif
-
-//==============================================================================
-// GLOBAL VARIABLES
-//==============================================================================
-#define ZCLIPWIDTH 1.
-
-static Handle(Aspect_DisplayConnection)& GetDisplayConnection()
-{
- static Handle(Aspect_DisplayConnection) aDisplayConnection;
- static Standard_Boolean isFirst = Standard_True;
- if (isFirst)
- {
- aDisplayConnection = new Aspect_DisplayConnection();
- isFirst = Standard_False;
- }
- return aDisplayConnection;
-}
-
-Standard_IMPORT Standard_Boolean Draw_VirtualWindows;
-
-//=======================================================================
-//function : MakeViewer
-//purpose :
-//=======================================================================
-
-Handle(V3d_Viewer) ViewerTest_Tool::MakeViewer (const Standard_CString theTitle)
-{
-#if defined(_WIN32) || defined(__WIN32__)
- Handle(Aspect_Window) window = new WNT_Window (theTitle,
- Handle(WNT_WClass)::DownCast (ViewerTest::WClass()),
- WS_OVERLAPPEDWINDOW, 0, 460, 409, 409, Quantity_NOC_BLACK);
-#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
- Handle(Aspect_Window) window = new Cocoa_Window (theTitle, 0, 460, 409, 409);
-#else
- Handle(Aspect_Window) window = new Xw_Window (GetDisplayConnection(), theTitle, 0, 460, 409, 409);
-#endif
- window->SetVirtual (Draw_VirtualWindows);
- window->Map();
-
- // Viewer
- Handle(Graphic3d_GraphicDriver) aDriver = Graphic3d::InitGraphicDriver (GetDisplayConnection());
- TCollection_ExtendedString NameOfWindow("Visu3D");
- Handle(V3d_Viewer) a3DViewer = new V3d_Viewer(aDriver,NameOfWindow.ToExtString());
-
- a3DViewer->SetDefaultBackgroundColor(Quantity_NOC_BLACK);
- a3DViewer->SetDefaultLights();
- a3DViewer->SetLightOn();
-
- // View
- Handle (V3d_View) V = a3DViewer->CreateView();
- V->SetWindow(window);
- V->SetZClippingDepth(0.5);
- V->SetZClippingWidth(ZCLIPWIDTH/2.);
-
- return a3DViewer;
-}
-
-//=======================================================================
-//function : MakeContext
-//purpose :
-//=======================================================================
-
-Handle(AIS_InteractiveContext) ViewerTest_Tool::MakeContext (const Standard_CString title)
-{
- return new AIS_InteractiveContext (MakeViewer(title));
-}
-
-
-
-//=======================================================================
-//function : InitViewerTest
-//purpose :
-//=======================================================================
-
-// ********* next method is defined in ViewerTest_ViewerCommands.hxx ****
-extern void ViewerTest_InitViewerTest (const Handle(AIS_InteractiveContext)&);
-// **********************************************************************
-
-void ViewerTest_Tool::InitViewerTest (const Handle(AIS_InteractiveContext)& context)
-{
- ViewerTest_InitViewerTest (context);
-}
-
}
}
+//==============================================================================
+//function : RemoveView
+//purpose :
+//==============================================================================
+void ViewerTest::RemoveView (const Handle(V3d_View)& theView,
+ const Standard_Boolean theToRemoveContext)
+{
+ if (!ViewerTest_myViews.IsBound2 (theView))
+ {
+ return;
+ }
+
+ const TCollection_AsciiString aViewName = ViewerTest_myViews.Find2 (theView);
+ RemoveView (aViewName, theToRemoveContext);
+}
+
//==============================================================================
//function : RemoveView
//purpose : Close and remove view from display, clear maps if neccessary
return 0;
}
-//==============================================================================
-//function : InitViewerTest
-//purpose : initialisation de toutes les variables static de ViewerTest (dp)
-//==============================================================================
-
-void ViewerTest_InitViewerTest (const Handle(AIS_InteractiveContext)& theContext)
-{
- Handle(V3d_Viewer) aViewer = theContext->CurrentViewer();
- ViewerTest::SetAISContext(theContext);
- aViewer->InitActiveViews();
- Handle(V3d_View) aView = aViewer->ActiveView();
- if (aViewer->MoreActiveViews()) ViewerTest::CurrentView(aView);
- ViewerTest::ResetEventManager();
- Handle(Aspect_Window) aWindow = aView->Window();
-#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
- // X11
- VT_GetWindow() = Handle(Xw_Window)::DownCast(aWindow);
- OSWindowSetup();
- static int aFirst = 1;
- if ( aFirst ) {
-#if TCL_MAJOR_VERSION < 8
- Tk_CreateFileHandler((void*)XConnectionNumber(GetDisplayConnection()->GetDisplay()),
- TK_READABLE, VProcessEvents, (ClientData) 0);
-#else
- Tk_CreateFileHandler(XConnectionNumber(GetDisplayConnection()->GetDisplay()),
- TK_READABLE, VProcessEvents, (ClientData) 0);
-#endif
- aFirst = 0;
- }
-#endif
-}
-
//==============================================================================
//function : VSetBg
//purpose : Load image as background
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
#include <AIS_InteractiveContext.hxx>
-#include <ViewerTest_Tool.hxx>
+#include <ViewerTest.hxx>
#include <DDF_Browser.hxx>
#include <DDocStd.hxx>
return 1;
}
- Handle(TDocStd_Document) Doc;
- DDocStd::GetDocument(argv[1], Doc);
- if ( Doc.IsNull() ) { di << argv[1] << " is not a document" << "\n"; return 1; }
+ Handle(TDocStd_Document) aDoc;
+ DDocStd::GetDocument (argv[1], aDoc);
+ if (aDoc.IsNull())
+ {
+ std::cout << argv[1] << " is not a document\n";
+ return 1;
+ }
// init viewer
-// char string[260];
-// Sprintf ( string, "AISInitViewer %s", argv[1] );
-// di.Eval ( string );
- TDF_Label acces = Doc->GetData()->Root();
- Handle(TPrsStd_AISViewer) viewer;
- if (!TPrsStd_AISViewer::Find (acces,viewer)) {
- TCollection_AsciiString title;
- title.Prepend(argv[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());
+ TDF_Label aRoot = aDoc->GetData()->Root();
+ Handle(TPrsStd_AISViewer) aDocViewer;
+ TCollection_AsciiString aViewName = TCollection_AsciiString ("Driver1/Document_") + argv[1] + "/View1";
+ if (!TPrsStd_AISViewer::Find (aRoot, aDocViewer))
+ {
+ ViewerTest::ViewerInit (0, 0, 0, 0, aViewName.ToCString(), "");
+ aDocViewer = TPrsStd_AISViewer::New (aRoot, ViewerTest::GetAISContext());
+ }
//szv:CAX-TRJ7 c2-pe-214.stp was clipped
- viewer->GetInteractiveContext()->CurrentViewer()->ActiveView()->SetZSize(ZVIEW_SIZE);
+ aDocViewer->GetInteractiveContext()->CurrentViewer()->InitActiveViews();
+ aDocViewer->GetInteractiveContext()->CurrentViewer()->ActiveView()->SetZSize(ZVIEW_SIZE);
//DDF::ReturnLabel(di,viewer->Label());
// collect sequence of labels to display
- Handle(XCAFDoc_ShapeTool) shapes = XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
+ Handle(XCAFDoc_ShapeTool) shapes = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main());
TDF_LabelSequence seq;
if ( argc >2 ) {
for ( Standard_Integer i=2; i < argc; i++ ) {
TDF_Label aLabel;
- TDF_Tool::Label(Doc->GetData(), argv[i], aLabel);
+ TDF_Tool::Label (aDoc->GetData(), argv[i], aLabel);
if ( aLabel.IsNull() || ! shapes->IsShape ( aLabel ) ) {
di << argv[i] << " is not a valid shape label!";
continue;
// prs->SetColor ( Col.Name() );
prs->Display(Standard_True);
}
- TPrsStd_AISViewer::Update(Doc->GetData()->Root());
+ TPrsStd_AISViewer::Update (aDoc->GetData()->Root());
return 0;
}
Handle(TDocStd_Document) aD1 = new TDocStd_Document("MDTV-XCAF");
aD1->Open(A);
- Handle(V3d_Viewer) vw = ViewerTest_Tool::MakeViewer ("Test viwer");
- Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(vw);
- TPrsStd_AISViewer::New (aD1->Main(),aContext);
+ TCollection_AsciiString aViewName ("Driver1/DummyDocument/View1");
+ ViewerTest::ViewerInit (0, 0, 0, 0, aViewName.ToCString(), "");
+ TPrsStd_AISViewer::New (aD1->GetData()->Root(), ViewerTest::GetAISContext());
+
// get shape tool for shape verification
Handle(XCAFDoc_ShapeTool) aShapes =
XCAFDoc_DocumentTool::ShapeTool (aD1->Main());
if( aLab.FindAttribute(TPrsStd_AISPresentation::GetID(), prs) )
prs->Display();
-
TPrsStd_AISViewer::Update(aLab);
- aContext->Display(aTriShape, Standard_True);
+ ViewerTest::GetAISContext()->Display (aTriShape, Standard_True);
aD1->BeforeClose();
aD1->Close();
+ ViewerTest::RemoveView (aViewName);
return 0;
}
+++ /dev/null
-
-puts "============="
-puts "BUC60851"
-puts "============="
-puts ""
-##########################################################
-## After several manipulations with Triedron of V3d_View class it raises an exception
-## (detected in method Visual3d_View::TriedronDisplay)
-##########################################################
-
-BUC60851
-vfit
-
-set only_screen 1
--- /dev/null
+puts "============"
+puts "OCC24430"
+puts "============"
+puts ""
+#######################################################################################
+# vviewlist draw command does not added name of viewer created by XShow draw command
+#######################################################################################
+
+pload DCAF
+NewDocument D XmlXCAF
+ReadIges D [locate_data_file bug23921_case2.igs]
+
+XShow D
+set info [vviewlist long]
+if { $info == "" } {
+ puts "Error: viewer name was not added"
+} else {
+ puts "OK: viewer name was added"
+}
+
+set only_screen 1