Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
SphereMapping.h
Go to the documentation of this file.
1
#ifndef SPHERE_MAPPING_H
2
#define SPHERE_MAPPING_H
3
4
#include "
Mapping.h
"
5
6
//-------------------------------------------------------------
7
// Define a sphere in polar coordinates
8
//
9
// map (r1,r2,r3) = (phi/Pi, theta/twoPi, r ) -> (x,y,z)
10
//-------------------------------------------------------------
11
class
SphereMapping
:
public
Mapping
12
{
13
private
:
14
aString
className;
15
real
x0,y0,z0,innerRadius,outerRadius,startTheta,endTheta,startPhi,endPhi;
16
17
public
:
18
19
SphereMapping
(
const
real
& innerRadius=.5,
20
const
real
& outerRadius=1.,
21
const
real
& x0=0.,
22
const
real
& y0=0.,
23
const
real
& z0=0.,
24
const
real
& startTheta=0.,
// initial value for "theta", in [0,1]
25
const
real
& endTheta=1.,
// final value for "theta", in [0,1]
26
const
real
& startPhi=0.,
// initial value for "phi", in [0,1]
27
const
real
& endPhi=1.
// final value for "phi", in [0,1]
28
);
29
30
31
// Copy constructor is deep by default
32
SphereMapping
(
const
SphereMapping
&,
const
CopyType
copyType=
DEEP
);
33
34
~SphereMapping
();
35
36
SphereMapping
&
operator =
(
const
SphereMapping
&
X
);
37
38
int
setOrigin
(
const
real
& x0_ =.0,
39
const
real
& y0_ =.0,
40
const
real
& z0_ =.0);
41
int
setPhi
(
const
real
& startPhi_ =.0,
42
const
real
& endPhi_ = 1.);
43
44
int
setRadii
(
const
real
& innerRadius_ =.5,
45
const
real
& outerRadius_ =1.);
46
47
int
setTheta
(
const
real
& startTheta_ =.0,
48
const
real
& endTheta_ =1. );
49
50
void
map
(
const
realArray
&
r
,
realArray
&
x
,
realArray
&
xr
=
Overture::nullRealDistributedArray
(),
51
MappingParameters
& params =
Overture::nullMappingParameters
() );
52
53
void
basicInverse
(
const
realArray
& x,
realArray
& r,
realArray
&
rx
=
Overture::nullRealDistributedArray
(),
54
MappingParameters
& params =
Overture::nullMappingParameters
());
55
56
virtual
void
mapS
(
const
RealArray
& r,
RealArray
& x,
RealArray
&
xr
=
Overture::nullRealArray
(),
57
MappingParameters
& params =
Overture::nullMappingParameters
());
58
59
virtual
void
basicInverseS
(
const
RealArray
& x,
60
RealArray
& r,
61
RealArray
&
rx
=
Overture::nullRealArray
(),
62
MappingParameters
& params =
Overture::nullMappingParameters
());
63
64
int
outside
(
const
realArray
& x );
// false means no or don't no
65
66
virtual
int
get
(
const
GenericDataBase
& dir,
const
aString
& name);
// get from a database file
67
virtual
int
put
(
GenericDataBase
& dir,
const
aString
& name)
const
;
// put to a database file
68
69
Mapping
*
make
(
const
aString
&
mappingClassName
);
70
aString
getClassName
()
const
{
return
SphereMapping::className; }
71
72
int
update
(
MappingInformation
& mapInfo );
73
74
private
:
75
76
//
77
// Virtual member functions used only through class ReferenceCounting:
78
//
79
virtual
ReferenceCounting
&
operator=
(
const
ReferenceCounting
& x)
80
{
return
operator=
((
SphereMapping
&)x); }
81
virtual
void
reference(
const
ReferenceCounting
& x)
82
{ reference((
SphereMapping
&)x); }
// *** Conversion to this class for the virtual = ****
83
virtual
ReferenceCounting
* virtualConstructor(
const
CopyType
ct =
DEEP
)
const
84
{ return ::new
SphereMapping
(*
this
, ct); }
85
};
86
87
88
#endif // SPHERE_H
Generated on Fri Jan 4 2013 10:17:59 for Overture by
1.8.3