1 // File: TopOpeBRep_Point2d.cxx
2 // Created: Thu Oct 29 09:55:47 1998
3 // Author: Jean Yves LEBEY
4 // <jyl@langdox.paris1.matra-dtv.fr>
7 #include <TopOpeBRepTool_DRAW.hxx>
10 #include <TopOpeBRep_Point2d.ixx>
11 #include <TopOpeBRep_define.hxx>
12 #include <TopOpeBRepDS.hxx>
13 #include <BRep_Tool.hxx>
15 //=======================================================================
16 //function : TopOpeBRep_Point2d
18 //=======================================================================
19 TopOpeBRep_Point2d::TopOpeBRep_Point2d() :
20 myhaspint(Standard_False),
21 myisvertex1(Standard_False),
23 myisvertex2(Standard_False),
25 myispointofsegment(Standard_False),
26 myips1(0),myips2(0),myhasancestors(Standard_False),
27 mystatus(TopOpeBRep_P2DUNK),
29 mykeep(Standard_True),
30 myedgesconfig(TopOpeBRepDS_UNSHGEOMETRY),
35 //=======================================================================
38 //=======================================================================
39 const TopoDS_Vertex& TopOpeBRep_Point2d::Vertex(const Standard_Integer Index) const
41 if (!IsVertex(Index)) Standard_Failure::Raise("TopOpeBRep_Point2d::Vertex");
42 if (Index == 1) return myvertex1;
43 else if (Index == 2) return myvertex2;
44 else Standard_Failure::Raise("TopOpeBRep_Point2d::Vertex");
48 //=======================================================================
49 //function : Transition
51 //=======================================================================
52 const TopOpeBRepDS_Transition& TopOpeBRep_Point2d::Transition(const Standard_Integer Index) const
54 if (Index == 1) return mytransition1;
55 else if (Index == 2) return mytransition2;
56 else Standard_Failure::Raise("TopOpeBRep_Point2d::Transition");
60 //=======================================================================
61 //function : ChangeTransition
63 //=======================================================================
64 TopOpeBRepDS_Transition& TopOpeBRep_Point2d::ChangeTransition(const Standard_Integer Index)
66 if (Index == 1) return mytransition1;
67 else if (Index == 2) return mytransition2;
68 else Standard_Failure::Raise("TopOpeBRep_Point2d::ChangeTransition");
72 //=======================================================================
75 //=======================================================================
76 void TopOpeBRep_Point2d::Dump(const Standard_Integer E1index,const Standard_Integer E2index) const
79 Standard_Real par1 = Parameter(1);
80 Standard_Real par2 = Parameter(2);
82 Standard_Integer index = Index();
83 Standard_Boolean keep = Keep();
84 Standard_Integer sts = Status();
85 Standard_Boolean pos = IsPointOfSegment();
86 Standard_Real tol = Tolerance();
88 const TopOpeBRepDS_Transition& T1 = Transition(1);
89 const TopOpeBRepDS_Transition& T2 = Transition(2);
91 Standard_Boolean isvertex1 = IsVertex(1); TopoDS_Vertex V1; if (isvertex1) V1 = Vertex(1);
92 Standard_Boolean isvertex2 = IsVertex(2); TopoDS_Vertex V2; if (isvertex2) V2 = Vertex(2);
93 Standard_Boolean isvertex = isvertex1 || isvertex2;
95 Standard_Integer ia1,ia2; SegmentAncestors(ia1,ia2);
96 cout<<endl<<"p2d "<<index<<" k="<<keep<<" pos="<<pos;
98 case TopOpeBRep_P2DUNK : cout<<" sts=u";break;
99 case TopOpeBRep_P2DSGF : cout<<" sts=f";break;
100 case TopOpeBRep_P2DSGL : cout<<" sts=l";break;
101 case TopOpeBRep_P2DNEW :
103 cout<<" anc="<<ia1<<","<<ia2;
105 case TopOpeBRep_P2DINT : cout<<" sts=i";break;
107 cout<<" cfg=";TopOpeBRepDS::Print(myedgesconfig,cout);
110 gp_Pnt P3D = Value();
112 cout<<FUN_tool_PRODINP()<<"P"<<Index()<<" "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z()<<"; # tol = "<<tol<<endl;
114 cout<<" on (1) :"; cout<<" vertex(1) : "; cout<<(isvertex1)? 1:0;
115 cout<<" T "<<E1index<<"(1) : "; T1.Dump(cout);
116 cout<<" par(1) = "<<par1;
118 P3D = BRep_Tool::Pnt(V1);
119 cout<<" PV(1) : "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z();
123 cout<<" on (2) :"; cout<<" vertex(2) : "; cout<<(isvertex2)? 1:0;
124 cout<<" T "<<E2index<<"(2) : "; T2.Dump(cout);
125 cout<<" par(2) = "<<par2;
127 P3D = BRep_Tool::Pnt(V2);
128 cout<<" PV(2) : "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z();