Back to index

salome-smesh  6.5.0
Typedefs | Functions
SMESH_Controls.cxx File Reference
#include "SMESH_ControlsDef.hxx"
#include <set>
#include <limits>
#include <BRepAdaptor_Surface.hxx>
#include <BRepClass_FaceClassifier.hxx>
#include <BRep_Tool.hxx>
#include <TopAbs.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Iterator.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Precision.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColgp_Array1OfXYZ.hxx>
#include <gp_Ax3.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Dir.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_XYZ.hxx>
#include "SMDS_Mesh.hxx"
#include "SMDS_Iterator.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_VolumeTool.hxx"
#include "SMDS_QuadraticFaceOfNodes.hxx"
#include "SMDS_QuadraticEdge.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMESHDS_GroupBase.hxx"
#include "SMESH_OctreeNode.hxx"
#include <vtkMeshQuality.h>

Go to the source code of this file.

Typedefs

typedef std::set< SMDS_MeshFace * > TMapOfFacePtr

Functions

static double skewAngle (const gp_XYZ &p1, const gp_XYZ &p2, const gp_XYZ &p3)
void UpdateBorders (const FreeEdges::Border &theBorder, FreeEdges::TBorders &theRegistry, FreeEdges::TBorders &theContainer)
static bool isEqual (const Quantity_Color &theColor1, const Quantity_Color &theColor2)
template<class TElement , class TIterator , class TPredicate >
void FillSequence (const TIterator &theIterator, TPredicate &thePredicate, Filter::TIdSequence &theSequence)
static void getLinks (const SMDS_MeshFace *theFace, ManifoldPart::TVectorOfLink &theLinks)

Typedef Documentation

typedef std::set<SMDS_MeshFace*> TMapOfFacePtr

Definition at line 3200 of file SMESH_Controls.cxx.


Function Documentation

template<class TElement , class TIterator , class TPredicate >
void FillSequence ( const TIterator &  theIterator,
TPredicate &  thePredicate,
Filter::TIdSequence &  theSequence 
) [inline]

Definition at line 3140 of file SMESH_Controls.cxx.

{
  if ( theIterator ) {
    while( theIterator->more() ) {
      TElement anElem = theIterator->next();
      long anId = anElem->GetID();
      if ( thePredicate->IsSatisfy( anId ) )
        theSequence.push_back( anId );
    }
  }
}
static void getLinks ( const SMDS_MeshFace *  theFace,
ManifoldPart::TVectorOfLink &  theLinks 
) [static]

Definition at line 3343 of file SMESH_Controls.cxx.

{
  int aNbNode = theFace->NbNodes();
  SMDS_ElemIteratorPtr aNodeItr = theFace->nodesIterator();
  int i = 1;
  SMDS_MeshNode* aNode = 0;
  for ( ; aNodeItr->more() && i <= aNbNode; )
  {

    SMDS_MeshNode* aN1 = (SMDS_MeshNode*)aNodeItr->next();
    if ( i == 1 )
      aNode = aN1;
    i++;
    SMDS_MeshNode* aN2 = ( i >= aNbNode ) ? aNode : (SMDS_MeshNode*)aNodeItr->next();
    i++;
    ManifoldPart::Link aLink( aN1, aN2 );
    theLinks.push_back( aLink );
  }
}
static bool isEqual ( const Quantity_Color &  theColor1,
const Quantity_Color &  theColor2 
) [static]

Definition at line 2502 of file SMESH_Controls.cxx.

{
  // tolerance to compare colors
  const double tol = 5*1e-3;
  return ( fabs( theColor1.Red() - theColor2.Red() ) < tol &&
           fabs( theColor1.Green() - theColor2.Green() ) < tol &&
           fabs( theColor1.Blue() - theColor2.Blue() ) < tol );
}
static double skewAngle ( const gp_XYZ &  p1,
const gp_XYZ &  p2,
const gp_XYZ &  p3 
) [inline, static]

Definition at line 1350 of file SMESH_Controls.cxx.

{
  gp_XYZ p12 = ( p2 + p1 ) / 2.;
  gp_XYZ p23 = ( p3 + p2 ) / 2.;
  gp_XYZ p31 = ( p3 + p1 ) / 2.;

  gp_Vec v1( p31 - p2 ), v2( p12 - p23 );

  return v1.Magnitude() < gp::Resolution() || v2.Magnitude() < gp::Resolution() ? 0. : v1.Angle( v2 );
}
void UpdateBorders ( const FreeEdges::Border theBorder,
FreeEdges::TBorders &  theRegistry,
FreeEdges::TBorders &  theContainer 
) [inline]

Definition at line 2314 of file SMESH_Controls.cxx.

{
  if(theRegistry.find(theBorder) == theRegistry.end()){
    theRegistry.insert(theBorder);
    theContainer.insert(theBorder);
  }else{
    theContainer.erase(theBorder);
  }
}