1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-06 10:36:12 +03:00
occt/src/GeomFill/GeomFill_TgtOnCoons.cxx
Denis Barbier 96a95605cd 0024510: Remove unused local variables
When warnings are enabled, compilers report lots of occurrences
of unused local variables, which makes it harder to find other
meaningful warnings.
This commit does not fix all unused local variables.

Fix new type conversion warning

Code cleaned to avoid MSVC compiler warnings on unused function arguments.
Several useless pieces of code are removed.
Changes in IntTools_EdgeFace.cxx, Blend_Walking_1.gxx, Bnd_BoundSortBox.cxx, ProjLib_ProjectedCurve.cxx are reverted (separated to specific issue for more in-depth analysis).
2014-01-09 12:21:51 +04:00

190 lines
4.1 KiB
C++

// Created on: 1995-12-04
// Created by: Laurent BOURESCHE
// Copyright (c) 1995-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 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 <GeomFill_TgtOnCoons.ixx>
#include <GeomFill_Boundary.hxx>
//=======================================================================
//function : GeomFill_TgtOnCoons
//purpose :
//=======================================================================
GeomFill_TgtOnCoons::GeomFill_TgtOnCoons
(const Handle(GeomFill_CoonsAlgPatch)& K,
const Standard_Integer I) : myK(K), ibound(I)
{
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
gp_Vec GeomFill_TgtOnCoons::Value(const Standard_Real W) const
{
Standard_Real U = 0.,V = 0.,bid = 0.;
switch (ibound){
case 0 :
myK->Bound(1)->Bounds(V,bid);
break;
case 1 :
myK->Bound(0)->Bounds(bid,U);
break;
case 2 :
myK->Bound(1)->Bounds(bid,V);
break;
case 3 :
myK->Bound(0)->Bounds(U,bid);
break;
}
gp_Vec tgk;
switch (ibound){
case 0 :
case 2 :
U = W;
tgk = myK->D1V(U,V);
break;
case 1 :
case 3 :
V = W;
tgk = myK->D1U(U,V);
break;
}
gp_Vec n = myK->Bound(ibound)->Norm(W);
Standard_Real scal = tgk.Dot(n);
n.Multiply(-scal);
tgk.Add(n);
return tgk;
}
//=======================================================================
//function : D1
//purpose :
//=======================================================================
gp_Vec GeomFill_TgtOnCoons::D1(const Standard_Real W) const
{
Standard_Real U = 0.,V = 0.,bid = 0.;
switch (ibound){
case 0 :
myK->Bound(1)->Bounds(V,bid);
break;
case 1 :
myK->Bound(0)->Bounds(bid,U);
break;
case 2 :
myK->Bound(1)->Bounds(bid,V);
break;
case 3 :
myK->Bound(0)->Bounds(U,bid);
break;
}
gp_Vec tgsc,dtgsc;
switch (ibound){
case 0 :
case 2 :
U = W;
tgsc = myK->D1V(U,V);
break;
case 1 :
case 3 :
V = W;
tgsc = myK->D1U(U,V);
break;
}
dtgsc = myK->DUV(U,V);
gp_Vec n, dn;
myK->Bound(ibound)->D1Norm(W,n,dn);
Standard_Real scal = tgsc.Dot(n);
gp_Vec scaln = n.Multiplied(-scal);
tgsc.Added(scaln);
gp_Vec scaldn = dn.Multiplied(-scal);
Standard_Real scal2 = -dtgsc.Dot(n) - tgsc.Dot(dn);
gp_Vec temp = n.Multiplied(scal2);
temp.Add(scaldn);
gp_Vec dtpur = dtgsc.Added(temp);
return dtpur;
}
//=======================================================================
//function : D1
//purpose :
//=======================================================================
void GeomFill_TgtOnCoons::D1(const Standard_Real W, gp_Vec& T, gp_Vec& DT) const
{
Standard_Real U = 0.,V = 0.,bid = 0.;
switch (ibound){
case 0 :
myK->Bound(1)->Bounds(V,bid);
break;
case 1 :
myK->Bound(0)->Bounds(bid,U);
break;
case 2 :
myK->Bound(1)->Bounds(bid,V);
break;
case 3 :
myK->Bound(0)->Bounds(U,bid);
break;
}
gp_Vec tgsc,dtgsc;
switch (ibound){
case 0 :
case 2 :
U = W;
tgsc = myK->D1V(U,V);
break;
case 1 :
case 3 :
V = W;
tgsc = myK->D1U(U,V);
break;
}
dtgsc = myK->DUV(U,V);
gp_Vec n, dn;
myK->Bound(ibound)->D1Norm(W,n,dn);
Standard_Real scal = tgsc.Dot(n);
gp_Vec scaln = n.Multiplied(-scal);
T = tgsc.Added(scaln);
gp_Vec scaldn = dn.Multiplied(-scal);
Standard_Real scal2 = -dtgsc.Dot(n) - tgsc.Dot(dn);
gp_Vec temp = n.Multiplied(scal2);
temp.Add(scaldn);
DT = dtgsc.Added(temp);
}