16 #ifndef __OMNETPP_COSGCANVAS_H 17 #define __OMNETPP_COSGCANVAS_H 19 #include "cownedobject.h" 23 namespace osg {
class Node; }
69 struct SIM_API Vec3d {
71 Vec3d() : 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) {}
140 double fieldOfViewAngle;
153 cOsgCanvas(
const char *name=
nullptr,
ViewerStyle viewerStyle=STYLE_GENERIC, osg::Node *scene=
nullptr);
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);
Suitable for flying above an object or terrain.
Definition: cosgcanvas.h:62
Similar to TERRAIN, but only allows seeing the object from above.
Definition: cosgcanvas.h:63
Defines a viewpoint in the 3D space.
Definition: cosgcanvas.h:85
Choose the camera manipulator automatically.
Definition: cosgcanvas.h:61
CameraManipulatorType getCameraManipulatorType() const
Definition: cosgcanvas.h:218
virtual cOsgCanvas * dup() const override
Definition: cosgcanvas.h:161
EarthViewpoint(double longitude, double latitude, double altitude, double heading, double pitch, double range)
Definition: cosgcanvas.h:127
ViewerStyle getViewerStyle() const
Definition: cosgcanvas.h:192
double getFieldOfViewAngle() const
Definition: cosgcanvas.h:228
Wraps an OpenSceneGraph scene, allowing 3D visualization in graphical user interfaces that support it...
Definition: cosgcanvas.h:42
double getZFar() const
Definition: cosgcanvas.h:276
bool valid
The validity of the data. If this is false, the vector members should not be read.
Definition: cosgcanvas.h:91
Defines a viewpoint in 3D space with geographical coordinates, for osgEarth-style viewing...
Definition: cosgcanvas.h:111
double getZNear() const
Definition: cosgcanvas.h:270
const Color & getClearColor() const
Definition: cosgcanvas.h:204
void setZNear(double zNear)
Definition: cosgcanvas.h:236
Vec3d eye
Specifies the position of the eye point.
Definition: cosgcanvas.h:88
void setZLimits(double zNear, double zFar)
Definition: cosgcanvas.h:253
Vec3d center
Specifies the position of the reference point.
Definition: cosgcanvas.h:89
void setFieldOfViewAngle(double fieldOfViewAngle)
Definition: cosgcanvas.h:223
void setZFar(double zFar)
Definition: cosgcanvas.h:244
void setViewerStyle(ViewerStyle viewerStyle)
Definition: cosgcanvas.h:187
A cObject that keeps track of its owner. It serves as base class for many classes in the OMNeT++ libr...
Definition: cownedobject.h:104
Allows unrestricted movement centered around an object.
Definition: cosgcanvas.h:64
Vec3d up
Specifies the direction of the up vector.
Definition: cosgcanvas.h:90
CameraManipulatorType
Camera manupulator types.
Definition: cosgcanvas.h:60
void setClearColor(Color clearColor)
Definition: cosgcanvas.h:199
Definition: cabstracthistogram.h:21
const EarthViewpoint & getEarthViewpoint() const
Definition: cosgcanvas.h:302
void setCameraManipulatorType(CameraManipulatorType manipulator)
Definition: cosgcanvas.h:213
ViewerStyle
Viewer styles.
Definition: cosgcanvas.h:49
virtual osg::Node * getScene() const
Definition: cosgcanvas.h:176
For generic (non-osgEarth) OSG models.
Definition: cosgcanvas.h:50
const Viewpoint & getGenericViewpoint() const
Definition: cosgcanvas.h:289