1 // Created on: 1996-02-05
2 // Created by: Jea Yves LEBEY
3 // Copyright (c) 1996-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and / or modify it
9 // under the terms of the GNU Lesser General Public version 2.1 as published
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <TestTopOpe_BOOP.hxx>
18 #include <TopOpeBRep_FacesIntersector.hxx>
19 #include <TopOpeBRep_EdgesIntersector.hxx>
20 #include <TopOpeBRep_ShapeIntersector.hxx>
25 TestTopOpe_BOOP::TestTopOpe_BOOP(const char* keys[],
26 const char* resnamdef) :
31 for (i=0;i<TESTTOPOPE_NKEYS; i++) mykeys[i] = keys[i];
32 myresnamdef = resnamdef;
33 myS1type = myS2type = TopAbs_SHAPE;
34 mynameS1 = ""; mynameS2 = "";
35 myPREPdone = Standard_False;
36 myBOOdone = Standard_False;
38 mylastPREP = -1; mytodoPREP = 999;
43 void TestTopOpe_BOOP::Tinit()
48 Standard_Integer TestTopOpe_BOOP::Tnb() const
53 Standard_Boolean TestTopOpe_BOOP::Tadd(const TCollection_AsciiString& k,const Standard_Integer i,const TCollection_AsciiString& h)
55 if (mycomn + 1 == TESTTOPOPE_NTKEYS) return Standard_False;
56 Standard_Integer r = mycomn++;
63 static TCollection_AsciiString TestTopOpebibi = "";
65 const TCollection_AsciiString& TestTopOpe_BOOP::Tkeys(const Standard_Integer i) const
67 if (i < mycomn ) return mycomk[i];
68 return TestTopOpebibi;
71 const TCollection_AsciiString& TestTopOpe_BOOP::Thelp(const Standard_Integer i) const
73 if (i < mycomn ) return mycomh[i];
74 return TestTopOpebibi;
77 Standard_Integer TestTopOpe_BOOP::Tstep(const TCollection_AsciiString& s) const
79 for (Standard_Integer i = 0; i<mycomn; i++) {
80 if (mycomk[i] == s) return mycomi[i];
85 Operation_t TestTopOpe_BOOP::Operation(const char* key) const
87 if (key == NULL) return BOOP_UND;
89 Operation_t o = BOOP_UND;
90 if (!strcmp(key,mykeys[BOOP_TOPX])) o = BOOP_TOPX;
91 else if (!strcmp(key,mykeys[BOOP_SECC])) o = BOOP_SECC;
92 else if (!strcmp(key,mykeys[BOOP_SECE])) o = BOOP_SECE;
93 else if (!strcmp(key,mykeys[BOOP_SEC])) o = BOOP_SEC;
94 else if (!strcmp(key,mykeys[BOOP_COM])) o = BOOP_COM;
95 else if (!strcmp(key,mykeys[BOOP_C12])) o = BOOP_C12;
96 else if (!strcmp(key,mykeys[BOOP_C21])) o = BOOP_C21;
97 else if (!strcmp(key,mykeys[BOOP_FUS])) o = BOOP_FUS;
102 Standard_Boolean TestTopOpe_BOOP::IsBooope(const char* key) const
104 Operation_t o = Operation(key);
105 Standard_Boolean res = (o == BOOP_SECC || o == BOOP_SECE || o == BOOP_SEC ||
106 o == BOOP_C12 || o == BOOP_C21 || o == BOOP_COM || o == BOOP_FUS);
110 void TestTopOpe_BOOP::SetCurrentHB(const Handle(TopOpeBRepBuild_HBuilder)& HB) {myHB = HB;}
111 void TestTopOpe_BOOP::SetCurrentHDS(const Handle(TopOpeBRepDS_HDataStructure)& HDS) {myHDS = HDS;}
112 void TestTopOpe_BOOP::SetShape1(const TopoDS_Shape& S1)
114 if (S1.IsNull()) { myS1.Nullify(); return;}
115 myS1=S1;myS1type=myS1.ShapeType();
117 void TestTopOpe_BOOP::SetShape2(const TopoDS_Shape& S2)
119 if (S2.IsNull()) { myS2.Nullify(); return;}
120 myS2=S2;myS2type=myS2.ShapeType();
123 Handle(TopOpeBRepBuild_HBuilder)& TestTopOpe_BOOP::ChangeCurrentHB() {return myHB;}
124 Handle(TopOpeBRepDS_HDataStructure)& TestTopOpe_BOOP::ChangeCurrentDS() {return myHDS;}
125 TopoDS_Shape& TestTopOpe_BOOP::ChangeShape1() {return myS1;}
126 TopoDS_Shape& TestTopOpe_BOOP::ChangeShape2() {return myS2;}
127 VarsTopo& TestTopOpe_BOOP::ChangeVarsTopo() { return myVarsTopo; }
128 const TCollection_AsciiString& TestTopOpe_BOOP::nameS1() const {return mynameS1;}
129 const TCollection_AsciiString& TestTopOpe_BOOP::nameS2() const {return mynameS2;}
130 const Handle(TopOpeBRepBuild_HBuilder)& TestTopOpe_BOOP::HBuilder() const { return myHB; }
131 void TestTopOpe_BOOP::SetMode(const Standard_Integer mode){myVarsTopo.SetMode(mode);}
132 Standard_Integer TestTopOpe_BOOP::GetMode() const { return myVarsTopo.GetMode(); }