Points&Forces (core)
Software tools facilitating the task of surveying architecture
a_text.h
Go to the documentation of this file.
1 /*
2  Copyright 2010-2012 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 _VE_TEXT_H_
17 #define _VE_TEXT_H_
18 
19 // .NAME a_text
20 // .PORTABILITY : ansi C++
21 // .SECTION Author
22 // Pierre Smars
23 
24 #include <iostream>
25 #include "a_text_base.h"
26 #include "a_unit_system.h"
27 #include "a_point.h"
28 
30 class a_text: public a_text_base
31 {
32  public:
33  a_text();
34  a_text(const a_text& text);
35  ~a_text();
36  virtual const std::string classname() {return "a_text";};
37  static const std::string help();
38  void file(const std::string& file);
39  std::ostream * file() const {return file_;}
40  bool use_user_unit() const {return use_user_unit_;}
41  void use_user_unit(const bool val) {use_user_unit_ = val;}
42  void user_unit(a_unit_system& unit) {user_unit_ = &unit;}
44  void on() {on_ = true;}
45  void off() {on_ = false;}
46  void dimension(int dim) {if ((dim>0)&&(dim<3)) dimension_ = dim;}
47  int dimension() const {return dimension_;}
48  void endl(bool ret) {endl_ = ret ? OS_endl_ : "";}
49  void flush();
50 
51  a_text& operator<<(const char v);
52  a_text& operator<<(const int v);
53  a_text& operator<<(const float v);
54  a_text& operator<<(const double v);
55  a_text& operator<<(std::string& v);
56  a_text& operator<<(const std::string& v);
57  a_text& operator<<(const a_point& v);
58  a_text& operator<<(std::ostream& (*f) (std::ostream&));
59  protected:
60  std::ostream * file_;
62  bool on_;
63  bool standard_;
66  std::string endl_;
67  std::string OS_endl_;
68  void init();
69 };
70 
71 #endif
a text class
Definition: a_text.h:31
a_unit_system & user_unit()
Definition: a_text.h:43
int dimension_
Definition: a_text.h:65
void endl(bool ret)
Definition: a_text.h:48
virtual const std::string classname()
Definition: a_text.h:36
void dimension(int dim)
Definition: a_text.h:46
a_text()
Definition: a_text.cxx:53
void off()
Definition: a_text.h:45
void use_user_unit(const bool val)
Definition: a_text.h:41
~a_text()
Definition: a_text.cxx:75
bool standard_
Definition: a_text.h:63
std::string OS_endl_
Definition: a_text.h:67
a_unit_system * user_unit_
Definition: a_text.h:61
void flush()
Definition: a_text.cxx:104
bool on_
Definition: a_text.h:62
void init()
Definition: a_text.cxx:20
void user_unit(a_unit_system &unit)
Definition: a_text.h:42
a_text & operator<<(const char v)
Definition: a_text.cxx:110
bool use_user_unit_
Definition: a_text.h:64
std::string endl_
Definition: a_text.h:66
bool use_user_unit() const
Definition: a_text.h:40
int dimension() const
Definition: a_text.h:47
void on()
Definition: a_text.h:44
std::ostream * file() const
Definition: a_text.h:39
std::ostream * file_
Definition: a_text.h:60
static const std::string help()
Definition: a_text.cxx:25
unit system
Definition: a_unit_system.h:34
int val