]> OCCT Git - occt.git/commitdiff
Coding - MSVC warning fix for STEP Rendering properties #498 V8_0_0_rc1
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Sun, 13 Apr 2025 20:05:22 +0000 (21:05 +0100)
committerGitHub <noreply@github.com>
Sun, 13 Apr 2025 20:05:22 +0000 (21:05 +0100)
Fixed warning on MSVC compiler with name overriding and type mismatching.

src/DataExchange/TKDESTEP/STEPConstruct/STEPConstruct_RenderingProperties.cxx
src/DataExchange/TKDESTEP/STEPConstruct/STEPConstruct_RenderingProperties.hxx

index e56de2a66a242f0faf235c58489cedcd81ef0196..521b2399ddbd760b85afc2fd2962b0d6f2c178b8 100644 (file)
@@ -237,10 +237,7 @@ Handle(StepVisual_SurfaceStyleRenderingWithProperties) STEPConstruct_RenderingPr
   // Add transparency
   Handle(StepVisual_SurfaceStyleTransparent) aTransparent = new StepVisual_SurfaceStyleTransparent;
   aTransparent->Init(myTransparency);
-
-  StepVisual_RenderingPropertiesSelect aRPS;
-  aRPS.SetValue(aTransparent);
-  aProps->SetValue(aPropIndex++, aRPS);
+  aProps->ChangeValue(aPropIndex++).SetValue(aTransparent);
 
   // Add the appropriate reflectance model based on what we have
   if (hasAmbientOnly)
@@ -250,9 +247,7 @@ Handle(StepVisual_SurfaceStyleRenderingWithProperties) STEPConstruct_RenderingPr
       new StepVisual_SurfaceStyleReflectanceAmbient;
     aAmbient->Init(myAmbientReflectance.first);
 
-    StepVisual_RenderingPropertiesSelect aRPS;
-    aRPS.SetValue(aAmbient);
-    aProps->SetValue(aPropIndex++, aRPS);
+    aProps->ChangeValue(aPropIndex++).SetValue(aAmbient);
   }
   else if (hasDiffuseAndAmbient)
   {
@@ -261,9 +256,7 @@ Handle(StepVisual_SurfaceStyleRenderingWithProperties) STEPConstruct_RenderingPr
       new StepVisual_SurfaceStyleReflectanceAmbientDiffuse;
     aAmbientDiffuse->Init(myAmbientReflectance.first, myDiffuseReflectance.first);
 
-    StepVisual_RenderingPropertiesSelect aRPS;
-    aRPS.SetValue(aAmbientDiffuse);
-    aProps->SetValue(aPropIndex++, aRPS);
+    aProps->ChangeValue(aPropIndex++).SetValue(aAmbientDiffuse);
   }
   else if (hasFullReflectance)
   {
@@ -277,9 +270,7 @@ Handle(StepVisual_SurfaceStyleRenderingWithProperties) STEPConstruct_RenderingPr
                     mySpecularExponent.first,
                     STEPConstruct_Styles::EncodeColor(mySpecularColour.first));
 
-    StepVisual_RenderingPropertiesSelect aRPS;
-    aRPS.SetValue(aFullRefl);
-    aProps->SetValue(aPropIndex++, aRPS);
+    aProps->ChangeValue(aPropIndex++).SetValue(aFullRefl);
   }
 
   // Create STEP surface style rendering with properties
@@ -304,7 +295,7 @@ XCAFDoc_VisMaterialCommon STEPConstruct_RenderingProperties::CreateXCAFMaterial(
 
   // Use surface color as the base diffuse color
   aMaterial.DiffuseColor = mySurfaceColor;
-  aMaterial.Transparency = myTransparency;
+  aMaterial.Transparency = static_cast<float>(myTransparency);
   aMaterial.IsDefined    = Standard_True;
 
   // Set default values for other properties
@@ -400,7 +391,7 @@ void STEPConstruct_RenderingProperties::Init(
   {
     for (Standard_Integer i = 1; i <= aProperties->Length(); i++)
     {
-      StepVisual_RenderingPropertiesSelect aPropSelect = aProperties->Value(i);
+      const StepVisual_RenderingPropertiesSelect& aPropSelect = aProperties->Value(i);
 
       // Check for transparency
       Handle(StepVisual_SurfaceStyleTransparent) aTransparent =
index 79e9ad6308bb147b0790036a2deac13f36809a22..4451ff948b10bb90e43d4b1bde58d3a04caeb7fd 100644 (file)
@@ -144,7 +144,7 @@ public:
   //! @return ColorRGBA object
   Quantity_ColorRGBA GetRGBAColor() const
   {
-    return Quantity_ColorRGBA(mySurfaceColor, 1.0 - myTransparency);
+    return Quantity_ColorRGBA(mySurfaceColor, static_cast<float>(1.0 - myTransparency));
   }
 
   //! Returns surface color