/*
 * Copyright (C) 2003-2004 Clemens Fuchslocher
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 *
 */

#include <GL/gl.h>
#include <GL/glu.h>

#include <iostream>

#include "Utility.h"
#include "Toolkit.h"
#include "GlActionVisitor.h"
#include "GlCompileSmoothVisitor.h"


namespace nsToolkit {

Toolkit::Toolkit(int argc, char *argv[])
{
	DEBUG_MESSAGE("Toolkit::Toolkit()")

	this->sceneGraph = NULL;
}


Toolkit::~Toolkit(void)
{
	DEBUG_MESSAGE("Toolkit::~Toolkit()")

	delete this->sceneGraph;
}


void Toolkit::setSceneGraph(nsSceneGraph::SceneGraph *sceneGraph)
{
	DEBUG_MESSAGE("Toolkit::setSceneGraph()")

	this->sceneGraph = sceneGraph;
}


nsSceneGraph::SceneGraph *Toolkit::getSceneGraph(void)
{
	DEBUG_MESSAGE("Toolkit::getSceneGraph()")

	return this->sceneGraph;
}


void Toolkit::performSceneGraphAction(nsSceneGraph::SceneGraphVisitor *visitor)
{
	DEBUG_MESSAGE("Toolkit::performSceneGraphAction()")

	if (this->sceneGraph == NULL)
	{
		std::cerr << __FILE__ << '[' << __LINE__ << "]: Toolkit::performSceneGraphAction(): this->sceneGraph isn't initialized." << std::endl;
		return;
	}

	this->sceneGraph->action(visitor);
}


}

