1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-01 10:26:12 +03:00
occt/src/TopOpeBRep/TopOpeBRep_Point2d.cxx
abv 498ce76bde 0024129: Eliminate remaining compiler warnings in MSVC++ 2008 32 bit with warning level 4
List of resolved warnings:

c4063: Aspect.cdl; TObj_Application.cxx; PCDM.cdl; OpenGl_Workspace_5.cxx;
c4100: XDEDRAW.cxx; ViewerTest_ViewerCommands.cxx; TopOpeBRep_FacesFiller_1.cxx; TopClass_Classifier3d.gxx; TDataStd_ReferenceArray.cxx; QABugs_19.cxx; IntPatch_ImpImpIntersection_5.gxx; HLRTopoBRep_DSFiller.cxx; HLRBRep_Data.lxx; DPrsStd_AISPresentationCommands.cxx; BRepMesh_Delaun.cxx;
c4127: BOPTools_AlgoTools2D.cxx; MAT_Mat.gxx; GeomFill_SweepSectionGenerator.cxx; BRepMesh_Delaun.cxx;
c4189: IntCurveSurface_Inter.gxx; IGESToBRep_BRepEntity.cxx; BRepMesh_Delaun.cxx; BRepAlgo_Loop.cxx; IntStart_SearchOnBoundaries_1.gxx;
c4190: Plugin_Macro.hxx;
c4389: Visual3d_View.cxx; TopOpeBRep/TopOpeBRep_vpr.cxx; TDataStd_BooleanArray.cxx; IntPatch_ALine.cxx;
c4701: BRepAlgo.cxx;
c4702: MNaming_NamingRetrievalDriver_1.cxx; MNaming_NamingRetrievalDriver_2.cxx; BRepClass3d_SolidExplorer.cxx;
c4706: TestTopOpe_BOOP.cxx;

Additional fixes:
- old-style declarations of C functions in IGES and STEP parsers
- clean-up of debug code, fixes for building in Debug mode
- in BRepFill_TrimShellCorner.cxx, lines 878-9, wrong use of assignment instead of comparison fixed
- fix for Plugin_Macro reverted; warning 4190 disabled instead
- in IntPatch_ALine.cxx, line 520, wrong comparison of boolean with index fixed
- in InterfaceGraphic_Visual3d.hxx, field IsCustomMatrix made boolean
- in TopOpeBRepBuild_ShapeSet, obsolete (unused) methods removed
2013-09-18 09:13:31 +04:00

149 lines
5.3 KiB
C++
Executable File

// Created on: 1998-10-29
// Created by: Jean Yves LEBEY
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#ifdef DRAW
#include <TopOpeBRepTool_DRAW.hxx>
#endif
#include <TopOpeBRep_Point2d.ixx>
#include <TopOpeBRep_define.hxx>
#include <TopOpeBRepDS.hxx>
#include <BRep_Tool.hxx>
//=======================================================================
//function : TopOpeBRep_Point2d
//purpose :
//=======================================================================
TopOpeBRep_Point2d::TopOpeBRep_Point2d() :
myhaspint(Standard_False),
myisvertex1(Standard_False),
myparameter1(0.),
myisvertex2(Standard_False),
myparameter2(0.),
myispointofsegment(Standard_False),
myips1(0),myips2(0),myhasancestors(Standard_False),
mystatus(TopOpeBRep_P2DUNK),
myindex(0),
mykeep(Standard_True),
myedgesconfig(TopOpeBRepDS_UNSHGEOMETRY),
mytolerance(0.)
{
}
//=======================================================================
//function : Vertex
//purpose :
//=======================================================================
const TopoDS_Vertex& TopOpeBRep_Point2d::Vertex(const Standard_Integer Index) const
{
if (!IsVertex(Index)) Standard_Failure::Raise("TopOpeBRep_Point2d::Vertex");
if (Index == 1) return myvertex1;
else if (Index == 2) return myvertex2;
else Standard_Failure::Raise("TopOpeBRep_Point2d::Vertex");
return myvertex1;
}
//=======================================================================
//function : Transition
//purpose :
//=======================================================================
const TopOpeBRepDS_Transition& TopOpeBRep_Point2d::Transition(const Standard_Integer Index) const
{
if (Index == 1) return mytransition1;
else if (Index == 2) return mytransition2;
else Standard_Failure::Raise("TopOpeBRep_Point2d::Transition");
return mytransition1;
}
//=======================================================================
//function : ChangeTransition
//purpose :
//=======================================================================
TopOpeBRepDS_Transition& TopOpeBRep_Point2d::ChangeTransition(const Standard_Integer Index)
{
if (Index == 1) return mytransition1;
else if (Index == 2) return mytransition2;
else Standard_Failure::Raise("TopOpeBRep_Point2d::ChangeTransition");
return mytransition1;
}
//=======================================================================
//function : Dump
//purpose :
//=======================================================================
#ifdef DEB
void TopOpeBRep_Point2d::Dump(const Standard_Integer E1index,const Standard_Integer E2index) const
{
Standard_Real par1 = Parameter(1);
Standard_Real par2 = Parameter(2);
Standard_Integer index = Index();
Standard_Boolean keep = Keep();
Standard_Integer sts = Status();
Standard_Boolean pos = IsPointOfSegment();
const TopOpeBRepDS_Transition& T1 = Transition(1);
const TopOpeBRepDS_Transition& T2 = Transition(2);
Standard_Boolean isvertex1 = IsVertex(1); TopoDS_Vertex V1; if (isvertex1) V1 = Vertex(1);
Standard_Boolean isvertex2 = IsVertex(2); TopoDS_Vertex V2; if (isvertex2) V2 = Vertex(2);
Standard_Integer ia1,ia2; SegmentAncestors(ia1,ia2);
cout<<endl<<"p2d "<<index<<" k="<<keep<<" pos="<<pos;
switch (sts) {
case TopOpeBRep_P2DUNK : cout<<" sts=u";break;
case TopOpeBRep_P2DSGF : cout<<" sts=f";break;
case TopOpeBRep_P2DSGL : cout<<" sts=l";break;
case TopOpeBRep_P2DNEW :
cout<<" sts=n";
cout<<" anc="<<ia1<<","<<ia2;
break;
case TopOpeBRep_P2DINT : cout<<" sts=i";break;
} // switch
cout<<" cfg=";TopOpeBRepDS::Print(myedgesconfig,cout);
cout<<endl;
gp_Pnt P3D = Value();
#ifdef DRAW
cout<<FUN_tool_PRODINP()<<"P"<<Index()<<" "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z()<<"; # tol = "<<tol<<endl;
#endif
cout<<" on (1) :"; cout<<" vertex(1) : "; cout<<(isvertex1)? 1:0;
cout<<" T "<<E1index<<"(1) : "; T1.Dump(cout);
cout<<" par(1) = "<<par1;
if (isvertex1) {
P3D = BRep_Tool::Pnt(V1);
cout<<" PV(1) : "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z();
}
cout<<endl;
cout<<" on (2) :"; cout<<" vertex(2) : "; cout<<(isvertex2)? 1:0;
cout<<" T "<<E2index<<"(2) : "; T2.Dump(cout);
cout<<" par(2) = "<<par2;
if (isvertex2) {
P3D = BRep_Tool::Pnt(V2);
cout<<" PV(2) : "<<P3D.X()<<" "<<P3D.Y()<<" "<<P3D.Z();
}
cout<<endl;
}
#else
void TopOpeBRep_Point2d::Dump(const Standard_Integer,const Standard_Integer) const {}
#endif