0022972: Eliminate macro definitions that has compiler-provided analogs (WNT and...
[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
42cf5bc1 17
18#include <BOPTest.hxx>
7fd59977 19#include <Draw_Interpretor.hxx>
20#include <Draw_PluginMacro.hxx>
7da5f7b1 21#include <SWDRAW.hxx>
42cf5bc1 22#include <TestTopOpe.hxx>
23#include <TestTopOpe_BOOP.hxx>
24#include <TestTopOpe_HDSDisplayer.hxx>
25#include <TestTopOpeDraw.hxx>
26#include <TestTopOpeTools.hxx>
27#include <TopoDS_Shape.hxx>
28#include <TopOpeBRepBuild_HBuilder.hxx>
29#include <TopOpeBRepDS_DSX.hxx>
30#include <TopOpeBRepDS_Dumper.hxx>
31#include <TopOpeBRepDS_HDataStructure.hxx>
32
57c28b61 33#ifdef _MSC_VER
7fd59977 34#pragma warning(4:4190)
35#endif
36
37//=======================================================================
38//function : AllCommands
39//purpose :
40//=======================================================================
41
42void TestTopOpe::AllCommands(Draw_Interpretor& theCommands)
43{
44 static Standard_Boolean done = Standard_False;
45 if (done) return;
46
47 done = Standard_True;
48
49 TestTopOpe::BOOPCommands(theCommands);
50 TestTopOpe::HDSCommands(theCommands);
51 TestTopOpe::MesureCommands(theCommands);
52 TestTopOpe::CORCommands(theCommands);
302f96fb 53 //TestTopOpe::DSACommands(theCommands);
7fd59977 54 TestTopOpe::OtherCommands(theCommands);
55 TestTopOpeTools::AllCommands(theCommands);
56 TestTopOpeDraw::AllCommands(theCommands);
57}
58
1d0a9d4d 59extern TestTopOpe_HDSDisplayer* PHDSD;
60extern TestTopOpe_BOOP* PBOOP;
7fd59977 61
62//=======================================================================
63//function : Shapes
64//purpose :
65//=======================================================================
66void TestTopOpe::Shapes(const TopoDS_Shape& S1,const TopoDS_Shape& S2)
67{
68 if (PHDSD != NULL) { PHDSD->SetShape1(S1);PHDSD->SetShape2(S2); }
69 if (PBOOP != NULL) { PBOOP->SetShape1(S1);PBOOP->SetShape2(S2); }
0797d9d3 70#ifdef OCCT_DEBUG
7fd59977 71 TopOpeBRepDS_SettraceSPSX_SS(S1,S2);
72#endif
73}
74
75//=======================================================================
76//function : CurrentHDS
77//purpose :
78//=======================================================================
79void TestTopOpe::CurrentDS(const Handle(TopOpeBRepDS_HDataStructure)& HDS)
80{
81 if (PHDSD != NULL) { PHDSD->SetCurrentHDS(HDS); }
82 if (PBOOP != NULL) { PBOOP->SetCurrentHDS(HDS); }
0797d9d3 83#ifdef OCCT_DEBUG
7fd59977 84 TopOpeBRepDS_SettraceSPSX_HDS(HDS);
85#endif
86}
87
0797d9d3 88#ifdef OCCT_DEBUG
7fd59977 89Standard_EXPORT void debloi(const TopOpeBRepDS_ListOfInterference& L)
90{
91 if (PBOOP == NULL) return;
92 TopOpeBRepDS_Dumper DSD(PBOOP->ChangeCurrentDS());
93 DSD.DumpLOI(L,cout,"");
94}
95Standard_EXPORT void debi(const Handle(TopOpeBRepDS_Interference)& I)
96{
97 if (PBOOP == NULL) return;
98 TopOpeBRepDS_Dumper DSD(PBOOP->ChangeCurrentDS());
99 DSD.DumpI(I,cout,"","\n");
100}
101#endif
102
103//=======================================================================
104//function : CurrentHB
105//purpose :
106//=======================================================================
107void TestTopOpe::CurrentHB(const Handle(TopOpeBRepBuild_HBuilder)& HB)
108{
109 if (PBOOP != NULL) { PBOOP->SetCurrentHB(HB); }
110}
111
112//==============================================================================
113// TestTopOpe::Factory
114//==============================================================================
115void TestTopOpe::Factory(Draw_Interpretor& theDI)
116{
117 static Standard_Boolean FactoryDone = Standard_False;
118 if (FactoryDone) return;
119
120 FactoryDone = Standard_True;
121
122 TestTopOpe::AllCommands(theDI);
123
124 BOPTest::Factory(theDI);
125
7da5f7b1 126 SWDRAW::Init (theDI);
127
0797d9d3 128#ifdef OCCT_DEBUG
7fd59977 129 cout << "Draw Plugin : All topological operations kernel commands are loaded" << endl;
130#endif
131}
132// Declare entry point PLUGINFACTORY
133DPLUGIN(TestTopOpe)