void Triangulation<2>::calculateSkeleton() { TriangulationBase<2>::calculateSkeleton(); // Get rid of the empty triangulation now, so that all the helper routines // can happily assume at least one triangle. if (simplices_.empty()) return; calculateBoundary(); // Sets: // - boundaryComponents_ // - Dim2Component::boundaryComponents_ // - Dim2 [ Edge, Vertex ]::boundaryComponent_ // - all Dim2BoundaryComponent members // Flesh out the details of each component. for (auto v : vertices()) v->component()->vertices_.push_back(v); for (auto e : edges()) e->component()->edges_.push_back(e); }
PITEM_VECTOR* getNearbyItems( UI32 x, UI32 y, UI32 range, UI32 flags, P_ITEM pSelf ) { PITEM_VECTOR* pvItemsInRange = 0; if( x > 0 && x < 6145 && y > 0 && y < 4097 ) { pvItemsInRange = new PITEM_VECTOR(); calculateBoundary( x, y, range ); PITEMLOCATIONMAPIT it( pItemLocationMap.lower_bound( locationToKey( upperLeft.x, upperLeft.y ) ) ), end( pItemLocationMap.upper_bound( locationToKey( lowerRight.x, lowerRight.y) )); P_ITEM pi = 0; for( ; it != end; ++it ) { pi = it->second; if( flags ) { if( pSelf ) { if( (flags & EXCLUDESELF) && pSelf->getSerial32() == pi->getSerial32() ) { continue; } } pvItemsInRange->push_back( pi ); } else { pvItemsInRange->push_back( pi ); } } } return pvItemsInRange; }
PCHAR_VECTOR* getNearbyChars( UI32 x, UI32 y, UI32 range, UI32 flags, P_CHAR pSelf ) { PCHAR_VECTOR* pvCharsInRange = 0; if( x > 0 && x < 6145 && y > 0 && y < 4097 ) { pvCharsInRange = new PCHAR_VECTOR(); calculateBoundary( x, y, range ); PCHARLOCATIONMAPIT it( pCharLocationMap.lower_bound( locationToKey( upperLeft.x, upperLeft.y ) ) ), end( pCharLocationMap.upper_bound( locationToKey( lowerRight.x, lowerRight.y) ) ); P_CHAR pc = 0; for( ; it != end; ++it ) { pc = it->second; if( flags ) { if( pSelf ) { if( (flags & EXCLUDESELF) && pSelf->getSerial32() == pc->getSerial32() ) { continue; } if ( (flags & COMBATTARGET) && pSelf->getSerial32() == pc->targserial ) { pvCharsInRange->push_back( pc ); continue; } } if ( pc->npc ) { if ( (flags & NPC) ) { pvCharsInRange->push_back( pc ); continue; } continue; } if ( (flags & ONLINE) && pc->IsOnline() ) { pvCharsInRange->push_back( pc ); continue; } if ( (flags & OFFLINE) && !pc->IsOnline() ) { pvCharsInRange->push_back( pc ); continue; } if ( (flags & DEAD) && pc->dead ) { pvCharsInRange->push_back( pc ); continue; } } else { pvCharsInRange->push_back( pc ); } } } return pvCharsInRange; }