cgma
CubitQuadFacetData Class Reference

#include <CubitQuadFacetData.hpp>

Inheritance diagram for CubitQuadFacetData:
CubitQuadFacet FacetEntity ToolDataUser

List of all members.

Public Member Functions

 CubitQuadFacetData (CubitFacet *tri_facets[2], CubitPoint *points[4])
 CubitQuadFacetData (CubitPoint *points[4])
 CubitQuadFacetData (CubitPoint *point0, CubitPoint *point1, CubitPoint *point2, CubitPoint *point3)
 CubitQuadFacetData (CubitFacetEdge *e0, CubitFacetEdge *e1, CubitFacetEdge *e2, CubitFacetEdge *e3)
 ~CubitQuadFacetData ()
int tri_to_quad_index (int tri_index, int pt_index)
CubitFacetget_tri_facet (int index)
CubitFacetget_tri_facet_at_point (CubitPoint *point_ptr)
void remove_tri_facets ()
void points (CubitPoint *points[4])
void points (DLIList< CubitPoint * > &point_list)
CubitPointpoint (int index)
CubitFacetEdgeedge (int index)

Private Attributes

CubitFacetmyTriangleFacets [2]
int triToQuadIndex [2][3]

Detailed Description

Definition at line 9 of file CubitQuadFacetData.hpp.


Constructor & Destructor Documentation

CubitQuadFacetData::CubitQuadFacetData ( CubitFacet tri_facets[2],
CubitPoint points[4] 
)

Definition at line 23 of file CubitQuadFacetData.cpp.

{
  myTriangleFacets[0] = tri_facets[0];
  myTriangleFacets[1] = tri_facets[1];

  CubitBoolean found = CUBIT_FALSE;
  CubitPoint *pt;
  int ii, jj, kk;

  for (jj=0; jj<2; jj++)
  {
    for (kk=0; kk<3; kk++)
    {
      pt = myTriangleFacets[jj]->point(kk);
      found = CUBIT_FALSE;
      for (ii=0; ii<4 && !found; ii++)
      {
        if (points[ii] == pt)
        {
          triToQuadIndex[jj][kk] = ii;
          found = CUBIT_TRUE;
        }
      }

      // If assertion occurs, the that points passed to the constructor do 
      // not match the points on the triangle facets

      assert(found == CUBIT_TRUE);
    }
  }
}

Definition at line 125 of file CubitQuadFacetData.cpp.

{
  
  // The orientation of the triangles in the quad is arbitrary.
  // We may want to split based on some other criteria (ie. angles)

  myTriangleFacets[0] = new CubitFacetData( points[0], points[1], points[2] );
  myTriangleFacets[1] = new CubitFacetData( points[2], points[3], points[0] );

  triToQuadIndex[0][0] = 0;
  triToQuadIndex[0][1] = 1;
  triToQuadIndex[0][2] = 2;
  triToQuadIndex[1][0] = 2;
  triToQuadIndex[1][1] = 3;
  triToQuadIndex[1][2] = 0;
}
CubitQuadFacetData::CubitQuadFacetData ( CubitPoint point0,
CubitPoint point1,
CubitPoint point2,
CubitPoint point3 
)

Definition at line 65 of file CubitQuadFacetData.cpp.

{
  
  // The orientation of the triangles in the quad is arbitrary.
  // We may want to split based on some other criteria (ie. angles)

  myTriangleFacets[0] = new CubitFacetData( point0, point1, point2 );
  myTriangleFacets[1] = new CubitFacetData( point2, point3, point0 );

  triToQuadIndex[0][0] = 0;
  triToQuadIndex[0][1] = 1;
  triToQuadIndex[0][2] = 2;
  triToQuadIndex[1][0] = 2;
  triToQuadIndex[1][1] = 3;
  triToQuadIndex[1][2] = 0;
}

Definition at line 92 of file CubitQuadFacetData.cpp.

{
  // create the diagonal edge

  CubitPoint *p0 = e3->shared_point(e0);
  CubitPoint *p2 = e1->shared_point(e2);
  assert(p0 != NULL && p2 != NULL);

  CubitFacetEdge *e4 = (CubitFacetEdge *) new CubitFacetEdgeData( p0, p2 );

  // create the triangles

  myTriangleFacets[0] = new CubitFacetData( e1, e4, e0 );
  myTriangleFacets[1] = new CubitFacetData( e3, e4, e2 );

  triToQuadIndex[0][0] = 0;
  triToQuadIndex[0][1] = 1;
  triToQuadIndex[0][2] = 2;
  triToQuadIndex[1][0] = 2;
  triToQuadIndex[1][1] = 3;
  triToQuadIndex[1][2] = 0;
}

Definition at line 149 of file CubitQuadFacetData.cpp.

{
  if (myTriangleFacets[0] == NULL && myTriangleFacets[1] == NULL)
    return;

  assert(myTriangleFacets[0] && myTriangleFacets[1]);

  // determine the dialogonal edge
  CubitPoint *p0 = this->point(0);
  CubitPoint *p2 = this->point(2);
  CubitFacetEdge *dedge = NULL;
  if (p0 != NULL && p2 != NULL)
  {
    dedge = p0->shared_edge(p2);
  }

  // delete both triangles
  delete myTriangleFacets[0];
  delete myTriangleFacets[1];

  // delete the dialgonal edge
  if (dedge != NULL)
  { 
    delete dedge;
  }
}

Member Function Documentation

CubitFacetEdge * CubitQuadFacetData::edge ( int  index) [virtual]

Implements CubitQuadFacet.

Definition at line 235 of file CubitQuadFacetData.cpp.

{
  int ii, jj;
  CubitPoint *p0 = NULL;
  CubitPoint *p1 = NULL;
  int index1 = (index + 1) % 4;
  for (ii=0; ii<2; ii++)
  {
    for (jj=0; jj<3; jj++)
    {
      if (triToQuadIndex[ii][jj] == index)
      {
        p0 = myTriangleFacets[ii]->point(jj);
      }
      else if ( triToQuadIndex[ii][jj] == index1 )
      {
        p1 = myTriangleFacets[ii]->point(jj);
      }
    }
  }
  assert(p0 != NULL && p1 != NULL);  // index is probably out of range
  
  return p0->shared_edge( p1 );
}
CubitFacet* CubitQuadFacetData::get_tri_facet ( int  index) [inline, virtual]

Implements CubitQuadFacet.

Definition at line 30 of file CubitQuadFacetData.hpp.

    { return myTriangleFacets[ index ]; }

Implements CubitQuadFacet.

Definition at line 267 of file CubitQuadFacetData.cpp.

{
  int ii, jj;
  for (ii=0; ii<2; ii++)
  {
    for (jj=0; jj<3; jj++)
    { 
      if (myTriangleFacets[ii]->point(jj) == point_ptr)
      {
        return myTriangleFacets[ii]; 
      }
    }
  }
  assert(0);  // point isn't on facet
  return NULL;
}
CubitPoint * CubitQuadFacetData::point ( int  index) [virtual]

Implements CubitQuadFacet.

Definition at line 212 of file CubitQuadFacetData.cpp.

{
  int ii, jj;
  for (ii=0; ii<2; ii++)
  {
    for (jj=0; jj<3; jj++)
    {
      if (triToQuadIndex[ii][jj] == index)
      {
        return myTriangleFacets[ii]->point(jj);
      }
    }
  }
  assert(0);  // index is probably out of range
  return NULL;
}
void CubitQuadFacetData::points ( CubitPoint points[4]) [virtual]

Implements CubitQuadFacet.

Definition at line 194 of file CubitQuadFacetData.cpp.

{

  thepoints[triToQuadIndex[0][0]] = myTriangleFacets[0]->point(0);
  thepoints[triToQuadIndex[0][1]] = myTriangleFacets[0]->point(1);
  thepoints[triToQuadIndex[0][2]] = myTriangleFacets[0]->point(2);
  thepoints[triToQuadIndex[1][0]] = myTriangleFacets[1]->point(0);
  thepoints[triToQuadIndex[1][1]] = myTriangleFacets[1]->point(1);
  thepoints[triToQuadIndex[1][2]] = myTriangleFacets[1]->point(2);
}
void CubitQuadFacetData::points ( DLIList< CubitPoint * > &  point_list) [inline, virtual]

Reimplemented from CubitQuadFacet.

Definition at line 42 of file CubitQuadFacetData.hpp.

    {CubitQuadFacet::points(point_list);}

Implements CubitQuadFacet.

Definition at line 182 of file CubitQuadFacetData.cpp.

{
  myTriangleFacets[0] = NULL;
  myTriangleFacets[1] = NULL;
}
int CubitQuadFacetData::tri_to_quad_index ( int  tri_index,
int  pt_index 
) [inline, virtual]

Implements CubitQuadFacet.

Definition at line 25 of file CubitQuadFacetData.hpp.

    { return triToQuadIndex[ tri_index ][ pt_index ]; }

Member Data Documentation

Definition at line 12 of file CubitQuadFacetData.hpp.

Definition at line 13 of file CubitQuadFacetData.hpp.


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