ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
VP1CylindricalGrid::Imp Class Reference
Collaboration diagram for VP1CylindricalGrid::Imp:

Public Member Functions

 Imp (VP1CylindricalGrid *, SoSeparator *attachsep)
 
void rebuild3DObjects ()
 
void updateColour ()
 

Public Attributes

VP1CylindricalGridtheclass
 
SoSeparator * attachSep
 
bool shown
 
SbColor4f colourAndTransp
 
double extent
 
double spacing
 
SoSeparator * sep
 
SoPackedColor * circlecol
 

Detailed Description

Definition at line 35 of file VP1CylindricalGrid.cxx.

Constructor & Destructor Documentation

◆ Imp()

VP1CylindricalGrid::Imp::Imp ( VP1CylindricalGrid tc,
SoSeparator *  attachsep 
)

Definition at line 74 of file VP1CylindricalGrid.cxx.

75  : theclass(tc), attachSep(as), shown(false),
76  colourAndTransp(SbColor4f(1,1,1,1)),extent(10), spacing(1),
77  sep(0), circlecol(0)
78 {
79  attachSep->ref();
80 }

Member Function Documentation

◆ rebuild3DObjects()

void VP1CylindricalGrid::Imp::rebuild3DObjects ( )

Definition at line 83 of file VP1CylindricalGrid.cxx.

84 {
85  theclass->messageVerbose("(Re)building 3D objects");
86 
87  if (sep) {
88  sep->removeAllChildren();
89  } else {
90  sep = new SoSeparator;
91  sep->ref();
92  }
93 
94  const bool save = sep->enableNotify(false);
95 
96  int nmax; double distmax;
97  if (!VP1Floor::calcParsFromExtentAndSpacing( theclass, extent, spacing, 20/*max lines*/, nmax, distmax )) {
98  nmax = 10;
99  distmax = 10*SYSTEM_OF_UNITS::m;
100  theclass->message("ERROR: Problems calculating nmax/distmax.");
101  }
102 
103  if (!circlecol) {
104  circlecol = new SoPackedColor();
105  circlecol->ref();
106  }
107 
108  //Add circles:
109  sep->addChild(circlecol);
110 
111  for (int ir=1;ir<=nmax;++ir) {
112  SoNode * circle = VP1QtInventorUtils::createCircle(ir*spacing);
113  SoSeparator * s = new SoSeparator;
114  SoTranslation *t1= new SoTranslation();
115  t1->translation.setValue(0.0,0.0,-distmax-spacing);
116  s->addChild(t1);
117  for (int iz = -nmax; iz<=nmax; ++iz) {
118  SoTranslation *t2= new SoTranslation();
119  t2->translation.setValue(0.0,0.0,spacing);
120  s->addChild(t2);
121  s->addChild(circle);
122  }
123  sep->addChild(s);
124  }
125 
126  //Add lines:
127 
128  SoVertexProperty * grid_cylindrical_vertices = new SoVertexProperty();
129 
130  int ivert(0);
131  int nsublines(0);
132  static const double invsqrttwo = 1.0/sqrt(2.0);
133  for (int ir=1;ir<=nmax;++ir) {
134  double r = ir*spacing;
135  double r2 = r*invsqrttwo;
136  grid_cylindrical_vertices->vertex.set1Value(ivert++,r,0,-distmax);
137  grid_cylindrical_vertices->vertex.set1Value(ivert++,r,0,+distmax);
138  grid_cylindrical_vertices->vertex.set1Value(ivert++,0,r,-distmax);
139  grid_cylindrical_vertices->vertex.set1Value(ivert++,0,r,+distmax);
140  grid_cylindrical_vertices->vertex.set1Value(ivert++,-r,0,-distmax);
141  grid_cylindrical_vertices->vertex.set1Value(ivert++,-r,0,+distmax);
142  grid_cylindrical_vertices->vertex.set1Value(ivert++,0,-r,-distmax);
143  grid_cylindrical_vertices->vertex.set1Value(ivert++,0,-r,+distmax);
144  grid_cylindrical_vertices->vertex.set1Value(ivert++,r2,r2,-distmax);
145  grid_cylindrical_vertices->vertex.set1Value(ivert++,r2,r2,+distmax);
146  grid_cylindrical_vertices->vertex.set1Value(ivert++,r2,-r2,-distmax);
147  grid_cylindrical_vertices->vertex.set1Value(ivert++,r2,-r2,+distmax);
148  grid_cylindrical_vertices->vertex.set1Value(ivert++,-r2,r2,-distmax);
149  grid_cylindrical_vertices->vertex.set1Value(ivert++,-r2,r2,+distmax);
150  grid_cylindrical_vertices->vertex.set1Value(ivert++,-r2,-r2,-distmax);
151  grid_cylindrical_vertices->vertex.set1Value(ivert++,-r2,-r2,+distmax);
152  nsublines+=8;
153  }
154 
155  grid_cylindrical_vertices->materialBinding=SoMaterialBinding::OVERALL;
156  grid_cylindrical_vertices->normalBinding=SoNormalBinding::OVERALL;
157  SoLineSet * line = new SoLineSet();
158  line->numVertices.enableNotify(FALSE);
159  line->numVertices.setNum(nsublines);
160  for (int i=0;i<nsublines;++i)
161  line->numVertices.set1Value(i,2);
162  line->vertexProperty = grid_cylindrical_vertices;
163  line->numVertices.enableNotify(TRUE);
164  line->numVertices.touch();
165 
166  sep->addChild(line);
167  updateColour();
168 
169  if (save) {
170  sep->enableNotify(true);
171  sep->touch();
172  }
173 
174 }

◆ updateColour()

void VP1CylindricalGrid::Imp::updateColour ( )

Definition at line 177 of file VP1CylindricalGrid.cxx.

178 {
179  theclass->messageVerbose("Updating packed colour");
180  if (circlecol)
181  circlecol->orderedRGBA = colourAndTransp.getPackedValue();
182  if (!sep||sep->getNumChildren()<1)
183  return;
184  SoNode * n = sep->getChild(0);
185  if (!n||n->getTypeId()!=SoLineSet::getClassTypeId())
186  return;
187  SoLineSet * line = static_cast<SoLineSet*>(n);
188  SoVertexProperty * vertices = static_cast<SoVertexProperty *>(line->vertexProperty.getValue());
189  if (vertices)
190  vertices->orderedRGBA = colourAndTransp.getPackedValue();
191 }

Member Data Documentation

◆ attachSep

SoSeparator* VP1CylindricalGrid::Imp::attachSep

Definition at line 40 of file VP1CylindricalGrid.cxx.

◆ circlecol

SoPackedColor* VP1CylindricalGrid::Imp::circlecol

Definition at line 48 of file VP1CylindricalGrid.cxx.

◆ colourAndTransp

SbColor4f VP1CylindricalGrid::Imp::colourAndTransp

Definition at line 43 of file VP1CylindricalGrid.cxx.

◆ extent

double VP1CylindricalGrid::Imp::extent

Definition at line 44 of file VP1CylindricalGrid.cxx.

◆ sep

SoSeparator* VP1CylindricalGrid::Imp::sep

Definition at line 47 of file VP1CylindricalGrid.cxx.

◆ shown

bool VP1CylindricalGrid::Imp::shown

Definition at line 42 of file VP1CylindricalGrid.cxx.

◆ spacing

double VP1CylindricalGrid::Imp::spacing

Definition at line 45 of file VP1CylindricalGrid.cxx.

◆ theclass

VP1CylindricalGrid* VP1CylindricalGrid::Imp::theclass

Definition at line 39 of file VP1CylindricalGrid.cxx.


The documentation for this class was generated from the following file:
beamspotman.r
def r
Definition: beamspotman.py:676
checkFileSG.line
line
Definition: checkFileSG.py:75
VP1CylindricalGrid::Imp::circlecol
SoPackedColor * circlecol
Definition: VP1CylindricalGrid.cxx:48
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition: VP1HelperClassBase.cxx:78
VP1CylindricalGrid::Imp::colourAndTransp
SbColor4f colourAndTransp
Definition: VP1CylindricalGrid.cxx:43
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
VP1CylindricalGrid::Imp::extent
double extent
Definition: VP1CylindricalGrid.cxx:44
MCP::ScaleSmearParam::r2
@ r2
VP1QtInventorUtils::createCircle
static SoNode * createCircle(const double &radius)
Definition: VP1QtInventorUtils.cxx:1282
checkTP.save
def save(self, fileName="./columbo.out")
Definition: checkTP.py:178
VP1CylindricalGrid::Imp::shown
bool shown
Definition: VP1CylindricalGrid.cxx:42
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
VP1CylindricalGrid::Imp::attachSep
SoSeparator * attachSep
Definition: VP1CylindricalGrid.cxx:40
python.Constants.TRUE
bool TRUE
for job options legacy (TODO: get rid of these!) ----------------------—
Definition: Control/AthenaCommon/python/Constants.py:22
VP1Floor::calcParsFromExtentAndSpacing
static bool calcParsFromExtentAndSpacing(VP1HelperClassBase *, const double &extent, const double &spacing, const int &nmaxlimit, int &nmax, double &distmax)
Definition: VP1Floor.cxx:30
SCT_ConditionsData::OVERALL
@ OVERALL
Definition: SCT_ConditionsParameters.h:24
VP1CylindricalGrid::Imp::theclass
VP1CylindricalGrid * theclass
Definition: VP1CylindricalGrid.cxx:39
VP1CylindricalGrid::Imp::sep
SoSeparator * sep
Definition: VP1CylindricalGrid.cxx:47
VP1CylindricalGrid::Imp::updateColour
void updateColour()
Definition: VP1CylindricalGrid.cxx:177
python.Constants.FALSE
bool FALSE
Definition: Control/AthenaCommon/python/Constants.py:23
ir
int ir
counter of the current depth
Definition: fastadd.cxx:49
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
VP1CylindricalGrid::Imp::spacing
double spacing
Definition: VP1CylindricalGrid.cxx:45
VP1HelperClassBase::message
void message(const QString &) const
Definition: VP1HelperClassBase.cxx:49
nmax
const int nmax(200)