Bayeux
3.4.1
Core Foundation library for SuperNEMO
bayeux
geomtools
i_wires_drawer.h
Go to the documentation of this file.
1
/* Author(s): F. Mauger <mauger@lpccaen.in2p3.fr>
3
* Creation date: 2015-02-07
4
* Last modified: 2015-02-07
5
*
6
* License:
7
*
8
* Description:
9
*
10
* Base class for all shape drawer in wires mode
11
*
12
* History:
13
*
14
*/
15
16
#ifndef GEOMTOOLS_I_WIRES_DRAWER_H
17
#define GEOMTOOLS_I_WIRES_DRAWER_H 1
18
19
// Standard library:
20
#include <iostream>
21
22
// Third party:
23
// - Boost:
24
#include <boost/scoped_ptr.hpp>
25
#include <boost/cstdint.hpp>
26
27
// This project:
28
#include <
geomtools/utils.h
>
29
#include <
geomtools/i_wires_3d_rendering.h
>
30
31
namespace
geomtools
{
32
33
/*
35
class cached_wires_drawer
36
{
37
public:
38
40
cached_wires_drawer(i_wires_3d_rendering & renderer_);
41
43
virtual ~cached_wires_drawer();
44
46
virtual void generate_wires_self(std::list<polyline_3d> & wires_,
47
uint32_t options_ = 0) const;
48
50
void clear_wires();
51
53
void update_wires();
54
56
bool has_wires() const;
57
59
const std::list<polyline_3d> & get_wires() const;
60
61
private:
62
63
i_wires_3d_rendering * _renderer_; //!< handle to an external renderer
64
uint32_t _options_; //!< Current rendering options
65
boost::scoped_ptr<std::list<polyline_3d> > _cached_wires_; //!< Cached wires collection
66
67
};
68
*/
69
71
template
<
class
T>
72
class
i_wires_drawer
:
public
i_wires_3d_rendering
73
{
74
public
:
75
76
// Type aliases:
77
typedef
T
object_type
;
78
typedef
T *
pointer_type
;
79
typedef
const
T *
const_pointer_type
;
80
typedef
T &
reference_type
;
81
typedef
const
T &
const_reference_type
;
82
84
i_wires_drawer
() :
_address_
(0)
85
{
86
return
;
87
}
88
90
i_wires_drawer
(
const_reference_type
object_) :
_address_
(0)
91
{
92
set_address
(object_);
93
return
;
94
}
95
97
virtual
~i_wires_drawer
()
98
{
99
return
;
100
}
101
103
bool
has_address
()
const
104
{
105
return
_address_
!= 0;
106
}
107
109
void
set_address
(
const_reference_type
object_)
110
{
111
_address_
= &object_;
112
return
;
113
}
114
116
void
reset_address
()
117
{
118
_address_
= 0;
119
return
;
120
}
121
123
const_reference_type
get
()
const
124
{
125
return
*
_address_
;
126
}
127
128
protected
:
129
130
const_pointer_type
_address_
;
131
132
};
133
134
}
// end of namespace geomtools
135
136
#endif // GEOMTOOLS_I_WIRES_DRAWER_H
137
138
/*
139
** Local Variables: --
140
** mode: c++ --
141
** c-file-style: "gnu" --
142
** tab-width: 2 --
143
** End: --
144
*/
geomtools::i_wires_drawer::reference_type
T & reference_type
Definition:
i_wires_drawer.h:80
geomtools::i_wires_drawer::has_address
bool has_address() const
Check the validity of the address.
Definition:
i_wires_drawer.h:103
geomtools::i_wires_drawer::get
const_reference_type get() const
Return a non mutable reference to the object.
Definition:
i_wires_drawer.h:123
geomtools::i_wires_drawer::i_wires_drawer
i_wires_drawer()
Default constructor.
Definition:
i_wires_drawer.h:84
geomtools::i_wires_drawer::const_pointer_type
const T * const_pointer_type
Definition:
i_wires_drawer.h:79
geomtools::i_wires_drawer::pointer_type
T * pointer_type
Definition:
i_wires_drawer.h:78
geomtools::spherical_extrusion_box_model
A box volume with a spherical extrusion.
Definition:
spherical_extrusion_box_model.h:40
geomtools::i_wires_drawer::reset_address
void reset_address()
Reset the address of the external object.
Definition:
i_wires_drawer.h:116
geomtools::i_wires_drawer::const_reference_type
const T & const_reference_type
Definition:
i_wires_drawer.h:81
geomtools::i_wires_drawer::i_wires_drawer
i_wires_drawer(const_reference_type object_)
Constructor.
Definition:
i_wires_drawer.h:90
utils.h
geomtools::i_wires_3d_rendering
brief Abstract interface for objects that can describe themselves as a collection of polylines for 3D...
Definition:
i_wires_3d_rendering.h:39
geomtools::i_wires_drawer::~i_wires_drawer
virtual ~i_wires_drawer()
Destructor.
Definition:
i_wires_drawer.h:97
geomtools::i_wires_drawer::_address_
const_pointer_type _address_
Reference to an external object.
Definition:
i_wires_drawer.h:130
geomtools::i_wires_drawer::set_address
void set_address(const_reference_type object_)
Set the address of the external object.
Definition:
i_wires_drawer.h:109
geomtools::i_wires_drawer
Base class for all shape drawer objects in wires mode.
Definition:
i_wires_drawer.h:72
i_wires_3d_rendering.h
geomtools::i_wires_drawer::object_type
T object_type
Definition:
i_wires_drawer.h:77
geomtools
Top-level namespace of the Bayeux/geomtools module library.
Definition:
electromagnetic_field_manager.h:39
Generated by
1.8.15