0025266: Debug statements in the source are getting flushed on to the console
[occt.git] / src / TestTopOpe / TestTopOpe.cxx
CommitLineData
b311480e 1// Created on: 1994-10-24
2// Created by: Jean Yves LEBEY
3// Copyright (c) 1994-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <TestTopOpe.ixx>
18#include <TestTopOpeTools.hxx>
19#include <TestTopOpeDraw.hxx>
20#include <TestTopOpe_HDSDisplayer.hxx>
21#include <TestTopOpe_BOOP.hxx>
22#include <TopOpeBRepDS_DSX.hxx>
23#include <TopOpeBRepDS_Dumper.hxx>
24#include <Draw_Interpretor.hxx>
25#include <Draw_PluginMacro.hxx>
26#include <BOPTest.hxx>
7da5f7b1 27#include <SWDRAW.hxx>
7fd59977 28#ifdef WNT
29#pragma warning(4:4190)
30#endif
31
32//=======================================================================
33//function : AllCommands
34//purpose :
35//=======================================================================
36
37void TestTopOpe::AllCommands(Draw_Interpretor& theCommands)
38{
39 static Standard_Boolean done = Standard_False;
40 if (done) return;
41
42 done = Standard_True;
43
44 TestTopOpe::BOOPCommands(theCommands);
45 TestTopOpe::HDSCommands(theCommands);
46 TestTopOpe::MesureCommands(theCommands);
47 TestTopOpe::CORCommands(theCommands);
302f96fb 48 //TestTopOpe::DSACommands(theCommands);
7fd59977 49 TestTopOpe::OtherCommands(theCommands);
50 TestTopOpeTools::AllCommands(theCommands);
51 TestTopOpeDraw::AllCommands(theCommands);
52}
53
1d0a9d4d 54extern TestTopOpe_HDSDisplayer* PHDSD;
55extern TestTopOpe_BOOP* PBOOP;
7fd59977 56
57//=======================================================================
58//function : Shapes
59//purpose :
60//=======================================================================
61void TestTopOpe::Shapes(const TopoDS_Shape& S1,const TopoDS_Shape& S2)
62{
63 if (PHDSD != NULL) { PHDSD->SetShape1(S1);PHDSD->SetShape2(S2); }
64 if (PBOOP != NULL) { PBOOP->SetShape1(S1);PBOOP->SetShape2(S2); }
65#ifdef DEB
66 TopOpeBRepDS_SettraceSPSX_SS(S1,S2);
67#endif
68}
69
70//=======================================================================
71//function : CurrentHDS
72//purpose :
73//=======================================================================
74void TestTopOpe::CurrentDS(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
75{
76 if (PHDSD != NULL) { PHDSD->SetCurrentHDS(HDS); }
77 if (PBOOP != NULL) { PBOOP->SetCurrentHDS(HDS); }
78#ifdef DEB
79 TopOpeBRepDS_SettraceSPSX_HDS(HDS);
80#endif
81}
82
83#ifdef DEB
84Standard_EXPORT void debloi(const TopOpeBRepDS_ListOfInterference& L)
85{
86 if (PBOOP == NULL) return;
87 TopOpeBRepDS_Dumper DSD(PBOOP->ChangeCurrentDS());
88 DSD.DumpLOI(L,cout,"");
89}
90Standard_EXPORT void debi(const Handle(TopOpeBRepDS_Interference)& I)
91{
92 if (PBOOP == NULL) return;
93 TopOpeBRepDS_Dumper DSD(PBOOP->ChangeCurrentDS());
94 DSD.DumpI(I,cout,"","\n");
95}
96#endif
97
98//=======================================================================
99//function : CurrentHB
100//purpose :
101//=======================================================================
102void TestTopOpe::CurrentHB(const Handle(TopOpeBRepBuild_HBuilder)& HB)
103{
104 if (PBOOP != NULL) { PBOOP->SetCurrentHB(HB); }
105}
106
107//==============================================================================
108// TestTopOpe::Factory
109//==============================================================================
110void TestTopOpe::Factory(Draw_Interpretor& theDI)
111{
112 static Standard_Boolean FactoryDone = Standard_False;
113 if (FactoryDone) return;
114
115 FactoryDone = Standard_True;
116
117 TestTopOpe::AllCommands(theDI);
118
119 BOPTest::Factory(theDI);
120
7da5f7b1 121 SWDRAW::Init (theDI);
122
63c629aa 123#ifdef TESTTOPOPE_DEB
7fd59977 124 cout << "Draw Plugin : All topological operations kernel commands are loaded" << endl;
125#endif
126}
127// Declare entry point PLUGINFACTORY
128DPLUGIN(TestTopOpe)