-
Notifications
You must be signed in to change notification settings - Fork 0
/
text3d.h
77 lines (63 loc) · 2.62 KB
/
text3d.h
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
/***************************************************************************
text3d.h - description
-------------------
begin : Tue Sep 5 2000
copyright : (C) 2000 by Anthony Liekens
email : mooby@alife.org
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TEXT3D_H
#define TEXT3D_H
#include <string>
#include "text.h"
#include "object3d.h"
#include "coordinate3d.h"
/**This class handles text objects. This class is derived from {@link Object Object}.
*@author Anthony Liekens
*/
class Text3D : public Object3D {
protected:
Text::TextJustifications justification;
Coordinate3D *place;
std::string contents;
public:
/**Constructor. Constructs a text object
*/
Text3D();
/**Constructor. Constructs a text object
*@param place - Instance of {@link Coordinate Coordinate}. Coordinates where the text object will be placed.
*@param contents - string
*/
Text3D(Coordinate3D *place, std::string contents);
~Text3D();
/**Set the text justification
*@param justification {@link Text3D::TextJustifications TextJustifications}
*@return void
*/
void setJustification(Text::TextJustifications justification) { this->justification = justification; }
/**Returns the text justification
*@return Instance of {@link Text3D::TextJustifications TextJustifications}
*/
Text::TextJustifications getJustification() { return justification; }
std::pair< double, double> getDepthRange();
void render( Figure*, double xOffset, double yOffset, double scale, double distance, double minDepth, double maxDepth, int minFigDepth = 0, int maxFigDepth = 999 );
void applyMatrix( Matrix< double >* );
void translate( Coordinate3D* );
/**Write the text object to a given outstream.
*@param stream output stream
*@return void
*/
void write(std::ostream &stream) const;
};
inline std::ostream &operator<<(std::ostream &stream, const Text3D & o) {
o.write(stream);
return stream;
}
#endif