summaryrefslogtreecommitdiff
path: root/CSXCAD/src/CSPropDumpBox.h
blob: 424be2ba136bfe11dcabf0346436752f957ba339 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
*	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 "CSPropProbeBox.h"


//! Continuous Structure Dump Property
/*!
  This Property defines an area (box) designated for field dumps.
  */
class CSXCAD_EXPORT CSPropDumpBox : public CSPropProbeBox
{
public:
	CSPropDumpBox(ParameterSet* paraSet);
	CSPropDumpBox(CSProperties* prop);
	CSPropDumpBox(unsigned int ID, ParameterSet* paraSet);
	virtual ~CSPropDumpBox();

	//! Get PropertyType as a xml element name \sa PropertyType and GetType
	virtual const std::string GetTypeXMLString() const {return std::string("DumpBox");}

	//! Define an arbitrary dump-type \sa GetDumpType
	void SetDumpType(int type) {DumpType=type;}
	//! Get the arbitrary dump-type \sa SetDumpType
	int GetDumpType() {return DumpType;}

	//! Define an arbitrary dump-mode \sa GetDumpMode
	void SetDumpMode(int mode) {DumpMode=mode;}
	//! Get the arbitrary dump-mode \sa SetDumpMode
	int GetDumpMode() {return DumpMode;}

	//! Define an arbitrary file-type \sa GetFileType
	void SetFileType(int ftype) {FileType=ftype;}
	//! Get the arbitrary file-type \sa SetFileType
	int GetFileType() {return FileType;}

	//! Set the multi grid level to use (default is 0) \sa GetMultiGridLevel
	void SetMultiGridLevel(int mgl) {MultiGridLevel=mgl;}
	//! Get the multi grid level to use \sa SetMultiGridLevel
	int GetMultiGridLevel() {return MultiGridLevel;}

	bool GetSubSampling() {return m_SubSampling;}
	void SetSubSampling(bool val) {m_SubSampling=val;}
	void SetSubSampling(int ny, unsigned int val);
	void SetSubSampling(unsigned int val[]);
	void SetSubSampling(const char* vals);
	unsigned int GetSubSampling(int ny);

	//! Get status of opt resolution flag
	bool GetOptResolution() {return m_OptResolution;}
	//! Set status of opt resolution flag
	void SetOptResolution(bool val) {m_OptResolution=val;}
	//! Set the opt resoultion for a given direction
	void SetOptResolution(int ny, double val);
	//! Set the opt resoultion for all directions
	void SetOptResolution(double val[]);
	//! Set the opt resoultion for all directions as string
	void SetOptResolution(const char* vals);
	//! Get the optimal resolution for a given direction
	double GetOptResolution(int ny);

	virtual bool Write2XML(TiXmlNode& root, bool parameterised=true, bool sparse=false);
	virtual bool ReadFromXML(TiXmlNode &root);

	virtual void Init();

	virtual void ShowPropertyStatus(std::ostream& stream);

protected:
	int DumpType;
	int DumpMode;
	int FileType;
	int MultiGridLevel;

	//sub-sampling
	bool m_SubSampling;
	unsigned int SubSampling[3];

	//sub-sampling
	bool m_OptResolution;
	double OptResolution[3];
};