Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
DepthMapping.h
Go to the documentation of this file.
1
#ifndef DEPTH_MAPPING_H
2
#define DEPTH_MAPPING_H
3
4
#include "
Mapping.h
"
5
6
//-------------------------------------------------------------
7
// Define a 3D Mapping from 2D Mapping by extending in
8
// the z-direction by a variable amount
9
//-------------------------------------------------------------
10
class
DepthMapping
:
public
Mapping
11
{
12
13
public
:
14
15
enum
DepthOption
16
{
17
constantDepth
,
18
quadraticDepth
,
19
depthFunction
20
};
21
22
DepthMapping
();
23
// Copy constructor is deep by default
24
DepthMapping
(
const
DepthMapping
&,
const
CopyType
copyType=
DEEP
);
25
26
~DepthMapping
();
27
28
DepthMapping
&
operator =
(
const
DepthMapping
& X0 );
29
30
int
setDepthFunction
(
Mapping
&
depth
);
31
int
setDepthFunctionParameters
(
real
a0,
real
b0,
real
a1,
real
b1 );
32
int
setSurface
(
Mapping
&
surface
);
33
int
setQuadraticParameters
(
const
real
&
a00
,
34
const
real
&
a10
,
35
const
real
&
a01
,
36
const
real
&
a20
,
37
const
real
&
a11
,
38
const
real
&
a02
);
39
40
void
map
(
const
realArray
&
r
,
realArray
& x,
realArray
& xr =
Overture::nullRealDistributedArray
(),
41
MappingParameters
& params =
Overture::nullMappingParameters
() );
42
43
virtual
int
get
(
const
GenericDataBase
& dir,
const
aString
& name);
// get from a database file
44
virtual
int
put
(
GenericDataBase
& dir,
const
aString
& name)
const
;
// put to a database file
45
46
Mapping
*
make
(
const
aString
&
mappingClassName
);
47
aString
getClassName
()
const
{
return
DepthMapping::className
; }
48
49
int
update
(
MappingInformation
& mapInfo ) ;
50
51
protected
:
52
aString
className
;
53
Mapping
*
surface
;
// this is a 2D grid for the surface
54
Mapping
*
depth
;
// This mapping may define a depth, z=depth(x,y)
55
56
DepthOption
depthOption
;
57
58
real
zSurface
;
// z level for the surface
59
real
zDepth
;
// depth (if constant)
60
real
a00
,
a10
,
a01
,
a20
,
a11
,
a02
;
// quadratic depth parameters
61
real
depthPar
[4];
// scale factors from x to r for the depthFunction
62
63
int
initialize
();
64
65
private
:
66
67
//
68
// Virtual member functions used only through class ReferenceCounting:
69
//
70
virtual
ReferenceCounting
&
operator=
(
const
ReferenceCounting
& x)
71
{
return
operator=
((
DepthMapping
&)x); }
72
virtual
void
reference(
const
ReferenceCounting
& x)
73
{ reference((
DepthMapping
&)x); }
// *** Conversion to this class for the virtual = ****
74
virtual
ReferenceCounting
* virtualConstructor(
const
CopyType
ct =
DEEP
)
const
75
{ return ::new
DepthMapping
(*
this
, ct); }
76
77
};
78
79
80
#endif
Generated on Fri Jan 4 2013 10:17:50 for Overture by
1.8.3