mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0031004: Coding - eliminate warnings issued by gcc 9.1.0
Fixed -Wrestrict warning within OSD::SetSignal(). Fixed -Wdeprecated-copy warning by adding missing counterpart in pair copy constructor / assignment operator or by removing trivial constructor. AdvApp2Var_Node, AdvApp2Var_Patch are now declared as Handle. AdvApp2Var_Iso is now passed by Handle. Disabled operator= for TDF_Transaction and TDF_IDFilter. Standard.cxx - fixed GCC version mischeck causing building failure with experimental GCC versions. TopOpeBRepDS_EXPORT.cxx - fixed -Wmaybe-uninitialized warnings.
This commit is contained in:
@@ -244,7 +244,7 @@ void AdvApp2Var_ApproxAFunc2Var::InitGrid(const Standard_Integer NbInt)
|
||||
{
|
||||
Standard_Integer iu=myConditions.UOrder(),iv=myConditions.VOrder(),iint;
|
||||
|
||||
AdvApp2Var_Patch M0(myFirstParInU,myLastParInU,myFirstParInV,myLastParInV,iu,iv);
|
||||
Handle(AdvApp2Var_Patch) M0 = new AdvApp2Var_Patch (myFirstParInU,myLastParInU,myFirstParInV,myLastParInV,iu,iv);
|
||||
|
||||
AdvApp2Var_SequenceOfPatch Net;
|
||||
Net.Append(M0);
|
||||
@@ -259,29 +259,29 @@ void AdvApp2Var_ApproxAFunc2Var::InitGrid(const Standard_Integer NbInt)
|
||||
|
||||
|
||||
gp_XY UV1(myFirstParInU,myFirstParInV);
|
||||
AdvApp2Var_Node C1(UV1,iu,iv);
|
||||
Handle(AdvApp2Var_Node) C1 = new AdvApp2Var_Node (UV1,iu,iv);
|
||||
gp_XY UV2(myLastParInU,myFirstParInV);
|
||||
AdvApp2Var_Node C2(UV2,iu,iv);
|
||||
Handle(AdvApp2Var_Node) C2 = new AdvApp2Var_Node (UV2,iu,iv);
|
||||
gp_XY UV4(myLastParInU,myLastParInV);
|
||||
AdvApp2Var_Node C4(UV4,iu,iv);
|
||||
Handle(AdvApp2Var_Node) C4 = new AdvApp2Var_Node (UV4,iu,iv);
|
||||
gp_XY UV3(myFirstParInU,myLastParInV);
|
||||
AdvApp2Var_Node C3(UV3,iu,iv);
|
||||
Handle(AdvApp2Var_Node) C3 = new AdvApp2Var_Node (UV3,iu,iv);
|
||||
AdvApp2Var_SequenceOfNode Bag;
|
||||
Bag.Append(C1);
|
||||
Bag.Append(C2);
|
||||
Bag.Append(C3);
|
||||
Bag.Append(C4);
|
||||
|
||||
AdvApp2Var_Iso V0(GeomAbs_IsoV,myFirstParInV,
|
||||
Handle(AdvApp2Var_Iso) V0 = new AdvApp2Var_Iso (GeomAbs_IsoV,myFirstParInV,
|
||||
myFirstParInU,myLastParInU,myFirstParInV,myLastParInV,
|
||||
1,iu,iv);
|
||||
AdvApp2Var_Iso V1(GeomAbs_IsoV,myLastParInV,
|
||||
Handle(AdvApp2Var_Iso) V1 = new AdvApp2Var_Iso (GeomAbs_IsoV,myLastParInV,
|
||||
myFirstParInU,myLastParInU,myFirstParInV,myLastParInV,
|
||||
2,iu,iv);
|
||||
AdvApp2Var_Iso U0(GeomAbs_IsoU,myFirstParInU,
|
||||
Handle(AdvApp2Var_Iso) U0 = new AdvApp2Var_Iso (GeomAbs_IsoU,myFirstParInU,
|
||||
myFirstParInU,myLastParInU,myFirstParInV,myLastParInV,
|
||||
3,iu,iv);
|
||||
AdvApp2Var_Iso U1(GeomAbs_IsoU,myLastParInU,
|
||||
Handle(AdvApp2Var_Iso) U1 = new AdvApp2Var_Iso (GeomAbs_IsoU,myLastParInU,
|
||||
myFirstParInU,myLastParInU,myFirstParInV,myLastParInV,
|
||||
4,iu,iv);
|
||||
|
||||
@@ -557,68 +557,74 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
|
||||
Standard_Real dec;
|
||||
Standard_Boolean more;
|
||||
Standard_Integer ind1, ind2, NbPatch, NbU, NbV;
|
||||
AdvApp2Var_Iso Is;
|
||||
Standard_Integer indN1, indN2;
|
||||
Standard_Integer iu = myConditions.UOrder(), iv = myConditions.VOrder();
|
||||
AdvApp2Var_Node N1(iu,iv), N2(iu,iv);
|
||||
|
||||
while ( myConstraints.FirstNotApprox(ind1, ind2, Is) ) {
|
||||
for (Handle(AdvApp2Var_Iso) anIso = myConstraints.FirstNotApprox(ind1, ind2); !anIso.IsNull(); anIso = myConstraints.FirstNotApprox(ind1, ind2))
|
||||
{
|
||||
// approximation of iso and calculation of constraints at extremities
|
||||
const Standard_Integer indN1 = myConstraints.FirstNode(anIso->Type(),ind1,ind2);
|
||||
N1 = *myConstraints.Node(indN1);
|
||||
const Standard_Integer indN2 = myConstraints.LastNode(anIso->Type(),ind1,ind2);
|
||||
N2 = *myConstraints.Node(indN2);
|
||||
|
||||
// approximation of iso and calculation of constraints at extremities
|
||||
indN1 = myConstraints.FirstNode(Is.Type(),ind1,ind2);
|
||||
N1 = myConstraints.Node(indN1);
|
||||
indN2 = myConstraints.LastNode(Is.Type(),ind1,ind2);
|
||||
N2 = myConstraints.Node(indN2);
|
||||
|
||||
Is.MakeApprox(myConditions,
|
||||
myFirstParInU, myLastParInU,
|
||||
myFirstParInV, myLastParInV,
|
||||
Func, N1 , N2);
|
||||
|
||||
if (Is.IsApproximated()) {
|
||||
// iso is approached at the required tolerance
|
||||
myConstraints.ChangeIso(ind1,ind2,Is);
|
||||
myConstraints.ChangeNode(indN1) = N1;
|
||||
myConstraints.ChangeNode(indN2) = N2;
|
||||
// note that old code attempted to make copy of anIso here (but copy was incomplete)
|
||||
anIso->MakeApprox (myConditions,
|
||||
myFirstParInU, myLastParInU,
|
||||
myFirstParInV, myLastParInV,
|
||||
Func, N1 , N2);
|
||||
if (anIso->IsApproximated())
|
||||
{
|
||||
// iso is approached at the required tolerance
|
||||
myConstraints.ChangeIso(ind1,ind2,anIso);
|
||||
*myConstraints.Node(indN1) = N1;
|
||||
*myConstraints.Node(indN2) = N2;
|
||||
}
|
||||
|
||||
else {
|
||||
// Approximation is not satisfactory
|
||||
else
|
||||
{
|
||||
// Approximation is not satisfactory
|
||||
NbU = myResult.NbPatchInU();
|
||||
NbV = myResult.NbPatchInV();
|
||||
if (Is.Type()==GeomAbs_IsoV) {
|
||||
NbPatch = (NbU+1)*NbV;
|
||||
more = UChoice.Value(Is.T0(),Is.T1(),dec);
|
||||
if (anIso->Type()==GeomAbs_IsoV)
|
||||
{
|
||||
NbPatch = (NbU+1)*NbV;
|
||||
more = UChoice.Value(anIso->T0(), anIso->T1(), dec);
|
||||
}
|
||||
else {
|
||||
NbPatch = (NbV+1)*NbU;
|
||||
more = VChoice.Value(Is.T0(),Is.T1(),dec);
|
||||
else
|
||||
{
|
||||
NbPatch = (NbV+1)*NbU;
|
||||
more = VChoice.Value(anIso->T0(),anIso->T1(),dec);
|
||||
}
|
||||
|
||||
if (NbPatch<=myMaxPatches && more) {
|
||||
// It is possible to cut iso
|
||||
if (Is.Type()==GeomAbs_IsoV) {
|
||||
myResult.UpdateInU(dec);
|
||||
myConstraints.UpdateInU(dec);
|
||||
}
|
||||
else {
|
||||
myResult.UpdateInV(dec);
|
||||
myConstraints.UpdateInV(dec);
|
||||
}
|
||||
if (NbPatch<=myMaxPatches && more)
|
||||
{
|
||||
// It is possible to cut iso
|
||||
if (anIso->Type()==GeomAbs_IsoV)
|
||||
{
|
||||
myResult.UpdateInU(dec);
|
||||
myConstraints.UpdateInU(dec);
|
||||
}
|
||||
else
|
||||
{
|
||||
myResult.UpdateInV(dec);
|
||||
myConstraints.UpdateInV(dec);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
// It is not possible to cut : the result is preserved
|
||||
if (Is.HasResult()) {
|
||||
Is.OverwriteApprox();
|
||||
myConstraints.ChangeIso(ind1,ind2,Is);
|
||||
myConstraints.ChangeNode(indN1) = N1;
|
||||
myConstraints.ChangeNode(indN2) = N2;
|
||||
}
|
||||
else {
|
||||
myHasResult = myDone = Standard_False;
|
||||
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Curve Approximation Error");
|
||||
}
|
||||
else
|
||||
{
|
||||
// It is not possible to cut : the result is preserved
|
||||
if (anIso->HasResult())
|
||||
{
|
||||
anIso->OverwriteApprox();
|
||||
myConstraints.ChangeIso(ind1,ind2,anIso);
|
||||
*myConstraints.Node(indN1) = N1;
|
||||
*myConstraints.Node(indN2) = N2;
|
||||
}
|
||||
else
|
||||
{
|
||||
myHasResult = myDone = Standard_False;
|
||||
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Curve Approximation Error");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -638,74 +644,82 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeConstraints(const AdvApprox_Cutting& UCh
|
||||
Standard_Real dec;
|
||||
Standard_Boolean more, CritRel = (Crit.Type() == AdvApp2Var_Relative);
|
||||
Standard_Integer ind1, ind2, NbPatch, NbU, NbV;
|
||||
AdvApp2Var_Iso Is;
|
||||
Standard_Integer indN1, indN2;
|
||||
Standard_Integer iu = myConditions.UOrder(), iv = myConditions.VOrder();
|
||||
AdvApp2Var_Node N1(iu,iv), N2(iu,iv);
|
||||
|
||||
while ( myConstraints.FirstNotApprox(ind1, ind2, Is) ) {
|
||||
for (Handle(AdvApp2Var_Iso) anIso = myConstraints.FirstNotApprox(ind1, ind2); !anIso.IsNull(); anIso = myConstraints.FirstNotApprox(ind1, ind2))
|
||||
{
|
||||
// approximation of the iso and calculation of constraints at the extremities
|
||||
indN1 = myConstraints.FirstNode(anIso->Type(),ind1,ind2);
|
||||
N1 = *myConstraints.Node(indN1);
|
||||
indN2 = myConstraints.LastNode(anIso->Type(),ind1,ind2);
|
||||
N2 = *myConstraints.Node(indN2);
|
||||
|
||||
// approximation of the iso and calculation of constraints at the extremities
|
||||
indN1 = myConstraints.FirstNode(Is.Type(),ind1,ind2);
|
||||
N1 = myConstraints.Node(indN1);
|
||||
indN2 = myConstraints.LastNode(Is.Type(),ind1,ind2);
|
||||
N2 = myConstraints.Node(indN2);
|
||||
// note that old code attempted to make copy of anIso here (but copy was incomplete)
|
||||
anIso->MakeApprox (myConditions,
|
||||
myFirstParInU, myLastParInU,
|
||||
myFirstParInV, myLastParInV,
|
||||
Func, N1 , N2);
|
||||
|
||||
Is.MakeApprox(myConditions,
|
||||
myFirstParInU, myLastParInU,
|
||||
myFirstParInV, myLastParInV,
|
||||
Func, N1 , N2);
|
||||
|
||||
if (Is.IsApproximated()) {
|
||||
// iso is approached at the required tolerance
|
||||
myConstraints.ChangeIso(ind1,ind2,Is);
|
||||
myConstraints.ChangeNode(indN1) = N1;
|
||||
myConstraints.ChangeNode(indN2) = N2;
|
||||
if (anIso->IsApproximated())
|
||||
{
|
||||
// iso is approached at the required tolerance
|
||||
myConstraints.ChangeIso(ind1,ind2,anIso);
|
||||
*myConstraints.Node(indN1) = N1;
|
||||
*myConstraints.Node(indN2) = N2;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Approximation is not satisfactory
|
||||
NbU = myResult.NbPatchInU();
|
||||
NbV = myResult.NbPatchInV();
|
||||
if (anIso->Type()==GeomAbs_IsoV)
|
||||
{
|
||||
NbPatch = (NbU+1)*NbV;
|
||||
more = UChoice.Value(anIso->T0(),anIso->T1(),dec);
|
||||
}
|
||||
else
|
||||
{
|
||||
NbPatch = (NbV+1)*NbU;
|
||||
more = VChoice.Value(anIso->T0(),anIso->T1(),dec);
|
||||
}
|
||||
|
||||
else {
|
||||
// Approximation is not satisfactory
|
||||
NbU = myResult.NbPatchInU();
|
||||
NbV = myResult.NbPatchInV();
|
||||
if (Is.Type()==GeomAbs_IsoV) {
|
||||
NbPatch = (NbU+1)*NbV;
|
||||
more = UChoice.Value(Is.T0(),Is.T1(),dec);
|
||||
}
|
||||
else {
|
||||
NbPatch = (NbV+1)*NbU;
|
||||
more = VChoice.Value(Is.T0(),Is.T1(),dec);
|
||||
}
|
||||
// To force Overwrite if the criterion is Absolute
|
||||
more = more && (CritRel);
|
||||
|
||||
// To force Overwrite if the criterion is Absolute
|
||||
more = more && (CritRel);
|
||||
|
||||
if (NbPatch<=myMaxPatches && more) {
|
||||
// It is possible to cut iso
|
||||
if (Is.Type()==GeomAbs_IsoV) {
|
||||
myResult.UpdateInU(dec);
|
||||
myConstraints.UpdateInU(dec);
|
||||
}
|
||||
else {
|
||||
myResult.UpdateInV(dec);
|
||||
myConstraints.UpdateInV(dec);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
// It is not possible to cut: the result is preserved
|
||||
if (Is.HasResult()) {
|
||||
Is.OverwriteApprox();
|
||||
myConstraints.ChangeIso(ind1,ind2,Is);
|
||||
myConstraints.ChangeNode(indN1) = N1;
|
||||
myConstraints.ChangeNode(indN2) = N2;
|
||||
}
|
||||
else {
|
||||
myHasResult = myDone = Standard_False;
|
||||
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Curve Approximation Error");
|
||||
}
|
||||
}
|
||||
if (NbPatch<=myMaxPatches && more)
|
||||
{
|
||||
// It is possible to cut iso
|
||||
if (anIso->Type()==GeomAbs_IsoV)
|
||||
{
|
||||
myResult.UpdateInU(dec);
|
||||
myConstraints.UpdateInU(dec);
|
||||
}
|
||||
else
|
||||
{
|
||||
myResult.UpdateInV(dec);
|
||||
myConstraints.UpdateInV(dec);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// It is not possible to cut: the result is preserved
|
||||
if (anIso->HasResult())
|
||||
{
|
||||
anIso->OverwriteApprox();
|
||||
myConstraints.ChangeIso(ind1,ind2,anIso);
|
||||
*myConstraints.Node(indN1) = N1;
|
||||
*myConstraints.Node(indN2) = N2;
|
||||
}
|
||||
else
|
||||
{
|
||||
myHasResult = myDone = Standard_False;
|
||||
throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : Curve Approximation Error");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -57,43 +57,30 @@ AdvApp2Var_Framework::AdvApp2Var_Framework(const AdvApp2Var_SequenceOfNode& Fram
|
||||
//purpose : return the first Iso not approximated
|
||||
//==========================================================================================
|
||||
|
||||
Standard_Boolean AdvApp2Var_Framework::FirstNotApprox(Standard_Integer& IndexIso,
|
||||
Standard_Integer& IndexStrip,
|
||||
AdvApp2Var_Iso& anIso) const
|
||||
Handle(AdvApp2Var_Iso) AdvApp2Var_Framework::FirstNotApprox(Standard_Integer& IndexIso,
|
||||
Standard_Integer& IndexStrip) 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);
|
||||
for (int anUVIter = 0; anUVIter < 2; ++anUVIter)
|
||||
{
|
||||
const AdvApp2Var_SequenceOfStrip& aSeq = anUVIter == 0 ? myUConstraints : myVConstraints;
|
||||
Standard_Integer i = 1;
|
||||
for (AdvApp2Var_SequenceOfStrip::Iterator aConstIter (aSeq); aConstIter.More(); aConstIter.Next(), i++)
|
||||
{
|
||||
const AdvApp2Var_Strip& S = aConstIter.Value();
|
||||
Standard_Integer j = 1;
|
||||
for (AdvApp2Var_Strip::Iterator anIsoIter (S); anIsoIter.More(); anIsoIter.Next(), j++)
|
||||
{
|
||||
const Handle(AdvApp2Var_Iso)& anIso = anIsoIter.Value();
|
||||
if (!anIso->IsApproximated())
|
||||
{
|
||||
IndexIso = j;
|
||||
IndexStrip = i;
|
||||
return anIso;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
return Handle(AdvApp2Var_Iso)();
|
||||
}
|
||||
|
||||
//==========================================================================================
|
||||
@@ -145,19 +132,12 @@ Standard_Integer AdvApp2Var_Framework::LastNode(const GeomAbs_IsoType Type,
|
||||
|
||||
void AdvApp2Var_Framework::ChangeIso(const Standard_Integer IndexIso,
|
||||
const Standard_Integer IndexStrip,
|
||||
const AdvApp2Var_Iso& anIso)
|
||||
const Handle(AdvApp2Var_Iso)& theIso)
|
||||
{
|
||||
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);
|
||||
}
|
||||
AdvApp2Var_Strip& S0 = theIso->Type() == GeomAbs_IsoV
|
||||
? myUConstraints.ChangeValue (IndexStrip)
|
||||
: myVConstraints.ChangeValue (IndexStrip);
|
||||
S0.SetValue (IndexIso, theIso);
|
||||
}
|
||||
|
||||
//==========================================================================================
|
||||
@@ -165,16 +145,19 @@ void AdvApp2Var_Framework::ChangeIso(const Standard_Integer IndexIso,
|
||||
//purpose : return the node of coordinates (U,V)
|
||||
//==========================================================================================
|
||||
|
||||
const AdvApp2Var_Node& AdvApp2Var_Framework::Node(const Standard_Real U,
|
||||
const Handle(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 )
|
||||
&& (Index<myNodeConstraints.Length()) ) {
|
||||
Index++;
|
||||
for (AdvApp2Var_SequenceOfNode::Iterator aNodeIter (myNodeConstraints); aNodeIter.More(); aNodeIter.Next())
|
||||
{
|
||||
const Handle(AdvApp2Var_Node)& aNode = aNodeIter.Value();
|
||||
if (aNode->Coord().X() == U
|
||||
&& aNode->Coord().Y() == V)
|
||||
{
|
||||
return aNode;
|
||||
}
|
||||
}
|
||||
return myNodeConstraints.Value(Index);
|
||||
return myNodeConstraints.Last();
|
||||
}
|
||||
|
||||
//==========================================================================================
|
||||
@@ -187,17 +170,20 @@ AdvApp2Var_Framework::IsoU(const Standard_Real U,
|
||||
const Standard_Real V0,
|
||||
const Standard_Real V1) const
|
||||
{
|
||||
Standard_Integer IndexStrip=1,IndexIso=1;
|
||||
while ( ( ((myVConstraints.Value(IndexStrip)).Value(1)).T0() != V0
|
||||
|| ((myVConstraints.Value(IndexStrip)).Value(1)).T1() != V1 )
|
||||
&& (IndexStrip<myVConstraints.Length()) ) {
|
||||
Standard_Integer IndexStrip = 1;
|
||||
while (IndexStrip < myVConstraints.Length()
|
||||
&& (myVConstraints.Value(IndexStrip).First()->T0() != V0
|
||||
|| myVConstraints.Value(IndexStrip).First()->T1() != V1))
|
||||
{
|
||||
IndexStrip++;
|
||||
}
|
||||
while ( ( ((myVConstraints.Value(IndexStrip)).Value(IndexIso)).Constante() != U)
|
||||
&& (IndexIso<=myUConstraints.Length()) ) {
|
||||
Standard_Integer IndexIso = 1;
|
||||
while (IndexIso<=myUConstraints.Length()
|
||||
&& myVConstraints.Value(IndexStrip).Value(IndexIso)->Constante() != U)
|
||||
{
|
||||
IndexIso++;
|
||||
}
|
||||
return (myVConstraints.Value(IndexStrip)).Value(IndexIso);
|
||||
return *(myVConstraints.Value(IndexStrip).Value(IndexIso));
|
||||
}
|
||||
|
||||
//==========================================================================================
|
||||
@@ -210,17 +196,20 @@ AdvApp2Var_Framework::IsoV(const Standard_Real U0,
|
||||
const Standard_Real U1,
|
||||
const Standard_Real V) const
|
||||
{
|
||||
Standard_Integer IndexStrip=1,IndexIso=1;
|
||||
while ( ( ((myUConstraints.Value(IndexStrip)).Value(1)).T0() != U0
|
||||
|| ((myUConstraints.Value(IndexStrip)).Value(1)).T1() != U1 )
|
||||
&& (IndexStrip<myUConstraints.Length()) ) {
|
||||
Standard_Integer IndexStrip = 1;
|
||||
while (IndexStrip < myUConstraints.Length()
|
||||
&& (myUConstraints.Value(IndexStrip).First()->T0() != U0
|
||||
|| myUConstraints.Value(IndexStrip).First()->T1() != U1))
|
||||
{
|
||||
IndexStrip++;
|
||||
}
|
||||
while ( ( ((myUConstraints.Value(IndexStrip)).Value(IndexIso)).Constante() != V)
|
||||
&& (IndexIso<=myVConstraints.Length()) ) {
|
||||
Standard_Integer IndexIso = 1;
|
||||
while (IndexIso<=myVConstraints.Length()
|
||||
&& myUConstraints.Value(IndexStrip).Value(IndexIso)->Constante() != V)
|
||||
{
|
||||
IndexIso++;
|
||||
}
|
||||
return (myUConstraints.Value(IndexStrip)).Value(IndexIso);
|
||||
return *(myUConstraints.Value(IndexStrip).Value(IndexIso));
|
||||
}
|
||||
|
||||
//==========================================================================================
|
||||
@@ -230,65 +219,74 @@ AdvApp2Var_Framework::IsoV(const Standard_Real U0,
|
||||
|
||||
void AdvApp2Var_Framework::UpdateInU(const Standard_Real CuttingValue)
|
||||
{
|
||||
Standard_Integer i=1,j;
|
||||
while (((myUConstraints.Value(i)).Value(1)).U0()>CuttingValue
|
||||
|| ((myUConstraints.Value(i)).Value(1)).U1()<CuttingValue) {
|
||||
i++;
|
||||
Standard_Integer i = 1;
|
||||
for (AdvApp2Var_SequenceOfStrip::Iterator anUConstIter (myUConstraints); anUConstIter.More(); anUConstIter.Next(), ++i)
|
||||
{
|
||||
if (anUConstIter.Value().First()->U0() <= CuttingValue
|
||||
&& anUConstIter.Value().First()->U1() >= CuttingValue)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
AdvApp2Var_Strip S0;
|
||||
AdvApp2Var_Iso Is;
|
||||
S0 = myUConstraints.Value(i);
|
||||
Standard_Real Udeb = (S0.Value(1)).U0(), Ufin = (S0.Value(1)).U1();
|
||||
|
||||
// modification des Isos V de la bande en U d'indice i
|
||||
for (j=1;j<=S0.Length();j++) {
|
||||
Is = S0.Value(j);
|
||||
Is.ChangeDomain(Udeb,CuttingValue);
|
||||
Is.ResetApprox();
|
||||
S0.SetValue(j,Is);
|
||||
}
|
||||
myUConstraints.SetValue(i,S0);
|
||||
{
|
||||
const AdvApp2Var_Strip& S0 = myUConstraints.Value(i);
|
||||
const Standard_Real Udeb = S0.First()->U0(), Ufin = S0.First()->U1();
|
||||
|
||||
// insertion d'une nouvelle bande en U apres l'indice i
|
||||
AdvApp2Var_Strip NewStrip;
|
||||
for (j=1;j<=S0.Length();j++) {
|
||||
AdvApp2Var_Iso NewIso((S0.Value(j)).Type(),(S0.Value(j)).Constante(),
|
||||
CuttingValue,Ufin,(S0.Value(j)).V0(),(S0.Value(j)).V1(),
|
||||
0,(S0.Value(j)).UOrder(),(S0.Value(j)).VOrder());
|
||||
NewIso.ResetApprox();
|
||||
NewStrip.Append(NewIso);
|
||||
// modification des Isos V de la bande en U d'indice i
|
||||
for (AdvApp2Var_Strip::Iterator aStripIter (S0); aStripIter.More(); aStripIter.Next())
|
||||
{
|
||||
const Handle(AdvApp2Var_Iso)& anIso = aStripIter.Value();
|
||||
anIso->ChangeDomain (Udeb, CuttingValue);
|
||||
anIso->ResetApprox();
|
||||
}
|
||||
|
||||
// insertion d'une nouvelle bande en U apres l'indice i
|
||||
AdvApp2Var_Strip aNewStrip;
|
||||
for (AdvApp2Var_Strip::Iterator aStripIter (S0); aStripIter.More(); aStripIter.Next())
|
||||
{
|
||||
const Handle(AdvApp2Var_Iso)& anIso = aStripIter.Value();
|
||||
Handle(AdvApp2Var_Iso) aNewIso = new AdvApp2Var_Iso (anIso->Type(), anIso->Constante(),
|
||||
CuttingValue, Ufin, anIso->V0(), anIso->V1(),
|
||||
0, anIso->UOrder(), anIso->VOrder());
|
||||
aNewIso->ResetApprox();
|
||||
aNewStrip.Append (aNewIso);
|
||||
}
|
||||
myUConstraints.InsertAfter (i, aNewStrip);
|
||||
}
|
||||
myUConstraints.InsertAfter(i,NewStrip);
|
||||
|
||||
// insertion d'une nouvelle Iso U=U* dans chaque bande en V apres l'indice i
|
||||
// et restriction des paves des Isos adjacentes
|
||||
for (j=1;j<=myVConstraints.Length();j++) {
|
||||
S0 = myVConstraints.Value(j);
|
||||
Is = S0.Value(i);
|
||||
Is.ChangeDomain(Is.U0(),CuttingValue,Is.V0(),Is.V1());
|
||||
S0.SetValue(i,Is);
|
||||
AdvApp2Var_Iso NewIso(Is.Type(),CuttingValue,Is.U0(),CuttingValue,Is.V0(),Is.V1(),
|
||||
0,Is.UOrder(),Is.VOrder());
|
||||
NewIso.ResetApprox();
|
||||
S0.InsertAfter(i,NewIso);
|
||||
Is = S0.Value(i+2);
|
||||
Is.ChangeDomain(CuttingValue,Is.U1(),Is.V0(),Is.V1());
|
||||
S0.SetValue(i+2,Is);
|
||||
myVConstraints.SetValue(j,S0);
|
||||
for (Standard_Integer j = 1; j <= myVConstraints.Length(); j++)
|
||||
{
|
||||
AdvApp2Var_Strip& S0 = myVConstraints.ChangeValue(j);
|
||||
Handle(AdvApp2Var_Iso) anIso = S0.Value(i);
|
||||
anIso->ChangeDomain (anIso->U0(), CuttingValue, anIso->V0(), anIso->V1());
|
||||
|
||||
Handle(AdvApp2Var_Iso) aNewIso = new AdvApp2Var_Iso (anIso->Type(), CuttingValue, anIso->U0(), CuttingValue, anIso->V0(), anIso->V1(),
|
||||
0, anIso->UOrder(), anIso->VOrder());
|
||||
aNewIso->ResetApprox();
|
||||
S0.InsertAfter (i, aNewIso);
|
||||
|
||||
anIso = S0.Value(i+2);
|
||||
anIso->ChangeDomain (CuttingValue, anIso->U1(), anIso->V0(), anIso->V1());
|
||||
}
|
||||
|
||||
// insertion des nouveaux noeuds (U*,Vj)
|
||||
AdvApp2Var_Node Prev, Next;
|
||||
Prev=myNodeConstraints.Value(1);
|
||||
for (j=1;j<myNodeConstraints.Length();j++) {
|
||||
Next=myNodeConstraints.Value(j+1);
|
||||
if ((Prev.Coord()).X()<CuttingValue && ((Next.Coord()).X()>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);
|
||||
Handle(AdvApp2Var_Node) aNext;
|
||||
Handle(AdvApp2Var_Node) aPrev = myNodeConstraints.First();
|
||||
for (Standard_Integer j = 1; j < myNodeConstraints.Length(); j++)
|
||||
{
|
||||
aNext = myNodeConstraints.Value(j+1);
|
||||
if (aPrev->Coord().X() < CuttingValue
|
||||
&& aNext->Coord().X() > CuttingValue
|
||||
&& aPrev->Coord().Y() == aNext->Coord().Y())
|
||||
{
|
||||
gp_XY aNewUV (CuttingValue, aPrev->Coord().Y());
|
||||
Handle(AdvApp2Var_Node) aNewNode = new AdvApp2Var_Node (aNewUV, aPrev->UOrder(), aPrev->VOrder());
|
||||
myNodeConstraints.InsertAfter (j, aNewNode);
|
||||
}
|
||||
Prev=Next;
|
||||
aPrev = aNext;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,65 +297,69 @@ void AdvApp2Var_Framework::UpdateInU(const Standard_Real CuttingValue)
|
||||
|
||||
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()<CuttingValue) {
|
||||
Standard_Integer j=1;
|
||||
while (myVConstraints.Value(j).First()->V0() > CuttingValue
|
||||
|| myVConstraints.Value(j).First()->V1() < CuttingValue)
|
||||
{
|
||||
j++;
|
||||
}
|
||||
AdvApp2Var_Strip S0;
|
||||
AdvApp2Var_Iso Is;
|
||||
S0 = myVConstraints.Value(j);
|
||||
Standard_Real Vdeb = (S0.Value(1)).V0(), Vfin = (S0.Value(1)).V1();
|
||||
|
||||
// modification des Isos U de la bande en V d'indice j
|
||||
for (i=1;i<=S0.Length();i++) {
|
||||
Is = S0.Value(i);
|
||||
Is.ChangeDomain(Vdeb,CuttingValue);
|
||||
Is.ResetApprox();
|
||||
S0.SetValue(i,Is);
|
||||
{
|
||||
AdvApp2Var_Strip& S0 = myVConstraints.ChangeValue(j);
|
||||
const Standard_Real Vdeb = S0.First()->V0(), Vfin = S0.First()->V1();
|
||||
|
||||
// modification des Isos U de la bande en V d'indice j
|
||||
for (AdvApp2Var_Strip::Iterator anIsoIter (S0); anIsoIter.More(); anIsoIter.Next())
|
||||
{
|
||||
const Handle(AdvApp2Var_Iso)& anIso = anIsoIter.Value();
|
||||
anIso->ChangeDomain (Vdeb, CuttingValue);
|
||||
anIso->ResetApprox();
|
||||
}
|
||||
|
||||
// insertion d'une nouvelle bande en V apres l'indice j
|
||||
AdvApp2Var_Strip aNewStrip;
|
||||
for (AdvApp2Var_Strip::Iterator anIsoIter (S0); anIsoIter.More(); anIsoIter.Next())
|
||||
{
|
||||
const Handle(AdvApp2Var_Iso)& anIso = anIsoIter.Value();
|
||||
Handle(AdvApp2Var_Iso) aNewIso = new AdvApp2Var_Iso (anIso->Type(), anIso->Constante(),
|
||||
anIso->U0(), anIso->U1(), CuttingValue, Vfin,
|
||||
0, anIso->UOrder(), anIso->VOrder());
|
||||
aNewIso->ResetApprox();
|
||||
aNewStrip.Append (aNewIso);
|
||||
}
|
||||
myVConstraints.InsertAfter(j, aNewStrip);
|
||||
}
|
||||
myVConstraints.SetValue(j,S0);
|
||||
|
||||
// insertion d'une nouvelle bande en V apres l'indice j
|
||||
AdvApp2Var_Strip NewStrip;
|
||||
for (i=1;i<=S0.Length();i++) {
|
||||
AdvApp2Var_Iso NewIso((S0.Value(i)).Type(),(S0.Value(i)).Constante(),
|
||||
(S0.Value(i)).U0(),(S0.Value(i)).U1(),CuttingValue,Vfin,
|
||||
0,(S0.Value(i)).UOrder(),(S0.Value(i)).VOrder());
|
||||
NewIso.ResetApprox();
|
||||
NewStrip.Append(NewIso);
|
||||
}
|
||||
myVConstraints.InsertAfter(j,NewStrip);
|
||||
// insertion d'une nouvelle Iso V=V* dans chaque bande en U apres l'indice j
|
||||
// et restriction des paves des Isos adjacentes
|
||||
for (AdvApp2Var_SequenceOfStrip::Iterator anUConstIter (myUConstraints); anUConstIter.More(); anUConstIter.Next())
|
||||
{
|
||||
AdvApp2Var_Strip& S0 = anUConstIter.ChangeValue();
|
||||
Handle(AdvApp2Var_Iso) anIso = S0.Value(j);
|
||||
anIso->ChangeDomain (anIso->U0(), anIso->U1(), anIso->V0(), CuttingValue);
|
||||
|
||||
// insertion d'une nouvelle Iso V=V* dans chaque bande en U apres l'indice j
|
||||
// et restriction des paves des Isos adjacentes
|
||||
for (i=1;i<=myUConstraints.Length();i++) {
|
||||
S0 = myUConstraints.Value(i);
|
||||
Is = S0.Value(j);
|
||||
Is.ChangeDomain(Is.U0(),Is.U1(),Is.V0(),CuttingValue);
|
||||
S0.SetValue(j,Is);
|
||||
AdvApp2Var_Iso NewIso(Is.Type(),CuttingValue,Is.U0(),Is.U1(),Is.V0(),CuttingValue,
|
||||
0,Is.UOrder(),Is.VOrder());
|
||||
NewIso.ResetApprox();
|
||||
S0.InsertAfter(j,NewIso);
|
||||
Is = S0.Value(j+2);
|
||||
Is.ChangeDomain(Is.U0(),Is.U1(),CuttingValue,Is.V1());
|
||||
S0.SetValue(j+2,Is);
|
||||
myUConstraints.SetValue(i,S0);
|
||||
Handle(AdvApp2Var_Iso) aNewIso = new AdvApp2Var_Iso (anIso->Type(), CuttingValue, anIso->U0(), anIso->U1(), anIso->V0(), CuttingValue,
|
||||
0, anIso->UOrder(), anIso->VOrder());
|
||||
aNewIso->ResetApprox();
|
||||
S0.InsertAfter (j, aNewIso);
|
||||
|
||||
anIso = S0.Value (j + 2);
|
||||
anIso->ChangeDomain (anIso->U0(), anIso->U1(), CuttingValue, anIso->V1());
|
||||
}
|
||||
|
||||
// insertion des nouveaux noeuds (Ui,V*)
|
||||
i = 1;
|
||||
while ( i<=myNodeConstraints.Length()
|
||||
&& ( ((myNodeConstraints.Value(i)).Coord()).Y()) < CuttingValue) {
|
||||
i+=myUConstraints.Length()+1;
|
||||
Standard_Integer i = 1;
|
||||
while (i <= myNodeConstraints.Length()
|
||||
&& myNodeConstraints.Value(i)->Coord().Y() < CuttingValue)
|
||||
{
|
||||
i += myUConstraints.Length() + 1;
|
||||
}
|
||||
for (j=1;j<=myUConstraints.Length()+1;j++) {
|
||||
gp_XY NewUV(((myNodeConstraints.Value(j)).Coord()).X(),CuttingValue);
|
||||
AdvApp2Var_Node NewNode(NewUV,
|
||||
(myNodeConstraints.Value(j)).UOrder(),
|
||||
(myNodeConstraints.Value(j)).VOrder());
|
||||
myNodeConstraints.InsertAfter(i+j-2,NewNode);
|
||||
for (j = 1; j <= myUConstraints.Length() + 1; j++)
|
||||
{
|
||||
const Handle(AdvApp2Var_Node)& aJNode = myNodeConstraints.Value(j);
|
||||
gp_XY NewUV (aJNode->Coord().X(), CuttingValue);
|
||||
Handle(AdvApp2Var_Node) aNewNode = new AdvApp2Var_Node (NewUV, aJNode->UOrder(), aJNode->VOrder());
|
||||
myNodeConstraints.InsertAfter (i+j-2, aNewNode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +372,7 @@ const Handle(TColStd_HArray1OfReal)&
|
||||
AdvApp2Var_Framework::UEquation(const Standard_Integer IndexIso,
|
||||
const Standard_Integer IndexStrip) const
|
||||
{
|
||||
return ((myVConstraints.Value(IndexStrip)).Value(IndexIso)).Polynom();
|
||||
return myVConstraints.Value(IndexStrip).Value(IndexIso)->Polynom();
|
||||
}
|
||||
|
||||
//==========================================================================================
|
||||
@@ -382,6 +384,6 @@ const Handle(TColStd_HArray1OfReal)&
|
||||
AdvApp2Var_Framework::VEquation(const Standard_Integer IndexIso,
|
||||
const Standard_Integer IndexStrip) const
|
||||
{
|
||||
return myUConstraints.Value(IndexStrip).Value(IndexIso).Polynom();
|
||||
return myUConstraints.Value(IndexStrip).Value(IndexIso)->Polynom();
|
||||
}
|
||||
|
||||
|
@@ -44,27 +44,25 @@ public:
|
||||
Standard_EXPORT AdvApp2Var_Framework();
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Framework(const AdvApp2Var_SequenceOfNode& Frame, const AdvApp2Var_SequenceOfStrip& UFrontier, const AdvApp2Var_SequenceOfStrip& VFrontier);
|
||||
|
||||
|
||||
//! search the Index of the first Iso not approximated,
|
||||
//! if all Isos are approximated Standard_False is returned.
|
||||
Standard_EXPORT Standard_Boolean FirstNotApprox (Standard_Integer& IndexIso, Standard_Integer& IndexStrip, AdvApp2Var_Iso& anIso) const;
|
||||
//! if all Isos are approximated NULL is returned.
|
||||
Standard_EXPORT Handle(AdvApp2Var_Iso) FirstNotApprox (Standard_Integer& IndexIso, Standard_Integer& IndexStrip) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer FirstNode (const GeomAbs_IsoType Type, const Standard_Integer IndexIso, const Standard_Integer IndexStrip) const;
|
||||
|
||||
Standard_EXPORT Standard_Integer LastNode (const GeomAbs_IsoType Type, const Standard_Integer IndexIso, const Standard_Integer IndexStrip) const;
|
||||
|
||||
Standard_EXPORT void ChangeIso (const Standard_Integer IndexIso, const Standard_Integer IndexStrip, const AdvApp2Var_Iso& anIso);
|
||||
Standard_EXPORT void ChangeIso (const Standard_Integer IndexIso, const Standard_Integer IndexStrip, const Handle(AdvApp2Var_Iso)& anIso);
|
||||
|
||||
const AdvApp2Var_Node& Node (const Standard_Integer IndexNode) const;
|
||||
const Handle(AdvApp2Var_Node)& Node (const Standard_Integer IndexNode) const { return myNodeConstraints.Value(IndexNode); }
|
||||
|
||||
Standard_EXPORT const AdvApp2Var_Node& Node (const Standard_Real U, const Standard_Real V) const;
|
||||
Standard_EXPORT const Handle(AdvApp2Var_Node)& Node (const Standard_Real U, const Standard_Real V) const;
|
||||
|
||||
Standard_EXPORT const AdvApp2Var_Iso& IsoU (const Standard_Real U, const Standard_Real V0, const Standard_Real V1) const;
|
||||
|
||||
Standard_EXPORT const AdvApp2Var_Iso& IsoV (const Standard_Real U0, const Standard_Real U1, const Standard_Real V) const;
|
||||
|
||||
AdvApp2Var_Node& ChangeNode (const Standard_Integer IndexNode);
|
||||
|
||||
Standard_EXPORT void UpdateInU (const Standard_Real CuttingValue);
|
||||
|
||||
Standard_EXPORT void UpdateInV (const Standard_Real CuttingValue);
|
||||
@@ -73,31 +71,12 @@ public:
|
||||
|
||||
Standard_EXPORT const Handle(TColStd_HArray1OfReal)& VEquation (const Standard_Integer IndexIso, const Standard_Integer IndexStrip) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
AdvApp2Var_SequenceOfNode myNodeConstraints;
|
||||
AdvApp2Var_SequenceOfStrip myUConstraints;
|
||||
AdvApp2Var_SequenceOfStrip myVConstraints;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AdvApp2Var_Framework.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AdvApp2Var_Framework_HeaderFile
|
||||
|
@@ -1,27 +0,0 @@
|
||||
// Created on: 1996-06-17
|
||||
// Created by: Philippe MANGIN
|
||||
// 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.
|
||||
|
||||
inline const AdvApp2Var_Node& AdvApp2Var_Framework::Node(
|
||||
const Standard_Integer IndexNode) const
|
||||
{
|
||||
return myNodeConstraints.Value(IndexNode);
|
||||
}
|
||||
|
||||
inline AdvApp2Var_Node& AdvApp2Var_Framework::ChangeNode(
|
||||
const Standard_Integer IndexNode)
|
||||
{
|
||||
return myNodeConstraints.ChangeValue(IndexNode);
|
||||
}
|
@@ -14,16 +14,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AdvApp2Var_Iso.hxx>
|
||||
|
||||
#include <AdvApp2Var_ApproxF2var.hxx>
|
||||
#include <AdvApp2Var_Context.hxx>
|
||||
#include <AdvApp2Var_Iso.hxx>
|
||||
#include <AdvApp2Var_Node.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TColStd_HArray1OfInteger.hxx>
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray2OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AdvApp2Var_Iso, Standard_Transient)
|
||||
|
||||
//=======================================================================
|
||||
//function : AdvApp2Var_Iso
|
||||
//purpose :
|
||||
|
@@ -31,16 +31,12 @@
|
||||
class AdvApp2Var_Context;
|
||||
class AdvApp2Var_Node;
|
||||
|
||||
|
||||
|
||||
//! used to store constraints on a line U = Ui or V = Vj
|
||||
class AdvApp2Var_Iso
|
||||
class AdvApp2Var_Iso : public Standard_Transient
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(AdvApp2Var_Iso, Standard_Transient)
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Iso();
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Iso(const GeomAbs_IsoType type, const Standard_Integer iu, const Standard_Integer iv);
|
||||
@@ -99,20 +95,12 @@ public:
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HArray2OfReal) MoyErrors() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Iso(const AdvApp2Var_Iso& Other);
|
||||
AdvApp2Var_Iso(const AdvApp2Var_Iso& Other);
|
||||
AdvApp2Var_Iso& operator= (const AdvApp2Var_Iso& theOther);
|
||||
|
||||
private:
|
||||
|
||||
GeomAbs_IsoType myType;
|
||||
Standard_Real myConstPar;
|
||||
@@ -132,13 +120,6 @@ private:
|
||||
Handle(TColStd_HArray1OfReal) mySomTab;
|
||||
Handle(TColStd_HArray1OfReal) myDifTab;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AdvApp2Var_Iso_HeaderFile
|
||||
|
@@ -52,15 +52,19 @@ AdvApp2Var_Network::AdvApp2Var_Network(const AdvApp2Var_SequenceOfPatch& Net,
|
||||
//purpose : return the first Patch not approximated
|
||||
//==========================================================================================
|
||||
|
||||
Standard_Boolean AdvApp2Var_Network::FirstNotApprox(Standard_Integer& Index) const
|
||||
Standard_Boolean AdvApp2Var_Network::FirstNotApprox(Standard_Integer& theIndex) const
|
||||
{
|
||||
Standard_Boolean good = Standard_True;
|
||||
Standard_Integer i;
|
||||
for (i = 1; i <= myNet.Length() && good; i++) {
|
||||
good = myNet.Value(i).IsApproximated();
|
||||
if (!good) {Index = i;}
|
||||
Standard_Integer anIndex = 1;
|
||||
for (AdvApp2Var_SequenceOfPatch::Iterator aPatchIter (myNet); aPatchIter.More(); aPatchIter.Next(), ++anIndex)
|
||||
{
|
||||
const Handle(AdvApp2Var_Patch)& aPatch = aPatchIter.Value();
|
||||
if (!aPatch->IsApproximated())
|
||||
{
|
||||
theIndex = anIndex;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return !good;
|
||||
return false;
|
||||
}
|
||||
|
||||
//==========================================================================================
|
||||
@@ -78,23 +82,20 @@ void AdvApp2Var_Network::UpdateInU(const Standard_Real CuttingValue)
|
||||
}
|
||||
myUParameters.InsertBefore(i,CuttingValue);
|
||||
|
||||
Standard_Integer indice;
|
||||
for (j=1; j< myVParameters.Length() ; j++){
|
||||
|
||||
for (j=1; j< myVParameters.Length() ; j++)
|
||||
{
|
||||
// modification des patches concernes par la decoupe
|
||||
AdvApp2Var_Patch Pat;
|
||||
indice = (myUParameters.Length()-1) * (j-1) + i - 1;
|
||||
Pat = myNet.Value(indice);
|
||||
Pat.ChangeDomain(Pat.U0(), CuttingValue, Pat.V0(), Pat.V1());
|
||||
Pat.ResetApprox();
|
||||
myNet.SetValue(indice, Pat);
|
||||
Standard_Integer indice = (myUParameters.Length()-1) * (j-1) + i - 1;
|
||||
const Handle(AdvApp2Var_Patch)& aPat = myNet.Value(indice);
|
||||
aPat->ChangeDomain (aPat->U0(), CuttingValue, aPat->V0(), aPat->V1());
|
||||
aPat->ResetApprox();
|
||||
|
||||
// insertion des nouveaux patches
|
||||
AdvApp2Var_Patch NewPat(CuttingValue,myUParameters.Value(i+1),
|
||||
Handle(AdvApp2Var_Patch) aNewPat = new AdvApp2Var_Patch (CuttingValue,myUParameters.Value(i+1),
|
||||
myVParameters.Value(j),myVParameters.Value(j+1),
|
||||
Pat.UOrder(),Pat.VOrder());
|
||||
NewPat.ResetApprox();
|
||||
myNet.InsertAfter(indice, NewPat);
|
||||
aPat->UOrder(), aPat->VOrder());
|
||||
aNewPat->ResetApprox();
|
||||
myNet.InsertAfter(indice, aNewPat);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -108,31 +109,32 @@ void AdvApp2Var_Network::UpdateInV(const Standard_Real CuttingValue)
|
||||
{
|
||||
|
||||
// insertion du nouveau parametre de decoupe
|
||||
Standard_Integer i,j=1;
|
||||
AdvApp2Var_Patch Pat;
|
||||
while (myVParameters.Value(j)<CuttingValue) {
|
||||
Standard_Integer j = 1;
|
||||
Handle(AdvApp2Var_Patch) Pat;
|
||||
while (myVParameters.Value(j)<CuttingValue)
|
||||
{
|
||||
j++;
|
||||
}
|
||||
myVParameters.InsertBefore(j,CuttingValue);
|
||||
|
||||
// modification des patches concernes par la decoupe
|
||||
Standard_Integer indice;
|
||||
for (i=1; i< myUParameters.Length() ; i++){
|
||||
indice = (myUParameters.Length()-1) * (j-2) + i;
|
||||
for (Standard_Integer i = 1; i < myUParameters.Length(); i++)
|
||||
{
|
||||
const Standard_Integer indice = (myUParameters.Length()-1) * (j-2) + i;
|
||||
Pat = myNet.Value(indice);
|
||||
Pat.ChangeDomain(Pat.U0(), Pat.U1(), Pat.V0(), CuttingValue);
|
||||
Pat.ResetApprox();
|
||||
myNet.SetValue(indice,Pat);
|
||||
Pat->ChangeDomain(Pat->U0(), Pat->U1(), Pat->V0(), CuttingValue);
|
||||
Pat->ResetApprox();
|
||||
}
|
||||
|
||||
// insertion des nouveaux patches
|
||||
for (i=1; i< myUParameters.Length() ; i++){
|
||||
indice = (myUParameters.Length()-1) * (j-1) + i-1;
|
||||
AdvApp2Var_Patch NewPat(myUParameters.Value(i), myUParameters.Value(i+1),
|
||||
for (Standard_Integer i = 1; i < myUParameters.Length(); i++)
|
||||
{
|
||||
const Standard_Integer indice = (myUParameters.Length()-1) * (j-1) + i-1;
|
||||
Handle(AdvApp2Var_Patch) aNewPat = new AdvApp2Var_Patch (myUParameters.Value(i), myUParameters.Value(i+1),
|
||||
CuttingValue,myVParameters.Value(j+1),
|
||||
Pat.UOrder(),Pat.VOrder());
|
||||
NewPat.ResetApprox();
|
||||
myNet.InsertAfter(indice,NewPat);
|
||||
Pat->UOrder(),Pat->VOrder());
|
||||
aNewPat->ResetApprox();
|
||||
myNet.InsertAfter (indice, aNewPat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,22 +148,21 @@ void AdvApp2Var_Network::SameDegree(const Standard_Integer iu,
|
||||
Standard_Integer& ncfu,
|
||||
Standard_Integer& ncfv)
|
||||
{
|
||||
|
||||
// calcul des coeff. max avec init selon l'ordre de continuite
|
||||
Standard_Integer IndPat;
|
||||
ncfu = 2*iu+2;
|
||||
ncfv = 2*iv+2;
|
||||
for (IndPat=1;IndPat<=myNet.Length();IndPat++) {
|
||||
ncfu = Max(ncfu,myNet.Value(IndPat).NbCoeffInU());
|
||||
ncfv = Max(ncfv,myNet.Value(IndPat).NbCoeffInV());
|
||||
for (AdvApp2Var_SequenceOfPatch::Iterator aPatIter (myNet); aPatIter.More(); aPatIter.Next())
|
||||
{
|
||||
const Handle(AdvApp2Var_Patch)& aPat = aPatIter.Value();
|
||||
ncfu = Max(ncfu, aPat->NbCoeffInU());
|
||||
ncfv = Max(ncfv, aPat->NbCoeffInV());
|
||||
}
|
||||
|
||||
// augmentation des nombres de coeff.
|
||||
AdvApp2Var_Patch Pat;
|
||||
for (IndPat=1;IndPat<=myNet.Length();IndPat++) {
|
||||
Pat = myNet.Value(IndPat);
|
||||
Pat.ChangeNbCoeff(ncfu,ncfv);
|
||||
myNet.SetValue(IndPat,Pat);
|
||||
for (AdvApp2Var_SequenceOfPatch::Iterator aPatIter (myNet); aPatIter.More(); aPatIter.Next())
|
||||
{
|
||||
const Handle(AdvApp2Var_Patch)& aPat = aPatIter.Value();
|
||||
aPat->ChangeNbCoeff (ncfu, ncfv);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -46,11 +46,8 @@ public:
|
||||
//! if all Patches are approximated Standard_False is returned
|
||||
Standard_EXPORT Standard_Boolean FirstNotApprox (Standard_Integer& Index) const;
|
||||
|
||||
AdvApp2Var_Patch& ChangePatch (const Standard_Integer Index);
|
||||
AdvApp2Var_Patch& operator() (const Standard_Integer Index)
|
||||
{
|
||||
return ChangePatch(Index);
|
||||
}
|
||||
AdvApp2Var_Patch& ChangePatch (const Standard_Integer Index) { return *myNet.Value(Index); }
|
||||
AdvApp2Var_Patch& operator() (const Standard_Integer Index) { return ChangePatch(Index); }
|
||||
|
||||
Standard_EXPORT void UpdateInU (const Standard_Real CuttingValue);
|
||||
|
||||
@@ -67,38 +64,23 @@ public:
|
||||
Standard_EXPORT Standard_Real UParameter (const Standard_Integer Index) const;
|
||||
|
||||
Standard_EXPORT Standard_Real VParameter (const Standard_Integer Index) const;
|
||||
|
||||
const AdvApp2Var_Patch& Patch (const Standard_Integer UIndex, const Standard_Integer VIndex) const;
|
||||
|
||||
const AdvApp2Var_Patch& Patch (const Standard_Integer UIndex, const Standard_Integer VIndex) const
|
||||
{
|
||||
return *myNet.Value ((VIndex-1)*(myUParameters.Length()-1) + UIndex);
|
||||
}
|
||||
|
||||
const AdvApp2Var_Patch& operator() (const Standard_Integer UIndex, const Standard_Integer VIndex) const
|
||||
{
|
||||
return Patch(UIndex,VIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
return Patch(UIndex,VIndex);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
AdvApp2Var_SequenceOfPatch myNet;
|
||||
TColStd_SequenceOfReal myUParameters;
|
||||
TColStd_SequenceOfReal myVParameters;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AdvApp2Var_Network.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AdvApp2Var_Network_HeaderFile
|
||||
|
@@ -1,29 +0,0 @@
|
||||
// Created on: 1996-06-13
|
||||
// Created by: Philippe MANGIN
|
||||
// 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.
|
||||
|
||||
//#include <TColStd_HArray1OfReal.hxx>
|
||||
|
||||
inline AdvApp2Var_Patch& AdvApp2Var_Network::ChangePatch(const Standard_Integer Index)
|
||||
{
|
||||
return myNet(Index);
|
||||
}
|
||||
|
||||
inline const AdvApp2Var_Patch& AdvApp2Var_Network::Patch(const Standard_Integer UIndex,
|
||||
const Standard_Integer VIndex) const
|
||||
{
|
||||
return myNet( (VIndex-1)*(myUParameters.Length()-1) + UIndex);
|
||||
}
|
||||
|
@@ -14,26 +14,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <AdvApp2Var_Node.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_XY.hxx>
|
||||
#include <TColgp_HArray2OfPnt.hxx>
|
||||
#include <TColStd_HArray2OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AdvApp2Var_Node, Standard_Transient)
|
||||
|
||||
//=======================================================================
|
||||
//function : AdvApp2Var_Node
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
AdvApp2Var_Node::AdvApp2Var_Node() :
|
||||
myOrdInU(2),
|
||||
myOrdInV(2)
|
||||
AdvApp2Var_Node::AdvApp2Var_Node()
|
||||
: myTruePoints(0, 2, 0, 2),
|
||||
myErrors (0, 2, 0, 2),
|
||||
myOrdInU (2),
|
||||
myOrdInV (2)
|
||||
{
|
||||
myTruePoints = new TColgp_HArray2OfPnt ( 0, 2, 0, 2);
|
||||
gp_Pnt P0(0.,0.,0.);
|
||||
myTruePoints->Init(P0);
|
||||
myErrors = new TColStd_HArray2OfReal( 0, 2, 0, 2);
|
||||
myErrors->Init(0.);
|
||||
myTruePoints.Init(P0);
|
||||
myErrors.Init(0.);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -42,15 +39,15 @@ myOrdInV(2)
|
||||
//=======================================================================
|
||||
|
||||
AdvApp2Var_Node::AdvApp2Var_Node(const Standard_Integer iu,
|
||||
const Standard_Integer iv) :
|
||||
myOrdInU(iu),
|
||||
myOrdInV(iv)
|
||||
const Standard_Integer iv)
|
||||
: myTruePoints(0, Max(0,iu), 0, Max(0,iv)),
|
||||
myErrors (0, Max(0,iu), 0, Max(0,iv)),
|
||||
myOrdInU (iu),
|
||||
myOrdInV (iv)
|
||||
{
|
||||
myTruePoints = new TColgp_HArray2OfPnt ( 0, Max(0,iu), 0, Max(0,iv));
|
||||
gp_Pnt P0(0.,0.,0.);
|
||||
myTruePoints->Init(P0);
|
||||
myErrors = new TColStd_HArray2OfReal( 0, Max(0,iu), 0, Max(0,iv));
|
||||
myErrors->Init(0.);
|
||||
myTruePoints.Init(P0);
|
||||
myErrors.Init(0.);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -60,118 +57,14 @@ myOrdInV(iv)
|
||||
|
||||
AdvApp2Var_Node::AdvApp2Var_Node(const gp_XY& UV,
|
||||
const Standard_Integer iu,
|
||||
const Standard_Integer iv) :
|
||||
myCoord(UV),
|
||||
myOrdInU(iu),
|
||||
myOrdInV(iv)
|
||||
const Standard_Integer iv)
|
||||
: myTruePoints(0, iu, 0, iv),
|
||||
myErrors (0, iu, 0, iv),
|
||||
myCoord (UV),
|
||||
myOrdInU(iu),
|
||||
myOrdInV(iv)
|
||||
{
|
||||
myTruePoints = new TColgp_HArray2OfPnt ( 0, iu, 0, iv);
|
||||
gp_Pnt P0(0.,0.,0.);
|
||||
myTruePoints->Init(P0);
|
||||
myErrors = new TColStd_HArray2OfReal( 0, iu, 0, iv);
|
||||
myErrors->Init(0.);
|
||||
myTruePoints.Init(P0);
|
||||
myErrors.Init(0.);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Coord
|
||||
//purpose : returns the coordinates (U,V) of the node
|
||||
//=======================================================================
|
||||
|
||||
gp_XY AdvApp2Var_Node::Coord() const
|
||||
{
|
||||
return myCoord;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetCoord
|
||||
//purpose : changes the coordinates (U,V) to (x1,x2)
|
||||
//=======================================================================
|
||||
|
||||
void AdvApp2Var_Node::SetCoord(const Standard_Real x1,
|
||||
const Standard_Real x2)
|
||||
{
|
||||
myCoord.SetX(x1);
|
||||
myCoord.SetY(x2);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : UOrder
|
||||
//purpose : returns the continuity order in U of the node
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer AdvApp2Var_Node::UOrder() const
|
||||
{
|
||||
return myOrdInU;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : VOrder
|
||||
//purpose : returns the continuity order in V of the node
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer AdvApp2Var_Node::VOrder() const
|
||||
{
|
||||
return myOrdInV;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPoint
|
||||
//purpose : affects the value F(U,V) or its derivates on the node (U,V)
|
||||
//=======================================================================
|
||||
|
||||
void AdvApp2Var_Node::SetPoint(const Standard_Integer iu,
|
||||
const Standard_Integer iv,
|
||||
const gp_Pnt& Pt)
|
||||
{
|
||||
myTruePoints->SetValue(iu, iv, Pt);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Point
|
||||
//purpose : returns the value F(U,V) or its derivates on the node (U,V)
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt AdvApp2Var_Node::Point(const Standard_Integer iu,
|
||||
const Standard_Integer iv) const
|
||||
{
|
||||
return myTruePoints->Value(iu, iv);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetError
|
||||
//purpose : affects the error between F(U,V) and its approximation
|
||||
//=======================================================================
|
||||
|
||||
void AdvApp2Var_Node::SetError(const Standard_Integer iu,
|
||||
const Standard_Integer iv,
|
||||
const Standard_Real error)
|
||||
{
|
||||
myErrors->SetValue(iu, iv, error);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Error
|
||||
//purpose : returns the error between F(U,V) and its approximation
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real AdvApp2Var_Node::Error(const Standard_Integer iu,
|
||||
const Standard_Integer iv) const
|
||||
{
|
||||
return myErrors->Value(iu, iv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -17,78 +17,85 @@
|
||||
#ifndef _AdvApp2Var_Node_HeaderFile
|
||||
#define _AdvApp2Var_Node_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_XY.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColgp_HArray2OfPnt.hxx>
|
||||
#include <TColStd_HArray2OfReal.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class gp_XY;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
|
||||
//! used to store constraints on a (Ui,Vj) point
|
||||
class AdvApp2Var_Node
|
||||
class AdvApp2Var_Node : public Standard_Transient
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(AdvApp2Var_Node, Standard_Transient)
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Node();
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Node(const Standard_Integer iu, const Standard_Integer iv);
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Node(const gp_XY& UV, const Standard_Integer iu, const Standard_Integer iv);
|
||||
|
||||
Standard_EXPORT gp_XY Coord() const;
|
||||
|
||||
Standard_EXPORT void SetCoord (const Standard_Real x1, const Standard_Real x2);
|
||||
|
||||
Standard_EXPORT Standard_Integer UOrder() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer VOrder() const;
|
||||
|
||||
Standard_EXPORT void SetPoint (const Standard_Integer iu, const Standard_Integer iv, const gp_Pnt& Cte);
|
||||
|
||||
Standard_EXPORT gp_Pnt Point (const Standard_Integer iu, const Standard_Integer iv) const;
|
||||
|
||||
Standard_EXPORT void SetError (const Standard_Integer iu, const Standard_Integer iv, const Standard_Real error);
|
||||
|
||||
Standard_EXPORT Standard_Real Error (const Standard_Integer iu, const Standard_Integer iv) const;
|
||||
|
||||
//! Returns the coordinates (U,V) of the node
|
||||
const gp_XY& Coord() const { return myCoord; }
|
||||
|
||||
//! changes the coordinates (U,V) to (x1,x2)
|
||||
void SetCoord (const Standard_Real x1, const Standard_Real x2)
|
||||
{
|
||||
myCoord.SetX(x1);
|
||||
myCoord.SetY(x2);
|
||||
}
|
||||
|
||||
//! returns the continuity order in U of the node
|
||||
Standard_Integer UOrder() const { return myOrdInU; }
|
||||
|
||||
protected:
|
||||
//! returns the continuity order in V of the node
|
||||
Standard_Integer VOrder() const { return myOrdInV; }
|
||||
|
||||
//! affects the value F(U,V) or its derivates on the node (U,V)
|
||||
void SetPoint (const Standard_Integer iu, const Standard_Integer iv, const gp_Pnt& Pt)
|
||||
{
|
||||
myTruePoints.SetValue(iu, iv, Pt);
|
||||
}
|
||||
|
||||
//! returns the value F(U,V) or its derivates on the node (U,V)
|
||||
const gp_Pnt& Point (const Standard_Integer iu, const Standard_Integer iv) const
|
||||
{
|
||||
return myTruePoints.Value(iu, iv);
|
||||
}
|
||||
|
||||
//! affects the error between F(U,V) and its approximation
|
||||
void SetError (const Standard_Integer iu, const Standard_Integer iv, const Standard_Real error)
|
||||
{
|
||||
myErrors.SetValue(iu, iv, error);
|
||||
}
|
||||
|
||||
//! returns the error between F(U,V) and its approximation
|
||||
Standard_Real Error (const Standard_Integer iu, const Standard_Integer iv) const { return myErrors.Value(iu, iv); }
|
||||
|
||||
//! Assign operator.
|
||||
AdvApp2Var_Node& operator= (const AdvApp2Var_Node& theOther)
|
||||
{
|
||||
myTruePoints = theOther.myTruePoints;
|
||||
myErrors = theOther.myErrors;
|
||||
myCoord = theOther.myCoord;
|
||||
myOrdInU = theOther.myOrdInU;
|
||||
myOrdInV = theOther.myOrdInV;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Node(const AdvApp2Var_Node& Other);
|
||||
AdvApp2Var_Node (const AdvApp2Var_Node& theOther);
|
||||
|
||||
private:
|
||||
|
||||
TColgp_Array2OfPnt myTruePoints;
|
||||
TColStd_Array2OfReal myErrors;
|
||||
gp_XY myCoord;
|
||||
Standard_Integer myOrdInU;
|
||||
Standard_Integer myOrdInV;
|
||||
Handle(TColgp_HArray2OfPnt) myTruePoints;
|
||||
Handle(TColStd_HArray2OfReal) myErrors;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _AdvApp2Var_Node_HeaderFile
|
||||
|
@@ -40,6 +40,8 @@
|
||||
#include <TColStd_HArray1OfReal.hxx>
|
||||
#include <TColStd_HArray2OfReal.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(AdvApp2Var_Patch, Standard_Transient)
|
||||
|
||||
//============================================================================
|
||||
//function : AdvApp2Var_Patch
|
||||
//purpose :
|
||||
@@ -144,35 +146,35 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
|
||||
rho = pow(du,iu)*pow(dv,iv);
|
||||
|
||||
// F(U0,V0) and its derivatives normalized on (-1,1)
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).X();
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV0))->Point(iu,iv)).X();
|
||||
HCOINS->SetValue( 1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv , valnorm );
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Y();
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV0))->Point(iu,iv)).Y();
|
||||
HCOINS->SetValue( 2+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Z();
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV0))->Point(iu,iv)).Z();
|
||||
HCOINS->SetValue( 3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
|
||||
// F(U1,V0) and its derivatives normalized on (-1,1)
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).X();
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV0))->Point(iu,iv)).X();
|
||||
HCOINS->SetValue( SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Y();
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV0))->Point(iu,iv)).Y();
|
||||
HCOINS->SetValue( SIZE+2+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Z();
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV0))->Point(iu,iv)).Z();
|
||||
HCOINS->SetValue( SIZE+3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
|
||||
// F(U0,V1) and its derivatives normalized on (-1,1)
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).X();
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV1))->Point(iu,iv)).X();
|
||||
HCOINS->SetValue( 2*SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Y();
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV1))->Point(iu,iv)).Y();
|
||||
HCOINS->SetValue( 2*SIZE+2+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Z();
|
||||
valnorm = rho * ((Constraints.Node(myU0,myV1))->Point(iu,iv)).Z();
|
||||
HCOINS->SetValue( 2*SIZE+3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
|
||||
// F(U1,V1) and its derivatives normalized on (-1,1)
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).X();
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV1))->Point(iu,iv)).X();
|
||||
HCOINS->SetValue( 3*SIZE+1+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).Y();
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV1))->Point(iu,iv)).Y();
|
||||
HCOINS->SetValue( 3*SIZE+2+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).Z();
|
||||
valnorm = rho * ((Constraints.Node(myU1,myV1))->Point(iu,iv)).Z();
|
||||
HCOINS->SetValue( 3*SIZE+3+NDIMEN*iu+NDIMEN*(IORDRU+2)*iv, valnorm );
|
||||
}
|
||||
}
|
||||
@@ -543,38 +545,38 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
|
||||
|
||||
// -F(U0,V0) and its derivatives normalized on (-1,1)
|
||||
ideb = HCOINS->Lower() + NDIMEN*iu+NDIMEN*(IORDRU+2)*iv - 1;
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).X();
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV0))->Point(iu,iv)).X();
|
||||
HCOINS->SetValue( 1+ideb , valnorm );
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Y();
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV0))->Point(iu,iv)).Y();
|
||||
HCOINS->SetValue( 2+ideb , valnorm );
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV0)).Point(iu,iv)).Z();
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV0))->Point(iu,iv)).Z();
|
||||
HCOINS->SetValue( 3+ideb , valnorm );
|
||||
|
||||
// -F(U1,V0) and its derivatives normalized on (-1,1)
|
||||
ideb += SIZE;
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).X();
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV0))->Point(iu,iv)).X();
|
||||
HCOINS->SetValue( 1+ideb , valnorm );
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Y();
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV0))->Point(iu,iv)).Y();
|
||||
HCOINS->SetValue( 2+ideb , valnorm );
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV0)).Point(iu,iv)).Z();
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV0))->Point(iu,iv)).Z();
|
||||
HCOINS->SetValue( 3+ideb , valnorm );
|
||||
|
||||
// -F(U0,V1) and its derivatives normalized on (-1,1)
|
||||
ideb += SIZE;
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).X();
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV1))->Point(iu,iv)).X();
|
||||
HCOINS->SetValue( 1+ideb , valnorm );
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Y();
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV1))->Point(iu,iv)).Y();
|
||||
HCOINS->SetValue( 2+ideb , valnorm );
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV1)).Point(iu,iv)).Z();
|
||||
valnorm = -rho * ((Constraints.Node(myU0,myV1))->Point(iu,iv)).Z();
|
||||
HCOINS->SetValue( 3+ideb , valnorm );
|
||||
|
||||
// -F(U1,V1) and its derivatives normalized on (-1,1)
|
||||
ideb += SIZE;
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).X();
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV1))->Point(iu,iv)).X();
|
||||
HCOINS->SetValue( 1+ideb , valnorm );
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).Y();
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV1))->Point(iu,iv)).Y();
|
||||
HCOINS->SetValue( 2+ideb , valnorm );
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV1)).Point(iu,iv)).Z();
|
||||
valnorm = -rho * ((Constraints.Node(myU1,myV1))->Point(iu,iv)).Z();
|
||||
HCOINS->SetValue( 3+ideb , valnorm );
|
||||
}
|
||||
}
|
||||
@@ -721,13 +723,13 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints)
|
||||
Standard_Real emax1=0.,emax2=0.,emax3=0.,emax4=0.,err1,err2,err3,err4;
|
||||
for (iu=0;iu<=myOrdInU;iu++) {
|
||||
for (iv=0;iv<=myOrdInV;iv++) {
|
||||
error = (Constraints.Node(myU0,myV0)).Error(iu,iv);
|
||||
error = (Constraints.Node(myU0,myV0))->Error(iu,iv);
|
||||
emax1 = Max(emax1,error);
|
||||
error = (Constraints.Node(myU1,myV0)).Error(iu,iv);
|
||||
error = (Constraints.Node(myU1,myV0))->Error(iu,iv);
|
||||
emax2 = Max(emax2,error);
|
||||
error = (Constraints.Node(myU0,myV1)).Error(iu,iv);
|
||||
error = (Constraints.Node(myU0,myV1))->Error(iu,iv);
|
||||
emax3 = Max(emax3,error);
|
||||
error = (Constraints.Node(myU1,myV1)).Error(iu,iv);
|
||||
error = (Constraints.Node(myU1,myV1))->Error(iu,iv);
|
||||
emax4 = Max(emax4,error);
|
||||
}
|
||||
}
|
||||
|
@@ -35,12 +35,10 @@ class AdvApp2Var_Criterion;
|
||||
|
||||
|
||||
//! used to store results on a domain [Ui,Ui+1]x[Vj,Vj+1]
|
||||
class AdvApp2Var_Patch
|
||||
class AdvApp2Var_Patch : public Standard_Transient
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(AdvApp2Var_Patch, Standard_Transient)
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Patch();
|
||||
|
||||
@@ -102,20 +100,12 @@ public:
|
||||
|
||||
Standard_EXPORT void SetCritValue (const Standard_Real dist);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT AdvApp2Var_Patch(const AdvApp2Var_Patch& P);
|
||||
AdvApp2Var_Patch(const AdvApp2Var_Patch& P);
|
||||
AdvApp2Var_Patch& operator= (const AdvApp2Var_Patch& theOther);
|
||||
|
||||
private:
|
||||
|
||||
Standard_Real myU0;
|
||||
Standard_Real myU1;
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include <AdvApp2Var_Node.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
|
||||
typedef NCollection_Sequence<AdvApp2Var_Node> AdvApp2Var_SequenceOfNode;
|
||||
|
||||
typedef NCollection_Sequence<Handle(AdvApp2Var_Node)> AdvApp2Var_SequenceOfNode;
|
||||
|
||||
#endif
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include <AdvApp2Var_Patch.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
|
||||
typedef NCollection_Sequence<AdvApp2Var_Patch> AdvApp2Var_SequenceOfPatch;
|
||||
typedef NCollection_Sequence<Handle(AdvApp2Var_Patch)> AdvApp2Var_SequenceOfPatch;
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -22,6 +22,6 @@
|
||||
|
||||
//! Set of constraints along a same type of Iso on the same level
|
||||
|
||||
typedef NCollection_Sequence<AdvApp2Var_Iso> AdvApp2Var_Strip;
|
||||
typedef NCollection_Sequence<Handle(AdvApp2Var_Iso)> AdvApp2Var_Strip;
|
||||
|
||||
#endif
|
||||
|
@@ -22,7 +22,6 @@ AdvApp2Var_Data_f2c.hxx
|
||||
AdvApp2Var_EvaluatorFunc2Var.hxx
|
||||
AdvApp2Var_Framework.cxx
|
||||
AdvApp2Var_Framework.hxx
|
||||
AdvApp2Var_Framework.lxx
|
||||
AdvApp2Var_Iso.cxx
|
||||
AdvApp2Var_Iso.hxx
|
||||
AdvApp2Var_MathBase.cxx
|
||||
@@ -30,7 +29,6 @@ AdvApp2Var_MathBase.hxx
|
||||
AdvApp2Var_MathBase_mathinit.cxx
|
||||
AdvApp2Var_Network.cxx
|
||||
AdvApp2Var_Network.hxx
|
||||
AdvApp2Var_Network.lxx
|
||||
AdvApp2Var_Node.cxx
|
||||
AdvApp2Var_Node.hxx
|
||||
AdvApp2Var_Patch.cxx
|
||||
|
Reference in New Issue
Block a user