OMNeT++ Simulation Library
6.0.3
|
16 #ifndef __OMNETPP_COSGCANVAS_H
17 #define __OMNETPP_COSGCANVAS_H
19 #include "cownedobject.h"
23 namespace osg {
class Node; }
69 struct SIM_API Vec3d {
70 double x = 0, y = 0, z = 0;
72 Vec3d(
double x,
double y,
double z): x(x), y(y), z(z) {}
96 Viewpoint(
const Vec3d& eye,
const Vec3d& center,
const Vec3d& up): eye(eye), center(center), up(up), valid(true) {}
114 double longitude = 0, latitude = 0, altitude = 0;
115 double heading = 0, pitch = 0, range = 0;
127 EarthViewpoint(
double longitude,
double latitude,
double altitude,
double heading,
double pitch,
double range)
128 : longitude(longitude), latitude(latitude), altitude(altitude), heading(heading), pitch(pitch), range(range), valid(true) {}
135 ViewerStyle viewerStyle;
138 Color clearColor = Color(128, 128, 220);
139 CameraManipulatorType cameraManipulatorType = CAM_AUTO;
140 double fieldOfViewAngle = 30;
144 Viewpoint *genericViewpoint;
145 EarthViewpoint *earthViewpoint;
153 cOsgCanvas(
const char *name=
nullptr, ViewerStyle viewerStyle=STYLE_GENERIC, osg::Node *scene=
nullptr);
155 virtual ~cOsgCanvas();
156 cOsgCanvas& operator=(
const cOsgCanvas& other);
162 virtual std::string str()
const override;
171 virtual void setScene(osg::Node *scene);
176 virtual osg::Node *
getScene()
const {
return scene;}
244 void setZFar(
double zFar) {this->zFar = zFar;}
253 void setZLimits(
double zNear,
double zFar) {this->zNear = zNear; this->zFar = zFar;}
264 bool hasZLimits()
const;
284 void setGenericViewpoint(
const Viewpoint& viewpoint);
297 void setEarthViewpoint(
const EarthViewpoint& earthViewpoint);
double getZNear() const
Definition: cosgcanvas.h:270
void setFieldOfViewAngle(double fieldOfViewAngle)
Definition: cosgcanvas.h:223
void setZLimits(double zNear, double zFar)
Definition: cosgcanvas.h:253
void setCameraManipulatorType(CameraManipulatorType manipulator)
Definition: cosgcanvas.h:213
bool valid
The validity of the data. If this is false, the vector members should not be read.
Definition: cosgcanvas.h:91
@ CAM_TRACKBALL
Allows unrestricted movement centered around an object.
Definition: cosgcanvas.h:64
double getFieldOfViewAngle() const
Definition: cosgcanvas.h:228
void setViewerStyle(ViewerStyle viewerStyle)
Definition: cosgcanvas.h:187
@ CAM_AUTO
Choose the camera manipulator automatically.
Definition: cosgcanvas.h:61
@ STYLE_GENERIC
For generic (non-osgEarth) OSG models.
Definition: cosgcanvas.h:50
CameraManipulatorType getCameraManipulatorType() const
Definition: cosgcanvas.h:218
void setZNear(double zNear)
Definition: cosgcanvas.h:236
virtual cOsgCanvas * dup() const override
Definition: cosgcanvas.h:161
double getZFar() const
Definition: cosgcanvas.h:276
Vec3d eye
Specifies the position of the eye point.
Definition: cosgcanvas.h:88
Defines a viewpoint in the 3D space.
Definition: cosgcanvas.h:85
@ CAM_TERRAIN
Suitable for flying above an object or terrain.
Definition: cosgcanvas.h:62
ViewerStyle getViewerStyle() const
Definition: cosgcanvas.h:192
@ CAM_OVERVIEW
Similar to TERRAIN, but only allows seeing the object from above.
Definition: cosgcanvas.h:63
Vec3d center
Specifies the position of the reference point.
Definition: cosgcanvas.h:89
const EarthViewpoint & getEarthViewpoint() const
Definition: cosgcanvas.h:302
CameraManipulatorType
Camera manupulator types.
Definition: cosgcanvas.h:60
const Color & getClearColor() const
Definition: cosgcanvas.h:204
Defines a viewpoint in 3D space with geographical coordinates, for osgEarth-style viewing.
Definition: cosgcanvas.h:111
ViewerStyle
Viewer styles.
Definition: cosgcanvas.h:49
void setClearColor(Color clearColor)
Definition: cosgcanvas.h:199
Vec3d up
Specifies the direction of the up vector.
Definition: cosgcanvas.h:90
virtual osg::Node * getScene() const
Definition: cosgcanvas.h:176
const Viewpoint & getGenericViewpoint() const
Definition: cosgcanvas.h:289
void setZFar(double zFar)
Definition: cosgcanvas.h:244
Wraps an OpenSceneGraph scene, allowing 3D visualization in graphical user interfaces that support it...
Definition: cosgcanvas.h:42
EarthViewpoint(double longitude, double latitude, double altitude, double heading, double pitch, double range)
Definition: cosgcanvas.h:127
A cObject that keeps track of its owner. It serves as base class for many classes in the OMNeT++ libr...
Definition: cownedobject.h:105