cgma
PartitionPoint Class Reference

#include <PartitionPoint.hpp>

Inheritance diagram for PartitionPoint:
TBPoint PartitionEntity GeometryEntity TopologyBridge

List of all members.

Public Member Functions

 PartitionPoint (const CubitVector &position, PartitionEntity *owner)
 PartitionPoint (const CubitSimpleAttrib &attrib, PartitionEntity *owner)
 PartitionPoint (TBPoint *real_point)
 ~PartitionPoint ()
virtual CubitVector coordinates () const
virtual CubitBox bounding_box () const
virtual CubitStatus move_to_geometry (CubitVector &)
TBPointreal_point () const
CubitStatus move (CubitVector &delta)
void append_simple_attribute_virt (const CubitSimpleAttrib &)
void remove_simple_attribute_virt (const CubitSimpleAttrib &)
void remove_all_simple_attribute_virt ()
CubitStatus get_simple_attribute (DLIList< CubitSimpleAttrib > &)
CubitStatus get_simple_attribute (const CubitString &name, DLIList< CubitSimpleAttrib > &)
void get_parents_virt (DLIList< TopologyBridge * > &parents)
void get_children_virt (DLIList< TopologyBridge * > &children)
int layer () const
GeometryQueryEngineget_geometry_query_engine () const
int num_curves () const
PartitionCurvenext_curve (PartitionCurve *prev=0) const
PartitionCurvecommon_curve (PartitionPoint *other) const
virtual void print_debug_info (const char *prefix=0, bool print_subentity_set=true) const
virtual void reverse_sense ()
virtual void notify_split (FacetEntity *, FacetEntity *)
CubitPointDatafacet_point () const
void facet_point (CubitPointData *set)
virtual CubitStatus save (CubitSimpleAttrib &attrib)
virtual void transform (const CubitTransformMatrix &)

Private Attributes

PartitionCurvefirstCurve
int curveCount
CubitVector myPosition
CubitPointDatafacetPoint

Friends

class PartitionCurve

Detailed Description

Definition at line 10 of file PartitionPoint.hpp.


Constructor & Destructor Documentation

PartitionPoint::PartitionPoint ( const CubitVector position,
PartitionEntity owner 
)

Definition at line 11 of file PartitionPoint.cpp.

  : firstCurve(0), curveCount(0), myPosition( position ), facetPoint(0)
{ 
  owner->sub_entity_set().add_lower_order( this );
}

Definition at line 27 of file PartitionPoint.cpp.

  : firstCurve(0), curveCount(0), facetPoint(0)
{ 
  DLIList<int> junk;
  DLIList<CubitVector*> pt;
  owner->sub_entity_set().add_lower_order( this, attrib, 0, pt, junk, junk, junk);
  assert(pt.size() == 1);
  myPosition = *pt.get();
  delete pt.get();
}

Definition at line 18 of file PartitionPoint.cpp.

  : firstCurve(0), curveCount(0), 
    myPosition( real_point->coordinates() ), 
    facetPoint(0)
{
  assert( dynamic_cast<SubEntitySet*>(real_point->owner()) == 0 );
  new SubEntitySet( real_point, this );
}

Definition at line 40 of file PartitionPoint.cpp.

{
  while( firstCurve )
  {
    PartitionCurve* curve = firstCurve;
    if( curve->start_point() == this )
      curve->start_point(0);
    if( curve->end_point() == this )
      curve->end_point(0);
    assert( firstCurve != curve );
  }
  assert( curveCount == 0 );
  facet_point(0);
}

Member Function Documentation

Implements TopologyBridge.

Definition at line 162 of file PartitionPoint.cpp.

{ sub_entity_set().add_attribute( this, csa ); }
CubitBox PartitionPoint::bounding_box ( void  ) const [virtual]

Reimplemented from TBPoint.

Definition at line 211 of file PartitionPoint.cpp.

  { return CubitBox(coordinates()); }

Definition at line 69 of file PartitionPoint.cpp.

{
  PartitionCurve* curve = 0;
  if( other == this )
  {
    while( (curve = next_curve(curve)) )
      if( curve->start_point() == curve->end_point() )
        return curve;
  }
  else
  {
    while( (curve = next_curve(curve)) )
      if( curve->other_point(other) )
        return curve;
  }
  return 0;
}
CubitVector PartitionPoint::coordinates ( void  ) const [virtual]

Implements TBPoint.

Definition at line 55 of file PartitionPoint.cpp.

  { return myPosition; }

Definition at line 54 of file PartitionPoint.hpp.

{ return facetPoint; }

Definition at line 186 of file PartitionPoint.cpp.

{
  if( facetPoint )
    TDVGFacetOwner::remove(facetPoint);
  facetPoint = set;
  if( set )
  {
    assert((set->coordinates() - coordinates()).length_squared() 
               < GEOMETRY_RESABS*GEOMETRY_RESABS);
    TDVGFacetOwner::set(facetPoint,this);
  }
}
void PartitionPoint::get_children_virt ( DLIList< TopologyBridge * > &  children) [virtual]

Implements TopologyBridge.

Definition at line 118 of file PartitionPoint.cpp.

{
}

Implements TopologyBridge.

Definition at line 127 of file PartitionPoint.cpp.

void PartitionPoint::get_parents_virt ( DLIList< TopologyBridge * > &  parents) [virtual]

Implements TopologyBridge.

Definition at line 96 of file PartitionPoint.cpp.

{
  parents.clean_out();
  if( real_point() )
  {
      // Get all the real point's parent curves.
    sub_entity_set().get_entity()->get_parents_virt( parents );

      // Remove all real parents hidden by partitions.  We will add
      // the partitions hiding these curves later.  
    for( int i = parents.size(); i--; )
      if( dynamic_cast<SubEntitySet*>(parents.step_and_get()->owner() ) )
        parents.change_to(0);
    parents.remove_all_with_value(0);
  }
  
    // Now add any parent partition curves
  for( PartitionCurve* curve = firstCurve; curve; curve = curve->next_curve(this) )
    parents.append( curve );
    
}

Implements TopologyBridge.

Definition at line 168 of file PartitionPoint.cpp.

{ 
  sub_entity_set().get_attributes( this, list ); 
  return CUBIT_SUCCESS;
}

Implements TopologyBridge.

Definition at line 173 of file PartitionPoint.cpp.

{ 
  sub_entity_set().get_attributes( this, name.c_str(), list ); 
  return CUBIT_SUCCESS;
}
int PartitionPoint::layer ( ) const [inline, virtual]

Reimplemented from TopologyBridge.

Definition at line 40 of file PartitionPoint.hpp.

Definition at line 87 of file PartitionPoint.cpp.

{
  //if( curveSet.size() )
    return CUBIT_FAILURE;
  
  //myPosition += delta;
  //return CUBIT_SUCCESS;
}

Reimplemented from PartitionEntity.

Definition at line 214 of file PartitionPoint.cpp.

{
  pos = coordinates();
  return CUBIT_SUCCESS;
}

Definition at line 66 of file PartitionPoint.cpp.

  { return prev ? prev->next_curve(this) : firstCurve; }
void PartitionPoint::notify_split ( FacetEntity ,
FacetEntity  
) [virtual]

Implements PartitionEntity.

Definition at line 183 of file PartitionPoint.cpp.

  { assert(0); }
int PartitionPoint::num_curves ( ) const [inline]

Definition at line 70 of file PartitionPoint.hpp.

  { return curveCount; }
void PartitionPoint::print_debug_info ( const char *  prefix = 0,
bool  print_subentity_set = true 
) const [virtual]

Reimplemented from PartitionEntity.

Definition at line 132 of file PartitionPoint.cpp.

{
  if( !prefix ) prefix = "";
  char* new_prefix = new char[strlen(prefix)+3];
  strcpy( new_prefix, prefix );
  strcat( new_prefix, "  ");
  CubitVector p = coordinates();
  PRINT_INFO("%sPartitionPoint %p at (%f,%f,%f)\n", 
    prefix, (void*)this, p.x(), p.y(), p.z() );
  DLIList<Curve*> curve_list;
  const_cast<PartitionPoint*>(this)->TopologyBridge::curves( curve_list );
  PRINT_INFO("%s  %d Curves (%d PartitionCurves).\n", prefix, 
    curve_list.size(), num_curves() );
  
  if ( facet_point() ) {
    p = facet_point()->coordinates();
    PRINT_INFO("%s  CubitPoint %p at [%f,%f,%f] (%f)\n", prefix,
            (void*)facet_point(), p.x(), p.y(), p.z(),
            (coordinates() - facet_point()->coordinates()).length());
  }
  
  if( ent_set )
    sub_entity_set().print_debug_info( new_prefix );
  else 
    print_partitioned_entity(new_prefix);
  delete [] new_prefix;
}

Definition at line 122 of file PartitionPoint.cpp.

{
  return dynamic_cast<TBPoint*>(sub_entity_set().get_entity());
}

Implements TopologyBridge.

Definition at line 166 of file PartitionPoint.cpp.

Implements TopologyBridge.

Definition at line 164 of file PartitionPoint.cpp.

{ sub_entity_set().rem_attribute( this, csa ); }
void PartitionPoint::reverse_sense ( ) [virtual]

Implements PartitionEntity.

Definition at line 180 of file PartitionPoint.cpp.

  { }

Implements PartitionEntity.

Definition at line 199 of file PartitionPoint.cpp.

{
  int id = sub_entity_set().get_id(this);
  if( id <= 0 )
    return CUBIT_FAILURE;
  
  DLIList<CubitVector*> pt_list(1);
  pt_list.append( new CubitVector(coordinates()) );
  
  return sub_entity_set().save_geometry( id, 0, &pt_list, 0, 0, 0, attrib );
}
void PartitionPoint::transform ( const CubitTransformMatrix xform) [virtual]

Implements PartitionEntity.

Definition at line 220 of file PartitionPoint.cpp.

{
  if( TBPoint* point = dynamic_cast<TBPoint*>(partitioned_entity()) )
    myPosition = point->coordinates();
  else
    myPosition = xform * myPosition;
  
  if( facetPoint )
    facetPoint->set(myPosition);
}

Friends And Related Function Documentation

friend class PartitionCurve [friend]

Definition at line 13 of file PartitionPoint.hpp.


Member Data Documentation

Definition at line 64 of file PartitionPoint.hpp.

Definition at line 67 of file PartitionPoint.hpp.

Definition at line 63 of file PartitionPoint.hpp.

Definition at line 66 of file PartitionPoint.hpp.


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