cgma
VGLoopTool.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : VGLoopTool.hpp
00003 //
00004 // Purpose       : Loop Modification Code
00005 //
00006 // Special Notes : Provides common functionality for composite and 
00007 //                 partition geometry.
00008 //
00009 // Creator       : Jason Kraftcheck
00010 //
00011 // Creation Date : 08/08/02
00012 //-------------------------------------------------------------------------
00013 
00014 #ifndef VG_LOOP_TOOL
00015 #define VG_LOOP_TOOL
00016 
00017  
00018 #include "CubitDefines.h"
00019 #include "DLIList.hpp"
00020 #include <vector>
00021 
00022 class CubitVector;
00023 
00024 template <class SURFACE, class LOOP, class COEDGE,class CURVE, class POINT>
00025 class VGLoopTool 
00026 {
00027 public:
00028 /*  
00029   static CubitStatus remove_curve( COEDGE* coedge1, 
00030                                    COEDGE* coedge2,
00031                                    DLIList<COEDGE*>& new_loop_coedges );
00032     //- Remove a curve from loop topology
00033     //- coedge1/2:  The two coedges of a curve
00034     //- If the passed coedges are in different loops, the loops
00035     //- will be combined into a single loop and new_loop_coedges will
00036     //- be empty.  
00037     //- If the passed coedges are in the same loop, unless the coedges
00038     //- are adjacent in that loop, the loop will be split into two
00039     //- loops and the coedges for the new loop passed back in 
00040     //- new_loop_coedges.
00041 
00042   static CubitStatus insert_curve( COEDGE* new_coedge1, 
00043                                    COEDGE* new_coedge2,
00044                                    SURFACE* surface,
00045                                    LOOP*& new_loop1,
00046                                    LOOP*& new_loop2 );
00047     //- Insert a curve into the loop topology
00048     //- new_coedge1/2:  The two new coedges of the curve to be inserted
00049     //- loop1/2_coedge: Any coedges of the existing loops in which the
00050     //-                 new coedges are to be inserted.  (May be NULL).
00051     //- new_loop_coedges: The ordered list of coedges from which the
00052     //-                   caller should create a new loop.  The loops
00053     //-                   are specified with a coedge to avoid the need
00054     //-                   for this class to also be a template of the
00055     //-                   loop type.
00056     //- Note:  In the comments below, when it is stated that a new loop
00057     //-        is created, this means that the coedges for the new loop
00058     //-        are passed back in new_loop_coedges.  This function does
00059     //-        not do the actual loop creation.
00060     //-
00061     //- If both loop1_coedge and loop2_coedge are null, both coedges
00062     //- are passed back in new_loop_coedges without any topology
00063     //- modification.  The caller should create either one or two
00064     //- new loops (a curve imprinted on the interior of the surface
00065     //- or a hole in the surface and a new surface in the hole)
00066     //- depending on the curve having the same start and end vertices.
00067     //-
00068     //- If one of loop1_coedge and loop2_coedge is NULL, or both
00069     //- are part of the same loop, both new coedges are inserted in 
00070     //- the same loop.  This will result in either a sipe or the 
00071     //- loop being split into two loops.  If the loop is split, the 
00072     //- coedges for the new loop are passed back in new_loop_coedges.
00073     //-
00074     //- If both loop1_coedge and loop2_coedge are non-null and part
00075     //- of different loops, the loops are joined using the new 
00076     //- coedges as a bridge.
00077 */
00078   static double loop_angle_metric( COEDGE* first_coedge );
00079 /*  
00080   static bool is_position_within_loop( const CubitVector& position,
00081                                        COEDGE* first_coedge,
00082                                        CubitVector* closest_on_loop = 0,
00083                                        CubitVector* normal = 0 );
00084                                        
00085   static double loop_area( COEDGE* first_coedge );
00086 
00087   static CubitStatus closest_point_trimmed( 
00088                                       DLIList<COEDGE*>& surface_coedges,
00089                                       const CubitVector& from_pt,
00090                                       CubitVector& result_pt,
00091                                       CubitPointContainment* cont = 0 );
00092 */
00093   static void get_loop_polyline( COEDGE* first_coedge,
00094                                  std::vector<CubitVector>& result_set );
00095 
00096 private:
00097 /*  
00098   static CubitStatus previous_coedge( COEDGE* coedge, SURFACE* surface,
00099                                       COEDGE*& result );
00100     //- Find the coedge in the passed surface after which the passed
00101     //- coedge will be inserted.  The returned coedge will share its
00102     //- start point (end point of the curve if the coedge sense is 
00103     //- reversed) with the end point (start point of the curve if the
00104     //- coedge sense is reversed) of the passed coedge.  If the coedge
00105     //- has no points in common with any loops in the passed surface,
00106     //- the result is NULL and CUBIT_SUCCESS is returned.  CUBIT_FAILURE
00107     //- is returned if something is wrong with the topology.
00108   
00109   static COEDGE* closest_loop_coedge( const CubitVector& from_pt,
00110                                       COEDGE* first_coedge,
00111                                       COEDGE*& other_coedge,
00112                                       CubitVector* closest_pt = 0 );
00113 
00114   static CubitStatus closest_surface_coedge( SURFACE* surface,
00115                                          const CubitVector& from_pt,
00116                                          COEDGE*& coedge1,
00117                                          COEDGE*& coedge2,
00118                                          CubitVector* pt_on_curve = 0 );
00119 
00120   static bool inside_of_curve( const CubitVector& curve_tangent,
00121                                const CubitVector& curve_position,
00122                                const CubitVector& surface_position,
00123                                const CubitVector& surface_normal );                                     
00124 
00125   static bool odd_coedge_count( COEDGE* coedge );
00126 */  
00127   static CubitStatus get_loop_polygon( COEDGE* first_coedge,
00128                                        DLIList<CubitVector*>& polygon_points );
00129                                        
00130 };
00131 
00132 #include "VGLoopTool.cpp"
00133 
00134 #endif
00135 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines