OpenStructure
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
stage
include
ost
gfx
gfx_prim.hh
Go to the documentation of this file.
1
//------------------------------------------------------------------------------
2
// This file is part of the OpenStructure project <www.openstructure.org>
3
//
4
// Copyright (C) 2008-2011 by the OpenStructure authors
5
//
6
// This library is free software; you can redistribute it and/or modify it under
7
// the terms of the GNU Lesser General Public License as published by the Free
8
// Software Foundation; either version 3.0 of the License, or (at your option)
9
// any later version.
10
// This library is distributed in the hope that it will be useful, but WITHOUT
11
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13
// details.
14
//
15
// You should have received a copy of the GNU Lesser General Public License
16
// along with this library; if not, write to the Free Software Foundation, Inc.,
17
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
//------------------------------------------------------------------------------
19
#ifndef OST_GFX_PRIM_HH
20
#define OST_GFX_PRIM_HH
21
22
/*
23
Author: Ansgar Philippsen
24
*/
25
26
#include <vector>
27
28
#include <
ost/geom/geom.hh
>
29
30
#include "
color.hh
"
31
32
namespace
ost {
namespace
gfx {
33
34
struct
SpherePrim
{
35
SpherePrim
():
36
position
(),
radius
(1.0),
color
()
37
{}
38
SpherePrim
(
const
geom::Vec3
& pos,
float
rad,
const
Color
& col):
39
position
(pos),
radius
(rad),
color
(col)
40
{}
41
42
geom::Vec3
position
;
43
float
radius
;
44
Color
color
;
45
};
46
47
typedef
std::vector<SpherePrim>
SpherePrimList
;
48
49
struct
CylinderPrim
{
50
CylinderPrim
():
51
start
(),
end
(),
52
radius1
(1.0),
radius2
(1.0),
53
color1
(),
color2
(),
54
length
(1.0),
rotmat
(),
rotmat_t
()
55
{
56
calc_rotmat
();
57
}
58
59
CylinderPrim
(
const
geom::Vec3
& st,
const
geom::Vec3
& en,
float
rad,
const
Color
& col):
60
start
(st),
end
(en),
61
radius1
(rad),
radius2
(rad),
62
color1
(col),
color2
(col),
63
length
(geom::
Length
(
end
-
start
)),
rotmat
(),
rotmat_t
()
64
{
65
calc_rotmat
();
66
}
67
68
CylinderPrim
(
const
geom::Vec3
& st,
const
geom::Vec3
& en,
float
rad,
const
Color
& col1,
const
Color
& col2):
69
start
(st),
end
(en),
70
radius1
(rad),
radius2
(rad),
71
color1
(col1),
color2
(col2),
72
length
(geom::
Length
(
end
-
start
)),
rotmat
(),
rotmat_t
()
73
{
74
calc_rotmat
();
75
}
76
77
CylinderPrim
(
const
geom::Vec3
& st,
const
geom::Vec3
& en,
float
rad1,
float
rad2,
const
Color
& col):
78
start
(st),
end
(en),
79
radius1
(rad1),
radius2
(rad2),
80
color1
(col),
color2
(col),
81
length
(geom::
Length
(
end
-
start
)),
rotmat
(),
rotmat_t
()
82
{
83
calc_rotmat
();
84
}
85
86
CylinderPrim
(
const
geom::Vec3
& st,
const
geom::Vec3
& en,
float
rad1,
float
rad2,
const
Color
& col1,
const
Color
& col2):
87
start
(st),
end
(en),
88
radius1
(rad1),
radius2
(rad2),
89
color1
(col1),
color2
(col2),
90
length
(geom::
Length
(
end
-
start
)),
rotmat
(),
rotmat_t
()
91
{
92
calc_rotmat
();
93
}
94
95
void
calc_rotmat
();
96
97
geom::Vec3
start
,
end
;
98
float
radius1
,
radius2
;
99
Color
color1
,
color2
;
100
float
length
;
101
geom::Mat3
rotmat
;
102
geom::Mat3
rotmat_t
;
103
};
104
105
typedef
std::vector<CylinderPrim>
CylinderPrimList
;
106
107
struct
TextPrim
{
108
TextPrim
():
str
(
""
),
position
(),
color
(),
points
(1.0) {}
109
TextPrim
(
const
String
& s,
const
geom::Vec3
& p,
const
Color
& c,
float
ps):
110
str
(s),
position
(p),
color
(c),
points
(ps) {}
111
String
str
;
112
geom::Vec3
position
;
113
Color
color
;
114
float
points
;
115
};
116
117
typedef
std::vector<TextPrim>
TextPrimList
;
118
119
120
}}
// ns
121
122
#endif
Generated on Mon Nov 5 2012 13:30:57 for OpenStructure by
1.8.1.1