Back to index

salome-geom  6.5.0
Public Member Functions | Private Attributes
GEOMImpl_Fillet1dPoint Class Reference

GEOMImpl_Fillet1dPoint is an internal class for 1D fillet algorithm to store and compare computed solutions on edges. More...

#include <GEOMImpl_Fillet1d.hxx>

List of all members.

Public Member Functions

Standard_EXPORT GEOMImpl_Fillet1dPoint (Standard_Real theParam)
 Puiblic methods.
Standard_EXPORT
GEOMImpl_Fillet1dPoint
Copy ()
 Make copy of point WARNING: Copies only field values: myParam, myV, myD, myValid.
Standard_EXPORT void SetParam (Standard_Real theParam)
 Set/Get parameter.
Standard_EXPORT Standard_Real GetParam () const
Standard_EXPORT void SetParam2 (const Standard_Real theParam2)
Standard_EXPORT Standard_Real GetParam2 ()
Standard_EXPORT Standard_Boolean IsValid (int theIndex)
 Returns validity.
Standard_EXPORT Standard_Integer GetNBValues ()
 Get values.
Standard_EXPORT Standard_Real GetValue (Standard_Integer theIndex)
Standard_EXPORT Standard_Real GetDiff (Standard_Integer theIndex)
Standard_EXPORT Standard_Integer GetNear (Standard_Integer theIndex)
Standard_EXPORT void SetCenter (const gp_Pnt2d thePoint)
 Set/Get center point.
Standard_EXPORT const gp_Pnt2d GetCenter ()
Standard_EXPORT void AddValue (Standard_Real theValue, Standard_Boolean theIsValid)
Standard_EXPORT Standard_Boolean ComputeDifference (GEOMImpl_Fillet1dPoint *)
 compute difference between this and given point
Standard_EXPORT void FilterPoints (GEOMImpl_Fillet1dPoint *)
Standard_EXPORT Standard_Integer HasSolution (Standard_Real theRadius)
 Check is point contains solution and returns the index of them if any.
void RemoveSolution (Standard_Integer theIndex)
 Remove solution by index.

Private Attributes

gp_Pnt2d myCenter
 Private fields.
Standard_Real myParam
Standard_Real myParam2
TColStd_SequenceOfReal myV
TColStd_SequenceOfReal myD
TColStd_SequenceOfInteger myValid
TColStd_SequenceOfInteger myNear

Detailed Description

GEOMImpl_Fillet1dPoint is an internal class for 1D fillet algorithm to store and compare computed solutions on edges.

Definition at line 81 of file GEOMImpl_Fillet1d.hxx.


Constructor & Destructor Documentation

Puiblic methods.

Constructor

Definition at line 87 of file GEOMImpl_Fillet1d.hxx.

  {myParam = theParam;}

Here is the caller graph for this function:


Member Function Documentation

void GEOMImpl_Fillet1dPoint::AddValue ( Standard_Real  theValue,
Standard_Boolean  theIsValid 
)

Definition at line 559 of file GEOMImpl_Fillet1d.cxx.

{
  Standard_Integer a;
  for(a = 1; a <= myV.Length(); a++)
  {
    if (theValue < myV.Value(a))
    {
      myV.InsertBefore(a, theValue);
      myValid.InsertBefore(a, (Standard_Integer)theValid);
      return;
    }
  }
  myV.Append(theValue);
  myValid.Append((Standard_Integer)theValid);
}

Here is the caller graph for this function:

compute difference between this and given point

Definition at line 579 of file GEOMImpl_Fillet1d.cxx.

{
  Standard_Integer a;
  Standard_Boolean aDiffsSet = (myD.Length() != 0);
  Standard_Real aDX = thePoint->GetParam() - myParam, aDY;
  if (thePoint->myV.Length() == myV.Length())
  { // absolutely the same points
    for(a = 1; a <= myV.Length(); a++)
    {
      aDY = thePoint->myV.Value(a) - myV.Value(a);
      if ( aDiffsSet )
        myD.SetValue(a, fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0);
      else
        myD.Append( fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0);
    }
    return Standard_True;
  }
  // between the diffeerent points searching for nearest analogs
  Standard_Integer b;
  for(a = 1; a <= myV.Length(); a++)
  {
    for(b = 1; b <= thePoint->myV.Length(); b++)
    {
      if (b == 1 || fabs(thePoint->myV.Value(b) - myV.Value(a)) < fabs(aDY))
        aDY = thePoint->myV.Value(b) - myV.Value(a);
    }
    if (aDiffsSet)
    {
      if ( fabs(aDX) > gp::Resolution() && fabs(aDY / aDX) < fabs(myD.Value(a)))
        myD.SetValue(a, aDY / aDX);
      else
        myD.SetValue(a, 0);
    }
    else
    {
      myD.Append( fabs(aDX) > gp::Resolution() ? aDY/aDX : 0);
    }
  }

  return Standard_False;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Make copy of point WARNING: Copies only field values: myParam, myV, myD, myValid.

Definition at line 736 of file GEOMImpl_Fillet1d.cxx.

{
  GEOMImpl_Fillet1dPoint* aCopy = new GEOMImpl_Fillet1dPoint(myParam);
  Standard_Integer a;
  for(a = 1; a <= myV.Length(); a++)
  {
    aCopy->myV.Append(myV.Value(a));
    aCopy->myD.Append(myD.Value(a));
    aCopy->myValid.Append(myValid.Value(a));
  }
  return aCopy;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 625 of file GEOMImpl_Fillet1d.cxx.

{
  Standard_Integer a, b;
  TColStd_SequenceOfReal aDiffs;
  Standard_Real aY, aY2, aDX = thePoint->GetParam() - myParam;
  for(a = 1; a <= myV.Length(); a++)
  {
    // searching for near point from thePoint
    Standard_Integer aNear = 0;
    Standard_Real aDiff = aDX * 10000.;
    aY = myV.Value(a) + myD.Value(a) * aDX;
    for(b = 1; b <= thePoint->myV.Length(); b++)
    {
      // calculate hypothesis value of the Y2 with the constant first and second derivative
      aY2 = aY + aDX * (thePoint->myD.Value(b) - myD.Value(a)) / 2.0;
      if (aNear == 0 || fabs(aY2 - thePoint->myV.Value(b)) < fabs(aDiff))
      {
        aNear = b;
        aDiff = aY2 - thePoint->myV.Value(b);
      }
    }//for b...

    if (aNear)
    {
      if (myV.Value(a) * thePoint->myV.Value(aNear) > 0)
      {// the same sign at the same sides of the interval
        if (myV.Value(a) * myD.Value(a) > 0)
        {
          if (fabs(myD.Value(a)) > Precision::Confusion())
            aNear = 0;
        }
        else
        {
          if (fabs(myV.Value(a)) > fabs(thePoint->myV.Value(aNear)))
            if (thePoint->myV.Value(aNear) * thePoint->myD.Value(aNear) < 0 &&
                fabs(thePoint->myD.Value(aNear)) > Precision::Confusion())
            {
              aNear = 0;
            }
        }
      }
    }

    if (aNear)
    {
      if (myV.Value(a) * thePoint->myV.Value(aNear) > 0)
      {
        if ((myV.Value(a) + myD.Value(a) * aDX) * myV.Value(a) > Precision::Confusion() &&
        (thePoint->myV.Value(aNear) + thePoint->myD.Value(aNear) * aDX) * thePoint->myV.Value(aNear) > Precision::Confusion())
        {
          aNear = 0;
        }
      }
    }

    if (aNear)
    {
      if (  fabs(aDX) < gp::Resolution() || fabs(aDiff / aDX) > 1.e+7)
      {
        aNear = 0;
      }
    }

    if (aNear == 0)
    {  // there is no near: remove it from the list
      myV.Remove(a);
      myD.Remove(a);
      myValid.Remove(a);
      a--;
    }
    else
    {
      Standard_Boolean aFound = Standard_False;
      for(b = 1; b <= myNear.Length(); b++)
      {
        if (myNear.Value(b) == aNear)
        {
          if (fabs(aDiffs.Value(b)) < fabs(aDiff))
          { // return this 'near'
            aFound = Standard_True;
            myV.Remove(a);
            myD.Remove(a);
            myValid.Remove(a);
            a--;
            break;
          }
          else
          { // remove the old 'near'
            myV.Remove(b);
            myD.Remove(b);
            myValid.Remove(b);
            myNear.Remove(b);
            aDiffs.Remove(b);
            a--;
            break;
          }
        }
      }//for b...
      if (!aFound)
      {
        myNear.Append(aNear);
        aDiffs.Append(aDiff);
      }
    }
  }//for a...
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 120 of file GEOMImpl_Fillet1d.hxx.

    {return myCenter;}

Here is the caller graph for this function:

Standard_EXPORT Standard_Real GEOMImpl_Fillet1dPoint::GetDiff ( Standard_Integer  theIndex) [inline]

Definition at line 112 of file GEOMImpl_Fillet1d.hxx.

    {return myD.Value(theIndex);}

Here is the caller graph for this function:

Get values.

Definition at line 109 of file GEOMImpl_Fillet1d.hxx.

{return myV.Length();}

Here is the caller graph for this function:

Standard_EXPORT Standard_Integer GEOMImpl_Fillet1dPoint::GetNear ( Standard_Integer  theIndex) [inline]

Definition at line 114 of file GEOMImpl_Fillet1d.hxx.

    {return myNear.Value(theIndex);}

Here is the caller graph for this function:

Standard_EXPORT Standard_Real GEOMImpl_Fillet1dPoint::GetParam ( ) const [inline]

Definition at line 97 of file GEOMImpl_Fillet1d.hxx.

    {return myParam;}

Here is the caller graph for this function:

Definition at line 101 of file GEOMImpl_Fillet1d.hxx.

    { return myParam2 ; }

Here is the caller graph for this function:

Standard_EXPORT Standard_Real GEOMImpl_Fillet1dPoint::GetValue ( Standard_Integer  theIndex) [inline]

Definition at line 110 of file GEOMImpl_Fillet1d.hxx.

    {return myV.Value(theIndex);}

Here is the caller graph for this function:

Standard_Integer GEOMImpl_Fillet1dPoint::HasSolution ( Standard_Real  theRadius)

Check is point contains solution and returns the index of them if any.

Definition at line 753 of file GEOMImpl_Fillet1d.cxx.

{
  Standard_Integer a;
  for(a = 1; a <= myV.Length(); a++)
  {
    if (fabs(sqrt(fabs(fabs(myV.Value(a)) + theRadius * theRadius)) - theRadius) < Precision::Confusion() / 10.)
      return a;
  }
  return 0;
}

Here is the caller graph for this function:

Standard_EXPORT Standard_Boolean GEOMImpl_Fillet1dPoint::IsValid ( int  theIndex) [inline]

Returns validity.

Definition at line 105 of file GEOMImpl_Fillet1d.hxx.

    {return (Standard_Boolean)myValid.Value(theIndex);}

Here is the caller graph for this function:

void GEOMImpl_Fillet1dPoint::RemoveSolution ( Standard_Integer  theIndex)

Remove solution by index.

Definition at line 768 of file GEOMImpl_Fillet1d.cxx.

{
  myV.Remove(theIndex);
  myD.Remove(theIndex);
  myValid.Remove(theIndex);
  myNear.Remove(theIndex);
}
Standard_EXPORT void GEOMImpl_Fillet1dPoint::SetCenter ( const gp_Pnt2d  thePoint) [inline]

Set/Get center point.

Definition at line 118 of file GEOMImpl_Fillet1d.hxx.

    {myCenter = thePoint;}

Here is the caller graph for this function:

Standard_EXPORT void GEOMImpl_Fillet1dPoint::SetParam ( Standard_Real  theParam) [inline]

Set/Get parameter.

Definition at line 95 of file GEOMImpl_Fillet1d.hxx.

    {myParam = theParam;}

Here is the caller graph for this function:

Standard_EXPORT void GEOMImpl_Fillet1dPoint::SetParam2 ( const Standard_Real  theParam2) [inline]

Definition at line 99 of file GEOMImpl_Fillet1d.hxx.

    {myParam2 = theParam2;}

Here is the caller graph for this function:


Member Data Documentation

Private fields.

Definition at line 136 of file GEOMImpl_Fillet1d.hxx.

TColStd_SequenceOfReal GEOMImpl_Fillet1dPoint::myD [private]

Definition at line 138 of file GEOMImpl_Fillet1d.hxx.

TColStd_SequenceOfInteger GEOMImpl_Fillet1dPoint::myNear [private]

Definition at line 139 of file GEOMImpl_Fillet1d.hxx.

Standard_Real GEOMImpl_Fillet1dPoint::myParam [private]

Definition at line 137 of file GEOMImpl_Fillet1d.hxx.

Standard_Real GEOMImpl_Fillet1dPoint::myParam2 [private]

Definition at line 137 of file GEOMImpl_Fillet1d.hxx.

TColStd_SequenceOfReal GEOMImpl_Fillet1dPoint::myV [private]

Definition at line 138 of file GEOMImpl_Fillet1d.hxx.

TColStd_SequenceOfInteger GEOMImpl_Fillet1dPoint::myValid [private]

Definition at line 139 of file GEOMImpl_Fillet1d.hxx.


The documentation for this class was generated from the following files: