Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
eaaa3eb4
Commit
eaaa3eb4
authored
Oct 20, 2010
by
Lionel Heng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up 3D imagery code.
parent
dedaa377
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
633 additions
and
318 deletions
+633
-318
Imagery.cc
src/ui/map3D/Imagery.cc
+160
-152
Imagery.h
src/ui/map3D/Imagery.h
+54
-15
Q3DWidget.cc
src/ui/map3D/Q3DWidget.cc
+137
-124
Q3DWidget.h
src/ui/map3D/Q3DWidget.h
+15
-13
QMap3DWidget.cc
src/ui/map3D/QMap3DWidget.cc
+8
-6
QMap3DWidget.h
src/ui/map3D/QMap3DWidget.h
+6
-6
Texture.cc
src/ui/map3D/Texture.cc
+31
-0
Texture.h
src/ui/map3D/Texture.h
+31
-0
TextureCache.cc
src/ui/map3D/TextureCache.cc
+31
-0
TextureCache.h
src/ui/map3D/TextureCache.h
+31
-0
WebImage.cc
src/ui/map3D/WebImage.cc
+32
-1
WebImage.h
src/ui/map3D/WebImage.h
+31
-0
WebImageCache.cc
src/ui/map3D/WebImageCache.cc
+35
-1
WebImageCache.h
src/ui/map3D/WebImageCache.h
+31
-0
No files found.
src/ui/map3D/Imagery.cc
View file @
eaaa3eb4
This diff is collapsed.
Click to expand it.
src/ui/map3D/Imagery.h
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class Imagery.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef IMAGERY_H
#define IMAGERY_H
...
...
@@ -28,11 +59,11 @@ public:
double
viewXOffset
,
double
viewYOffset
,
const
QString
&
utmZone
);
void
prefetch3D
(
double
radius
,
double
imag
eResolution
,
void
prefetch3D
(
double
radius
,
double
til
eResolution
,
double
xOrigin
,
double
yOrigin
,
double
viewXOffset
,
double
viewYOffset
,
const
QString
&
utmZone
);
void
draw3D
(
double
radius
,
double
imag
eResolution
,
void
draw3D
(
double
radius
,
double
til
eResolution
,
double
xOrigin
,
double
yOrigin
,
double
viewXOffset
,
double
viewYOffset
,
const
QString
&
utmZone
);
...
...
@@ -40,28 +71,36 @@ public:
bool
update
(
void
);
private:
void
imageBounds
(
int32_t
x
,
int32_t
y
,
double
imag
eResolution
,
void
imageBounds
(
int32_t
tileX
,
int32_t
tileY
,
double
til
eResolution
,
double
&
x1
,
double
&
y1
,
double
&
x2
,
double
&
y2
,
double
&
x3
,
double
&
y3
,
double
&
x4
,
double
&
y4
);
double
&
x3
,
double
&
y3
,
double
&
x4
,
double
&
y4
)
const
;
void
tileBounds
(
double
tileResolution
,
double
minUtmX
,
double
minUtmY
,
double
maxUtmX
,
double
maxUtmY
,
const
QString
&
utmZone
,
int32_t
&
minTileX
,
int32_t
&
minTileY
,
int32_t
&
maxTileX
,
int32_t
&
maxTileY
,
int32_t
&
zoomLevel
)
const
;
double
tileYToLatitude
(
double
y
);
double
latitudeToTileY
(
double
latitude
);
double
tileXToLongitude
(
int32_t
tileX
,
int32_t
numTiles
)
const
;
double
tileYToLatitude
(
int32_t
tileY
,
int32_t
numTiles
)
const
;
int32_t
longitudeToTileX
(
double
longitude
,
int32_t
numTiles
)
const
;
int32_t
latitudeToTileY
(
double
latitude
,
int32_t
numTiles
)
const
;
void
UTMtoTile
(
double
northing
,
double
easting
,
const
QString
&
utmZone
,
double
imag
eResolution
,
int32_t
&
tileX
,
int32_t
&
tileY
,
int32_t
&
zoomLevel
);
double
til
eResolution
,
int32_t
&
tileX
,
int32_t
&
tileY
,
int32_t
&
zoomLevel
)
const
;
QChar
UTMLetterDesignator
(
double
latitude
);
QChar
UTMLetterDesignator
(
double
latitude
)
const
;
void
LLtoUTM
(
const
double
latitude
,
const
double
longitude
,
void
LLtoUTM
(
double
latitude
,
double
longitude
,
double
&
utmNorthing
,
double
&
utmEasting
,
QString
&
utmZone
);
QString
&
utmZone
)
const
;
void
UTMtoLL
(
const
double
utmNorthing
,
const
double
utmEasting
,
const
QString
&
utmZone
,
double
&
latitude
,
double
&
longitude
);
void
UTMtoLL
(
double
utmNorthing
,
double
utmEasting
,
const
QString
&
utmZone
,
double
&
latitude
,
double
&
longitude
)
const
;
QString
getTileURL
(
int32_t
x
,
int32_t
y
,
int32_t
zoomLevel
)
;
QString
getTileURL
(
int32_t
tileX
,
int32_t
tileY
,
int32_t
zoomLevel
)
const
;
ImageryType
currentImageryType
;
...
...
src/ui/map3D/Q3DWidget.cc
View file @
eaaa3eb4
...
...
@@ -474,13 +474,13 @@ Q3DWidget::setDisplayMode3D()
}
float
Q3DWidget
::
r2d
(
float
angle
)
Q3DWidget
::
r2d
(
float
angle
)
const
{
return
angle
*
57.295779513082320876
f
;
}
float
Q3DWidget
::
d2r
(
float
angle
)
Q3DWidget
::
d2r
(
float
angle
)
const
{
return
angle
*
0.0174532925199432957692
f
;
}
...
...
@@ -866,160 +866,173 @@ Q3DWidget::closeEvent(QCloseEvent *)
// exit application
}
void
Q3DWidget
::
wireSphere
(
double
radius
,
int
slices
,
int
stacks
)
void
Q3DWidget
::
wireSphere
(
double
radius
,
int
slices
,
int
stacks
)
const
{
static
GLUquadricObj
*
quadObj
;
static
GLUquadricObj
*
quadObj
;
// Make sure quad object exists
if
(
!
quadObj
)
quadObj
=
gluNewQuadric
();
gluQuadricDrawStyle
(
quadObj
,
GLU_LINE
);
gluQuadricNormals
(
quadObj
,
GLU_SMOOTH
);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere
(
quadObj
,
radius
,
slices
,
stacks
);
if
(
!
quadObj
)
quadObj
=
gluNewQuadric
();
gluQuadricDrawStyle
(
quadObj
,
GLU_LINE
);
gluQuadricNormals
(
quadObj
,
GLU_SMOOTH
);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere
(
quadObj
,
radius
,
slices
,
stacks
);
}
void
Q3DWidget
::
solidSphere
(
double
radius
,
int
slices
,
int
stacks
)
void
Q3DWidget
::
solidSphere
(
double
radius
,
int
slices
,
int
stacks
)
const
{
static
GLUquadricObj
*
quadObj
;
static
GLUquadricObj
*
quadObj
;
// Make sure quad object exists
if
(
!
quadObj
)
quadObj
=
gluNewQuadric
();
gluQuadricDrawStyle
(
quadObj
,
GLU_FILL
);
gluQuadricNormals
(
quadObj
,
GLU_SMOOTH
);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere
(
quadObj
,
radius
,
slices
,
stacks
);
if
(
!
quadObj
)
quadObj
=
gluNewQuadric
();
gluQuadricDrawStyle
(
quadObj
,
GLU_FILL
);
gluQuadricNormals
(
quadObj
,
GLU_SMOOTH
);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere
(
quadObj
,
radius
,
slices
,
stacks
);
}
void
Q3DWidget
::
wireCone
(
double
base
,
double
height
,
int
slices
,
int
stacks
)
void
Q3DWidget
::
wireCone
(
double
base
,
double
height
,
int
slices
,
int
stacks
)
const
{
static
GLUquadricObj
*
quadObj
;
static
GLUquadricObj
*
quadObj
;
// Make sure quad object exists
if
(
!
quadObj
)
quadObj
=
gluNewQuadric
();
gluQuadricDrawStyle
(
quadObj
,
GLU_LINE
);
gluQuadricNormals
(
quadObj
,
GLU_SMOOTH
);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluCylinder
(
quadObj
,
base
,
0.0
,
height
,
slices
,
stacks
);
if
(
!
quadObj
)
quadObj
=
gluNewQuadric
();
gluQuadricDrawStyle
(
quadObj
,
GLU_LINE
);
gluQuadricNormals
(
quadObj
,
GLU_SMOOTH
);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluCylinder
(
quadObj
,
base
,
0.0
,
height
,
slices
,
stacks
);
}
void
Q3DWidget
::
solidCone
(
double
base
,
double
height
,
int
slices
,
int
stacks
)
void
Q3DWidget
::
solidCone
(
double
base
,
double
height
,
int
slices
,
int
stacks
)
const
{
static
GLUquadricObj
*
quadObj
;
// Make sure quad object exists
if
(
!
quadObj
)
quadObj
=
gluNewQuadric
();
gluQuadricDrawStyle
(
quadObj
,
GLU_FILL
);
gluQuadricNormals
(
quadObj
,
GLU_SMOOTH
);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluCylinder
(
quadObj
,
base
,
0.0
,
height
,
slices
,
stacks
);
if
(
!
quadObj
)
quadObj
=
gluNewQuadric
();
gluQuadricDrawStyle
(
quadObj
,
GLU_FILL
);
gluQuadricNormals
(
quadObj
,
GLU_SMOOTH
);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluCylinder
(
quadObj
,
base
,
0.0
,
height
,
slices
,
stacks
);
}
void
Q3DWidget
::
drawBox
(
float
size
,
GLenum
type
)
void
Q3DWidget
::
drawBox
(
float
size
,
GLenum
type
)
const
{
static
GLfloat
n
[
6
][
3
]
=
{
{
-
1.0
,
0.0
,
0.0
},
{
0.0
,
1.0
,
0.0
},
{
1.0
,
0.0
,
0.0
},
{
0.0
,
-
1.0
,
0.0
},
{
0.0
,
0.0
,
1.0
},
{
0.0
,
0.0
,
-
1.0
}
};
static
GLint
faces
[
6
][
4
]
=
{
{
0
,
1
,
2
,
3
},
{
3
,
2
,
6
,
7
},
{
7
,
6
,
5
,
4
},
{
4
,
5
,
1
,
0
},
{
5
,
6
,
2
,
1
},
{
7
,
4
,
0
,
3
}
};
GLfloat
v
[
8
][
3
];
GLint
i
;
v
[
0
][
0
]
=
v
[
1
][
0
]
=
v
[
2
][
0
]
=
v
[
3
][
0
]
=
-
size
/
2
;
v
[
4
][
0
]
=
v
[
5
][
0
]
=
v
[
6
][
0
]
=
v
[
7
][
0
]
=
size
/
2
;
v
[
0
][
1
]
=
v
[
1
][
1
]
=
v
[
4
][
1
]
=
v
[
5
][
1
]
=
-
size
/
2
;
v
[
2
][
1
]
=
v
[
3
][
1
]
=
v
[
6
][
1
]
=
v
[
7
][
1
]
=
size
/
2
;
v
[
0
][
2
]
=
v
[
3
][
2
]
=
v
[
4
][
2
]
=
v
[
7
][
2
]
=
-
size
/
2
;
v
[
1
][
2
]
=
v
[
2
][
2
]
=
v
[
5
][
2
]
=
v
[
6
][
2
]
=
size
/
2
;
for
(
i
=
5
;
i
>=
0
;
i
--
)
{
glBegin
(
type
);
glNormal3fv
(
&
n
[
i
][
0
]);
glVertex3fv
(
&
v
[
faces
[
i
][
0
]][
0
]);
glVertex3fv
(
&
v
[
faces
[
i
][
1
]][
0
]);
glVertex3fv
(
&
v
[
faces
[
i
][
2
]][
0
]);
glVertex3fv
(
&
v
[
faces
[
i
][
3
]][
0
]);
glEnd
();
}
static
GLfloat
n
[
6
][
3
]
=
{
{
-
1.0
,
0.0
,
0.0
},
{
0.0
,
1.0
,
0.0
},
{
1.0
,
0.0
,
0.0
},
{
0.0
,
-
1.0
,
0.0
},
{
0.0
,
0.0
,
1.0
},
{
0.0
,
0.0
,
-
1.0
}
};
static
GLint
faces
[
6
][
4
]
=
{
{
0
,
1
,
2
,
3
},
{
3
,
2
,
6
,
7
},
{
7
,
6
,
5
,
4
},
{
4
,
5
,
1
,
0
},
{
5
,
6
,
2
,
1
},
{
7
,
4
,
0
,
3
}
};
GLfloat
v
[
8
][
3
];
GLint
i
;
v
[
0
][
0
]
=
v
[
1
][
0
]
=
v
[
2
][
0
]
=
v
[
3
][
0
]
=
-
size
/
2
;
v
[
4
][
0
]
=
v
[
5
][
0
]
=
v
[
6
][
0
]
=
v
[
7
][
0
]
=
size
/
2
;
v
[
0
][
1
]
=
v
[
1
][
1
]
=
v
[
4
][
1
]
=
v
[
5
][
1
]
=
-
size
/
2
;
v
[
2
][
1
]
=
v
[
3
][
1
]
=
v
[
6
][
1
]
=
v
[
7
][
1
]
=
size
/
2
;
v
[
0
][
2
]
=
v
[
3
][
2
]
=
v
[
4
][
2
]
=
v
[
7
][
2
]
=
-
size
/
2
;
v
[
1
][
2
]
=
v
[
2
][
2
]
=
v
[
5
][
2
]
=
v
[
6
][
2
]
=
size
/
2
;
for
(
i
=
5
;
i
>=
0
;
i
--
)
{
glBegin
(
type
);
glNormal3fv
(
&
n
[
i
][
0
]);
glVertex3fv
(
&
v
[
faces
[
i
][
0
]][
0
]);
glVertex3fv
(
&
v
[
faces
[
i
][
1
]][
0
]);
glVertex3fv
(
&
v
[
faces
[
i
][
2
]][
0
]);
glVertex3fv
(
&
v
[
faces
[
i
][
3
]][
0
]);
glEnd
();
}
}
void
Q3DWidget
::
wireCube
(
double
size
)
void
Q3DWidget
::
wireCube
(
double
size
)
const
{
drawBox
(
size
,
GL_LINE_LOOP
);
drawBox
(
size
,
GL_LINE_LOOP
);
}
void
Q3DWidget
::
solidCube
(
double
size
)
void
Q3DWidget
::
solidCube
(
double
size
)
const
{
drawBox
(
size
,
GL_QUADS
);
drawBox
(
size
,
GL_QUADS
);
}
void
Q3DWidget
::
doughnut
(
float
r
,
float
R
,
int
nsides
,
int
rings
)
void
Q3DWidget
::
doughnut
(
float
r
,
float
R
,
int
nsides
,
int
rings
)
const
{
int
i
,
j
;
GLfloat
theta
,
phi
,
theta1
;
GLfloat
cosTheta
,
sinTheta
;
GLfloat
cosTheta1
,
sinTheta1
;
GLfloat
ringDelta
,
sideDelta
;
ringDelta
=
2.0
*
M_PI
/
rings
;
sideDelta
=
2.0
*
M_PI
/
nsides
;
theta
=
0.0
;
cosTheta
=
1.0
;
sinTheta
=
0.0
;
for
(
i
=
rings
-
1
;
i
>=
0
;
i
--
)
{
theta1
=
theta
+
ringDelta
;
cosTheta1
=
cos
(
theta1
);
sinTheta1
=
sin
(
theta1
);
glBegin
(
GL_QUAD_STRIP
);
phi
=
0.0
;
for
(
j
=
nsides
;
j
>=
0
;
j
--
)
{
GLfloat
cosPhi
,
sinPhi
,
dist
;
phi
+=
sideDelta
;
cosPhi
=
cos
(
phi
);
sinPhi
=
sin
(
phi
);
dist
=
R
+
r
*
cosPhi
;
glNormal3f
(
cosTheta1
*
cosPhi
,
-
sinTheta1
*
cosPhi
,
sinPhi
);
glVertex3f
(
cosTheta1
*
dist
,
-
sinTheta1
*
dist
,
r
*
sinPhi
);
glNormal3f
(
cosTheta
*
cosPhi
,
-
sinTheta
*
cosPhi
,
sinPhi
);
glVertex3f
(
cosTheta
*
dist
,
-
sinTheta
*
dist
,
r
*
sinPhi
);
int
i
,
j
;
GLfloat
theta
,
phi
,
theta1
;
GLfloat
cosTheta
,
sinTheta
;
GLfloat
cosTheta1
,
sinTheta1
;
GLfloat
ringDelta
,
sideDelta
;
ringDelta
=
2.0
*
M_PI
/
rings
;
sideDelta
=
2.0
*
M_PI
/
nsides
;
theta
=
0.0
;
cosTheta
=
1.0
;
sinTheta
=
0.0
;
for
(
i
=
rings
-
1
;
i
>=
0
;
i
--
)
{
theta1
=
theta
+
ringDelta
;
cosTheta1
=
cos
(
theta1
);
sinTheta1
=
sin
(
theta1
);
glBegin
(
GL_QUAD_STRIP
);
phi
=
0.0
;
for
(
j
=
nsides
;
j
>=
0
;
j
--
)
{
GLfloat
cosPhi
,
sinPhi
,
dist
;
phi
+=
sideDelta
;
cosPhi
=
cos
(
phi
);
sinPhi
=
sin
(
phi
);
dist
=
R
+
r
*
cosPhi
;
glNormal3f
(
cosTheta1
*
cosPhi
,
-
sinTheta1
*
cosPhi
,
sinPhi
);
glVertex3f
(
cosTheta1
*
dist
,
-
sinTheta1
*
dist
,
r
*
sinPhi
);
glNormal3f
(
cosTheta
*
cosPhi
,
-
sinTheta
*
cosPhi
,
sinPhi
);
glVertex3f
(
cosTheta
*
dist
,
-
sinTheta
*
dist
,
r
*
sinPhi
);
}
glEnd
();
theta
=
theta1
;
cosTheta
=
cosTheta1
;
sinTheta
=
sinTheta1
;
}
glEnd
();
theta
=
theta1
;
cosTheta
=
cosTheta1
;
sinTheta
=
sinTheta1
;
}
}
void
Q3DWidget
::
wireTorus
(
double
innerRadius
,
double
outerRadius
,
int
nsides
,
int
rings
)
void
Q3DWidget
::
wireTorus
(
double
innerRadius
,
double
outerRadius
,
int
nsides
,
int
rings
)
const
{
glPushAttrib
(
GL_POLYGON_BIT
);
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_LINE
);
doughnut
(
innerRadius
,
outerRadius
,
nsides
,
rings
);
glPopAttrib
();
glPushAttrib
(
GL_POLYGON_BIT
);
glPolygonMode
(
GL_FRONT_AND_BACK
,
GL_LINE
);
doughnut
(
innerRadius
,
outerRadius
,
nsides
,
rings
);
glPopAttrib
();
}
void
Q3DWidget
::
solidTorus
(
double
innerRadius
,
double
outerRadius
,
int
nsides
,
int
rings
)
void
Q3DWidget
::
solidTorus
(
double
innerRadius
,
double
outerRadius
,
int
nsides
,
int
rings
)
const
{
doughnut
(
innerRadius
,
outerRadius
,
nsides
,
rings
);
doughnut
(
innerRadius
,
outerRadius
,
nsides
,
rings
);
}
src/ui/map3D/Q3DWidget.h
View file @
eaaa3eb4
...
...
@@ -162,19 +162,21 @@ protected:
void
switchTo3DMode
(
void
);
void
setDisplayMode3D
(
void
);
float
r2d
(
float
angle
);
float
d2r
(
float
angle
);
void
wireSphere
(
double
radius
,
int
slices
,
int
stacks
);
void
solidSphere
(
double
radius
,
int
slices
,
int
stacks
);
void
wireCone
(
double
base
,
double
height
,
int
slices
,
int
stacks
);
void
solidCone
(
double
base
,
double
height
,
int
slices
,
int
stacks
);
void
drawBox
(
float
size
,
GLenum
type
);
void
wireCube
(
double
size
);
void
solidCube
(
double
size
);
void
doughnut
(
float
r
,
float
R
,
int
nsides
,
int
rings
);
void
wireTorus
(
double
innerRadius
,
double
outerRadius
,
int
nsides
,
int
rings
);
void
solidTorus
(
double
innerRadius
,
double
outerRadius
,
int
nsides
,
int
rings
);
float
r2d
(
float
angle
)
const
;
float
d2r
(
float
angle
)
const
;
void
wireSphere
(
double
radius
,
int
slices
,
int
stacks
)
const
;
void
solidSphere
(
double
radius
,
int
slices
,
int
stacks
)
const
;
void
wireCone
(
double
base
,
double
height
,
int
slices
,
int
stacks
)
const
;
void
solidCone
(
double
base
,
double
height
,
int
slices
,
int
stacks
)
const
;
void
drawBox
(
float
size
,
GLenum
type
)
const
;
void
wireCube
(
double
size
)
const
;
void
solidCube
(
double
size
)
const
;
void
doughnut
(
float
r
,
float
R
,
int
nsides
,
int
rings
)
const
;
void
wireTorus
(
double
innerRadius
,
double
outerRadius
,
int
nsides
,
int
rings
)
const
;
void
solidTorus
(
double
innerRadius
,
double
outerRadius
,
int
nsides
,
int
rings
)
const
;
GLUquadricObj
*
quadObj
;
...
...
src/ui/map3D/QMap3DWidget.cc
View file @
eaaa3eb4
...
...
@@ -266,7 +266,7 @@ QMap3DWidget::displayHandler(void)
&
painter
);
}
void
QMap3DWidget
::
drawWaypoints
(
)
void
QMap3DWidget
::
drawWaypoints
(
void
)
const
{
if
(
uas
)
{
...
...
@@ -391,7 +391,9 @@ QMap3DWidget::drawLegend(void)
&
painter
);
}
void
QMap3DWidget
::
paintText
(
QString
text
,
QColor
color
,
float
fontSize
,
float
refX
,
float
refY
,
QPainter
*
painter
)
void
QMap3DWidget
::
paintText
(
QString
text
,
QColor
color
,
float
fontSize
,
float
refX
,
float
refY
,
QPainter
*
painter
)
const
{
QPen
prevPen
=
painter
->
pen
();
...
...
@@ -590,7 +592,7 @@ QMap3DWidget::toggleLockCamera(int32_t state)
}
void
QMap3DWidget
::
drawPlatform
(
float
roll
,
float
pitch
,
float
yaw
)
QMap3DWidget
::
drawPlatform
(
float
roll
,
float
pitch
,
float
yaw
)
const
{
glPushMatrix
();
...
...
@@ -627,7 +629,7 @@ QMap3DWidget::drawPlatform(float roll, float pitch, float yaw)
}
void
QMap3DWidget
::
drawGrid
(
void
)
QMap3DWidget
::
drawGrid
(
void
)
const
{
float
radius
=
10.0
f
;
float
resolution
=
0.25
f
;
...
...
@@ -660,7 +662,7 @@ QMap3DWidget::drawGrid(void)
void
QMap3DWidget
::
drawImagery
(
double
originX
,
double
originY
,
const
QString
&
zone
,
bool
prefetch
)
bool
prefetch
)
const
{
glPushMatrix
();
glEnable
(
GL_BLEND
);
...
...
@@ -763,7 +765,7 @@ QMap3DWidget::drawTrail(float x, float y, float z)
}
void
QMap3DWidget
::
drawTarget
(
float
x
,
float
y
,
float
z
)
QMap3DWidget
::
drawTarget
(
float
x
,
float
y
,
float
z
)
const
{
static
double
radius
=
0.2
;
static
bool
expand
=
true
;
...
...
src/ui/map3D/QMap3DWidget.h
View file @
eaaa3eb4
...
...
@@ -80,16 +80,16 @@ private slots:
protected:
UASInterface
*
uas
;
void
paintText
(
QString
text
,
QColor
color
,
float
fontSize
,
float
refX
,
float
refY
,
QPainter
*
painter
);
void
drawWaypoints
(
)
;
float
refX
,
float
refY
,
QPainter
*
painter
)
const
;
void
drawWaypoints
(
void
)
const
;
private:
void
drawPlatform
(
float
roll
,
float
pitch
,
float
yaw
);
void
drawGrid
(
void
);
void
drawPlatform
(
float
roll
,
float
pitch
,
float
yaw
)
const
;
void
drawGrid
(
void
)
const
;
void
drawImagery
(
double
originX
,
double
originY
,
const
QString
&
zone
,
bool
prefetch
);
bool
prefetch
)
const
;
void
drawTrail
(
float
x
,
float
y
,
float
z
);
void
drawTarget
(
float
x
,
float
y
,
float
z
);
void
drawTarget
(
float
x
,
float
y
,
float
z
)
const
;
void
drawLegend
(
void
);
...
...
src/ui/map3D/Texture.cc
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class Texture.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#include "Texture.h"
Texture
::
Texture
()
...
...
src/ui/map3D/Texture.h
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class Texture.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef TEXTURE_H
#define TEXTURE_H
...
...
src/ui/map3D/TextureCache.cc
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class TextureCache.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#include "TextureCache.h"
TextureCache
::
TextureCache
(
uint32_t
_cacheSize
)
...
...
src/ui/map3D/TextureCache.h
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class TextureCache.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef TEXTURECACHE_H
#define TEXTURECACHE_H
...
...
src/ui/map3D/WebImage.cc
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class WebImage.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#include "WebImage.h"
#include <QDebug>
...
...
@@ -6,7 +37,7 @@
WebImage
::
WebImage
()
:
state
(
WebImage
::
UNINITIALIZED
)
,
sourceURL
(
""
)
,
image
(
new
QImage
)
,
image
(
0
)
,
lastReference
(
0
)
,
syncFlag
(
false
)
{
...
...
src/ui/map3D/WebImage.h
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class WebImage.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef WEBIMAGE_H
#define WEBIMAGE_H
...
...
src/ui/map3D/WebImageCache.cc
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class WebImageCache.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#include "WebImageCache.h"
#include <QNetworkReply>
...
...
@@ -100,7 +131,10 @@ WebImageCache::at(int32_t index) const
void
WebImageCache
::
downloadFinished
(
QNetworkReply
*
reply
)
{
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
reply
->
deleteLater
();
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
return
;
}
QVariant
attribute
=
reply
->
attribute
(
QNetworkRequest
::
RedirectionTargetAttribute
);
...
...
src/ui/map3D/WebImageCache.h
View file @
eaaa3eb4
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL 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 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of the class WebImageCache.
*
* @author Lionel Heng <hengli@student.ethz.ch>
*
*/
#ifndef WEBIMAGECACHE_H
#define WEBIMAGECACHE_H
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment