1 /*******************************************************************************
2 Copyright (c) 2012, Jonathan Hiller
3 
4 This file is part of the AMF Tools suite. http://amf.wikispaces.com/
5 AMF Tools is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6 AMF Tools 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 Lesser General Public License for more details.
7 See <http://www.opensource.org/licenses/lgpl-3.0.html> for license details.
8 *******************************************************************************/
9 
10 #ifndef NVERTICES_H
11 #define NVERTICES_H
12 
13 #include<string>
14 #include<vector>
15 #include "nVertex.h"
16 #include "nEdge.h"
17 
18 //class nVertex;
19 ///class nEdge;
20 class CXmlStreamWrite;
21 class CXmlStreamRead;
22 
23 
24 class nVertices
25 {
26 public:
27 	nVertices(void);
28 	~nVertices(void);
nVertices(const nVertices & In)29 	nVertices(const nVertices& In) {*this = In;} //copy constructor
30 	nVertices& operator=(const nVertices& In); //overload Equals
31 	void Clear(void); //clears all data
32 
33 	//XML read/write
34 	bool WriteXML(CXmlStreamWrite* pXML, std::string* pMessage = 0, bool* pCancelFlag = 0);
35 	bool ReadXML(CXmlStreamRead* pXML, nAmf* pAmf, bool StrictLoad=true, std::string* pMessage = 0, bool* pCancelFlag = 0);
36 	bool CheckValid(nAmf* pAmf, bool FixNode=true, std::string* pMessage = 0);
37 
38 	//required tags
39 	std::vector<nVertex> VertexList;
40 
41 	//optional tags
42 	std::vector<nEdge> EdgeList;
43 
44 	//utilities
GetNumVertices(void)45 	int GetNumVertices(void){return VertexList.size();}
GetNumEdges(void)46 	int GetNumEdges(void){return EdgeList.size();}
AddVertex(nVertex & VIn)47 	int AddVertex(nVertex& VIn){VertexList.push_back(VIn); return VertexList.size()-1;} //returns index
AddEdge(nEdge & EIn)48 	int AddEdge(nEdge& EIn){EdgeList.push_back(EIn); return EdgeList.size()-1;} //returns index
49 	void Translate(double dx, double dy, double dz);
50 	void Rotate(double rx, double ry, double rz); //rotates about origin
51 	//RotateQuat
52 	//RotateAngleAxis
53 
54 
55 
56 };
57 
58 #endif //NVERTICES_H
59