51class CameraManipulator;
52class NodeTrackerManipulator;
73 NODESET_TLSLINKMARKERS,
92 Command_TLSChange(
const MSLink*
const link, osg::Switch* switchNode);
95 virtual ~Command_TLSChange();
107 const MSLink*
const myLink;
110 osg::ref_ptr<osg::Switch> mySwitch;
117 Command_TLSChange(
const Command_TLSChange&) =
delete;
120 Command_TLSChange& operator=(
const Command_TLSChange&) =
delete;
125 osg::ref_ptr<osg::PositionAttitudeTransform> pos;
126 osg::ref_ptr<osg::ShapeDrawable> geom;
127 osg::ref_ptr<osg::Material> mat;
128 osg::ref_ptr<osg::Switch> lights;
138 virtual ~GUIOSGView();
202 long onKeyPress(FXObject*, FXSelector,
void*);
212 long onPaint(FXObject*, FXSelector,
void*);
213 long OnIdle(FXObject* sender, FXSelector sel,
void* ptr);
230 static osg::Vec4d toOSGColorVector(
RGBColor c,
bool useAlpha =
false);
236 void updatePositionInformation()
const;
239 bool getPositionAtCursor(
float xNorm,
float yNorm,
Position& pos)
const;
250 void initChanger(
const Boundary& viewPort);
253 void adoptViewSettings();
256 double calculateRotation(
const osg::Vec3d& lookFrom,
const osg::Vec3d& lookAt,
const osg::Vec3d& up);
258 class SUMOTerrainManipulator :
public osgGA::TerrainManipulator {
260 SUMOTerrainManipulator() {
261 setAllowThrow(
false);
262 setVerticalAxisFixed(
false);
264 bool performMovementLeftMouseButton(
const double eventTimeDelta,
const double dx,
const double dy) {
265 return osgGA::TerrainManipulator::performMovementMiddleMouseButton(eventTimeDelta, dx, dy);
267 bool performMovementMiddleMouseButton(
const double eventTimeDelta,
const double dx,
const double dy) {
268 return osgGA::TerrainManipulator::performMovementLeftMouseButton(eventTimeDelta, dx, dy);
270 bool performMovementRightMouseButton(
const double eventTimeDelta,
const double dx,
const double dy) {
271 return osgGA::TerrainManipulator::performMovementRightMouseButton(eventTimeDelta, dx, -dy);
275 class FXOSGAdapter :
public osgViewer::GraphicsWindow {
279 void grabFocusIfPointerInWindow() {}
280 void useCursor(
bool cursorOn);
282 bool makeCurrentImplementation();
283 bool releaseContext();
284 void swapBuffersImplementation();
290 bool realizeImplementation() {
293 bool isRealizedImplementation()
const {
296 void closeImplementation() {}
297 bool releaseContextImplementation() {
305 FXCursor*
const myOldCursor;
308 class PickHandler :
public osgGA::GUIEventHandler {
310 PickHandler(GUIOSGView* parent) : myParent(parent), myDrag(false) {};
311 bool handle(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
315 GUIOSGView*
const myParent;
322 osg::ref_ptr<FXOSGAdapter> myAdapter;
323 osg::ref_ptr<osgViewer::Viewer> myViewer;
324 osg::ref_ptr<osg::Group> myRoot;
328 osg::ref_ptr<SUMOTerrainManipulator> myCameraManipulator;
332 float myOSGNormalizedCursorX, myOSGNormalizedCursorY;
334 std::map<MSVehicle*, OSGMovable > myVehicles;
335 std::map<MSTransportable*, OSGMovable > myPersons;
337 osg::ref_ptr<osg::Node> myGreenLight;
338 osg::ref_ptr<osg::Node> myYellowLight;
339 osg::ref_ptr<osg::Node> myRedLight;
340 osg::ref_ptr<osg::Node> myRedYellowLight;
341 osg::ref_ptr<osg::Node> myPoleBase;
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
A class that stores a 2D geometrical boundary.
Representation of a lane in the micro simulation (gui-version)
A MSNet extended by some values for usage within the gui.
virtual long onLeftBtnRelease(FXObject *, FXSelector, void *)
virtual long onVisualizationChange(FXObject *, FXSelector, void *)
hook to react on change in visualization settings
std::vector< GUIGlObject * > getGUIGlObjectsUnderCursor()
returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects)
virtual void recenterView()
recenters the view
virtual SUMOTime getCurrentTimeStep() const
get the current simulation time
virtual long onMiddleBtnRelease(FXObject *, FXSelector, void *)
virtual long onMouseMove(FXObject *, FXSelector, void *)
virtual long onCmdCloseEdge(FXObject *, FXSelector, void *)
virtual void buildViewToolBars(GUIGlChildWindow *)
builds the view toolbars
virtual void showViewportEditor()
show viewport editor
virtual void zoom2Pos(Position &camera, Position &lookAt, double zoom)
zoom interface for 3D view
virtual long onCmdCloseLane(FXObject *, FXSelector, void *)
interaction with the simulation
virtual long onLeftBtnPress(FXObject *, FXSelector, void *)
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
virtual GUILane * getLaneUnderCursor()
returns the GUILane at cursor position (implementation depends on view)
virtual void onGamingClick(Position)
on gaming click
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual long onMiddleBtnPress(FXObject *, FXSelector, void *)
virtual void stopTrack()
stop track
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
void setWindowCursorPosition(FXint x, FXint y)
Returns the gl-id of the object under the given coordinates.
virtual long onCmdShowReachability(FXObject *, FXSelector, void *)
highlight edges according to reachability
virtual void recalculateBoundaries()=0
recalculate boundaries
virtual void updateViewportValues()
update the viewport chooser with the current view values
virtual void startTrack(int)
star track
virtual bool is3DView() const
return whether this is a 3D view
virtual long onRightBtnRelease(FXObject *, FXSelector, void *)
virtual void copyViewportTo(GUISUMOAbstractView *view)
copy the viewport to the given view
virtual bool setColorScheme(const std::string &)
set color scheme
virtual long onCmdAddRerouter(FXObject *, FXSelector, void *)
virtual long onPaint(FXObject *, FXSelector, void *)
virtual long onRightBtnPress(FXObject *, FXSelector, void *)
virtual long onConfigure(FXObject *, FXSelector, void *)
mouse functions
virtual GUIGlID getTrackedID() const
get tracked id
A single child window which contains a view of the simulation area.
A MSVehicle extended by some values for usage within the gui.
Base class for things to execute if a tls switches to a new phase.
Representation of a vehicle in the micro simulation.
A point in 2D or 3D with translation and scaling methods.