<commit_before>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkLightKit.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "vtkLightKit.h"

#include "vtkObjectFactory.h"
#include "vtkLight.h"
#include "vtkPiecewiseFunction.h"
#include "vtkRenderer.h"

vtkCxxRevisionMacro(vtkLightKit, "1.24");
vtkStandardNewMacro(vtkLightKit);

static const char *vtkLightKitTypeStrings[] = {
  "KeyLight",
  "FillLight",
  "BackLight",
  "HeadLight",
  NULL
};

static const char *vtkLightKitSubTypeStrings[] = {
  "Warmth",
  "Intensity",
  "Elevation",
  "Azimuth",
  "K:F Ratio",
  "K:B Ratio",
  "K:H Ratio",
  NULL
};

// These are the same as vtkLightKitSubTypeStrings but shorter
// usefull for a GUI with minimum space
static const char *vtkLightKitSubTypeShortStrings[] = {
  "War.",
  "Int. ",
  "Ele.",
  "Azi.",
  "K:F",
  "K:B",
  "K:H",
  NULL
};


//----------------------------------------------------------------------------
vtkLightKit::vtkLightKit()
{
  // create members
  this->KeyLight = vtkLight::New();
  this->FillLight = vtkLight::New();
  this->HeadLight = vtkLight::New();
  this->BackLight0 = vtkLight::New();
  this->BackLight1 = vtkLight::New();

  for(int i = 0; i < 4; i++)
    {
    this->WarmthFunction[i] = vtkPiecewiseFunction::New();
    }
  this->InitializeWarmthFunctions();

  // initialize values
  this->KeyLight->SetLightTypeToCameraLight();
  this->FillLight->SetLightTypeToCameraLight();
  this->BackLight0->SetLightTypeToCameraLight();
  this->BackLight1->SetLightTypeToCameraLight();

  this->HeadLight->SetLightTypeToHeadlight();

  this->SetKeyLightAngle(50.0, 10.0);
  this->SetFillLightAngle(-75.0, -10.0);
  this->SetBackLightAngle(0.0, 110.0);

  this->KeyLightWarmth  = 0.6;
  this->FillLightWarmth = 0.4;
  this->HeadLightWarmth = 0.5;
  this->BackLightWarmth = 0.5;

  this->KeyLightIntensity = 0.75;
  this->KeyToFillRatio = 3.0;
  this->KeyToBackRatio = 3.5;
  this->KeyToHeadRatio = 3.0;

  this->MaintainLuminance = 0;
}  

//----------------------------------------------------------------------------
vtkLightKit::~vtkLightKit()
{<commit_msg>BUG: A previous fix removed a call to Modified() in the contructor, causing the values on LightKit's lights not to be updated until a value was explicitly set.  Fixed the problem by calling the lower-baggage "Update()" at the end of the constructor.<commit_after>/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkLightKit.cxx

  Copyright (c) <NAME>, <NAME>, <NAME>
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "vtkLightKit.h"

#include "vtkObjectFactory.h"
#include "vtkLight.h"
#include "vtkPiecewiseFunction.h"
#include "vtkRenderer.h"

vtkCxxRevisionMacro(vtkLightKit, "1.25");
vtkStandardNewMacro(vtkLightKit);

static const char *vtkLightKitTypeStrings[] = {
  "KeyLight",
  "FillLight",
  "BackLight",
  "HeadLight",
  NULL
};

static const char *vtkLightKitSubTypeStrings[] = {
  "Warmth",
  "Intensity",
  "Elevation",
  "Azimuth",
  "K:F Ratio",
  "K:B Ratio",
  "K:H Ratio",
  NULL
};

// These are the same as vtkLightKitSubTypeStrings but shorter
// usefull for a GUI with minimum space
static const char *vtkLightKitSubTypeShortStrings[] = {
  "War.",
  "Int. ",
  "Ele.",
  "Azi.",
  "K:F",
  "K:B",
  "K:H",
  NULL
};


//----------------------------------------------------------------------------
vtkLightKit::vtkLightKit()
{
  // create members
  this->KeyLight = vtkLight::New();
  this->FillLight = vtkLight::New();
  this->HeadLight = vtkLight::New();
  this->BackLight0 = vtkLight::New();
  this->BackLight1 = vtkLight::New();

  for(int i = 0; i < 4; i++)
    {
    this->WarmthFunction[i] = vtkPiecewiseFunction::New();
    }
  this->InitializeWarmthFunctions();

  // initialize values
  this->KeyLight->SetLightTypeToCameraLight();
  this->FillLight->SetLightTypeToCameraLight();
  this->BackLight0->SetLightTypeToCameraLight();
  this->BackLight1->SetLightTypeToCameraLight();

  this->HeadLight->SetLightTypeToHeadlight();

  this->SetKeyLightAngle(50.0, 10.0);
  this->SetFillLightAngle(-75.0, -10.0);
  this->SetBackLightAngle(0.0, 110.0);

  this->KeyLightWarmth  = 0.6;
  this->FillLightWarmth = 0.4;
  this->HeadLightWarmth = 0.5;
  this->BackLightWarmth = 0.5;

  this->KeyLightIntensity = 0.75;
  this->KeyToFillRatio = 3.0;
  this->KeyToBackRatio = 3.5;
  this->KeyToHeadRatio = 3.0;

  this->MaintainLuminance = 0;
  this->Update();
}  

//----------------------------------------------------------------------------
vtkLightKit::~vtkLightKit()
{
{'fraction_non_alphanumeric': 0.24170704435333581, 'fraction_numerical': 0.016772269847185987, 'mean_word_length': 3.321256038647343, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 68, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1519203', 'n_tokens_mistral': 1811, 'n_tokens_neox': 1719, 'n_words': 374}