Ion: gfx/node.h Source File
50 const std::string& GetLabel() const { return label_; }
55 state_table_ = state_table;
61 shader_program_ = shader_program;
68 if (block.Get())
69 uniform_blocks_.push_back(block);
72 if (index < uniform_blocks_.size() && block.Get())
73 uniform_blocks_[index] = block;
87 if (shape.Get()) {
94 if (index < shapes_.size() && shape.Get())
100 for (auto it = shapes_.begin(); it != shapes_.end();) {
110 if (index < shapes_.size()) {
111 auto it = shapes_.begin() + index;
124 if (child.Get()) {
126 children_.push_back(child);
131 if (index < children_.size() && child.Get())
138 for (auto it = children_.begin(); it != children_.end();) {
148 if (index < children_.size()) {
149 auto it = children_.begin() + index;
159 ~Node() override;
size_t AddShape(const ShapePtr &shape)
Child node management.
void SetShaderProgram(const ShaderProgramPtr &shader_program)
Shader program management.
base::ReferentPtr< Node >::Type NodePtr
void RemoveChild(const NodePtr &child)
Removes all instances of child from this' children if it is actually a child of this.
const base::AllocVector< NodePtr > & GetChildren() const
void ReplaceUniformBlock(size_t index, const UniformBlockPtr &block)
void RemoveChildAt(size_t index)
Removes the child Node at the passed index if the index is valid.
const size_t kInvalidIndex
kInvalidIndex is a size_t value that is very unlikely to be a valid index.
void SetStateTable(const StateTablePtr &state_table)
StateTable management.
A UniformHolder is a base class for an object that holds Uniforms.
void ReplaceShape(size_t index, const ShapePtr &shape)
const ShaderProgramPtr & GetShaderProgram() const
void RemoveShape(const ShapePtr &shape)
Removes all instances of the shape if it is contained in this' shapes.
const base::AllocVector< UniformBlockPtr > & GetUniformBlocks() const
void RemoveShapeAt(size_t index)
Removes the Shape at the passed index if the index is valid.
const StateTablePtr & GetStateTable() const
Thread-safe abstract base class.
const base::AllocVector< ShapePtr > & GetShapes() const
void SetLabel(const std::string &label)
void ReplaceChild(size_t index, const NodePtr &child)
size_t AddChild(const NodePtr &child)
Child node management.
const std::string & GetLabel() const
Returns/sets the label of this.
A Node instance represents a node in a scene graph.
void AddUniformBlock(const UniformBlockPtr &block)
UniformBlock management.
void ClearUniformBlocks()
This class can be used in place of std::vector to allow an Ion Allocator to be used for memory alloca...