From 4175d4966c1a5915696f2cd2446d91aaa882018b Mon Sep 17 00:00:00 2001 From: Charles PIGNEROL <> Date: Tue, 4 Nov 2025 14:50:26 +0100 Subject: [PATCH] Version 5.14.0. Set/GetLighting methods of vtkTrihedron. Objective: to make the axes insensitive to lighting so that they are always the same color. --- cmake/version.cmake | 4 +- .../public/VtkContrib/vtkTrihedron.h | 18 +++++++- src/VtkContrib/vtkTrihedron.cpp | 41 +++++++++++++++++++ versions.txt | 7 ++++ 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/cmake/version.cmake b/cmake/version.cmake index 3031eb7..5f48ca5 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -3,8 +3,8 @@ # set (VTK_CONTRIB_MAJOR_VERSION "5") -set (VTK_CONTRIB_MINOR_VERSION "13") -set (VTK_CONTRIB_RELEASE_VERSION "1") +set (VTK_CONTRIB_MINOR_VERSION "14") +set (VTK_CONTRIB_RELEASE_VERSION "0") set (VTK_CONTRIB_VERSION ${VTK_CONTRIB_MAJOR_VERSION}.${VTK_CONTRIB_MINOR_VERSION}.${VTK_CONTRIB_RELEASE_VERSION}) diff --git a/src/VtkContrib/public/VtkContrib/vtkTrihedron.h b/src/VtkContrib/public/VtkContrib/vtkTrihedron.h index f900b2e..73e677d 100644 --- a/src/VtkContrib/public/VtkContrib/vtkTrihedron.h +++ b/src/VtkContrib/public/VtkContrib/vtkTrihedron.h @@ -62,8 +62,7 @@ class vtkTrihedron : public vtkPropAssembly * En mode 2D off, les positions sont relatives, chaque * axe mesurant 1.1, donc l'offset est à comparer à 1. */ - virtual void SetLabelsOffsets ( - double xOffset, double yOffset, double zOffset); + virtual void SetLabelsOffsets (double xOffset, double yOffset, double zOffset); /** * @param Redimensionne l'épaisseur des axes du facteur transmis en @@ -101,6 +100,21 @@ class vtkTrihedron : public vtkPropAssembly */ virtual void SetElevationColor (double r, double g, double b); + /** + * Rend les axes sensibles aux éclairages (Off par défaut). + * @since 5.14.0 + */ + virtual void LightingOn ( ); + virtual void LightingOff ( ); + virtual void SetLighting (int onOff); + + /** + * @return 1 si les axes sont sensibles aux éclairages, 0 dans le cas contraire. + * @warning Seul l'axe des abscisses est évalué. + * @since 5.14.0 + */ + virtual int GetLighting ( ); + /** * Affiche les libellés dans le plan de la vue true ou dans * l'espace 3D false.. diff --git a/src/VtkContrib/vtkTrihedron.cpp b/src/VtkContrib/vtkTrihedron.cpp index 90356b1..e3c7326 100644 --- a/src/VtkContrib/vtkTrihedron.cpp +++ b/src/VtkContrib/vtkTrihedron.cpp @@ -157,6 +157,8 @@ vtkTrihedron::vtkTrihedron ( ) SetAbscissaColor (xColor [0], xColor [1], xColor [2]); SetOrdinateColor (yColor [0], yColor [1], yColor [2]); SetElevationColor (zColor [0], zColor [1], zColor [2]); + + LightingOff ( ); // v 5.14.0 } // vtkTrihedron::vtkTrihedron @@ -470,6 +472,45 @@ void vtkTrihedron::SetElevationColor (double r, double g, double b) } // vtkTrihedron::SetElevationColor +void vtkTrihedron::LightingOn ( ) +{ + if (0 != GetXAxisArrowActor ( ).GetProperty ( )) + GetXAxisArrowActor ( ).GetProperty ( )->LightingOn ( ); + if (0 != GetYAxisArrowActor ( ).GetProperty ( )) + GetYAxisArrowActor ( ).GetProperty ( )->LightingOn ( ); + if (0 != GetZAxisArrowActor ( ).GetProperty ( )) + GetZAxisArrowActor ( ).GetProperty ( )->LightingOn ( ); +} // vtkTrihedron::LightingOn + + +void vtkTrihedron::LightingOff ( ) +{ + if (0 != GetXAxisArrowActor ( ).GetProperty ( )) + GetXAxisArrowActor ( ).GetProperty ( )->LightingOff ( ); + if (0 != GetYAxisArrowActor ( ).GetProperty ( )) + GetYAxisArrowActor ( ).GetProperty ( )->LightingOff ( ); + if (0 != GetZAxisArrowActor ( ).GetProperty ( )) + GetZAxisArrowActor ( ).GetProperty ( )->LightingOff ( ); +} // vtkTrihedron::LightingOff + + +void vtkTrihedron::SetLighting (int onOff) +{ + if (0 != GetXAxisArrowActor ( ).GetProperty ( )) + GetXAxisArrowActor ( ).GetProperty ( )->SetLighting (onOff); + if (0 != GetYAxisArrowActor ( ).GetProperty ( )) + GetYAxisArrowActor ( ).GetProperty ( )->SetLighting (onOff); + if (0 != GetZAxisArrowActor ( ).GetProperty ( )) + GetZAxisArrowActor ( ).GetProperty ( )->SetLighting (onOff); +} // vtkTrihedron::SetLighting + + +int vtkTrihedron::GetLighting ( ) +{ + return 0 == GetXAxisArrowActor ( ).GetProperty ( ) ? 0 : GetXAxisArrowActor ( ).GetProperty ( )->GetLighting ( ); +} // vtkTrihedron::GetLighting + + void vtkTrihedron::SetLabel2D (bool on) { if (true == on) diff --git a/versions.txt b/versions.txt index d835bfa..546d82f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,3 +1,10 @@ +Version 5.14.0 : 04/11/25 +================ + +Méthodes Set/GetLighting de vtkTrihedron. Objectif : rendre les axes insensibles à l'éclairage pour qu'ils soient +toujours de la même couleur. + + Version 5.13.1 : 24/10/25 ================