Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_material.h
Go to the documentation of this file.
1 /*
2 Copyright 2010-2014 Pierre SMARS (smars@yuntech.edu.tw)
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 2 of the License, or
6 (at your option) any later version.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #ifndef _A_MATERIAL_H_
17 #define _A_MATERIAL_H_
18 
19 #include <iostream>
20 #include <sstream>
21 #include <string>
22 
24 {
25 public:
26  a_material() : ref_(-1), density_(0.), name_("noname") {};
27  a_material(const a_material& m) : ref_(m.ref()), density_(m.density()), name_(m.name()) {};
28  a_material(const std::string& name, double density) : ref_(-1), density_(density), name_(name) {};
30  static const std::string help();
31  void ref(const int ref) {ref_ = ref;}
32  int ref() const {return ref_;}
33  void density(const double density) {density_ = density;}
34  double density() const {return density_;}
35  void name(const std::string name) {name_ = name;}
36  std::string name() const {return name_;}
37 
38  //: input/output
39  virtual void read(std::istream &i);
40  virtual void write(std::ostream &o) const;
41 
42 protected:
43  int ref_;
44  double density_;
45  std::string name_;
46 };
47 
48 
49 std::istream& operator>> (std::istream& i, a_material& m);
50 std::ostream& operator<< (std::ostream& o, const a_material& m);
51 std::istream& operator>> (std::istream& i, a_material* m);
52 std::ostream& operator<< (std::ostream& o, const a_material* m);
53 
54 #endif
55 
std::ostream & operator<<(std::ostream &o, const a_material &m)
Definition: a_material.cxx:60
std::istream & operator>>(std::istream &i, a_material &m)
Definition: a_material.cxx:54
std::string name() const
Definition: a_material.h:36
void ref(const int ref)
Definition: a_material.h:31
virtual void read(std::istream &i)
Definition: a_material.cxx:36
double density() const
Definition: a_material.h:34
double density_
Definition: a_material.h:44
void name(const std::string name)
Definition: a_material.h:35
a_material(const std::string &name, double density)
Definition: a_material.h:28
static const std::string help()
get information about the class
Definition: a_material.cxx:18
int ref() const
Definition: a_material.h:32
std::string name_
Definition: a_material.h:45
virtual void write(std::ostream &o) const
Definition: a_material.cxx:48
void density(const double density)
Definition: a_material.h:33
a_material(const a_material &m)
Definition: a_material.h:27