Version: 6.3.1
Functions

src/StdMeshers/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>
Include dependency graph for StdMeshers_Deflection1D.cxx:

Go to the source code of this file.

Functions

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.

Parameters:
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.

References Max(), PAL_MESH_041_mesh.p1, and PAL_MESH_041_mesh.p2.

Referenced by SMESH.TShapeDisplayer.checkTriangulation().

{
  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 );
}
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 );
}
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS