cgma
FacetCoEdge.cpp
Go to the documentation of this file.
00001 //-------------------------------------------------------------------------
00002 // Filename      : FacetCoEdge.cpp
00003 //
00004 // Purpose       : 
00005 //
00006 // Special Notes :
00007 //
00008 // Creator       : Steven J. Owen
00009 //
00010 // Creation Date : 07/18/00
00011 //
00012 // Owner         : Steven J. Owen
00013 //-------------------------------------------------------------------------
00014 
00015 // ********** BEGIN STANDARD INCLUDES      **********
00016 // ********** END STANDARD INCLUDES        **********
00017 
00018 // ********** BEGIN CUBIT INCLUDES         **********
00019 #include "CubitDefines.h"
00020 #include "CastTo.hpp"
00021 #include "FacetCoEdge.hpp"
00022 #include "FacetLoop.hpp"
00023 #include "FacetQueryEngine.hpp"
00024 #include "CubitUtil.hpp"
00025 
00026 #include "FacetBody.hpp"
00027 #include "FacetLump.hpp"
00028 #include "FacetShell.hpp"
00029 #include "FacetSurface.hpp"
00030 #include "FacetCurve.hpp"
00031 // ********** END CUBIT INCLUDES           **********
00032 
00033 // ********** BEGIN FORWARD DECLARATIONS   **********
00034 // ********** END FORWARD DECLARATIONS     **********
00035 
00036 // ********** BEGIN STATIC DECLARATIONS    **********
00037 // ********** END STATIC DECLARATIONS      **********
00038 
00039 // ********** BEGIN PUBLIC FUNCTIONS       **********
00040 
00041 //-------------------------------------------------------------------------
00042 // Purpose       : A constructor with a pointer to a Facet CoEdge.
00043 //
00044 // Special Notes :
00045 //
00046 // Creator       : Steve Owen
00047 //
00048 // Creation Date : 07/18/00
00049 //-------------------------------------------------------------------------
00050 FacetCoEdge::FacetCoEdge( Curve *curv_ptr, LoopSM *loop_ptr, CubitSense sense )
00051 {
00052   myCurve = curv_ptr;
00053   myLoop = loop_ptr;
00054   edgeSense = sense; 
00055 }
00056 
00057 //-------------------------------------------------------------------------
00058 // Purpose       : A constructor with a pointer to a Facet CoEdge.
00059 //
00060 // Special Notes : Constructor used for save/restore
00061 //
00062 // Creator       : Corey Ernst 
00063 //
00064 // Creation Date : 02/03/03
00065 //-------------------------------------------------------------------------
00066 FacetCoEdge::FacetCoEdge( Curve *curv_ptr, CubitSense sense )
00067 {
00068   myCurve = curv_ptr;
00069   myLoop = NULL; 
00070   edgeSense = sense; 
00071 }
00072 
00073 //-------------------------------------------------------------------------
00074 // Purpose       : The destructor
00075 //
00076 // Special Notes :
00077 //
00078 // Creator       : Steve Owen
00079 //
00080 // Creation Date : 07/18/00
00081 //-------------------------------------------------------------------------
00082 FacetCoEdge::~FacetCoEdge()
00083 {
00084 }
00085 
00086 //-------------------------------------------------------------------------
00087 // Purpose       : Get geometry modeling engine: FacetQueryEngine
00088 //
00089 // Special Notes :
00090 //
00091 // Creator       : Steve Owen
00092 //
00093 // Creation Date : 07/18/00
00094 //-------------------------------------------------------------------------
00095 GeometryQueryEngine* FacetCoEdge::get_geometry_query_engine() const
00096 {
00097   return FacetQueryEngine::instance();
00098 }  
00099 
00100 //-------------------------------------------------------------------------
00101 // Purpose       : The purpose of this function is to append a
00102 //                 attribute to the OSME. The name is attached to the 
00103 //                 underlying solid model entity this one points to.
00104 //
00105 //
00106 // Special Notes : 
00107 //
00108 // Creator       : Steve Owen
00109 //
00110 // Creation Date : 07/18/00
00111 //-------------------------------------------------------------------------
00112 void FacetCoEdge::append_simple_attribute_virt(const CubitSimpleAttrib& /*csattrib_ptr*/)
00113 {
00114   //PRINT_ERROR("FacetCoEdge::append_simple_attribute_virt not implemented\n");
00115   return;
00116 }
00117 
00118 
00119 //-------------------------------------------------------------------------
00120 // Purpose       : The purpose of this function is to remove a simple 
00121 //                 attribute attached to this geometry entity. The name is 
00122 //                 removed from the underlying BODY this points to.
00123 //
00124 // Special Notes : 
00125 //
00126 // Creator       : Steve Owen
00127 //
00128 // Creation Date : 07/18/00
00129 //-------------------------------------------------------------------------
00130 void FacetCoEdge::remove_simple_attribute_virt(const CubitSimpleAttrib& /*csattrib_ptr*/)
00131 {
00132   //PRINT_ERROR("FacetCoEdge::remove_simple_attribute_virt not implemented\n");
00133   return;
00134 }
00135 
00136 //-------------------------------------------------------------------------
00137 // Purpose       : The purpose of this function is to remove all simple 
00138 //                 attributes attached to this geometry entity.  Also
00139 //                 removes lingering GTC attributes.
00140 //
00141 //
00142 // Special Notes : 
00143 //
00144 // Creator       : Steve Owen
00145 //
00146 // Creation Date : 07/18/00
00147 //-------------------------------------------------------------------------
00148 void FacetCoEdge::remove_all_simple_attribute_virt()
00149 {
00150   //PRINT_ERROR("FacetCoEdge::remove_all_simple_attribute_virt not implemented\n");
00151   return;
00152 }
00153 
00154 //-------------------------------------------------------------------------
00155 // Purpose       : The purpose of this function is to get the  
00156 //                 attributes attached to this geometry entity. The name is 
00157 //                 attached to the underlying BODY this points to.
00158 //
00159 // Special Notes : 
00160 //
00161 // Creator       : Steve Owen
00162 //
00163 // Creation Date : 07/18/00
00164 //-------------------------------------------------------------------------
00165 CubitStatus FacetCoEdge::get_simple_attribute(DLIList<CubitSimpleAttrib>&
00166                                               /*cubit_simple_attrib_list*/)
00167 {
00168   //PRINT_ERROR("FacetCoEdge::get_simple_attribute not implemented\n");
00169   return CUBIT_FAILURE;
00170 }
00171 CubitStatus FacetCoEdge::get_simple_attribute(const CubitString&,
00172                                               DLIList<CubitSimpleAttrib>&)
00173   { return CUBIT_FAILURE; }
00174 
00175 
00176 CubitSense FacetCoEdge::sense()
00177 {
00178   return edgeSense;
00179 }
00180 /*
00181 void FacetCoEdge::bodysms(DLIList<BodySM*> &bodies)
00182 {
00183   myLoop->bodysms(bodies);
00184 }
00185 
00186 void FacetCoEdge::lumps(DLIList<Lump*> &lumps)
00187 {
00188   myLoop->lumps(lumps);
00189 }
00190 
00191 void FacetCoEdge::shellsms(DLIList<ShellSM*> &shellsms)
00192 {
00193   myLoop->shellsms(shellsms);
00194 }
00195 
00196 void FacetCoEdge::surfaces(DLIList<Surface*> &surfaces)
00197 {
00198   myLoop->surfaces( surfaces );
00199 }
00200 
00201 void FacetCoEdge::loopsms(DLIList<LoopSM*> &loopsms)
00202 {
00203   loopsms.append_unique( myLoop );
00204 }
00205 
00206 void FacetCoEdge::coedgesms(DLIList<CoEdgeSM*> &coedgesms)
00207 {
00208   coedgesms.append_unique( this );
00209 }
00210 
00211 void FacetCoEdge::curves(DLIList<Curve*> &curves)
00212 {
00213   curves.append_unique( myCurve );
00214 }
00215 
00216 void FacetCoEdge::points(DLIList<Point*> &points)
00217 {
00218   myCurve->points( points );
00219 }
00220 */
00221 
00222 void FacetCoEdge::get_parents_virt( DLIList<TopologyBridge*>& parents )
00223   { parents.append( myLoop ); }
00224 
00225 void FacetCoEdge::get_children_virt( DLIList<TopologyBridge*>& children )
00226   { children.append( myCurve ); }
00227 
00228 void FacetCoEdge::reverse_sense()
00229 {
00230   edgeSense = CubitUtil::opposite_sense( edgeSense );
00231 }
00232 
00233 
00234 void FacetCoEdge::get_lumps( DLIList<FacetLump*>& result_list )
00235 {
00236   DLIList<FacetShell*> shell_list;
00237   get_shells( shell_list );
00238   shell_list.reset();
00239   for ( int i = shell_list.size(); i--; )
00240   {
00241     FacetShell* shell = shell_list.get_and_step();
00242     shell->get_lumps( result_list );
00243     FacetLump* lump = dynamic_cast<FacetLump*>(shell->get_lump());
00244     if (lump)
00245       result_list.append_unique(lump);
00246   }
00247 }
00248 
00249 void FacetCoEdge::get_shells( DLIList<FacetShell*>& result_list )
00250 {
00251   if ( FacetLoop* loop = dynamic_cast<FacetLoop*>(myLoop) )
00252     if ( FacetSurface* surf = dynamic_cast<FacetSurface*>(loop->get_surface()) )
00253       surf->get_shells( result_list );
00254 }
00255 
00256 void FacetCoEdge::get_curves( DLIList<FacetCurve*>& result_list )
00257 {
00258   if (FacetCurve* curve = dynamic_cast<FacetCurve*>(myCurve))
00259     result_list.append(curve);
00260 }
00261 
00262 
00263 // ********** END PUBLIC FUNCTIONS         **********
00264 
00265 // ********** BEGIN PROTECTED FUNCTIONS    **********
00266 // ********** END PROTECTED FUNCTIONS      **********
00267 
00268 // ********** BEGIN PRIVATE FUNCTIONS      **********
00269 // ********** END PRIVATE FUNCTIONS        **********
00270 
00271 // ********** BEGIN HELPER CLASSES         **********
00272 // ********** END HELPER CLASSES           **********
00273 
00274 // ********** BEGIN EXTERN FUNCTIONS       **********
00275 // ********** END EXTERN FUNCTIONS         **********
00276 
00277 // ********** BEGIN STATIC FUNCTIONS       **********
00278 // ********** END STATIC FUNCTIONS         **********
00279 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines