Пример #1
0
//Backdrop headup display graphics - instrument panels & crosshairs
void DrawHUD() {
	//Black out side panels
	SetLineWidth(5);
	int i, j;
	for (i=0; i<8; i++)
		for (j=0; j<8; j++) {
			Plot(i*5,j*5,BLACK);
			Plot(120+i*5,j*5,BLACK);
		}
	SetLineWidth(1);

	//Some concentric circles
	DrawCircle(arrowX, arrowY, 19, RED);
	DrawCircle(radarX, radarY, 19, GREEN);

	//Crosshairs
	Color crosshair;
	if (LineHitsObject(cameraPos, cameraAngle) == tankObjectIndex) {
		crosshair = RED;
	} else {
		crosshair = WHITE;
	}
	DrawLine(80, 40, 80, 80, crosshair);
	DrawLine(60, 60, 100, 60, crosshair);
	DrawCircle(80, 60, 10, crosshair);

	//lives
	for (i = 0; i< lives; i++)
		DrawImage(tankImage, 45 + i * 25, 6, WHITE);

	//score
	SetTextColor(YELLOW);
	DrawText(45, 15, "%d", score);
}
Пример #2
0
static void SetScreenMode (id0_int_t mode)
{
	switch (mode)
	{
	case 1:
		BE_ST_SetScreenMode(3);
		SetLineWidth(80);
		break;
	case 3:
		BE_ST_SetScreenMode(0xd);
		SetLineWidth(40);
		break;
	}
}
Пример #3
0
void
avtContourPlot::SetAtts(const AttributeGroup *a)
{
    needsRecalculation =
        atts.ChangesRequireRecalculation(*(const ContourAttributes*)a);
    atts = *(const ContourAttributes*)a;

    if (atts.GetContourMethod() == ContourAttributes::Level)
    {
        numLevels = atts.GetContourNLevels();
    }
    else if (atts.GetContourMethod() == ContourAttributes::Value)
    {
        numLevels = (int)atts.GetContourValue().size();
    }
    else 
    {
        numLevels = (int)atts.GetContourPercent().size();
    }

    SetColors();
    SetLineWidth(atts.GetLineWidth());
    SetLineStyle(atts.GetLineStyle());
    SetLegend(atts.GetLegendFlag());
    if (atts.GetWireframe())
    {
        behavior->SetAntialiasedRenderOrder(ABSOLUTELY_LAST);
        levelsMapper->SetSpecularIsInappropriate(true);
    }
    else 
    {
        behavior->SetAntialiasedRenderOrder(DOES_NOT_MATTER);
        levelsMapper->SetSpecularIsInappropriate(false);
    }
}
Пример #4
0
BOOL CDRFilter::AddAttributesToArrowheadPath(NodePath *P, DocColour *Col, INT32 LineWidth,
		LineCapType Cap, JointType Join)
{
	if(P->InkPath.IsFilled)
	{
		// it's a filled path, so it need to be filled with the colour and have no line
		// colour
		SetPathFilled(TRUE);
		if(!SetLineColour(DocColour(COLOUR_TRANS)) || !SetFillColour(*Col))
			return FALSE;
	} else {
		// it's not a filled colour, so don't fill it and stroke it with the line width and colour
		if(!SetLineColour(*Col) || !SetLineWidth(LineWidth) || !SetLineCap(Cap) || !SetJoinType(Join))
			return FALSE;
	}

	// apply the attributes to the object
	// If not filled, then set the ignore bit on the fill attribute.
//	if (P->InkPath.IsFilled == FALSE)
//		CurrentAttrs[ATTR_FILLGEOMETRY].Ignore = TRUE;
//	else
		CurrentAttrs[ATTR_FILLGEOMETRY].Ignore = FALSE;

	// Add attributes to the path, if they are different from the default...
	BOOL Result = AttributeManager::ApplyBasedOnDefaults(P, CurrentAttrs);

	//	DeleteCurrentAttrs();
 	//	SetUpCurrentAttrs();

	// Enable the fill attribute again
	CurrentAttrs[ATTR_FILLGEOMETRY].Ignore = FALSE;

	return Result;
}
Пример #5
0
void graph() {
   //Draw a simple graph
   // To see the output of this macro, click begin_html <a href="gif/graph.gif">here</a>. end_html
   //Author: Rene Brun
   
   TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500);

   c1->SetFillColor(42);
   c1->SetGrid();

   const Int_t n = 20;
   Double_t x[n], y[n];
   for (Int_t i=0;i<n;i++) {
     x[i] = i*0.1;
     y[i] = 10*sin(x[i]+0.2);
     printf(" i %i %f %f \n",i,x[i],y[i]);
   }
   auto gr = new TGraph(n,x,y);
   gr->SetLineColor(2);
   gr->SetLineWidth(4);
   gr->SetMarkerColor(4);
   gr->SetMarkerStyle(21);
   gr->SetTitle("a simple graph");
   gr->GetXaxis()->SetTitle("X title");
   gr->GetYaxis()->SetTitle("Y title");
   gr->Draw("ACP");

   // TCanvas::Update() draws the frame, after which one can change it
   c1->Update();
   c1->GetFrame()->SetFillColor(21);
   c1->GetFrame()->SetBorderSize(12);
   c1->Modified();
}
void
avtCurvePlot::SetAtts(const AttributeGroup *a)
{
    needsRecalculation =
        atts.ChangesRequireRecalculation(*(const CurveAttributes*)a);
    atts = *(const CurveAttributes*)a;

    double rgba[4];
    atts.GetCurveColor().GetRgba(rgba);
    curveLegend->SetColor(rgba);

    if (atts.GetShowLegend())
    {
        curveLegend->LegendOn();
    }
    else
    {
        curveLegend->LegendOff();
    }

    SetLineWidth(atts.GetLineWidth());
    SetLineStyle(atts.GetLineStyle());

    decoMapper->SetLabelColor(rgba);
    decoMapper->SetLabelVisibility(atts.GetShowLabels());

    renderer->SetAtts(atts);
    behavior->GetInfo().GetAttributes().SetWindowMode(WINMODE_CURVE);
}
Пример #7
0
 // Colored table
 void FancyTable(wxArrayString& header, wxArrayPtrVoid& data)
 {
   // Colors, line width and bold font
   SetFillColour(wxColour(255,0,0));
   SetTextColour(255);
   SetDrawColour(wxColour(128,0,0));
   SetLineWidth(.3);
   SetFont(wxS(""),wxS("B"));
   //Header
   double w[4] = {40,35,40,45};
   size_t i;
   for (i = 0; i < header.GetCount(); i++)
   {
     Cell(w[i],7,header[i],wxPDF_BORDER_FRAME, 0, wxPDF_ALIGN_CENTER, 1);
   }
   Ln();
   // Color and font restoration
   SetFillColour(wxColour(224,235,255));
   SetTextColour(0);
   SetFont(wxS(""));
   // Data
   int fill = 0;
   size_t j;
   for (j = 0; j < data.GetCount(); j++)
   {
     wxArrayString* row = (wxArrayString*) data[j];
     Cell(w[0],6,(*row)[0],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_LEFT,fill);
     Cell(w[1],6,(*row)[1],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_LEFT,fill);
     Cell(w[2],6,(*row)[2],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_RIGHT,fill);
     Cell(w[3],6,(*row)[3],wxPDF_BORDER_LEFT | wxPDF_BORDER_RIGHT,0,wxPDF_ALIGN_RIGHT,fill);
     Ln();
     fill = 1 - fill;
   }
   Cell((w[0]+w[1]+w[2]+w[3]),0,wxS(""),wxPDF_BORDER_TOP);
 }
Пример #8
0
//Setup
void Start() {
	OpenFileSystem();
	OpenGraphics();
	SetLineWidth(1); //needed otherwise we draw huge thick points!

	//Register bitmaps
	OpenImageRegister();
	logoImage = RegisterImage(_binary_Images_battle_bmp_start,_binary_Images_battle_bmp_end - _binary_Images_battle_bmp_start);
	signatureImage = RegisterImage(_binary_Images_rorschach_bmp_start,_binary_Images_rorschach_bmp_end - _binary_Images_rorschach_bmp_start);
	tankImage = RegisterImage(_binary_Images_tank_bmp_start,_binary_Images_tank_bmp_end - _binary_Images_tank_bmp_start);
	CloseImageRegister();

	sweepStepCount=0;

	ResetTimer();
	arrowRefAngle=0;
	sweepAngle = 2 * PI / SWEEPSTEPS;

	arrowX=20;
	arrowY=20;
	radarX=140;
	radarY=20;

	sweepArm.x=140;
	sweepArm.y=20;
	oldKeystate=0;

	refreshCount=0;

  	//Load calibration data, if any exists
  	rotateSleep = ROTATESLEEP;
  	LoadCalibration();

	Splash();
}
Пример #9
0
void MuReco( )
{
  TCut CPdg    = "_tracks_Pdg==13||_tracks_Pdg==211"; 

  TFile   *inFileMC;
  //gStyle->SetOptStat(0);  
  inFileMC = new TFile("ERAnaOneToOneMuReco.root");
  inFileMC->cd();
  TTree* _algoMuMC_tree = (TTree*)(inFileMC->Get("_ana1to1_tree"));


  TCanvas *C1     = new TCanvas("C1","C1",600,600);
  C1->cd();
  
  auto cut2 = new TH1D("cut2","Muon deposited Energy;  E_{#mu} [MeV];Count",20,0,800);
  _algoMuMC_tree->Draw("_tracks_DepEnFromLength>>cut2",CPdg,"");
  cut2->SetLineWidth(3);
  cut2->SetLineColor(kRed);
  cut2->GetYaxis()->SetTitleOffset(1.5);

  C1->SaveAs("MuRecoEn.png");  
  //  TFile   *inFileReco;
  //  inFileReco = new TFile("ERAnaOneToOneMuMC.root");
  //  inFileReco->cd();
  //  TTree* _algoMuReco_tree = (TTree*)(inFileReco->Get("_ProtonSel_tree"));
}
Пример #10
0
bool wxGISDisplay::CheckDrawAsPoint(const OGREnvelope &Envelope, double dfLineWidth, bool bIsRing, double dOffsetX, double dOffsetY, bool bCheckEnvelope)
{
	OGREnvelope TestEnv;
	TestEnv = Envelope;
	if(!IsDoubleEquil(m_dAngleRad, 0.0))
	{
		RotateEnvelope(TestEnv, -m_dAngleRad, m_dRotatedBoundsCenterX, m_dRotatedBoundsCenterY);
	}

	if(bCheckEnvelope && !m_CurrentBoundsRotated.Intersects(TestEnv))
		return true;

	double EnvWidth = Envelope.MaxX - Envelope.MinX;
	double EnvHeight = Envelope.MaxY - Envelope.MinY;

	World2DCDist(&EnvWidth, &EnvHeight);
	double dfR = (fabs(EnvWidth) + fabs(EnvHeight)) * .5;
    if (dfR <= MINPOLYDRAWAREA)
	{
	    if(bIsRing)
        {
            SetLineWidth( dfLineWidth + dfLineWidth );
        }
        else
        {
            SetLineWidth( dfLineWidth );
        }

        if (dfR >= MINPOLYAREA)
		{
            wxCriticalSectionLocker locker(m_CritSect);
			cairo_move_to(m_saLayerCaches[m_nCurrentLayer].pCairoContext, Envelope.MinX + dOffsetX, Envelope.MinY + dOffsetY);
			cairo_line_to(m_saLayerCaches[m_nCurrentLayer].pCairoContext, Envelope.MaxX + dOffsetX, Envelope.MaxY + dOffsetY);
		}
        else
        {
			DrawPointFast(Envelope.MinX, Envelope.MinY, dOffsetX, dOffsetY);
        }



        SetLineCap(CAIRO_LINE_CAP_ROUND);
		return true;
	}
	return false;
}
Пример #11
0
nuiOutliner::nuiOutliner(nuiPathGenerator* pPath, float linewidth)
{
  mpPath = pPath;
  SetLineWidth(linewidth);
  mLineJoin = nuiLineJoinBevel;
  mLineCap = nuiLineCapBut;
  mMiterLimit = 0.5;
}
Пример #12
0
//Draw radar dots on HUD
void DrawRadarDots(bool clear) {
	int i;
	int x, y;
	Point3d transformed;
	SetLineWidth(3); //only the tank is largest
	for(i=1; i<=world.numObjects; i++) {
		transformed=TransformPoint(world.objects[i].centre, cameraPos, cameraAngle);
		if (i==2) //rest of objects a little smaller
			SetLineWidth(2);
		//draw transformed point on radar
		x = (int)(transformed.x / 200.0 * 20.0);
		y = (int)(transformed.z / 200.0 * 20.0);
		if (qsqrt(x * x + y * y) < 20) { //if within circle
			Plot(x + radarX, radarY - y, (clear ? BLACK : world.objects[i].colour));
		}
	}
	SetLineWidth(1);
}
Пример #13
0
void
MultiCurveAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("MultiCurveAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("defaultPalette")) != 0)
        defaultPalette.SetFromNode(node);
    if((node = searchNode->GetNode("changedColors")) != 0)
        SetChangedColors(node->AsUnsignedCharVector());
    if((node = searchNode->GetNode("colorType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetColorType(ColoringMethod(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            ColoringMethod value;
            if(ColoringMethod_FromString(node->AsString(), value))
                SetColorType(value);
        }
    }
    if((node = searchNode->GetNode("singleColor")) != 0)
        singleColor.SetFromNode(node);
    if((node = searchNode->GetNode("multiColor")) != 0)
        multiColor.SetFromNode(node);
    if((node = searchNode->GetNode("lineStyle")) != 0)
        SetLineStyle(node->AsInt());
    if((node = searchNode->GetNode("lineWidth")) != 0)
        SetLineWidth(node->AsInt());
    if((node = searchNode->GetNode("yAxisTitleFormat")) != 0)
        SetYAxisTitleFormat(node->AsString());
    if((node = searchNode->GetNode("useYAxisTickSpacing")) != 0)
        SetUseYAxisTickSpacing(node->AsBool());
    if((node = searchNode->GetNode("yAxisTickSpacing")) != 0)
        SetYAxisTickSpacing(node->AsDouble());
    if((node = searchNode->GetNode("displayMarkers")) != 0)
        SetDisplayMarkers(node->AsBool());
    if((node = searchNode->GetNode("markerVariable")) != 0)
        SetMarkerVariable(node->AsString());
    if((node = searchNode->GetNode("displayIds")) != 0)
        SetDisplayIds(node->AsBool());
    if((node = searchNode->GetNode("idVariable")) != 0)
        SetIdVariable(node->AsString());
    if((node = searchNode->GetNode("legendFlag")) != 0)
        SetLegendFlag(node->AsBool());
}
Пример #14
0
mitk::Material::Material(  )
{
  InitializeStandardValues();
  SetColor( GetColor() );
  SetColorCoefficient( GetColorCoefficient() );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( GetSpecularCoefficient() );
  SetSpecularPower( GetSpecularPower() );
  SetOpacity( GetOpacity() );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
}
Пример #15
0
mitk::Material::Material( mitk::Material::Color color, vtkFloatingPointType colorCoefficient, vtkFloatingPointType specularCoefficient, vtkFloatingPointType specularPower, vtkFloatingPointType opacity )
{
  InitializeStandardValues();
  SetColor( color );
  SetColorCoefficient( colorCoefficient );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( specularCoefficient );
  SetSpecularPower( specularPower );
  SetOpacity( opacity );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
}
Пример #16
0
mitk::Material::Material( vtkFloatingPointType red, vtkFloatingPointType green, vtkFloatingPointType blue, vtkFloatingPointType opacity )
{
  InitializeStandardValues();
  SetColor( red, green, blue );
  SetColorCoefficient( GetColorCoefficient() );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( GetSpecularCoefficient() );
  SetSpecularPower( GetSpecularPower() );
  SetOpacity( opacity );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
  m_Name = "";
}
Пример #17
0
void SimpleHistogram()
{
   // Create a histogram with 64 bins and an x axis ranging from 0 to 16
   auto h = new TH1F("myPyHisto", "Productivity;C++ Knowledge;Productivity", 64, 0, 16);

   // Fill it with random numbers distributed according to a linear function ("pol1")
   h->FillRandom("pol1");

   // Change its line width with a thicker one
   h->SetLineWidth(4);

   // Draw!
   h->Draw();
}
Пример #18
0
mitk::Material::Material( Color color, double opacity )
{
  InitializeStandardValues();
  SetColor( color );
  SetColorCoefficient( GetColorCoefficient() );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( GetSpecularCoefficient() );
  SetSpecularPower( GetSpecularPower() );
  SetOpacity( opacity );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
  m_Name = "";
}
Пример #19
0
void fillrandom() {
   TCanvas *c1 = new TCanvas("c1","The FillRandom example",200,10,700,900);

   auto pad1 = new TPad("pad1","The pad with the function",0.05,0.50,0.95,0.95);
   auto pad2 = new TPad("pad2","The pad with the histogram",0.05,0.05,0.95,0.45);
   pad1->Draw();
   pad2->Draw();
   pad1->cd();

   gBenchmark->Start("fillrandom");
   //
   // A function (any dimension) or a formula may reference
   // an already defined formula
   //
   auto form1 = new TFormula("form1","abs(sin(x)/x)");
   auto sqroot = new TF1("sqroot","x*gaus(0) + [3]*form1",0,10);
   sqroot->SetParameters(10,4,1,20);
   pad1->SetGridx();
   pad1->SetGridy();
   pad1->GetFrame()->SetBorderMode(-1);
   pad1->GetFrame()->SetBorderSize(5);
   sqroot->SetLineColor(4);
   sqroot->SetLineWidth(6);
   sqroot->Draw();
   auto lfunction = new TPaveLabel(5,39,9.8,46,"The sqroot function");
   lfunction->Draw();
   c1->Update();

   //
   // Create a one dimensional histogram (one float per bin)
   // and fill it following the distribution in function sqroot.
   //
   pad2->cd();
   pad2->GetFrame()->SetBorderMode(-1);
   pad2->GetFrame()->SetBorderSize(5);
   auto h1f = new TH1F("h1f","Test random numbers",200,0,10);
   h1f->SetFillColor(45);
   h1f->FillRandom("sqroot",10000);
   h1f->Draw();
   c1->Update();
   //
   // Open a ROOT file and save the formula, function and histogram
   //
   TFile myfile("fillrandom.root","RECREATE");
   form1->Write();
   sqroot->Write();
   h1f->Write();
   gBenchmark->Show("fillrandom");
}
Пример #20
0
void ZeroLine::ReloadResource() {
	line->Release();
	utilLine->Release();
	D3DXCreateLine(ZeroApp->GetDevice(), &line);
	D3DXCreateLine(ZeroApp->GetDevice(), &utilLine);

	line->SetAntialias(true);
	line->SetPatternScale(1.0f);
	utilLine->SetAntialias(true);
	utilLine->SetPatternScale(1.0f);

	if (lineWidth != -1)
		SetLineWidth(lineWidth);
	if (lineHeight != -1)
		SetLinePattern(lineHeight);
}
Пример #21
0
mitk::Material::Material( double red, double green, double blue,
    double colorCoefficient, double specularCoefficient,
    double specularPower, double opacity )
{
  InitializeStandardValues();
  SetColor( red, green, blue );
  SetColorCoefficient( colorCoefficient );
  SetSpecularColor( GetSpecularColor() );
  SetSpecularCoefficient( specularCoefficient );
  SetSpecularPower( specularPower );
  SetOpacity( opacity );
  SetInterpolation( GetInterpolation() );
  SetRepresentation( GetRepresentation() );
  SetLineWidth( GetLineWidth() );
  m_Name = "";
}
Пример #22
0
void 
avtTopologyPlot::SetColors()
{
    std::vector < std::string > labels(4);
    LevelColorMap levelColorMap;

    labels[0] = avtTopologyFilter::labelNames[0];
    labels[1] = avtTopologyFilter::labelNames[1];
    labels[2] = avtTopologyFilter::labelNames[2];
    labels[3] = avtTopologyFilter::labelNames[3];
    
    ColorAttributeList cal(atts.GetMultiColor());
    int numColors = cal.GetNumColors();
    
    //
    //  Create colors from original color table. 
    //
    unsigned char *colors = new unsigned char[numColors * 4];
    unsigned char *cptr = colors;
    for(int i = 0; i < numColors; i++)
    {
        cal[i].SetAlpha((unsigned char)(255 * opacity[i]));

        *cptr++ = (unsigned char)cal[i].Red();
        *cptr++ = (unsigned char)cal[i].Green();
        *cptr++ = (unsigned char)cal[i].Blue();
        *cptr++ = (unsigned char)cal[i].Alpha();

        //
        //  Create a label-to-color-index mapping 
        //
        levelColorMap.insert(LevelColorMap::value_type(labels[i], i));
    }

    avtLUT->SetLUTColorsWithOpacity(colors, numColors);
    levelsMapper->SetColors(cal, needsRecalculation);
    levelsLegend->SetLevels(labels);

    levelsMapper->SetLabelColorMap(levelColorMap);
    levelsLegend->SetLabelColorMap(levelColorMap);

    delete [] colors;

    SetLineWidth(atts.GetLineWidth());
    SetLineStyle(atts.GetLineStyle());
}
Пример #23
0
void CToolsCtlPanelText::UpdateCalendarTextControls(CAGSymCalendar* pCalendarSym)
{
	CAGSpec* pAGSpec = pCalendarSym->GetActiveSpec();
	if (!pAGSpec)
		return;
	
	// Update the FillType control
	SetFillType(pAGSpec->m_FillType);

	// Update the FillColor control
	SetFillColor(pAGSpec->m_FillColor);

	// Update the FillColor2 control
	SetFillColor2(pAGSpec->m_FillColor2);

	// Update the LineWidth control
	SetLineWidth(pAGSpec->m_LineWidth);

	// Update the LineColor control
	SetLineColor(pAGSpec->m_LineColor);

	// Update the Title control
	//SetTitleText(pCalendarSym->GetActivePanelTitle());

	//UpdateFillCtrls();
	//UpdateLineCtrls();
	ShowHideColors();

	// Update the TextSize control
	SetTextSize(abs(pAGSpec->m_Font.lfHeight));

	// Update the Font control
	LOGFONT& SymFont = pAGSpec->m_Font;
	SetFontControl(&pAGSpec->m_Font, true/*bClearIfBad*/);

	// Update the text style controls
	m_ButtonBold.Check(SymFont.lfWeight != FW_NORMAL);
	m_ButtonItalic.Check(!!SymFont.lfItalic);
	m_ButtonUnderline.Check(!!SymFont.lfUnderline);

	// Update the Vertical adjustment controls
	UpdateTextAlignCtrls(pCalendarSym);
}
void CToolsCtlPanelGraphics::UpdateControls()
{
	CDocWindow* pDocWindow = m_pCtp->GetDocWindow();
	CAGDoc* pAGDoc = (!pDocWindow ? NULL : pDocWindow->GetDoc());

	CAGSym* pSym = m_pCtp->m_pDocWindow->GetSelectedItem();
	if (!pSym)
		return;

	if (pSym->IsGraphic())
	{
		CAGSymGraphic* pGraphicSym = (CAGSymGraphic*)pSym;

		if (pSym->IsRectangle())
			SetShapeName("Rectangle");
		else
		if (pSym->IsEllipse())
			SetShapeName("Circle/Ellipse");
		else
		if (pSym->IsLine())
			SetShapeName("Line");
		else
		if (pSym->IsShape())
		{
			SetShapeName(((CAGSymDrawing*)pSym)->GetShapeName());
		}

		// Update the Fill controls
		SetFillType(pGraphicSym->GetFillType());
		SetFillColor(pGraphicSym->GetFillColor());
		SetFillColor2(pGraphicSym->GetFillColor2());

		// Update the Line control
		SetLineWidth(pGraphicSym->GetLineWidth());
		SetLineColor(pGraphicSym->GetLineColor());

		//UpdateFillCtrls();
		//UpdateLineCtrls();
		ShowHideColors();
	}
}
Пример #25
0
void nGraphics::DrawCursor(const nVector2& position,float internal,float external,float angle,const nColor& color)
{
	SetLineWidth(2);

	nMatrix4 matRot,matTrans,matFinal;

	D3DXMatrixRotationZ(&matRot,angle);
	D3DXMatrixTranslation(&matTrans,position.x,position.y,0.0f);

	matFinal = matRot * matTrans;

	nVector2 lines[2];

	lines[0] = nVector2(internal,internal);
	lines[1] = nVector2(external,external);

	D3DXVec2TransformCoordArray((LPD3DXVECTOR2)lines,sizeof(nVector2),(LPD3DXVECTOR2)lines,sizeof(nVector2),&matFinal,2);

	DrawLines(lines,2,color);

	lines[0] = nVector2(-internal,internal);
	lines[1] = nVector2(-external,external);

	D3DXVec2TransformCoordArray((LPD3DXVECTOR2)lines,sizeof(nVector2),(LPD3DXVECTOR2)lines,sizeof(nVector2),&matFinal,2);

	DrawLines(lines,2,color);

	lines[0] = nVector2(internal,-internal);
	lines[1] = nVector2(external,-external);

	D3DXVec2TransformCoordArray((LPD3DXVECTOR2)lines,sizeof(nVector2),(LPD3DXVECTOR2)lines,sizeof(nVector2),&matFinal,2);

	DrawLines(lines,2,color);

	lines[0] = nVector2(-internal,-internal);
	lines[1] = nVector2(-external,-external);

	D3DXVec2TransformCoordArray((LPD3DXVECTOR2)lines,sizeof(nVector2),(LPD3DXVECTOR2)lines,sizeof(nVector2),&matFinal,2);

	DrawLines(lines,2,color);
}
Пример #26
0
void CToolsPanelText2::UpdateCalendarTextControls(CAGSymCalendar* pCalendarSym)
{
	CAGSpec* pAGSpec = pCalendarSym->GetActiveSpec();
	if (!pAGSpec)
		return;
	
	// Update the FillType control
	SetFillType(pAGSpec->m_FillType);

	// Update the FillColor control
	SetFillColor(pAGSpec->m_FillColor);

	// Update the FillColor2 control
	SetFillColor2(pAGSpec->m_FillColor2);

	// Update the LineWidth control
	SetLineWidth(pAGSpec->m_LineWidth);

	// Update the LineColor control
	SetLineColor(pAGSpec->m_LineColor);

	ShowHideColors();
}
Пример #27
0
void
avtWellBorePlot::SetAtts(const AttributeGroup *a)
{
    const WellBoreAttributes *newAtts = (const WellBoreAttributes *)a;

    needsRecalculation = atts.ChangesRequireRecalculation(*newAtts);

    atts = *newAtts;

    if (WellBoreFilter != NULL)
        WellBoreFilter->SetAttributes(*newAtts);

    if (newAtts->GetNWellBores() == 0)
        return;

    SetColors();

    SetLegend(atts.GetLegendFlag());
    SetLineWidth(atts.GetWellLineWidth());
    SetLineStyle(atts.GetWellLineStyle());

    decoMapper->SetScale(atts.GetWellNameScale());
    decoMapper->SetLabelVisibility(true);
}
Пример #28
0
void
AxesArray::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("AxesArray");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("visible")) != 0)
        SetVisible(node->AsBool());
    if((node = searchNode->GetNode("ticksVisible")) != 0)
        SetTicksVisible(node->AsBool());
    if((node = searchNode->GetNode("autoSetTicks")) != 0)
        SetAutoSetTicks(node->AsBool());
    if((node = searchNode->GetNode("autoSetScaling")) != 0)
        SetAutoSetScaling(node->AsBool());
    if((node = searchNode->GetNode("lineWidth")) != 0)
        SetLineWidth(node->AsInt());
    if((node = searchNode->GetNode("axes")) != 0)
        axes.SetFromNode(node);
}
void
VectorAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("VectorAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("glyphLocation")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetGlyphLocation(GlyphLocation(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            GlyphLocation value;
            if(GlyphLocation_FromString(node->AsString(), value))
                SetGlyphLocation(value);
        }
    }
    if((node = searchNode->GetNode("useStride")) != 0)
        SetUseStride(node->AsBool());
    if((node = searchNode->GetNode("stride")) != 0)
        SetStride(node->AsInt());
    if((node = searchNode->GetNode("nVectors")) != 0)
        SetNVectors(node->AsInt());
    if((node = searchNode->GetNode("lineStyle")) != 0)
        SetLineStyle(node->AsInt());
    if((node = searchNode->GetNode("lineWidth")) != 0)
        SetLineWidth(node->AsInt());
    if((node = searchNode->GetNode("scale")) != 0)
        SetScale(node->AsDouble());
    if((node = searchNode->GetNode("scaleByMagnitude")) != 0)
        SetScaleByMagnitude(node->AsBool());
    if((node = searchNode->GetNode("autoScale")) != 0)
        SetAutoScale(node->AsBool());
    if((node = searchNode->GetNode("headSize")) != 0)
        SetHeadSize(node->AsDouble());
    if((node = searchNode->GetNode("headOn")) != 0)
        SetHeadOn(node->AsBool());
    if((node = searchNode->GetNode("colorByMag")) != 0)
        SetColorByMag(node->AsBool());
    if((node = searchNode->GetNode("useLegend")) != 0)
        SetUseLegend(node->AsBool());
    if((node = searchNode->GetNode("vectorColor")) != 0)
        vectorColor.SetFromNode(node);
    if((node = searchNode->GetNode("colorTableName")) != 0)
        SetColorTableName(node->AsString());
    if((node = searchNode->GetNode("invertColorTable")) != 0)
        SetInvertColorTable(node->AsBool());
    if((node = searchNode->GetNode("vectorOrigin")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetVectorOrigin(OriginType(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            OriginType value;
            if(OriginType_FromString(node->AsString(), value))
                SetVectorOrigin(value);
        }
    }
    if((node = searchNode->GetNode("minFlag")) != 0)
        SetMinFlag(node->AsBool());
    if((node = searchNode->GetNode("maxFlag")) != 0)
        SetMaxFlag(node->AsBool());
    if((node = searchNode->GetNode("limitsMode")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetLimitsMode(LimitsMode(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            LimitsMode value;
            if(LimitsMode_FromString(node->AsString(), value))
                SetLimitsMode(value);
        }
    }
    if((node = searchNode->GetNode("min")) != 0)
        SetMin(node->AsDouble());
    if((node = searchNode->GetNode("max")) != 0)
        SetMax(node->AsDouble());
    if((node = searchNode->GetNode("lineStem")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetLineStem(LineStem(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            LineStem value;
            if(LineStem_FromString(node->AsString(), value))
                SetLineStem(value);
        }
    }
    if((node = searchNode->GetNode("geometryQuality")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetGeometryQuality(Quality(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            Quality value;
            if(Quality_FromString(node->AsString(), value))
                SetGeometryQuality(value);
        }
    }
    if((node = searchNode->GetNode("stemWidth")) != 0)
        SetStemWidth(node->AsDouble());
    if((node = searchNode->GetNode("origOnly")) != 0)
        SetOrigOnly(node->AsBool());
    if((node = searchNode->GetNode("glyphType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 2)
                SetGlyphType(GlyphType(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            GlyphType value;
            if(GlyphType_FromString(node->AsString(), value))
                SetGlyphType(value);
        }
    }
}
void
SubsetAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("SubsetAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("colorType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 3)
                SetColorType(ColoringMethod(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            ColoringMethod value;
            if(ColoringMethod_FromString(node->AsString(), value))
                SetColorType(value);
        }
    }
    if((node = searchNode->GetNode("colorTableName")) != 0)
        SetColorTableName(node->AsString());
    if((node = searchNode->GetNode("invertColorTable")) != 0)
        SetInvertColorTable(node->AsBool());
    if((node = searchNode->GetNode("filledFlag")) != 0)
        SetFilledFlag(node->AsBool());
    if((node = searchNode->GetNode("legendFlag")) != 0)
        SetLegendFlag(node->AsBool());
    if((node = searchNode->GetNode("lineStyle")) != 0)
        SetLineStyle(node->AsInt());
    if((node = searchNode->GetNode("lineWidth")) != 0)
        SetLineWidth(node->AsInt());
    if((node = searchNode->GetNode("singleColor")) != 0)
        singleColor.SetFromNode(node);
    if((node = searchNode->GetNode("multiColor")) != 0)
        multiColor.SetFromNode(node);
    if((node = searchNode->GetNode("subsetNames")) != 0)
        SetSubsetNames(node->AsStringVector());
    if((node = searchNode->GetNode("subsetType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 6)
                SetSubsetType(Subset_Type(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            Subset_Type value;
            if(Subset_Type_FromString(node->AsString(), value))
                SetSubsetType(value);
        }
    }
    if((node = searchNode->GetNode("opacity")) != 0)
        SetOpacity(node->AsDouble());
    if((node = searchNode->GetNode("wireframe")) != 0)
        SetWireframe(node->AsBool());
    if((node = searchNode->GetNode("drawInternal")) != 0)
        SetDrawInternal(node->AsBool());
    if((node = searchNode->GetNode("smoothingLevel")) != 0)
        SetSmoothingLevel(node->AsInt());
    if((node = searchNode->GetNode("pointSize")) != 0)
        SetPointSize(node->AsDouble());
    if((node = searchNode->GetNode("pointType")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 8)
                SetPointType(PointType(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            PointType value;
            if(PointType_FromString(node->AsString(), value))
                SetPointType(value);
        }
    }
    if((node = searchNode->GetNode("pointSizeVarEnabled")) != 0)
        SetPointSizeVarEnabled(node->AsBool());
    if((node = searchNode->GetNode("pointSizeVar")) != 0)
        SetPointSizeVar(node->AsString());
    if((node = searchNode->GetNode("pointSizePixels")) != 0)
        SetPointSizePixels(node->AsInt());
}