Back to index

salome-smesh  6.5.0
StdMeshers_Deflection1D.cxx File Reference
#include "StdMeshers_Deflection1D.hxx"
#include "utilities.h"
#include "SMESH_Mesh.hxx"
#include "SMESH_Algo.hxx"
#include <BRep_Tool.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Geom_Curve.hxx>
#include <TopExp.hxx>
#include <TopLoc_Location.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <gp_Lin.hxx>
#include <gp_Pnt.hxx>

Go to the source code of this file.


ostream & operator<< (ostream &save, StdMeshers_Deflection1D &hyp)
istream & operator>> (istream &load, StdMeshers_Deflection1D &hyp)
static double deflection (const GeomAdaptor_Curve &theCurve, double theU1, double theU2)
 Evaluate curve deflection between two points.

Function Documentation

static double deflection ( const GeomAdaptor_Curve &  theCurve,
double  theU1,
double  theU2 
) [static]

Evaluate curve deflection between two points.

theCurve- the curve
theU1- the parameter of the first point
theU2- the parameter of the second point
Return values:
double- deflection value

Definition at line 159 of file StdMeshers_Deflection1D.cxx.

  if ( theCurve.GetType() == GeomAbs_Line )
    return 0;
  // line between theU1 and theU2
  gp_Pnt p1 = theCurve.Value( theU1 ), p2 = theCurve.Value( theU2 );
  gp_Lin segment( p1, gp_Vec( p1, p2 ));

  // evaluate square distance of theCurve from the segment
  Standard_Real dist2 = 0;
  const int nbPnt = 7;
  const double step = ( theU2 - theU1 ) / nbPnt;
  while (( theU1 += step ) < theU2 )
    dist2 = Max( dist2, segment.SquareDistance( theCurve.Value( theU1 )));

  return sqrt( dist2 );

Here is the call graph for this function:

Here is the caller graph for this function:

ostream& operator<< ( std::ostream &  save,
StdMeshers_Deflection1D &  hyp 

Definition at line 134 of file StdMeshers_Deflection1D.cxx.

  return hyp.SaveTo( save );
istream& operator>> ( std::istream &  load,
StdMeshers_Deflection1D &  hyp 

Definition at line 145 of file StdMeshers_Deflection1D.cxx.

  return hyp.LoadFrom( load );