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

0027360: Visualization - remove obsolete anti-aliasing API

The methods V3d_View::SetAntialiasingOn(), ::SetAntialiasingOff()
and Antialiasing() have been removed.
This commit is contained in:
kgv 2016-07-30 17:54:29 +03:00 committed by bugmaster
parent d01ed5fdd1
commit 2e5139af6b
16 changed files with 13 additions and 199 deletions

View File

@ -1010,3 +1010,10 @@ Graphic3d_Group::SetGroupPrimitivesAspect() should be the main method defining p
The implementation of Graphic3d_Group::SetGroupPrimitivesAspect() has been changed from copying aspect values to keeping passed object. The implementation of Graphic3d_Group::SetGroupPrimitivesAspect() has been changed from copying aspect values to keeping passed object.
Although it was not documented, previosly it was possible to modify single aspects instance (like Graphic3d_AspectFillArea3d) and set it to multiple groups. Although it was not documented, previosly it was possible to modify single aspects instance (like Graphic3d_AspectFillArea3d) and set it to multiple groups.
Now such code would produce unexpected result and therefore should be updated to create dedicated aspect instance. Now such code would produce unexpected result and therefore should be updated to create dedicated aspect instance.
@subsection upgrade_710_removed Removed features
The following obsolete features have been removed:
* Obsolete Antialiasing API V3d_View::SetAntialiasingOn(). This method was intended to activate deprecated OpenGL functionality (GL_POLYGON_SMOOTH, GL_LINE_SMOOTH, GL_POINT_SMOOTH).
Instead of old API, application should request MSAA buffers for antialiasing by assigning Graphic3d_RenderingParams::NbMsaaSamples property of structure returned by V3d_View::ChangeRenderingParams().

View File

@ -1461,14 +1461,6 @@ vnbselected
~~~~~ ~~~~~
Returns the number of selected objects in the interactive context. Returns the number of selected objects in the interactive context.
@subsubsection occt_draw_4_2_17 vantialiasing
Syntax:
~~~~~
vantialiasing 1|0
~~~~~
Sets antialiasing if the command is called with 1 or unsets otherwise.
@subsubsection occt_draw_4_2_18 vpurgedisplay @subsubsection occt_draw_4_2_18 vpurgedisplay
Syntax: Syntax:

View File

@ -1036,18 +1036,13 @@ GetDocument()->UpdateResultMessageDlg("SetShadingModel",Message);
void CViewer3dView::OnAntialiasingonoff() void CViewer3dView::OnAntialiasingonoff()
{ {
if(!myView->Antialiasing()) Graphic3d_RenderingParams& aParams = myView->ChangeRenderingParams();
myView->SetAntialiasingOn(); aParams.NbMsaaSamples = aParams.NbMsaaSamples == 0 ? 8 : 0;
else
myView->SetAntialiasingOff();
myView->Update(); myView->Update();
TCollection_AsciiString Message("\ TCollection_AsciiString Message("\
if(!myView->Antialiasing())\n\ Graphic3d_RenderingParams& aParams = myView->ChangeRenderingParams();\n\
myView->SetAntialiasingOn();\n\ aParams.NbMsaaSamples = aParams.NbMsaaSamples == 0 ? 8 : 0;\n\
else\n\
myView->SetAntialiasingOff();\n\
"); ");
// Update The Result Message Dialog // Update The Result Message Dialog

View File

@ -1140,7 +1140,6 @@ Standard_Integer Graphic3d_CView::HaveTheSameOwner (const Handle(Graphic3d_Struc
void Graphic3d_CView::CopySettings (const Handle(Graphic3d_CView)& theOther) void Graphic3d_CView::CopySettings (const Handle(Graphic3d_CView)& theOther)
{ {
ChangeRenderingParams() = theOther->RenderingParams(); ChangeRenderingParams() = theOther->RenderingParams();
SetAntialiasingEnabled (theOther->IsAntialiasingEnabled());
SetBackground (theOther->Background()); SetBackground (theOther->Background());
SetGradientBackground (theOther->GradientBackground()); SetGradientBackground (theOther->GradientBackground());
SetBackgroundImage (theOther->BackgroundImage()); SetBackgroundImage (theOther->BackgroundImage());

View File

@ -402,12 +402,6 @@ public:
//! Returns reference to current rendering parameters and effect settings. //! Returns reference to current rendering parameters and effect settings.
Graphic3d_RenderingParams& ChangeRenderingParams() { return myRenderParams; } Graphic3d_RenderingParams& ChangeRenderingParams() { return myRenderParams; }
//! Returns true if anti-aliasing is enabled for the view.
virtual Standard_Boolean IsAntialiasingEnabled() const = 0;
//! Enable or disable anti-aliasing in the view.
virtual void SetAntialiasingEnabled (const Standard_Boolean theIsEnabled) = 0;
//! Returns background fill color. //! Returns background fill color.
virtual Aspect_Background Background() const = 0; virtual Aspect_Background Background() const = 0;

View File

@ -19,7 +19,6 @@
// Dynamic fields // Dynamic fields
#define OPENGL_NS_RESMAT (1<<2) #define OPENGL_NS_RESMAT (1<<2)
#define OPENGL_NS_TEXTURE (1<<4) #define OPENGL_NS_TEXTURE (1<<4)
#define OPENGL_NS_ANTIALIASING (1<<5)
#define OPENGL_NS_2NDPASSNEED (1<<6) #define OPENGL_NS_2NDPASSNEED (1<<6)
#define OPENGL_NS_2NDPASSDO (1<<7) #define OPENGL_NS_2NDPASSDO (1<<7)
#define OPENGL_NS_WHITEBACK (1<<8) #define OPENGL_NS_WHITEBACK (1<<8)

View File

@ -62,7 +62,6 @@ OpenGl_View::OpenGl_View (const Handle(Graphic3d_StructureManager)& theMgr,
myCaps (theCaps), myCaps (theCaps),
myDeviceLostFlag (theDeviceLostFlag), myDeviceLostFlag (theDeviceLostFlag),
myWasRedrawnGL (Standard_False), myWasRedrawnGL (Standard_False),
myAntiAliasing (Standard_False),
myCulling (Standard_True), myCulling (Standard_True),
myShadingModel (Graphic3d_TOSM_FACET), myShadingModel (Graphic3d_TOSM_FACET),
myBackfacing (Graphic3d_TOBM_AUTOMATIC), myBackfacing (Graphic3d_TOBM_AUTOMATIC),
@ -96,14 +95,6 @@ OpenGl_View::OpenGl_View (const Handle(Graphic3d_StructureManager)& theMgr,
{ {
myWorkspace = new OpenGl_Workspace (this, NULL); myWorkspace = new OpenGl_Workspace (this, NULL);
// AA mode
const char* anAaEnv = ::getenv ("CALL_OPENGL_ANTIALIASING_MODE");
if (anAaEnv != NULL)
{
int v;
if (sscanf (anAaEnv, "%d", &v) > 0) myAntiAliasing = v;
}
OpenGl_Light aLight; OpenGl_Light aLight;
aLight.Type = Graphic3d_TOLS_AMBIENT; aLight.Type = Graphic3d_TOLS_AMBIENT;
aLight.IsHeadlight = Standard_False; aLight.IsHeadlight = Standard_False;

View File

@ -273,12 +273,6 @@ public:
public: public:
//! Returns true if anti-aliasing is enabled for the view.
Standard_Boolean virtual IsAntialiasingEnabled() const Standard_OVERRIDE { return myAntiAliasing; }
//! Enable or disable anti-aliasing in the view.
virtual void SetAntialiasingEnabled (const Standard_Boolean theIsEnabled) Standard_OVERRIDE { myAntiAliasing = theIsEnabled; }
//! Returns background fill color. //! Returns background fill color.
Standard_EXPORT virtual Aspect_Background Background() const Standard_OVERRIDE; Standard_EXPORT virtual Aspect_Background Background() const Standard_OVERRIDE;
@ -563,7 +557,6 @@ protected:
Standard_Boolean& myDeviceLostFlag; Standard_Boolean& myDeviceLostFlag;
Standard_Boolean myWasRedrawnGL; Standard_Boolean myWasRedrawnGL;
Standard_Boolean myAntiAliasing;
Standard_Boolean myCulling; Standard_Boolean myCulling;
Graphic3d_TypeOfShadingModel myShadingModel; Graphic3d_TypeOfShadingModel myShadingModel;
Graphic3d_TypeOfBackfacingModel myBackfacing; Graphic3d_TypeOfBackfacingModel myBackfacing;

View File

@ -922,13 +922,6 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection,
#endif #endif
aManager->SetShadingModel (myShadingModel); aManager->SetShadingModel (myShadingModel);
// Apply AntiAliasing
if (myAntiAliasing)
myWorkspace->NamedStatus |= OPENGL_NS_ANTIALIASING;
else
myWorkspace->NamedStatus &= ~OPENGL_NS_ANTIALIASING;
if (!aManager->IsEmpty()) if (!aManager->IsEmpty())
{ {
aManager->UpdateClippingState(); aManager->UpdateClippingState();
@ -1022,40 +1015,6 @@ void OpenGl_View::renderStructs (Graphic3d_Camera::Projection theProjection,
return; return;
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext(); Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
if ( (myWorkspace->NamedStatus & OPENGL_NS_2NDPASSNEED) == 0 )
{
#if !defined(GL_ES_VERSION_2_0)
const int anAntiAliasingMode = myWorkspace->AntiAliasingMode();
#endif
if ( !myAntiAliasing )
{
#if !defined(GL_ES_VERSION_2_0)
if (aCtx->core11 != NULL)
{
glDisable (GL_POINT_SMOOTH);
}
glDisable(GL_LINE_SMOOTH);
if( anAntiAliasingMode & 2 ) glDisable(GL_POLYGON_SMOOTH);
#endif
glBlendFunc (GL_ONE, GL_ZERO);
glDisable (GL_BLEND);
}
else
{
#if !defined(GL_ES_VERSION_2_0)
if (aCtx->core11 != NULL)
{
glEnable(GL_POINT_SMOOTH);
}
glEnable(GL_LINE_SMOOTH);
if( anAntiAliasingMode & 2 ) glEnable(GL_POLYGON_SMOOTH);
#endif
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable (GL_BLEND);
}
}
Standard_Boolean toRenderGL = theToDrawImmediate || Standard_Boolean toRenderGL = theToDrawImmediate ||
myRenderParams.Method != Graphic3d_RM_RAYTRACING || myRenderParams.Method != Graphic3d_RM_RAYTRACING ||
myRaytraceInitStatus == OpenGl_RT_FAIL || myRaytraceInitStatus == OpenGl_RT_FAIL ||

View File

@ -655,11 +655,8 @@ void OpenGl_Workspace::updateMaterial (const int theFlag)
else else
{ {
// render opaque // render opaque
if ((NamedStatus & OPENGL_NS_ANTIALIASING) == 0) glBlendFunc (GL_ONE, GL_ZERO);
{ glDisable (GL_BLEND);
glBlendFunc (GL_ONE, GL_ZERO);
glDisable (GL_BLEND);
}
if (myUseDepthWrite) if (myUseDepthWrite)
{ {
glDepthMask (GL_TRUE); glDepthMask (GL_TRUE);
@ -1005,15 +1002,6 @@ Standard_Boolean OpenGl_Workspace::UseGLLight() const
return myView->IsGLLightEnabled(); return myView->IsGLLightEnabled();
} }
// =======================================================================
// function : AntiAliasingMode
// purpose :
// =======================================================================
Standard_Integer OpenGl_Workspace::AntiAliasingMode() const
{
return myView->IsAntialiasingEnabled();
}
// ======================================================================= // =======================================================================
// function : IsCullingEnabled // function : IsCullingEnabled
// purpose : // purpose :

View File

@ -162,9 +162,6 @@ public:
//! @return true if usage of GL light is enabled. //! @return true if usage of GL light is enabled.
Standard_EXPORT Standard_Boolean UseGLLight() const; Standard_EXPORT Standard_Boolean UseGLLight() const;
//! @return true if antialiasing is enabled.
Standard_EXPORT Standard_Integer AntiAliasingMode() const;
//! @return true if clipping algorithm enabled //! @return true if clipping algorithm enabled
Standard_EXPORT Standard_Boolean IsCullingEnabled() const; Standard_EXPORT Standard_Boolean IsCullingEnabled() const;
@ -362,7 +359,6 @@ protected: //! @name protected fields
Handle(OpenGl_Context) myGlContext; Handle(OpenGl_Context) myGlContext;
Handle(OpenGl_PrinterContext) myPrintContext; Handle(OpenGl_PrinterContext) myPrintContext;
Handle(OpenGl_LineAttributes) myLineAttribs; Handle(OpenGl_LineAttributes) myLineAttribs;
Standard_Integer myAntiAliasingMode;
Standard_Boolean myUseZBuffer; Standard_Boolean myUseZBuffer;
Standard_Boolean myUseDepthWrite; Standard_Boolean myUseDepthWrite;
Standard_Boolean myUseGLLight; Standard_Boolean myUseGLLight;

View File

@ -390,29 +390,6 @@ static Standard_Integer BUC60699(Draw_Interpretor& di, Standard_Integer /*n*/, c
return 0; return 0;
} }
static Standard_Integer GER61394(Draw_Interpretor& di, Standard_Integer argc, const char ** argv )
{
if(argc > 2) {
di << "Usage : " << argv[0] << " [1/0]\n";
return -1;
}
Handle(AIS_InteractiveContext) myAIScontext = ViewerTest::GetAISContext();
if(myAIScontext.IsNull()) {
di << "use 'vinit' command before " << argv[0] << "\n";
return -1;
}
Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
if((argc == 2) && (Draw::Atof(argv[1]) == 0))
myV3dView->SetAntialiasingOff();
else
myV3dView->SetAntialiasingOn();
myV3dView->Update();
return 0;
}
#define DEFAULT_COLOR Quantity_NOC_GOLDENROD #define DEFAULT_COLOR Quantity_NOC_GOLDENROD
//======================================================================= //=======================================================================
@ -1817,7 +1794,6 @@ void QABugs::Commands_3(Draw_Interpretor& theCommands) {
theCommands.Add("BUC60574","BUC60574 ",__FILE__,BUC60574,group); theCommands.Add("BUC60574","BUC60574 ",__FILE__,BUC60574,group);
theCommands.Add("BUC60699","BUC60699 ",__FILE__,BUC60699,group); theCommands.Add("BUC60699","BUC60699 ",__FILE__,BUC60699,group);
theCommands.Add("GER61394","GER61394 [1/0]",__FILE__,GER61394,group);
theCommands.Add("GER61351","GER61351 name/object name/r g b/object r g b",__FILE__,setcolor,group); theCommands.Add("GER61351","GER61351 name/object name/r g b/object r g b",__FILE__,setcolor,group);
theCommands.Add("setcolor","setcolor name/object name/r g b/object r g b",__FILE__,setcolor,group); theCommands.Add("setcolor","setcolor name/object name/r g b/object r g b",__FILE__,setcolor,group);

View File

@ -153,7 +153,6 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th
myDefaultCamera = new Graphic3d_Camera(); myDefaultCamera = new Graphic3d_Camera();
myImmediateUpdate = Standard_False; myImmediateUpdate = Standard_False;
SetAntialiasingOff();
SetAutoZFitMode (Standard_True, 1.0); SetAutoZFitMode (Standard_True, 1.0);
SetBackFacingModel (V3d_TOBM_AUTOMATIC); SetBackFacingModel (V3d_TOBM_AUTOMATIC);
SetCamera (aCamera); SetCamera (aCamera);
@ -2431,15 +2430,6 @@ V3d_TypeOfVisualization V3d_View::Visualization() const
return static_cast<V3d_TypeOfVisualization> (myView->VisualizationType()); return static_cast<V3d_TypeOfVisualization> (myView->VisualizationType());
} }
//=============================================================================
//function : Antialiasing
//purpose :
//=============================================================================
Standard_Boolean V3d_View::Antialiasing() const
{
return myView->IsAntialiasingEnabled();
}
//============================================================================= //=============================================================================
//function : Viewer //function : Viewer
//purpose : //purpose :

View File

@ -102,8 +102,6 @@ DEFINE_STANDARD_HANDLE(V3d_View, MMgt_TShared)
//! VIEWER application. //! VIEWER application.
//! The methods of this class allow the editing //! The methods of this class allow the editing
//! and inquiring the parameters linked to the view. //! and inquiring the parameters linked to the view.
//! (Projection,Mapping,Zclipping,DepthCueing,AntiAliasing
//! et Conversions) .
//! Provides a set of services common to all types of view. //! Provides a set of services common to all types of view.
//! Warning: The default parameters are defined by the class //! Warning: The default parameters are defined by the class
//! Viewer (Example : SetDefaultViewSize()). //! Viewer (Example : SetDefaultViewSize()).
@ -265,12 +263,6 @@ public:
//! Defines the visualization type in the view. //! Defines the visualization type in the view.
Standard_EXPORT void SetVisualization (const V3d_TypeOfVisualization theType); Standard_EXPORT void SetVisualization (const V3d_TypeOfVisualization theType);
//! Activates antialiasing in the view.
Standard_EXPORT void SetAntialiasingOn();
//! Deactivates antialiasing in the view.
Standard_EXPORT void SetAntialiasingOff();
//! Defines the depth of the medium clipping plane. //! Defines the depth of the medium clipping plane.
Standard_EXPORT void SetZClippingDepth (const Quantity_Length theDepth); Standard_EXPORT void SetZClippingDepth (const Quantity_Length theDepth);
@ -722,10 +714,6 @@ public:
//! Returns the current visualisation mode. //! Returns the current visualisation mode.
Standard_EXPORT V3d_TypeOfVisualization Visualization() const; Standard_EXPORT V3d_TypeOfVisualization Visualization() const;
//! Indicates if the antialiasing is active (True) or
//! inactive (False).
Standard_EXPORT Standard_Boolean Antialiasing() const;
//! Returns activity and information on the Zcueing. //! Returns activity and information on the Zcueing.
//! <Depth> : Depth of plane. //! <Depth> : Depth of plane.
//! <Width> : Thickness around the plane. //! <Width> : Thickness around the plane.

View File

@ -39,24 +39,6 @@
#include <V3d_View.hxx> #include <V3d_View.hxx>
#include <V3d_Viewer.hxx> #include <V3d_Viewer.hxx>
// =======================================================================
// function : SetAntialiasingOn
// purpose :
// =======================================================================
void V3d_View::SetAntialiasingOn()
{
myView->SetAntialiasingEnabled (Standard_True);
}
// =======================================================================
// function : SetAntialiasingOff
// purpose :
// =======================================================================
void V3d_View::SetAntialiasingOff()
{
myView->SetAntialiasingEnabled (Standard_False);
}
//============================================================================= //=============================================================================
//function : SetZClippingDepth //function : SetZClippingDepth
//purpose : //purpose :

View File

@ -6318,37 +6318,6 @@ static Standard_Integer VNbSelected (Draw_Interpretor& di,
return 0; return 0;
} }
//=======================================================================
//function : VAntialiasing
//purpose : Switches altialiasing on or off
//=======================================================================
static Standard_Integer VAntialiasing (Draw_Interpretor& di,
Standard_Integer argc,
const char ** argv)
{
if(argc > 2)
{
di << "Usage : " << argv[0] << " [1|0]\n";
return 1;
}
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(aContext.IsNull())
{
di << "use 'vinit' command before " << argv[0] << "\n";
return 1;
}
Handle(V3d_View) aView = ViewerTest::CurrentView();
if((argc == 2) && (atof(argv[1]) == 0))
aView->SetAntialiasingOff();
else
aView->SetAntialiasingOn();
aView->Update();
return 0;
}
//======================================================================= //=======================================================================
//function : VPurgeDisplay //function : VPurgeDisplay
//purpose : Switches altialiasing on or off //purpose : Switches altialiasing on or off
@ -9524,10 +9493,6 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
" vzrange - without parameters shows current values\n" " vzrange - without parameters shows current values\n"
" vzrange [znear] [zfar] - applies provided values to view", " vzrange [znear] [zfar] - applies provided values to view",
__FILE__,VZRange, group); __FILE__,VZRange, group);
theCommands.Add("vantialiasing",
"vantialiasing 1|0"
"\n\t\t: Switches altialiasing on or off",
__FILE__,VAntialiasing,group);
theCommands.Add ("vpurgedisplay", theCommands.Add ("vpurgedisplay",
"vpurgedisplay" "vpurgedisplay"
"- removes structures which don't belong to objects displayed in neutral point", "- removes structures which don't belong to objects displayed in neutral point",