// Created on: 1996-07-02 // Created by: Joelle CHAUVET // Copyright (c) 1996-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. // Modified: Mon Dec 9 11:39:13 1996 // by: Joelle CHAUVET // G1135 : empty constructor #include #include #include #include #include #include #include #include //========================================================================================== //function : AdvApp2Var_Framework //purpose : //========================================================================================== AdvApp2Var_Framework::AdvApp2Var_Framework() { } //========================================================================================== //function : AdvApp2Var_Framework //purpose : //========================================================================================== AdvApp2Var_Framework::AdvApp2Var_Framework(const AdvApp2Var_SequenceOfNode& Frame, const AdvApp2Var_SequenceOfStrip& UFrontier, const AdvApp2Var_SequenceOfStrip& VFrontier) { myNodeConstraints = Frame; myUConstraints = UFrontier; myVConstraints = VFrontier; } //========================================================================================== //function : FirstNotApprox //purpose : return the first Iso not approximated //========================================================================================== Standard_Boolean AdvApp2Var_Framework::FirstNotApprox(Standard_Integer& IndexIso, Standard_Integer& IndexStrip, AdvApp2Var_Iso& anIso) const { Standard_Boolean good = Standard_True; Standard_Integer i,j; AdvApp2Var_Strip S; for (i = 1; i <= myUConstraints.Length() && good ; i++) { S = myUConstraints.Value(i); for (j = 1; j <= S.Length() && good ; j++) { good = (S.Value(j)).IsApproximated(); if (!good) { IndexIso = j; IndexStrip = i; anIso = S.Value(j); } } } if (!good) { goto FINISH; } for (i = 1; i <= myVConstraints.Length() && good; i++) { S = myVConstraints.Value(i); for (j = 1; j <= S.Length() && good ; j++) { good = (S.Value(j)).IsApproximated(); if (!good) { IndexIso = j; IndexStrip = i; anIso = S.Value(j); } } } FINISH: return !good; } //========================================================================================== //function : FirstNode //purpose : return the first node of an iso //========================================================================================== Standard_Integer AdvApp2Var_Framework::FirstNode(const GeomAbs_IsoType Type, const Standard_Integer IndexIso, const Standard_Integer IndexStrip) const { Standard_Integer NbIso,Index; NbIso = myUConstraints.Length()+1; if (Type==GeomAbs_IsoU) { Index = NbIso * (IndexStrip-1) + IndexIso; return Index; } else { Index = NbIso * (IndexIso-1) + IndexStrip; return Index; } } //========================================================================================== //function : LastNode //purpose : return the last node of an iso //========================================================================================== Standard_Integer AdvApp2Var_Framework::LastNode(const GeomAbs_IsoType Type, const Standard_Integer IndexIso, const Standard_Integer IndexStrip) const { Standard_Integer NbIso,Index; NbIso = myUConstraints.Length()+1; if (Type==GeomAbs_IsoU) { Index = NbIso * IndexStrip + IndexIso; return Index; } else { Index = NbIso * (IndexIso-1) + IndexStrip + 1; return Index; } } //========================================================================================== //function : ChangeIso //purpose : replace the iso IndexIso of the strip IndexStrip by anIso //========================================================================================== void AdvApp2Var_Framework::ChangeIso(const Standard_Integer IndexIso, const Standard_Integer IndexStrip, const AdvApp2Var_Iso& anIso) { AdvApp2Var_Strip S0; if (anIso.Type()==GeomAbs_IsoV) { S0 = myUConstraints.Value(IndexStrip); S0.SetValue(IndexIso,anIso); myUConstraints.SetValue(IndexStrip,S0); } else { S0 = myVConstraints.Value(IndexStrip); S0.SetValue(IndexIso,anIso); myVConstraints.SetValue(IndexStrip,S0); } } //========================================================================================== //function : Node //purpose : return the node of coordinates (U,V) //========================================================================================== const AdvApp2Var_Node& AdvApp2Var_Framework::Node(const Standard_Real U, const Standard_Real V) const { Standard_Integer Index=1; while ( ( ((myNodeConstraints.Value(Index)).Coord()).X() != U || ((myNodeConstraints.Value(Index)).Coord()).Y() != V ) && (IndexCuttingValue || ((myUConstraints.Value(i)).Value(1)).U1()CuttingValue) && ((Prev.Coord()).Y()==(Next.Coord()).Y())) { gp_XY NewUV(CuttingValue,(Prev.Coord()).Y()); AdvApp2Var_Node NewNode(NewUV,Prev.UOrder(),Prev.VOrder()); myNodeConstraints.InsertAfter(j,NewNode); } Prev=Next; } } //========================================================================================== //function : UpdateInV //purpose : modification and insertion of nodes and isos //========================================================================================== void AdvApp2Var_Framework::UpdateInV(const Standard_Real CuttingValue) { Standard_Integer i,j=1; while (((myVConstraints.Value(j)).Value(1)).V0()>CuttingValue || ((myVConstraints.Value(j)).Value(1)).V1()