42 int nNumberNodes = int(nodes->size());
44 for (
int n = 0 ; n < nNumberNodes ; n++)
52 int nNumberEdges = int(edges->size());
54 for (
int e = 0 ; e < nNumberEdges ; e++)
70 std::vector<CSGEdge*>::iterator iter =
m_Edges.begin();
81 std::vector<CSGNode*>::iterator iter_node =
m_Nodes.begin();
83 while (iter_node !=
m_Nodes.end())
107 return addEdge(nIndex1, nIndex2, -1, -1);
127 return int(
m_Edges.size()) - 1;
132 if (nNode == nAdjacency)
134 printf(
"Error: adding node as adjacenca\n");
138 bool bPresent =
false;
192 infile >> nNumberNodes;
195 for (
int n = 0 ; n < nNumberNodes ; n++)
202 infile >> nNumberEdges;
204 for (
int e = 0 ; e < nNumberEdges ; e++)
210 catch (std::istream::failure&)
212 printf(
"ERROR: failed to write FeatureGraph to file\n");
232 if (
addNode(pNewNode) != nIndex)
234 printf(
"Error input file inconsistent\n");
245 int nIndex1, nIndex2, nLeftFace, nRightFace;
251 infile >> nRightFace;
253 addEdge(nIndex1, nIndex2, nLeftFace, nRightFace);
262 int nNumberNodes = int(
m_Nodes.size());
264 outfile << nNumberNodes << std::endl;
267 for (
int n = 0 ; n < nNumberNodes ; n++)
273 int nNumberEdges = int(
m_Edges.size());
274 outfile << nNumberEdges << std::endl;
276 for (
int e = 0 ; e < nNumberEdges ; e++)
282 catch (std::ostream::failure&)
284 printf(
"ERROR: failed to write FeatureGraph to file\n");
295 outfile << pCurrentNode->
getIndex() << std::endl;
299 outfile << std::endl;
306 outfile << pCurrentEdge->
nIndex1 <<
" ";
307 outfile << pCurrentEdge->
nIndex2 <<
" ";
309 outfile << pCurrentEdge->
nLeftFace <<
" ";
312 outfile << std::endl;