cgma
TDSurfaceOverlap Class Reference

#include <TDSurfaceOverlap.hpp>

Inheritance diagram for TDSurfaceOverlap:
ToolData

List of all members.

Public Member Functions

 TDSurfaceOverlap (RefFace *ref_face_ptr, unsigned short ang_facet_tol, double abs_facet_tol, double gap_max)
 ~TDSurfaceOverlap ()
int has_rtree ()
DLIList< SurfaceOverlapFacet * > * get_facet_list ()
AbstractTree
< SurfaceOverlapFacet * > * 
get_facet_rtree ()
DLIList< Body * > * get_body_list ()

Static Public Member Functions

static int is_surface_overlap (const ToolData *td)

Private Attributes

RefFacerefFacePtr
DLIList< SurfaceOverlapFacet * > facetList
AbstractTree
< SurfaceOverlapFacet * > * 
aTree
DLIList< Body * > bodyList
int bodiesRetrieved
int marked
unsigned short angFacetTol
double absFacetTol
double gapMax

Detailed Description

Definition at line 17 of file TDSurfaceOverlap.hpp.


Constructor & Destructor Documentation

TDSurfaceOverlap::TDSurfaceOverlap ( RefFace ref_face_ptr,
unsigned short  ang_facet_tol,
double  abs_facet_tol,
double  gap_max 
)

Definition at line 8 of file TDSurfaceOverlap.cpp.

{
  refFacePtr = ref_face_ptr;
  aTree = NULL;
  marked = 0;
  bodiesRetrieved = 0;
  angFacetTol = ang_facet_tol;
  absFacetTol = abs_facet_tol;
  gapMax = gap_max;
}

Definition at line 21 of file TDSurfaceOverlap.cpp.

{
  while( facetList.size() ) delete facetList.pop();
  if( aTree )
    delete aTree;
}

Member Function Documentation

Definition at line 96 of file TDSurfaceOverlap.cpp.

Definition at line 29 of file TDSurfaceOverlap.cpp.

{
  if( facetList.size() )
    return &facetList;

  GMem *gmem_ptr = new GMem;
  CubitStatus stat = refFacePtr->get_graphics( *gmem_ptr, angFacetTol, absFacetTol );

  if( !stat )
  {
    delete gmem_ptr;
    return NULL;
  }

  GPoint* plist = gmem_ptr->point_list();
  int* facet_list = gmem_ptr->facet_list();

  int i;
   
  GPoint p[3];
  for (i = 0; i < gmem_ptr->fListCount; )
  {
    int sides = facet_list[i++];
    if (sides != 3)
    {
      PRINT_WARNING("Skipping n-sided polygone in triangle list"
                    " in TDSurfaceOverlap.\n");
      i += sides;
    }
    else
    {
      p[0] = plist[facet_list[i++]];
      p[1] = plist[facet_list[i++]];
      p[2] = plist[facet_list[i++]];
   
      SurfaceOverlapFacet *facet = new SurfaceOverlapFacet( p );
      facetList.append( facet );
    }
  }

  delete gmem_ptr;

  return &facetList;
}

Definition at line 75 of file TDSurfaceOverlap.cpp.

{
  if( !aTree && !get_facet_list() )
    return NULL;

  if( !aTree )
  {
    aTree = new RTree<SurfaceOverlapFacet*>( gapMax );

    int i;
    for( i=facetList.size(); i--; )
    {
      SurfaceOverlapFacet *facet_ptr = facetList.get_and_step();
      aTree->add( facet_ptr );
    }
  }

  return aTree;
}
int TDSurfaceOverlap::has_rtree ( ) [inline]

Definition at line 25 of file TDSurfaceOverlap.hpp.

{if(aTree) return CUBIT_TRUE; else return CUBIT_FALSE;}
static int TDSurfaceOverlap::is_surface_overlap ( const ToolData td) [inline, static]

Definition at line 35 of file TDSurfaceOverlap.hpp.

     {return (CAST_TO(td, const TDSurfaceOverlap) != NULL);}

Member Data Documentation

Definition at line 47 of file TDSurfaceOverlap.hpp.

unsigned short TDSurfaceOverlap::angFacetTol [private]

Definition at line 46 of file TDSurfaceOverlap.hpp.

Definition at line 44 of file TDSurfaceOverlap.hpp.

Definition at line 43 of file TDSurfaceOverlap.hpp.

double TDSurfaceOverlap::gapMax [private]

Definition at line 48 of file TDSurfaceOverlap.hpp.

int TDSurfaceOverlap::marked [private]

Definition at line 45 of file TDSurfaceOverlap.hpp.

Definition at line 40 of file TDSurfaceOverlap.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines