1b6c71c6f6314d913b028c6653025dbb6a627531
[occt.git] / src / TopOpeBRepTool / TopOpeBRepTool_faulty.cxx
1 // Created on: 1998-11-24
2 // Created by: Xuan PHAM PHU
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22 #include <TopOpeBRepTool_define.hxx>
23 #include <TopOpeBRepTool_EXPORT.hxx>
24 #include <TopOpeBRepTool_2d.hxx>
25 #include <TopExp_Explorer.hxx>
26 #include <BRep_Tool.hxx>
27 #include <GeomAdaptor_Surface.hxx>
28 #include <TopTools_Array1OfShape.hxx>
29 #include <TopoDS.hxx>
30 #include <TopExp.hxx>
31
32 #define M_FORWARD(sta)  (sta == TopAbs_FORWARD)
33 #define M_REVERSED(sta) (sta == TopAbs_REVERSED)
34 #define M_INTERNAL(sta) (sta == TopAbs_INTERNAL)
35 #define M_EXTERNAL(sta) (sta == TopAbs_EXTERNAL)
36
37 #ifdef DRAW
38 #include <TopOpeBRepTool_DRAW.hxx>
39 #endif
40
41 #ifdef DEB
42 extern TopTools_IndexedMapOfShape STATIC_PURGE_mapv;
43 extern TopTools_IndexedMapOfOrientedShape STATIC_PURGE_mapeds;
44 extern Standard_Boolean TopOpeBRepTool_GettracePURGE();
45 Standard_EXPORT void FUN_REINIT()
46 {
47   STATIC_PURGE_mapv.Clear(); STATIC_PURGE_mapeds.Clear();
48 }
49 Standard_EXPORT Standard_Integer FUN_addepc(const TopoDS_Shape& ed,const TopoDS_Shape&)
50 {
51   Standard_Integer ie = STATIC_PURGE_mapeds.Add(ed);
52 #ifdef DRAW
53 //  TCollection_AsciiString aa = TCollection_AsciiString("pc_"); FUN_tool_draw(aa,TopoDS::Edge(ed),TopoDS::Face(f),ie);
54 //  TCollection_AsciiString bb = TCollection_AsciiString("ed_"); FUN_tool_draw(bb,ed,ie);
55 #endif  
56   return ie;
57 }
58
59 Standard_EXPORT Standard_Integer FUN_addcheckepc(const TopoDS_Shape& ed,const TopoDS_Shape& f) {
60   Standard_Integer ie = 0;
61   ie = STATIC_PURGE_mapeds.FindIndex(ed);
62   if (ie == 0) ie = FUN_addepc(ed,f);
63   return ie;
64 }
65 Standard_IMPORT Standard_Integer FUN_adds(const TopoDS_Shape& s);
66
67 Standard_EXPORT void FUN_tool_tori(const TopAbs_Orientation Or)
68 {
69   switch (Or) {
70   case TopAbs_FORWARD:
71     cout<<"FOR";break;
72   case TopAbs_REVERSED:
73     cout<<"REV";break;
74   case TopAbs_INTERNAL:
75     cout<<"INT";break;
76   case TopAbs_EXTERNAL:
77     cout<<"EXT";break;
78   }    
79 }
80 #endif
81
82 Standard_EXPORT void FUN_tool_trace(const Standard_Integer Index)
83 {
84   if (Index == 1) cout <<"FORWARD ";
85   if (Index == 2) cout <<"REVERSED ";
86 }
87 Standard_EXPORT void FUN_tool_trace(const gp_Pnt2d p2d)
88 {
89   cout<<" = ("<<p2d.X()<<" "<<p2d.Y()<<")"<<endl;
90 }