cgma
PartitionCurve.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : PartitionCurve-new.hpp
00003 //
00004 // Purpose       : 
00005 //
00006 // Special Notes : 
00007 //
00008 // Creator       : Jason Kraftcheck
00009 //
00010 // Creation Date : 04/10/02
00011 //-------------------------------------------------------------------------
00012 #ifndef PARTITION_CURVE_HPP
00013 #define PARTITION_CURVE_HPP
00014 
00015 #include "Curve.hpp"
00016 #include "PartitionPoint.hpp"
00017 #include "PartitionCoEdge.hpp"
00018 
00019 class PartitionPoint;
00020 class PartitionSurface;
00021 class GMem;
00022 class CubitFacetEdgeData;
00023 
00024 class PartitionCurve : public Curve, public PartitionEntity
00025 {
00026 
00027 public:
00028 
00029   virtual PartitionCurve* split( double param ) = 0;
00030   
00031   virtual CubitStatus combine( PartitionCurve* dead_curve ) = 0;
00032 
00033   virtual ~PartitionCurve();
00034 
00035   PartitionPoint* start_point() const
00036     { return startPoint; }
00037   
00038   PartitionPoint* end_point() const
00039     { return endPoint; }
00040   
00041   PartitionPoint* other_point( const PartitionPoint* pt ) const
00042     { return pt == startPoint ? endPoint : pt == endPoint ? startPoint : 0; }
00043     
00044   int num_coedges() const;
00045   
00046   PartitionCoEdge* next_coedge( const PartitionCoEdge* prev = 0 ) const
00047     { return !prev ? firstCoEdge : prev->myCurve == this ? prev->curveNext : 0; }
00048   
00049   CubitStatus add( PartitionCoEdge* coedge );
00050   CubitStatus remove( PartitionCoEdge* coedge );
00051   void remove_all_coedges();
00052   
00053   CubitStatus start_point( PartitionPoint* point );
00054   CubitStatus end_point  ( PartitionPoint* point );
00055   
00056   virtual CubitStatus get_graphics( GMem& result,
00057                                     double angle_tolerance=0,
00058                                     double distance_tolerance=0,
00059                                     double max_edge_length=0) = 0; 
00060   
00061   PartitionCurve* next_curve( const PartitionPoint* about_this ) const
00062     { return about_this == startPoint ? startNext :
00063              about_this ==   endPoint ?   endNext : 0; }
00064   
00065   bool is_nonmanifold( const PartitionSurface* in_this_surf ) const;
00066   bool is_in_surface( const PartitionSurface* surf, 
00067                       bool manifold_only = false ) const;
00068   
00069   CubitStatus move_to_geometry( CubitVector& position );
00070   CubitStatus move_to_geometry( CubitPoint* facetPoint );
00071   
00072   void append_simple_attribute_virt( const CubitSimpleAttrib& );
00073   void remove_simple_attribute_virt( const CubitSimpleAttrib& );
00074   void remove_all_simple_attribute_virt();
00075   CubitStatus get_simple_attribute( DLIList<CubitSimpleAttrib>& );
00076   CubitStatus get_simple_attribute( const CubitString& name,
00077                                     DLIList<CubitSimpleAttrib>& );
00078 
00079   void get_parents_virt( DLIList<TopologyBridge*>& );
00080   void get_children_virt( DLIList<TopologyBridge*>& );
00081   int layer() const { return sub_entity_set().get_owner_layer(); }
00082   GeometryQueryEngine* get_geometry_query_engine() const;
00083 
00084         
00085   virtual void print_debug_info( const char* prefix = 0,
00086                                  bool print_subentity_set = true ) const;
00087   
00088 
00089   void get_facet_data( DLIList<CubitFacetEdgeData*>& result_list ) const;
00090   void set_facet_data( const DLIList<CubitFacetEdgeData*>& new_list );
00091   bool has_facet_data() const { return facetEdges.size() > 0; }
00092   void remove_facet_data();
00093   void replace_facet(CubitFacetEdgeData* dead_facet,
00094                      DLIList<CubitFacetEdgeData*> &new_facets);
00095   virtual void notify_split( FacetEntity* old_entity, FacetEntity* new_entity );
00096   CubitStatus fix_facet_data( PartitionCurve* new_curve );
00097   void remove_dead_facet( CubitFacetEdgeData* edge );
00098     //- update facet data for curve partition operation
00099     //- must be called after end points have been updated.
00100     
00101   void do_facet_cleanup();
00102     //- remove small edges, etc.
00103  
00104   void draw_facets(int color);
00105   
00106   virtual void transform( const CubitTransformMatrix& );
00107 
00108 protected:
00109 
00110   PartitionCurve( );
00111   
00112   CubitStatus get_save_topology( DLIList<int>& points );
00113   
00114   void reverse_point_order();
00115 
00116 private:
00117 
00118   DLIList<CubitFacetEdgeData*> facetEdges;
00119 
00120   CubitStatus remove_start_point();
00121   CubitStatus remove_end_point();
00122   CubitStatus remove_from_point( PartitionPoint* point, PartitionCurve* next );
00123 
00124   PartitionCoEdge* firstCoEdge;
00125   
00126   PartitionPoint *startPoint, *endPoint;
00127   PartitionCurve *startNext, *endNext;
00128 };
00129 
00130 #endif
00131 
00132   
00133   
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines