view src/SearchGeodeVisitor.cpp @ 10:5727d511a13a

add src in Martial Project Xcode.
author tokumoritaichirou@nw0743.st.ie.u-ryukyu.ac.jp
date Wed, 03 Feb 2010 03:39:04 +0900
parents
children
line wrap: on
line source

/*
 *  SearchGeodeVisitor.cpp
 *  Martial
 *
 *  Created by ryoma on 10/01/31.
 *  Copyright 2010 琉球大学. All rights reserved.
 *
 */

#include "SearchGeodeVisitor.h"

void SearchGeodeVisitor::apply(osg::Geode& Geode) {
	//ここでつまづいた。 char* と std::string の比較はfalse
	if (Geode.getName() == targetGeodeName) {
		std::cout << "success geode!!\n";
		targetGeode = &Geode;
	} else {
		std::cout << "false " << Geode.getName() << "\n";
		traverse(Geode);
	}
}

void SearchGeodeVisitor::setSearchGeodeName(const std::string &_targetGeodeName) {
	targetGeodeName = _targetGeodeName;
}

osg::Geode* SearchGeodeVisitor::getGeode() {
	return targetGeode;
}