|
@@ -757,7 +757,8 @@ Viewer::Viewer(roadmanager::OpenDrive* odrManager, const char* modelFilename, co
|
|
|
|
|
|
// Check if the viewer has been created correctly - window created is a indication
|
|
|
osgViewer::ViewerBase::Windows wins;
|
|
|
- osgViewer_->getWindows(wins);
|
|
|
+ osgViewer_->getWindows(wins);
|
|
|
+
|
|
|
if (wins.size() == 0)
|
|
|
{
|
|
|
// Viewer failed to create window. Probably Anti Aliasing is not supported on executing platform.
|
|
@@ -966,6 +967,7 @@ Viewer::Viewer(roadmanager::OpenDrive* odrManager, const char* modelFilename, co
|
|
|
{
|
|
|
// Default background color
|
|
|
osgViewer_->getCamera()->setClearColor(osg::Vec4(0.5f, 0.75f, 1.0f, 0.0f));
|
|
|
+ osgViewer_->getCamera()->setClearColor(osg::Vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
|
|
}
|
|
|
|
|
|
// add the window size toggle handler
|
|
@@ -1015,6 +1017,17 @@ Viewer::Viewer(roadmanager::OpenDrive* odrManager, const char* modelFilename, co
|
|
|
|
|
|
osgViewer_->realize();
|
|
|
|
|
|
+ /****************************2021 apollo_fu add****************************************/
|
|
|
+ //设置显示窗口的大小
|
|
|
+ osgViewer::GraphicsWindow *pWnd = dynamic_cast<osgViewer::GraphicsWindow*>(osgViewer_->getCamera()->getGraphicsContext());
|
|
|
+ if (pWnd) {
|
|
|
+ pWnd->setWindowRectangle(400, 200, 800, 600);
|
|
|
+
|
|
|
+ pWnd->setWindowDecoration(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**************************************************************************/
|
|
|
+
|
|
|
// Overlay text
|
|
|
osg::ref_ptr<osg::Geode> textGeode = new osg::Geode;
|
|
|
osg::Vec4 layoutColor(0.9f, 0.9f, 0.9f, 1.0f);
|
|
@@ -1657,7 +1670,9 @@ bool Viewer::CreateRoadMarkLines(roadmanager::OpenDrive* od)
|
|
|
point.set(osi_point2.x, osi_point2.y, osi_point2.z + z_offset);
|
|
|
osi_rm_points->push_back(point);
|
|
|
|
|
|
- osi_rm_color->push_back(osg::Vec4(color_white[0], color_white[1], color_white[2], 1.0));
|
|
|
+ osi_rm_color->push_back(osg::Vec4(color_white[0], color_white[1], color_white[2], 1.0));
|
|
|
+// osi_rm_color->push_back(osg::Vec4(color_yellow[0], color_yellow[1], color_yellow[2], 1.0));
|
|
|
+
|
|
|
|
|
|
// Put points at the start and end of the roadmark
|
|
|
osi_rm_point->setSize(6.0f);
|
|
@@ -1701,7 +1716,8 @@ bool Viewer::CreateRoadMarkLines(roadmanager::OpenDrive* od)
|
|
|
{
|
|
|
point.set(curr_osi_rm.GetPoint(s).x, curr_osi_rm.GetPoint(s).y, curr_osi_rm.GetPoint(s).z + z_offset);
|
|
|
osi_rm_points->push_back(point);
|
|
|
- osi_rm_color->push_back(osg::Vec4(color_white[0], color_white[1], color_white[2], 1.0));
|
|
|
+ osi_rm_color->push_back(osg::Vec4(color_white[0], color_white[1], color_white[2], 1.0));
|
|
|
+// osi_rm_color->push_back(osg::Vec4(color_yellow[0], color_yellow[1], color_yellow[2], 1.0));
|
|
|
}
|
|
|
|
|
|
// Put points on selected locations
|
|
@@ -1717,7 +1733,8 @@ bool Viewer::CreateRoadMarkLines(roadmanager::OpenDrive* od)
|
|
|
|
|
|
// Draw lines between each selected points
|
|
|
lineWidth->setWidth(OSI_LINE_WIDTH);
|
|
|
- color->push_back(osg::Vec4(color_white[0], color_white[1], color_white[2], 1.0));
|
|
|
+ color->push_back(osg::Vec4(color_white[0], color_white[1], color_white[2], 1.0));
|
|
|
+// color->push_back(osg::Vec4(color_yellow[0], color_yellow[1], color_yellow[2], 1.0));
|
|
|
|
|
|
geom->setVertexArray(osi_rm_points.get());
|
|
|
geom->setColorArray(color.get());
|