cgma
|
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 : Chain.C 00010 // 00011 // Purpose : 00012 // 00013 // Special Notes : 00014 // 00015 // Creator : Xuechen Liu 00016 // 00017 // Creation Date : 08/02/96 00018 // 00019 // Owner : Malcolm J. Panthaki 00020 //------------------------------------------------------------------------- 00021 00022 // ********** BEGIN STANDARD INCLUDES ********** 00023 // ********** END STANDARD INCLUDES ********** 00024 00025 // ********** BEGIN MOTIF INCLUDES ********** 00026 // ********** END MOTIF INCLUDES ********** 00027 00028 // ********** BEGIN OPEN INVENTOR INCLUDES ********** 00029 // ********** END OPEN INVENTOR INCLUDES ********** 00030 00031 // ********** BEGIN CUBIT INCLUDES ********** 00032 00033 #include "Chain.hpp" 00034 00035 #include "SenseEntity.hpp" 00036 #include "CoVertex.hpp" 00037 00038 #include "BasicTopologyEntity.hpp" 00039 00040 #include "DLIList.hpp" 00041 00042 #include "CastTo.hpp" 00043 00044 #include "RefEdge.hpp" 00045 #include "RefVertex.hpp" 00046 00047 // ********** END CUBIT INCLUDES ********** 00048 00049 // ********** BEGIN STATIC DECLARATIONS ********** 00050 // ********** END STATIC DECLARATIONS ********** 00051 00052 // ********** BEGIN PUBLIC FUNCTIONS ********** 00053 00054 //------------------------------------------------------------------------- 00055 // Purpose : Constructor. 00056 // 00057 // Special Notes : 00058 // 00059 // Creator : Xuechen Liu 00060 // 00061 // Creation Date : 08/02/96 00062 //------------------------------------------------------------------------- 00063 Chain::Chain() 00064 { 00065 } 00066 00067 //------------------------------------------------------------------------- 00068 // Purpose : The destructor 00069 // 00070 // Special Notes : 00071 // 00072 // Creator : Raikanta Sahu 00073 // 00074 // Creation Date : 10/22/96 00075 //------------------------------------------------------------------------- 00076 Chain::~Chain() 00077 { 00078 } 00079 00080 //------------------------------------------------------------------------- 00081 // Purpose : These functions return the RefVertex associated with 00082 // the first/last CoVertex'es of this Chain. 00083 // 00084 // Special Notes : 00085 // 00086 // Creator : Jason Kraftcheck 00087 // 00088 // Creation Date : 07/22/03 00089 //------------------------------------------------------------------------- 00090 RefVertex* Chain::start_vertex() 00091 { 00092 // Get first CoVertex in chain 00093 SenseEntity* se_ptr = get_first_sense_entity_ptr(); 00094 if (!se_ptr) 00095 return 0; 00096 00097 // Get RefVertex from CoVertex 00098 BasicTopologyEntity* bte_ptr = se_ptr->get_basic_topology_entity_ptr(); 00099 return static_cast<RefVertex*>(bte_ptr); 00100 } 00101 00102 RefVertex* Chain::end_vertex() 00103 { 00104 // Get last CoVertex in chain 00105 SenseEntity* se_ptr = get_last_sense_entity_ptr(); 00106 if (!se_ptr) 00107 return 0; 00108 00109 // Get RefVertex from CoVertex 00110 BasicTopologyEntity* bte_ptr = se_ptr->get_basic_topology_entity_ptr(); 00111 return static_cast<RefVertex*>(bte_ptr); 00112 } 00113 00114 //------------------------------------------------------------------------- 00115 // Purpose : These functions return the 00116 // first/last CoVertex'es of this Chain. 00117 // 00118 // Special Notes : 00119 // 00120 // Creator : Jason Kraftcheck 00121 // 00122 // Creation Date : 07/22/03 00123 //------------------------------------------------------------------------- 00124 CoVertex* Chain::start_co_vertex() 00125 { 00126 // Get first CoVertex in chain 00127 SenseEntity* se_ptr = get_first_sense_entity_ptr(); 00128 return static_cast<CoVertex*>(se_ptr); 00129 } 00130 00131 CoVertex* Chain::end_co_vertex() 00132 { 00133 // Get last CoVertex in chain 00134 SenseEntity* se_ptr = get_last_sense_entity_ptr(); 00135 return static_cast<CoVertex*>(se_ptr); 00136 } 00137 00138 // ********** END PUBLIC FUNCTIONS ********** 00139 00140 // ********** BEGIN PROTECTED FUNCTIONS ********** 00141 00142 // ********** END PUBLIC FUNCTIONS ********** 00143 // ********** END PROTECTED FUNCTIONS ********** 00144 00145 // ********** BEGIN PRIVATE FUNCTIONS ********** 00146 // ********** END PRIVATE FUNCTIONS ********** 00147 00148 // ********** BEGIN HELPER CLASSES ********** 00149 // ********** END HELPER CLASSES ********** 00150 00151 // ********** BEGIN EXTERN FUNCTIONS ********** 00152 // ********** END EXTERN FUNCTIONS ********** 00153 00154 // ********** BEGIN STATIC FUNCTIONS ********** 00155 // ********** END STATIC FUNCTIONS ********** 00156