Closed GoogleCodeExporter closed 9 years ago
How do you "save as file"? What format and how?
And what other software did you use for opening that file?
Which entity is added twice (entity ID)?
Original comment by fabian.g...@gmail.com
on 21 Aug 2014 at 12:20
I saved it as a file using osgDB::writeNodeFile( <group>, <something.3ds> ) to
save it as a .3ds file and open using 3D Studio Max.
Actually when I use osg::NodeVisitor to print all the names of the osg nodes
IfcPlusPlus generates, I am seeing the beams twice; and when I try to rename
one of the beams using osg::Object's setName(), two beams are being renamed.
All the beams (IfcBeams class) are being saved twice. e.g. #171514.
FYI, this IFC file is exported from Autodesk Revit from a revit file someone
gave me.
Original comment by lizhi...@gmail.com
on 21 Aug 2014 at 3:56
Beams normally have more than one representation, for example one solid and one
curve representation.
The curves are added to a separate switch, so that it can be switched on and
off.
If you look into the osg file, you can see that the second node for one product
has only lines as PrimitiveSets.
Original comment by fabian.g...@gmail.com
on 21 Aug 2014 at 4:37
I took some time to look at the .osg file saved this way and indeed they are
represented as switches, and under the switch there are a solid one and one
named CurveRepresentation. But if you search the .osg file you can see "Use
Switch_##" (where ## is the UniqueID of one of the Switch for the IfcBeams. I
believe this means that the same node (reference) is added here in addition to
the first one.
You can use this piece of code to print the names of all the nodes in the osg
graph, and you can see they are printed twice:
#include <osg/NodeVisitor>
#include <osg/Node>
class coutNameVisitor : public osg::NodeVisitor
{
public:
coutNameVisitor() :osg::NodeVisitor( // Traverse all children.
osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
{}
virtual void apply(osg::Node &searchNode)
{
std::string id;
id = searchNode.getName();
if (id.length() > 0)
std::cout << id << std::endl;
// keep traversing
traverse(searchNode);
}
};
//// then in main():
coutNameVisitor printvisitor;
group_->accept(printvisitor);
It might be because in IfcPlusPlusGeometry, ReaderWriterIFC.cpp, the code
parent_group->addChild( item_grp );
in both Line 218 and Line 532 are both executed for the IfcBeam, since they may
have both curve and solid representations.
Original comment by lizhi...@gmail.com
on 21 Aug 2014 at 10:10
By printed twice I mean both the switch and its CurveRepresentation are printed
twice.
Original comment by lizhi...@gmail.com
on 21 Aug 2014 at 10:12
Attachments:
I changed the way the items are added to the product group, that should fix
this issue.
Original comment by fabian.g...@gmail.com
on 19 Sep 2014 at 8:19
Original issue reported on code.google.com by
lizhi...@gmail.com
on 20 Aug 2014 at 7:09