1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0025511: Visualization - drop redundant viewer option V3d_View::Transparency()

Visual3d_ViewManager, activate texturing by default.

Update Qt sample

Conflicts:
	src/AIS/AIS_InteractiveContext.cxx
This commit is contained in:
kgv 2014-12-04 14:52:49 +03:00
parent 147dfa6daa
commit 49dd2f7d93
17 changed files with 5 additions and 123 deletions

View File

@ -51,7 +51,6 @@ Viewer::Viewer(QWidget* parent):QWidget(parent)
myView->MustBeResized(); myView->MustBeResized();
myView->SetSurfaceDetail(V3d_TEX_NONE); myView->SetSurfaceDetail(V3d_TEX_NONE);
myView->SetTransparency(Standard_True);
myView->SetSize(10000.0); myView->SetSize(10000.0);
myView->SetZSize(10000.0); myView->SetZSize(10000.0);
myView->SetViewMappingDefault(); myView->SetViewMappingDefault();

View File

@ -261,12 +261,6 @@ is
is deferred; is deferred;
---Purpose: call_togl_setvisualisation ---Purpose: call_togl_setvisualisation
Transparency ( me : mutable;
ACView : CView from Graphic3d;
AFlag : Boolean from Standard )
is deferred;
---Purpose: call_togl_transparency
View ( me : mutable; View ( me : mutable;
ACView : in out CView from Graphic3d ) ACView : in out CView from Graphic3d )
returns Boolean from Standard returns Boolean from Standard

View File

@ -167,7 +167,6 @@ public:
Standard_EXPORT void SetClipPlanes (const Graphic3d_CView& theCView); Standard_EXPORT void SetClipPlanes (const Graphic3d_CView& theCView);
Standard_EXPORT void SetCamera (const Graphic3d_CView& theCView); Standard_EXPORT void SetCamera (const Graphic3d_CView& theCView);
Standard_EXPORT void SetVisualisation (const Graphic3d_CView& ACView); 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 Standard_Boolean View (Graphic3d_CView& ACView);
Standard_EXPORT void Environment (const 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); 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);

View 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 // function : InvalidateBVHData
// purpose : // purpose :

View File

@ -54,7 +54,7 @@ static const GLdouble THE_IDENTITY_MATRIX[4][4] =
OpenGl_View::OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext, OpenGl_View::OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext,
OpenGl_StateCounter* theCounter) OpenGl_StateCounter* theCounter)
: mySurfaceDetail(Visual3d_TOD_NONE), : mySurfaceDetail(Visual3d_TOD_ALL),
myBackfacing(0), myBackfacing(0),
myBgTexture(myDefaultBgTexture), myBgTexture(myDefaultBgTexture),
myBgGradient(myDefaultBgGradient), myBgGradient(myDefaultBgGradient),

View File

@ -156,7 +156,6 @@ OpenGl_Workspace::OpenGl_Workspace (const Handle(OpenGl_GraphicDriver)& theDrive
myTransientDrawToFront (Standard_True), myTransientDrawToFront (Standard_True),
myBackBufferRestored (Standard_False), myBackBufferRestored (Standard_False),
myIsImmediateDrawn (Standard_False), myIsImmediateDrawn (Standard_False),
myUseTransparency (Standard_False),
myUseZBuffer (Standard_False), myUseZBuffer (Standard_False),
myUseDepthTest (Standard_True), myUseDepthTest (Standard_True),
myUseGLLight (Standard_True), myUseGLLight (Standard_True),
@ -255,15 +254,6 @@ Standard_Boolean OpenGl_Workspace::Activate()
return Standard_True; return Standard_True;
} }
// =======================================================================
// function : UseTransparency
// purpose : call_togl_transparency
// =======================================================================
void OpenGl_Workspace::UseTransparency (const Standard_Boolean theFlag)
{
myUseTransparency = theFlag;
}
//======================================================================= //=======================================================================
//function : ResetAppliedAspect //function : ResetAppliedAspect
//purpose : Sets default values of GL parameters in accordance with default aspects //purpose : Sets default values of GL parameters in accordance with default aspects

View File

@ -184,7 +184,6 @@ public:
Image_PixMap& theImage, Image_PixMap& theImage,
const Graphic3d_BufferType& theBufferType); const Graphic3d_BufferType& theBufferType);
void UseTransparency (const Standard_Boolean theFlag);
Standard_Boolean& UseZBuffer() { return myUseZBuffer; } Standard_Boolean& UseZBuffer() { return myUseZBuffer; }
Standard_Boolean& UseDepthTest() { return myUseDepthTest; } Standard_Boolean& UseDepthTest() { return myUseDepthTest; }
Standard_Boolean& UseGLLight() { return myUseGLLight; } 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 myTransientDrawToFront; //!< optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myBackBufferRestored; Standard_Boolean myBackBufferRestored;
Standard_Boolean myIsImmediateDrawn; //!< flag indicates that immediate mode buffer contains some data Standard_Boolean myIsImmediateDrawn; //!< flag indicates that immediate mode buffer contains some data
Standard_Boolean myUseTransparency;
Standard_Boolean myUseZBuffer; Standard_Boolean myUseZBuffer;
Standard_Boolean myUseDepthTest; Standard_Boolean myUseDepthTest;
Standard_Boolean myUseGLLight; Standard_Boolean myUseGLLight;

View File

@ -119,7 +119,7 @@ void OpenGl_Workspace::updateMaterial (const int theFlag)
NamedStatus |= OPENGL_NS_2NDPASSNEED; NamedStatus |= OPENGL_NS_2NDPASSNEED;
} }
if (myUseTransparency && aProps->trans != 1.0f) if (aProps->trans != 1.0f)
{ {
// render transparent // render transparent
myMatTmp.Diffuse.a() = aProps->trans; myMatTmp.Diffuse.a() = aProps->trans;
@ -349,7 +349,7 @@ const OpenGl_AspectFace* OpenGl_Workspace::AspectFace (const Standard_Boolean th
? TelCullNone ? TelCullNone
: (TelCullMode )AspectFace_set->CullingMode(); : (TelCullMode )AspectFace_set->CullingMode();
if (aCullingMode != TelCullNone if (aCullingMode != TelCullNone
&& myUseTransparency && !(NamedStatus & OPENGL_NS_2NDPASSDO)) && !(NamedStatus & OPENGL_NS_2NDPASSDO))
{ {
// disable culling in case of translucent shading aspect // disable culling in case of translucent shading aspect
if (AspectFace_set->IntFront().trans != 1.0f) if (AspectFace_set->IntFront().trans != 1.0f)

View File

@ -70,7 +70,6 @@ void V3d_Plane::Display (const Handle(V3d_View)& theView,
Graphic3d_MaterialAspect aPlastic (Graphic3d_NOM_PLASTIC); Graphic3d_MaterialAspect aPlastic (Graphic3d_NOM_PLASTIC);
aPlastic.SetColor (theColor); aPlastic.SetColor (theColor);
aPlastic.SetTransparency (0.5); aPlastic.SetTransparency (0.5);
theView->SetTransparency (Standard_True);
anAsp->SetFrontMaterial (aPlastic); anAsp->SetFrontMaterial (aPlastic);
anAsp->SetInteriorStyle (Aspect_IS_HATCH); anAsp->SetInteriorStyle (Aspect_IS_HATCH);
anAsp->SetHatchStyle (Aspect_HS_GRID_DIAGONAL_WIDE); anAsp->SetHatchStyle (Aspect_HS_GRID_DIAGONAL_WIDE);

View File

@ -35,8 +35,6 @@
-- -> Add SetProjModel() method. -- -> Add SetProjModel() method.
-- VKH - 15/11/99 : G004 -- VKH - 15/11/99 : G004
-- -> Add method Dump() -- -> Add method Dump()
-- GG - IMP210200
-- -> Add Transparency() method
-- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr> -- THA - 17/08/00 Thomas HARTL <t-hartl@muenchen.matra-dtv.fr>
-- -> Add Print method (works only under Windows). -- -> Add Print method (works only under Windows).
-- GG - IMP231100 -- GG - IMP231100
@ -415,10 +413,6 @@ is
---Level: Public ---Level: Public
---Purpose: Returns TRUE when the light is active in this view. ---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) SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
returns Boolean from Standard; returns Boolean from Standard;
---Purpose: sets the immediate update mode and returns the previous one. ---Purpose: sets the immediate update mode and returns the previous one.
@ -1141,10 +1135,6 @@ is
---Level: Public ---Level: Public
-- purpose: return the current environment texture used -- 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; Visualization ( me ) returns TypeOfVisualization from V3d;
---Level: Public ---Level: Public
---Purpose: Returns the current visualisation mode. ---Purpose: Returns the current visualisation mode.
@ -1638,7 +1628,6 @@ fields
MyGridEchoStructure : Structure from Graphic3d; MyGridEchoStructure : Structure from Graphic3d;
MyGridEchoGroup : Group from Graphic3d; MyGridEchoGroup : Group from Graphic3d;
MyTransparencyFlag : Boolean from Standard;
myImmediateUpdate: Boolean from Standard is protected; myImmediateUpdate: Boolean from Standard is protected;
myXscreenAxis : Vector from Graphic3d; myXscreenAxis : Vector from Graphic3d;

View File

@ -251,8 +251,6 @@ V3d_View::V3d_View(const Handle(V3d_Viewer)& VM, const V3d_TypeOfView Type ) :
aCamera->SetProjectionType ((Type == V3d_ORTHOGRAPHIC) aCamera->SetProjectionType ((Type == V3d_ORTHOGRAPHIC)
? Graphic3d_Camera::Projection_Orthographic ? Graphic3d_Camera::Projection_Orthographic
: Graphic3d_Camera::Projection_Perspective); : Graphic3d_Camera::Projection_Perspective);
MyTransparencyFlag = Standard_False;
} }
//============================================================================= //=============================================================================

View File

@ -21,7 +21,6 @@
-------------------------------- --------------------------------
00-09-92 : GG ; Creation. 00-09-92 : GG ; Creation.
24-12-97 : FMN ; Suppression de GEOMLITE 24-12-97 : FMN ; Suppression de GEOMLITE
21-02-00 : GG ; Add Transparency() method
23-11-00 : GG ; Add IsActiveLight() and IsActivePlane() methods 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() { void V3d_View::InitActiveLights() {
myActiveLightsIterator.Initialize(MyActiveLights); myActiveLightsIterator.Initialize(MyActiveLights);
} }

View File

@ -57,7 +57,7 @@ MyModel (Visual3d_TOM_NONE),
MyVisual (Visual3d_TOV_WIREFRAME), MyVisual (Visual3d_TOV_WIREFRAME),
MyLights (), MyLights (),
MyTextureEnv(), MyTextureEnv(),
MySurfaceDetail(Visual3d_TOD_NONE), MySurfaceDetail(Visual3d_TOD_ALL),
myClipPlanes() myClipPlanes()
{ {
} }

View File

@ -1045,15 +1045,6 @@ is
-- or insufficient memory. -- or insufficient memory.
-- Warning: Works only under Windows. -- 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 ) ZBufferIsActivated ( me )
returns Boolean from Standard returns Boolean from Standard
is static; is static;

View File

@ -805,7 +805,6 @@ void Visual3d_View::Activate()
{ {
myGraphicDriver->ActivateView (MyCView); myGraphicDriver->ActivateView (MyCView);
myGraphicDriver->Background (MyCView); myGraphicDriver->Background (MyCView);
myGraphicDriver->Transparency (MyCView, myViewManager->Transparency());
MyCView.Active = 1; 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 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 // function : SetZBufferActivity
// purpose : // purpose :

View File

@ -411,24 +411,6 @@ is
-- if <AStructure> is displayed in <AProjector> and TOS_COMPUTED. -- if <AStructure> is displayed in <AProjector> and TOS_COMPUTED.
---Category: Private methods ---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 ) ZBufferAuto ( me )
returns Boolean from Standard returns Boolean from Standard
is static; is static;
@ -473,7 +455,6 @@ fields
-- advanced -- advanced
MyZBufferAuto : Boolean from Standard; MyZBufferAuto : Boolean from Standard;
MyTransparency : Boolean from Standard;
-- Z layer indexes -- Z layer indexes
myLayerIds : MapOfInteger from TColStd; myLayerIds : MapOfInteger from TColStd;

View File

@ -83,8 +83,7 @@ Visual3d_ViewManager::Visual3d_ViewManager (const Handle(Graphic3d_GraphicDriver
Graphic3d_StructureManager (theDriver), Graphic3d_StructureManager (theDriver),
MyDefinedView (), 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), 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), MyZBufferAuto (Standard_False)
MyTransparency (Standard_False)
{ {
// default layer is always presented in display layer sequence // default layer is always presented in display layer sequence
// it can not be removed // it can not be removed
@ -558,24 +557,6 @@ void Visual3d_ViewManager::UnIdentification (const Standard_Integer aViewId)
MyViewGenId.Free(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) void Visual3d_ViewManager::SetZBufferAuto (const Standard_Boolean AFlag)
{ {
if (MyZBufferAuto && AFlag) return; if (MyZBufferAuto && AFlag) return;