Merge pull request #5971 from AlexeyAB:correct_lighting_3d_reconstruct

pull/5985/head
Alexander Alekhin 9 years ago
commit 3f8d5be56f
  1. 3
      modules/viz/include/opencv2/viz/widgets.hpp
  2. 8
      modules/viz/src/widget.cpp

@ -67,7 +67,8 @@ namespace cv
REPRESENTATION, REPRESENTATION,
IMMEDIATE_RENDERING, IMMEDIATE_RENDERING,
SHADING, SHADING,
AMBIENT AMBIENT,
LIGHTING
}; };
enum RepresentationValues enum RepresentationValues

@ -115,6 +115,14 @@ void cv::viz::Widget::setRenderingProperty(int property, double value)
case LINE_WIDTH: actor->GetProperty()->SetLineWidth(float(value)); break; case LINE_WIDTH: actor->GetProperty()->SetLineWidth(float(value)); break;
case IMMEDIATE_RENDERING: actor->GetMapper()->SetImmediateModeRendering(int(value)); break; case IMMEDIATE_RENDERING: actor->GetMapper()->SetImmediateModeRendering(int(value)); break;
case AMBIENT: actor->GetProperty()->SetAmbient(float(value)); break; case AMBIENT: actor->GetProperty()->SetAmbient(float(value)); break;
case LIGHTING:
{
if (value == 0)
actor->GetProperty()->LightingOff();
else
actor->GetProperty()->LightingOn();
break;
}
case FONT_SIZE: case FONT_SIZE:
{ {
vtkTextActor* text_actor = vtkTextActor::SafeDownCast(actor); vtkTextActor* text_actor = vtkTextActor::SafeDownCast(actor);

Loading…
Cancel
Save