cgma
CompositeEngine.cpp File Reference
#include <assert.h>
#include "CompositeEngine.hpp"
#include "PartitionEngine.hpp"
#include "DLIList.hpp"
#include "TDUniqueId.hpp"
#include "CubitTransformMatrix.hpp"
#include "RTree.hpp"
#include "CompositePoint.hpp"
#include "CompositeCurve.hpp"
#include "CompositeCoEdge.hpp"
#include "CompositeLoop.hpp"
#include "CompositeSurface.hpp"
#include "CompositeShell.hpp"
#include "CompositeLump.hpp"
#include "CompositeBody.hpp"
#include "GfxPreview.hpp"
#include "PartitionPoint.hpp"
#include "SegmentedCurve.hpp"
#include "CADefines.hpp"
#include "VGLoopTool.hpp"
#include "Body.hpp"
#include "LumpSM.hpp"
#include "GeometryQueryTool.hpp"
#include "AppUtil.hpp"
#include "GeometryEvent.hpp"

Go to the source code of this file.

Typedefs

typedef VGLoopTool
< CompositeSurface,
CompositeLoop, CompositeCoEdge,
CompositeCurve, CompositePoint
CompLoopTool

Functions

static void cme_hide_surface (HiddenEntitySet &set, CompositeSurface *surface)
static void cme_unhide_surface (CompositeSurface *surf)
static CompositeCoSurfcme_create_cosurf (CompositeLump *lump, CompositeSurface *surf)

Typedef Documentation


Function Documentation

static CompositeCoSurf* cme_create_cosurf ( CompositeLump lump,
CompositeSurface surf 
) [static]

Definition at line 4333 of file CompositeEngine.cpp.

{
  Surface* real_surf = surf->get_surface(0);
  
  DLIList<TopologyBridge*> shells, lumps(1);
  real_surf->get_parents( shells );
  while (shells.size())
  {
    TopologyBridge* shell = shells.pop();
    lumps.clean_out();
    shell->get_parents( lumps );
    assert( lumps.size() == 1 );
    TopologyBridge* real_lump = lumps.pop();
    if (real_lump->owner() == lump)
    {
      CubitSense sense = real_surf->get_shell_sense( dynamic_cast<ShellSM*>(shell) );
      if (sense == CUBIT_UNKNOWN)
        sense = CUBIT_FORWARD;
      else if (surf->get_sense(0) == CUBIT_REVERSED)
        sense = (sense == CUBIT_REVERSED) ? CUBIT_FORWARD : CUBIT_REVERSED;
    
      CompositeCoSurf* result = new CompositeCoSurf(sense);
      surf->add( result );
      return result;
    }
  }
  
  return NULL;
}
static void cme_hide_surface ( HiddenEntitySet set,
CompositeSurface surface 
) [static]

Definition at line 2413 of file CompositeEngine.cpp.

{
  set.hide( surface );
  CompositeLoop* loop = 0;
  while (NULL != (loop = surface->next_loop( loop )))
  {
    set.hide( loop );
    CompositeCoEdge* coedge = loop->first_coedge();
    do {
      set.hide( coedge );
      
      bool hide_curve = true;
      CompositeCurve* curve = coedge->get_curve();
      CompositeCoEdge* curve_coedge = 0;
      while ((curve_coedge = curve->next_coedge( curve_coedge )))
        if (curve_coedge->owner() != &set)
          { hide_curve = false; break; }
      
      if (hide_curve)
      {
        set.hide( curve );
        int num_pts = 1 + (curve->start_point() == curve->end_point());
        for (int i = 0; i < num_pts; i++)
        {
          CompositePoint* pnt = i ? curve->end_point() : curve->start_point();
          bool hide_pnt = true;
          CompositeCurve* pnt_curve = 0;
          while ((pnt_curve = pnt->next_curve( pnt_curve )))
            if (pnt_curve->owner() != &set)
              { hide_pnt = false; break; }
          
          if (hide_pnt)
            set.hide( pnt );
        }
      }
    } while((coedge = loop->next_coedge(coedge)) != loop->first_coedge());
  }
}
static void cme_unhide_surface ( CompositeSurface surf) [static]

Definition at line 2453 of file CompositeEngine.cpp.

{
  HiddenEntitySet* set = dynamic_cast<HiddenEntitySet*>(surf->owner());
  assert( !!set );
  set->restore( surf );
  CompositeLoop* loop = 0;
  while (NULL != (loop = surf->next_loop( loop )))
  {
    set->restore( loop );
    CompositeCoEdge* coedge = loop->first_coedge();
    do {
      if (coedge->owner() == set)
      {
        CompositeCurve* curve = coedge->get_curve();
        set->restore( coedge );
        set->restore( curve );
        if (curve->start_point()->owner() == set)
          set->restore( curve->start_point() );
        if (curve->end_point()->owner() == set)
          set->restore( curve->end_point() );
      }
    } while ((coedge = loop->next_coedge(coedge)) != loop->first_coedge());
  }
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines