17 ReaderWriter::getStringValue(filename, pParametersNode,
"FileName");
19 if (
findXMLNode(pParametersNode,
"UseEmbeddedGeometry")) {
20 useEG = ReaderWriter::getBoolValue(pParametersNode,
"UseEmbeddedGeometry");
28 virtual void init(osgUtil::LineSegmentIntersector::Intersection* intersection,
33 std::vector<osg::ref_ptr<WG_Wall> >* walls,
34 std::vector<osg::ref_ptr<WG_Point> >* points,
35 osg::Geode* pOSGGeode,
36 osg::Vec3Array* pOSGVertexArray) {
43 XMLString::transcode(
"Range", tempStr, 99);
44 XERCES_CPP_NAMESPACE_QUALIFIER DOMText* TextNode;
45 DOMImplementation* Impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
48 XMLString::transcode(
"VreckoRoomEditModel", tempStr, 99);
49 XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* Document = Impl->createDocument(0, tempStr, 0);
50 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Root = Document->getDocumentElement();
53 XMLString::transcode(
"WallGeometry", tempStr, 99);
54 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement*
WallGeometry = Document->createElement(tempStr);
55 Root->appendChild(WallGeometry);
58 XMLString::transcode(
"Points", tempStr, 99);
59 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Points = Document->createElement(tempStr);
60 Root->appendChild(Points);
64 XMLString::transcode(
"PointsCount", tempStr, 99);
65 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* PointsCount = Document->createElement(tempStr);
66 Points->appendChild(PointsCount);
67 sprintf(tempChar,
"%d", points->size());
68 XMLString::transcode(tempChar, tempStr, 99);
69 TextNode = Document->createTextNode(tempStr);
70 PointsCount->appendChild(TextNode);
72 for (
unsigned int i = 0; i < points->size(); i++) {
74 WG_Point* CurrentPoint = points->at(i).get();
76 XMLString::transcode(
"Point", tempStr, 99);
77 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Point = Document->createElement(tempStr);
78 Points->appendChild(Point);
81 XMLString::transcode(
"Position", tempStr, 99);
82 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Position = Document->createElement(tempStr);
83 Point->appendChild(Position);
85 XMLString::transcode(tempChar, tempStr, 99);
86 TextNode = Document->createTextNode(tempStr);
87 Position->appendChild(TextNode);
89 XMLString::transcode(
"Height", tempStr, 99);
90 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Height = Document->createElement(tempStr);
91 Point->appendChild(Height);
92 sprintf(tempChar,
"%f", CurrentPoint->
getHeight());
93 XMLString::transcode(tempChar, tempStr, 99);
94 TextNode = Document->createTextNode(tempStr);
95 Height->appendChild(TextNode);
97 XMLString::transcode(
"Id", tempStr, 99);
98 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Id = Document->createElement(tempStr);
99 Point->appendChild(Id);
100 sprintf(tempChar,
"%d", CurrentPoint->
getId());
101 XMLString::transcode(tempChar, tempStr, 99);
102 TextNode = Document->createTextNode(tempStr);
103 Id->appendChild(TextNode);
107 XMLString::transcode(
"Walls", tempStr, 99);
108 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Walls = Document->createElement(tempStr);
109 Root->appendChild(Walls);
112 XMLString::transcode(
"WallsCount", tempStr, 99);
113 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* WallsCount = Document->createElement(tempStr);
114 Walls->appendChild(WallsCount);
115 sprintf(tempChar,
"%d", walls->size());
116 XMLString::transcode(tempChar, tempStr, 99);
117 TextNode = Document->createTextNode(tempStr);
118 WallsCount->appendChild(TextNode);
120 for (
unsigned int j = 0; j < walls->size(); j++) {
121 WG_Wall* currentWall = walls->at(j).get();
125 XMLString::transcode(
"Wall", tempStr, 99);
126 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* Wall = Document->createElement(tempStr);
127 Walls->appendChild(Wall);
130 XMLString::transcode(
"QPoint", tempStr, 99);
131 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QPoint = Document->createElement(tempStr);
132 Wall->appendChild(QPoint);
136 XMLString::transcode(
"Id", tempStr, 99);
137 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QId = Document->createElement(tempStr);
138 QPoint->appendChild(QId);
139 sprintf(tempChar,
"%d", Q->
getId());
140 XMLString::transcode(tempChar, tempStr, 99);
141 TextNode = Document->createTextNode(tempStr);
142 QId->appendChild(TextNode);
145 XMLString::transcode(
"Color", tempStr, 99);
146 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QColor = Document->createElement(tempStr);
147 QPoint->appendChild(QColor);
149 XMLString::transcode(tempChar, tempStr, 99);
150 TextNode = Document->createTextNode(tempStr);
151 QColor->appendChild(TextNode);
155 XMLString::transcode(
"tCWV", tempStr, 99);
156 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QtCWV = Document->createElement(tempStr);
157 QPoint->appendChild(QtCWV);
159 XMLString::transcode(tempChar, tempStr, 99);
160 TextNode = Document->createTextNode(tempStr);
161 QtCWV->appendChild(TextNode);
164 XMLString::transcode(
"tCCWV", tempStr, 99);
165 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QtCCWV = Document->createElement(tempStr);
166 QPoint->appendChild(QtCCWV);
168 XMLString::transcode(tempChar, tempStr, 99);
169 TextNode = Document->createTextNode(tempStr);
170 QtCCWV->appendChild(TextNode);
173 XMLString::transcode(
"bCWV", tempStr, 99);
174 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QbCWV = Document->createElement(tempStr);
175 QPoint->appendChild(QbCWV);
177 XMLString::transcode(tempChar, tempStr, 99);
178 TextNode = Document->createTextNode(tempStr);
179 QbCWV->appendChild(TextNode);
182 XMLString::transcode(
"bCCWV", tempStr, 99);
183 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QbCCWV = Document->createElement(tempStr);
184 QPoint->appendChild(QbCCWV);
186 XMLString::transcode(tempChar, tempStr, 99);
187 TextNode = Document->createTextNode(tempStr);
188 QbCCWV->appendChild(TextNode);
192 XMLString::transcode(
"nCWV", tempStr, 99);
193 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QnCWV = Document->createElement(tempStr);
194 QPoint->appendChild(QnCWV);
196 XMLString::transcode(tempChar, tempStr, 99);
197 TextNode = Document->createTextNode(tempStr);
198 QnCWV->appendChild(TextNode);
201 XMLString::transcode(
"nCCWV", tempStr, 99);
202 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* QnCCWV = Document->createElement(tempStr);
203 QPoint->appendChild(QnCCWV);
205 XMLString::transcode(tempChar, tempStr, 99);
206 TextNode = Document->createTextNode(tempStr);
207 QnCCWV->appendChild(TextNode);
213 XMLString::transcode(
"RPoint", tempStr, 99);
214 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RPoint = Document->createElement(tempStr);
215 Wall->appendChild(RPoint);
219 XMLString::transcode(
"Id", tempStr, 99);
220 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RId = Document->createElement(tempStr);
221 RPoint->appendChild(RId);
222 sprintf(tempChar,
"%d", R->
getId());
223 XMLString::transcode(tempChar, tempStr, 99);
224 TextNode = Document->createTextNode(tempStr);
225 RId->appendChild(TextNode);
228 XMLString::transcode(
"Color", tempStr, 99);
229 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RColor = Document->createElement(tempStr);
230 RPoint->appendChild(RColor);
232 XMLString::transcode(tempChar, tempStr, 99);
233 TextNode = Document->createTextNode(tempStr);
234 RColor->appendChild(TextNode);
238 XMLString::transcode(
"tCWV", tempStr, 99);
239 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RtCWV = Document->createElement(tempStr);
240 RPoint->appendChild(RtCWV);
242 XMLString::transcode(tempChar, tempStr, 99);
243 TextNode = Document->createTextNode(tempStr);
244 RtCWV->appendChild(TextNode);
247 XMLString::transcode(
"tCCWV", tempStr, 99);
248 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RtCCWV = Document->createElement(tempStr);
249 RPoint->appendChild(RtCCWV);
251 XMLString::transcode(tempChar, tempStr, 99);
252 TextNode = Document->createTextNode(tempStr);
253 RtCCWV->appendChild(TextNode);
256 XMLString::transcode(
"bCWV", tempStr, 99);
257 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RbCWV = Document->createElement(tempStr);
258 RPoint->appendChild(RbCWV);
260 XMLString::transcode(tempChar, tempStr, 99);
261 TextNode = Document->createTextNode(tempStr);
262 RbCWV->appendChild(TextNode);
265 XMLString::transcode(
"bCCWV", tempStr, 99);
266 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RbCCWV = Document->createElement(tempStr);
267 RPoint->appendChild(RbCCWV);
269 XMLString::transcode(tempChar, tempStr, 99);
270 TextNode = Document->createTextNode(tempStr);
271 RbCCWV->appendChild(TextNode);
274 XMLString::transcode(
"nCWV", tempStr, 99);
275 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RnCWV = Document->createElement(tempStr);
276 RPoint->appendChild(RnCWV);
278 XMLString::transcode(tempChar, tempStr, 99);
279 TextNode = Document->createTextNode(tempStr);
280 RnCWV->appendChild(TextNode);
283 XMLString::transcode(
"nCCWV", tempStr, 99);
284 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* RnCCWV = Document->createElement(tempStr);
285 RPoint->appendChild(RnCCWV);
287 XMLString::transcode(tempChar, tempStr, 99);
288 TextNode = Document->createTextNode(tempStr);
289 RnCCWV->appendChild(TextNode);
295 XMLString::transcode(
"topNormal", tempStr, 99);
296 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* topNormal = Document->createElement(tempStr);
297 Wall->appendChild(topNormal);
299 XMLString::transcode(tempChar, tempStr, 99);
300 TextNode = Document->createTextNode(tempStr);
301 topNormal->appendChild(TextNode);
303 XMLString::transcode(
"bottomNormal", tempStr, 99);
304 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* bottomNormal = Document->createElement(tempStr);
305 Wall->appendChild(bottomNormal);
307 XMLString::transcode(tempChar, tempStr, 99);
308 TextNode = Document->createTextNode(tempStr);
309 bottomNormal->appendChild(TextNode);
311 XMLString::transcode(
"qrNormal", tempStr, 99);
312 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* qrNormal = Document->createElement(tempStr);
313 Wall->appendChild(qrNormal);
315 XMLString::transcode(tempChar, tempStr, 99);
316 TextNode = Document->createTextNode(tempStr);
317 qrNormal->appendChild(TextNode);
319 XMLString::transcode(
"rqNormal", tempStr, 99);
320 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* rqNormal = Document->createElement(tempStr);
321 Wall->appendChild(rqNormal);
323 XMLString::transcode(tempChar, tempStr, 99);
324 TextNode = Document->createTextNode(tempStr);
325 rqNormal->appendChild(TextNode);
331 DOMWriter* Serializer = ((DOMImplementationLS*)Impl)->createDOMWriter();
333 F = (filename.c_str());
334 XMLFormatTarget *MyFormTarget =
new LocalFileFormatTarget(F);
335 Serializer->writeNode(MyFormTarget, *Document);
340 Serializer->release();
346 std::string filename;