]> OCCT Git - occt-copy.git/commitdiff
Cosmetic fixes. CR00000-HYDRO_2
authorduv <duv@opencascade.com>
Wed, 9 Apr 2014 09:40:07 +0000 (13:40 +0400)
committerduv <duv@opencascade.com>
Wed, 9 Apr 2014 09:40:07 +0000 (13:40 +0400)
src/Graphic3d/Graphic3d.cdl
src/OpenGl/OpenGl_GraphicDriver.hxx
src/OpenGl/OpenGl_GraphicDriver_7.cxx
src/OpenGl/OpenGl_Layer.cxx
src/OpenGl/OpenGl_Layer.hxx
src/OpenGl/OpenGl_View_2.cxx
src/V3d/V3d_Viewer.cxx
src/Visual3d/Visual3d_View.cxx
src/Visual3d/Visual3d_ViewManager.cxx

index ed7d272b58e64a7fc9775994e03caeab91cd9860..2502412e3f42f09b1a3a50ed329244f0bb623573 100644 (file)
@@ -419,7 +419,7 @@ is
     primitive Mat4;
     primitive Mat4d;
 
-    primitive ZLayerSettings;
+    imported ZLayerSettings;
 
     --------------------
     -- Category: Classes
index f91b4f58c9dc2b654dc08e7226b9a188c761de0e..f77cdc7bedfda575f608da86aa23feb5cb80049d 100644 (file)
@@ -308,7 +308,7 @@ public:
   //! Sets the settings for a single Z layer of specified view.
   Standard_EXPORT void SetZLayerSettings (const Graphic3d_CView& theCView,
                                           const Standard_Integer theLayerId,
-                                          const Graphic3d_ZLayerSettings theSettings);
+                                          const Graphic3d_ZLayerSettings& theSettings);
 
 public:
 
index 16ad66dfcc858be18e6aa6f853c4524aa4190366..2e9c74a5b07c90f2a91463ae5bb556ac6e7f91a7 100644 (file)
@@ -632,7 +632,7 @@ void OpenGl_GraphicDriver::RemoveZLayer (const Graphic3d_CView& theCView,
 //=======================================================================
 Standard_EXPORT void OpenGl_GraphicDriver::SetZLayerSettings (const Graphic3d_CView& theCView,
                                                               const Standard_Integer theLayerId,
-                                                              const Graphic3d_ZLayerSettings theSettings)
+                                                              const Graphic3d_ZLayerSettings& theSettings)
 {
   const OpenGl_CView* aCView = (const OpenGl_CView* )theCView.ptrView;
   if (aCView)
index bbaa5466122b11d4c1ed547dc64fddc014552f2d..9b1bb6852ac683fdf37b88e1e3e894b3d7e65b50 100644 (file)
 
 #include <OpenGl_GlCore11.hxx>
 
-//=======================================================================
-//function : OpenGl_LayerSettings
-//purpose  : 
-//=======================================================================
-OpenGl_LayerSettings::OpenGl_LayerSettings()
-  : DepthOffsetFactor (1.0f),
-    DepthOffsetUnits  (1.0f),
-    Flags (OpenGl_LayerDepthTest
-          | OpenGl_LayerDepthWrite
-          | OpenGl_LayerDepthClear)
-{
-  //
-}
-
 //=======================================================================
 //function : OpenGl_Layer
 //purpose  : 
@@ -48,13 +34,13 @@ OpenGl_Layer::OpenGl_Layer (const Standard_Integer theNbPriorities)
 void OpenGl_Layer::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
 {
   // separate depth buffers
-  if (IsSettingEnabled (OpenGl_LayerDepthClear))
+  if (IsSettingEnabled (Graphic3d_ZLayerDepthClear))
   {
     glClear (GL_DEPTH_BUFFER_BIT);
   }
 
   // handle depth test
-  if (IsSettingEnabled (OpenGl_LayerDepthTest))
+  if (IsSettingEnabled (Graphic3d_ZLayerDepthTest))
   {
     glDepthFunc (GL_LESS);
   }
@@ -64,17 +50,17 @@ void OpenGl_Layer::Render (const Handle(OpenGl_Workspace) &AWorkspace) const
   }
 
   // handle depth offset
-  if (IsSettingEnabled (OpenGl_LayerDepthOffset))
+  if (IsSettingEnabled (Graphic3d_ZLayerDepthOffset))
   {
     glPolygonOffset (myLayerSettings.DepthOffsetFactor, myLayerSettings.DepthOffsetUnits);
   }
   else
   {
-    glPolygonOffset (0.f, 0.f);
+    glPolygonOffset (0.0f, 0.0f);
   }
 
   // handle depth write
-  if (IsSettingEnabled (OpenGl_LayerDepthWrite))
+  if (IsSettingEnabled (Graphic3d_ZLayerDepthWrite))
   {
     glDepthMask (GL_TRUE);
   }
index d36fd9af2a7b79911612c5d9face4e428f8c4539..81235aff7c45d8e3f6d27a0febd427c8cefa835b 100644 (file)
 #define _OpenGl_Layer_Header
 
 #include <OpenGl_PriorityList.hxx>
+#include <Graphic3d_ZLayerSettings.hxx>
 
 class Handle(OpenGl_Workspace);
 
-enum OpenGl_LayerSetting
-{
-  OpenGl_LayerDepthTest = 1,
-  OpenGl_LayerDepthWrite = 2,
-  OpenGl_LayerDepthClear = 4,
-  OpenGl_LayerDepthOffset = 8
-};
-
-struct OpenGl_LayerSettings
-{
-  //! Initializes settings
-  OpenGl_LayerSettings();
-
-  //! Returns true if theSetting is enabled.
-  const Standard_Boolean IsSettingEnabled (const OpenGl_LayerSetting theSetting) const
-  {
-    return (Flags & theSetting) == theSetting;
-  }
-
-  Standard_ShortReal DepthOffsetFactor; //!< Factor argument value for OpenGl glPolygonOffset function.
-  Standard_ShortReal DepthOffsetUnits;  //!< Units argument value for OpenGl glPolygonOffset function.
-
-  Standard_Integer Flags; //!< Storage field for settings.
-};
-
 class OpenGl_Layer
 {
 public:
@@ -53,16 +29,16 @@ public:
   OpenGl_Layer (const Standard_Integer theNbPriorities = 11);
 
   //! Returns settings of the layer object.
-  const OpenGl_LayerSettings LayerSettings() const { return myLayerSettings; };
+  const Graphic3d_ZLayerSettings LayerSettings() const { return myLayerSettings; };
 
   //! Sets settings of the layer object.
-  void SetLayerSettings (OpenGl_LayerSettings theSettings)
+  void SetLayerSettings (Graphic3d_ZLayerSettings theSettings)
   {
     myLayerSettings = theSettings;
   }
 
   //! Returns true if theSetting is enabled for the layer.
-  const Standard_Boolean IsSettingEnabled (const OpenGl_LayerSetting theSetting) const
+  const Standard_Boolean IsSettingEnabled (const Graphic3d_ZLayerSetting theSetting) const
   {
     return myLayerSettings.IsSettingEnabled (theSetting);
   }
@@ -77,8 +53,8 @@ public:
 
 private:
 
-  OpenGl_PriorityList myPriorityList;   //!< Associated priority list object.
+  OpenGl_PriorityList myPriorityList;       //!< Associated priority list object.
 
-  OpenGl_LayerSettings myLayerSettings; //!< Layer setting flags.
+  Graphic3d_ZLayerSettings myLayerSettings; //!< Layer setting flags.
 };
 #endif //_OpenGl_Layer_Header
index 5e13a9886ffcb58bcb3b1a980bf8d5c3dbaaa818..59ac16829b0576e0a3605e30553deede458be4da 100644 (file)
@@ -1518,13 +1518,6 @@ void OpenGl_View::ChangeZLayer (const OpenGl_Structure *theStructure,
 void OpenGl_View::SetZLayerSettings (const Standard_Integer theLayerId,
                                      const Graphic3d_ZLayerSettings theSettings)
 {
-  // Convert Graphic3d_ZLayerSettings to OpenGl_LayerSettings
-  OpenGl_LayerSettings aConvertedSettings;
-
-  aConvertedSettings.DepthOffsetFactor = theSettings.DepthOffsetFactor;
-  aConvertedSettings.DepthOffsetUnits  = theSettings.DepthOffsetUnits;
-  aConvertedSettings.Flags             = theSettings.Flags;
-
-  myZLayers.Layer (theLayerId).SetLayerSettings (aConvertedSettings);
+  myZLayers.Layer (theLayerId).SetLayerSettings (theSettings);
 }
 
index f4df8ddc410d002eadefe12e21d6550a77f29cb5..254ed231d3a4646fa8cb17e34dc59abd0ea49c60 100644 (file)
@@ -359,7 +359,7 @@ void V3d_Viewer::DelView( const Handle(V3d_View)& TheView ) {
 //=======================================================================
 
 void V3d_Viewer::SetZLayerSettings (const Standard_Integer theLayerId,
-                                    const Graphic3d_ZLayerSettings theSettings)
+                                    const Graphic3d_ZLayerSettings& theSettings)
 {
   MyViewer->SetZLayerSettings (theLayerId, theSettings);
 }
index 021091f02b758a84d9234fd93ccda568b598f909..4b52723ffe9a984a666507f21e94822836e6c8be 100644 (file)
@@ -3676,7 +3676,7 @@ Standard_Boolean Visual3d_View::Export (const Standard_CString       theFileName
 //=======================================================================
 
 void Visual3d_View::SetZLayerSettings (const Standard_Integer theLayerId,
-                                       const Graphic3d_ZLayerSettings theSettings)
+                                       const Graphic3d_ZLayerSettings& theSettings)
 {
   MyGraphicDriver->SetZLayerSettings (MyCView, theLayerId, theSettings);
 }
index 3d13bc9e0b51da903eb354e036e70c15949ccd55..1d795a07277964f4f227301fbc0a59784ba0560a 100644 (file)
@@ -1207,12 +1207,14 @@ Standard_Integer Visual3d_ViewManager::GetZLayer (const Handle(Graphic3d_Structu
 //purpose  :
 //=======================================================================
 void Visual3d_ViewManager::SetZLayerSettings (const Standard_Integer theLayerId,
-                                              const Graphic3d_ZLayerSettings theSettings)
+                                              const Graphic3d_ZLayerSettings& theSettings)
 {
-  // tell all managed views to set zlayer settings display layers
+  // tell all managed views to set zlayer settings
   Visual3d_SetIteratorOfSetOfView aViewIt (MyDefinedView);
-  for ( ; aViewIt.More (); aViewIt.Next ())
+  for (; aViewIt.More (); aViewIt.Next ())
+  {
     (aViewIt.Value ())->SetZLayerSettings (theLayerId, theSettings);
+  }
 
   if (myMapOfZLayerSettings.IsBound (theLayerId))
   {
@@ -1232,7 +1234,9 @@ void Visual3d_ViewManager::SetZLayerSettings (const Standard_Integer theLayerId,
 Graphic3d_ZLayerSettings Visual3d_ViewManager::ZLayerSettings (const Standard_Integer theLayerId)
 {
   if (!myLayerIds.Contains (theLayerId))
+  {
     return Graphic3d_ZLayerSettings();
+  }
 
   return myMapOfZLayerSettings.Find (theLayerId);
 }