Base: refactor InventorBuilder

This commit is contained in:
wmayer
2022-12-09 14:43:59 +01:00
parent 6165144f6e
commit f2f9df6d39
2 changed files with 42 additions and 0 deletions

View File

@@ -546,6 +546,33 @@ void PolygonOffsetItem::write(InventorOutput& out) const
// -----------------------------------------------------------------------------
Coordinate3Item::Coordinate3Item(const std::vector<Vector3f>& points)
: points(points)
{
}
void Coordinate3Item::write(InventorOutput& out) const
{
beginPoint(out);
InventorFieldWriter writer;
writer.write<Vector3f>("point", points, out);
endPoint(out);
}
void Coordinate3Item::beginPoint(InventorOutput& out) const
{
out.writeLine("Coordinate3 {");
out.increaseIndent();
}
void Coordinate3Item::endPoint(InventorOutput& out) const
{
out.decreaseIndent();
out.writeLine("}");
}
// -----------------------------------------------------------------------------
void PointSetItem::write(InventorOutput& out) const
{
out.writeLine("PointSet { }");

View File

@@ -354,6 +354,21 @@ private:
PolygonOffset offset;
};
/*!
* \brief The Coordinate3Item class supports the SoCoordinate3 node.
*/
class BaseExport Coordinate3Item : public NodeItem
{
public:
Coordinate3Item(const std::vector<Vector3f>& points);
void write(InventorOutput& out) const override;
private:
void beginPoint(InventorOutput& out) const;
void endPoint(InventorOutput& out) const;
std::vector<Vector3f> points;
};
/*!
* \brief The PointSetItem class supports the SoPointSet node.
*/