void DlgTwoEnd::Init() { int nID = 0; CString strID; IteratorPtr<int> IdItPtr(Jun::ms_PipeID.CreatIterator()); for(IdItPtr->Fist();!IdItPtr->IsDone();IdItPtr->Next()) { nID = IdItPtr->CurrentItem(); strID.Format(_T("%d"),abs(nID)); if(nID > 0) { m_strInPipeID = strID; } else { m_strOutPipeID = strID; } } m_strOutEle = Jun::ms_OutletEle.GetValue(); InitNum(m_strInEle,m_strUnit,Jun::ms_InletEle); if(0==m_strInEle.CompareNoCase(m_strOutEle)) { m_bSameEle = TRUE; } else { m_bSameEle = FALSE; } CheckSame(); UpdateData(FALSE); }
hobj_t *FindVertex( vec3d_t v, hobj_t *vertexcls ) { int hashkey; hashvec3d_t *hv; // hashkey = ((((int)(v[2]))+((int)(v[1]))+((int)(v[0]))) & ((HASHTAB_SIZE-1) << 3 )) >> 3; hashkey = (int)(((v[2]-p_min[2]) / (p_max[2]-p_min[2])) * (float)(HASHTAB_SIZE-1)); hv = hashtab[ hashkey ]; // search in list for ( ; hv ; hv=hv->next ) { if ( CheckSame( hv->v, v ) ) break; } if ( !hv ) { // vertex not found hv = NewHashvec(); hv->next = hashtab[hashkey]; hashtab[hashkey] = hv; Vec3dCopy( hv->v, v ); hv->self = BuildVertexClass( v ); InsertClass( vertexcls, hv->self ); } return hv->self; }
void CheckPoint( vec3d_t p ) { int i; fp_t *p1, *p2; for ( i = 0; i < jpnum; i++ ) { p1 = jpoly[i]; p2 = jpoly[(i+1 == jpnum) ? 0 : (i+1)]; if ( CheckSame( p1, p ) || CheckSame( p2, p ) ) return; if ( CheckCollinearEdge( p1, p2, p ) ) { InsertPointAt( (i+1 == jpnum) ? 0 : (i+1), p ); return; } } }
polygon_t * PolygonRemoveEqualPoints( polygon_t *in ) { polygon_t *p; int i; p = NewPolygon( in->pointnum ); for ( i = 0; i < in->pointnum; i++ ) { if ( CheckSame( in->p[i], in->p[(i+1)%in->pointnum] ) ) { continue; } Vec3dCopy( p->p[p->pointnum], in->p[i] ); p->pointnum++; } return p; }
void DlgTwoEnd::OnCheckSame() { // TODO: Add your control notification handler code here m_bSameEle = !m_bSameEle; CheckSame(); }