// __author__ = Juan Carlos De Abreu (jcabreur@gmail.com)
// 
// This file define an interface for the scene nodes.
//
// All classes that will be inherent of this one must be implement the methods
// apply and copy, the first is called to update the scene tree in each render
// and the second allow create a clon of the node.
// Each node must create the instance with the property value for the type.
//
// An use of this class can be to have a interface to manipulate a set of 
// different scene nodes, i.e.;
// std::vector< SmartPointer<ISceneNode> > scene_nodes;
// scene_nodes.push_back(new RotateNode(90, 1, 0, 0));
// scene_nodes.push_back(new TranslateNode(1, 1, 1));
// scene_nodes.push_back(new LightNode());
// const int kNumberOfSceneNodes = static_cast<int>(scene_nodes.size());
// for (int i = 0; i < kNumberOfSceneNodes; ++i)
//   scene_nodes[i]->apply();

#ifndef SCENE_SCENE_NODE_H__
#define SCENE_SCENE_NODE_H__

#include "../../global.h"
#include "../../Base/Memory/MMObject.h"
#include "../../Base/Memory/SmartPointer.h"

BEGIN_TEG_NAMESPACE();

class ISceneNode : public IMMObject {
 public:
  // Node types.
  enum {
    SCALE_NODE = 1,
    ROTATE_NODE = 2,
    TRANSLATE_NODE = 4,
    TRANSFORMATION_NODE = 7,
    GROUP_NODE = 8,
    LIGHT_NODE = 16,
    GEOMETRY_NODE = 32
  };

  // SceneNode constructor and destructor.
  ISceneNode(int type);
  virtual ~ISceneNode();

  // Accessor and mutator methods to ISceneNode attributes.
  inline int type() const { return type_; }

  // Methods.
  virtual void apply() = 0;
  virtual SmartPointer<ISceneNode> copy() = 0;

 private:
  // ISceneNode attributes, node type.
  int type_;
  DISALLOW_COPY_AND_ASSIGN(ISceneNode);
};

END_TEG_NAMESPACE();

#endif  // SCENE_SCENE_NODE_H__
