Skip to content

Commit e140c7b

Browse files
committed
Minor update
1 parent a282005 commit e140c7b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/rl/sg/XmlFactory.cpp

+10-6
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ namespace rl
8282

8383
for (int i = 0; i < ::std::min(1, scenes.size()); ++i)
8484
{
85+
::rl::xml::Path path(document, scenes[i]);
86+
8587
::SoInput input;
8688

8789
if (!input.openFile(scenes[i].getLocalPath(scenes[i].getProperty("href")).c_str() ,true))
@@ -102,7 +104,7 @@ namespace rl
102104

103105
// model
104106

105-
::rl::xml::NodeSet models = ::rl::xml::Path(document, scenes[i]).eval("model").getValue<::rl::xml::NodeSet>();
107+
::rl::xml::NodeSet models = path.eval("model").getValue<::rl::xml::NodeSet>();
106108

107109
for (int j = 0; j < models.size(); ++j)
108110
{
@@ -127,6 +129,8 @@ namespace rl
127129

128130
for (int k = 0; k < bodies.size(); ++k)
129131
{
132+
::rl::xml::Path path(document, bodies[k]);
133+
130134
::SoSearchAction bodySearchAction;
131135
bodySearchAction.setName(bodies[k].getProperty("name").c_str());
132136
bodySearchAction.apply(static_cast<::SoFullPath*>(modelSearchAction.getPath())->getTail());
@@ -199,17 +203,17 @@ namespace rl
199203

200204
for (int l = 0; l < shapeSearchAction.getPaths().getLength(); ++l)
201205
{
202-
::SoFullPath* path = static_cast<::SoFullPath*>(shapeSearchAction.getPaths()[l]);
206+
::SoFullPath* fullPath = static_cast<::SoFullPath*>(shapeSearchAction.getPaths()[l]);
203207

204-
if (path->getLength() > 1)
208+
if (fullPath->getLength() > 1)
205209
{
206-
path = static_cast<::SoFullPath*>(shapeSearchAction.getPaths()[l]->copy(1, static_cast<::SoFullPath*>(shapeSearchAction.getPaths()[l])->getLength() - 1));
210+
fullPath = static_cast<::SoFullPath*>(shapeSearchAction.getPaths()[l]->copy(1, static_cast<::SoFullPath*>(shapeSearchAction.getPaths()[l])->getLength() - 1));
207211
}
208212

209-
pathList.append(path);
213+
pathList.append(fullPath);
210214

211215
::SoGetMatrixAction shapeGetMatrixAction(viewportRegion);
212-
shapeGetMatrixAction.apply(path);
216+
shapeGetMatrixAction.apply(fullPath);
213217
::SbMatrix shapeMatrix = shapeGetMatrixAction.getMatrix();
214218

215219
if (!scene->isScalingSupported())

0 commit comments

Comments
 (0)