From 9528a60cd6d7885ecc4e0e6085ae51266cd5febf Mon Sep 17 00:00:00 2001 From: sreekanth-arikatla <sreekanth.arikatla@kitware.com> Date: Wed, 23 Jun 2021 17:30:55 -0400 Subject: [PATCH] REFAC: Move light classes into their own headers --- Examples/BoneShaving/BoneShavingExample.cpp | 2 +- .../CameraControllerExample.cpp | 2 +- .../ManualCDWithOctreeExample.cpp | 2 +- .../CreateEnclosingMesh.cpp | 2 +- .../DebugRendering/DebugRenderingExample.cpp | 2 +- .../DeformableBody/DeformableBodyExample.cpp | 2 +- Examples/FemurCut/FemurCutExample.cpp | 2 +- .../GeometryProcessingExample.cpp | 2 +- .../GeometryTransformsExample.cpp | 2 +- Examples/Levelset/levelsetExample.cpp | 2 +- Examples/MultipleScenes/multipleScenes.cpp | 3 +- .../ObjectControllerExample.cpp | 2 +- .../ObjectCtrlDummyClientExample.cpp | 2 +- Examples/Octree/OctreeExample.cpp | 2 +- .../OpenVRControllerExample.cpp | 2 +- Examples/PBD/PBDCloth/pbdClothExample.cpp | 2 +- .../PBDClothRemap/pbdClothRemapExample.cpp | 3 +- .../PBDCollisionMultipleObjectsExample.cpp | 2 +- .../PBDCollisionOneObjectExample.cpp | 2 +- .../PBDCollisionStairsExample.cpp | 2 +- .../PBD3DDeformableObject.cpp | 2 +- .../PBD/PBDInjection/PBDInjectExample.cpp | 2 +- Examples/PBDCutting/PBDCuttingExample.cpp | 2 +- Examples/PBDPicking/PBDPickingExample.cpp | 2 +- Examples/ReducedFEM/ReducedFEM.cpp | 2 +- Examples/Rendering/RenderingExample.cpp | 2 +- .../RigidBodyDynamicsExample.cpp | 2 +- .../RigidBodyDynamicsExample2.cpp | 2 +- .../RigidBodyVirtualCouplingExample.cpp | 2 +- Examples/SDFHaptics/SDFHapticsExample.cpp | 2 +- Examples/SPH-FEM-PBD/sphFemPbdExample.cpp | 2 +- .../SPH-Obj-SDFInteractionExample.cpp | 2 +- Examples/SPHFluid/SPHFluidExample.hpp | 2 +- Examples/Screenshot/ScreenshotExample.cpp | 4 +- Examples/Vessel/vesselExample.cpp | 2 +- .../VirtualCouplingExample.cpp | 2 +- .../VTKRenderer/imstkVTKRenderer.cpp | 4 +- .../Lights/imstkDirectionalLight.h | 54 ++++++++ Source/SceneEntities/Lights/imstkLight.h | 127 ------------------ Source/SceneEntities/Lights/imstkPointLight.h | 83 ++++++++++++ Source/SceneEntities/Lights/imstkSpotLight.h | 64 +++++++++ 41 files changed, 244 insertions(+), 164 deletions(-) create mode 100644 Source/SceneEntities/Lights/imstkDirectionalLight.h create mode 100644 Source/SceneEntities/Lights/imstkPointLight.h create mode 100644 Source/SceneEntities/Lights/imstkSpotLight.h diff --git a/Examples/BoneShaving/BoneShavingExample.cpp b/Examples/BoneShaving/BoneShavingExample.cpp index 314d687e1..accdeffb5 100644 --- a/Examples/BoneShaving/BoneShavingExample.cpp +++ b/Examples/BoneShaving/BoneShavingExample.cpp @@ -25,7 +25,7 @@ #include "imstkHapticDeviceClient.h" #include "imstkHapticDeviceManager.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/CameraController/CameraControllerExample.cpp b/Examples/CameraController/CameraControllerExample.cpp index a50bb128b..da1a7cf3b 100644 --- a/Examples/CameraController/CameraControllerExample.cpp +++ b/Examples/CameraController/CameraControllerExample.cpp @@ -24,7 +24,7 @@ #include "imstkHapticDeviceClient.h" #include "imstkHapticDeviceManager.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/CollisionDetection/ManualCDWithOctree/ManualCDWithOctreeExample.cpp b/Examples/CollisionDetection/ManualCDWithOctree/ManualCDWithOctreeExample.cpp index b586424f6..e53376d0a 100644 --- a/Examples/CollisionDetection/ManualCDWithOctree/ManualCDWithOctreeExample.cpp +++ b/Examples/CollisionDetection/ManualCDWithOctree/ManualCDWithOctreeExample.cpp @@ -25,7 +25,7 @@ #include "imstkDebugRenderGeometry.h" #include "imstkKeyboardDeviceClient.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" #include "imstkOctreeBasedCD.h" diff --git a/Examples/CreateEnclosingMesh/CreateEnclosingMesh.cpp b/Examples/CreateEnclosingMesh/CreateEnclosingMesh.cpp index 3ddc19e30..c8272bfb9 100644 --- a/Examples/CreateEnclosingMesh/CreateEnclosingMesh.cpp +++ b/Examples/CreateEnclosingMesh/CreateEnclosingMesh.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkGeometryUtilities.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/DebugRendering/DebugRenderingExample.cpp b/Examples/DebugRendering/DebugRenderingExample.cpp index 819b50af7..a83a04871 100644 --- a/Examples/DebugRendering/DebugRenderingExample.cpp +++ b/Examples/DebugRendering/DebugRenderingExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkDebugRenderGeometry.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/DeformableBody/DeformableBodyExample.cpp b/Examples/DeformableBody/DeformableBodyExample.cpp index 3e6e0e4f9..58a4d74f0 100644 --- a/Examples/DeformableBody/DeformableBodyExample.cpp +++ b/Examples/DeformableBody/DeformableBodyExample.cpp @@ -24,7 +24,7 @@ #include "imstkFeDeformableObject.h" #include "imstkFEMDeformableBodyModel.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/FemurCut/FemurCutExample.cpp b/Examples/FemurCut/FemurCutExample.cpp index 40c976569..a83afaada 100644 --- a/Examples/FemurCut/FemurCutExample.cpp +++ b/Examples/FemurCut/FemurCutExample.cpp @@ -26,7 +26,7 @@ #include "imstkKeyboardSceneControl.h" #include "imstkLevelSetCH.h" #include "imstkLevelSetModel.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/GeometryProcessing/GeometryProcessingExample.cpp b/Examples/GeometryProcessing/GeometryProcessingExample.cpp index 5e198b2b1..f2c196e7b 100644 --- a/Examples/GeometryProcessing/GeometryProcessingExample.cpp +++ b/Examples/GeometryProcessing/GeometryProcessingExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkDataArray.h" #include "imstkImageData.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkNew.h" diff --git a/Examples/GeometryTransforms/GeometryTransformsExample.cpp b/Examples/GeometryTransforms/GeometryTransformsExample.cpp index d612eed65..626b8226b 100644 --- a/Examples/GeometryTransforms/GeometryTransformsExample.cpp +++ b/Examples/GeometryTransforms/GeometryTransformsExample.cpp @@ -23,7 +23,7 @@ #include "imstkCamera.h" #include "imstkCylinder.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/Levelset/levelsetExample.cpp b/Examples/Levelset/levelsetExample.cpp index 0256682ce..717cb042e 100644 --- a/Examples/Levelset/levelsetExample.cpp +++ b/Examples/Levelset/levelsetExample.cpp @@ -23,7 +23,7 @@ #include "imstkKeyboardSceneControl.h" #include "imstkLevelSetDeformableObject.h" #include "imstkLevelSetModel.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/MultipleScenes/multipleScenes.cpp b/Examples/MultipleScenes/multipleScenes.cpp index e1b489738..1347ce269 100644 --- a/Examples/MultipleScenes/multipleScenes.cpp +++ b/Examples/MultipleScenes/multipleScenes.cpp @@ -22,7 +22,8 @@ #include "imstkCamera.h" #include "imstkConsoleModule.h" #include "imstkKeyboardDeviceClient.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" +#include "imstkSpotLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkNew.h" diff --git a/Examples/ObjectController/ObjectControllerExample.cpp b/Examples/ObjectController/ObjectControllerExample.cpp index 99db5e0b6..0701337d1 100644 --- a/Examples/ObjectController/ObjectControllerExample.cpp +++ b/Examples/ObjectController/ObjectControllerExample.cpp @@ -27,7 +27,7 @@ #include "imstkHapticDeviceManager.h" #include "imstkKeyboardDeviceClient.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/ObjectControllerDummyClient/ObjectCtrlDummyClientExample.cpp b/Examples/ObjectControllerDummyClient/ObjectCtrlDummyClientExample.cpp index 8d586705c..fc48cdf0c 100644 --- a/Examples/ObjectControllerDummyClient/ObjectCtrlDummyClientExample.cpp +++ b/Examples/ObjectControllerDummyClient/ObjectCtrlDummyClientExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkCollidingObject.h" #include "imstkDummyClient.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkNew.h" #include "imstkOrientedBox.h" diff --git a/Examples/Octree/OctreeExample.cpp b/Examples/Octree/OctreeExample.cpp index da1d90c76..32cf71efa 100644 --- a/Examples/Octree/OctreeExample.cpp +++ b/Examples/Octree/OctreeExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkDebugRenderGeometry.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkLooseOctree.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/OpenVRController/OpenVRControllerExample.cpp b/Examples/OpenVRController/OpenVRControllerExample.cpp index 74491f6d5..70f02959f 100644 --- a/Examples/OpenVRController/OpenVRControllerExample.cpp +++ b/Examples/OpenVRController/OpenVRControllerExample.cpp @@ -20,7 +20,7 @@ =========================================================================*/ #include "imstkCamera.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkNew.h" diff --git a/Examples/PBD/PBDCloth/pbdClothExample.cpp b/Examples/PBD/PBDCloth/pbdClothExample.cpp index 3002dfe2b..fc86c0a84 100644 --- a/Examples/PBD/PBDCloth/pbdClothExample.cpp +++ b/Examples/PBD/PBDCloth/pbdClothExample.cpp @@ -23,7 +23,7 @@ #include "imstkImageData.h" #include "imstkKeyboardDeviceClient.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/PBD/PBDClothRemap/pbdClothRemapExample.cpp b/Examples/PBD/PBDClothRemap/pbdClothRemapExample.cpp index df20fdeee..64ba1f18d 100644 --- a/Examples/PBD/PBDClothRemap/pbdClothRemapExample.cpp +++ b/Examples/PBD/PBDClothRemap/pbdClothRemapExample.cpp @@ -22,7 +22,8 @@ #include "imstkCamera.h" #include "imstkKeyboardDeviceClient.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" +#include "imstkSpotLight.h" #include "imstkLogger.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/PBD/PBDCollisionMultipleObjects/PBDCollisionMultipleObjectsExample.cpp b/Examples/PBD/PBDCollisionMultipleObjects/PBDCollisionMultipleObjectsExample.cpp index 07b382ee4..5eaf9b397 100644 --- a/Examples/PBD/PBDCollisionMultipleObjects/PBDCollisionMultipleObjectsExample.cpp +++ b/Examples/PBD/PBDCollisionMultipleObjects/PBDCollisionMultipleObjectsExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkCollisionGraph.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/PBD/PBDCollisionOneObject/PBDCollisionOneObjectExample.cpp b/Examples/PBD/PBDCollisionOneObject/PBDCollisionOneObjectExample.cpp index 8a07a6e22..a4c8d5c70 100644 --- a/Examples/PBD/PBDCollisionOneObject/PBDCollisionOneObjectExample.cpp +++ b/Examples/PBD/PBDCollisionOneObject/PBDCollisionOneObjectExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkCollisionGraph.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/PBD/PBDCollisionStairs/PBDCollisionStairsExample.cpp b/Examples/PBD/PBDCollisionStairs/PBDCollisionStairsExample.cpp index 60d0e78d8..d98e9d784 100644 --- a/Examples/PBD/PBDCollisionStairs/PBDCollisionStairsExample.cpp +++ b/Examples/PBD/PBDCollisionStairs/PBDCollisionStairsExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkCollisionGraph.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/PBD/PBDDeformableObject/PBD3DDeformableObject.cpp b/Examples/PBD/PBDDeformableObject/PBD3DDeformableObject.cpp index af1fa4720..7c08770fe 100644 --- a/Examples/PBD/PBDDeformableObject/PBD3DDeformableObject.cpp +++ b/Examples/PBD/PBDDeformableObject/PBD3DDeformableObject.cpp @@ -21,7 +21,7 @@ #include "imstkCamera.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/PBD/PBDInjection/PBDInjectExample.cpp b/Examples/PBD/PBDInjection/PBDInjectExample.cpp index 37de20a2f..8f0e81f15 100644 --- a/Examples/PBD/PBDInjection/PBDInjectExample.cpp +++ b/Examples/PBD/PBDInjection/PBDInjectExample.cpp @@ -24,7 +24,7 @@ #include "imstkImageData.h" #include "imstkKeyboardDeviceClient.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMouseSceneControl.h" #include "imstkOneToOneMap.h" #include "imstkPbdModel.h" diff --git a/Examples/PBDCutting/PBDCuttingExample.cpp b/Examples/PBDCutting/PBDCuttingExample.cpp index d372d7611..dc3e9761c 100644 --- a/Examples/PBDCutting/PBDCuttingExample.cpp +++ b/Examples/PBDCutting/PBDCuttingExample.cpp @@ -24,7 +24,7 @@ #include "imstkHapticDeviceManager.h" #include "imstkKeyboardDeviceClient.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/PBDPicking/PBDPickingExample.cpp b/Examples/PBDPicking/PBDPickingExample.cpp index 71c3845b0..c28feeee6 100644 --- a/Examples/PBDPicking/PBDPickingExample.cpp +++ b/Examples/PBDPicking/PBDPickingExample.cpp @@ -26,7 +26,7 @@ #include "imstkHapticDeviceManager.h" #include "imstkKeyboardSceneControl.h" #include "imstkLaparoscopicToolController.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/ReducedFEM/ReducedFEM.cpp b/Examples/ReducedFEM/ReducedFEM.cpp index 4192ca9f1..34f315e43 100644 --- a/Examples/ReducedFEM/ReducedFEM.cpp +++ b/Examples/ReducedFEM/ReducedFEM.cpp @@ -28,7 +28,7 @@ #include "imstkMouseSceneControl.h" #include "imstkNew.h" #include "imstkOneToOneMap.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkCamera.h" #include "imstkReducedStVKBodyModel.h" #include "imstkReducedFeDeformableObject.h" diff --git a/Examples/Rendering/RenderingExample.cpp b/Examples/Rendering/RenderingExample.cpp index 17fd9a6ba..6dc468abb 100644 --- a/Examples/Rendering/RenderingExample.cpp +++ b/Examples/Rendering/RenderingExample.cpp @@ -23,7 +23,7 @@ #include "imstkCamera.h" #include "imstkIBLProbe.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/RigidBodyDynamics/RigidBodyDynamicsExample.cpp b/Examples/RigidBodyDynamics/RigidBodyDynamicsExample.cpp index 01b4d27ea..ab2698154 100644 --- a/Examples/RigidBodyDynamics/RigidBodyDynamicsExample.cpp +++ b/Examples/RigidBodyDynamics/RigidBodyDynamicsExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkIsometricMap.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/RigidBodyDynamics2/RigidBodyDynamicsExample2.cpp b/Examples/RigidBodyDynamics2/RigidBodyDynamicsExample2.cpp index 596833707..618aa0c0c 100644 --- a/Examples/RigidBodyDynamics2/RigidBodyDynamicsExample2.cpp +++ b/Examples/RigidBodyDynamics2/RigidBodyDynamicsExample2.cpp @@ -26,7 +26,7 @@ #include "imstkImplicitGeometryToImageData.h" #include "imstkKeyboardDeviceClient.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/RigidBodyVirtualCoupling/RigidBodyVirtualCouplingExample.cpp b/Examples/RigidBodyVirtualCoupling/RigidBodyVirtualCouplingExample.cpp index 0dcc94293..8b026bc02 100644 --- a/Examples/RigidBodyVirtualCoupling/RigidBodyVirtualCouplingExample.cpp +++ b/Examples/RigidBodyVirtualCoupling/RigidBodyVirtualCouplingExample.cpp @@ -24,7 +24,7 @@ #include "imstkHapticDeviceManager.h" #include "imstkIsometricMap.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/SDFHaptics/SDFHapticsExample.cpp b/Examples/SDFHaptics/SDFHapticsExample.cpp index 60badea5d..7be500955 100644 --- a/Examples/SDFHaptics/SDFHapticsExample.cpp +++ b/Examples/SDFHaptics/SDFHapticsExample.cpp @@ -26,7 +26,7 @@ #include "imstkImageData.h" #include "imstkImplicitFunctionFiniteDifferenceFunctor.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkLogger.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" diff --git a/Examples/SPH-FEM-PBD/sphFemPbdExample.cpp b/Examples/SPH-FEM-PBD/sphFemPbdExample.cpp index 592832d12..628ba2706 100644 --- a/Examples/SPH-FEM-PBD/sphFemPbdExample.cpp +++ b/Examples/SPH-FEM-PBD/sphFemPbdExample.cpp @@ -25,7 +25,7 @@ #include "imstkFEMDeformableBodyModel.h" #include "imstkImageData.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/SPH-Obj-SDF/SPH-Obj-SDFInteractionExample.cpp b/Examples/SPH-Obj-SDF/SPH-Obj-SDFInteractionExample.cpp index 8d8edd2e8..f4057cfc2 100644 --- a/Examples/SPH-Obj-SDF/SPH-Obj-SDFInteractionExample.cpp +++ b/Examples/SPH-Obj-SDF/SPH-Obj-SDFInteractionExample.cpp @@ -22,7 +22,7 @@ #include "imstkCamera.h" #include "imstkCollisionGraph.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/SPHFluid/SPHFluidExample.hpp b/Examples/SPHFluid/SPHFluidExample.hpp index 3d4213296..41dde2cf3 100644 --- a/Examples/SPHFluid/SPHFluidExample.hpp +++ b/Examples/SPHFluid/SPHFluidExample.hpp @@ -23,7 +23,7 @@ #include "imstkCollisionDetection.h" #include "imstkCollisionGraph.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" #include "imstkObjectInteractionFactory.h" diff --git a/Examples/Screenshot/ScreenshotExample.cpp b/Examples/Screenshot/ScreenshotExample.cpp index 7d5f00659..8de5a6d13 100644 --- a/Examples/Screenshot/ScreenshotExample.cpp +++ b/Examples/Screenshot/ScreenshotExample.cpp @@ -22,7 +22,9 @@ #include "imstkCamera.h" #include "imstkKeyboardDeviceClient.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" +#include "imstkPointLight.h" +#include "imstkSpotLight.h" #include "imstkLogger.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/Vessel/vesselExample.cpp b/Examples/Vessel/vesselExample.cpp index 2ea57aebf..b4835a69c 100644 --- a/Examples/Vessel/vesselExample.cpp +++ b/Examples/Vessel/vesselExample.cpp @@ -25,7 +25,7 @@ #include "imstkImageData.h" #include "imstkImageDistanceTransform.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMeshIO.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" diff --git a/Examples/VirtualCoupling/VirtualCouplingExample.cpp b/Examples/VirtualCoupling/VirtualCouplingExample.cpp index 2b72da632..2b467f86d 100644 --- a/Examples/VirtualCoupling/VirtualCouplingExample.cpp +++ b/Examples/VirtualCoupling/VirtualCouplingExample.cpp @@ -28,7 +28,7 @@ #include "imstkHapticDeviceClient.h" #include "imstkHapticDeviceManager.h" #include "imstkKeyboardSceneControl.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" #include "imstkMouseSceneControl.h" #include "imstkNew.h" #include "imstkPlane.h" diff --git a/Source/Rendering/VTKRenderer/imstkVTKRenderer.cpp b/Source/Rendering/VTKRenderer/imstkVTKRenderer.cpp index 01d19b585..8cc1c9b32 100644 --- a/Source/Rendering/VTKRenderer/imstkVTKRenderer.cpp +++ b/Source/Rendering/VTKRenderer/imstkVTKRenderer.cpp @@ -22,7 +22,9 @@ #include "imstkVTKRenderer.h" #include "imstkCamera.h" #include "imstkDebugRenderGeometry.h" -#include "imstkLight.h" +#include "imstkDirectionalLight.h" +#include "imstkPointLight.h" +#include "imstkSpotLight.h" #include "imstkLogger.h" #include "imstkScene.h" #include "imstkSceneObject.h" diff --git a/Source/SceneEntities/Lights/imstkDirectionalLight.h b/Source/SceneEntities/Lights/imstkDirectionalLight.h new file mode 100644 index 000000000..e88e12fa4 --- /dev/null +++ b/Source/SceneEntities/Lights/imstkDirectionalLight.h @@ -0,0 +1,54 @@ +/*========================================================================= + + Library: iMSTK + + Copyright (c) Kitware, Inc. & Center for Modeling, Simulation, + & Imaging in Medicine, Rensselaer Polytechnic Institute. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0.txt + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +=========================================================================*/ + +#pragma once + +#include "imstkLight.h" + +namespace imstk +{ +/// +/// \class DirectionalLight +/// +/// \brief Directional light class +/// +/// A directional light has no position or range. The focal point is the +/// direction. +/// +class DirectionalLight : public Light +{ +public: + DirectionalLight(const std::string& name) : Light(name, LightType::Directional) + { + this->setFocalPoint(-1.0f, -1.0f, -1.0f); + } + + virtual ~DirectionalLight() override = default; + + virtual const std::string getTypeName() const { return "DirectionalLight"; } + + /// + /// \brief Direction of the light + /// + void setDirection(const Vec3d& dir) { setFocalPoint(dir); } + void setDirection(const double x, const double y, const double z) { setFocalPoint(Vec3d(x, y, z)); } +}; +} // imstk \ No newline at end of file diff --git a/Source/SceneEntities/Lights/imstkLight.h b/Source/SceneEntities/Lights/imstkLight.h index 333df01c1..c111a4d41 100644 --- a/Source/SceneEntities/Lights/imstkLight.h +++ b/Source/SceneEntities/Lights/imstkLight.h @@ -129,131 +129,4 @@ protected: std::string m_name; LightType m_type; }; - -//----------------------------------------------------------------------------- - -/// -/// \class DirectionalLight -/// -/// \brief Directional light class -/// -/// A directional light has no position or range. The focal point is the -/// direction. -/// -class DirectionalLight : public Light -{ -public: - DirectionalLight(const std::string& name) : Light(name, LightType::Directional) - { - this->setFocalPoint(-1.0f, -1.0f, -1.0f); - } - - virtual ~DirectionalLight() override = default; - -public: - virtual const std::string getTypeName() const { return "DirectionalLight"; } - - /// - /// \brief Direction of the light - /// - void setDirection(const Vec3d& dir) { setFocalPoint(dir); } - void setDirection(const double x, const double y, const double z) { setFocalPoint(Vec3d(x, y, z)); } - -protected: -}; - -//----------------------------------------------------------------------------- - -/// -/// \class PointLight -/// -/// \brief Point light class -/// -/// A point light has a position, and it's range is determined by it's -/// intensity. -/// -class PointLight : public Light -{ -public: - /// - /// \brief Constructors - /// - PointLight(const std::string& name, const LightType& type = LightType::Point) : Light(name, type) { } - - virtual ~PointLight() override = default; - -public: - virtual const std::string getTypeName() const { return "PointLight"; } - - /// - /// \brief Get the cone angle - /// - const float getConeAngle() const { return m_coneAngle; } - - /// - /// \brief Get the light position - /// - void setConeAngle(const double angle) { m_coneAngle = (float)angle; } - - /// - /// \brief Get the light position - /// - const Vec3f getPosition() const { return m_position; } - - /// - /// \brief Set the light position - /// - void setPosition(const Vec3d& p) - { - m_position = Vec3f( - static_cast<float>(p[0]), - static_cast<float>(p[1]), - static_cast<float>(p[2])); - }; - void setPosition(const double& x, const double& y, const double& z) - { - this->setPosition(Vec3d(x, y, z)); - } - -protected: - Vec3f m_position = Vec3f(0.0f, 0.0f, 0.0f); - float m_coneAngle = 179.0f; -}; - -//----------------------------------------------------------------------------- - -/// -/// \class Spot light class -/// -/// \brief A spot light is a point light in a cone shape. -/// -class SpotLight : public PointLight -{ -public: - /// - /// \brief Constructors - /// - SpotLight(const std::string& name) : PointLight(name, LightType::Spot) - { - m_coneAngle = 10.0f; - } - - virtual ~SpotLight() override = default; - -public: - virtual const std::string getTypeName() const { return "SpotLight"; } - - /// - /// \brief Get the spotlight angle in degrees - /// - float getSpotAngle() const { return m_spotAngle; } - - /// - /// \brief Set the spotlight angle in degrees - /// - void setSpotAngle(const double& angle) { m_spotAngle = static_cast<float>(angle); } - -protected: - float m_spotAngle = 45.0f; -}; } // imstk \ No newline at end of file diff --git a/Source/SceneEntities/Lights/imstkPointLight.h b/Source/SceneEntities/Lights/imstkPointLight.h new file mode 100644 index 000000000..a624d6eb9 --- /dev/null +++ b/Source/SceneEntities/Lights/imstkPointLight.h @@ -0,0 +1,83 @@ +/*========================================================================= + + Library: iMSTK + + Copyright (c) Kitware, Inc. & Center for Modeling, Simulation, + & Imaging in Medicine, Rensselaer Polytechnic Institute. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0.txt + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +=========================================================================*/ + +#pragma once + +#include "imstkLight.h" + +namespace imstk +{ +/// +/// \class PointLight +/// +/// \brief Point light class +/// +/// A point light has a position, and it's range is determined by it's +/// intensity. +/// +class PointLight : public Light +{ +public: + /// + /// \brief Constructors + /// + PointLight(const std::string& name, const LightType& type = LightType::Point) : Light(name, type) { } + + virtual ~PointLight() override = default; + +public: + virtual const std::string getTypeName() const { return "PointLight"; } + + /// + /// \brief Get the cone angle + /// + const float getConeAngle() const { return m_coneAngle; } + + /// + /// \brief Get the light position + /// + void setConeAngle(const double angle) { m_coneAngle = (float)angle; } + + /// + /// \brief Get the light position + /// + const Vec3f getPosition() const { return m_position; } + + /// + /// \brief Set the light position + /// + void setPosition(const Vec3d& p) + { + m_position = Vec3f( + static_cast<float>(p[0]), + static_cast<float>(p[1]), + static_cast<float>(p[2])); + }; + void setPosition(const double& x, const double& y, const double& z) + { + this->setPosition(Vec3d(x, y, z)); + } + +protected: + Vec3f m_position = Vec3f(0.0f, 0.0f, 0.0f); + float m_coneAngle = 179.0f; +}; +} // imstk \ No newline at end of file diff --git a/Source/SceneEntities/Lights/imstkSpotLight.h b/Source/SceneEntities/Lights/imstkSpotLight.h new file mode 100644 index 000000000..9d87aae42 --- /dev/null +++ b/Source/SceneEntities/Lights/imstkSpotLight.h @@ -0,0 +1,64 @@ +/*========================================================================= + + Library: iMSTK + + Copyright (c) Kitware, Inc. & Center for Modeling, Simulation, + & Imaging in Medicine, Rensselaer Polytechnic Institute. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0.txt + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +=========================================================================*/ + +#pragma once + +#include "imstkPointLight.h" + +#include <string> + +namespace imstk +{ +/// +/// \class Spot light class +/// +/// \brief A spot light is a point light in a cone shape. +/// +class SpotLight : public PointLight +{ +public: + /// + /// \brief Constructors + /// + SpotLight(const std::string& name) : PointLight(name, LightType::Spot) + { + m_coneAngle = 10.0f; + } + + virtual ~SpotLight() override = default; + +public: + virtual const std::string getTypeName() const { return "SpotLight"; } + + /// + /// \brief Get the spotlight angle in degrees + /// + float getSpotAngle() const { return m_spotAngle; } + + /// + /// \brief Set the spotlight angle in degrees + /// + void setSpotAngle(const double& angle) { m_spotAngle = static_cast<float>(angle); } + +protected: + float m_spotAngle = 45.0f; +}; +} // imstk \ No newline at end of file -- GitLab