Example #1
0
void PlygonDrawer::resetGraph() {
	GraphNodeVisitorGraph grp_vis;
	for (grp_vis.begin(m_graph->m_rows, m_graph->m_cols); ! grp_vis.end(); ++grp_vis)
		if (m_graph->check_bdy_enable(grp_vis.m_ptCur)) {
			GraphNode* pNode = m_graph->get_node(grp_vis.m_ptCur);
			auto categ = pNode->get_category();
			categ.spec  = CHESS_CATEGORY_NORM;
			categ.color = (enNodeColor)(rand()%NODE_COLOR_SPEC);
			m_tileMap->changeCell(grp_vis.m_ptCur, &categ);
			pNode->set_category(categ);
		}
}
Example #2
0
void PlygonDrawer::clrGraph() {
	GraphNodeVisitorGraph grp_vis;
	for (grp_vis.begin(m_graph->m_rows, m_graph->m_cols); ! grp_vis.end(); ++grp_vis)
		if (m_graph->check_bdy_enable(grp_vis.m_ptCur)) {
			GraphNode* pNode = m_graph->get_node(grp_vis.m_ptCur);
			auto categ = pNode->get_category();
			if(categ.spec != enBeadCategory::CHESS_CATEGORY_NORM && categ.spec != enBeadCategory::CHESS_CATEGORY_DOUBLE) {
				auto categ_new  = categ;
				categ_new.spec  = enBeadCategory::CHESS_CATEGORY_NORM;
				if (categ_new.color == enNodeColor::NODE_COLOR_SPEC) {
					categ_new.color = (enNodeColor)(rand()%enNodeColor::NODE_COLOR_SPEC);
				}
				pNode->set_category(categ_new);

				m_tileMap->changeCell(grp_vis.m_ptCur, &categ_new);
			}
		}
}