CMS 3D CMS Logo

FWBoxIconBase.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWBoxIconBase
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Thu Feb 19 15:09:45 CST 2009
11 //
12 
13 // system include files
14 #include "TVirtualX.h"
15 
16 // user include files
18 
19 //
20 // constants, enums and typedefs
21 //
22 
23 //
24 // static data member definitions
25 //
26 
27 //
28 // constructors and destructor
29 //
30 FWBoxIconBase::FWBoxIconBase(unsigned int iEdgeLength) : m_edgeLength(iEdgeLength) {}
31 
32 // FWBoxIconBase::FWBoxIconBase(const FWBoxIconBase& rhs)
33 // {
34 // // do actual copying here;
35 // }
36 
38 
39 //
40 // assignment operators
41 //
42 // const FWBoxIconBase& FWBoxIconBase::operator=(const FWBoxIconBase& rhs)
43 // {
44 // //An exception safe implementation is
45 // FWBoxIconBase temp(rhs);
46 // swap(rhs);
47 //
48 // return *this;
49 // }
50 
51 //
52 // member functions
53 //
54 
55 //
56 // const member functions
57 //
58 void FWBoxIconBase::draw(Drawable_t iID, GContext_t iContext, int iX, int iY) const {
59  //draw in background color
60  gVirtualX->ClearArea(iID, iX, iY, m_edgeLength - 1, m_edgeLength - 1);
61  //now draw foreground
62  gVirtualX->DrawLine(iID, iContext, iX, iY, iX + m_edgeLength - 1, iY);
63  gVirtualX->DrawLine(iID, iContext, iX + m_edgeLength - 1, iY, iX + m_edgeLength - 1, iY + m_edgeLength - 1);
64  gVirtualX->DrawLine(iID, iContext, iX, iY + m_edgeLength - 1, iX + m_edgeLength - 1, iY + m_edgeLength - 1);
65  gVirtualX->DrawLine(iID, iContext, iX, iY, iX, iY + m_edgeLength - 1);
66 
67  drawInsideBox(iID, iContext, iX + 1, iY + 1, m_edgeLength - 2);
68 }
69 
70 //
71 // static member functions
72 //
FWBoxIconBase::drawInsideBox
virtual void drawInsideBox(Drawable_t iID, GContext_t iContext, int iX, int iY, unsigned int iSize) const =0
FWBoxIconBase::draw
void draw(Drawable_t iID, GContext_t iContext, int iX, int iY) const
Definition: FWBoxIconBase.cc:58
FWBoxIconBase.h
FWBoxIconBase::~FWBoxIconBase
virtual ~FWBoxIconBase()
Definition: FWBoxIconBase.cc:37
FWBoxIconBase::FWBoxIconBase
FWBoxIconBase(unsigned int iEdgeLength)
Definition: FWBoxIconBase.cc:30
FWBoxIconBase::m_edgeLength
unsigned int m_edgeLength
Definition: FWBoxIconBase.h:49