cgma
Loop.hpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : Loop.hpp
00003 //
00004 // Purpose       : Represents a loop of edges of a face of a model.
00005 //
00006 // Special Notes :
00007 //
00008 // Creator       : Xuechen Liu
00009 //
00010 // Creation Date : 08/02/96
00011 //
00012 // Owner         : Malcolm J. Panthaki
00013 //-------------------------------------------------------------------------
00014 
00015 #ifndef LOOP_HPP
00016 #define LOOP_HPP
00017 
00018 // ********** BEGIN STANDARD INCLUDES      **********
00019 // ********** END STANDARD INCLUDES        **********
00020 
00021 // ********** BEGIN CUBIT INCLUDES         **********
00022 #include "CubitDefines.h"
00023 #include "GeometryDefines.h"
00024 #include "CubitBox.hpp"
00025 #include "GroupingEntity.hpp"
00026 // ********** END CUBIT INCLUDES           **********
00027 
00028 // ********** BEGIN FORWARD DECLARATIONS   **********
00029 class CoEdge;
00030 class RefFace;
00031 class RefEdge;
00032 class RefVertex;
00033 class CubitVector;
00034 class LoopSM;
00035 // ********** END FORWARD DECLARATIONS     **********
00036 
00037 class CUBIT_GEOM_EXPORT Loop : public GroupingEntity
00038 {
00039 public :
00040   
00041   Loop() ;
00042     //- The default constructor.
00043   
00044   Loop(LoopSM* OSMEPtr) ;
00045     //- The constructor with a pointer to an other solid model entity.
00046 
00047   DagType dag_type() const { return DagType::loop_type(); }
00048   
00049   LoopType loop_type() const;
00050     //R LoopType
00051     //- Gets the type of this loop.  See LoopType enum for more details.
00052   
00053   CubitStatus get_angle_metric(double& angle_metric);
00054     //R CubitStatus
00055     //R- CUBIT_SUCCESS/CUBIT_FAILURE
00056     //O angle_metric
00057     //O- Angle metric value
00058     //- Gets the angle metric for this Loop. The value of the angle  
00059     //- metric returned is
00060     //- ( sum(interior_angles_at_vertices)/pi - n ).
00061     //- For planar faces this metric is 2.0 for internal
00062     //- Loops and -2.0 for
00063     //- external Loops.
00064   
00065   CubitStatus ordered_ref_edges( DLIList<RefEdge*>& ordered_edge_list );
00066     //R CubitStatus
00067     //R- CUBIT_SUCCESS/CUBIT_FAILURE
00068     //O ordered_edge_list
00069     //O- Ordered list of ref edges with respect to this loop.
00070     //- This function works through the co_edges to get the correct
00071     //- ref_edges with respect to this loop.
00072 
00073   CubitStatus ordered_co_edges (DLIList<CoEdge*>& ordered_coedge_list);
00074     //R CubitStatus
00075     //R- CUBIT_SUCCESS/CUBIT_FAILURE
00076     //O ordered_edge_list
00077     //O- Ordered list of co edges with respect to this loop.
00078     //- This function is differnt than the simple co_edges function.
00079     //- You must use this function if you want the co_edges to respect
00080     //- the loop in their list.
00081         
00082     RefFace* get_ref_face_ptr( );
00083     //R RefFace*
00084     //R- A pointer to the parent RefFace.
00085     
00086     CoEdge* get_co_edge_ptr( RefEdge* ref_edge_ptr );
00087     //R CoEdge* 
00088     //R- A pointer to a child CoEdge
00089     //I ref_edge_ptr
00090     //I- A pointer to a child RefEdge
00091     //- This method returns the child CoEdge connecting the
00092     //- passed RefEdge to this Loop.  If the RefEdge occurs
00093     //- more than once in the Loop, only the first CoEdge
00094     //- encountered will be returned.
00095     
00096       
00097   CubitBox bounding_box();
00098     //R CubitBox
00099     //R- The bounding box of this loop.
00100     //- This method returns the bounding box of a Loop
00101     //- as the union of the bounding boxes of its child
00102     //- RefEdges.
00103 
00104     CubitStatus tangents( RefVertex* vertex_ptr, 
00105                             CubitVector& first_vector,
00106                           CubitVector& second_vector ) ;
00107         //R CubitStatus
00108         //I veretx_ptr
00109         //I- A pointer to a vertex in this loop.
00110         //O first_vector
00111         //O- For the first edge on the loop which contains the passed
00112         //O- vertex, this is (an approximation of) the tangent of that
00113         //O- edge at the location of the vertex, pointing outwards from
00114         //O- the vertex.
00115         //O second_vector
00116         //O- For the second edge on the loop which contains the passed
00117         //O- vertex, this is (an approximation of) the tangent of that
00118         //O- edge at the location of the vertex, pointing outwards from
00119         //O- the vertex.
00120         //- Get the tangent vectors of the loop at the location of the
00121         //- passed vertex, pointing outwards from the vertex.
00122         //- 
00123         //- NOTE:  Both returned vectors point outward from the vertex.
00124         //-        To have both tangents pointing in the direction of
00125         //-        the loop, reverse first_vector.
00126     
00127   CubitBoolean validate() ;
00128         //R CubitBoolean
00129         //R- CUBIT_TRUE if the Loop is topologically valid.
00130         //R- CUBIT_FALSE otherwise.
00131         //- Validate the Loop.
00132         //- Returns CubitFalse if:
00133         //-  * The Loop has no CoEdges.
00134         //-  * Any CoEdge has no child RefEdge.
00135         //-  * Any CoEdge has an undefined sense (sense is CUBIT_UNKNOWN).
00136         //-  * The Loop is not topologically closed.
00137         //-  * The sense of a CoEdge does not correspond to
00138         //-    the order of the vertices on its child RefEdge.
00139         //-  * The Loop has two child RefEdges which form a topological
00140         //-    figure-eight (there is only one child vertex of the Loop.)
00141 
00142   LoopSM* get_loop_sm_ptr() const;
00143   
00144     CubitBoolean about_spatially_equal( DLIList<CoEdge*>& other_loop_coedges,
00145                                         CubitSense relative_sense,
00146                                         double tolerance_factor = 1.0,
00147                                         CubitBoolean notify_refEntity 
00148                                            = CUBIT_FALSE );
00149                                         
00150 
00151    protected: 
00152 
00153    private:
00154     Loop( const Loop& );
00155     void operator=( const Loop&);
00156 } ;
00157 
00158 // ********** BEGIN INLINE FUNCTIONS       **********
00159 // ********** END INLINE FUNCTIONS         **********
00160 
00161 // ********** BEGIN FRIEND FUNCTIONS       **********
00162 // ********** END FRIEND FUNCTIONS         **********
00163 
00164 // ********** BEGIN EXTERN FUNCTIONS       **********
00165 // ********** END EXTERN FUNCTIONS         **********
00166 
00167 #endif
00168 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines