Version: 6.3.1
Public Member Functions | Private Attributes

SMESH.Controls.ElemGeomType Class Reference

#include <SMESH_ControlsDef.hxx>

Inheritance diagram for SMESH.Controls.ElemGeomType:
Inheritance graph
[legend]

Public Member Functions

 ElemGeomType ()
virtual void SetMesh (const SMDS_Mesh *theMesh)
virtual bool IsSatisfy (long theElementId)
void SetType (SMDSAbs_ElementType theType)
virtual SMDSAbs_ElementType GetType () const
void SetGeomType (SMDSAbs_GeometryType theType)
virtual SMDSAbs_GeometryType GetGeomType () const

Private Attributes

const SMDS_MeshmyMesh
SMDSAbs_ElementType myType
SMDSAbs_GeometryType myGeomType

Detailed Description

Definition at line 863 of file SMESH_ControlsDef.hxx.


Constructor & Destructor Documentation

ElemGeomType::ElemGeomType ( )

Member Function Documentation

SMDSAbs_GeometryType ElemGeomType::GetGeomType ( ) const [virtual]

Definition at line 2538 of file SMESH_Controls.cxx.

{
  return myGeomType;
}
SMDSAbs_ElementType ElemGeomType::GetType ( ) const [virtual]

Implements SMESH.Controls.Predicate.

Definition at line 2528 of file SMESH_Controls.cxx.

{
  return myType;
}
bool ElemGeomType::IsSatisfy ( long  theElementId) [virtual]

Implements SMESH.Controls.Predicate.

Definition at line 2476 of file SMESH_Controls.cxx.

References SMESH_BelongToGeom.anElemType, SMDS_Mesh.FindElement(), SMDS_MeshElement.GetType(), SMDS_MeshElement.IsPoly(), SMDS_MeshElement.IsQuadratic(), SMESH.Controls.FreeEdges.myMesh, SMDS_MeshElement.NbNodes(), SMDSAbs_All, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, SMDSAbs_Volume, SMDSGeom_EDGE, SMDSGeom_HEXA, SMDSGeom_PENTA, SMDSGeom_POINT, SMDSGeom_POLYGON, SMDSGeom_POLYHEDRA, SMDSGeom_PYRAMID, SMDSGeom_QUADRANGLE, SMDSGeom_TETRA, and SMDSGeom_TRIANGLE.

{
  if (!myMesh) return false;
  const SMDS_MeshElement* anElem = myMesh->FindElement( theId );
  if ( !anElem )
    return false;
  const SMDSAbs_ElementType anElemType = anElem->GetType();
  if ( myType != SMDSAbs_All && anElemType != myType )
    return false;
  const int aNbNode = anElem->NbNodes();
  bool isOk = false;
  switch( anElemType )
  {
  case SMDSAbs_Node:
    isOk = (myGeomType == SMDSGeom_POINT);
    break;

  case SMDSAbs_Edge:
    isOk = (myGeomType == SMDSGeom_EDGE);
    break;

  case SMDSAbs_Face:
    if ( myGeomType == SMDSGeom_TRIANGLE )
      isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 6 : aNbNode == 3));
    else if ( myGeomType == SMDSGeom_QUADRANGLE )
      isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 8 : aNbNode == 4));
    else if ( myGeomType == SMDSGeom_POLYGON )
      isOk = anElem->IsPoly();
    break;

  case SMDSAbs_Volume:
    if ( myGeomType == SMDSGeom_TETRA )
      isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 10 : aNbNode == 4));
    else if ( myGeomType == SMDSGeom_PYRAMID )
      isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 13 : aNbNode == 5));
    else if ( myGeomType == SMDSGeom_PENTA )
      isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 15 : aNbNode == 6));
    else if ( myGeomType == SMDSGeom_HEXA )
      isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 20 : aNbNode == 8));
     else if ( myGeomType == SMDSGeom_POLYHEDRA )
      isOk = anElem->IsPoly();
    break;
    default: break;
  }
  return isOk;
}
void ElemGeomType::SetGeomType ( SMDSAbs_GeometryType  theType)

Definition at line 2533 of file SMESH_Controls.cxx.

{
  myGeomType = theType;
}
void ElemGeomType::SetMesh ( const SMDS_Mesh theMesh) [virtual]

Implements SMESH.Controls.Functor.

Definition at line 2471 of file SMESH_Controls.cxx.

References SMESH.Controls.FreeEdges.myMesh.

{
  myMesh = theMesh;
}
void ElemGeomType::SetType ( SMDSAbs_ElementType  theType)

Definition at line 2523 of file SMESH_Controls.cxx.

{
  myType = theType;
}

Field Documentation

Definition at line 876 of file SMESH_ControlsDef.hxx.

Definition at line 874 of file SMESH_ControlsDef.hxx.

Definition at line 875 of file SMESH_ControlsDef.hxx.

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