cgma
TDFacetboolData Class Reference

#include <TDFacetboolData.hpp>

Inheritance diagram for TDFacetboolData:
ToolData

List of all members.

Public Member Functions

 TDFacetboolData ()
 ~TDFacetboolData ()
void set (int sv, int e0v, int e1v, int e2v, bool parent, bool is_reversed)
int * get_edge_indices (bool rev_flag)
int get_surf_index ()
bool parent_is_body_1 ()
bool is_reversed ()
void is_reversed (bool rev)

Static Public Member Functions

static int is_facetbool_facet (const ToolData *td)
static TDFacetboolDataget (CubitFacet *facet_ptr)
static CubitStatus add_facetbool_facet (FacetEntity *facet_entity)

Private Member Functions

int * get_edge_indices ()

Private Attributes

int surfaceIndex
int edgeIndex [3]
bool body_1_flag
 true if this triangle came from body 1; false if from body 2.
bool isReversed

Detailed Description

  • Class: TDFacetboolData
  • Owner: John Fowler
  • Description: Data for maintaining persistent IDs.
  • surfaceIndex and edgeIndex[] are indices into a list of entities.
  • Checked By:
  • Version:

Definition at line 18 of file TDFacetboolData.hpp.


Constructor & Destructor Documentation

Definition at line 11 of file TDFacetboolData.cpp.

{
  isReversed=false;
}

Definition at line 16 of file TDFacetboolData.cpp.

{

}

Member Function Documentation

Definition at line 26 of file TDFacetboolData.cpp.

{
  TDFacetboolData* td = (TDFacetboolData*) 
                           facet_ptr->get_TD( &TDFacetboolData::is_facetbool_facet );
  if ( td == NULL )
  {
    td = new TDFacetboolData;
    facet_ptr->add_TD( td );
  }

  return CUBIT_SUCCESS;
}
TDFacetboolData * TDFacetboolData::get ( CubitFacet facet_ptr) [static]

Definition at line 48 of file TDFacetboolData.cpp.

{
  TDFacetboolData *td = (TDFacetboolData*) 
                           facet_ptr->get_TD(&TDFacetboolData::is_facetbool_facet);
  if ( td != NULL )
  {
    return td;
  }
  return (TDFacetboolData*) NULL;
}
int* TDFacetboolData::get_edge_indices ( ) [inline, private]

To try to avoid a problem with the order of the edge indices, we force the calling code to provide whether the associated facet is reversed or not. The public version is below.

Definition at line 35 of file TDFacetboolData.hpp.

{ return edgeIndex; }
int * TDFacetboolData::get_edge_indices ( bool  rev_flag)

Get the edge indices array. Give a flag telling whether the facet is backwards. If it has been marked as reversed (or forward) since the last time this function was called, the array will be reversed. This is a little dangerous since the calling code can have a pointer to this array, so please be careful.

Definition at line 73 of file TDFacetboolData.cpp.

{
  is_reversed(rev_flag);
  return get_edge_indices();
}

Definition at line 59 of file TDFacetboolData.hpp.

{ return surfaceIndex; }
int TDFacetboolData::is_facetbool_facet ( const ToolData td) [static]

Definition at line 21 of file TDFacetboolData.cpp.

{
  return (CAST_TO(const_cast<ToolData*>(td), TDFacetboolData) != NULL);
}
bool TDFacetboolData::is_reversed ( ) [inline]

Returns the isReversed. This allows to determine whether the facets orientation has changed since the egde array was last modified.

Definition at line 64 of file TDFacetboolData.hpp.

    {return isReversed;}
void TDFacetboolData::is_reversed ( bool  rev)

Manually set the is_reversed flag. This shouldn't be needed. By calling get_edge_indices(bool rev_flag), the isReversed flag will be automatically modified if necessary.

Definition at line 60 of file TDFacetboolData.cpp.

{
  if(rev_flag != isReversed){
    isReversed = rev_flag;
    int temp_int;
    temp_int = edgeIndex[0];
    edgeIndex[0]=edgeIndex[2];
    edgeIndex[2]=temp_int;
  }
}

Definition at line 61 of file TDFacetboolData.hpp.

{ return body_1_flag; }
void TDFacetboolData::set ( int  sv,
int  e0v,
int  e1v,
int  e2v,
bool  parent,
bool  is_reversed 
)

Definition at line 39 of file TDFacetboolData.cpp.

    { surfaceIndex = sv; 
      edgeIndex[0] = e0v; 
      edgeIndex[1] = e1v; 
      edgeIndex[2] = e2v;
      body_1_flag = parent;
      isReversed=is_reversed;
    } 

Member Data Documentation

true if this triangle came from body 1; false if from body 2.

Definition at line 28 of file TDFacetboolData.hpp.

int TDFacetboolData::edgeIndex[3] [private]

An index into an array of CubitFacetEdges denoting which CubitFacetEdges (if any) that the three triangle edges came from.

Definition at line 26 of file TDFacetboolData.hpp.

Is the associated facet reversed or not. The determines whether we need to adjust the edge array before returning it.

Definition at line 31 of file TDFacetboolData.hpp.

An index into an array of FacetSurfaces denoting which FacetSurface this triangle came from.

Definition at line 23 of file TDFacetboolData.hpp.


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