summaryrefslogtreecommitdiff
path: root/CSXCAD/src/CSPrimPolyhedronReader.h
blob: 60e8c527cedea2163a7b449d994701868096f7d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
*	Copyright (C) 2008-2012 Thorsten Liebig (Thorsten.Liebig@gmx.de)
*
*	This program 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.
*
*	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 Lesser General Public License for more details.
*
*	You should have received a copy of the GNU Lesser General Public License
*	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "CSPrimitives.h"
#include "CSPrimPolyhedron.h"

//! STL/PLY import primitive
class CSXCAD_EXPORT CSPrimPolyhedronReader : public CSPrimPolyhedron
{
public:
	//! Import file type
	enum FileType
	{
		UNKNOWN, STL_FILE, PLY_FILE
	};

	CSPrimPolyhedronReader(ParameterSet* paraSet, CSProperties* prop);
	CSPrimPolyhedronReader(CSPrimPolyhedronReader* primPHReader, CSProperties *prop=NULL);
	CSPrimPolyhedronReader(unsigned int ID, ParameterSet* paraSet, CSProperties* prop);
	virtual ~CSPrimPolyhedronReader();

	virtual CSPrimPolyhedronReader* GetCopy(CSProperties *prop=NULL) {return new CSPrimPolyhedronReader(this,prop);}

	virtual void SetFilename(std::string name) {m_filename=name;}
	virtual std::string GetFilename() const {return m_filename;}

	virtual void SetFileType(FileType ft) {m_filetype=ft;}
	virtual FileType GetFileType() const {return m_filetype;}

	virtual bool Update(std::string *ErrStr=NULL);
	virtual bool Write2XML(TiXmlElement &elem, bool parameterised=true);
	virtual bool ReadFromXML(TiXmlNode &root);

	virtual bool ReadFile();

protected:
	std::string m_filename;
	FileType m_filetype;
};