]> OCCT Git - occt-copy.git/commitdiff
0025511: Visualization - drop redundant viewer option V3d_View::Transparency() V6_8_0p1
authorkgv <kgv@opencascade.com>
Thu, 4 Dec 2014 11:52:49 +0000 (14:52 +0300)
committerkgv <kgv@opencascade.com>
Thu, 15 Jan 2015 06:38:11 +0000 (09:38 +0300)
Visual3d_ViewManager, activate texturing by default.

Update Qt sample

Conflicts:
src/AIS/AIS_InteractiveContext.cxx

17 files changed:
samples/qt/VoxelDemo/src/Viewer.cpp
src/Graphic3d/Graphic3d_GraphicDriver.cdl
src/OpenGl/OpenGl_GraphicDriver.hxx
src/OpenGl/OpenGl_GraphicDriver_7.cxx
src/OpenGl/OpenGl_View.cxx
src/OpenGl/OpenGl_Workspace.cxx
src/OpenGl/OpenGl_Workspace.hxx
src/OpenGl/OpenGl_Workspace_5.cxx
src/V3d/V3d_Plane.cxx
src/V3d/V3d_View.cdl
src/V3d/V3d_View.cxx
src/V3d/V3d_View_2.cxx
src/Visual3d/Visual3d_ContextView.cxx
src/Visual3d/Visual3d_View.cdl
src/Visual3d/Visual3d_View.cxx
src/Visual3d/Visual3d_ViewManager.cdl
src/Visual3d/Visual3d_ViewManager.cxx

index 43bbae4b304a077a733c6fc9599cab23269ec6fe..f71805b23f4933838aa505dddba27ffbda883955 100644 (file)
@@ -51,7 +51,6 @@ Viewer::Viewer(QWidget* parent):QWidget(parent)
 
     myView->MustBeResized();
     myView->SetSurfaceDetail(V3d_TEX_NONE);
-    myView->SetTransparency(Standard_True);
     myView->SetSize(10000.0);
     myView->SetZSize(10000.0);
     myView->SetViewMappingDefault();
index ef0273030d675d2250aa0822eae5f06a977b2432..8203a5806b15faa5893ff5377c1e03cdbfe24d9f 100644 (file)
@@ -261,12 +261,6 @@ is
         is deferred;
     ---Purpose: call_togl_setvisualisation
 
-    Transparency ( me       : mutable;
-                   ACView   : CView from Graphic3d;
-                   AFlag    : Boolean from Standard )
-        is deferred;
-    ---Purpose: call_togl_transparency
-
     View ( me   : mutable;
            ACView   : in out CView from Graphic3d )
         returns Boolean from Standard
index 3895f64331a66fd4bbe734806fcc65f1b6e1f924..9df98f1767bf0d7afd44c3360d3474e3113754ed 100644 (file)
@@ -167,7 +167,6 @@ public:
   Standard_EXPORT void SetClipPlanes (const Graphic3d_CView& theCView);
   Standard_EXPORT void SetCamera (const Graphic3d_CView& theCView);
   Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView);
-  Standard_EXPORT void Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag);
   Standard_EXPORT Standard_Boolean View (Graphic3d_CView& ACView);
   Standard_EXPORT void Environment (const Graphic3d_CView& ACView);
   Standard_EXPORT void ZBufferTriedronSetup (const Quantity_NameOfColor XColor = Quantity_NOC_RED, const Quantity_NameOfColor YColor = Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor = Quantity_NOC_BLUE1, const Standard_Real SizeRatio = 0.8, const Standard_Real AxisDiametr = 0.05, const Standard_Integer NbFacettes = 12);
index ab44eb4ba5c6c26c0bc8846957326ad9b9750c24..5f40749b39913c2d23b11af2dc50cef3e15d44c6 100644 (file)
@@ -470,13 +470,6 @@ void OpenGl_GraphicDriver::SetVisualisation (const Graphic3d_CView& ACView)
   }
 }
 
-void OpenGl_GraphicDriver::Transparency (const Graphic3d_CView& ACView, const Standard_Boolean AFlag)
-{
-  const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
-  if (aCView)
-    aCView->WS->UseTransparency(AFlag);
-}
-
 // =======================================================================
 // function : InvalidateBVHData
 // purpose  :
index 1e409ed7ebdba96f4425d2e06ca8af7bd00c2008..4dce50224c7c43a67ed645c592d5616f3a8d40ee 100644 (file)
@@ -54,7 +54,7 @@ static const GLdouble THE_IDENTITY_MATRIX[4][4] =
 
 OpenGl_View::OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext,
                           OpenGl_StateCounter*       theCounter)
-: mySurfaceDetail(Visual3d_TOD_NONE),
+: mySurfaceDetail(Visual3d_TOD_ALL),
   myBackfacing(0),
   myBgTexture(myDefaultBgTexture),
   myBgGradient(myDefaultBgGradient),
index 2bfcd3b3a6f07b3bc17c58328f942dc4371d5a7a..ad95d7d180666b88ec733ac7894f110fe5bfe3c3 100644 (file)
@@ -156,7 +156,6 @@ OpenGl_Workspace::OpenGl_Workspace (const Handle(OpenGl_GraphicDriver)& theDrive
   myTransientDrawToFront (Standard_True),
   myBackBufferRestored   (Standard_False),
   myIsImmediateDrawn     (Standard_False),
-  myUseTransparency (Standard_False),
   myUseZBuffer (Standard_False),
   myUseDepthTest (Standard_True),
   myUseGLLight (Standard_True),
@@ -255,15 +254,6 @@ Standard_Boolean OpenGl_Workspace::Activate()
   return Standard_True;
 }
 
-// =======================================================================
-// function : UseTransparency
-// purpose  : call_togl_transparency
-// =======================================================================
-void OpenGl_Workspace::UseTransparency (const Standard_Boolean theFlag)
-{
-  myUseTransparency = theFlag;
-}
-
 //=======================================================================
 //function : ResetAppliedAspect
 //purpose  : Sets default values of GL parameters in accordance with default aspects
index 805d577e095e80a693220ec67d47bdf092d533b2..6dfe38d7cbd07d9be05a7737713c033e4a9ce7d7 100644 (file)
@@ -184,7 +184,6 @@ public:
                                Image_PixMap&               theImage,
                                const Graphic3d_BufferType& theBufferType);
 
-  void UseTransparency (const Standard_Boolean theFlag);
   Standard_Boolean& UseZBuffer()   { return myUseZBuffer; }
   Standard_Boolean& UseDepthTest() { return myUseDepthTest; }
   Standard_Boolean& UseGLLight()   { return myUseGLLight; }
@@ -671,7 +670,6 @@ protected: //! @name protected fields
   Standard_Boolean       myTransientDrawToFront; //!< optimization flag for immediate mode (to render directly to the front buffer)
   Standard_Boolean       myBackBufferRestored;
   Standard_Boolean       myIsImmediateDrawn;     //!< flag indicates that immediate mode buffer contains some data
-  Standard_Boolean       myUseTransparency;
   Standard_Boolean       myUseZBuffer;
   Standard_Boolean       myUseDepthTest;
   Standard_Boolean       myUseGLLight;
index dfac729108dd32865f56b6b730ae97b550ee8940..910d282696acb316a0a5dec0cc3be8a181660f8a 100644 (file)
@@ -119,7 +119,7 @@ void OpenGl_Workspace::updateMaterial (const int theFlag)
       NamedStatus |= OPENGL_NS_2NDPASSNEED;
     }
 
-    if (myUseTransparency && aProps->trans != 1.0f)
+    if (aProps->trans != 1.0f)
     {
       // render transparent
       myMatTmp.Diffuse.a() = aProps->trans;
@@ -349,7 +349,7 @@ const OpenGl_AspectFace* OpenGl_Workspace::AspectFace (const Standard_Boolean th
                              ? TelCullNone
                              : (TelCullMode )AspectFace_set->CullingMode();
     if (aCullingMode != TelCullNone
-     && myUseTransparency && !(NamedStatus & OPENGL_NS_2NDPASSDO))
+     && !(NamedStatus & OPENGL_NS_2NDPASSDO))
     {
       // disable culling in case of translucent shading aspect
       if (AspectFace_set->IntFront().trans != 1.0f)
index 26269a8f6e6837c5d8d7aa8df322489afbaf5a03..9af803b87e6cc2d2f82e9b097837682f8bd7b7b9 100755 (executable)
@@ -70,7 +70,6 @@ void V3d_Plane::Display (const Handle(V3d_View)& theView,
   Graphic3d_MaterialAspect aPlastic (Graphic3d_NOM_PLASTIC);
   aPlastic.SetColor (theColor);
   aPlastic.SetTransparency (0.5);
-  theView->SetTransparency (Standard_True);
   anAsp->SetFrontMaterial (aPlastic);
   anAsp->SetInteriorStyle (Aspect_IS_HATCH);
   anAsp->SetHatchStyle (Aspect_HS_GRID_DIAGONAL_WIDE);
index bdb30dd514a3ed0b38f36d77e891316404ee1486..a1a8a6ddbafe7f7a06a97d3b73fc7f81173f7032 100644 (file)
@@ -35,8 +35,6 @@
 --              -> Add SetProjModel() method.
 --      VKH - 15/11/99 : G004
 --              -> Add method Dump()
---      GG  - IMP210200
---              -> Add Transparency() method
 --      THA  - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
 --              -> Add Print method (works only under Windows).
 --      GG  - IMP231100
@@ -415,10 +413,6 @@ is
         ---Level: Public
         ---Purpose: Returns TRUE when the light is active in this view.
 
-        SetTransparency( me : mutable ; AnActivity : Boolean = Standard_False);
-        ---Level: Public
-        ---Purpose: Activate/Deactivate the transparency in this view.
-
         SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
         returns Boolean from Standard;
          ---Purpose: sets the immediate update mode and returns the previous one.
@@ -1141,10 +1135,6 @@ is
         ---Level: Public
         -- purpose: return the current environment texture used
 
-        Transparency(me) returns Boolean from Standard;
-        ---Level: Public
-        ---Purpose: Returns the transparency activity.
-
         Visualization ( me ) returns TypeOfVisualization from V3d;
         ---Level: Public
         ---Purpose: Returns the current visualisation mode.
@@ -1638,7 +1628,6 @@ fields
         MyGridEchoStructure             :       Structure from Graphic3d;
         MyGridEchoGroup                 :       Group from Graphic3d;
 
-        MyTransparencyFlag      : Boolean from Standard;
         myImmediateUpdate: Boolean from Standard is protected;
 
         myXscreenAxis           : Vector from Graphic3d;
index 9eb2e8d5c9afa483f2a168c83aabcf11a0b25d99..5d16ad0e9a1d04f8e9064b4355b62d706e5152e8 100644 (file)
@@ -251,8 +251,6 @@ V3d_View::V3d_View(const Handle(V3d_Viewer)& VM, const V3d_TypeOfView Type ) :
   aCamera->SetProjectionType ((Type == V3d_ORTHOGRAPHIC)
     ? Graphic3d_Camera::Projection_Orthographic
     : Graphic3d_Camera::Projection_Perspective);
-
-  MyTransparencyFlag = Standard_False;
 }
 
 //=============================================================================
index 723ff90117ef4ed2eb97b99ac20e01849c61ca81..c1a41ffd22e286bbfdfd4af24dbcf05366aa6b12 100644 (file)
@@ -21,7 +21,6 @@
      --------------------------------
       00-09-92 : GG  ; Creation.
       24-12-97 : FMN ; Suppression de GEOMLITE
-      21-02-00 : GG  ; Add Transparency() method
       23-11-00 : GG  ; Add IsActiveLight() and IsActivePlane() methods
 
 ************************************************************************/
@@ -102,18 +101,6 @@ void V3d_View::SetLightOff( ) {
 
 }
 
-void V3d_View::SetTransparency(const Standard_Boolean AnActivity) {
-
-  MyTransparencyFlag = AnActivity;
-  MyView->SetTransparency(AnActivity);
-}
-
-
-Standard_Boolean V3d_View::Transparency() const {
-
-  return MyTransparencyFlag;
-}
-
 void V3d_View::InitActiveLights() {
 myActiveLightsIterator.Initialize(MyActiveLights);
 }
index c5c211745f04fb4b0f82426d79808dd00dc105ea..84f0448e0820b4bbfbb1c0d6f87e87555d0a028f 100644 (file)
@@ -57,7 +57,7 @@ MyModel (Visual3d_TOM_NONE),
 MyVisual (Visual3d_TOV_WIREFRAME),
 MyLights (),
 MyTextureEnv(),
-MySurfaceDetail(Visual3d_TOD_NONE),
+MySurfaceDetail(Visual3d_TOD_ALL),
 myClipPlanes()
 {
 }
index 919d791e62a8c6b6a82ee0bedf18507ab1190da9..30db5d4c6387c9936565f69b90dcb1a45665ae18 100644 (file)
@@ -1045,15 +1045,6 @@ is
         -- or insufficient memory.
        --  Warning: Works only under Windows.
 
-       SetTransparency ( me : mutable;
-               AFlag : Boolean from Standard )
-               is static;
-       ---Level: Advanced
-       ---Purpose: if <AFlag> is Standard_True then the transparency
-       --          is managed in the view <me>.
-       --          Default Standard_False
-       ---Category: Internal methods
-
        ZBufferIsActivated ( me )
                returns Boolean from Standard
                is static;
index 29710e9d0b25884f1ece1b502382434a15f7e15b..05b0f49fc0b29e9b1ba3982c57d6e4d01a1566ba 100644 (file)
@@ -805,7 +805,6 @@ void Visual3d_View::Activate()
   {
     myGraphicDriver->ActivateView (MyCView);
     myGraphicDriver->Background   (MyCView);
-    myGraphicDriver->Transparency (MyCView, myViewManager->Transparency());
 
     MyCView.Active = 1;
 
@@ -1800,22 +1799,6 @@ Standard_Boolean Visual3d_View::ZBufferIsActivated() const
   return MyCView.Context.ZBufferActivity != 0; //  0 or 1 => forced by the programmer
 }
 
-// =======================================================================
-// function : SetTransparency
-// purpose  :
-// =======================================================================
-void Visual3d_View::SetTransparency (const Standard_Boolean theActivity)
-{
-  if (IsDeleted()
-  || !IsDefined()
-  || !IsActive())
-  {
-    return;
-  }
-
-  myGraphicDriver->Transparency (MyCView, theActivity);
-}
-
 // =======================================================================
 // function : SetZBufferActivity
 // purpose  :
index aadee62c9089c9397bfb0fb7f0348c414dcd866c..967611b88eae05b880a67e38c17b73a337b79053 100644 (file)
@@ -411,24 +411,6 @@ is
        --          if <AStructure> is displayed in <AProjector> and TOS_COMPUTED.
        ---Category: Private methods
 
-       Transparency ( me )
-               returns Boolean from Standard
-               is static;
-       ---Level: Advanced
-       ---Purpose: Returns Standard_True if the transparency
-       --          is activated in all activated views.
-       --          Default Standard_False
-       ---Category: Internal methods
-
-       SetTransparency ( me : mutable;
-               AFlag : Boolean from Standard )
-               is static;
-       ---Level: Advanced
-       ---Purpose: if <AFlag> is Standard_True then the transparency
-       --          is managed.
-       --          Default Standard_False
-       ---Category: Internal methods
-
        ZBufferAuto ( me )
                returns Boolean from Standard
                is static;
@@ -473,7 +455,6 @@ fields
 
        -- advanced
        MyZBufferAuto                   :       Boolean from Standard;
-       MyTransparency                  :       Boolean from Standard;
 
         -- Z layer indexes
         myLayerIds                      :       MapOfInteger from TColStd;
index 9943b824aba03bf07e193fe783ef351d276b22a0..1ac96a3d981be631c07c92ecec7927e9d29dea84 100644 (file)
@@ -83,8 +83,7 @@ Visual3d_ViewManager::Visual3d_ViewManager (const Handle(Graphic3d_GraphicDriver
 Graphic3d_StructureManager (theDriver),
 MyDefinedView (),
 MyViewGenId (View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*(Visual3d_ViewManager::CurrentId ()-1),View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*Visual3d_ViewManager::CurrentId ()-1),
-MyZBufferAuto (Standard_False),
-MyTransparency (Standard_False)
+MyZBufferAuto (Standard_False)
 {
   // default layer is always presented in display layer sequence
   // it can not be removed
@@ -558,24 +557,6 @@ void Visual3d_ViewManager::UnIdentification (const Standard_Integer aViewId)
   MyViewGenId.Free(aViewId);
 }
 
-void Visual3d_ViewManager::SetTransparency (const Standard_Boolean AFlag)
-{
-  if (MyTransparency && AFlag) return;
-  if (! MyTransparency && ! AFlag) return;
-
-  for(int i=1; i<=MyDefinedView.Length(); i++)
-  {
-    (MyDefinedView.Value(i))->SetTransparency(AFlag);
-  }
-
-  MyTransparency = AFlag;
-}
-
-Standard_Boolean Visual3d_ViewManager::Transparency () const
-{
-  return (MyTransparency);
-}
-
 void Visual3d_ViewManager::SetZBufferAuto (const Standard_Boolean AFlag)
 {
   if (MyZBufferAuto && AFlag) return;