ATLAS Offline Software
Loading...
Searching...
No Matches
VP1Letters::Imp Class Reference
Collaboration diagram for VP1Letters::Imp:

Public Member Functions

 Imp (VP1Letters *, SoMaterial *mat, SoSeparator *attachsep)
void createLetterAData (std::vector< double > &x, std::vector< double > &y)
void createLetterCData (std::vector< double > &x, std::vector< double > &y)
void normalizeLetterData (std::vector< double > &x, std::vector< double > &y, double yheight)
SoNode * createLetter (const std::vector< double > &x, const std::vector< double > &y)
void updateFields ()
void ensureInit3DObjects ()

Public Attributes

VP1Letterstheclass
SoMaterial * material
SoSeparator * attachSep
bool shown
double zpos
double vertpos
SoSeparator * sep
SoTranslation * transA
SoTranslation * transC

Detailed Description

Definition at line 35 of file VP1Letters.cxx.

Constructor & Destructor Documentation

◆ Imp()

VP1Letters::Imp::Imp ( VP1Letters * tc,
SoMaterial * mat,
SoSeparator * attachsep )

Definition at line 84 of file VP1Letters.cxx.

85 : theclass(tc), material(mat), attachSep(as), shown(false),
86 zpos(0),vertpos(0), sep(0), transA(0), transC(0)
87{
88 material->ref();
89 attachSep->ref();
90}
static Double_t tc
SoSeparator * sep
SoTranslation * transA
SoSeparator * attachSep
SoTranslation * transC
VP1Letters * theclass
SoMaterial * material

Member Function Documentation

◆ createLetter()

SoNode * VP1Letters::Imp::createLetter ( const std::vector< double > & x,
const std::vector< double > & y )

Definition at line 200 of file VP1Letters.cxx.

200 {
201 if (x.size()!=y.size()) {
202 theclass->message("createLetter Error: Input vectors have different length!");
203 return new SoCube;
204 }
205
207 // SbPolyhedron * sbpoly = static_cast<SbPolyhedron*>(new SbPolyhedronPolygonXSect(x,y,0.3*m));
208 // SoPolyhedron * poly = new SoPolyhedron(sbpoly);
209 SoPolyhedron * poly = new SoPolyhedron(SbPolyhedronPolygonXSect(x,y,0.3*SYSTEM_OF_UNITS::m));
210 return poly;
211}
#define y
#define x
static void initClass()

◆ createLetterAData()

void VP1Letters::Imp::createLetterAData ( std::vector< double > & x,
std::vector< double > & y )

Definition at line 94 of file VP1Letters.cxx.

94 {
95
96 x.clear();
97 y.clear();
98 x.push_back(294.15418); y.push_back(175.81259);
99 x.push_back(230.15085); y.push_back(349.36906);
100 x.push_back(358.39109); y.push_back(349.36906);
101 x.push_back(294.15418); y.push_back(175.81259);
102 x.push_back(267.52506); y.push_back(129.32842);
103 x.push_back(321.01689); y.push_back(129.32842);
104 x.push_back(453.92891); y.push_back(478.07648);
105 x.push_back(404.87526); y.push_back(478.07648);
106 x.push_back(373.10719); y.push_back(388.61197);
107 x.push_back(215.90194); y.push_back(388.61197);
108 x.push_back(184.13386); y.push_back(478.07648);
109 x.push_back(134.37945); y.push_back(478.07648);
110 x.push_back(267.52506); y.push_back(129.32842);
111}

◆ createLetterCData()

void VP1Letters::Imp::createLetterCData ( std::vector< double > & x,
std::vector< double > & y )

Definition at line 114 of file VP1Letters.cxx.

114 {
115
116 x.clear();
117 y.clear();
118 x.push_back(666.70068); y.push_back(278.58533);
119 x.push_back(668.72098); y.push_back(165.44825);
120 x.push_back(591.94939); y.push_back(127.06245);
121 x.push_back(496.99505); y.push_back(98.77818);
122 x.push_back(400.02041); y.push_back(94.73757);
123 x.push_back(299.00515); y.push_back(108.87971);
124 x.push_back(224.25386); y.push_back(145.2452);
125 x.push_back(149.50258); y.push_back(201.81374);
126 x.push_back(92.934034); y.push_back(280.60564);
127 x.push_back(56.568543); y.push_back(379.60059);
128 x.push_back(46.467017); y.push_back(486.67676);
129 x.push_back(52.527932); y.push_back(591.73262);
130 x.push_back(76.771593); y.push_back(682.64635);
131 x.push_back(109.09647); y.push_back(741.2352);
132 x.push_back(145.46197); y.push_back(783.66161);
133 x.push_back(189.90868); y.push_back(830.12862);
134 x.push_back(248.49753); y.push_back(864.47381);
135 x.push_back(327.28942); y.push_back(886.69717);
136 x.push_back(406.08132); y.push_back(898.819);
137 x.push_back(454.56865); y.push_back(898.819);
138 x.push_back(523.25902); y.push_back(886.69717);
139 x.push_back(600.03061); y.push_back(858.41289);
140 x.push_back(646.49763); y.push_back(838.20984);
141 x.push_back(668.72098); y.push_back(818.00679);
142 x.push_back(666.70068); y.push_back(710.93062);
143 x.push_back(616.19305); y.push_back(751.33672);
144 x.push_back(555.5839); y.push_back(785.68191);
145 x.push_back(484.87322); y.push_back(807.90527);
146 x.push_back(430.32498); y.push_back(809.92557);
147 x.push_back(379.81736); y.push_back(807.90527);
148 x.push_back(317.1879); y.push_back(791.74283);
149 x.push_back(280.82241); y.push_back(775.58039);
150 x.push_back(248.49753); y.push_back(749.31642);
151 x.push_back(214.15234); y.push_back(710.93062);
152 x.push_back(175.76654); y.push_back(652.34177);
153 x.push_back(159.6041); y.push_back(565.46866);
154 x.push_back(155.56349); y.push_back(480.61584);
155 x.push_back(161.62441); y.push_back(401.82394);
156 x.push_back(189.90868); y.push_back(314.95082);
157 x.push_back(242.43661); y.push_back(242.21984);
158 x.push_back(301.02546); y.push_back(203.83404);
159 x.push_back(361.63461); y.push_back(181.61069);
160 x.push_back(426.28437); y.push_back(177.57008);
161 x.push_back(511.13719); y.push_back(187.6716);
162 x.push_back(587.90878); y.push_back(217.97618);
163 x.push_back(644.47732); y.push_back(258.38228);
164 //Correct orientation for SbPolyhedronPolygonXSect:
165 std::reverse(x.begin(), x.end());
166 std::reverse(y.begin(), y.end());
167}
void reverse(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of reverse for DataVector/List.

◆ ensureInit3DObjects()

void VP1Letters::Imp::ensureInit3DObjects ( )

Definition at line 214 of file VP1Letters.cxx.

215{
216 if (sep)
217 return;
218 theclass->messageVerbose("Building 3D objects");
219 sep = new SoSeparator; sep->ref();
220 sep->addChild(material);
221
222 //Create letters:
223 std::vector<double> x,y;
225 normalizeLetterData(x,y,2*SYSTEM_OF_UNITS::m);
226 SoNode * letterA = createLetter(x,y);
228 normalizeLetterData(x,y,2*SYSTEM_OF_UNITS::m);
229 SoNode * letterC = createLetter(x,y);
230
231 transA = new SoTranslation;
232 transA->ref();
233 transC = new SoTranslation;
234 transC->ref();
235
236 SoRotationXYZ * xf = new SoRotationXYZ();
237 xf->axis=SoRotationXYZ::Z;
238 xf->angle = 180*SYSTEM_OF_UNITS::deg;
239
240 sep->addChild(transC);
241 sep->addChild(letterC);
242 sep->addChild(transA);
243 sep->addChild(xf);
244 sep->addChild(letterA);
245}
void createLetterCData(std::vector< double > &x, std::vector< double > &y)
void normalizeLetterData(std::vector< double > &x, std::vector< double > &y, double yheight)
void createLetterAData(std::vector< double > &x, std::vector< double > &y)
SoNode * createLetter(const std::vector< double > &x, const std::vector< double > &y)

◆ normalizeLetterData()

void VP1Letters::Imp::normalizeLetterData ( std::vector< double > & x,
std::vector< double > & y,
double yheight )

Definition at line 170 of file VP1Letters.cxx.

171{
172 //Translates and rescales so letter goes from -0.5*yheight to +0.5*yheight in y, and is centered around 0 in x.
173 if (x.size()!=y.size()) {
174 theclass->message("normalizeLetterData Error: Input vectors have different length!");
175 return;
176 }
177
178 unsigned n = x.size();
179
180 double xmin(1e20),xmax(-1e20),ymin(1e20),ymax(-1e20);
181 for (unsigned i = 0; i<n;++i) {
182 if (x.at(i)<xmin) xmin = x.at(i);
183 if (x.at(i)>xmax) xmax = x.at(i);
184 if (y.at(i)<ymin) ymin = y.at(i);
185 if (y.at(i)>ymax) ymax = y.at(i);
186 }
187
188 assert(ymax>ymin&&xmax>xmin);
189
190 double scale=yheight/(ymax-ymin);
191 double xoffset=-xmin-0.5*(xmax-xmin);
192 for (unsigned i = 0; i<n;++i) {
193 x.at(i) = (x.at(i)+xoffset)*scale;
194 y.at(i) = (y.at(i)-ymin)*scale-0.5*yheight;
195 }
196
197}
double xmax
Definition listroot.cxx:61
double ymin
Definition listroot.cxx:63
double xmin
Definition listroot.cxx:60
double ymax
Definition listroot.cxx:64

◆ updateFields()

void VP1Letters::Imp::updateFields ( )

Definition at line 248 of file VP1Letters.cxx.

249{
251 theclass->messageVerbose("Updating fields");
252 transA->translation.setValue(0, 0, 2*zpos);
253 transC->translation.setValue(0, vertpos, -zpos);
254}
void ensureInit3DObjects()

Member Data Documentation

◆ attachSep

SoSeparator* VP1Letters::Imp::attachSep

Definition at line 42 of file VP1Letters.cxx.

◆ material

SoMaterial* VP1Letters::Imp::material

Definition at line 41 of file VP1Letters.cxx.

◆ sep

SoSeparator* VP1Letters::Imp::sep

Definition at line 53 of file VP1Letters.cxx.

◆ shown

bool VP1Letters::Imp::shown

Definition at line 49 of file VP1Letters.cxx.

◆ theclass

VP1Letters* VP1Letters::Imp::theclass

Definition at line 40 of file VP1Letters.cxx.

◆ transA

SoTranslation* VP1Letters::Imp::transA

Definition at line 54 of file VP1Letters.cxx.

◆ transC

SoTranslation* VP1Letters::Imp::transC

Definition at line 55 of file VP1Letters.cxx.

◆ vertpos

double VP1Letters::Imp::vertpos

Definition at line 51 of file VP1Letters.cxx.

◆ zpos

double VP1Letters::Imp::zpos

Definition at line 50 of file VP1Letters.cxx.


The documentation for this class was generated from the following file: