18#include <Inventor/nodes/SoMaterial.h>
19#include <Inventor/nodes/SoCube.h>
20#include <Inventor/nodes/SoSeparator.h>
21#include <Inventor/nodes/SoTranslation.h>
22#include <Inventor/nodes/SoRotationXYZ.h>
27 #include "CLHEP/Units/SystemOfUnits.h"
28 #define SYSTEM_OF_UNITS CLHEP
30 #include "GaudiKernel/SystemOfUnits.h"
31 #define SYSTEM_OF_UNITS Gaudi::Units
39 SoSeparator * attachsep);
47 SoNode *
createLetter(
const std::vector<double>&
x,
const std::vector<double> &
y);
78 m_d->material->unref();
79 m_d->attachSep->unref();
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);
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);
173 if (
x.size()!=
y.size()) {
174 theclass->message(
"normalizeLetterData Error: Input vectors have different length!");
178 unsigned n =
x.size();
181 for (
unsigned i = 0; i<n;++i) {
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;
201 if (
x.size()!=
y.size()) {
202 theclass->message(
"createLetter Error: Input vectors have different length!");
218 theclass->messageVerbose(
"Building 3D objects");
219 sep =
new SoSeparator;
sep->ref();
223 std::vector<double>
x,
y;
231 transA =
new SoTranslation;
233 transC =
new SoTranslation;
236 SoRotationXYZ * xf =
new SoRotationXYZ();
237 xf->axis=SoRotationXYZ::Z;
238 xf->angle = 180*SYSTEM_OF_UNITS::deg;
241 sep->addChild(letterC);
244 sep->addChild(letterA);
251 theclass->messageVerbose(
"Updating fields");
265 if (
m_d->attachSep->findChild(
m_d->sep)<0)
266 m_d->attachSep->addChild(
m_d->sep);
268 if (
m_d->sep&&
m_d->attachSep->findChild(
m_d->sep)>=0)
269 m_d->attachSep->removeChild(
m_d->sep);
SoPolyhedron is an Inventor encapsulation of the HepPolyedron class written by E.Chernyaev.
VP1HelperClassBase(IVP1System *sys=0, QString helpername="")
void messageVerbose(const QString &) const
void createLetterCData(std::vector< double > &x, std::vector< double > &y)
void normalizeLetterData(std::vector< double > &x, std::vector< double > &y, double yheight)
void ensureInit3DObjects()
void createLetterAData(std::vector< double > &x, std::vector< double > &y)
Imp(VP1Letters *, SoMaterial *mat, SoSeparator *attachsep)
SoNode * createLetter(const std::vector< double > &x, const std::vector< double > &y)
VP1Letters(SoMaterial *mat, SoSeparator *attachsep, IVP1System *sys, QObject *parent=0)
void setZPos(const double &)
void setVerticalPosition(const double &)
void reverse(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of reverse for DataVector/List.