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().
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()*
{
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();
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()))
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 :
}
}
-//=======================================================================
-//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 :
}
}
-//=======================================================================
-//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 :
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.
//! 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
shape,
TypOfSel,
aDeflection,
- myDrawer->HLRAngle(),
+ myDrawer->DeviationAngle(),
myDrawer->IsAutoTriangulation());
}
catch (Standard_Failure const& anException)
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
}
-//=======================================================================
-//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 :
SetToUpdate();
}
-//=======================================================================
-//function : SetOwnHLRDeviationCoefficient
-//purpose :
-//=======================================================================
-
-void AIS_Shape::SetOwnHLRDeviationCoefficient ( const Standard_Real aCoefficient )
-{
- myDrawer->SetHLRDeviationCoefficient( aCoefficient );
-
-}
-
//=======================================================================
//function : SetOwnDeviationAngle
//purpose :
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 :
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 :
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 :
//! 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);
//! 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); }
myAngle = ang;
Handle(HLRBRep_PolyAlgo) hider = new HLRBRep_PolyAlgo(S);
- hider->Angle(ang);
hider->Projector(HLRAlgo_Projector(myTrsf,myFocal > 0.,myFocal));
hider->Update();
//! 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;
//! 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;
TopoDS_Shape myPickShap;
Standard_Real myAngle;
-
};
-
-#include <DBRep_HideData.lxx>
-
-
-
-
-
#endif // _DBRep_HideData_HeaderFile
+++ /dev/null
-// 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;
-}
-
DBRep_Face.lxx
DBRep_HideData.cxx
DBRep_HideData.hxx
-DBRep_HideData.lxx
DBRep_IsoBuilder.cxx
DBRep_IsoBuilder.hxx
DBRep_ListIteratorOfListOfEdge.hxx
HLRBRep_PCLocFOfTheLocateExtPCOfTheProjPCurOfCInter_0.cxx
HLRBRep_PolyAlgo.cxx
HLRBRep_PolyAlgo.hxx
-HLRBRep_PolyAlgo.lxx
HLRBRep_PolyHLRToShape.cxx
HLRBRep_PolyHLRToShape.hxx
HLRBRep_PolyHLRToShape.lxx
HLRBRep_PolyAlgo::HLRBRep_PolyAlgo () :
myDebug (Standard_False),
-myAngle (5 * M_PI / 180.),
myTolSta (0.1),
myTolEnd (0.9),
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;
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)
#ifndef _HLRBRep_PolyAlgo_HeaderFile
#define _HLRBRep_PolyAlgo_HeaderFile
-#include <HLRAlgo_PolyInternalNode.hxx>
-
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepAdaptor_Curve.hxx>
+#include <BRepAdaptor_Curve2d.hxx>
+#include <GeomAbs_Shape.hxx>
#include <HLRAlgo_Array1OfTData.hxx>
#include <HLRAlgo_Array1OfPISeg.hxx>
#include <HLRAlgo_Array1OfPINod.hxx>
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
+#include <HLRAlgo_ListOfBPoint.hxx>
+#include <HLRAlgo_PolyAlgo.hxx>
+#include <HLRAlgo_PolyInternalNode.hxx>
#include <HLRAlgo_Projector.hxx>
-#include <Standard_Real.hxx>
-#include <TopTools_SequenceOfShape.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <Standard_Boolean.hxx>
-#include <BRepAdaptor_Surface.hxx>
-#include <BRepAdaptor_Curve.hxx>
-#include <BRepAdaptor_Curve2d.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Integer.hxx>
-#include <TColStd_Array1OfTransient.hxx>
#include <TColStd_Array1OfInteger.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <HLRAlgo_ListOfBPoint.hxx>
+#include <TColStd_Array1OfTransient.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
-#include <GeomAbs_Shape.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_SequenceOfShape.hxx>
-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)
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 <I>.
//! 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;
-
- 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;
+ const HLRAlgo_Projector& Projector() const { return myProj; }
+
+ void Projector (const HLRAlgo_Projector& theProj) { myProj = theProj; }
- 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,
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;
TIMultiply(thePoint.ChangeCoord(1), thePoint.ChangeCoord(2), thePoint.ChangeCoord(3), VecPartOnly);
}
+private:
+
HLRAlgo_Projector myProj;
Standard_Real TMat[3][3];
Standard_Real TLoc[3];
TopTools_IndexedMapOfShape myFMap;
Handle(HLRAlgo_PolyAlgo) myAlgo;
Standard_Boolean myDebug;
- Standard_Real myAngle;
Standard_Real myTolSta;
Standard_Real myTolEnd;
Standard_Real myTolAngular;
BRepAdaptor_Curve myBCurv;
BRepAdaptor_Curve2d myPC;
-
};
-
-#include <HLRBRep_PolyAlgo.lxx>
-
-
-
-
-
#endif // _HLRBRep_PolyAlgo_HeaderFile
+++ /dev/null
-// 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 <HLRAlgo_PolyAlgo.hxx>
-
-//=======================================================================
-//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; }
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),
myHasOwnDeviationCoefficient = Standard_True;
}
-//=======================================================================
-//function : SetHLRDeviationCoefficient
-//purpose :
-//=======================================================================
-
-void Prs3d_Drawer::SetHLRDeviationCoefficient (const Standard_Real theCoefficient)
-{
- myPreviousHLRDeviationCoefficient = HLRDeviationCoefficient();
- myHLRDeviationCoefficient = theCoefficient;
- myHasOwnHLRDeviationCoefficient = Standard_True;
-}
-
//=======================================================================
//function : SetDeviationAngle
//purpose :
myHasOwnDeviationAngle = Standard_True;
}
-//=======================================================================
-//function : SetHLRAngle
-//purpose :
-//=======================================================================
-
-void Prs3d_Drawer::SetHLRAngle (const Standard_Real theAngle)
-{
- myPreviousHLRDeviationAngle = HLRAngle();
- myHLRAngle = theAngle;
- myHasOwnHLRDeviationAngle = Standard_True;
-}
-
// =======================================================================
// function : SetAutoTriangulation
// purpose :
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;
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)
}
}
- //! 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()
}
}
- //! 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
//! 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;
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;
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;
// retrieve meshing tool from Factory
Handle(BRepMesh_DiscretRoot) aMeshAlgo = BRepMesh_DiscretFactory::Get().Discret (theShape,
aDeflection,
- theDrawer->HLRAngle());
+ theDrawer->DeviationAngle());
if (!aMeshAlgo.IsNull())
{
aMeshAlgo->Perform();
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;
}
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"
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]