From 67441d0ca30466eec83edf8e8f87fcfd45c07119 Mon Sep 17 00:00:00 2001 From: kgv Date: Fri, 13 Mar 2020 00:35:06 +0300 Subject: [PATCH] 0031424: Visualization - stop using Prs3d_Drawer::HLRAngle() parameter Prs3d_Drawer, AIS_Shape, AIS_InteractiveContext - removed properties HLRDeviationCoefficient() and HLRAngle(). Prs3d_Drawer::HLRAngle() is kept as alias to Prs3d_Drawer::DeviationAngle() with deprecated flag. Prs3d_Drawer::DeviationAngle() default value is changed from 12 to 20 degrees to match Prs3d_Drawer::HLRAngle() which has been previously used in majority of cases. Removed unused property HLRBRep_PolyAlgo::Angle(). --- dox/dev_guides/upgrade/upgrade.md | 6 + .../ios/UIKitSample/UIKitSample/OcctViewer.mm | 2 +- src/AIS/AIS_ColoredShape.cxx | 2 +- src/AIS/AIS_InteractiveContext.cxx | 149 ---------------- src/AIS/AIS_InteractiveContext.hxx | 49 +----- src/AIS/AIS_Shape.cxx | 93 +--------- src/AIS/AIS_Shape.hxx | 33 +--- src/DBRep/DBRep_HideData.cxx | 1 - src/DBRep/DBRep_HideData.hxx | 29 +--- src/DBRep/DBRep_HideData.lxx | 36 ---- src/DBRep/FILES | 1 - src/HLRBRep/FILES | 1 - src/HLRBRep/HLRBRep_PolyAlgo.cxx | 3 - src/HLRBRep/HLRBRep_PolyAlgo.hxx | 125 ++++++-------- src/HLRBRep/HLRBRep_PolyAlgo.lxx | 163 ------------------ src/Prs3d/Prs3d_Drawer.cxx | 38 +--- src/Prs3d/Prs3d_Drawer.hxx | 108 ++---------- src/StdPrs/StdPrs_HLRPolyShape.cxx | 9 +- src/StdPrs/StdPrs_ToolTriangulatedShape.cxx | 2 +- src/ViewerTest/ViewerTest_ViewerCommands.cxx | 5 +- tests/bugs/vis/bug26014 | 2 +- 21 files changed, 90 insertions(+), 767 deletions(-) delete mode 100644 src/DBRep/DBRep_HideData.lxx delete mode 100644 src/HLRBRep/HLRBRep_PolyAlgo.lxx diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index d7c1612305..45c48ea1c6 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -1889,6 +1889,12 @@ Unexpected const-ness of Aspect_Window::DoResize() method has been removed, so t Enumeration BRepOffset_Type is renamed to ChFiDS_TypeOfConcavity. +@subsection upgrade_750_hlrangle Prs3d_Drawer deviation angle + +Properties Prs3d_Drawer::HLRAngle() and Prs3d_Drawer::HLRDeviationCoefficient() have been removed from classes *Prs3d_Drawer*, *AIS_Shape* and *AIS_InteractiveContext*. +Prs3d_Drawer::DeviationAngle() should be now used instead of Prs3d_Drawer::HLRAngle() and Prs3d_Drawer::DeviationCoefficient() instead of Prs3d_Drawer::HLRDeviationCoefficient(). +The default value of Prs3d_Drawer::DeviationAngle() property has been changed from 12 to 20 degrees to match removed Prs3d_Drawer::HLRAngle(), previously used as input for triangulation algorithm. + @subsection upgrade_750_hlrprs Changes in HLR presentation API Methods computing HLR presentation within *PrsMgr_PresentableObject::Compute()* have been renamed to *PrsMgr_PresentableObject::computeHLR()* diff --git a/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm b/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm index c1d3aba89d..0ede0c71ac 100644 --- a/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm +++ b/samples/ios/UIKitSample/UIKitSample/OcctViewer.mm @@ -262,7 +262,7 @@ bool OcctViewer::ImportSTEP(std::string theFilename) { BRepMesh_IncrementalMesh anAlgo; anAlgo.ChangeParameters().Deflection = aDeflection; - anAlgo.ChangeParameters().Angle = aDrawer->HLRAngle(); + anAlgo.ChangeParameters().Angle = aDrawer->DeviationAngle(); anAlgo.ChangeParameters().InParallel = Standard_True; anAlgo.SetShape (aCompound); anAlgo.Perform(); diff --git a/src/AIS/AIS_ColoredShape.cxx b/src/AIS/AIS_ColoredShape.cxx index c5ca8990c2..3354a5c360 100644 --- a/src/AIS/AIS_ColoredShape.cxx +++ b/src/AIS/AIS_ColoredShape.cxx @@ -491,7 +491,7 @@ void AIS_ColoredShape::ComputeSelection (const Handle(SelectMgr_Selection)& theS const TopAbs_ShapeEnum aTypOfSel = AIS_Shape::SelectionType (theMode); const Standard_Real aDeflection = Prs3d::GetDeflection (myshape, myDrawer); - const Standard_Real aDeviationAngle = myDrawer->HLRAngle(); + const Standard_Real aDeviationAngle = myDrawer->DeviationAngle(); const Standard_Integer aPriority = StdSelect_BRepSelectionTool::GetStandardPriority (myshape, aTypOfSel); if (myDrawer->IsAutoTriangulation() && !BRepTools::Triangulation (myshape, Precision::Infinite())) diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx index 5d4454d5e7..04d0076c87 100644 --- a/src/AIS/AIS_InteractiveContext.cxx +++ b/src/AIS/AIS_InteractiveContext.cxx @@ -1173,57 +1173,6 @@ Standard_Real AIS_InteractiveContext::DeviationCoefficient() const return myDefaultDrawer->DeviationCoefficient(); } -//======================================================================= -//function : SetHLRDeviationCoefficient -//purpose : -//======================================================================= -void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Standard_Real theCoefficient) -{ - myDefaultDrawer->SetHLRDeviationCoefficient (theCoefficient); -} - -//======================================================================= -//function : HLRDeviationCoefficient -//purpose : -//======================================================================= -Standard_Real AIS_InteractiveContext::HLRDeviationCoefficient() const -{ - return myDefaultDrawer->HLRDeviationCoefficient(); -} - -//======================================================================= -//function : SetHLRAngle -//purpose : -//======================================================================= -void AIS_InteractiveContext::SetHLRAngle (const Standard_Real theAngle) -{ - myDefaultDrawer->SetHLRAngle (theAngle); -} - -//======================================================================= -//function : SetHLRAngleAndDeviation -//purpose : compute with anangle a HLRAngle and a HLRDeviationCoefficient -// and set them in myHLRAngle and in myHLRDeviationCoefficient -// of myDefaultDrawer -//======================================================================= -void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Standard_Real theAngle) -{ - Standard_Real anOutAngl, anOutDefl; - HLRBRep::PolyHLRAngleAndDeflection (theAngle, anOutAngl, anOutDefl); - - myDefaultDrawer->SetHLRAngle (anOutAngl); - myDefaultDrawer->SetHLRDeviationCoefficient (anOutDefl); -} - -//======================================================================= -//function : HLRAngle -//purpose : -//======================================================================= -Standard_Real AIS_InteractiveContext::HLRAngle() const -{ - return myDefaultDrawer->HLRAngle(); -} - //======================================================================= //function : SetDisplayMode //purpose : @@ -1472,40 +1421,6 @@ void AIS_InteractiveContext::SetDeviationCoefficient (const Handle(AIS_Interacti } } -//======================================================================= -//function : SetHLRDeviationCoefficient -//purpose : -//======================================================================= -void AIS_InteractiveContext::SetHLRDeviationCoefficient (const Handle(AIS_InteractiveObject)& theIObj, - const Standard_Real theCoefficient, - const Standard_Boolean theToUpdateViewer) -{ - if (theIObj.IsNull()) - { - return; - } - - // To be modified after the related methods of AIS_Shape are passed to InteractiveObject - setContextToObject (theIObj); - if (theIObj->Type() != AIS_KOI_Object - && theIObj->Type() != AIS_KOI_Shape) - { - return; - } - else if (theIObj->Signature() != 0) - { - return; - } - - Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj); - aShape->SetOwnHLRDeviationCoefficient (theCoefficient); - aShape->UpdatePresentations(); - if (theToUpdateViewer) - { - UpdateCurrentViewer(); - } -} - //======================================================================= //function : SetDeviationAngle //purpose : @@ -1572,70 +1487,6 @@ void AIS_InteractiveContext::SetAngleAndDeviation (const Handle(AIS_InteractiveO } } -//======================================================================= -//function : SetHLRAngleAndDeviation -//purpose : -//======================================================================= -void AIS_InteractiveContext::SetHLRAngleAndDeviation (const Handle(AIS_InteractiveObject)& theIObj, - const Standard_Real theAngle, - const Standard_Boolean theToUpdateViewer) -{ - if (theIObj.IsNull()) - { - return; - } - - // To be modified after the related methods of AIS_Shape are passed to InteractiveObject - setContextToObject (theIObj); - if (theIObj->Type() != AIS_KOI_Shape) - { - return; - } - if (theIObj->Signature() != 0) - { - return; - } - Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj); - aShape->SetHLRAngleAndDeviation (theAngle); - aShape->UpdatePresentations(); - if (theToUpdateViewer) - { - UpdateCurrentViewer(); - } -} - -//======================================================================= -//function : SetHLRDeviationAngle -//purpose : -//======================================================================= -void AIS_InteractiveContext::SetHLRDeviationAngle (const Handle(AIS_InteractiveObject)& theIObj, - const Standard_Real theAngle, - const Standard_Boolean theToUpdateViewer) -{ - if (theIObj.IsNull()) - { - return; - } - - // To be modified after the related methods of AIS_Shape are passed to InteractiveObject - setContextToObject (theIObj); - if (theIObj->Type() != AIS_KOI_Shape) - { - return; - } - if (theIObj->Signature() != 0) - { - return; - } - Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (theIObj); - aShape->SetOwnHLRDeviationAngle (theAngle); - aShape->UpdatePresentations(); - if (theToUpdateViewer) - { - UpdateCurrentViewer(); - } -} - //======================================================================= //function : UnsetColor //purpose : diff --git a/src/AIS/AIS_InteractiveContext.hxx b/src/AIS/AIS_InteractiveContext.hxx index 0e1b56d8ff..42b89bbd27 100644 --- a/src/AIS/AIS_InteractiveContext.hxx +++ b/src/AIS/AIS_InteractiveContext.hxx @@ -971,23 +971,6 @@ public: //! @name tessellation deviation properties for automatic triangulation Standard_EXPORT void SetAngleAndDeviation (const Handle(AIS_InteractiveObject)& theIObj, const Standard_Real theAngle, const Standard_Boolean theToUpdateViewer); - - - //! Sets the deviation coefficient aCoefficient for removal of hidden lines created by different viewpoints in different presentations. - //! The Default value is 0.02. - Standard_EXPORT void SetHLRDeviationCoefficient (const Handle(AIS_InteractiveObject)& theIObj, - const Standard_Real theCoefficient, - const Standard_Boolean theToUpdateViewer); - - Standard_EXPORT void SetHLRDeviationAngle (const Handle(AIS_InteractiveObject)& theIObj, - const Standard_Real theAngle, - const Standard_Boolean theToUpdateViewer); - - //! Computes a HLRAngle and a HLRDeviationCoefficient by means of the angle anAngle - //! and sets the corresponding methods in the default drawing tool with these values. - Standard_EXPORT void SetHLRAngleAndDeviation (const Handle(AIS_InteractiveObject)& theIObj, - const Standard_Real theAngle, - const Standard_Boolean theToUpdateViewer); //! Sets the deviation coefficient theCoefficient. //! Drawings of curves or patches are made with respect to a maximal chordal deviation. @@ -1017,40 +1000,10 @@ public: //! @name tessellation deviation properties for automatic triangulation //! This deviation will be: SizeOfObject * DeviationCoefficient. Standard_EXPORT Standard_Real DeviationCoefficient() const; - //! default 12 degrees + //! default 20 degrees Standard_EXPORT void SetDeviationAngle (const Standard_Real anAngle); Standard_EXPORT Standard_Real DeviationAngle() const; - - //! Sets the deviation coefficient aCoefficient for removal of hidden lines created by different viewpoints in different presentations. - //! The Default value is 0.02. - Standard_EXPORT void SetHLRDeviationCoefficient (const Standard_Real aCoefficient); - - //! Returns the real number value of the hidden line removal deviation coefficient. - //! A Deviation coefficient is used in the shading display mode. - //! The shape is seen decomposed into triangles. - //! These are used to calculate reflection of light from the surface of the object. - //! The triangles are formed from chords of the curves in the shape. - //! The deviation coefficient give the highest value of the angle with which a chord can deviate from a tangent to a curve. - //! If this limit is reached, a new triangle is begun. - //! To find the hidden lines, hidden line display mode entails recalculation of the view at each different projector perspective. - //! Because hidden lines entail calculations of more than usual complexity to decompose them into these triangles, - //! a deviation coefficient allowing greater tolerance is used. - //! This increases efficiency in calculation. - //! The Default value is 0.02. - Standard_EXPORT Standard_Real HLRDeviationCoefficient() const; - - //! Sets the HLR angle. - Standard_EXPORT void SetHLRAngle (const Standard_Real theAngle); - - //! Returns the real number value of the deviation angle in hidden line removal views in this interactive context. - //! The default value is 20*PI/180. - Standard_EXPORT Standard_Real HLRAngle() const; - - //! compute with theAngle a HLRAngle and a HLRDeviationCoefficient - //! and set them in myHLRAngle and in myHLRDeviationCoefficient of myDefaultDrawer; - //! theAngle is in radian; ( 1 deg < angle in deg < 20 deg) - Standard_EXPORT void SetHLRAngleAndDeviation (const Standard_Real theAngle); public: //! @name HLR (Hidden Line Removal) display attributes diff --git a/src/AIS/AIS_Shape.cxx b/src/AIS/AIS_Shape.cxx index c3eab18854..ca23c15921 100644 --- a/src/AIS/AIS_Shape.cxx +++ b/src/AIS/AIS_Shape.cxx @@ -336,7 +336,7 @@ void AIS_Shape::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, shape, TypOfSel, aDeflection, - myDrawer->HLRAngle(), + myDrawer->DeviationAngle(), myDrawer->IsAutoTriangulation()); } catch (Standard_Failure const& anException) @@ -819,20 +819,6 @@ Standard_Boolean AIS_Shape::SetOwnDeviationCoefficient () return itSet; } -//======================================================================= -//function : SetHLROwnDeviationCoefficient -//purpose : resets myhasOwnHLRDeviationCoefficient to Standard_False and -// returns Standard_True if it change -//======================================================================= - -Standard_Boolean AIS_Shape::SetOwnHLRDeviationCoefficient () -{ - Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationCoefficient(); - if(itSet) myDrawer->SetHLRDeviationCoefficient(); - return itSet; - -} - //======================================================================= //function : SetOwnDeviationAngle //purpose : resets myhasOwnDeviationAngle to Standard_False and @@ -847,20 +833,6 @@ Standard_Boolean AIS_Shape::SetOwnDeviationAngle () } -//======================================================================= -//function : SetOwnHLRDeviationAngle -//purpose : resets myhasOwnHLRDeviationAngle to Standard_False and -// returns Standard_True if it change -//======================================================================= - -Standard_Boolean AIS_Shape::SetOwnHLRDeviationAngle () -{ - Standard_Boolean itSet = myDrawer->HasOwnHLRDeviationAngle(); - if(itSet) myDrawer->SetHLRAngle(); - return itSet; - -} -//***** SetOwn //======================================================================= //function : SetOwnDeviationCoefficient //purpose : @@ -872,17 +844,6 @@ void AIS_Shape::SetOwnDeviationCoefficient ( const Standard_Real aCoefficient ) SetToUpdate(); } -//======================================================================= -//function : SetOwnHLRDeviationCoefficient -//purpose : -//======================================================================= - -void AIS_Shape::SetOwnHLRDeviationCoefficient ( const Standard_Real aCoefficient ) -{ - myDrawer->SetHLRDeviationCoefficient( aCoefficient ); - -} - //======================================================================= //function : SetOwnDeviationAngle //purpose : @@ -918,31 +879,6 @@ Standard_Real AIS_Shape::UserAngle() const return myInitAng ==0. ? GetContext()->DeviationAngle(): myInitAng; } - -//======================================================================= -//function : SetHLRAngleAndDeviation -//purpose : -//======================================================================= - -void AIS_Shape::SetHLRAngleAndDeviation ( const Standard_Real anAngle ) -{ - Standard_Real OutAngl,OutDefl; - HLRBRep::PolyHLRAngleAndDeflection(anAngle,OutAngl,OutDefl); - SetOwnHLRDeviationAngle( OutAngl ); - SetOwnHLRDeviationCoefficient(OutDefl); - -} -//======================================================================= -//function : SetOwnHLRDeviationAngle -//purpose : -//======================================================================= - -void AIS_Shape::SetOwnHLRDeviationAngle ( const Standard_Real anAngle ) -{ - myDrawer->SetHLRAngle( anAngle ); -} - -//***** GetOwn //======================================================================= //function : OwnDeviationCoefficient //purpose : @@ -956,20 +892,6 @@ Standard_Boolean AIS_Shape::OwnDeviationCoefficient ( Standard_Real & aCoeffici return myDrawer->HasOwnDeviationCoefficient() ; } -//======================================================================= -//function : OwnHLRDeviationCoefficient -//purpose : -//======================================================================= - -Standard_Boolean AIS_Shape::OwnHLRDeviationCoefficient ( Standard_Real & aCoefficient, - Standard_Real & aPreviousCoefficient ) const -{ - aCoefficient = myDrawer->HLRDeviationCoefficient(); - aPreviousCoefficient = myDrawer->PreviousHLRDeviationCoefficient (); - return myDrawer->HasOwnHLRDeviationCoefficient(); - -} - //======================================================================= //function : OwnDeviationAngle //purpose : @@ -983,19 +905,6 @@ Standard_Boolean AIS_Shape::OwnDeviationAngle ( Standard_Real & anAngle, return myDrawer->HasOwnDeviationAngle(); } -//======================================================================= -//function : OwnHLRDeviationAngle -//purpose : -//======================================================================= - -Standard_Boolean AIS_Shape::OwnHLRDeviationAngle ( Standard_Real & anAngle, - Standard_Real & aPreviousAngle ) const -{ - anAngle = myDrawer->HLRAngle(); - aPreviousAngle = myDrawer->PreviousHLRDeviationAngle (); - return myDrawer->HasOwnHLRDeviationAngle(); -} - //======================================================================= //function : DumpJson //purpose : diff --git a/src/AIS/AIS_Shape.hxx b/src/AIS/AIS_Shape.hxx index ceb86a5359..ad13131f62 100644 --- a/src/AIS/AIS_Shape.hxx +++ b/src/AIS/AIS_Shape.hxx @@ -92,23 +92,13 @@ public: //! Sets a local value for deviation coefficient for this specific shape. Standard_EXPORT Standard_Boolean SetOwnDeviationCoefficient(); - - //! Sets a local value for HLR deviation coefficient for this specific shape. - Standard_EXPORT Standard_Boolean SetOwnHLRDeviationCoefficient(); - + //! Sets a local value for deviation angle for this specific shape. Standard_EXPORT Standard_Boolean SetOwnDeviationAngle(); - //! Sets a local value for HLR deviation angle for this specific shape. - Standard_EXPORT Standard_Boolean SetOwnHLRDeviationAngle(); - //! Sets a local value for deviation coefficient for this specific shape. Standard_EXPORT void SetOwnDeviationCoefficient (const Standard_Real aCoefficient); - - //! sets myOwnHLRDeviationCoefficient field in Prs3d_Drawer & - //! recomputes presentation - Standard_EXPORT void SetOwnHLRDeviationCoefficient (const Standard_Real aCoefficient); - + //! this compute a new angle and Deviation from the value anAngle //! and set the values stored in myDrawer with these that become local to the shape Standard_EXPORT void SetAngleAndDeviation (const Standard_Real anAngle); @@ -119,36 +109,17 @@ public: //! sets myOwnDeviationAngle field in Prs3d_Drawer & recomputes presentation Standard_EXPORT void SetOwnDeviationAngle (const Standard_Real anAngle); - //! this compute a new Angle and Deviation from the value anAngle for HLR - //! and set the values stored in myDrawer for with these that become local to the shape - Standard_EXPORT void SetHLRAngleAndDeviation (const Standard_Real anAngle); - - //! sets myOwnHLRDeviationAngle field in Prs3d_Drawer & recomputes presentation - Standard_EXPORT void SetOwnHLRDeviationAngle (const Standard_Real anAngle); - //! Returns true and the values of the deviation //! coefficient aCoefficient and the previous deviation //! coefficient aPreviousCoefficient. If these values are //! not already set, false is returned. Standard_EXPORT Standard_Boolean OwnDeviationCoefficient (Standard_Real& aCoefficient, Standard_Real& aPreviousCoefficient) const; - //! Returns true and the values of the HLR deviation - //! coefficient aCoefficient and the previous HLR - //! deviation coefficient aPreviousCoefficient. If these - //! values are not already set, false is returned. - Standard_EXPORT Standard_Boolean OwnHLRDeviationCoefficient (Standard_Real& aCoefficient, Standard_Real& aPreviousCoefficient) const; - //! Returns true and the values of the deviation angle //! anAngle and the previous deviation angle aPreviousAngle. //! If these values are not already set, false is returned. Standard_EXPORT Standard_Boolean OwnDeviationAngle (Standard_Real& anAngle, Standard_Real& aPreviousAngle) const; - //! Returns true and the values of the HLR deviation - //! angle anAngle and of the previous HLR deviation - //! angle aPreviousAngle. If these values are not - //! already set, false is returned. - Standard_EXPORT Standard_Boolean OwnHLRDeviationAngle (Standard_Real& anAngle, Standard_Real& aPreviousAngle) const; - //! Sets the type of HLR algorithm used by the shape void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR) { myDrawer->SetTypeOfHLR (theTypeOfHLR); } diff --git a/src/DBRep/DBRep_HideData.cxx b/src/DBRep/DBRep_HideData.cxx index 2adcb32599..33203100f1 100644 --- a/src/DBRep/DBRep_HideData.cxx +++ b/src/DBRep/DBRep_HideData.cxx @@ -57,7 +57,6 @@ void DBRep_HideData::Set(const Standard_Integer viewID, myAngle = ang; Handle(HLRBRep_PolyAlgo) hider = new HLRBRep_PolyAlgo(S); - hider->Angle(ang); hider->Projector(HLRAlgo_Projector(myTrsf,myFocal > 0.,myFocal)); hider->Update(); diff --git a/src/DBRep/DBRep_HideData.hxx b/src/DBRep/DBRep_HideData.hxx index 263271390a..c2ab898f9a 100644 --- a/src/DBRep/DBRep_HideData.hxx +++ b/src/DBRep/DBRep_HideData.hxx @@ -59,11 +59,11 @@ public: //! Focal <= 0 means parallel projection //! Alg : the hidden lines Standard_EXPORT void Set (const Standard_Integer ViewId, const gp_Trsf& TProj, const Standard_Real Focal, const TopoDS_Shape& S, const Standard_Real ang); - - Standard_Integer ViewId() const; - - Standard_Real Angle() const; - + + Standard_Integer ViewId() const { return myView; } + + Standard_Real Angle() const { return myAngle; } + //! Returns True if the projection is the same Standard_EXPORT Standard_Boolean IsSame (const gp_Trsf& TProj, const Standard_Real Focla) const; @@ -72,19 +72,8 @@ public: //! Returns the subshape touched by the last pick. Standard_EXPORT const TopoDS_Shape& LastPick() const; - - - -protected: - - - - - private: - - Standard_Integer myView; gp_Trsf myTrsf; Standard_Real myFocal; @@ -93,14 +82,6 @@ private: TopoDS_Shape myPickShap; Standard_Real myAngle; - }; - -#include - - - - - #endif // _DBRep_HideData_HeaderFile diff --git a/src/DBRep/DBRep_HideData.lxx b/src/DBRep/DBRep_HideData.lxx deleted file mode 100644 index ee4f3b75e2..0000000000 --- a/src/DBRep/DBRep_HideData.lxx +++ /dev/null @@ -1,36 +0,0 @@ -// Created on: 1995-09-22 -// Created by: Remi LEQUETTE -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -//function : ViewId -//purpose : -//======================================================================= - -inline Standard_Integer DBRep_HideData::ViewId() const -{ - return myView; -} - -//======================================================================= -//function : Angle -//purpose : -//======================================================================= - -inline Standard_Real DBRep_HideData::Angle() const -{ - return myAngle; -} - diff --git a/src/DBRep/FILES b/src/DBRep/FILES index 3f042dde53..8af2cc6e96 100755 --- a/src/DBRep/FILES +++ b/src/DBRep/FILES @@ -11,7 +11,6 @@ DBRep_Face.hxx DBRep_Face.lxx DBRep_HideData.cxx DBRep_HideData.hxx -DBRep_HideData.lxx DBRep_IsoBuilder.cxx DBRep_IsoBuilder.hxx DBRep_ListIteratorOfListOfEdge.hxx diff --git a/src/HLRBRep/FILES b/src/HLRBRep/FILES index f794128b34..b334189ee7 100644 --- a/src/HLRBRep/FILES +++ b/src/HLRBRep/FILES @@ -74,7 +74,6 @@ HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter.hxx HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter_0.cxx HLRBRep_PolyAlgo.cxx HLRBRep_PolyAlgo.hxx -HLRBRep_PolyAlgo.lxx HLRBRep_PolyHLRToShape.cxx HLRBRep_PolyHLRToShape.hxx HLRBRep_PolyHLRToShape.lxx diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.cxx b/src/HLRBRep/HLRBRep_PolyAlgo.cxx index 63e88a77ff..17e9c05364 100644 --- a/src/HLRBRep/HLRBRep_PolyAlgo.cxx +++ b/src/HLRBRep/HLRBRep_PolyAlgo.cxx @@ -78,7 +78,6 @@ static Standard_Integer DoError = Standard_False; HLRBRep_PolyAlgo::HLRBRep_PolyAlgo () : myDebug (Standard_False), -myAngle (5 * M_PI / 180.), myTolSta (0.1), myTolEnd (0.9), myTolAngular(0.001) @@ -94,7 +93,6 @@ myTolAngular(0.001) HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const Handle(HLRBRep_PolyAlgo)& A) { myDebug = A->Debug(); - myAngle = A->Angle(); myTolAngular = A->TolAngular(); myTolSta = A->TolCoef(); myTolEnd = 1 - myTolSta; @@ -114,7 +112,6 @@ HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const Handle(HLRBRep_PolyAlgo)& A) HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const TopoDS_Shape& S) : myDebug (Standard_False), -myAngle (5 * M_PI / 180.), myTolSta (0.1), myTolEnd (0.9), myTolAngular(0.001) diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.hxx b/src/HLRBRep/HLRBRep_PolyAlgo.hxx index f6836f666b..73fe51d335 100644 --- a/src/HLRBRep/HLRBRep_PolyAlgo.hxx +++ b/src/HLRBRep/HLRBRep_PolyAlgo.hxx @@ -17,42 +17,31 @@ #ifndef _HLRBRep_PolyAlgo_HeaderFile #define _HLRBRep_PolyAlgo_HeaderFile -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include #include #include #include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -class HLRAlgo_PolyAlgo; class Geom_Surface; -class Standard_OutOfRange; -class TopoDS_Shape; class HLRAlgo_Projector; class TopoDS_Edge; class HLRAlgo_PolyInternalData; class HLRAlgo_EdgeStatus; struct HLRAlgo_TriangleData; - class HLRBRep_PolyAlgo; DEFINE_STANDARD_HANDLE(HLRBRep_PolyAlgo, Standard_Transient) @@ -122,8 +111,8 @@ public: Standard_EXPORT HLRBRep_PolyAlgo(const TopoDS_Shape& S); - Standard_Integer NbShapes() const; - + Standard_Integer NbShapes() const { return myShapes.Length(); } + Standard_EXPORT TopoDS_Shape& Shape (const Standard_Integer I); //! remove the Shape of Index . @@ -135,40 +124,40 @@ public: //! Loads the shape S into this framework. //! Warning S must have already been triangulated. - void Load (const TopoDS_Shape& S); - + void Load (const TopoDS_Shape& theShape) { myShapes.Append (theShape); } + Standard_EXPORT Handle(HLRAlgo_PolyAlgo) Algo() const; //! Sets the parameters of the view for this framework. //! These parameters are defined by an HLRAlgo_Projector object, //! which is returned by the Projector function on a Prs3d_Projector object. - const HLRAlgo_Projector& Projector() const; + const HLRAlgo_Projector& Projector() const { return myProj; } + + void Projector (const HLRAlgo_Projector& theProj) { myProj = theProj; } - void Projector (const HLRAlgo_Projector& P); - - Standard_Real Angle() const; - - void Angle (const Standard_Real Ang); - - Standard_Real TolAngular() const; - - void TolAngular (const Standard_Real Tol); - - Standard_Real TolCoef() const; - - void TolCoef (const Standard_Real Tol); + Standard_Real TolAngular() const { return myTolAngular; } + + void TolAngular (const Standard_Real theTol) { myTolAngular = theTol; } + + Standard_Real TolCoef() const { return myTolSta; } + void TolCoef (const Standard_Real theTol) + { + myTolSta = theTol; + myTolEnd = 1.0 - theTol; + } + //! Launches calculation of outlines of the shape //! visualized by this framework. Used after setting the point of view and //! defining the shape or shapes to be visualized. Standard_EXPORT void Update(); - - void InitHide(); - - Standard_Boolean MoreHide() const; - - void NextHide(); - + + void InitHide() { myAlgo->InitHide(); } + + Standard_Boolean MoreHide() const { return myAlgo->MoreHide(); } + + void NextHide() { myAlgo->NextHide(); } + Standard_EXPORT HLRAlgo_BiPoint::PointsT& Hide ( HLRAlgo_EdgeStatus& status, TopoDS_Shape& S, @@ -176,35 +165,26 @@ public: Standard_Boolean& regn, Standard_Boolean& outl, Standard_Boolean& intl); - - void InitShow(); - - Standard_Boolean MoreShow() const; - - void NextShow(); - + + void InitShow() { myAlgo->InitShow(); } + + Standard_Boolean MoreShow() const { return myAlgo->MoreShow(); } + + void NextShow() { myAlgo->NextShow(); } + Standard_EXPORT HLRAlgo_BiPoint::PointsT& Show (TopoDS_Shape& S, Standard_Boolean& reg1, Standard_Boolean& regn, Standard_Boolean& outl, Standard_Boolean& intl); //! Make a shape with the internal outlines in each //! face. Standard_EXPORT TopoDS_Shape OutLinedShape (const TopoDS_Shape& S) const; - - Standard_Boolean Debug() const; - - void Debug (const Standard_Boolean B); - + Standard_Boolean Debug() const { return myDebug; } + void Debug (const Standard_Boolean theDebug) { myDebug = theDebug; } DEFINE_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,Standard_Transient) -protected: - - - - private: - Standard_EXPORT TopoDS_Shape MakeShape() const; @@ -284,6 +264,8 @@ private: TIMultiply(thePoint.ChangeCoord(1), thePoint.ChangeCoord(2), thePoint.ChangeCoord(3), VecPartOnly); } +private: + HLRAlgo_Projector myProj; Standard_Real TMat[3][3]; Standard_Real TLoc[3]; @@ -296,7 +278,6 @@ private: TopTools_IndexedMapOfShape myFMap; Handle(HLRAlgo_PolyAlgo) myAlgo; Standard_Boolean myDebug; - Standard_Real myAngle; Standard_Real myTolSta; Standard_Real myTolEnd; Standard_Real myTolAngular; @@ -305,14 +286,6 @@ private: BRepAdaptor_Curve myBCurv; BRepAdaptor_Curve2d myPC; - }; - -#include - - - - - #endif // _HLRBRep_PolyAlgo_HeaderFile diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.lxx b/src/HLRBRep/HLRBRep_PolyAlgo.lxx deleted file mode 100644 index c8baf782b5..0000000000 --- a/src/HLRBRep/HLRBRep_PolyAlgo.lxx +++ /dev/null @@ -1,163 +0,0 @@ -// Created on: 1995-06-15 -// Created by: Christophe MARION -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -//======================================================================= -//function : NbShapes -//purpose : -//======================================================================= - -inline Standard_Integer HLRBRep_PolyAlgo::NbShapes () const -{ return myShapes.Length(); } - -//======================================================================= -//function : Load -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::Load (const TopoDS_Shape& S) -{ myShapes.Append(S); } - -//======================================================================= -//function : Projector -//purpose : -//======================================================================= - -inline const HLRAlgo_Projector & HLRBRep_PolyAlgo::Projector () const -{ return myProj; } - -//======================================================================= -//function : Projector -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::Projector (const HLRAlgo_Projector& P) -{ myProj = P; } - -//======================================================================= -//function : Angle -//purpose : -//======================================================================= - -inline Standard_Real HLRBRep_PolyAlgo::Angle () const -{ return myAngle; } - -//======================================================================= -//function : Angle -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::Angle (const Standard_Real Ang) -{ myAngle = Ang; } - -//======================================================================= -//function : TolAngular -//purpose : -//======================================================================= - -inline Standard_Real HLRBRep_PolyAlgo::TolAngular () const -{ return myTolAngular; } - -//======================================================================= -//function : TolAngular -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::TolAngular (const Standard_Real Tol) -{ myTolAngular = Tol; } - -//======================================================================= -//function : TolCoef -//purpose : -//======================================================================= - -inline Standard_Real HLRBRep_PolyAlgo::TolCoef () const -{ return myTolSta; } - -//======================================================================= -//function : TolCoef -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::TolCoef (const Standard_Real Tol) -{ myTolSta = Tol; myTolEnd = 1 - Tol;} - -//======================================================================= -//function : InitHide -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::InitHide () -{ - myAlgo->InitHide(); -} - -//======================================================================= -//function : MoreHide -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_PolyAlgo::MoreHide () const -{ return myAlgo->MoreHide(); } - -//======================================================================= -//function : NextHide -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::NextHide () -{ myAlgo->NextHide(); } - -//======================================================================= -//function : InitShow -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::InitShow () -{ myAlgo->InitShow(); } - -//======================================================================= -//function : MoreShow -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_PolyAlgo::MoreShow () const -{ return myAlgo->MoreShow(); } - -//======================================================================= -//function : NextShow -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::NextShow () -{ myAlgo->NextShow(); } - -//======================================================================= -//function : Debug -//purpose : -//======================================================================= - -inline Standard_Boolean HLRBRep_PolyAlgo::Debug () const -{ return myDebug; } - -//======================================================================= -//function : Debug -//purpose : -//======================================================================= - -inline void HLRBRep_PolyAlgo::Debug (const Standard_Boolean B) -{ myDebug = B; } diff --git a/src/Prs3d/Prs3d_Drawer.cxx b/src/Prs3d/Prs3d_Drawer.cxx index eb20c50e63..4d5e0a8891 100644 --- a/src/Prs3d/Prs3d_Drawer.cxx +++ b/src/Prs3d/Prs3d_Drawer.cxx @@ -59,12 +59,8 @@ Prs3d_Drawer::Prs3d_Drawer() myTypeOfHLR (Prs3d_TOH_NotSet), myDeviationCoefficient (0.001), myHasOwnDeviationCoefficient (Standard_False), - myHLRDeviationCoefficient (0.02), - myHasOwnHLRDeviationCoefficient (Standard_False), - myDeviationAngle (12.0 * M_PI / 180.0), + myDeviationAngle (20.0 * M_PI / 180.0), myHasOwnDeviationAngle (Standard_False), - myHLRAngle (20.0 * M_PI / 180.0), - myHasOwnHLRDeviationAngle (Standard_False), myIsoOnPlane (Standard_False), myHasOwnIsoOnPlane (Standard_False), myIsoOnTriangulation (Standard_False), @@ -223,18 +219,6 @@ void Prs3d_Drawer::SetDeviationCoefficient (const Standard_Real theCoefficient) myHasOwnDeviationCoefficient = Standard_True; } -//======================================================================= -//function : SetHLRDeviationCoefficient -//purpose : -//======================================================================= - -void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real theCoefficient) -{ - myPreviousHLRDeviationCoefficient = HLRDeviationCoefficient(); - myHLRDeviationCoefficient = theCoefficient; - myHasOwnHLRDeviationCoefficient = Standard_True; -} - //======================================================================= //function : SetDeviationAngle //purpose : @@ -247,18 +231,6 @@ void Prs3d_Drawer::SetDeviationAngle (const Standard_Real theAngle) myHasOwnDeviationAngle = Standard_True; } -//======================================================================= -//function : SetHLRAngle -//purpose : -//======================================================================= - -void Prs3d_Drawer::SetHLRAngle (const Standard_Real theAngle) -{ - myPreviousHLRDeviationAngle = HLRAngle(); - myHLRAngle = theAngle; - myHasOwnHLRDeviationAngle = Standard_True; -} - // ======================================================================= // function : SetAutoTriangulation // purpose : @@ -1101,9 +1073,7 @@ void Prs3d_Drawer::ClearLocalAttributes() myHasOwnTypeOfDeflection = Standard_False; myHasOwnChordialDeviation = Standard_False; myHasOwnDeviationCoefficient = Standard_False; - myHasOwnHLRDeviationCoefficient = Standard_False; myHasOwnDeviationAngle = Standard_False; - myHasOwnHLRDeviationAngle = Standard_False; myHasOwnIsoOnPlane = Standard_False; myHasOwnIsoOnTriangulation = Standard_False; myHasOwnIsAutoTriangulated = Standard_False; @@ -1432,15 +1402,9 @@ void Prs3d_Drawer::DumpJson (Standard_OStream& theOStream, Standard_Integer theD OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDeviationCoefficient) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPreviousDeviationCoefficient) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDeviationCoefficient) - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHLRDeviationCoefficient) - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnHLRDeviationCoefficient) - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPreviousHLRDeviationCoefficient) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDeviationAngle) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnDeviationAngle) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPreviousDeviationAngle) - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHLRAngle) - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnHLRDeviationAngle) - OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPreviousHLRDeviationAngle) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsoOnPlane) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasOwnIsoOnPlane) OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsoOnTriangulation) diff --git a/src/Prs3d/Prs3d_Drawer.hxx b/src/Prs3d/Prs3d_Drawer.hxx index 87030ccc2b..743b866995 100644 --- a/src/Prs3d/Prs3d_Drawer.hxx +++ b/src/Prs3d/Prs3d_Drawer.hxx @@ -213,61 +213,11 @@ public: } } - //! Sets the deviation coefficient aCoefficient for removal - //! of hidden lines created by different viewpoints in - //! different presentations. The Default value is 0.02. - //! Also sets the hasOwnHLRDeviationCoefficient flag to Standard_True and myPreviousHLRDeviationCoefficient - Standard_EXPORT void SetHLRDeviationCoefficient (const Standard_Real theCoefficient); - - //! Returns the real number value of the hidden line - //! removal deviation coefficient in this framework, if the flag - //! hasOwnHLRDeviationCoefficient is true or there is no Link. - //! Else the shape's HLR deviation coefficient is used. - //! A Deviation coefficient is used in the shading display - //! mode. The shape is seen decomposed into triangles. - //! These are used to calculate reflection of light from the - //! surface of the object. - //! The triangles are formed from chords of the curves in - //! the shape. The deviation coefficient give the highest - //! value of the angle with which a chord can deviate - //! from a tangent to a curve. If this limit is reached, a new triangle is begun. - //! To find the hidden lines, hidden line display mode - //! entails recalculation of the view at each different projector perspective. - //! Since hidden lines entail calculations of more than - //! usual complexity to decompose them into these - //! triangles, a deviation coefficient allowing greater - //! tolerance is used. This increases efficiency in calculation. - //! The Default value is 0.02. - Standard_Real HLRDeviationCoefficient() const - { - return HasOwnHLRDeviationCoefficient() || myLink.IsNull() - ? myHLRDeviationCoefficient - : myLink->HLRDeviationCoefficient(); - } - - //! Sets the hasOwnHLRDeviationCoefficient flag to Standard_False - void SetHLRDeviationCoefficient() - { - myHasOwnHLRDeviationCoefficient = Standard_False; - } - - //! Returns true if the there is a setting for HLR deviation - //! coefficient in this framework for a specific interactive object. - Standard_Boolean HasOwnHLRDeviationCoefficient() const { return myHasOwnHLRDeviationCoefficient; } - - //! Returns the previous value of the hidden line removal deviation coefficient. - Standard_Real PreviousHLRDeviationCoefficient() const - { - return myHasOwnHLRDeviationCoefficient - ? myPreviousHLRDeviationCoefficient - : 0.0; - } - //! Sets the deviation angle theAngle. //! Also sets the hasOwnDeviationAngle flag to Standard_True, and myPreviousDeviationAngle. Standard_EXPORT void SetDeviationAngle (const Standard_Real theAngle); - //! Returns the value for deviation angle. + //! Returns the value for deviation angle in radians, 20 * M_PI / 180 by default. Standard_Real DeviationAngle() const { return HasOwnDeviationAngle() || myLink.IsNull() @@ -302,39 +252,6 @@ public: } } - //! Sets anAngle, the angle of maximum chordal deviation for removal of hidden lines created by - //! different viewpoints in different presentations. - //! The default value is 20 * M_PI / 180. - //! Also sets the hasOwnHLRDeviationAngle flag to Standard_True and myPreviousHLRDeviationAngle. - Standard_EXPORT void SetHLRAngle (const Standard_Real theAngle); - - //! Returns the real number value of the deviation angle - //! in hidden line removal views. The default value is 20 * M_PI / 180. - Standard_Real HLRAngle() const - { - return HasOwnHLRDeviationAngle() || myLink.IsNull() - ? myHLRAngle - : myLink->HLRAngle(); - } - - //! Sets the hasOwnHLRDeviationAngle flag to Standard_False - void SetHLRAngle() - { - myHasOwnHLRDeviationAngle = Standard_False; - } - - //! Returns true if the there is a setting for HLR deviation - //! angle in this framework for a specific interactive object. - Standard_Boolean HasOwnHLRDeviationAngle() const { return myHasOwnHLRDeviationAngle; } - - //! Returns the previous value of the HLR deviation angle. - Standard_Real PreviousHLRDeviationAngle() const - { - return myHasOwnHLRDeviationAngle - ? myPreviousHLRDeviationAngle - : 0.0; - } - //! Sets IsAutoTriangulated on or off by setting the parameter theIsEnabled to true or false. //! If this flag is True automatic re-triangulation with deflection-check logic will be applied. //! Else this feature will be disable and triangulation is expected to be computed by application itself @@ -894,6 +811,23 @@ public: //! Dumps the content of me into the stream Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; +public: //! @name deprecated methods + + Standard_DEPRECATED("SetDeviationAngle() should be used instead") + void SetHLRAngle (const Standard_Real theAngle) { SetDeviationAngle (theAngle); } + + Standard_DEPRECATED("DeviationAngle() should be used instead") + Standard_Real HLRAngle() const { return DeviationAngle(); } + + Standard_DEPRECATED("SetDeviationAngle() should be used instead") + void SetHLRAngle() { SetDeviationAngle(); } + + Standard_DEPRECATED("HasOwnDeviationAngle() should be used instead") + Standard_Boolean HasOwnHLRDeviationAngle() const { return HasOwnDeviationAngle(); } + + Standard_DEPRECATED("PreviousDeviationAngle() should be used instead") + Standard_Real PreviousHLRDeviationAngle() const { return PreviousDeviationAngle(); } + protected: Handle(Prs3d_Drawer) myLink; @@ -910,15 +844,9 @@ protected: Standard_Real myDeviationCoefficient; Standard_Real myPreviousDeviationCoefficient; Standard_Boolean myHasOwnDeviationCoefficient; - Standard_Real myHLRDeviationCoefficient; - Standard_Boolean myHasOwnHLRDeviationCoefficient; - Standard_Real myPreviousHLRDeviationCoefficient; Standard_Real myDeviationAngle; Standard_Boolean myHasOwnDeviationAngle; Standard_Real myPreviousDeviationAngle; - Standard_Real myHLRAngle; - Standard_Boolean myHasOwnHLRDeviationAngle; - Standard_Real myPreviousHLRDeviationAngle; Standard_Boolean myIsoOnPlane; Standard_Boolean myHasOwnIsoOnPlane; Standard_Boolean myIsoOnTriangulation; diff --git a/src/StdPrs/StdPrs_HLRPolyShape.cxx b/src/StdPrs/StdPrs_HLRPolyShape.cxx index df97938bbe..9fc6a82d7c 100644 --- a/src/StdPrs/StdPrs_HLRPolyShape.cxx +++ b/src/StdPrs/StdPrs_HLRPolyShape.cxx @@ -74,18 +74,11 @@ void StdPrs_HLRPolyShape::ComputeHLR (const Handle(Prs3d_Presentation)& aPresent if (aDrawer->IsAutoTriangulation()) { - const Standard_Boolean aRel = aDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE; - Standard_Real aDef = aRel ? aDrawer->HLRDeviationCoefficient() : aDrawer->MaximalChordialDeviation(); - IMeshTools_Parameters aMeshParams; - aMeshParams.Relative = aRel; - aMeshParams.Angle = aDrawer->HLRAngle(); - aMeshParams.Deflection = aDef; - BRepMesh_IncrementalMesh mesh(aShape, aMeshParams); + StdPrs_ToolTriangulatedShape::Tessellate (aShape, aDrawer); } Handle(HLRBRep_PolyAlgo) hider = new HLRBRep_PolyAlgo(aShape); hider->Projector (aProj); - hider->Angle(aDrawer->HLRAngle()); hider->Update(); Standard_Real sta,end,dx,dy,dz; Standard_ShortReal tolsta, tolend; diff --git a/src/StdPrs/StdPrs_ToolTriangulatedShape.cxx b/src/StdPrs/StdPrs_ToolTriangulatedShape.cxx index 07db4abeaf..681d3db788 100644 --- a/src/StdPrs/StdPrs_ToolTriangulatedShape.cxx +++ b/src/StdPrs/StdPrs_ToolTriangulatedShape.cxx @@ -262,7 +262,7 @@ Standard_Boolean StdPrs_ToolTriangulatedShape::Tessellate (const TopoDS_Shape& // retrieve meshing tool from Factory Handle(BRepMesh_DiscretRoot) aMeshAlgo = BRepMesh_DiscretFactory::Get().Discret (theShape, aDeflection, - theDrawer->HLRAngle()); + theDrawer->DeviationAngle()); if (!aMeshAlgo.IsNull()) { aMeshAlgo->Perform(); diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index c2d8b0f594..11e690014e 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -10531,7 +10531,7 @@ static int VDefaults (Draw_Interpretor& theDi, theDi << "DeflType: absolute\n" << "AbsoluteDeflection: " << aDefParams->MaximalChordialDeviation() << "\n"; } - theDi << "AngularDeflection: " << (180.0 * aDefParams->HLRAngle() / M_PI) << "\n"; + theDi << "AngularDeflection: " << (180.0 * aDefParams->DeviationAngle() / M_PI) << "\n"; theDi << "AutoTriangulation: " << (aDefParams->IsAutoTriangulation() ? "on" : "off") << "\n"; return 0; } @@ -10576,8 +10576,7 @@ static int VDefaults (Draw_Interpretor& theDi, std::cout << "Error: wrong syntax at " << anArg << "\n"; return 1; } - // currently HLRDeviationAngle is used instead of DeviationAngle in most places - aDefParams->SetHLRAngle (M_PI * Draw::Atof (theArgVec[anArgIter]) / 180.0); + aDefParams->SetDeviationAngle (M_PI * Draw::Atof (theArgVec[anArgIter]) / 180.0); } else if (anArg == "-AUTOTR" || anArg == "-AUTOTRIANG" diff --git a/tests/bugs/vis/bug26014 b/tests/bugs/vis/bug26014 index c4bf981488..2e9c5e097b 100644 --- a/tests/bugs/vis/bug26014 +++ b/tests/bugs/vis/bug26014 @@ -16,7 +16,7 @@ vdisplay c vfit explode c F -vaspects c -subshapes c_2 -setcolor RED +vaspects c -subshapes c_2 -setcolor RED -setLineWidth 4 set aColorWireframe [vreadpixel 200 31 rgb name] set aColorShaded [vreadpixel 180 60 rgb name]