cgma
|
#include <CubitFacetEdgeData.hpp>
Public Member Functions | |
CubitFacetEdgeData (CubitPoint *p1, CubitPoint *p2) | |
CubitFacetEdgeData (CubitPoint *p1, CubitPoint *p2, CubitFacet *facet1, CubitFacet *facet2, int edge_index1, int edge_index2) | |
~CubitFacetEdgeData () | |
int | id () |
void | set_id (int ent_id) |
CubitPoint * | point (int index) |
CubitPoint * | start_node () |
CubitPoint * | end_node () |
void | set_point (CubitPoint *pt, int index) |
CubitFacet * | adj_facet (int index) |
void | facets (DLIList< CubitFacet * > &facet_list) |
void | edges (DLIList< CubitFacetEdge * > &edge_list) |
void | points (DLIList< CubitPoint * > &point_list) |
int | num_adj_facets () |
int | number_tris () |
void | marked (int my_flag) |
int | marked () |
void | add_facet (CubitFacet *facet_ptr) |
CubitStatus | remove_facet (CubitFacet *facet_ptr) |
CubitStatus | merge_edges (CubitFacetEdgeData *other_edge) |
void | flip () |
Private Attributes | |
CubitPoint * | pointArray [2] |
DLIList< CubitFacet * > | adjFacetList |
int | entityId |
Definition at line 32 of file CubitFacetEdgeData.hpp.
CubitFacetEdgeData::CubitFacetEdgeData | ( | CubitPoint * | p1, |
CubitPoint * | p2 | ||
) |
Definition at line 29 of file CubitFacetEdgeData.cpp.
{ assert( p1 && p2 ); assert( p1 != p2 ); pointArray[0] = p1; pointArray[1] = p2; counter_id++; entityId = counter_id; // determine adjacency (assumes facets are already defined) // set the edge and use on the adjacent facets int sense; int eindex; CubitFacet *facet_ptr; DLIList<CubitFacet*> facet_list; p1->facets( facet_list ); CubitBoolean found; for(int ii=0; ii<facet_list.size(); ii++) { found = CUBIT_FALSE; facet_ptr = facet_list.get_and_step(); for(int jj=0; jj<3 && !found; jj++) { if (facet_ptr->point(jj) == p2) { found = CUBIT_TRUE; adjFacetList.append(facet_ptr); eindex = facet_ptr->edge_index( p1, p2, sense ); facet_ptr->edge( this, eindex ); facet_ptr->edge_use( sense, eindex ); } } } }
CubitFacetEdgeData::CubitFacetEdgeData | ( | CubitPoint * | p1, |
CubitPoint * | p2, | ||
CubitFacet * | facet1, | ||
CubitFacet * | facet2, | ||
int | edge_index1, | ||
int | edge_index2 | ||
) |
Definition at line 72 of file CubitFacetEdgeData.cpp.
{ assert( p1 && p2 ); assert( p1 != p2 ); pointArray[0] = p1; pointArray[1] = p2; counter_id++; entityId = counter_id; if (facet1) { adjFacetList.append(facet1); facet1->edge( this, edge_index1 ); facet1->edge_use( 1, edge_index1 ); } if (facet2) { adjFacetList.append(facet2); facet2->edge( this, edge_index2 ); facet2->edge_use( -1, edge_index2 ); } }
Definition at line 102 of file CubitFacetEdgeData.cpp.
{ assert(adjFacetList.size() == 0); }
void CubitFacetEdgeData::add_facet | ( | CubitFacet * | facet_ptr | ) | [inline, virtual] |
Reimplemented from CubitFacetEdge.
Definition at line 68 of file CubitFacetEdgeData.hpp.
{ adjFacetList.append(facet_ptr); }
CubitFacet * CubitFacetEdgeData::adj_facet | ( | int | index | ) | [virtual] |
Implements CubitFacetEdge.
Definition at line 113 of file CubitFacetEdgeData.cpp.
{ if (index < 0 || index > adjFacetList.size() - 1) return (CubitFacet *)NULL; adjFacetList.reset(); return adjFacetList.next(index); }
void CubitFacetEdgeData::edges | ( | DLIList< CubitFacetEdge * > & | edge_list | ) | [virtual] |
Implements CubitFacetEdge.
Definition at line 138 of file CubitFacetEdgeData.cpp.
{ edge_list.append( this ); }
CubitPoint* CubitFacetEdgeData::end_node | ( | ) | [inline, virtual] |
Implements CubitFacetEdge.
Definition at line 52 of file CubitFacetEdgeData.hpp.
{ return point(1); }
void CubitFacetEdgeData::facets | ( | DLIList< CubitFacet * > & | facet_list | ) | [virtual] |
Implements CubitFacetEdge.
Definition at line 127 of file CubitFacetEdgeData.cpp.
{ facet_list += adjFacetList; }
void CubitFacetEdgeData::flip | ( | ) | [virtual] |
Implements CubitFacetEdge.
Definition at line 213 of file CubitFacetEdgeData.cpp.
{ CubitPoint* tmp = pointArray[0]; pointArray[0] = pointArray[1]; pointArray[1] = tmp; for ( int i = adjFacetList.size(); i--; ) { CubitFacet* facet = adjFacetList.get_and_step(); int index = facet->edge_index(this); assert(index >= 0); facet->edge_use( -facet->edge_use(index), index ); } toggle_is_flipped(); }
int CubitFacetEdgeData::id | ( | ) | [inline, virtual] |
void CubitFacetEdgeData::marked | ( | int | my_flag | ) | [inline, virtual] |
Reimplemented from CubitFacetEdge.
Definition at line 65 of file CubitFacetEdgeData.hpp.
{ set_flag(my_flag); }
int CubitFacetEdgeData::marked | ( | ) | [inline, virtual] |
Reimplemented from CubitFacetEdge.
Definition at line 66 of file CubitFacetEdgeData.hpp.
{ return get_flag(); }
CubitStatus CubitFacetEdgeData::merge_edges | ( | CubitFacetEdgeData * | other_edge | ) |
Definition at line 181 of file CubitFacetEdgeData.cpp.
{ if( other_edge == this ) return CUBIT_SUCCESS; int reversed = false; if ( point(0) == other_edge->point(1) && point(1) == other_edge->point(0) ) reversed = true; else if( point(0) != other_edge->point(0) || point(1) != other_edge->point(1) ) return CUBIT_FAILURE; CubitFacetData* facet; adjFacetList.reset(); while( other_edge->adjFacetList.size() ) { facet = dynamic_cast<CubitFacetData*>(other_edge->adjFacetList.pop()); for ( int i = 0; i < 3; i++ ) { if( facet->edge(i) == other_edge ) { facet->edge( this, i ); add_facet(facet); if( reversed ) facet->edge_use( -facet->edge_use(i), i ); } } } delete other_edge; return CUBIT_SUCCESS; }
int CubitFacetEdgeData::num_adj_facets | ( | ) | [inline, virtual] |
Implements CubitFacetEdge.
Definition at line 62 of file CubitFacetEdgeData.hpp.
{ return adjFacetList.size(); }
int CubitFacetEdgeData::number_tris | ( | ) | [inline, virtual] |
Reimplemented from CubitFacetEdge.
Definition at line 64 of file CubitFacetEdgeData.hpp.
{ return num_adj_facets(); }
CubitPoint* CubitFacetEdgeData::point | ( | int | index | ) | [inline, virtual] |
Implements CubitFacetEdge.
Definition at line 50 of file CubitFacetEdgeData.hpp.
{ return pointArray[index]; };
void CubitFacetEdgeData::points | ( | DLIList< CubitPoint * > & | point_list | ) | [virtual] |
Implements CubitFacetEdge.
Definition at line 149 of file CubitFacetEdgeData.cpp.
{ point_list.append( pointArray[0] ); point_list.append( pointArray[1] ); }
CubitStatus CubitFacetEdgeData::remove_facet | ( | CubitFacet * | facet_ptr | ) | [virtual] |
Implements CubitFacetEdge.
Definition at line 161 of file CubitFacetEdgeData.cpp.
{ CubitStatus stat = CUBIT_SUCCESS; bool removed = adjFacetList.remove( facet_ptr ); if (removed) stat = CUBIT_SUCCESS; else stat = CUBIT_FAILURE; return stat; }
void CubitFacetEdgeData::set_id | ( | int | ent_id | ) | [inline, virtual] |
Reimplemented from CubitFacetEdge.
Definition at line 48 of file CubitFacetEdgeData.hpp.
{entityId=ent_id;};
void CubitFacetEdgeData::set_point | ( | CubitPoint * | pt, |
int | index | ||
) | [inline] |
Definition at line 54 of file CubitFacetEdgeData.hpp.
{ pointArray[index] = pt; }
CubitPoint* CubitFacetEdgeData::start_node | ( | ) | [inline, virtual] |
Implements CubitFacetEdge.
Definition at line 51 of file CubitFacetEdgeData.hpp.
{ return point(0); }
DLIList<CubitFacet *> CubitFacetEdgeData::adjFacetList [private] |
Definition at line 36 of file CubitFacetEdgeData.hpp.
int CubitFacetEdgeData::entityId [private] |
Definition at line 37 of file CubitFacetEdgeData.hpp.
CubitPoint* CubitFacetEdgeData::pointArray[2] [private] |
Definition at line 35 of file CubitFacetEdgeData.hpp.