Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

SELECT.H File Reference

Go to the source code of this file.

Data Structures

struct  trace_t

Defines

#define SF_CYCLE   0x20
#define SF_CYCLEKEEP   0x40
#define SF_ENTITIES_FIRST   0x02
#define SF_IGNORECURVES   0x08
#define SF_IGNOREGROUPS   0x10
#define SF_SELECTED_ONLY   0x01
#define SF_SINGLEFACE   0x04

Enumerations

enum  select_t {
  sel_brush, sel_vertex, sel_edge, sel_singlevertex,
  sel_curvepoint, sel_area, sel_terrainpoint, sel_terraintexture,
  sel_addpoint, sel_editpoint
}

Functions

void AbsoluteToLocal (plane_t normal2, face_t *f, vec3_t &p1, vec3_t &p2, vec3_t &p3)
void clearSelection ()
void ComputeAbsolute (face_t *f, vec3_t &p1, vec3_t &p2, vec3_t &p3)
void Select_AddToGroup (const char *pName)
void Select_AllOfType ()
void Select_Brush (brush_t *b, bool bComplete=true, bool bStatus=true)
void Select_Clone (void)
void Select_CompleteTall (void)
void Select_Delete (void)
void Select_Deselect (bool bDeselectFaces=true)
void Select_FitTexture (int nHeight=1, int nWidth=1)
void Select_FlipAxis (int axis)
void Select_GetBounds (vec3_t mins, vec3_t maxs)
void Select_Hide ()
void Select_Inside (void)
void Select_Invert (void)
void Select_MakeDetail (void)
void Select_MakeStructural (void)
void Select_Move (vec3_t delta, bool bSnap=true)
void Select_Name (const char *pName)
void Select_PartialTall (void)
void Select_Ray (vec3_t origin, vec3_t dir, int flags)
void Select_Reselect ()
void Select_RotateAxis (int axis, float deg, bool bPaint=true, bool bMouse=false)
void WINAPI Select_SetTexture (texdef_t *texdef, brushprimit_texdef_t *brushprimit_texdef, bool bFitScale=false, void *pPlugTexdef=NULL)
void Select_ShowAllHidden ()
void Select_Touching (void)
trace_t Test_Ray (vec3_t origin, vec3_t dir, int flags)


Define Documentation

#define SF_CYCLE   0x20
 

Definition at line 55 of file SELECT.H.

Referenced by Drag_Begin().

#define SF_CYCLEKEEP   0x40
 

Definition at line 56 of file SELECT.H.

#define SF_ENTITIES_FIRST   0x02
 

Definition at line 51 of file SELECT.H.

Referenced by Drag_Begin(), and Test_Ray().

#define SF_IGNORECURVES   0x08
 

Definition at line 53 of file SELECT.H.

#define SF_IGNOREGROUPS   0x10
 

Definition at line 54 of file SELECT.H.

#define SF_SELECTED_ONLY   0x01
 

Definition at line 50 of file SELECT.H.

#define SF_SINGLEFACE   0x04
 

Definition at line 52 of file SELECT.H.

Referenced by Drag_Begin().


Enumeration Type Documentation

enum select_t
 

Enumeration values:
sel_brush 
sel_vertex 
sel_edge 
sel_singlevertex 
sel_curvepoint 
sel_area 
sel_terrainpoint 
sel_terraintexture 
sel_addpoint 
sel_editpoint 

Definition at line 23 of file SELECT.H.

00024 {
00025     sel_brush,
00026     // sel_sticky_brush,
00027     // sel_face,
00028     sel_vertex,
00029     sel_edge,
00030     sel_singlevertex,
00031     sel_curvepoint,
00032     sel_area,
00033     sel_terrainpoint,
00034     sel_terraintexture,
00035     sel_addpoint,           // for dropping points
00036     sel_editpoint           // for editing points
00037 
00038 } select_t;


Function Documentation

void AbsoluteToLocal plane_t  normal2,
face_t f,
vec3_t p1,
vec3_t p2,
vec3_t p3
 

Definition at line 781 of file SELECT.CPP.

References atan2(), Back(), Clamp(), CrossProduct(), face_s::d_texture, DotProduct, f, face_t, g_qeglobals, qtexture_s::height, QEGlobals_t::m_bBrushPrimitMode, p2, texdef_t::rotate, texdef_t::scale, texdef_t::shift, Sys_Printf(), face_s::texdef, TextureAxisFromPlane(), vec3_t, VectorAdd, VectorCopy, VectorRotate(), VectorScale, VectorSubtract, qtexture_s::width, x, and y.

Referenced by RotateFaceTexture(), and SetFaceTexdef().

00782 {
00783     vec3_t ex,ey,ez;
00784 
00785 #ifdef _DEBUG
00786     if (g_qeglobals.m_bBrushPrimitMode)
00787         Sys_Printf("Warning : illegal call of AbsoluteToLocal in brush primitive mode\n");
00788 #endif
00789 
00790     // computing new local axis base
00791   TextureAxisFromPlane(&normal2, ex, ey);
00792   CrossProduct(ex, ey, ez);
00793 
00794   // projecting back on (ex,ey)
00795     Back(ez,p1);
00796     Back(ez,p2);
00797     Back(ez,p3);
00798 
00799     vec3_t aux;
00800     // rotation
00801   VectorCopy(p2, aux);
00802   VectorSubtract(aux, p1,aux);
00803     
00804     float x = DotProduct(aux,ex);
00805     float y = DotProduct(aux,ey);
00806   f->texdef.rotate = 180 * atan2(y,x) / Q_PI;
00807 
00808     vec3_t rex,rey;
00809     // computing rotated local axis base
00810   VectorCopy(ez, aux);
00811   VectorScale(aux, f->texdef.rotate, aux);
00812   VectorCopy(ex, rex);
00813   VectorRotate(rex, aux, rex);
00814   VectorCopy(ey, rey);
00815   VectorRotate(rey, aux, rey);
00816 
00817     // scale
00818   VectorCopy(p2, aux);
00819   VectorSubtract(aux, p1, aux);
00820   f->texdef.scale[0] = DotProduct(aux, rex);
00821   VectorCopy(p3, aux);
00822   VectorSubtract(aux, p1, aux);
00823   f->texdef.scale[1] = DotProduct(aux, rey);
00824 
00825     // shift
00826     // only using p1
00827     x = DotProduct(rex,p1);
00828     y = DotProduct(rey,p1);                 
00829     x /= f->texdef.scale[0];
00830     y /= f->texdef.scale[1];
00831 
00832   VectorCopy(rex, p1);
00833   VectorScale(p1, x, p1);
00834   VectorCopy(rey, aux);
00835   VectorScale(aux, y, aux);
00836   VectorAdd(p1, aux, p1);
00837   VectorCopy(ez, aux);
00838   VectorScale(aux, -f->texdef.rotate, aux);
00839   VectorRotate(p1, aux, p1);
00840     f->texdef.shift[0] = -DotProduct(p1, ex);
00841     f->texdef.shift[1] = -DotProduct(p1, ey);
00842 
00843     // stored rot is good considering local axis base
00844     // change it if necessary
00845     f->texdef.rotate = -f->texdef.rotate;
00846 
00847   Clamp(f->texdef.shift[0], f->d_texture->width);
00848   Clamp(f->texdef.shift[1], f->d_texture->height);
00849   Clamp(f->texdef.rotate, 360);
00850 
00851 }

Here is the call graph for this function:

void clearSelection  ) 
 

Definition at line 34 of file SELECT.CPP.

References QEGlobals_t::d_select_mode, g_qeglobals, and QEGlobals_t::selectObject.

Referenced by Drag_Setup(), CDlgCamera::OnOK(), CMainFrame::OnRaiseLowerTerrain(), CMainFrame::OnSelectionDragedges(), CMainFrame::OnSelectionDragvertecies(), Patch_Deselect(), Select_Clone(), Select_CompleteTall(), Select_Delete(), Select_Deselect(), Select_Inside(), Select_PartialTall(), Select_Ray(), and Select_Touching().

00034                       {
00035     g_qeglobals.d_select_mode = sel_brush;
00036     g_qeglobals.selectObject = NULL;
00037 }

void ComputeAbsolute face_t f,
vec3_t p1,
vec3_t p2,
vec3_t p3
 

Definition at line 732 of file SELECT.CPP.

References ComputeScale(), CrossProduct(), plane_t::dist, f, face_t, g_qeglobals, QEGlobals_t::m_bBrushPrimitMode, plane_t::normal, p2, face_s::plane, ProjectOnPlane(), texdef_t::rotate, texdef_t::shift, Sys_Printf(), face_s::texdef, TextureAxisFromPlane(), vec3_t, VectorAdd, VectorCopy, VectorRotate(), and VectorScale.

Referenced by RotateFaceTexture(), and SetFaceTexdef().

00733 {
00734     vec3_t ex,ey,ez;            // local axis base
00735 
00736 #ifdef _DEBUG
00737     if (g_qeglobals.m_bBrushPrimitMode)
00738         Sys_Printf("Warning : illegal call of ComputeAbsolute in brush primitive mode\n");
00739 #endif
00740 
00741   // compute first local axis base
00742   TextureAxisFromPlane(&f->plane, ex, ey);
00743   CrossProduct(ex, ey, ez);
00744         
00745     vec3_t aux;
00746   VectorCopy(ex, aux);
00747   VectorScale(aux, -f->texdef.shift[0], aux);
00748   VectorCopy(aux, p1);
00749   VectorCopy(ey, aux);
00750   VectorScale(aux, -f->texdef.shift[1], aux);
00751   VectorAdd(p1, aux, p1);
00752   VectorCopy(p1, p2);
00753   VectorAdd(p2, ex, p2);
00754   VectorCopy(p1, p3);
00755   VectorAdd(p3, ey, p3);
00756   VectorCopy(ez, aux);
00757   VectorScale(aux, -f->texdef.rotate, aux);
00758   VectorRotate(p1, aux, p1);
00759   VectorRotate(p2, aux, p2);
00760   VectorRotate(p3, aux, p3);
00761     // computing rotated local axis base
00762     vec3_t rex,rey;
00763   VectorCopy(ex, rex);
00764   VectorRotate(rex, aux, rex);
00765   VectorCopy(ey, rey);
00766   VectorRotate(rey, aux, rey);
00767 
00768   ComputeScale(rex,rey,p1,f);
00769     ComputeScale(rex,rey,p2,f);
00770     ComputeScale(rex,rey,p3,f);
00771 
00772     // project on normal plane
00773     // along ez 
00774     // assumes plane normal is normalized
00775     ProjectOnPlane(f->plane.normal,f->plane.dist,ez,p1);
00776     ProjectOnPlane(f->plane.normal,f->plane.dist,ez,p2);
00777     ProjectOnPlane(f->plane.normal,f->plane.dist,ez,p3);
00778 };

Here is the call graph for this function:

void Select_AddToGroup const char *  pName  ) 
 

Definition at line 1790 of file SELECT.CPP.

References b, Brush_SetEpair(), brush_t, g_qeglobals, Group_AddToProperGroup(), QEGlobals_t::m_bBrushPrimitMode, brush_s::next, and selected_brushes.

Referenced by CGroupDlg::OnBtnAdd(), CMainFrame::OnDropGroupAddtoWorld(), and CMainFrame::OnDropGroupRemove().

01791 {
01792     if (g_qeglobals.m_bBrushPrimitMode)
01793   {
01794       for (brush_t* b=selected_brushes.next ; b && b != &selected_brushes ; b=b->next)
01795       {
01796       Brush_SetEpair(b, "group", pName);
01797             Group_AddToProperGroup(b);
01798       }
01799   }
01800 }

Here is the call graph for this function:

void Select_AllOfType  ) 
 

Definition at line 1551 of file SELECT.CPP.

References active_brushes, b, Brush_AddToList(), brush_s::brush_faces, Brush_RemoveFromList(), brush_t, patchMesh_t::d_texture, QEGlobals_t::d_texturewin, e, face_t, FilterBrush(), g_ptrSelectedFaces, g_qeglobals, GetSelectAllCriteria(), qtexture_s::name, texdef_t::name, face_s::next, next, brush_s::next, brush_s::owner, brush_s::patchBrush, brush_s::pPatch, Select_Deselect(), selected_brushes, Sys_Printf(), Sys_UpdateWindows(), face_s::texdef, texturewin_t::texdef, ValueForKey(), and W_ALL.

Referenced by CMainFrame::OnSelectAll().

01552 {
01553     brush_t *b, *next;
01554     entity_t    *e;
01555     if ( (selected_brushes.next == &selected_brushes)
01556         || (selected_brushes.next->next != &selected_brushes) )
01557     {
01558 
01559     CString strName;
01560     if (g_ptrSelectedFaces.GetSize() == 0)
01561     {
01562       strName = g_qeglobals.d_texturewin.texdef.name;
01563     }
01564     else
01565     {
01566       face_t *selFace = reinterpret_cast<face_t*>(g_ptrSelectedFaces.GetAt(0));
01567       strName = selFace->texdef.name;
01568     }
01569 
01570     Select_Deselect();
01571       for (b=active_brushes.next ; b != &active_brushes ; b=next)
01572     {
01573           next = b->next;
01574         
01575       if (FilterBrush (b))
01576             continue;
01577 
01578       if (b->patchBrush)
01579       {
01580         if (strcmpi(strName, b->pPatch->d_texture->name) == 0)
01581         {
01582                 Brush_RemoveFromList (b);
01583                 Brush_AddToList (b, &selected_brushes);
01584         }
01585       }
01586       else
01587       {
01588         for (face_t* pFace = b->brush_faces; pFace; pFace = pFace->next)
01589         {
01590           if (strcmpi(strName, pFace->texdef.name) == 0)
01591           {
01592                   Brush_RemoveFromList (b);
01593                   Brush_AddToList (b, &selected_brushes);
01594           }
01595         }
01596       }
01597     }
01598     Sys_UpdateWindows(W_ALL);
01599     return;
01600   }
01601 
01602   
01603   b = selected_brushes.next;
01604     e = b->owner;
01605 
01606   if (e != NULL)
01607   {
01608     if (e != world_entity)
01609     {
01610       CString strName = e->eclass->name;
01611       CString strKey, strVal;
01612       bool bCriteria = GetSelectAllCriteria(strKey, strVal);
01613       Sys_Printf("Selecting all %s(s)\n", strName);
01614       Select_Deselect();
01615 
01616         for (b=active_brushes.next ; b != &active_brushes ; b=next)
01617         {
01618             next = b->next;
01619             
01620         if (FilterBrush (b))
01621                 continue;
01622 
01623         e = b->owner;
01624         if (e != NULL)
01625         {
01626           if (strcmpi(e->eclass->name, strName) == 0)
01627           {
01628             bool doIt = true;
01629             if (bCriteria) {
01630               CString str = ValueForKey (e, strKey);
01631               if (str.CompareNoCase(strVal) != 0) {
01632                 doIt = false;
01633               }
01634             }
01635             if (doIt) {
01636                 Brush_RemoveFromList (b);
01637                 Brush_AddToList (b, &selected_brushes);
01638             }
01639           }
01640         }
01641       }
01642     }
01643   }
01644     Sys_UpdateWindows (W_ALL);
01645 
01646 }

Here is the call graph for this function:

void Select_Brush brush_t b,
bool  bComplete = true,
bool  bStatus = true
 

Definition at line 215 of file SELECT.CPP.

References b, Brush_AddToList(), Brush_RemoveFromList(), brush_t, entity_t::brushes, QEGlobals_t::d_select_count, QEGlobals_t::d_select_order, e, entity_s::eclass, g_pParentWnd, g_ptrSelectedFaceBrushes, g_ptrSelectedFaces, g_qeglobals, brush_s::next, brush_s::onext, brush_s::owner, Select_GetBounds(), selected_brushes, CMainFrame::SetStatusText(), UpdateEntitySel(), UpdatePatchInspector(), UpdateSurfaceDialog(), vec3_t, VectorSubtract, and world_entity.

Referenced by CPlugInManager::CommitBrushHandleToMap(), CPlugInManager::CommitPatchHandleToMap(), ConnectEntities(), CopyAndSelect(), CreateEntity(), CreateEntityFromName(), CreateSmartEntity(), END_MESSAGE_MAP(), FinishSmartCreation(), GenerateEndCaps(), Map_ImportBuffer(), CMainFrame::OnCreate(), CMainFrame::OnPatchTab(), Patch_BrushToMesh(), Patch_CapCurrent(), Patch_GenericMesh(), Patch_Thicken(), QERApp_CreateBrush(), QERApp_SelectBrush(), Select_Ray(), Select_Reselect(), Terrain_BrushToMesh(), Undo_Redo(), and Undo_Undo().

00216 {
00217     brush_t *b;
00218     entity_t    *e;
00219 
00220   g_ptrSelectedFaces.RemoveAll();
00221   g_ptrSelectedFaceBrushes.RemoveAll();
00222     //selected_face = NULL;
00223     if (g_qeglobals.d_select_count < 2)
00224         g_qeglobals.d_select_order[g_qeglobals.d_select_count] = brush;
00225     g_qeglobals.d_select_count++;
00226 
00227   //if (brush->patchBrush)
00228   //  Patch_Select(brush->nPatchID);
00229 
00230     e = brush->owner;
00231     if (e)
00232     {
00233         // select complete entity on first click
00234         if (e != world_entity && bComplete == true)
00235         {
00236             for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
00237                 if (b->owner == e)
00238                     goto singleselect;
00239             for (b=e->brushes.onext ; b != &e->brushes ; b=b->onext)
00240             {
00241         Brush_RemoveFromList (b);
00242                 Brush_AddToList (b, &selected_brushes);
00243             }
00244         }
00245         else
00246         {
00247 singleselect:
00248             Brush_RemoveFromList (brush);
00249             Brush_AddToList (brush, &selected_brushes);
00250       UpdateSurfaceDialog();
00251       UpdatePatchInspector();
00252         }
00253 
00254         if (e->eclass)
00255         {
00256             UpdateEntitySel(brush->owner->eclass);
00257         }
00258     }
00259   if (bStatus)
00260   {
00261     vec3_t vMin, vMax, vSize;
00262       Select_GetBounds (vMin, vMax);
00263     VectorSubtract(vMax, vMin, vSize);
00264     CString strStatus;
00265     strStatus.Format("Selection X:: %.1f  Y:: %.1f  Z:: %.1f", vSize[0], vSize[1], vSize[2]);
00266     g_pParentWnd->SetStatusText(2, strStatus);
00267   }
00268 }

Here is the call graph for this function:

void Select_Clone void   ) 
 

Definition at line 450 of file SELECT.CPP.

References active_brushes, CMainFrame::ActiveXY(), b, Brush_AddToList(), Brush_Build(), Brush_Clone(), Brush_Move(), Brush_RemoveFromList(), brush_t, clearSelection(), CXYWnd::Copy(), QEGlobals_t::d_gridsize, QEGlobals_t::d_workcount, DeleteKey(), e, entity_s::eclass, Entity_Clone(), Entity_LinkBrush(), eclass_s::fixedsize, g_bScreenUpdates, g_pParentWnd, g_qeglobals, n, next, brush_s::next, CMainFrame::NudgeSelection(), brush_s::owner, CXYWnd::Paste(), selected_brushes, Sys_UpdateWindows(), vec3_t, W_ALL, and world_entity.

Referenced by CMainFrame::OnSelectionClone().

00451 {
00452 #if 1
00453   ASSERT(g_pParentWnd->ActiveXY());
00454   g_bScreenUpdates = false;  
00455   g_pParentWnd->ActiveXY()->Copy();
00456   g_pParentWnd->ActiveXY()->Paste();
00457   g_pParentWnd->NudgeSelection(2, g_qeglobals.d_gridsize);
00458   g_pParentWnd->NudgeSelection(3, g_qeglobals.d_gridsize);
00459   g_bScreenUpdates = true;  
00460   Sys_UpdateWindows(W_ALL);
00461 #else
00462 
00463     brush_t     *b, *b2, *n, *next, *next2;
00464     vec3_t      delta;
00465     entity_t    *e;
00466 
00467     g_qeglobals.d_workcount++;
00468     clearSelection();
00469 
00470     delta[0] = g_qeglobals.d_gridsize;
00471     delta[1] = g_qeglobals.d_gridsize;
00472     delta[2] = 0;
00473 
00474     for (b=selected_brushes.next ; b != &selected_brushes ; b=next)
00475     {
00476         next = b->next;
00477         // if the brush is a world brush, handle simply
00478         if (b->owner == world_entity)
00479         {
00480             n = Brush_Clone (b);
00481             Brush_AddToList (n, &active_brushes);
00482             Entity_LinkBrush (world_entity, n);
00483             Brush_Build( n );
00484             Brush_Move (b, delta);
00485             continue;
00486         }
00487 
00488         e = Entity_Clone (b->owner);
00489         // clear the target / targetname
00490         DeleteKey (e, "target");
00491         DeleteKey (e, "targetname");
00492 
00493         // if the brush is a fixed size entity, create a new entity
00494         if (b->owner->eclass->fixedsize)
00495         {
00496             n = Brush_Clone (b);
00497             Brush_AddToList (n, &active_brushes);
00498             Entity_LinkBrush (e, n);
00499             Brush_Build( n );
00500             Brush_Move (b, delta);
00501             continue;
00502         }
00503         
00504         // brush is a complex entity, grab all the other ones now
00505 
00506         next = &selected_brushes;
00507 
00508         for ( b2 = b ; b2 != &selected_brushes ; b2=next2)
00509         {
00510             next2 = b2->next;
00511             if (b2->owner != b->owner)
00512             {
00513                 if (next == &selected_brushes)
00514                     next = b2;
00515                 continue;
00516             }
00517 
00518             // move b2 to the start of selected_brushes,
00519             // so it won't be hit again
00520             Brush_RemoveFromList (b2);
00521             Brush_AddToList (b2, &selected_brushes);
00522             
00523             n = Brush_Clone (b2);
00524             Brush_AddToList (n, &active_brushes);
00525             Entity_LinkBrush (e, n);
00526             Brush_Build( n );
00527             Brush_Move (b2, delta, true);
00528         }
00529 
00530     }
00531     Sys_UpdateWindows (W_ALL);
00532 #endif
00533 }

Here is the call graph for this function:

void Select_CompleteTall void   ) 
 

Definition at line 1063 of file SELECT.CPP.

References active_brushes, CMainFrame::ActiveXY(), b, Brush_AddToList(), Brush_RemoveFromList(), brush_t, clearSelection(), FilterBrush(), g_pParentWnd, CXYWnd::GetViewType(), i, brush_s::maxs, brush_s::mins, next, brush_s::next, QE_SingleBrush(), Select_Delete(), selected_brushes, Sys_UpdateWindows(), vec3_t, VectorCopy, and W_ALL.

Referenced by CMainFrame::OnSelectionSelectcompletetall().

01064 {
01065     brush_t *b, *next;
01066     //int       i;
01067     vec3_t  mins, maxs;
01068 
01069     if (!QE_SingleBrush ())
01070         return;
01071 
01072     clearSelection();
01073 
01074     VectorCopy (selected_brushes.next->mins, mins);
01075     VectorCopy (selected_brushes.next->maxs, maxs);
01076     Select_Delete ();
01077 
01078   int nDim1 = (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 1 : 0;
01079   int nDim2 = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 1 : 2;
01080 
01081     for (b=active_brushes.next ; b != &active_brushes ; b=next)
01082     {
01083         next = b->next;
01084 
01085     if ( (b->maxs[nDim1] > maxs[nDim1] || b->mins[nDim1] < mins[nDim1]) 
01086       || (b->maxs[nDim2] > maxs[nDim2] || b->mins[nDim2] < mins[nDim2]) )
01087       continue;
01088 
01089         if (FilterBrush (b))
01090             continue;
01091 
01092         Brush_RemoveFromList (b);
01093         Brush_AddToList (b, &selected_brushes);
01094 #if 0
01095     // old stuff
01096     for (i=0 ; i<2 ; i++)
01097             if (b->maxs[i] > maxs[i] || b->mins[i] < mins[i])
01098                 break;
01099         if (i == 2)
01100         {
01101             Brush_RemoveFromList (b);
01102             Brush_AddToList (b, &selected_brushes);
01103         }
01104 #endif
01105     }
01106     Sys_UpdateWindows (W_ALL);
01107 }

Here is the call graph for this function:

void Select_Delete void   ) 
 

Definition at line 336 of file SELECT.CPP.

References Brush_Free(), brush_t, clearSelection(), QEGlobals_t::d_num_move_points, QEGlobals_t::d_select_count, g_ptrSelectedFaceBrushes, g_ptrSelectedFaces, g_qeglobals, brush_s::next, Patch_Delete(), brush_s::patchBrush, brush_s::pPatch, brush_s::pTerrain, selected_brushes, Sys_UpdateWindows(), Terrain_Delete(), brush_s::terrainBrush, and W_ALL.

Referenced by CXYWnd::Clip(), Entity_Create(), GenerateEndCaps(), Map_RegionBrush(), Map_RegionTallBrush(), CMainFrame::OnSelectionDelete(), Patch_BrushToMesh(), Patch_GenericMesh(), QERApp_DeleteSelection(), Select_CompleteTall(), Select_Inside(), Select_PartialTall(), CXYWnd::SplitClip(), and Terrain_BrushToMesh().

00337 {
00338     brush_t *brush;
00339 
00340   g_ptrSelectedFaces.RemoveAll();
00341   g_ptrSelectedFaceBrushes.RemoveAll();
00342     //selected_face = NULL;
00343     
00344     clearSelection();
00345 
00346     g_qeglobals.d_select_count = 0;
00347     g_qeglobals.d_num_move_points = 0;
00348     while (selected_brushes.next != &selected_brushes)
00349     {
00350         brush = selected_brushes.next;
00351     if (brush->patchBrush)
00352     {
00353       //Patch_Delete(brush->nPatchID);
00354       Patch_Delete(brush->pPatch);
00355     }
00356     if (brush->terrainBrush)
00357     {
00358         Terrain_Delete(brush->pTerrain );
00359     }
00360 
00361         Brush_Free (brush);
00362     }
00363 
00364     // FIXME: remove any entities with no brushes
00365 
00366     Sys_UpdateWindows (W_ALL);
00367 }

Here is the call graph for this function:

void Select_Deselect bool  bDeselectFaces = true  ) 
 

Definition at line 369 of file SELECT.CPP.

References active_brushes, CMainFrame::ActiveXY(), b, brush_t, clearSelection(), QEGlobals_t::d_new_brush_bottom_z, QEGlobals_t::d_new_brush_top_z, QEGlobals_t::d_num_move_points, QEGlobals_t::d_select_count, QEGlobals_t::d_workcount, g_pParentWnd, g_ptrSelectedFaceBrushes, g_ptrSelectedFaces, g_qeglobals, brush_s::maxs, brush_s::mins, brush_s::next, Patch_Deselect(), brush_s::prev, selected_brushes, Sys_UpdateWindows(), CXYWnd::UndoClear(), and W_ALL.

Referenced by AddProp(), ConnectEntities(), CopyAndSelect(), CreateEntity(), CreateEntityFromName(), CreateSmartEntity(), Drag_Begin(), END_MESSAGE_MAP(), FindReplaceTextures(), FinishSmartCreation(), Map_ImportBuffer(), Map_LoadFile(), CMainFrame::OnConvertcurves(), CMainFrame::OnPatchTab(), CMainFrame::OnSelectionDeselect(), CMainFrame::OnViewHideshowHideselected(), CXYWnd::Paste(), QERApp_DeselectAllBrushes(), Select_AllOfType(), Select_MakeDetail(), Select_MakeStructural(), Test_Ray(), Undo_Redo(), and Undo_Undo().

00370 {
00371     brush_t *b;
00372 
00373   Patch_Deselect();
00374 
00375   g_pParentWnd->ActiveXY()->UndoClear();
00376 
00377   g_qeglobals.d_workcount++;
00378     g_qeglobals.d_select_count = 0;
00379     g_qeglobals.d_num_move_points = 0;
00380     b = selected_brushes.next;
00381 
00382     if (b == &selected_brushes)
00383     {
00384         if (bDeselectFaces)
00385         {
00386             g_ptrSelectedFaces.RemoveAll();
00387       g_ptrSelectedFaceBrushes.RemoveAll();
00388       //selected_face = NULL;
00389         }
00390         Sys_UpdateWindows (W_ALL);
00391         return;
00392     }
00393 
00394   if (bDeselectFaces)
00395   {
00396     g_ptrSelectedFaces.RemoveAll();
00397     g_ptrSelectedFaceBrushes.RemoveAll();
00398       //selected_face = NULL;
00399   }
00400 
00401     clearSelection();
00402 
00403     // grab top / bottom height for new brushes
00404     if (b->mins[2] < b->maxs[2])
00405     {
00406         g_qeglobals.d_new_brush_bottom_z = b->mins[2];
00407         g_qeglobals.d_new_brush_top_z = b->maxs[2];
00408     }
00409 
00410     selected_brushes.next->prev = &active_brushes;
00411     selected_brushes.prev->next = active_brushes.next;
00412     active_brushes.next->prev = selected_brushes.prev;
00413     active_brushes.next = selected_brushes.next;
00414     selected_brushes.prev = selected_brushes.next = &selected_brushes;  
00415 
00416     Sys_UpdateWindows (W_ALL);
00417 }

Here is the call graph for this function:

void Select_FitTexture int  nHeight = 1,
int  nWidth = 1
 

Definition at line 1666 of file SELECT.CPP.

References b, Brush_Build(), Brush_FitTexture(), brush_t, Face_FitTexture(), face_t, g_ptrSelectedFaceBrushes, g_ptrSelectedFaces, i, brush_s::next, selected_brushes, Sys_UpdateWindows(), and W_CAMERA.

Referenced by CSurfaceDlg::OnBtnFacefit().

01667 {
01668     brush_t     *b;
01669 
01670   int nFaceCount = g_ptrSelectedFaces.GetSize();
01671 
01672   if(selected_brushes.next == &selected_brushes && nFaceCount == 0)
01673         return;
01674 
01675   for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
01676     {
01677     Brush_FitTexture(b, nHeight, nWidth);
01678         Brush_Build(b);
01679     }
01680 
01681     if (nFaceCount > 0)
01682     {
01683     for (int i = 0; i < nFaceCount; i++)
01684     {
01685       face_t *selFace = reinterpret_cast<face_t*>(g_ptrSelectedFaces.GetAt(i));
01686       brush_t *selBrush = reinterpret_cast<brush_t*>(g_ptrSelectedFaceBrushes.GetAt(i));
01687       Face_FitTexture(selFace, nHeight, nWidth);
01688         Brush_Build(selBrush);
01689     }
01690     }
01691 
01692     Sys_UpdateWindows (W_CAMERA);
01693 }

Here is the call graph for this function:

void Select_FlipAxis int  axis  ) 
 

Definition at line 898 of file SELECT.CPP.

References i, Select_ApplyMatrix(), select_fliporder, Select_GetMid(), select_matrix, select_origin, Sys_UpdateWindows(), vec3_origin, VectorCopy, and W_ALL.

Referenced by CMainFrame::OnBrushFlipx(), CMainFrame::OnBrushFlipy(), and CMainFrame::OnBrushFlipz().

00899 {
00900     int     i;
00901 
00902     Select_GetMid (select_origin);
00903     for (i=0 ; i<3 ; i++)
00904     {
00905         VectorCopy (vec3_origin, select_matrix[i]);
00906         select_matrix[i][i] = 1;
00907     }
00908     select_matrix[axis][axis] = -1;
00909 
00910     select_fliporder = true;
00911     Select_ApplyMatrix (true, false, 0, 0);
00912     Sys_UpdateWindows (W_ALL);
00913 }

Here is the call graph for this function:

void Select_GetBounds vec3_t  mins,
vec3_t  maxs
 

Definition at line 592 of file SELECT.CPP.

References b, brush_t, i, brush_s::maxs, brush_s::mins, brush_s::next, and selected_brushes.

Referenced by CPlugInManager::Dispatch(), Map_RegionSelectedBrushes(), Select_Brush(), Select_GetMid(), Select_GetTrueMid(), and Select_Move().

00593 {
00594     brush_t *b;
00595     int     i;
00596 
00597     for (i=0 ; i<3 ; i++)
00598     {
00599         mins[i] = 99999;
00600         maxs[i] = -99999;
00601     }
00602 
00603     for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
00604         for (i=0 ; i<3 ; i++)
00605         {
00606             if (b->mins[i] < mins[i])
00607                 mins[i] = b->mins[i];
00608             if (b->maxs[i] > maxs[i])
00609                 maxs[i] = b->maxs[i];
00610         }
00611 }

void Select_Hide  ) 
 

Definition at line 1700 of file SELECT.CPP.

References b, brush_t, brush_s::hiddenBrush, brush_s::next, selected_brushes, Sys_UpdateWindows(), and W_ALL.

Referenced by CMainFrame::OnViewHideshowHideselected().

01701 {
01702     for (brush_t* b=selected_brushes.next ; b && b != &selected_brushes ; b=b->next)
01703     {
01704     b->hiddenBrush = true;
01705     }
01706     Sys_UpdateWindows (W_ALL);
01707 }

Here is the call graph for this function:

void Select_Inside void   ) 
 

Definition at line 1191 of file SELECT.CPP.

References active_brushes, b, Brush_AddToList(), Brush_RemoveFromList(), brush_t, clearSelection(), FilterBrush(), i, brush_s::maxs, brush_s::mins, next, brush_s::next, QE_SingleBrush(), Select_Delete(), selected_brushes, Sys_UpdateWindows(), vec3_t, VectorCopy, and W_ALL.

Referenced by CMainFrame::OnSelectionSelectinside().

01192 {
01193     brush_t *b, *next;
01194     int     i;
01195     vec3_t  mins, maxs;
01196 
01197     if (!QE_SingleBrush ())
01198         return;
01199 
01200     clearSelection();
01201 
01202     VectorCopy (selected_brushes.next->mins, mins);
01203     VectorCopy (selected_brushes.next->