Core Scene Graph Data Structures in C++


Shape

The Group node and all its subclasses constitute the parent nodes of the scene graph tree structure. At the leaves of the tree structure only Shape nodes are allowed. In addition to Group nodes and the Group subclasses, Shape nodes are also allowed to be children of the Group nodes. No other node type is allowed to be a child of a Group node. As described in the VRML'97 Standard, a Shape node has two fields, appearance, and geometry, and both fields may contain NULL pointers.

class Shape : public Node {
  public:
                        Shape();
    virtual            ~Shape();
    void                setAppearance(Node* node);
    Node*               getAppearance();
    bool                hasAppearanceNone();
    bool                hasAppearanceMaterial();
    bool                hasAppearanceImageTexture();
    bool                hasAppearanceUnsupported();
    void                setGeometry(Node* node);
    Node*               getGeometry();
    bool                hasGeometryNull();
    bool                hasGeometryIndexedFaceSet();
    bool                hasGeometryIndexedLineSet();
    bool                hasGeometryUnsupported();
    virtual bool        isShape() const;
    virtual string      getType() const;
};