cgma
Shell.cpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Copyright Notice
00003 //
00004 // Copyright (c) 1996 
00005 // by Malcolm J. Panthaki, DBA, and the University of New Mexico.
00006 //-------------------------------------------------------------------------
00007 //
00008 //-------------------------------------------------------------------------
00009 // Filename      : Shell.C
00010 //
00011 // Purpose       : This file contains the implementation of the class
00012 //                  Shell. 
00013 //
00014 // Special Notes :
00015 //
00016 // Creator       : Xuechen Liu
00017 //
00018 // Creation Date : 08/02/96
00019 //
00020 // Owner         : Xuechen Liu
00021 //-------------------------------------------------------------------------
00022 
00023 // ********** BEGIN STANDARD INCLUDES      **********
00024 // ********** END STANDARD INCLUDES        **********
00025 
00026 // ********** BEGIN MOTIF INCLUDES         **********
00027 // ********** END MOTIF INCLUDES           **********
00028 
00029 // ********** BEGIN OPEN INVENTOR INCLUDES **********
00030 // ********** END OPEN INVENTOR INCLUDES   **********
00031 
00032 // ********** BEGIN CUBIT INCLUDES         **********
00033 #include "Shell.hpp"
00034 #include "CoFace.hpp"
00035 #include "CastTo.hpp"
00036 #include "DLIList.hpp"
00037 #include "RefFace.hpp"
00038 #include "CubitBox.hpp"
00039 #include "RefVolume.hpp"
00040 #include "ShellSM.hpp"
00041 // ********** END CUBIT INCLUDES           **********
00042 
00043 // ********** BEGIN STATIC DECLARATIONS    **********
00044 // ********** END STATIC DECLARATIONS      **********
00045 
00046 // ********** BEGIN PUBLIC FUNCTIONS       **********
00047 
00048 //-------------------------------------------------------------------------
00049 // Purpose       : Default constructor.
00050 //
00051 // Special Notes :
00052 //
00053 // Creator       : Xuechen Liu
00054 //
00055 // Creation Date : 08/06/96
00056 //-------------------------------------------------------------------------
00057 Shell::Shell()
00058 {
00059 }
00060 
00061 //-------------------------------------------------------------------------
00062 // Purpose       : A constructor woth a pointer to an other solid
00063 //                 model entity.
00064 //
00065 // Special Notes :
00066 //
00067 // Creator       : Xuechen Liu
00068 //
00069 // Creation Date : 08/06/96
00070 //-------------------------------------------------------------------------
00071 Shell::Shell(ShellSM* OSMEPtr)
00072 {
00073    bridge_manager()->add_bridge(OSMEPtr) ;
00074 }
00075 
00076 
00077 
00078 RefVolume* Shell::get_ref_volume_ptr()
00079 {
00080     return CAST_TO( get_basic_topology_entity_ptr(), RefVolume );
00081 }
00082 
00083 //-------------------------------------------------------------------------
00084 // Purpose       : Find the bounding box of the Shell
00085 //
00086 // Special Notes : 
00087 //
00088 // Creator       : Jason Kraftcheck
00089 //
00090 // Creation Date : 11/27/99
00091 //-------------------------------------------------------------------------
00092 CubitBox Shell::bounding_box()
00093 {
00094     CubitBox result;
00095     DLIList<RefFace*> face_list;
00096     ref_faces( face_list );
00097     if( face_list.size() > 0 )
00098         result = face_list.get_and_step()->bounding_box();
00099     for( int i = face_list.size(); i > 1; i-- )
00100         result |= face_list.get_and_step()->bounding_box();
00101     return result;
00102 }
00103 
00104 //-------------------------------------------------------------------------
00105 // Purpose       : Get ShellSM
00106 //
00107 // Special Notes : 
00108 //
00109 // Creator       : Jason Kraftcheck
00110 //
00111 // Creation Date : 07/23/03
00112 //-------------------------------------------------------------------------
00113 ShellSM* Shell::get_shell_sm_ptr() const
00114 {
00115   return dynamic_cast<ShellSM*>(bridge_manager()->topology_bridge());
00116 }
00117 
00118 //-------------------------------------------------------------------------
00119 // Purpose       : Check if shell is a sheet.
00120 //
00121 // Special Notes : 
00122 //
00123 // Creator       : Jason Kraftcheck
00124 //
00125 // Creation Date : 01/15/04
00126 //-------------------------------------------------------------------------
00127 CubitBoolean Shell::is_sheet()
00128 {
00129   DLIList<RefFace*> faces;
00130   ref_faces(faces);
00131   while (faces.size())
00132     if ( ! faces.pop()->is_nonmanifold(this) )
00133       return CUBIT_FALSE;
00134   return CUBIT_TRUE;
00135 }  
00136 
00137 // ********** END PUBLIC FUNCTIONS         **********
00138 
00139 // ********** BEGIN PROTECTED FUNCTIONS    **********
00140 // ********** END PROTECTED FUNCTIONS      **********
00141 
00142 // ********** BEGIN PRIVATE FUNCTIONS      **********
00143 // ********** END PRIVATE FUNCTIONS        **********
00144 
00145 // ********** BEGIN HELPER CLASSES         **********
00146 // ********** END HELPER CLASSES           **********
00147 
00148 // ********** BEGIN EXTERN FUNCTIONS       **********
00149 // ********** END EXTERN FUNCTIONS         **********
00150 
00151 // ********** BEGIN STATIC FUNCTIONS       **********
00152 // ********** END STATIC FUNCTIONS         **********
00153 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines