Ignore:
Timestamp:
11/01/01 10:19:46 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.cc

    r1018 r1023  
    22
    33#include <math.h>
     4#include <fstream.h>
    45
    56#include <TClonesArray.h>
     
    308309    }
    309310}
     311
     312// ------------------------------------------------------------------------
     313//
     314// Save primitive as a C++ statement(s) on output stream out
     315//
     316void MCamDisplay::SavePrimitive(ofstream &out, Option_t *opt)
     317{
     318    if (!gROOT->ClassSaved(TCanvas::Class()))
     319        fDrawingPad->SavePrimitive(out, opt);
     320
     321    out << "   " << fDrawingPad->GetName() << "->SetWindowSize(";
     322    out << fDrawingPad->GetWw() << "," << fDrawingPad->GetWh() << ");" << endl;
     323}
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.h

    r1015 r1023  
    5757    void Reset();
    5858    void Draw(Option_t *option="");
     59    void SavePrimitive(ofstream &out, Option_t *);
    5960
    6061    ClassDef(MCamDisplay, 0) // Displays the magic camera
  • trunk/MagicSoft/Mars/mgui/MHexagon.cc

    r1018 r1023  
    3030#include "MHexagon.h"
    3131
     32#include <fstream.h>
    3233#include <iostream.h>
    3334
     
    5152//
    5253MHexagon::MHexagon(Float_t x, Float_t y, Float_t d)
    53 : TAttFill(0, 1001), fX(x), fY(y), fD(d)
     54: TAttLine(1, 1, 1), TAttFill(0, 1001), fX(x), fY(y), fD(d)
    5455{
    5556}
     
    6061//
    6162MHexagon::MHexagon(MGeomPix &pix)
    62 : TAttFill(0, 1001)
     63: TAttLine(1, 1, 1), TAttFill(0, 1001)
    6364{
    6465    fX = pix.GetX();
     
    246247void MHexagon::Print(Option_t *) const
    247248{
    248     cout << GetName() << ": x=" << fX << "mm y=" << fY << "mm r=" << fD << "mm" << endl;
    249 
    250     cout << " Color="     << GetLineColor() << ",";
    251     cout << " Style="     << GetLineStyle() << ",";
    252     cout << " Width="     << GetLineWidth() << ",";
    253     cout << " FillColor=" << GetFillColor() << endl;
    254 }
     249    cout << "MHexagon - " << GetName() << ": ";
     250    cout << "x=" << fX << "mm y=" << fY << "mm r=" << fD << "mm" << endl;
     251
     252    cout << " Line:";
     253    cout << " Color=" << GetLineColor() << ",";
     254    cout << " Style=" << GetLineStyle() << ",";
     255    cout << " Width=" << GetLineWidth() << endl;
     256    cout << " Fill:";
     257    cout << " Color=" << GetFillColor() << ",";
     258    cout << " Style=" << GetFillStyle() << endl;
     259}
     260
     261// ------------------------------------------------------------------------
     262//
     263// Save primitive as a C++ statement(s) on output stream out
     264//
     265void MHexagon::SavePrimitive(ofstream &out, Option_t *)
     266{
     267
     268    if (gROOT->ClassSaved(MHexagon::Class()))
     269       out << "   ";
     270    else
     271       out << "   MHexagon *";
     272
     273    out << "hexagon = new MHexagon(" << fX << "," << fY << "," << fD << ");" << endl;
     274
     275    SaveFillAttributes(out, "hexagon");
     276    SaveLineAttributes(out, "hexagon");
     277
     278    out << "   hexagon->Draw();" << endl;
     279}
  • trunk/MagicSoft/Mars/mgui/MHexagon.h

    r1018 r1023  
    4444    virtual ~MHexagon();
    4545
    46     void Copy (TObject &hexagon);
     46    virtual void  Copy(TObject &hexagon);
    4747
    4848    virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
    49     virtual void  DrawHexagon( Float_t x, Float_t y, Float_t d);
     49    virtual void  DrawHexagon(Float_t x, Float_t y, Float_t d);
    5050
    5151    //virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
     
    5555    virtual void  PaintHexagon(Float_t x, Float_t y, Float_t d);
    5656    virtual void  Print(Option_t *Option="") const; // *MENU*
     57    virtual void  SavePrimitive(ofstream &out, Option_t *);
    5758
    5859    ClassDef(MHexagon, 0)    // A hexagon for MAGIC
Note: See TracChangeset for help on using the changeset viewer.