Back to index

salome-smesh  6.5.0
Defines | Typedefs | Functions
StdMeshers_Quadrangle_2D.cxx File Reference
#include "StdMeshers_Quadrangle_2D.hxx"
#include "StdMeshers_FaceSide.hxx"
#include "StdMeshers_QuadrangleParams.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_Block.hxx"
#include "SMESH_Comment.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_EdgePosition.hxx"
#include "SMDS_FacePosition.hxx"
#include <BRep_Tool.hxx>
#include <Geom_Surface.hxx>
#include <NCollection_DefineArray2.hxx>
#include <Precision.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TColgp_SequenceOfXY.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopoDS.hxx>
#include "utilities.h"
#include "Utils_ExceptHandlers.hxx"

Go to the source code of this file.

Defines

#define StdMeshers_Array2OfNode_HeaderFile

Typedefs

typedef const SMDS_MeshNode * SMDS_MeshNodePtr
typedef gp_XY gp_UV
typedef SMESH_Comment TComm

Functions

 DEFINE_ARRAY2 (StdMeshers_Array2OfNode, StdMeshers_BaseCollectionNodePtr, SMDS_MeshNodePtr) using namespace std
static bool twoEdgesMeatAtVertex (const TopoDS_Edge &e1, const TopoDS_Edge &e2, SMESH_Mesh &mesh)
 Return true if only two given edges meat at their common vertex.
static void ShiftQuad (FaceQuadStruct *quad, const int num, bool)
static gp_UV CalcUV (double x0, double x1, double y0, double y1, FaceQuadStruct *quad, const gp_UV &a0, const gp_UV &a1, const gp_UV &a2, const gp_UV &a3)
static gp_UV CalcUV2 (double x, double y, FaceQuadStruct *quad, const gp_UV &a0, const gp_UV &a1, const gp_UV &a2, const gp_UV &a3)

Define Documentation

Definition at line 62 of file StdMeshers_Quadrangle_2D.cxx.


Typedef Documentation

typedef gp_XY gp_UV

Definition at line 71 of file StdMeshers_Quadrangle_2D.cxx.

typedef const SMDS_MeshNode* SMDS_MeshNodePtr

Definition at line 63 of file StdMeshers_Quadrangle_2D.cxx.

Definition at line 72 of file StdMeshers_Quadrangle_2D.cxx.


Function Documentation

static gp_UV CalcUV ( double  x0,
double  x1,
double  y0,
double  y1,
FaceQuadStruct quad,
const gp_UV a0,
const gp_UV a1,
const gp_UV a2,
const gp_UV a3 
) [static]

Definition at line 1372 of file StdMeshers_Quadrangle_2D.cxx.

{
  const vector<UVPtStruct>& uv_eb = quad->side[0]->GetUVPtStruct(true,0);
  const vector<UVPtStruct>& uv_er = quad->side[1]->GetUVPtStruct(false,1);
  const vector<UVPtStruct>& uv_et = quad->side[2]->GetUVPtStruct(true,1);
  const vector<UVPtStruct>& uv_el = quad->side[3]->GetUVPtStruct(false,0);

  double x = (x0 + y0 * (x1 - x0)) / (1 - (y1 - y0) * (x1 - x0));
  double y = y0 + x * (y1 - y0);

  double param_b = uv_eb[0].normParam + x * (uv_eb.back().normParam - uv_eb[0].normParam);
  double param_t = uv_et[0].normParam + x * (uv_et.back().normParam - uv_et[0].normParam);
  double param_r = uv_er[0].normParam + y * (uv_er.back().normParam - uv_er[0].normParam);
  double param_l = uv_el[0].normParam + y * (uv_el.back().normParam - uv_el[0].normParam);

  gp_UV p0 = quad->side[BOTTOM_SIDE]->Value2d(param_b).XY();
  gp_UV p1 = quad->side[RIGHT_SIDE ]->Value2d(param_r).XY();
  gp_UV p2 = quad->side[TOP_SIDE   ]->Value2d(param_t).XY();
  gp_UV p3 = quad->side[LEFT_SIDE  ]->Value2d(param_l).XY();

  gp_UV uv = CalcUV(x,y, a0,a1,a2,a3, p0,p1,p2,p3);

  return uv;
}

Here is the caller graph for this function:

static gp_UV CalcUV2 ( double  x,
double  y,
FaceQuadStruct quad,
const gp_UV a0,
const gp_UV a1,
const gp_UV a2,
const gp_UV a3 
) [static]

Definition at line 1405 of file StdMeshers_Quadrangle_2D.cxx.

{
  gp_UV p0 = quad->side[BOTTOM_SIDE]->Value2d(x).XY();
  gp_UV p1 = quad->side[RIGHT_SIDE ]->Value2d(y).XY();
  gp_UV p2 = quad->side[TOP_SIDE   ]->Value2d(x).XY();
  gp_UV p3 = quad->side[LEFT_SIDE  ]->Value2d(y).XY();

  gp_UV uv = CalcUV(x,y, a0,a1,a2,a3, p0,p1,p2,p3);

  return uv;
}

Here is the call graph for this function:

DEFINE_ARRAY2 ( StdMeshers_Array2OfNode  ,
StdMeshers_BaseCollectionNodePtr  ,
SMDS_MeshNodePtr   
)
static void ShiftQuad ( FaceQuadStruct quad,
const int  num,
bool   
) [static]

Definition at line 1354 of file StdMeshers_Quadrangle_2D.cxx.

{
  StdMeshers_FaceSide* side[4] = { quad->side[0], quad->side[1], quad->side[2], quad->side[3] };
  for (int i = BOTTOM_SIDE; i < NB_SIDES; ++i) {
    int id = (i + num) % NB_SIDES;
    bool wasForward = (i < TOP_SIDE);
    bool newForward = (id < TOP_SIDE);
    if (wasForward != newForward)
      side[ i ]->Reverse();
    quad->side[ id ] = side[ i ];
  }
}
static bool twoEdgesMeatAtVertex ( const TopoDS_Edge &  e1,
const TopoDS_Edge &  e2,
SMESH_Mesh &  mesh 
) [static]

Return true if only two given edges meat at their common vertex.

Definition at line 763 of file StdMeshers_Quadrangle_2D.cxx.

{
  TopoDS_Vertex v;
  if (!TopExp::CommonVertex(e1, e2, v))
    return false;
  TopTools_ListIteratorOfListOfShape ancestIt(mesh.GetAncestors(v));
  for (; ancestIt.More() ; ancestIt.Next())
    if (ancestIt.Value().ShapeType() == TopAbs_EDGE)
      if (!e1.IsSame(ancestIt.Value()) && !e2.IsSame(ancestIt.Value()))
        return false;
  return true;
}