Example #1
0
//==========================================================================
//
//
//
//==========================================================================
void HWDrawList::DrawSorted(HWDrawInfo *di, FRenderState &state, SortNode * head)
{
	float clipsplit[2];
	int relation = 0;
	float z = 0.f;

	state.GetClipSplit(clipsplit);

	if (drawitems[head->itemindex].rendertype == DrawType_FLAT)
	{
		z = flats[drawitems[head->itemindex].index]->z;
		relation = z > di->Viewpoint.Pos.Z ? 1 : -1;
	}


	// left is further away, i.e. for stuff above viewz its z coordinate higher, for stuff below viewz its z coordinate is lower
	if (head->left)
	{
		if (relation == -1)
		{
			state.SetClipSplit(clipsplit[0], z);	// render below: set flat as top clip plane
		}
		else if (relation == 1)
		{
			state.SetClipSplit(z, clipsplit[1]);	// render above: set flat as bottom clip plane
		}
		DrawSorted(di, state, head->left);
		state.SetClipSplit(clipsplit);
	}
	DoDraw(di, state, true, head->itemindex);
	if (head->equal)
	{
		SortNode * ehead = head->equal;
		while (ehead)
		{
			DoDraw(di, state, true, ehead->itemindex);
			ehead = ehead->equal;
		}
	}
	// right is closer, i.e. for stuff above viewz its z coordinate is lower, for stuff below viewz its z coordinate is higher
	if (head->right)
	{
		if (relation == 1)
		{
			state.SetClipSplit(clipsplit[0], z);	// render below: set flat as top clip plane
		}
		else if (relation == -1)
		{
			state.SetClipSplit(z, clipsplit[1]);	// render above: set flat as bottom clip plane
		}
		DrawSorted(di, state, head->right);
		state.SetClipSplit(clipsplit);
	}
}
Example #2
0
//==========================================================================
//
//
//
//==========================================================================
void GLDrawList::DoDrawSorted(SortNode * head)
{
	float clipsplit[2];
	int relation = 0;
	float z = 0.f;

	gl_RenderState.GetClipSplit(clipsplit);

	if (drawitems[head->itemindex].rendertype == GLDIT_FLAT)
	{
		z = flats[drawitems[head->itemindex].index].z;
		relation = z > ViewPos.Z ? 1 : -1;
	}


	// left is further away, i.e. for stuff above viewz its z coordinate higher, for stuff below viewz its z coordinate is lower
	if (head->left) 
	{
		if (relation == -1)
		{
			gl_RenderState.SetClipSplit(clipsplit[0], z);	// render below: set flat as top clip plane
		}
		else if (relation == 1)
		{
			gl_RenderState.SetClipSplit(z, clipsplit[1]);	// render above: set flat as bottom clip plane
		}
		DoDrawSorted(head->left);
		gl_RenderState.SetClipSplit(clipsplit);
	}
	DoDraw(GLPASS_TRANSLUCENT, head->itemindex, true);
	if (head->equal)
	{
		SortNode * ehead=head->equal;
		while (ehead)
		{
			DoDraw(GLPASS_TRANSLUCENT, ehead->itemindex, true);
			ehead=ehead->equal;
		}
	}
	// right is closer, i.e. for stuff above viewz its z coordinate is lower, for stuff below viewz its z coordinate is higher
	if (head->right)
	{
		if (relation == 1)
		{
			gl_RenderState.SetClipSplit(clipsplit[0], z);	// render below: set flat as top clip plane
		}
		else if (relation == -1)
		{
			gl_RenderState.SetClipSplit(z, clipsplit[1]);	// render above: set flat as bottom clip plane
		}
		DoDrawSorted(head->right);
		gl_RenderState.SetClipSplit(clipsplit);
	}
}
Example #3
0
void DrawRon()
{

  //gStyle->SetOptFit(1);

  DoDraw("0005");
  DoDraw("1020");
  DoDraw("3040");
  DoDraw("5060");
  DoDraw("7080");

}
Example #4
0
File: caret.cpp Project: EdgarTx/wx
void wxCaret::Refresh()
{
    wxClientDC dcWin(GetWindow());
// this is the new code, switch to 0 if this gives problems
#ifdef wxHAS_CARET_USING_OVERLAYS
    wxDCOverlay dcOverlay( m_overlay, &dcWin, m_x, m_y, m_width , m_height );
    if ( m_blinkedOut )
    {
        dcOverlay.Clear();
    }
    else
    {
        DoDraw( &dcWin );
    }
#else
    wxMemoryDC dcMem;
    dcMem.SelectObject(m_bmpUnderCaret);
    if ( m_blinkedOut )
    {
        // restore the old image
        dcWin.Blit(m_xOld, m_yOld, m_width, m_height,
                   &dcMem, 0, 0);
        m_xOld =
        m_yOld = -1;
    }
    else
    {
        if ( m_xOld == -1 && m_yOld == -1 )
        {
            // save the part we're going to overdraw

            int x = m_x,
                y = m_y;
#if defined(__WXGTK__) && !defined(__WX_DC_BLIT_FIXED__)
            wxPoint pt = dcWin.GetDeviceOrigin();
            x += pt.x;
            y += pt.y;
#endif // broken wxGTK wxDC::Blit
            dcMem.Blit(0, 0, m_width, m_height,
                       &dcWin, x, y);

            m_xOld = m_x;
            m_yOld = m_y;
        }
        //else: we already saved the image below the caret, don't do it any
        //      more

        // and draw the caret there
        DoDraw(&dcWin);
    }
#endif
}
Example #5
0
// ----------------------------------------------------------------------------
//		* HandleControlEvent
// ----------------------------------------------------------------------------
OSStatus
GuidoCarbonControl::HandleControlEvent( EventRef inEvent )
{
    OSStatus result = noErr;	// handled by default.
  	
    switch( ::GetEventKind( inEvent ))
    {
        case kEventControlDraw:		DoDraw();	 break;  
  		case kEventControlHitTest: 	HitTest( inEvent );	break;	
  		case kEventControlTrack:	TrackMouse( inEvent );	break;
  
  
	/*	case kEventControlClick:
        {
         	int x = 0;
         	int y = 0;
         	cout << "Guido control clicked ( " << x << ", " << y << " )" << endl;
         	break;
         }*/
         
         default:
          	result = eventNotHandledErr;
          	break;
    }
    
    return result;
}
Example #6
0
int16
SimplePluginInstance::PlatformHandleEvent(nsPluginEvent* event)
{
    int16 eventHandled = FALSE;
	
    EventRecord* ev = (EventRecord*) event;
    if (This != NULL && event != NULL)
    {
        switch (ev->what)
        {
            /*
             * Draw ourselves on update events
             */
          case updateEvt:
            if( StartDraw( fWindow ) ) {
                DoDraw(This);
                EndDraw( fWindow );
            }
            eventHandled = true;
            break;
          default:
            break;
        }
    }
    return eventHandled;
}
Example #7
0
//==========================================================================
//
//
//
//==========================================================================
void HWDrawList::Draw(HWDrawInfo *di, FRenderState &state, bool translucent)
{
	for (unsigned i = 0; i < drawitems.Size(); i++)
	{
		DoDraw(di, state, translucent, i);
	}
}
Example #8
0
//==========================================================================
//
//
//
//==========================================================================
void GLDrawList::Draw(int pass)
{
	for(unsigned i=0;i<drawitems.Size();i++)
	{
		DoDraw(pass, i);
	}
}
Example #9
0
void wxlCanObj::Draw( wxDC& dc, double absx, double absy )
{
    if ( m_brush.Ok() )
        dc.SetBrush( m_brush );
    if ( m_pen.Ok() )
        dc.SetPen( m_pen );

    wxBrush currentBrush = dc.GetBrush();
    wxPen currentPen = dc.GetPen();

    absx += m_x;
    absy += m_y;

    DoDraw( dc, absx, absy );

    // iterate over the child list
    for ( wxlCanObjList::Node *node = m_objects.GetFirst(); node; node = node->GetNext() )
    {
        wxlCanObj *drawobj = node->GetData();
        // restore brush and pen
        dc.SetBrush( currentBrush );
        dc.SetPen( currentPen );
        drawobj->Draw( dc , absx, absy );
    }
}
Example #10
0
void CStatusWindow::ChangePointerCursorMode()
	{
	TInt mode=(iMode+1)%(EPointerCursorLastMode+1);
	iMode=STATIC_CAST(TPointerCursorMode,mode);
	UpdateString2();
	DoDraw();
	iUpdateNeeded=ETrue;
	}
Example #11
0
/**
  Draw function to draw the container control.\n
  Gets a handle to the Windows Graphic context.\n
  Calculates the present dimensions of the control and invokes the DoDraw function.\n
*/
void CCtlContainer::Draw( const TRect& /*aRect*/ ) const
	{
	// get a graphics contect - outline the control
	CWindowGc& gc=SystemGc();
	TRect rect=Rect();
	gc.SetBrushColor( KRgbBlue ) ;
	DoDraw( gc, rect ) ;
	}
Example #12
0
void OnlineGUI::DrawPrev()
{
  // Handler for the "Prev" button.
  fRadioPage[current_page]->SetState(kButtonUp);
  // The following line triggers DoRadio(), or at least.. used to
  fRadioPage[current_page-1]->SetState(kButtonDown);
  current_page--;
  DoDraw();  
}
Example #13
0
void wxCaret::Refresh()
{
    wxClientDC dcWin(GetWindow());
// this is the new code, switch to 0 if this gives problems
#ifdef wxHAS_CARET_USING_OVERLAYS
    wxDCOverlay dcOverlay( m_overlay, &dcWin, m_x, m_y, m_width , m_height );
    if ( m_blinkedOut )
    {
        dcOverlay.Clear();
    }
    else
    {
        DoDraw( &dcWin, GetWindow() );
    }
#else
    wxMemoryDC dcMem;
    dcMem.SelectObject(m_bmpUnderCaret);
    if ( m_blinkedOut )
    {
        // restore the old image
        dcWin.Blit(m_xOld, m_yOld, m_width, m_height,
                   &dcMem, 0, 0);
        m_xOld =
        m_yOld = -1;
    }
    else
    {
        if ( m_xOld == -1 && m_yOld == -1 )
        {
            // save the part we're going to overdraw
            dcMem.Blit(0, 0, m_width, m_height,
                       &dcWin, m_x, m_y);

            m_xOld = m_x;
            m_yOld = m_y;
        }
        //else: we already saved the image below the caret, don't do it any
        //      more

        // and draw the caret there
        DoDraw(&dcWin, GetWindow());
    }
#endif
}
//----------------------------------------------------------------------------------------------
void IDrawInterface::Draw()
{
	DoDraw();

	if (m_pCoreSDK->IsAEditor() && !m_pCoreSDK->IsAGame())
	{
		DrawBounds();
		//DrawController();
	}
}
Example #15
0
void CStatusWindow::ChangeXyInputType()
	{
	if (iXyInputType==EXYInputMouse)
		iXyInputType=EXYInputPointer;
	else if (iXyInputType==EXYInputPointer)
		iXyInputType=EXYInputMouse;
	UpdateString1();
	DoDraw();
	iUpdateNeeded=ETrue;
	}
void RectangleDrawer::OnPaint( wxPaintEvent& WXUNUSED(event) )
{
	wxClientDC dc(this);
	if (!m_pRectangleDB)
		return;
	DoDraw(dc);
	//Sleep(1000);
	//m_bDoScreenShot = true;
	//DoDraw(dc, false);
}
Example #17
0
void GameObject::Draw(DrawMgr& drawMgr)
{
    DoDraw(drawMgr);

    GameObjectPtrList::iterator iter = m_children.begin();
    for ( ; iter != m_children.end(); ++iter)
    {
        (*iter)->Draw(drawMgr);
    }
}
Example #18
0
nsresult
SimplePluginInstance::PlatformSetWindow(nsPluginWindow* window)
{
    fWindow = window;
    if( StartDraw( window ) ) {
        DoDraw(This);
        EndDraw( window );
    }
    return NS_OK;
}
Example #19
0
void wxSheetCellStringRendererRefData::Draw(wxSheet& sheet,
        const wxSheetCellAttr& attr,
        wxDC& dc,
        const wxRect& rectCell,
        const wxSheetCoords& coords,
        bool isSelected)
{
    // erase only this cells background, overflow cells should have been erased
    wxSheetCellRendererRefData::Draw(sheet, attr, dc, rectCell, coords, isSelected);
    DoDraw(sheet, attr, dc, rectCell, coords, isSelected);
}
Example #20
0
//==========================================================================
//
//
//
//==========================================================================
void GLDrawList::DoDrawSorted(SortNode * head)
{
	do
	{
		if (head->left) 
		{
			DoDrawSorted(head->left);
		}
		DoDraw(GLPASS_TRANSLUCENT, head->itemindex);
		if (head->equal)
		{
			SortNode * ehead=head->equal;
			while (ehead)
			{
				DoDraw(GLPASS_TRANSLUCENT, ehead->itemindex);
				ehead=ehead->equal;
			}
		}
	}
	while ((head=head->right));
}
Example #21
0
void BackgroundView::SetSize(int w, int h) {
	delete m_dc;
	delete m_bmp;
	m_dc = new wxMemoryDC();
	m_dc->SetFont(m_graphs->GetFont());

	m_bmp = new wxBitmap(w, h);

	ClearDC(m_dc, m_bmp, w, h);

	DoDraw(m_dc);
}
Example #22
0
void CGroup::CoreDraw(void)
{
    InitDraw();
    
    if (m_bUpdateLayout)
    {
        DrawLayout();
        m_bUpdateLayout = false;
    }

    DoDraw();
    RefreshWidget();

    DrawChilds();
}
Example #23
0
void Widget::Draw(DrawContext &context) const
{
    if (!IsVisible()) return;

    DrawContext::Base::FilterSaver filterSaver(context.GetBase());

    // apply opacity filter
    if (visibility * opacity < 1 && (context.GetBase().GetFilterCaps() & DrawContext::Base::alphaFilter))
        context.GetBase().PushAlphaFilter(math::HermiteScale(visibility, visibilityFadeExponent) * opacity);

    // apply glow filter
    if (glowiness * glowIntensity > 0 && (context.GetBase().GetFilterCaps() & DrawContext::Base::glowFilter))
        context.GetBase().PushGlowFilter(math::HermiteScale(glowiness, glowFadeExponent) * glowIntensity);

    DoDraw(context);
}
Example #24
0
void wxWindow::OnPaint(wxPaintEvent& event)
{
    if ( !m_renderer )
    {
        // it is a native control which paints itself
        event.Skip();
    }
    else
    {
        // get the DC to use and create renderer on it
        wxPaintDC dc(this);
        wxControlRenderer renderer(this, dc, m_renderer);

        // draw the control
        DoDraw(&renderer);
    }
}
Example #25
0
void CWindow::Draw(CGraphic& aGraphic)const
{
	if(iChildWindow)
	{
		iChildWindow->Draw(aGraphic);
	}
	else
	{
		if(iIsNormalWindow && iIsActivated)
		{
			DrawBackground(aGraphic);
			DrawButton(aGraphic);
		}
		DoDraw(aGraphic);
		DrawEachControl(aGraphic);
	}
}
Example #26
0
void ASSDrawEngine::draw()
{
	refresh_called = false;
	
	PixelFormat::AGGType pixf(rBuf);
	RendererBase rbase(pixf);
	RendererPrimitives rprim(rbase);
	RendererSolid rsolid(rbase);

	agg::trans_affine mtx;
	ConstructPathsAndCurves(mtx, rm_path, rb_path, rm_curve);

	rasterizer.reset();
	update_rendered_bound_coords(true);
	DoDraw(rbase, rprim, rsolid, mtx);
	
	delete rm_path, rb_path, rm_curve;
}
Example #27
0
Int_t OnlineGUI::OpenRootFile() {


  fRootFile = new TFile(fConfig->GetRootFile(),"READ");
  if(fRootFile->IsZombie() || (fRootFile->GetSize() == -1)
     || (fRootFile->ReadKeys()==0)) {
    cout << "New run not yet available.  Waiting..." << endl;
    fRootFile->Close();
    delete fRootFile;
    fRootFile = 0;
    timer->Reset();
    timer->Disconnect();
    timer->Connect(timer,"Timeout()","OnlineGUI",this,"CheckRootFile()");
    return -1;
  }

  // Update the runnumber
  ObtainRunNumber();
  if(runNumber != 0) {
    TString rnBuff = "Run #";
    rnBuff += runNumber;
    fRunNumber->SetText(rnBuff.Data());
    hframe->Layout();
  }

  // Open the Root Trees.  Give a warning if it's not there..
  GetFileObjects();
  if (fUpdate) { // Only do this stuff if their are valid keys
    GetRootTree();
    GetTreeVars();
    for(UInt_t i=0; i<fRootTree.size(); i++) {
      if(fRootTree[i]==0) {
	fRootTree.erase(fRootTree.begin() + i);
      }
    }
    DoDraw();
  } else {
    return -1;
  }
  return 0;

}
Example #28
0
LRESULT CDrawHeader::DoLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	POINT point;
	point.x = GET_X_LPARAM(lParam);
	point.y = GET_Y_LPARAM(lParam);

	m_ptLastLButtonDown = point;
	
	if (!m_bColumnResizing)
	{
		m_pAlmSum->SetCapture(TRUE, this);
		if (MouseOverColumnResizeArea(point))
		{
			SetCursor(m_hColDivCursor); 
			m_bColumnResizing = TRUE;
		}
		else
		{
			m_nColumnCatpture = GetColumn(point);

			CDCHandle dcHandle = m_pAlmSum->GetDC();
			DoDraw(dcHandle);
			m_pAlmSum->ReleaseDC(dcHandle);
		}
	}

	if (m_bColumnResizing)
	{
		if (!GetResizeColumn(point, m_nResizingColumn, m_nDragDivideOffset))
			return 1;
		
		CRect rect = m_pAlmSum->m_rect;
		CRect invertedRect(point.x - 1 - m_nDragDivideOffset, rect.top, 
			point.x - m_nDragDivideOffset, rect.bottom);
		
		CDCHandle dcHandle = m_pAlmSum->GetDC();
		dcHandle.InvertRect(&invertedRect);
		m_pAlmSum->ReleaseDC(dcHandle);
	}
		
	return 0;
}
Example #29
0
void OnlineGUI::DoRadio()
{
  // Handle the radio buttons
  //  Find out which button has been pressed..
  //   turn off the previous button...
  //   then draw the appropriate page.
  // This routine also handles the Draw from the Prev/Next buttons
  //   - makes a call to DoDraw()

  UInt_t pagecount = fConfig->GetPageCount();
  TGButton *btn = (TGButton *) gTQSender;
  UInt_t id = btn->WidgetId();
  
  if (id <= pagecount) {  
    fRadioPage[current_page]->SetState(kButtonUp);
  }

  current_page = id;
  if(!fConfig->IsMonitor()) DoDraw();

}
Example #30
0
void wxCaret::Refresh()
{
    wxClientDC dcWin(GetWindow());
    wxMemoryDC dcMem;
    dcMem.SelectObject(m_bmpUnderCaret);
    if ( m_blinkedOut )
    {
        // restore the old image
        dcWin.Blit(m_xOld, m_yOld, m_width, m_height,
                   &dcMem, 0, 0);
        m_xOld =
        m_yOld = -1;
    }
    else
    {
        if ( m_xOld == -1 && m_yOld == -1 )
        {
            // save the part we're going to overdraw

            int x = m_x,
                y = m_y;
#if defined(__WXGTK__) && !defined(__WX_DC_BLIT_FIXED__)
            wxPoint pt = dcWin.GetDeviceOrigin();
            x += pt.x;
            y += pt.y;
#endif // broken wxGTK wxDC::Blit
            dcMem.Blit(0, 0, m_width, m_height,
                       &dcWin, x, y);

            m_xOld = m_x;
            m_yOld = m_y;
        }
        //else: we already saved the image below the caret, don't do it any
        //      more

        // and draw the caret there
        DoDraw(&dcWin);
    }
}