Multiple PrsMgr_PresentableObject::Compute() methods have been replaced by single one
PrsMgr_PresentableObject::computeHLR().
Dummy implementations of previously declared methods have been removed
from AIS classes not implementng HLR presentation.
Class Prs3d_Projector has been removed and Graphic3d_Camera is now passed directly,
so that redundant dependency from HLRAlgo_Projector in Prs3d interfaces has been eliminated.
StdPrs_HLRShape and StdPrs_HLRPolyShape now implement common interface StdPrs_HLRShapeI.
Enumeration BRepOffset_Type is renamed to ChFiDS_TypeOfConcavity.
+@subsection upgrade_750_hlrprs Changes in HLR presentation API
+
+Methods computing HLR presentation within *PrsMgr_PresentableObject::Compute()* have been renamed to *PrsMgr_PresentableObject::computeHLR()*
+and now accept *Graphic3d_Camera* object instead of removed *Prs3d_Projector*.
+
@subsection upgrade_750_sensitiveEntity Select3D_SensitiveEntity interface change
The method Select3D_SensitiveEntity::NbSubElements() has been changed to be constant. Select3D_SensitiveEntity subclasses at application level should be updated accordingly.
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
- virtual void Compute(const Handle(Prs3d_Projector)& ,const Handle(Prs3d_Presentation)& ) {}
virtual void ComputeSelection (const Handle(SelectMgr_Selection)& ,const Standard_Integer ) {}
private:
}
}
-
-void ISession_Direction::Compute (const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
-{
-}
-
void ISession_Direction::ComputeSelection (const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode);
- void Compute (const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
gp_Pnt myPnt;
StdPrs_Point::Add(aPresentation,aGeomPoint,myDrawer);
}
-
-void ISession_Point::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
- {
- }
-
void ISession_Point::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*unMode*/)
{
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer aMode);
- void Compute (const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation);
void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer unMode);
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0);
- virtual void Compute (const Handle(Prs3d_Projector)& ,const Handle(Prs3d_Presentation)& ) {}
virtual void ComputeSelection (const Handle(SelectMgr_Selection)& ,const Standard_Integer ) {}
private:
StdPrs_Curve::Add (aPresentation, anAdaptorCurve, myDrawer);
}
-void ISession_Curve::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
- {
-
- }
-
void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
-Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
Handle(Geom_Curve) myCurve;
#include <Prs3d_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_LineAspect.hxx>
-#include <Prs3d_Projector.hxx>
#include <Prs3d_Text.hxx>
#include <Quantity_Factor.hxx>
#include <Quantity_Length.hxx>
StdPrs_Curve::Add (aPresentation, anAdaptorCurve, myDrawer);
}
-void ISession_Curve::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
- {
-
- }
-
void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
-Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
Handle(Geom_Curve) myCurve;
#include "HLRApp.h"
#include "OCC_2dView.h"
#include <ISession2D/ISession2D_Shape.h>
-#include "Prs3d_Projector.hxx"
#ifdef _DEBUG
//#define new DEBUG_NEW
void CSelectionDialog::UpdateProjector()
{
- Standard_Real DX,DY,DZ,XAt,YAt,ZAt, Vx,Vy,Vz ;
- myActiveView->Proj(DX,DY,DZ);
- myActiveView->At(XAt,YAt,ZAt);
- myActiveView->Up( Vx,Vy,Vz );
+ const Handle(Graphic3d_Camera)& aCam = myActiveView->Camera();
+ gp_Dir aBackDir = -aCam->Direction();
+ gp_Dir aXpers = aCam->Up().Crossed (aBackDir);
+ gp_Ax3 anAx3 (aCam->Center(), aBackDir, aXpers);
+ gp_Trsf aTrsf;
+ aTrsf.SetTransformation (anAx3);
+ HLRAlgo_Projector aProjector (aTrsf, !aCam->IsOrthographic(), aCam->Scale());
+
OnDisplay(false);
- Standard_Boolean IsPerspective = (myActiveView->Type() == V3d_PERSPECTIVE);
- Standard_Real aFocus = 1;
- Prs3d_Projector aPrs3dProjector(IsPerspective,aFocus,DX,DY,DZ,XAt,YAt,ZAt,Vx,Vy,Vz);
- HLRAlgo_Projector aProjector = aPrs3dProjector.Projector();
if (myDisplayableShape.IsNull()) return;
myDisplayableShape->SetProjector(aProjector);
StdPrs_Curve::Add (aPresentation, anAdaptorCurve, myDrawer);
}
-void ISession_Curve::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
- {
-
- }
-
void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
const Standard_Integer /*aMode*/)
{
private:
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ;
-Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ;
Handle(Geom_Curve) myCurve;
}
}
-void User_Cylinder::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
+void User_Cylinder::computeHLR (const Handle(Graphic3d_Camera)& aProjector,
+ const Handle(Geom_Transformation)& ,
+ const Handle(Prs3d_Presentation)& aPresentation)
{
Handle (Prs3d_Drawer) aDefDrawer = GetContext()->DefaultDrawer();
if (aDefDrawer->DrawHiddenLine())
myDrawer->EnableDrawHiddenLine();
else
myDrawer->DisableDrawHiddenLine();
- StdPrs_HLRPolyShape::Add(aPresentation,myShape,myDrawer,aProjector);
+ StdPrs_HLRPolyShape aTool;
+ aTool.ComputeHLR (aPresentation,myShape,myDrawer,aProjector);
}
void User_Cylinder::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
#include <Standard_DefineHandle.hxx>
#include <Standard_Macro.hxx>
#include <Graphic3d_AspectFillArea3d.hxx>
-#include <Prs3d_Projector.hxx>
// Handle definition
//
class User_Cylinder;
const Standard_Integer aMode = 0) ;
void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer aMode) ;
- void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation);
+ void computeHLR (const Handle(Graphic3d_Camera)& aProjector, const Handle(Geom_Transformation)& theTrsf, const Handle(Prs3d_Presentation)& aPresentation);
Standard_Boolean TriangleIsValid(const gp_Pnt& P1,const gp_Pnt& P2,const gp_Pnt& P3) const;
Quantity_Color Color(gp_Pnt& thePoint,Standard_Real AltMin,Standard_Real AltMax, const Standard_Integer ColorizationMode) ;
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Prs3d_DimensionAspect.hxx>
-#include <Prs3d_Projector.hxx>
#include <Prs3d_Presentation.hxx>
#include <Standard.hxx>
#include <Standard_Macro.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
-void AIS_Axis::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_Axis::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
SynchronizeAspects();
}
-
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_Axis::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Prs3d_Presentation)&)
-{
-}
-
//=======================================================================
//function : ComputeFields
//purpose :
//! Returns true if the interactive object accepts the display mode aMode.
Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 2; }
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeFields();
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-
-void AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! Returns true if the 2d chamfer dimension is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
-
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
+
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
gp_Pnt myPntAttach;
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-
-void AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! Returns true if the 3d chamfer dimension is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
gp_Pnt myPntAttach;
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-
-void AIS_Circle::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_Circle::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
myIsFilledCircleSens);
aSelection->Add(seg);
}
-
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_Circle::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Prs3d_Presentation)&)
-{
-}
//! starting point theUStart, the arc ending point theUEnd,
//! and the type of sensitivity theIsFilledCircleSens.
Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& theCircle, const Standard_Real theUStart, const Standard_Real theUEnd, const Standard_Boolean theIsFilledCircleSens = Standard_False);
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
+
//! Returns index 6 by default.
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 6; }
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeCircle (const Handle(Prs3d_Presentation)& aPresentation);
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
}
-void AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeTwoEdgesConcentric
//purpose :
}
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-
-void AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Prs3d_Presentation)&)
-{
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! aPlane is provided to create an axis along which the
//! relation of concentricity can be extended.
Standard_EXPORT AIS_ConcentricRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane);
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeTwoEdgesConcentric (const Handle(Prs3d_Presentation)& aPresentationManager);
Standard_EXPORT void ComputeEdgeVertexConcentric (const Handle(Prs3d_Presentation)& aPresentationManager);
#include <NCollection_DataMap.hxx>
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
-#include <Prs3d_Projector.hxx>
+#include <Prs3d_Presentation.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
}
//=======================================================================
-//function : Compute
+//function : computeHLR
//purpose :
//=======================================================================
-void AIS_ConnectedInteractive::Compute (const Handle(Prs3d_Projector)& theProjector,
- const Handle(Geom_Transformation)& theTransformation,
- const Handle(Prs3d_Presentation)& thePresentation)
+void AIS_ConnectedInteractive::computeHLR (const Handle(Graphic3d_Camera)& theProjector,
+ const Handle(Geom_Transformation)& theTransformation,
+ const Handle(Prs3d_Presentation)& thePresentation)
{
- updateShape (Standard_False);
+ const bool hasTrsf = !theTransformation.IsNull()
+ && theTransformation->Form() != gp_Identity;
+ updateShape (!hasTrsf);
if (myShape.IsNull())
{
return;
}
- const TopLoc_Location& aLocation = myShape.Location();
- TopoDS_Shape aShape = myShape.Located (TopLoc_Location (theTransformation->Trsf()) * aLocation);
- Compute (theProjector, thePresentation, aShape);
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-void AIS_ConnectedInteractive::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)
-{
- updateShape (Standard_True);
- Compute (aProjector, aPresentation, myShape);
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-void AIS_ConnectedInteractive::Compute (const Handle(Prs3d_Projector)& theProjector,
- const Handle(Prs3d_Presentation)& thePrs,
- const TopoDS_Shape& theShape)
-{
- AIS_Shape::computeHlrPresentation (theProjector, thePrs, theShape, myDrawer);
+ if (hasTrsf)
+ {
+ const TopLoc_Location& aLocation = myShape.Location();
+ TopoDS_Shape aShape = myShape.Located (TopLoc_Location (theTransformation->Trsf()) * aLocation);
+ AIS_Shape::computeHlrPresentation (theProjector, thePresentation, aShape, myDrawer);
+ }
+ else
+ {
+ AIS_Shape::computeHlrPresentation (theProjector, thePresentation, myShape, myDrawer);
+ }
}
//=======================================================================
//! a transformation if there's one stored.
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode) Standard_OVERRIDE;
- //! Computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
- //! Computes the presentation according to a point of view
- //! given by <aProjector>.
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
+ //! Computes the presentation according to a point of view.
+ Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
+ const Handle(Geom_Transformation)& theTrsf,
+ const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE;
//! Generates sensitive entities by copying
//! them from myReference selection, creates and sets an entity
Standard_EXPORT void updateShape (const Standard_Boolean WithLocation = Standard_True);
- //! Computes the presentation according to a point of view
- //! given by <aProjector>.
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& aShape);
-
Standard_EXPORT void connect (const Handle(AIS_InteractiveObject)& theAnotherObj,
const Handle(Geom_Transformation)& theLocation);
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveCircle.hxx>
#include <Select3D_SensitiveSegment.hxx>
myPoint1, myPoint2, myPoint3, myPoint4, myPlane );
}
-
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning at compilation (SUN)
-//=======================================================================
-
-void AIS_EqualDistanceRelation::Compute( const Handle( Prs3d_Projector )& /*aProjector*/,
- const Handle( Prs3d_Presentation )& /*aPresentation*/)
-{
-// throw Standard_NotImplemented("AIS_EqualDistanceRelation::Compute( const Handle( Prs3d_Projector )&,
- // const Handle( Prs3d_Presentation )& )");
-// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning at compilation (SUN)
-//=======================================================================
-void AIS_EqualDistanceRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_EqualDistanceRelation::Compute(const Handle(Prs3d_Projector)&,
-// const Handle(Geom_Transformation)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! Returns the shape aShape4 from the framework
//! created at construction time.
const TopoDS_Shape& Shape4() const;
-
- //! Computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
+
//! Computes the location of an intreval between
//! between two edges. FirstAttach , SecondAttach
//! are the returned extreme points of the interval.
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
TopoDS_Shape myShape3;
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
myFirstCenter, mySecondCenter, myFirstPoint, mySecondPoint, myPlane );
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning at compilation (SUN)
-//=======================================================================
-
-void AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )& /*aProjector*/,
- const Handle( Prs3d_Presentation )& /*aPresentation*/)
-{
-// throw Standard_NotImplemented("AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )&,const Handle( Prs3d_Presentation )& )");
-// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-
-void AIS_EqualRadiusRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_EqualRadiusRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! If one of edges is not in the given plane,
//! the presentation method projects it onto the plane.
Standard_EXPORT AIS_EqualRadiusRelation(const TopoDS_Edge& aFirstEdge, const TopoDS_Edge& aSecondEdge, const Handle(Geom_Plane)& aPlane);
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeRadiusPosition();
#include <gp_XYZ.hxx>
#include <Precision.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
myArrowSize);
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-
-void AIS_FixRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_FixRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-
-void AIS_FixRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_FixRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! Returns true if the Interactive Objects in the relation
//! are movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
//! computes the presentation for <myFixShape> if it's a
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
}
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-void AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose : function used to compute the selection associated to the
//! Returns true if the interactive object is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(AIS_IdenticRelation,AIS_Relation)
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeOneEdgeOVertexPresentation (const Handle(Prs3d_Presentation)& aPresentation);
#include <gp_Dir.hxx>
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
-#include <Prs3d_Projector.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
-void AIS_Line::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
myEndPoint->Pnt());
aSelection->Add(seg);
}
-
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_Line::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Prs3d_Presentation)&)
-{
-}
-
-
-
-
//! and a finishing point aEndPoint for the line.
Standard_EXPORT AIS_Line(const Handle(Geom_Point)& aStartPoint, const Handle(Geom_Point)& aEndPoint);
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
//! Returns the signature 5.
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 5; }
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeInfiniteLine (const Handle(Prs3d_Presentation)& aPresentation);
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Select3D_SensitiveBox.hxx>
ComputeEllipse(aPresentation);
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-
-void AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-
-void AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
-
//=======================================================================
//function : ComputeEllipse
//purpose :
//! Max Ellipse radius dimension with position
//! Shape can be edge , planar face or cylindrical face
Standard_EXPORT AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeEllipse (const Handle(Prs3d_Presentation)& aPresentation);
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning at compilation (SUN)
-//=======================================================================
-void AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
-{
-// throw Standard_NotImplemented("AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
-// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Geom_Transformation)&,
- const Handle(Prs3d_Presentation)&)
-{
- throw Standard_NotImplemented("AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
-// PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
void SetTool (const TopoDS_Shape& aMidPointTool);
const TopoDS_Shape& GetTool() const;
-
- //! Computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeFaceFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first);
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Select3D_SensitiveBox.hxx>
ComputeEllipse(aPresentation);
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-
-void AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-
-void AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeEllipse
//purpose :
//! Max Ellipse radius dimension with position
//! Shape can be edge , planar face or cylindrical face
Standard_EXPORT AIS_MinRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeEllipse (const Handle(Prs3d_Presentation)& aPresentation);
#include <AIS_ConnectedInteractive.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveEntity.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Standard_NotImplemented.hxx>
}
}
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-
-void AIS_MultipleConnectedInteractive::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-
-void AIS_MultipleConnectedInteractive::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : AcceptShapeDecomposition
//purpose :
//! Clears all the connections to objects.
Standard_EXPORT void DisconnectAll();
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
//! Informs the graphic context that the interactive Object
//! may be decomposed into sub-shapes for dynamic selection.
Standard_EXPORT virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE;
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
}
-
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning at compilation (SUN)
-//=======================================================================
-void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
-{
-// throw Standard_NotImplemented("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation)");
-// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Geom_Transformation)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! first shape aFShape, the second shape aSShape, the
//! dimension aVal, and the text aText.
Standard_EXPORT AIS_OffsetDimension(const TopoDS_Shape& FistShape, const TopoDS_Shape& SecondShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
//! Indicates that the dimension we are concerned with is an offset.
virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE;
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoFacesOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! Returns true if the parallelism is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoFacesParallel (const Handle(Prs3d_Presentation)& aPresentation);
#include <IntAna2d_IntPoint.hxx>
#include <Precision.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
// Cas pas traite - Edge/Face
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! This object is defined by a first shape aFShape and a
//! second shape aSShape.
Standard_EXPORT AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape);
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
-
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
+
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoFacesPerpendicular (const Handle(Prs3d_Presentation)& aPresentation);
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PlaneAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitiveTriangulation.hxx>
}
}
-void AIS_Plane::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
- PrsMgr_PresentableObject::Compute(aProjector, aTransformation, aPresentation);
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
}
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_Plane::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Prs3d_Presentation)&)
-{
-}
-
//=======================================================================
//function : ComputeFields
//purpose :
//! Sets the type of sensitivity for the plane.
void SetTypeOfSensitivity (Select3D_TypeOfSensitivity theTypeOfSensitivity) { myTypeOfSensitivity = theTypeOfSensitivity; }
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer theMode) Standard_OVERRIDE;
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeFrame();
Standard_EXPORT void ComputeFields();
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitivePoint.hxx>
#include <Select3D_SensitiveSegment.hxx>
aPresentation->SetInfiniteState (Standard_True);
}
-void AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
SynchronizeAspects();
}
-
-void AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Prs3d_Presentation)&)
-{
-}
-
-
//=======================================================================
//function : ExtremityPoints
//purpose : to avoid warning
//! Returns true if the display mode selected, aMode, is valid.
Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
+
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 4; }
//! Returns datum as the type of Interactive Object.
private:
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
private:
#include <Prs3d_Drawer.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Quantity_Color.hxx>
#include <Select3D_SensitivePoint.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-
-void AIS_Point::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_Point::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
return BRepBuilderAPI_MakeVertex(P);
}
-
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_Point::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Prs3d_Presentation)&)
-{
-}
-
//=======================================================================
//function : SetMarker
//purpose :
//! Returns true if the display mode selected is valid for point datums.
Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
//! Allows you to provide settings for the Color.
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
private:
-
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
#include <Prs3d_Drawer.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Prs3d_Root.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <StdPrs_BndBox.hxx>
//function : computeHlrPresentation
//purpose :
//=======================================================================
-void AIS_Shape::computeHlrPresentation (const Handle(Prs3d_Projector)& theProjector,
+void AIS_Shape::computeHlrPresentation (const Handle(Graphic3d_Camera)& theProjector,
const Handle(Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer)
switch (theDrawer->TypeOfHLR())
{
case Prs3d_TOH_Algo:
- StdPrs_HLRShape::Add (thePrs, theShape, theDrawer, theProjector);
+ {
+ StdPrs_HLRShape aBuilder;
+ aBuilder.ComputeHLR (thePrs, theShape, theDrawer, theProjector);
break;
+ }
case Prs3d_TOH_PolyAlgo:
- default:
- StdPrs_HLRPolyShape::Add (thePrs, theShape, theDrawer, theProjector);
+ case Prs3d_TOH_NotSet:
+ {
+ StdPrs_HLRPolyShape aBuilder;
+ aBuilder.ComputeHLR (thePrs, theShape, theDrawer, theProjector);
break;
+ }
}
}
catch (Standard_Failure const& anException)
const Standard_Integer theMode) Standard_OVERRIDE;
//! Compute projected presentation.
- virtual void Compute (const Handle(Prs3d_Projector)& theProjector,
- const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE
+ virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
+ const Handle(Geom_Transformation)& theTrsf,
+ const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE
{
- computeHlrPresentation (theProjector, thePrs, myshape, myDrawer);
- }
-
- //! Compute projected presentation with transformation.
- virtual void Compute (const Handle(Prs3d_Projector)& theProjector,
- const Handle(Geom_Transformation)& theTrsf,
- const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE
- {
- const TopLoc_Location& aLoc = myshape.Location();
- const TopoDS_Shape aShape = myshape.Located (TopLoc_Location (theTrsf->Trsf()) * aLoc);
- computeHlrPresentation (theProjector, thePrs, aShape, myDrawer);
+ if (!theTrsf.IsNull()
+ && theTrsf->Form() != gp_Identity)
+ {
+ const TopLoc_Location& aLoc = myshape.Location();
+ const TopoDS_Shape aShape = myshape.Located (TopLoc_Location (theTrsf->Trsf()) * aLoc);
+ computeHlrPresentation (theProjector, thePrs, aShape, myDrawer);
+ }
+ else
+ {
+ computeHlrPresentation (theProjector, thePrs, myshape, myDrawer);
+ }
}
//! Compute selection.
public:
//! Compute HLR presentation for specified shape.
- Standard_EXPORT static void computeHlrPresentation (const Handle(Prs3d_Projector)& theProjector,
+ Standard_EXPORT static void computeHlrPresentation (const Handle(Graphic3d_Camera)& theProjector,
const Handle(Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer);
#include <Prs3d_DimensionAspect.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveBox.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
}
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning at compilation (SUN)
-//=======================================================================
-void AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
-{
-// throw Standard_NotImplemented("AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
-// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&,
- const Handle(Geom_Transformation)&,
- const Handle(Prs3d_Presentation)&)
-{
- throw Standard_NotImplemented("AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
-// PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! Returns the tool composed of a first shape, a second
//! shape, and a plane. This tool is created at construction time.
const TopoDS_Shape& GetTool() const;
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoFacesSymmetric (const Handle(Prs3d_Presentation)& aprs);
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
}
}
-//=======================================================================
-//function : Compute
-//purpose : to avoid warning
-//=======================================================================
-void AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ;
-}
-
-void AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Geom_Transformation)& aTransformation,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
-// throw Standard_NotImplemented("AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
- PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
//! - 2 - there is a connection to the second shape.
//! This reference is initially defined at construction time.
Standard_EXPORT void SetExternRef (const Standard_Integer aRef);
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
private:
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoFacesTangent (const Handle(Prs3d_Presentation)& aPresentation);
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_Text.hxx>
#include <Prs3d_TextAspect.hxx>
computePresentation (thePrsMgr, thePrs);
}
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-void AIS_Trihedron::Compute (const Handle(Prs3d_Projector)& theProjector,
- const Handle(Geom_Transformation)& theTrsf,
- const Handle(Prs3d_Presentation)& thePrs)
-{
- PrsMgr_PresentableObject::Compute (theProjector, theTrsf, thePrs);
-}
-
//=======================================================================
//function : ComputeSelection
//purpose :
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode) Standard_OVERRIDE;
- //! This compute is unavailable for trihedron presentation.
- void Compute (const Handle(Prs3d_Projector)& , const Handle(Prs3d_Presentation)& ) Standard_OVERRIDE {}
-
- //! This compute is unavailable for trihedron presentation.
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& theProjector,
- const Handle(Geom_Transformation)& theTrsf,
- const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE;
-
//! Compute selection.
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) Standard_OVERRIDE;
}
else
{
- Handle(Graphic3d_Structure) aCompStruct = aStruct->IsTransformed() ? aStruct->Compute (this, aStruct->Transformation()) : aStruct->Compute (this);
+ Handle(Graphic3d_Structure) aCompStruct;
+ aStruct->computeHLR (myCamera, aCompStruct);
aCompStruct->SetHLRValidation (Standard_True);
const Standard_Boolean toComputeWireframe = myVisualization == Graphic3d_TOV_WIREFRAME
Handle(Graphic3d_Structure) aCompStructOld = myStructsComputed.ChangeValue (anIndex);
Handle(Graphic3d_Structure) aCompStruct = aCompStructOld;
aCompStruct->SetTransformation (Handle(Geom_Transformation)());
- theStruct->IsTransformed() ? theStruct->Compute (this, theStruct->Transformation(), aCompStruct)
- : theStruct->Compute (this, aCompStruct);
+ theStruct->computeHLR (myCamera, aCompStruct);
aCompStruct->SetHLRValidation (Standard_True);
aCompStruct->CalculateBoundBox();
{
aStruct = myStructsComputed.Value (anIndex);
aStruct->SetTransformation (Handle(Geom_Transformation)());
- if (theStructure->IsTransformed())
- {
- theStructure->Compute (this, theStructure->Transformation(), aStruct);
- }
- else
- {
- theStructure->Compute (this, aStruct);
- }
- }
- else
- {
- aStruct = theStructure->IsTransformed()
- ? theStructure->Compute (this, theStructure->Transformation())
- : theStructure->Compute (this);
}
+ theStructure->computeHLR (myCamera, aStruct);
aStruct->SetHLRValidation (Standard_True);
Standard_Boolean IsRemoved() const { return myIsRemoved; }
//! Returns camera object of the view.
- virtual const Handle(Graphic3d_Camera)& Camera() const { return myCamera; }
+ virtual const Handle(Graphic3d_Camera)& Camera() const Standard_OVERRIDE { return myCamera; }
//! Sets camera used by the view.
virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) { myCamera = theCamera; }
#include <Standard_Transient.hxx>
+class Graphic3d_Camera;
class Graphic3d_DataStructureManager;
DEFINE_STANDARD_HANDLE(Graphic3d_DataStructureManager, Standard_Transient)
//! It defines the global attributes.
class Graphic3d_DataStructureManager : public Standard_Transient
{
-
-public:
-
DEFINE_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,Standard_Transient)
-
protected:
-
//! Initializes the manager <me>.
Standard_EXPORT Graphic3d_DataStructureManager();
-
-
-private:
-
-
-
+ //! Returns camera object of the view.
+ virtual const Handle(Graphic3d_Camera)& Camera() const = 0;
};
-
-
-
-
-
-
#endif // _Graphic3d_DataStructureManager_HeaderFile
{
//
}
-
- //! Returns the new Structure defined for the new visualization
- virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector)
- {
- (void )theProjector;
- return this;
- }
-
- //! Returns the new Structure defined for the new visualization
- virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- const Handle(Geom_Transformation)& theTrsf)
- {
- (void )theProjector;
- (void )theTrsf;
- return this;
- }
//! Returns the new Structure defined for the new visualization
- virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- Handle(Graphic3d_Structure)& theStructure)
- {
- (void )theProjector;
- (void )theStructure;
- }
-
- //! Returns the new Structure defined for the new visualization
- virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- const Handle(Geom_Transformation)& theTrsf,
- Handle(Graphic3d_Structure)& theStructure)
+ virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
+ Handle(Graphic3d_Structure)& theStructure)
{
(void )theProjector;
- (void )theTrsf;
(void )theStructure;
}
Prs3d_Presentation.hxx
Prs3d_PresentationShadow.cxx
Prs3d_PresentationShadow.hxx
-Prs3d_Projector.cxx
-Prs3d_Projector.hxx
Prs3d_Root.hxx
Prs3d_ShadingAspect.cxx
Prs3d_ShadingAspect.hxx
+++ /dev/null
-// 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 <gp_Ax3.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Trsf.hxx>
-#include <HLRAlgo_Projector.hxx>
-#include <Prs3d_Projector.hxx>
-#include <Standard_Type.hxx>
-
-IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Projector,Standard_Transient)
-
-Prs3d_Projector::Prs3d_Projector (const HLRAlgo_Projector& HLPr): MyProjector(HLPr)
-{}
-
-
-
-Prs3d_Projector::Prs3d_Projector (const Standard_Boolean Pers,
- const Standard_Real Focus,
- const Standard_Real DX,
- const Standard_Real DY,
- const Standard_Real DZ,
- const Standard_Real XAt,
- const Standard_Real YAt,
- const Standard_Real ZAt,
- const Standard_Real XUp,
- const Standard_Real YUp,
- const Standard_Real ZUp)
-{
- gp_Pnt At (XAt,YAt,ZAt);
- gp_Dir Zpers (DX,DY,DZ);
- gp_Dir Ypers (XUp,YUp,ZUp);
- gp_Dir Xpers = Ypers.Crossed(Zpers);
- gp_Ax3 Axe (At, Zpers, Xpers);
- gp_Trsf T;
- T.SetTransformation(Axe);
- MyProjector = HLRAlgo_Projector(T,Pers,Focus);
-}
-
-
-HLRAlgo_Projector Prs3d_Projector::Projector () const
-{
- return MyProjector;
-}
+++ /dev/null
-// Created on: 1993-03-19
-// Created by: Jean-Louis FRENKEL
-// Copyright (c) 1993-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.
-
-#ifndef _Prs3d_Projector_HeaderFile
-#define _Prs3d_Projector_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <HLRAlgo_Projector.hxx>
-#include <Standard_Transient.hxx>
-#include <Standard_Boolean.hxx>
-
-class Prs3d_Projector;
-DEFINE_STANDARD_HANDLE(Prs3d_Projector, Standard_Transient)
-
-//! A projector object.
-//! This object defines the parameters of a view for a
-//! visualization algorithm. It is, for example, used by the
-//! hidden line removal algorithms.
-class Prs3d_Projector : public Standard_Transient
-{
-
-public:
-
-
- Standard_EXPORT Prs3d_Projector(const HLRAlgo_Projector& Pr);
-
- //! Constructs a projector framework from the following parameters
- //! - Pers is true if the view is a perspective view and
- //! false if it is an axonometric one;
- //! - Focus is the focal length if a perspective view is defined;
- //! - DX, DY and DZ are the coordinates of the
- //! projection vector;
- //! - XAt, YAt and ZAt are the coordinates of the view point;
- //! - XUp, YUp and ZUp are the coordinates of the
- //! vertical direction vector.
- Standard_EXPORT Prs3d_Projector(const Standard_Boolean Pers, const Standard_Real Focus, const Standard_Real DX, const Standard_Real DY, const Standard_Real DZ, const Standard_Real XAt, const Standard_Real YAt, const Standard_Real ZAt, const Standard_Real XUp, const Standard_Real YUp, const Standard_Real ZUp);
-
- //! Returns a projector object for use in a hidden line removal algorithm.
- Standard_EXPORT HLRAlgo_Projector Projector() const;
-
- DEFINE_STANDARD_RTTIEXT(Prs3d_Projector,Standard_Transient)
-
-private:
-
- HLRAlgo_Projector MyProjector;
-
-};
-
-#endif // _Prs3d_Projector_HeaderFile
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <PrsMgr_Presentation.hxx>
#include <PrsMgr_PresentationManager.hxx>
}
//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-void PrsMgr_PresentableObject::Compute(const Handle(Prs3d_Projector)& /*aProjector*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
-{
- throw Standard_NotImplemented("cannot compute under a specific projector");
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
+//function : computeHLR
+//purpose :
//=======================================================================
-void PrsMgr_PresentableObject::Compute(const Handle(Prs3d_Projector)& /* aProjector*/,
- const Handle(Geom_Transformation)& /*aTrsf*/,
- const Handle(Prs3d_Presentation)& /*aPresentation*/)
+void PrsMgr_PresentableObject::computeHLR (const Handle(Graphic3d_Camera)& ,
+ const Handle(Geom_Transformation)& ,
+ const Handle(Prs3d_Presentation)& )
{
throw Standard_NotImplemented("cannot compute under a specific projector");
}
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode) = 0;
- //! Calculates the 3D view presentation.
+ //! Calculates hidden line removal presentation for specific camera position.
//! Each of the views in the viewer and every modification such as rotation, for example, entails recalculation.
- //! It must be redefined to implement hidden line removal for the object. The user never calls this method himself.
- //! This is done via the InteractiveContext object and is dependent on the point of view from which the object is displayed.
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& theProjector,
- const Handle(Prs3d_Presentation)& thePrs);
-
- //! Calculates the 3D view presentation.
- //! A point of view is provided by the projector, and the geometric transformation which has transformed associated presentable objects is specified by transformation.
- //! This function is to be used in case where a hidden line removal display cannot be calculated automatically.
- //! This occurs when associated presentable objects have been transformed geometrically, but not translated.
+ //! Default implementation throws Standard_NotImplemented exception
//! Warning! The transformation must be applied to the object before computation.
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& theProjector,
- const Handle(Geom_Transformation)& theTrsf,
- const Handle(Prs3d_Presentation)& thePrs);
+ //! @param theProjector [in] view orientation
+ //! @param theTrsf [in] additional transformation, or NULL if undefined
+ //! @param thePrs [in] presentation to fill
+ Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
+ const Handle(Geom_Transformation)& theTrsf,
+ const Handle(Prs3d_Presentation)& thePrs);
//! Recomputes invalidated presentations of the object.
//! @param theToIncludeHidden if TRUE, then even hidden invalidated presentations will be updated
#include <Graphic3d_DataStructureManager.hxx>
#include <Precision.hxx>
#include <Prs3d_Drawer.hxx>
-#include <Prs3d_Projector.hxx>
#include <PrsMgr_PresentableObject.hxx>
#include <PrsMgr_PresentationManager.hxx>
#include <Quantity_Color.hxx>
myPresentableObject->Compute (myPresentationManager, this, aDispMode);
}
-//=======================================================================
-//function : Compute
-//purpose : Methods for hidden parts...
-//=======================================================================
-Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector)
-{
- Handle(Graphic3d_Structure) aPrs = new Graphic3d_Structure (myPresentationManager->StructureManager());
- myPresentableObject->Compute (Projector (theProjector), aPrs);
- return aPrs;
-}
-
//=======================================================================
//function : Compute
//purpose :
//=======================================================================
-void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- Handle(Graphic3d_Structure)& theStructToFill)
+void PrsMgr_Presentation::computeHLR (const Handle(Graphic3d_Camera)& theProjector,
+ Handle(Graphic3d_Structure)& theStructToFill)
{
- theStructToFill->Clear();
- Handle(Prs3d_Presentation) aPrs = theStructToFill;
- myPresentableObject->Compute (Projector (theProjector), aPrs);
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- const Handle(Geom_Transformation)& theTrsf)
-{
- Handle(Prs3d_Presentation) aPrs3d = new Prs3d_Presentation (myPresentationManager->StructureManager());
- myPresentableObject->Compute (Projector (theProjector), theTrsf, aPrs3d);
- return aPrs3d;
-}
-
-//=======================================================================
-//function : Compute
-//purpose :
-//=======================================================================
-void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- const Handle(Geom_Transformation)& theTrsf,
- Handle(Graphic3d_Structure)& theStructToFill)
-{
- // recompute HLR after transformation in all the case
+ if (theStructToFill.IsNull())
+ {
+ theStructToFill = new Prs3d_Presentation (myPresentationManager->StructureManager());
+ }
Handle(Graphic3d_Structure) aPrs = theStructToFill;
theStructToFill->Clear();
- myPresentableObject->Compute (Projector (theProjector), theTrsf, aPrs);
-}
-
-//=======================================================================
-//function : Projector
-//purpose :
-//=======================================================================
-Handle(Prs3d_Projector) PrsMgr_Presentation::Projector (const Handle(Graphic3d_DataStructureManager)& theProjector)
-{
- Handle(Graphic3d_Camera) aCamera = Handle(Graphic3d_CView)::DownCast (theProjector)->Camera();
- const gp_Dir aDir = aCamera->Direction().Reversed();
- const gp_Pnt anAt = aCamera->Center();
- const gp_Dir anUp = aCamera->Up();
- Handle(Prs3d_Projector) aProj = new Prs3d_Projector (!aCamera->IsOrthographic(),
- aCamera->Scale(),
- aDir.X(), aDir.Y(), aDir.Z(),
- anAt.X(), anAt.Y(), anAt.Z(),
- anUp.X(), anUp.Y(), anUp.Z());
- return aProj;
+ myPresentableObject->computeHLR (theProjector, Transformation(), aPrs);
}
//=======================================================================
class PrsMgr_PresentationManager;
class PrsMgr_PresentableObject;
class Quantity_Color;
+class Graphic3d_Camera;
class Geom_Transformation;
class Prs3d_Drawer;
class Graphic3d_Structure;
class Graphic3d_DataStructureManager;
-class Prs3d_Projector;
DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Graphic3d_Structure)
//! Displays myStructure.
Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
- Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector) Standard_OVERRIDE;
-
- Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE;
-
- Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
-
- Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
- const Handle(Geom_Transformation)& theTrsf,
- Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
-
- Standard_EXPORT static Handle(Prs3d_Projector) Projector (const Handle(Graphic3d_DataStructureManager)& theProjector);
-
+ Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
+ Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
protected:
Handle(PrsMgr_PresentationManager) myPresentationManager;
#include <TopoDS_Compound.hxx>
#include <TopoDS_CompSolid.hxx>
#include <StdSelect_ShapeTypeFilter.hxx>
-#include <Prs3d_Projector.hxx>
#include <HLRAlgo_Projector.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Font_NameOfFont.hxx>
StdPrs_HLRPolyShape.hxx
StdPrs_HLRShape.cxx
StdPrs_HLRShape.hxx
+StdPrs_HLRShapeI.cxx
+StdPrs_HLRShapeI.hxx
StdPrs_HLRToolShape.cxx
StdPrs_HLRToolShape.hxx
StdPrs_Isolines.cxx
#include <HLRBRep_PolyAlgo.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
+#include <StdPrs_ToolTriangulatedShape.hxx>
#include <StdPrs_WFShape.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TopAbs.hxx>
#define PntY2 ((Standard_Real*)Coordinates)[4]
#define PntZ2 ((Standard_Real*)Coordinates)[5]
+IMPLEMENT_STANDARD_RTTIEXT(StdPrs_HLRPolyShape, StdPrs_HLRShapeI)
+
//=======================================================================
//function : Add
-//purpose :
+//purpose :
//=======================================================================
-
-void StdPrs_HLRPolyShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
- const TopoDS_Shape& aShape,
- const Handle (Prs3d_Drawer)& aDrawer,
- const Handle (Prs3d_Projector)& aProjector)
+void StdPrs_HLRPolyShape::ComputeHLR (const Handle(Prs3d_Presentation)& aPresentation,
+ const TopoDS_Shape& aShape,
+ const Handle(Prs3d_Drawer)& aDrawer,
+ const Handle(Graphic3d_Camera)& theProjector) const
{
+ gp_Dir aBackDir = -theProjector->Direction();
+ gp_Dir aXpers = theProjector->Up().Crossed (aBackDir);
+ gp_Ax3 anAx3 (theProjector->Center(), aBackDir, aXpers);
+ gp_Trsf aTrsf;
+ aTrsf.SetTransformation (anAx3);
+ const HLRAlgo_Projector aProj (aTrsf, !theProjector->IsOrthographic(), theProjector->Scale());
+
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(aPresentation);
TopExp_Explorer ex;
}
Handle(HLRBRep_PolyAlgo) hider = new HLRBRep_PolyAlgo(aShape);
-
- hider->Projector(aProjector->Projector());
+ hider->Projector (aProj);
hider->Angle(aDrawer->HLRAngle());
hider->Update();
Standard_Real sta,end,dx,dy,dz;
#ifndef _StdPrs_HLRPolyShape_HeaderFile
#define _StdPrs_HLRPolyShape_HeaderFile
-#include <Prs3d_Root.hxx>
-#include <Prs3d_Drawer.hxx>
-
-class TopoDS_Shape;
-class Prs3d_Projector;
-
-//! Instantiates Prs3d_PolyHLRShape to define a
-//! display of a shape where hidden and visible lines are
-//! identified with respect to a given projection.
-//! StdPrs_HLRPolyShape works with a polyhedral
-//! simplification of the shape whereas
-//! StdPrs_HLRShape takes the shape itself into
-//! account. When you use StdPrs_HLRShape, you
-//! obtain an exact result, whereas, when you use
-//! StdPrs_HLRPolyShape, you reduce computation
-//! time but obtain polygonal segments.
+#include <StdPrs_HLRShapeI.hxx>
+
+//! Instantiates Prs3d_PolyHLRShape to define a display of a shape where hidden
+//! and visible lines are identified with respect to a given projection.
+//! StdPrs_HLRPolyShape works with a polyhedral simplification of the shape whereas
+//! StdPrs_HLRShape takes the shape itself into account.
+//! When you use StdPrs_HLRShape, you obtain an exact result, whereas, when you use StdPrs_HLRPolyShape,
+//! you reduce computation time but obtain polygonal segments.
//! The polygonal algorithm is used.
-class StdPrs_HLRPolyShape : public Prs3d_Root
+class StdPrs_HLRPolyShape : public StdPrs_HLRShapeI
{
+ DEFINE_STANDARD_RTTIEXT(StdPrs_HLRPolyShape, StdPrs_HLRShapeI)
public:
-
- DEFINE_STANDARD_ALLOC
-
- //! Defines the hidden line removal display of the
- //! topology aShape in the projection defined by
- //! aProjector. The shape and the projection are added
- //! to the display aPresentation, and the attributes of the
- //! elements present in the aPresentation are defined by
- //! the attribute manager aDrawer.
- Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& aShape, const Handle(Prs3d_Drawer)& aDrawer, const Handle(Prs3d_Projector)& aProjector);
-
-
-
-
-protected:
-
-
-
-
-
-private:
-
-
-
-
+ //! Compute presentation for specified shape.
+ Standard_EXPORT virtual void ComputeHLR (const Handle(Prs3d_Presentation)& thePrs,
+ const TopoDS_Shape& theShape,
+ const Handle(Prs3d_Drawer)& theDrawer,
+ const Handle(Graphic3d_Camera)& theProjector) const Standard_OVERRIDE;
};
-
-
-
-
-
-
#endif // _StdPrs_HLRPolyShape_HeaderFile
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#include <StdPrs_HLRShape.hxx>
+
#include <BRepAdaptor_Curve.hxx>
#include <Graphic3d_Group.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
-#include <StdPrs_HLRShape.hxx>
#include <StdPrs_HLRToolShape.hxx>
#include <StdPrs_DeflectionCurve.hxx>
#include <TopoDS_Shape.hxx>
#include <TColgp_SequenceOfPnt.hxx>
+#include <HLRAlgo_Projector.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(StdPrs_HLRShape, StdPrs_HLRShapeI)
//=======================================================================
-//function : Add
-//purpose :
+//function : ComputeHLR
+//purpose :
//=======================================================================
-
-void StdPrs_HLRShape::Add (const Handle(Prs3d_Presentation)& thePresentation,
- const TopoDS_Shape& theShape,
- const Handle(Prs3d_Drawer)& theDrawer,
- const Handle(Prs3d_Projector)& theProjector)
+void StdPrs_HLRShape::ComputeHLR (const Handle(Prs3d_Presentation)& thePresentation,
+ const TopoDS_Shape& theShape,
+ const Handle(Prs3d_Drawer)& theDrawer,
+ const Handle(Graphic3d_Camera)& theProjector) const
{
- StdPrs_HLRToolShape aTool(theShape, theProjector->Projector());
+ gp_Dir aBackDir = -theProjector->Direction();
+ gp_Dir aXpers = theProjector->Up().Crossed (aBackDir);
+ gp_Ax3 anAx3 (theProjector->Center(), aBackDir, aXpers);
+ gp_Trsf aTrsf;
+ aTrsf.SetTransformation (anAx3);
+ const HLRAlgo_Projector aProj (aTrsf, !theProjector->IsOrthographic(), theProjector->Scale());
+
+ StdPrs_HLRToolShape aTool(theShape, aProj);
Standard_Integer aNbEdges = aTool.NbEdges();
Standard_Integer anI;
Standard_Real anU1, anU2;
#ifndef _StdPrs_HLRFace_H__
#define _StdPrs_HLRFace_H__
-#include <Prs3d_Root.hxx>
-#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Drawer.hxx>
-#include <Prs3d_Projector.hxx>
+#include <StdPrs_HLRShapeI.hxx>
-// Computes the presentation of objects with
-// removal of their hidden lines for a specific
-// projector. The exact algorithm is used.
-
-class StdPrs_HLRShape: public Prs3d_Root
+//! Computes the presentation of objects with removal of their hidden lines for a specific projector.
+//! The exact algorithm is used.
+class StdPrs_HLRShape : public StdPrs_HLRShapeI
{
+ DEFINE_STANDARD_RTTIEXT(StdPrs_HLRShape, StdPrs_HLRShapeI)
public:
- DEFINE_STANDARD_ALLOC
-
- Standard_EXPORT static void Add
- (const Handle(Prs3d_Presentation)& thePresentation,
- const TopoDS_Shape& theShape,
- const Handle(Prs3d_Drawer)& theDrawer,
- const Handle(Prs3d_Projector)& theProjector);
+ //! Compute presentation for specified shape.
+ Standard_EXPORT virtual void ComputeHLR (const Handle(Prs3d_Presentation)& thePrs,
+ const TopoDS_Shape& theShape,
+ const Handle(Prs3d_Drawer)& theDrawer,
+ const Handle(Graphic3d_Camera)& theProjector) const Standard_OVERRIDE;
};
#endif
--- /dev/null
+// Copyright (c) 2020 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 <StdPrs_HLRShapeI.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(StdPrs_HLRShapeI, Standard_Transient)
--- /dev/null
+// Copyright (c) 2020 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.
+
+#ifndef _StdPrs_HLRShapeI_HeaderFile
+#define _StdPrs_HLRShapeI_HeaderFile
+
+#include <Prs3d_Presentation.hxx>
+#include <Standard_Transient.hxx>
+#include <Standard_Type.hxx>
+
+class TopoDS_Shape;
+class Prs3d_Drawer;
+class Graphic3d_Camera;
+
+//! Computes the presentation of objects with removal of their hidden lines for a specific projector.
+class StdPrs_HLRShapeI : public Standard_Transient
+{
+ DEFINE_STANDARD_RTTIEXT(StdPrs_HLRShapeI, Standard_Transient)
+public:
+
+ //! Compute presentation for specified shape.
+ virtual void ComputeHLR (const Handle(Prs3d_Presentation)& thePrs,
+ const TopoDS_Shape& theShape,
+ const Handle(Prs3d_Drawer)& theDrawer,
+ const Handle(Graphic3d_Camera)& theProjector) const = 0;
+
+};
+
+#endif // _StdPrs_HLRShapeI_HeaderFile
#include <Geom_Transformation.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
-#include <Prs3d_Projector.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_WFShape.hxx>
#include <StdPrs_ShadedShape.hxx>
StdPrs_WFShape::Add (P, mysh, myDrawer);
}
-void StdSelect_Shape::Compute(const Handle(Prs3d_Projector)& aProjector ,
- const Handle(Geom_Transformation)& aGeomTrans,
- const Handle(Prs3d_Presentation)& aPresentation )
-{
- PrsMgr_PresentableObject::Compute(aProjector,aGeomTrans,aPresentation);
-}
-
-
-void StdSelect_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
- const Handle(Prs3d_Presentation)& aPresentation)
-{
- PrsMgr_PresentableObject::Compute(aProjector,aPresentation);
-}
-
void StdSelect_Shape::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
Standard_EXPORT StdSelect_Shape(const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer = Handle(Prs3d_Drawer)());
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
-
- //! computes the presentation according to a point of view
- //! given by <aProjector>.
- //! To be Used when the associated degenerated Presentations
- //! have been transformed by <aTrsf> which is not a Pure
- //! Translation. The HLR Prs can't be deducted automatically
- //! WARNING :<aTrsf> must be applied
- //! to the object to display before computation !!!
- Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
const TopoDS_Shape& Shape() const { return mysh; }
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
-private:
-
- Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
-
private:
TopoDS_Shape mysh;