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.
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().
~~~~~
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
Syntax:
void CViewer3dView::OnAntialiasingonoff()
{
- if(!myView->Antialiasing())
- myView->SetAntialiasingOn();
- else
- myView->SetAntialiasingOff();
-
+ Graphic3d_RenderingParams& aParams = myView->ChangeRenderingParams();
+ aParams.NbMsaaSamples = aParams.NbMsaaSamples == 0 ? 8 : 0;
myView->Update();
TCollection_AsciiString Message("\
-if(!myView->Antialiasing())\n\
- myView->SetAntialiasingOn();\n\
-else\n\
- myView->SetAntialiasingOff();\n\
+Graphic3d_RenderingParams& aParams = myView->ChangeRenderingParams();\n\
+aParams.NbMsaaSamples = aParams.NbMsaaSamples == 0 ? 8 : 0;\n\
");
// Update The Result Message Dialog
void Graphic3d_CView::CopySettings (const Handle(Graphic3d_CView)& theOther)
{
ChangeRenderingParams() = theOther->RenderingParams();
- SetAntialiasingEnabled (theOther->IsAntialiasingEnabled());
SetBackground (theOther->Background());
SetGradientBackground (theOther->GradientBackground());
SetBackgroundImage (theOther->BackgroundImage());
//! Returns reference to current rendering parameters and effect settings.
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.
virtual Aspect_Background Background() const = 0;
// Dynamic fields
#define OPENGL_NS_RESMAT (1<<2)
#define OPENGL_NS_TEXTURE (1<<4)
-#define OPENGL_NS_ANTIALIASING (1<<5)
#define OPENGL_NS_2NDPASSNEED (1<<6)
#define OPENGL_NS_2NDPASSDO (1<<7)
#define OPENGL_NS_WHITEBACK (1<<8)
myCaps (theCaps),
myDeviceLostFlag (theDeviceLostFlag),
myWasRedrawnGL (Standard_False),
- myAntiAliasing (Standard_False),
myCulling (Standard_True),
myShadingModel (Graphic3d_TOSM_FACET),
myBackfacing (Graphic3d_TOBM_AUTOMATIC),
{
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;
aLight.Type = Graphic3d_TOLS_AMBIENT;
aLight.IsHeadlight = Standard_False;
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.
Standard_EXPORT virtual Aspect_Background Background() const Standard_OVERRIDE;
Standard_Boolean& myDeviceLostFlag;
Standard_Boolean myWasRedrawnGL;
- Standard_Boolean myAntiAliasing;
Standard_Boolean myCulling;
Graphic3d_TypeOfShadingModel myShadingModel;
Graphic3d_TypeOfBackfacingModel myBackfacing;
#endif
aManager->SetShadingModel (myShadingModel);
-
- // Apply AntiAliasing
- if (myAntiAliasing)
- myWorkspace->NamedStatus |= OPENGL_NS_ANTIALIASING;
- else
- myWorkspace->NamedStatus &= ~OPENGL_NS_ANTIALIASING;
-
if (!aManager->IsEmpty())
{
aManager->UpdateClippingState();
return;
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 ||
myRenderParams.Method != Graphic3d_RM_RAYTRACING ||
myRaytraceInitStatus == OpenGl_RT_FAIL ||
else
{
// 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)
{
glDepthMask (GL_TRUE);
return myView->IsGLLightEnabled();
}
-// =======================================================================
-// function : AntiAliasingMode
-// purpose :
-// =======================================================================
-Standard_Integer OpenGl_Workspace::AntiAliasingMode() const
-{
- return myView->IsAntialiasingEnabled();
-}
-
// =======================================================================
// function : IsCullingEnabled
// purpose :
//! @return true if usage of GL light is enabled.
Standard_EXPORT Standard_Boolean UseGLLight() const;
- //! @return true if antialiasing is enabled.
- Standard_EXPORT Standard_Integer AntiAliasingMode() const;
-
//! @return true if clipping algorithm enabled
Standard_EXPORT Standard_Boolean IsCullingEnabled() const;
Handle(OpenGl_Context) myGlContext;
Handle(OpenGl_PrinterContext) myPrintContext;
Handle(OpenGl_LineAttributes) myLineAttribs;
- Standard_Integer myAntiAliasingMode;
Standard_Boolean myUseZBuffer;
Standard_Boolean myUseDepthWrite;
Standard_Boolean myUseGLLight;
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
//=======================================================================
theCommands.Add("BUC60574","BUC60574 ",__FILE__,BUC60574,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("setcolor","setcolor name/object name/r g b/object r g b",__FILE__,setcolor,group);
myDefaultCamera = new Graphic3d_Camera();
myImmediateUpdate = Standard_False;
- SetAntialiasingOff();
SetAutoZFitMode (Standard_True, 1.0);
SetBackFacingModel (V3d_TOBM_AUTOMATIC);
SetCamera (aCamera);
return static_cast<V3d_TypeOfVisualization> (myView->VisualizationType());
}
-//=============================================================================
-//function : Antialiasing
-//purpose :
-//=============================================================================
-Standard_Boolean V3d_View::Antialiasing() const
-{
- return myView->IsAntialiasingEnabled();
-}
-
//=============================================================================
//function : Viewer
//purpose :
//! VIEWER application.
//! The methods of this class allow the editing
//! 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.
//! Warning: The default parameters are defined by the class
//! Viewer (Example : SetDefaultViewSize()).
//! Defines the visualization type in the view.
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.
Standard_EXPORT void SetZClippingDepth (const Quantity_Length theDepth);
//! Returns the current visualisation mode.
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.
//! <Depth> : Depth of plane.
//! <Width> : Thickness around the plane.
#include <V3d_View.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
//purpose :
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
//purpose : Switches altialiasing on or off
" vzrange - without parameters shows current values\n"
" vzrange [znear] [zfar] - applies provided values to view",
__FILE__,VZRange, group);
- theCommands.Add("vantialiasing",
- "vantialiasing 1|0"
- "\n\t\t: Switches altialiasing on or off",
- __FILE__,VAntialiasing,group);
theCommands.Add ("vpurgedisplay",
"vpurgedisplay"
"- removes structures which don't belong to objects displayed in neutral point",