fixes #0002745: The Disappearing Grid

This commit is contained in:
wmayer
2017-12-02 17:17:43 +01:00
parent f08f160c37
commit e387c88920

View File

@@ -26,6 +26,7 @@
#ifndef _PreComp_
# include <Standard_math.hxx>
# include <Inventor/nodes/SoBaseColor.h>
# include <Inventor/nodes/SoDepthBuffer.h>
# include <Inventor/nodes/SoDrawStyle.h>
# include <Inventor/nodes/SoMaterial.h>
# include <Inventor/nodes/SoLineSet.h>
@@ -69,6 +70,7 @@ ViewProvider2DObject::ViewProvider2DObject()
GridRoot = new SoSeparator();
GridRoot->ref();
GridRoot->setName("GridRoot");
MinX = MinY = -100;
MaxX = MaxY = 100;
GridStyle.setEnums(GridStyleEnums);
@@ -147,6 +149,10 @@ SoSeparator* ViewProvider2DObject::createGrid(void)
carpet->vertexProperty = vts;
parent->addChild(carpet);*/
SoDepthBuffer *depth = new SoDepthBuffer;
depth->function = SoDepthBuffer::ALWAYS;
parent->addChild(depth);
// gridlines
mycolor = new SoBaseColor;
mycolor->rgb.setValue(0.7f, 0.7f ,0.7f);