/* ======================================================================================================================= Map_RegionSelectedBrushes ======================================================================================================================= */ void Map_RegionSelectedBrushes(void) { Map_RegionOff(); if (selected_brushes.next == &selected_brushes) { // nothing selected Sys_Status("Tried to region with no selection...\n"); return; } region_active = true; Select_GetBounds(region_mins, region_maxs); // move the entire active_brushes list to filtered_brushes filtered_brushes.next = active_brushes.next; filtered_brushes.prev = active_brushes.prev; filtered_brushes.next->prev = &filtered_brushes; filtered_brushes.prev->next = &filtered_brushes; Patch_Deselect(); // move the entire selected_brushes list to active_brushes active_brushes.next = selected_brushes.next; active_brushes.prev = selected_brushes.prev; active_brushes.next->prev = &active_brushes; active_brushes.prev->next = &active_brushes; // clear selected_brushes selected_brushes.next = selected_brushes.prev = &selected_brushes; Sys_UpdateWindows(W_ALL); }
void Select_GetTrueMid( vec3_t mid ) { edVec3_c mins, maxs; Select_GetBounds( mins, maxs ); for ( int i = 0 ; i < 3 ; i++ ) mid[i] = ( mins[i] + ( ( maxs[i] - mins[i] ) / 2 ) ); }
void Select_GetMid (vec3_t mid) { vec3_t mins, maxs; int i; Select_GetBounds (mins, maxs); for (i=0 ; i<3 ; i++) mid[i] = g_qeglobals.d_gridsize*floor ( ( (mins[i] + maxs[i])*0.5 )/g_qeglobals.d_gridsize ); }
/* ============ Select_Brush ============ */ void Select_Brush( brush_s* brush, bool bComplete, bool bStatus ) { brush_s* b; entity_s* e; g_ptrSelectedFaces.RemoveAll(); g_ptrSelectedFaceBrushes.RemoveAll(); //selected_face = NULL; if ( g_qeglobals.d_select_count < 2 ) g_qeglobals.d_select_order[g_qeglobals.d_select_count] = brush; g_qeglobals.d_select_count++; //if (brush->patchBrush) // Patch_Select(brush->nPatchID); e = brush->owner; if ( e ) { // select complete entity on first click if ( e != world_entity && bComplete == true ) { for ( b = selected_brushes.next ; b != &selected_brushes ; b = b->next ) if ( b->owner == e ) goto singleselect; for ( b = e->brushes.onext ; b != &e->brushes ; b = b->onext ) { Brush_RemoveFromList( b ); Brush_AddToList( b, &selected_brushes ); } } else { singleselect: Brush_RemoveFromList( brush ); Brush_AddToList( brush, &selected_brushes ); UpdateSurfaceDialog(); UpdatePatchInspector(); } if ( e->eclass ) { UpdateEntitySel( brush->owner->eclass ); } } if ( bStatus ) { edVec3_c vMin, vMax, vSize; Select_GetBounds( vMin, vMax ); vSize = vMax - vMin; CString strStatus; strStatus.Format( "Selection X:: %.1f Y:: %.1f Z:: %.1f", vSize[0], vSize[1], vSize[2] ); g_pParentWnd->SetStatusText( 2, strStatus ); } }
/* ======================== Map_RegionSelectedBrushes ======================== */ void Map_RegionSelectedBrushes( void ){ Map_RegionOff(); if ( selected_brushes.next == &selected_brushes ) { // nothing selected Sys_Printf( "Tried to region with no selection...\n" ); return; } region_active = true; Select_GetBounds( region_mins, region_maxs ); #ifdef _DEBUG if ( filtered_brushes.next != &filtered_brushes ) { Sys_FPrintf( SYS_WRN, "WARNING: filtered_brushes list may not be empty in Map_RegionSelectedBrushes\n" ); } #endif if ( active_brushes.next == &active_brushes ) { // just have an empty filtered_brushes list // this happens if you set region after selecting all the brushes in your map (some weird people do that, ask MrE!) filtered_brushes.next = filtered_brushes.prev = &filtered_brushes; } else { // move the entire active_brushes list to filtered_brushes filtered_brushes.next = active_brushes.next; filtered_brushes.prev = active_brushes.prev; filtered_brushes.next->prev = &filtered_brushes; filtered_brushes.prev->next = &filtered_brushes; } // move the entire selected_brushes list to active_brushes active_brushes.next = selected_brushes.next; active_brushes.prev = selected_brushes.prev; active_brushes.next->prev = &active_brushes; active_brushes.prev->next = &active_brushes; // deselect patches for ( brush_t *b = active_brushes.next; b != &active_brushes; b = b->next ) if ( b->patchBrush ) { b->pPatch->bSelected = false; } // clear selected_brushes selected_brushes.next = selected_brushes.prev = &selected_brushes; Sys_UpdateWindows( W_ALL ); }
void Select_GetMid( vec3_t mid ) { edVec3_c mins, maxs; int i; if ( g_PrefsDlg.m_bNoClamp ) { Select_GetTrueMid( mid ); return; } Select_GetBounds( mins, maxs ); for ( i = 0 ; i < 3 ; i++ ) mid[i] = g_qeglobals.d_gridsize * floor( ( ( mins[i] + maxs[i] ) * 0.5 ) / g_qeglobals.d_gridsize ); }
/* ============ Select_Move ============ */ void Select_Move( vec3_t delta, bool bSnap ) { brush_s* b; // actually move the selected brushes for ( b = selected_brushes.next ; b != &selected_brushes ; b = b->next ) Brush_Move( b, delta, bSnap ); edVec3_c vMin, vMax; Select_GetBounds( vMin, vMax ); CString strStatus; strStatus.Format( "Origin X:: %.1f Y:: %.1f Z:: %.1f", vMin[0], vMax[1], vMax[2] ); g_pParentWnd->SetStatusText( 2, strStatus ); // Sys_UpdateWindows (W_ALL); }
void CPlugInManager::Dispatch(int n, const char * p) { for (int i = 0; i < m_PlugIns.GetSize(); i++) { CPlugIn *plug = reinterpret_cast<CPlugIn*>(m_PlugIns.GetAt(i)); if (plug->ownsCommandID(n)) { vec3_t vMin, vMax; if (selected_brushes.next == &selected_brushes) { vMin[0] = vMin[1] = vMin[2] = 0; VectorCopy(vMin, vMax); } else { Select_GetBounds (vMin, vMax); } plug->dispatchCommand(p, vMin, vMax, QE_SingleBrush(true)); // PGM -- added quiet break; } } }
void CPluginSlot::Dispatch(const char *p) { Vector3 vMin, vMax; Select_GetBounds (vMin, vMax); mpTable->m_pfnQERPlug_Dispatch(p, reinterpret_cast<float*>(&vMin), reinterpret_cast<float*>(&vMax), true);//QE_SingleBrush(true)); }