예제 #1
0
/*
============
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 );
	}
}
예제 #2
0
void Select_Brush (brush_t *brush)
{
	brush_t	*b;
	entity_t	*e;

	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++;

	e = brush->owner;
	if (e)
	{
		// select complete entity on first click
		if (e != world_entity)
		{
			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);
		}

		if (e->eclass)
			UpdateEntitySel(brush->owner->eclass);
	}
}