0022922: Clean up warnings on uninitialized / unused variables
[occt.git] / src / TopOpeBRep / TopOpeBRep_Point2d.cxx
CommitLineData
7fd59977 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>
5
6#ifdef DRAW
7#include <TopOpeBRepTool_DRAW.hxx>
8#endif
9
10#include <TopOpeBRep_Point2d.ixx>
11#include <TopOpeBRep_define.hxx>
12#include <TopOpeBRepDS.hxx>
13#include <BRep_Tool.hxx>
14
15//=======================================================================
16//function : TopOpeBRep_Point2d
17//purpose :
18//=======================================================================
19TopOpeBRep_Point2d::TopOpeBRep_Point2d() :
20myhaspint(Standard_False),
21myisvertex1(Standard_False),
22myparameter1(0.),
23myisvertex2(Standard_False),
24myparameter2(0.),
25myispointofsegment(Standard_False),
26myips1(0),myips2(0),myhasancestors(Standard_False),
27mystatus(TopOpeBRep_P2DUNK),
28myindex(0),
29mykeep(Standard_True),
30myedgesconfig(TopOpeBRepDS_UNSHGEOMETRY),
31mytolerance(0.)
32{
33}
34
35//=======================================================================
36//function : Vertex
37//purpose :
38//=======================================================================
39const TopoDS_Vertex& TopOpeBRep_Point2d::Vertex(const Standard_Integer Index) const
40{
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");
45 return myvertex1;
46}
47
48//=======================================================================
49//function : Transition
50//purpose :
51//=======================================================================
52const TopOpeBRepDS_Transition& TopOpeBRep_Point2d::Transition(const Standard_Integer Index) const
53{
54 if (Index == 1) return mytransition1;
55 else if (Index == 2) return mytransition2;
56 else Standard_Failure::Raise("TopOpeBRep_Point2d::Transition");
57 return mytransition1;
58}
59
60//=======================================================================
61//function : ChangeTransition
62//purpose :
63//=======================================================================
64TopOpeBRepDS_Transition& TopOpeBRep_Point2d::ChangeTransition(const Standard_Integer Index)
65{
66 if (Index == 1) return mytransition1;
67 else if (Index == 2) return mytransition2;
68 else Standard_Failure::Raise("TopOpeBRep_Point2d::ChangeTransition");
69 return mytransition1;
70}
71
72//=======================================================================
73//function : Dump
74//purpose :
75//=======================================================================
76void TopOpeBRep_Point2d::Dump(const Standard_Integer E1index,const Standard_Integer E2index) const
77{
78#ifdef DEB
79 Standard_Real par1 = Parameter(1);
80 Standard_Real par2 = Parameter(2);
81
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();
87
88 const TopOpeBRepDS_Transition& T1 = Transition(1);
89 const TopOpeBRepDS_Transition& T2 = Transition(2);
90
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);
7fd59977 93
94 Standard_Integer ia1,ia2; SegmentAncestors(ia1,ia2);
95 cout<<endl<<"p2d "<<index<<" k="<<keep<<" pos="<<pos;
96 switch (sts) {
97 case TopOpeBRep_P2DUNK : cout<<" sts=u";break;
98 case TopOpeBRep_P2DSGF : cout<<" sts=f";break;
99 case TopOpeBRep_P2DSGL : cout<<" sts=l";break;
100 case TopOpeBRep_P2DNEW :
101 cout<<" sts=n";
102 cout<<" anc="<<ia1<<","<<ia2;
103 break;
104 case TopOpeBRep_P2DINT : cout<<" sts=i";break;
105 } // switch
106 cout<<" cfg=";TopOpeBRepDS::Print(myedgesconfig,cout);
107 cout<<endl;
108
109 gp_Pnt P3D = Value();
110#ifdef DRAW
111 cout<<FUN_tool_PRODINP()<<"P"<<Index()<<" "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z()<<"; # tol = "<<tol<<endl;
112#endif
113 cout<<" on (1) :"; cout<<" vertex(1) : "; cout<<(isvertex1)? 1:0;
114 cout<<" T "<<E1index<<"(1) : "; T1.Dump(cout);
115 cout<<" par(1) = "<<par1;
116 if (isvertex1) {
117 P3D = BRep_Tool::Pnt(V1);
118 cout<<" PV(1) : "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z();
119 }
120 cout<<endl;
121
122 cout<<" on (2) :"; cout<<" vertex(2) : "; cout<<(isvertex2)? 1:0;
123 cout<<" T "<<E2index<<"(2) : "; T2.Dump(cout);
124 cout<<" par(2) = "<<par2;
125 if (isvertex2) {
126 P3D = BRep_Tool::Pnt(V2);
127 cout<<" PV(2) : "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z();
128 }
129 cout<<endl;
130#endif
131}