// Created on: 1993-06-17 // Created by: Jean Yves LEBEY // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #include #include #include #include #include #include #include #include #include #include #ifdef OCCT_DEBUG extern Standard_Boolean TopOpeBRepTool_GettraceVC(); extern Standard_Boolean TopOpeBRepTool_GettraceCLOV(); #endif //======================================================================= //function : TopOpeBRepBuild_PaveClassifier //purpose : //======================================================================= TopOpeBRepBuild_PaveClassifier::TopOpeBRepBuild_PaveClassifier (const TopoDS_Shape& E) : myEdgePeriodic(Standard_False), mySameParameters(Standard_False), myClosedVertices(Standard_False) { myEdge = TopoDS::Edge(E); if ( ! BRep_Tool::Degenerated(myEdge) ) { TopLoc_Location loc; Standard_Real f,l; Handle(Geom_Curve) C = BRep_Tool::Curve(myEdge,loc,f,l); if ( !C.IsNull() ) { if (C->IsPeriodic()) { TopoDS_Vertex v1,v2; TopExp::Vertices(myEdge,v1,v2); // v1 FORWARD, v2 REVERSED if ( !v1.IsNull() && !v2.IsNull() ) { // --- the edge has vertices myFirst = f; Standard_Real fC = C->FirstParameter(); Standard_Real lC = C->LastParameter(); myPeriod = lC - fC; myEdgePeriodic = mySameParameters = v1.IsSame(v2); if ( mySameParameters ) { myFirst = BRep_Tool::Parameter(v1,myEdge); } } else { // --- the edge has no vertices myFirst = f; myPeriod = l - f; myEdgePeriodic = Standard_True; mySameParameters = Standard_False; } } } #ifdef OCCT_DEBUG if (TopOpeBRepTool_GettraceVC()) { std::cout< myP2) std::cout<<" p1 > p2"; std::cout<<" --> state "; TopAbs::Print(state,std::cout); std::cout< "< "< state "; TopAbs::Print(state,std::cout); std::cout<Vertex().Orientation(); myO2 = PV2->Vertex().Orientation(); myP1 = PV1->Parameter(); myP2 = PV2->Parameter(); #ifdef OCCT_DEBUG if (TopOpeBRepTool_GettraceVC()) { std::cout< final state "; TopAbs::Print(state,std::cout); std::cout<