cgma
TDSplitSurface Class Reference

#include <TDSplitSurface.hpp>

Inheritance diagram for TDSplitSurface:
ToolData

List of all members.

Public Member Functions

 TDSplitSurface (int vertex_type)
 TDSplitSurface (RefFace *ref_face_ptr)
 ~TDSplitSurface ()
RefFaceref_face_ptr ()
void add_type (int type)
int get_type ()
CubitStatus add_coedges (DLIList< CoEdge * > &co_edge_list, int side_interval[])
CubitStatus add_a_coedges (DLIList< CoEdge * > &a_coedges, RefVertex *start_vertex_ptr=NULL)
CubitStatus add_b_coedges (DLIList< CoEdge * > &b_coedges, RefVertex *start_vertex_ptr=NULL)
CubitStatus add_c_coedges (DLIList< CoEdge * > &c_coedges, RefVertex *start_vertex_ptr=NULL)
CubitStatus add_d_coedges (DLIList< CoEdge * > &d_coedges, RefVertex *start_vertex_ptr=NULL)
CubitStatus tessellate_sides (double tol, double fraction, double distance, int num_segs, DLIList< RefVertex * > &through_vertex_list)
RefVertexstart_vertex (CoEdge *co_edge_ptr)
DLIList< CoEdge * > * get_a_coedges ()
DLIList< CoEdge * > * get_b_coedges ()
DLIList< CoEdge * > * get_c_coedges ()
DLIList< CoEdge * > * get_d_coedges ()
double length_a ()
double length_b ()
double length_c ()
double length_d ()
int coord_list_size_a ()
void coord_list_reset_a ()
void coord_list_last_a ()
CubitVectorcoord_list_get_a ()
CubitVectorcoord_list_get_and_step_a ()
CubitVectorcoord_list_get_and_back_a ()
int coord_list_size_b ()
void coord_list_reset_b ()
void coord_list_last_b ()
CubitVectorcoord_list_get_b ()
CubitVectorcoord_list_get_and_step_b ()
CubitVectorcoord_list_get_and_back_b ()
int coord_list_size_c ()
void coord_list_reset_c ()
void coord_list_last_c ()
CubitVectorcoord_list_get_c ()
CubitVectorcoord_list_get_and_step_c ()
CubitVectorcoord_list_get_and_back_c ()
int coord_list_size_d ()
void coord_list_reset_d ()
void coord_list_last_d ()
CubitVectorcoord_list_get_d ()
CubitVectorcoord_list_get_and_step_d ()
CubitVectorcoord_list_get_and_back_d ()
int param_list_size_a ()
void param_list_reset_a ()
void param_list_last_a ()
double param_list_get_a ()
double param_list_get_and_step_a ()
double param_list_get_and_back_a ()
int param_list_size_b ()
void param_list_reset_b ()
void param_list_last_b ()
double param_list_get_b ()
double param_list_get_and_step_b ()
double param_list_get_and_back_b ()
int param_list_size_c ()
void param_list_reset_c ()
void param_list_last_c ()
double param_list_get_c ()
double param_list_get_and_step_c ()
double param_list_get_and_back_c ()
int param_list_size_d ()
void param_list_reset_d ()
void param_list_last_d ()
double param_list_get_d ()
double param_list_get_and_step_d ()
double param_list_get_and_back_d ()
CubitBoolean is_a_collapsed ()
CubitBoolean is_b_collapsed ()
CubitBoolean is_c_collapsed ()
CubitBoolean is_d_collapsed ()

Static Public Member Functions

static int is_split_surface (const ToolData *td)

Private Attributes

RefFacerefFacePtr
SSSidesideA
SSSidesideB
SSSidesideC
SSSidesideD
int vertexType

Detailed Description

Definition at line 186 of file TDSplitSurface.hpp.


Constructor & Destructor Documentation

TDSplitSurface::TDSplitSurface ( int  vertex_type)

Definition at line 12 of file TDSplitSurface.cpp.

{
  vertexType = vertex_type;
  sideA = NULL;
  sideB = NULL;
  sideC = NULL;
  sideD = NULL;
}

Definition at line 21 of file TDSplitSurface.cpp.

{
  refFacePtr = ref_face_ptr;

  sideA = NULL;
  sideB = NULL;
  sideC = NULL;
  sideD = NULL;
}

Definition at line 31 of file TDSplitSurface.cpp.

{
  if( sideA )
    delete sideA;
  if( sideB )
    delete sideB;
  if( sideC )
    delete sideC;
  if( sideD )
    delete sideD;
}

Member Function Documentation

CubitStatus TDSplitSurface::add_a_coedges ( DLIList< CoEdge * > &  a_coedges,
RefVertex start_vertex_ptr = NULL 
)

Definition at line 132 of file TDSplitSurface.cpp.

{
  if( start_vertex_ptr == NULL )
    sideA = new SSSide( refFacePtr, a_coedges );
  else
  {
    // Collapsed side (for triangle)
    CubitVector tmp(start_vertex_ptr->coordinates()); 
    sideA = new SSSide( refFacePtr, a_coedges, &tmp );
  }
  return CUBIT_SUCCESS;
}
CubitStatus TDSplitSurface::add_b_coedges ( DLIList< CoEdge * > &  b_coedges,
RefVertex start_vertex_ptr = NULL 
)

Definition at line 147 of file TDSplitSurface.cpp.

{
  if( start_vertex_ptr == NULL )
    sideB = new SSSide( refFacePtr, b_coedges );
  else
  {
    // Collapsed side (for triangle)
    CubitVector tmp(start_vertex_ptr->coordinates()); 
    sideB = new SSSide( refFacePtr, b_coedges, &tmp );
  }
  return CUBIT_SUCCESS;
}
CubitStatus TDSplitSurface::add_c_coedges ( DLIList< CoEdge * > &  c_coedges,
RefVertex start_vertex_ptr = NULL 
)

Definition at line 162 of file TDSplitSurface.cpp.

{
  if( start_vertex_ptr == NULL )
    sideC = new SSSide( refFacePtr, c_coedges );
  else
  {
    // Collapsed side (for triangle)
    CubitVector tmp(start_vertex_ptr->coordinates()); 
    sideC = new SSSide( refFacePtr, c_coedges, &tmp );
  }
  return CUBIT_SUCCESS;
}
CubitStatus TDSplitSurface::add_coedges ( DLIList< CoEdge * > &  co_edge_list,
int  side_interval[] 
)

Definition at line 44 of file TDSplitSurface.cpp.

{
  int i;
  co_edge_list.reset();
  CoEdge *co_edge_ptr;
  DLIList<CoEdge*> chain;
  RefVertex *start_vertex_ptr;

  // SIDE A
  if( side_interval[0] == 0 )
  {
    co_edge_ptr = co_edge_list.get();
    start_vertex_ptr = start_vertex( co_edge_ptr );
    CubitVector tmp(start_vertex_ptr->coordinates());
    sideA = new SSSide( refFacePtr, chain, &tmp );
  }
  else
  {
    for( i=side_interval[0]; i--; )
    {
      co_edge_ptr = co_edge_list.get_and_step();
      chain.append( co_edge_ptr );
    }
    sideA = new SSSide( refFacePtr, chain );
  }
  chain.clean_out();

  // SIDE B
  if( side_interval[1] == 0 )
  {
    co_edge_ptr = co_edge_list.get();
    start_vertex_ptr = start_vertex( co_edge_ptr );
    CubitVector tmp(start_vertex_ptr->coordinates());
    sideB = new SSSide( refFacePtr, chain, &tmp );
  }
  else
  {
    for( i=side_interval[1]; i--; )
    {
      co_edge_ptr = co_edge_list.get_and_step();
      chain.append( co_edge_ptr );
    }
    sideB = new SSSide( refFacePtr, chain );
  }
  chain.clean_out();

  // SIDE C
  if( side_interval[2] == 0 )
  {
    co_edge_ptr = co_edge_list.get();
    start_vertex_ptr = start_vertex( co_edge_ptr );
    CubitVector tmp(start_vertex_ptr->coordinates());
    sideC = new SSSide( refFacePtr, chain, &tmp );
  }
  else
  {
    for( i=side_interval[2]; i--; )
    {
      co_edge_ptr = co_edge_list.get_and_step();
      chain.append( co_edge_ptr );
    }
    sideC = new SSSide( refFacePtr, chain );
  }
  chain.clean_out();

  // SIDE D
  if( side_interval[3] == 0 )
  {
    co_edge_ptr = co_edge_list.get();
    start_vertex_ptr = start_vertex( co_edge_ptr );
    CubitVector tmp(start_vertex_ptr->coordinates());
    sideD = new SSSide( refFacePtr, chain, &tmp );
  }
  else
  {
    for( i=side_interval[3]; i--; )
    {
      co_edge_ptr = co_edge_list.get_and_step();
      chain.append( co_edge_ptr );
    }
    sideD = new SSSide( refFacePtr, chain );
  }

  return CUBIT_SUCCESS;
}
CubitStatus TDSplitSurface::add_d_coedges ( DLIList< CoEdge * > &  d_coedges,
RefVertex start_vertex_ptr = NULL 
)

Definition at line 177 of file TDSplitSurface.cpp.

{
  if( start_vertex_ptr == NULL )
    sideD = new SSSide( refFacePtr, d_coedges );
  else
  {
    // Collapsed side (for triangle)
    CubitVector tmp(start_vertex_ptr->coordinates()); 
    sideD = new SSSide( refFacePtr, d_coedges, &tmp );
  }
  return CUBIT_SUCCESS;
}
void TDSplitSurface::add_type ( int  type)

Definition at line 364 of file TDSplitSurface.hpp.

Definition at line 375 of file TDSplitSurface.hpp.

Definition at line 348 of file TDSplitSurface.hpp.

Definition at line 355 of file TDSplitSurface.hpp.

Definition at line 362 of file TDSplitSurface.hpp.

Definition at line 373 of file TDSplitSurface.hpp.

Definition at line 346 of file TDSplitSurface.hpp.

{ return sideA->coord_list_size(); }

Definition at line 353 of file TDSplitSurface.hpp.

{ return sideB->coord_list_size(); }

Definition at line 360 of file TDSplitSurface.hpp.

{ return sideC->coord_list_size(); }

Definition at line 371 of file TDSplitSurface.hpp.

{ return sideD->coord_list_size(); }

Definition at line 192 of file TDSplitSurface.cpp.

{
  return sideA->co_edges();
}

Definition at line 198 of file TDSplitSurface.cpp.

{
  return sideB->co_edges();
}

Definition at line 204 of file TDSplitSurface.cpp.

{
  return sideC->co_edges();
}

Definition at line 210 of file TDSplitSurface.cpp.

{
  return sideD->co_edges();
}
int TDSplitSurface::get_type ( ) [inline]

Definition at line 334 of file TDSplitSurface.hpp.

{ return vertexType; }

Definition at line 404 of file TDSplitSurface.hpp.

{ return sideA->is_collapsed(); }

Definition at line 407 of file TDSplitSurface.hpp.

{ return sideB->is_collapsed(); }

Definition at line 410 of file TDSplitSurface.hpp.

{ return sideC->is_collapsed(); }

Definition at line 413 of file TDSplitSurface.hpp.

{ return sideD->is_collapsed(); }
static int TDSplitSurface::is_split_surface ( const ToolData td) [inline, static]

Definition at line 315 of file TDSplitSurface.hpp.

     {return (CAST_TO(td, const TDSplitSurface) != NULL);}
double TDSplitSurface::length_a ( ) [inline]

Definition at line 337 of file TDSplitSurface.hpp.

{ return sideA->length(); }
double TDSplitSurface::length_b ( ) [inline]

Definition at line 339 of file TDSplitSurface.hpp.

{ return sideB->length(); }
double TDSplitSurface::length_c ( ) [inline]

Definition at line 341 of file TDSplitSurface.hpp.

{ return sideC->length(); }
double TDSplitSurface::length_d ( ) [inline]

Definition at line 343 of file TDSplitSurface.hpp.

{ return sideD->length(); }

Definition at line 396 of file TDSplitSurface.hpp.

Definition at line 401 of file TDSplitSurface.hpp.

Definition at line 386 of file TDSplitSurface.hpp.

Definition at line 391 of file TDSplitSurface.hpp.

Definition at line 384 of file TDSplitSurface.hpp.

Definition at line 394 of file TDSplitSurface.hpp.

Definition at line 399 of file TDSplitSurface.hpp.

Definition at line 382 of file TDSplitSurface.hpp.

Definition at line 389 of file TDSplitSurface.hpp.

Definition at line 331 of file TDSplitSurface.hpp.

{ return refFacePtr; }

Definition at line 256 of file TDSplitSurface.cpp.

{
  RefEdge *ref_edge_ptr = co_edge_ptr->get_ref_edge_ptr();
  
  if ( co_edge_ptr->get_sense() == CUBIT_REVERSED )
    return ref_edge_ptr->end_vertex();
  else
    return ref_edge_ptr->start_vertex();
}
CubitStatus TDSplitSurface::tessellate_sides ( double  tol,
double  fraction,
double  distance,
int  num_segs,
DLIList< RefVertex * > &  through_vertex_list 
)

Definition at line 216 of file TDSplitSurface.cpp.

{
  // Sides B and D will use the graphics tessellation to build the 
  // param lists.
  if( sideB->build_param_list_from_facets( tol ) == CUBIT_FAILURE )
    return CUBIT_FAILURE;
  if( sideD->build_param_list_from_facets( tol ) == CUBIT_FAILURE )
    return CUBIT_FAILURE;

  // Syncronize the lists so that we have the same number and evenly
  // spaced tessellations on B and D sides
  if( sideB->syncronize_lists( sideD, tol ) == CUBIT_FAILURE )
  {
    PRINT_ERROR( "Unable to interpolate split location.\n" );
    return CUBIT_FAILURE;
  }

  // Sides A and C typically only need to retrieve the 50% location,
  // but may have a location different than 50% or multiple locations.
  // Note if num_segs>2 the fraction is ignored.

  // Populate lists for side A
  if( sideA->build_param_list( fraction, distance, num_segs, through_vertex_list ) 
    == CUBIT_FAILURE )
    return CUBIT_FAILURE;

  // Populate lists for side C
  if( distance != -1.0 )
    distance = sideC->length()-distance;

  if( sideC->build_param_list( 1.0-fraction, distance, num_segs, 
                               through_vertex_list ) == CUBIT_FAILURE )
    return CUBIT_FAILURE;

  return CUBIT_SUCCESS;
}

Member Data Documentation

Definition at line 320 of file TDSplitSurface.hpp.

Definition at line 322 of file TDSplitSurface.hpp.

Definition at line 323 of file TDSplitSurface.hpp.

Definition at line 324 of file TDSplitSurface.hpp.

Definition at line 325 of file TDSplitSurface.hpp.

Definition at line 328 of file TDSplitSurface.hpp.


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