bool StdMeshers_Projection_3D::IsApplicable(const TopoDS_Shape & aShape, bool toCheckAll)
{
  TopExp_Explorer exp0( aShape, TopAbs_SOLID );
  if ( !exp0.More() ) return false;

  TopTools_IndexedMapOfOrientedShape blockShapes;
  TopoDS_Vertex v;
  TopoDS_Shell shell;
  for ( ; exp0.More(); exp0.Next() )
  {
    int nbFoundShells = 0;
    TopExp_Explorer exp1( exp0.Current(), TopAbs_SHELL );
    for ( ; exp1.More(); exp1.Next(), ++nbFoundShells )
    {
      shell = TopoDS::Shell( exp1.Current() );
      if ( nbFoundShells == 2 ) break;
    }
    if ( nbFoundShells != 1 ) {
      if ( toCheckAll ) return false;
      continue;
    }   
    bool isBlock = SMESH_Block::FindBlockShapes( shell, v, v, blockShapes );
    if ( toCheckAll && !isBlock ) return false;
    if ( !toCheckAll && isBlock ) return true;
  }
  return toCheckAll;
}
Ejemplo n.º 2
0
int main(int argc, char* argv[]){
  if(argc == 3){
    int_type a = (int_type)atoi(argv[1]);
    int_type b = (int_type)atoi(argv[2]);
    int_type lhs = exp0(a, b);
    int_type rhs = exp1(a, b);
    if(lhs == rhs){
      printf("lhs == rhs: %d\n", lhs);
    } else {
      printf("lhs = %d != rhs = %d\n", lhs, rhs);

    }
  }
  return 0;
}