1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-16 10:08:36 +03:00

0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims

The following classes and their subclasses within AIS package
have been moved to new package PrsDim and renamed:
- AIS_Relation  -> PrsDim_Relation;
- AIS_Dimension -> PrsDim_Dimension,
This commit is contained in:
kgv 2020-03-21 16:31:03 +03:00 committed by bugmaster
parent 64943a5187
commit 787ff2408c
108 changed files with 2373 additions and 2516 deletions

View File

@ -202,6 +202,7 @@ n InterfaceGraphic
n AIS n AIS
n Aspect n Aspect
n DsgPrs n DsgPrs
n PrsDim
n Graphic3d n Graphic3d
n Image n Image
n Media n Media

View File

@ -1900,6 +1900,11 @@ The default value of Prs3d_Drawer::DeviationAngle() property has been changed fr
Methods computing HLR presentation within *PrsMgr_PresentableObject::Compute()* have been renamed to *PrsMgr_PresentableObject::computeHLR()* 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*. and now accept *Graphic3d_Camera* object instead of removed *Prs3d_Projector*.
@subsection upgrade_750_dimensions Dimension and Relation presentations moved from AIS to PrsDim
Presentation classes displaying Dimensions and Relations have been moved from *AIS* package to *PrsDim*.
Corresponding classes should be renamed in application code (like *AIS_LengthDimension* -> *PrsDim_LengthDimension*).
@subsection upgrade_750_sensitiveEntity Select3D_SensitiveEntity interface change @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. The method Select3D_SensitiveEntity::NbSubElements() has been changed to be constant. Select3D_SensitiveEntity subclasses at application level should be updated accordingly.

View File

@ -962,26 +962,26 @@ This command can also draw a sphere surface or a volume with a large amount of p
The **Relation** is made up of constraints on one or more interactive shapes and the corresponding reference geometry. For example, you might want to constrain two edges in a parallel relation. This constraint is considered as an object in its own right, and is shown as a sensitive primitive. This takes the graphic form of a perpendicular arrow marked with the || symbol and lying between the two edges. The **Relation** is made up of constraints on one or more interactive shapes and the corresponding reference geometry. For example, you might want to constrain two edges in a parallel relation. This constraint is considered as an object in its own right, and is shown as a sensitive primitive. This takes the graphic form of a perpendicular arrow marked with the || symbol and lying between the two edges.
The following relations are provided by *AIS*: The following relations are provided by *PrsDim*:
* *AIS_ConcentricRelation* * *PrsDim_ConcentricRelation*
* *AIS_FixRelation* * *PrsDim_FixRelation*
* *AIS_IdenticRelation* * *PrsDim_IdenticRelation*
* *AIS_ParallelRelation* * *PrsDim_ParallelRelation*
* *AIS_PerpendicularRelation* * *PrsDim_PerpendicularRelation*
* *AIS_Relation* * *PrsDim_Relation*
* *AIS_SymmetricRelation* * *PrsDim_SymmetricRelation*
* *AIS_TangentRelation* * *PrsDim_TangentRelation*
The list of relations is not exhaustive. The list of relations is not exhaustive.
@subsubsection occt_visu_3_5_4 Dimensions @subsubsection occt_visu_3_5_4 Dimensions
* *AIS_AngleDimension* * *PrsDim_AngleDimension*
* *AIS_Chamf3dDimension* * *PrsDim_Chamf3dDimension*
* *AIS_DiameterDimension* * *PrsDim_DiameterDimension*
* *AIS_DimensionOwner* * *PrsDim_DimensionOwner*
* *AIS_LengthDimension* * *PrsDim_LengthDimension*
* *AIS_OffsetDimension* * *PrsDim_OffsetDimension*
* *AIS_RadiusDimension* * *PrsDim_RadiusDimension*
@subsubsection occt_visu_3_5_5 MeshVS_Mesh @subsubsection occt_visu_3_5_5 MeshVS_Mesh

View File

@ -6,8 +6,7 @@
#include "DimensionDlg.h" #include "DimensionDlg.h"
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <AIS_LengthDimension.hxx> #include <PrsDim_AngleDimension.hxx>
#include <AIS_AngleDimension.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <GC_MakePlane.hxx> #include <GC_MakePlane.hxx>
#include <Prs3d_DimensionAspect.hxx> #include <Prs3d_DimensionAspect.hxx>
@ -128,7 +127,7 @@ void CAngleParamsVerticesPage::OnBnClickedVertex3Btn()
GC_MakePlane aPlaneBuilder (aP1,aP2,aP3); GC_MakePlane aPlaneBuilder (aP1,aP2,aP3);
Handle(Geom_Plane) aPlane = aPlaneBuilder.Value(); Handle(Geom_Plane) aPlane = aPlaneBuilder.Value();
Handle(AIS_AngleDimension) anAngleDim = new AIS_AngleDimension (aP1,aP2,aP3); Handle(PrsDim_AngleDimension) anAngleDim = new PrsDim_AngleDimension (aP1,aP2,aP3);
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
anAspect->MakeArrows3d (Standard_False); anAspect->MakeArrows3d (Standard_False);
anAspect->MakeText3d (aDimDlg->GetTextType()); anAspect->MakeText3d (aDimDlg->GetTextType());
@ -146,7 +145,7 @@ void CAngleParamsVerticesPage::OnBnClickedVertex3Btn()
} }
else // radians - no special symbol else // radians - no special symbol
{ {
anAngleDim->SetDisplaySpecialSymbol (AIS_DSS_No); anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No);
} }
} }
anAngleDim->SetDimensionAspect (anAspect); anAngleDim->SetDimensionAspect (anAspect);

View File

@ -7,7 +7,7 @@
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <AIS_LengthDimension.hxx> #include <PrsDim_LengthDimension.hxx>
#include <GC_MakePlane.hxx> #include <GC_MakePlane.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
@ -91,7 +91,7 @@ void CLengthParamsEdgePage::OnBnClickedChooseEdgeBtn()
CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner()); CDimensionDlg *aDimDlg = (CDimensionDlg*)(GetParentOwner());
Handle(AIS_LengthDimension) aLenDim = new AIS_LengthDimension (TopoDS::Edge (anEdge), aPlane->Pln()); Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (TopoDS::Edge (anEdge), aPlane->Pln());
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
anAspect->MakeArrows3d (Standard_False); anAspect->MakeArrows3d (Standard_False);
anAspect->MakeText3d (aDimDlg->GetTextType()); anAspect->MakeText3d (aDimDlg->GetTextType());

View File

@ -5,8 +5,8 @@
#include "LengthParamsEdgesPage.h" #include "LengthParamsEdgesPage.h"
#include "DimensionDlg.h" #include "DimensionDlg.h"
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <AIS_LengthDimension.hxx> #include <PrsDim_LengthDimension.hxx>
#include <AIS_AngleDimension.hxx> #include <PrsDim_AngleDimension.hxx>
#include <GC_MakePlane.hxx> #include <GC_MakePlane.hxx>
// CLengthParamsEdgesPage dialog // CLengthParamsEdgesPage dialog
@ -119,7 +119,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
if (myIsAngleDimension) if (myIsAngleDimension)
{ {
// Build an angle dimension between two non-parallel edges // Build an angle dimension between two non-parallel edges
Handle(AIS_AngleDimension) anAngleDim = new AIS_AngleDimension (myFirstEdge, mySecondEdge); Handle(PrsDim_AngleDimension) anAngleDim = new PrsDim_AngleDimension (myFirstEdge, mySecondEdge);
anAngleDim->SetDimensionAspect (anAspect); anAngleDim->SetDimensionAspect (anAspect);
anAngleDim->DimensionAspect()->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); anAngleDim->DimensionAspect()->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed());
if (aDimDlg->IsUnitsDisplayed()) if (aDimDlg->IsUnitsDisplayed())
@ -131,7 +131,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
} }
else else
{ {
anAngleDim->SetDisplaySpecialSymbol (AIS_DSS_No); anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No);
} }
} }
@ -140,7 +140,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn()
} }
else else
{ {
Handle(AIS_LengthDimension) aLenDim = new AIS_LengthDimension (myFirstEdge, mySecondEdge, aPlane->Pln()); Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (myFirstEdge, mySecondEdge, aPlane->Pln());
aLenDim->SetDimensionAspect (anAspect); aLenDim->SetDimensionAspect (anAspect);
aLenDim->SetFlyout (aDimDlg->GetFlyout()); aLenDim->SetFlyout (aDimDlg->GetFlyout());
if (aDimDlg->IsUnitsDisplayed()) if (aDimDlg->IsUnitsDisplayed())

View File

@ -6,7 +6,7 @@
#include "DimensionDlg.h" #include "DimensionDlg.h"
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <AIS_LengthDimension.hxx> #include <PrsDim_LengthDimension.hxx>
#include <GC_MakePlane.hxx> #include <GC_MakePlane.hxx>
@ -103,7 +103,7 @@ void CLengthParamsVerticesPage::OnBnClickedVertex2Btn()
CDimensionDlg *aDimDlg = (CDimensionDlg*)(this->GetParentOwner()); CDimensionDlg *aDimDlg = (CDimensionDlg*)(this->GetParentOwner());
Handle(AIS_LengthDimension) aLenDim = new AIS_LengthDimension (aP1, aP2, aPlane->Pln()); Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (aP1, aP2, aPlane->Pln());
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();
anAspect->MakeArrows3d (Standard_False); anAspect->MakeArrows3d (Standard_False);

View File

@ -5,8 +5,8 @@
#include "ParamsFacesPage.h" #include "ParamsFacesPage.h"
#include "DimensionDlg.h" #include "DimensionDlg.h"
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <AIS_LengthDimension.hxx> #include <PrsDim_LengthDimension.hxx>
#include <AIS_AngleDimension.hxx> #include <PrsDim_AngleDimension.hxx>
// CParamsFacesPage dialog // CParamsFacesPage dialog
@ -87,7 +87,7 @@ void CParamsFacesPage::OnBnClickedFacesbtn2()
if (myIsAngleDimension) if (myIsAngleDimension)
{ {
// Build an angle dimension between two non-parallel edges // Build an angle dimension between two non-parallel edges
Handle(AIS_AngleDimension) anAngleDim = new AIS_AngleDimension (myFirstFace, mySecondFace); Handle(PrsDim_AngleDimension) anAngleDim = new PrsDim_AngleDimension (myFirstFace, mySecondFace);
anAngleDim->SetDimensionAspect (anAspect); anAngleDim->SetDimensionAspect (anAspect);
if (aDimDlg->IsUnitsDisplayed()) if (aDimDlg->IsUnitsDisplayed())
@ -99,7 +99,7 @@ void CParamsFacesPage::OnBnClickedFacesbtn2()
} }
else else
{ {
anAngleDim->SetDisplaySpecialSymbol (AIS_DSS_No); anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No);
} }
} }
@ -108,7 +108,7 @@ void CParamsFacesPage::OnBnClickedFacesbtn2()
} }
else else
{ {
Handle(AIS_LengthDimension) aLenDim = new AIS_LengthDimension (myFirstFace, mySecondFace); Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (myFirstFace, mySecondFace);
aLenDim->SetDimensionAspect (anAspect); aLenDim->SetDimensionAspect (anAspect);
if (aLenDim->DimensionAspect()->IsUnitsDisplayed()) if (aLenDim->DimensionAspect()->IsUnitsDisplayed())

View File

@ -4,8 +4,8 @@
#include "DimensionDlg.h" #include "DimensionDlg.h"
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <AIS_RadiusDimension.hxx> #include <PrsDim_RadiusDimension.hxx>
#include <AIS_DiameterDimension.hxx> #include <PrsDim_DiameterDimension.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
@ -96,16 +96,16 @@ void CRadiusParamsPage::OnBnClickedObjectBtn()
myAISContext->ClearSelected (Standard_False); myAISContext->ClearSelected (Standard_False);
CDimensionDlg *aDimDlg = (CDimensionDlg*)(this->GetParentOwner()); CDimensionDlg *aDimDlg = (CDimensionDlg*)(this->GetParentOwner());
// Try to create dimension if it is possible // Try to create dimension if it is possible
Handle(AIS_Dimension) aDim; Handle(PrsDim_Dimension) aDim;
if (myIsDiameterDimension) if (myIsDiameterDimension)
{ {
aDim = new AIS_DiameterDimension (aCircle); aDim = new PrsDim_DiameterDimension (aCircle);
Handle(AIS_DiameterDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout()); Handle(PrsDim_DiameterDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout());
} }
else else
{ {
aDim = new AIS_RadiusDimension (aCircle); aDim = new PrsDim_RadiusDimension (aCircle);
Handle(AIS_RadiusDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout()); Handle(PrsDim_RadiusDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout());
} }
Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect();

View File

@ -17,26 +17,9 @@
#ifndef _AIS_HeaderFile #ifndef _AIS_HeaderFile
#define _AIS_HeaderFile #define _AIS_HeaderFile
#include <AIS_KindOfSurface.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx> #include <Prs3d_Presentation.hxx>
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_DefineAlloc.hxx> #include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class Bnd_Box;
class Geom_Curve;
class Geom_Plane;
class Geom_Surface;
class TopoDS_Edge;
class TopoDS_Face;
class TopoDS_Shape;
class TopoDS_Vertex;
//! Application Interactive Services provide the means to create links between an application GUI viewer and //! Application Interactive Services provide the means to create links between an application GUI viewer and
//! the packages which are used to manage selection and presentation. //! the packages which are used to manage selection and presentation.
@ -90,119 +73,6 @@ public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
//! Returns the nearest point in a shape. This is used by
//! several classes in calculation of dimensions.
Standard_EXPORT static gp_Pnt Nearest (const TopoDS_Shape& aShape, const gp_Pnt& aPoint);
//! @return the nearest point on the line.
Standard_EXPORT static gp_Pnt Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint);
//! For the given point finds nearest point on the curve,
//! @return TRUE if found point is belongs to the curve
//! and FALSE otherwise.
Standard_EXPORT static Standard_Boolean Nearest (const Handle(Geom_Curve)& theCurve, const gp_Pnt& thePoint, const gp_Pnt& theFirstPoint, const gp_Pnt& theLastPoint, gp_Pnt& theNearestPoint);
Standard_EXPORT static gp_Pnt Farest (const TopoDS_Shape& aShape, const gp_Pnt& aPoint);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt);
//! Used by dimensions only.
//! Computes the 3d geometry of <anEdge>.
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt, Standard_Boolean& theIsInfinite);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any.
//! If <aCurve> is not in the current plane, <extCurve> contains
//! the not projected curve associated to <anEdge>.
//! If <anEdge> is infinite, <isinfinite> = true and the 2
//! parameters <FirstPnt> and <LastPnt> have no signification.
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt, Handle(Geom_Curve)& theExtCurve, Standard_Boolean& theIsInfinite, Standard_Boolean& theIsOnPlane, const Handle(Geom_Plane)& thePlane);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, const Handle(Geom_Plane)& thePlane);
//! Used by dimensions only.Computes the 3d geometry
//! of<anEdge1> and <anEdge2> and checks if they are infinite.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, Standard_Boolean& theIsinfinite1, Standard_Boolean& theIsinfinite2);
//! Used by 2d Relation only Computes the 3d geometry
//! of<anEdge1> and <anEdge2> in the current Plane and the
//! extremities if any. Return in ExtCurve the 3d curve
//! (not projected in the plane) of the first edge if
//! <indexExt> =1 or of the 2nd edge if <indexExt> = 2. If
//! <indexExt> = 0, ExtCurve is Null. if there is an edge
//! external to the plane, <isinfinite> is true if this
//! edge is infinite. So, the extremities of it are not
//! significant. Return TRUE if ok
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Standard_Integer& theExtIndex, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, Handle(Geom_Curve)& theExtCurve, Standard_Boolean& theIsinfinite1, Standard_Boolean& theIsinfinite2, const Handle(Geom_Plane)& thePlane);
//! Checks if aCurve belongs to aPlane; if not, projects aCurve in aPlane
//! and returns aCurve;
//! Return TRUE if ok
Standard_EXPORT static Standard_Boolean ComputeGeomCurve (Handle(Geom_Curve)& aCurve, const Standard_Real first1, const Standard_Real last1, gp_Pnt& FirstPnt1, gp_Pnt& LastPnt1, const Handle(Geom_Plane)& aPlane, Standard_Boolean& isOnPlane);
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Vertex& aVertex, gp_Pnt& point, const Handle(Geom_Plane)& aPlane, Standard_Boolean& isOnPlane);
//! Tryes to get Plane from Face. Returns Surface of Face
//! in aSurf. Returns Standard_True and Plane of Face in
//! aPlane in following cases:
//! Face is Plane, Offset of Plane,
//! Extrusion of Line and Offset of Extrusion of Line
//! Returns pure type of Surface which can be:
//! Plane, Cylinder, Cone, Sphere, Torus,
//! SurfaceOfRevolution, SurfaceOfExtrusion
Standard_EXPORT static Standard_Boolean GetPlaneFromFace (const TopoDS_Face& aFace, gp_Pln& aPlane, Handle(Geom_Surface)& aSurf, AIS_KindOfSurface& aSurfType, Standard_Real& Offset);
Standard_EXPORT static void InitFaceLength (const TopoDS_Face& aFace, gp_Pln& aPlane, Handle(Geom_Surface)& aSurface, AIS_KindOfSurface& aSurfaceType, Standard_Real& anOffset);
//! Finds attachment points on two curvilinear faces for length dimension.
//! @param thePlaneDir [in] the direction on the dimension plane to
//! compute the plane automatically. It will not be taken into account if
//! plane is defined by user.
Standard_EXPORT static void InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, Handle(Geom_Surface)& theFirstSurf, Handle(Geom_Surface)& theSecondSurf, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, gp_Dir& theDirOnPlane);
//! Finds three points for the angle dimension between
//! two planes.
Standard_EXPORT static Standard_Boolean InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, gp_Pnt& theCenter, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, const Standard_Boolean theIsFirstPointSet = Standard_False);
//! Finds three points for the angle dimension between
//! two curvilinear surfaces.
Standard_EXPORT static Standard_Boolean InitAngleBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, const AIS_KindOfSurface theFirstSurfType, const AIS_KindOfSurface theSecondSurfType, gp_Pnt& theCenter, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, const Standard_Boolean theIsFirstPointSet = Standard_False);
Standard_EXPORT static gp_Pnt ProjectPointOnPlane (const gp_Pnt& aPoint, const gp_Pln& aPlane);
Standard_EXPORT static gp_Pnt ProjectPointOnLine (const gp_Pnt& aPoint, const gp_Lin& aLine);
Standard_EXPORT static gp_Pnt TranslatePointToBound (const gp_Pnt& aPoint, const gp_Dir& aDir, const Bnd_Box& aBndBox);
//! returns True if point with anAttachPar is
//! in domain of arc
Standard_EXPORT static Standard_Boolean InDomain (const Standard_Real aFirstPar, const Standard_Real aLastPar, const Standard_Real anAttachPar);
//! computes nearest to ellipse arc apex
Standard_EXPORT static gp_Pnt NearestApex (const gp_Elips& elips, const gp_Pnt& pApex, const gp_Pnt& nApex, const Standard_Real fpara, const Standard_Real lpara, Standard_Boolean& IsInDomain);
//! computes length of ellipse arc in parametric units
Standard_EXPORT static Standard_Real DistanceFromApex (const gp_Elips& elips, const gp_Pnt& Apex, const Standard_Real par);
Standard_EXPORT static void ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPres, const Handle(Prs3d_Drawer)& aDrawer, const TopoDS_Edge& anEdge, const Handle(Geom_Curve)& ProjCurve, const gp_Pnt& FirstP, const gp_Pnt& LastP, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfLine aProjTOL = Aspect_TOL_DASH, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
Standard_EXPORT static void ComputeProjVertexPresentation (const Handle(Prs3d_Presentation)& aPres, const Handle(Prs3d_Drawer)& aDrawer, const TopoDS_Vertex& aVertex, const gp_Pnt& ProjPoint, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfMarker aProjTOM = Aspect_TOM_PLUS, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
}; };
#endif // _AIS_HeaderFile #endif // _AIS_HeaderFile

View File

@ -1,33 +0,0 @@
// Created on: 1997-02-28
// Created by: Jean-Pierre COMBE
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : KindOfDimension
//purpose :
//=======================================================================
inline AIS_KindOfDimension AIS_Chamf2dDimension::KindOfDimension() const
{
return AIS_KOD_LENGTH;
}
//=======================================================================
//function : IsMovable
//purpose :
//=======================================================================
inline Standard_Boolean AIS_Chamf2dDimension::IsMovable() const
{
return Standard_True;
}

View File

@ -1,33 +0,0 @@
// Created on: 1997-02-28
// Created by: Jean-Pierre COMBE
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : KindOfDimension
//purpose :
//=======================================================================
inline AIS_KindOfDimension AIS_Chamf3dDimension::KindOfDimension() const
{
return AIS_KOD_LENGTH;
}
//=======================================================================
//function : IsMovable
//purpose :
//=======================================================================
inline Standard_Boolean AIS_Chamf3dDimension::IsMovable() const
{
return Standard_True;
}

View File

@ -1,57 +0,0 @@
// Created on: 1998-01-24
// Created by: Julia GERASIMOVA
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : SetShape3
//purpose :
//=======================================================================
inline void AIS_EqualDistanceRelation::SetShape3( const TopoDS_Shape& aShape )
{
myShape3 = aShape;
}
//=======================================================================
//function : Shape3
//purpose :
//=======================================================================
inline const TopoDS_Shape& AIS_EqualDistanceRelation::Shape3() const
{
return myShape3;
}
//=======================================================================
//function : SetShape4
//purpose :
//=======================================================================
inline void AIS_EqualDistanceRelation::SetShape4( const TopoDS_Shape& aShape )
{
myShape4 = aShape;
}
//=======================================================================
//function : Shape4
//purpose :
//=======================================================================
inline const TopoDS_Shape& AIS_EqualDistanceRelation::Shape4() const
{
return myShape4;
}

View File

@ -1,33 +0,0 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// Copyright (c) 1996-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 _AIS_KindOfSurface_HeaderFile
#define _AIS_KindOfSurface_HeaderFile
enum AIS_KindOfSurface
{
AIS_KOS_Plane,
AIS_KOS_Cylinder,
AIS_KOS_Cone,
AIS_KOS_Sphere,
AIS_KOS_Torus,
AIS_KOS_Revolution,
AIS_KOS_Extrusion,
AIS_KOS_OtherSurface
};
#endif // _AIS_KindOfSurface_HeaderFile

View File

@ -1,42 +0,0 @@
// Created on: 2000-10-20
// Created by: Julia DOROVSKIKH
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : SetTool
//purpose :
//=======================================================================
inline void AIS_MidPointRelation::SetTool(const TopoDS_Shape& aMidPointTool)
{
myTool = aMidPointTool;
}
//=======================================================================
//function : GetTool
//purpose :
//=======================================================================
inline const TopoDS_Shape& AIS_MidPointRelation::GetTool() const
{
return myTool;
}
//=======================================================================
//function : IsMovable
//purpose :
//=======================================================================
inline Standard_Boolean AIS_MidPointRelation::IsMovable() const
{
return Standard_True;
}

View File

@ -1,42 +0,0 @@
// Created on: 1997-03-04
// Created by: Jean-Pierre COMBE
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : KindOfDimension
//purpose :
//=======================================================================
inline AIS_KindOfDimension AIS_OffsetDimension::KindOfDimension() const
{
return AIS_KOD_OFFSET;
}
//=======================================================================
//function : IsMovable
//purpose :
//=======================================================================
inline Standard_Boolean AIS_OffsetDimension::IsMovable() const
{
return Standard_True;
}
//=======================================================================
//function : SetRelativePos
//purpose :
//=======================================================================
inline void AIS_OffsetDimension::SetRelativePos(const gp_Trsf& aTrsf)
{
myRelativePos = aTrsf;
}

View File

@ -1,24 +0,0 @@
// Created on: 1997-02-28
// Created by: Jean-Pierre COMBE
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : IsMovable
//purpose :
//=======================================================================
inline Standard_Boolean AIS_ParallelRelation::IsMovable() const
{
return Standard_True;
}

View File

@ -1,33 +0,0 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// Copyright (c) 1996-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 _AIS_StandardDatum_HeaderFile
#define _AIS_StandardDatum_HeaderFile
//! Declares the type of standard datum of an Interactive Object.
enum AIS_StandardDatum
{
AIS_SD_None,
AIS_SD_Point,
AIS_SD_Axis,
AIS_SD_Trihedron,
AIS_SD_PlaneTrihedron,
AIS_SD_Line,
AIS_SD_Circle,
AIS_SD_Plane
};
#endif // _AIS_StandardDatum_HeaderFile

View File

@ -1,43 +0,0 @@
// Created on: 1997-03-03
// Created by: Jean-Pierre COMBE
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : SetTool
//purpose :
//=======================================================================
inline void AIS_SymmetricRelation::SetTool(const TopoDS_Shape& aSymmetricTool)
{
myTool = aSymmetricTool;
}
//=======================================================================
//function : GetTool
//purpose :
//=======================================================================
inline const TopoDS_Shape& AIS_SymmetricRelation::GetTool() const
{
return myTool;
}
//=======================================================================
//function : IsMovable
//purpose :
//=======================================================================
inline Standard_Boolean AIS_SymmetricRelation::IsMovable() const
{
return Standard_True;
}

View File

@ -1,4 +1,3 @@
AIS.cxx
AIS.hxx AIS.hxx
AIS_Animation.cxx AIS_Animation.cxx
AIS_Animation.hxx AIS_Animation.hxx
@ -7,8 +6,6 @@ AIS_AnimationCamera.cxx
AIS_AnimationCamera.hxx AIS_AnimationCamera.hxx
AIS_AnimationObject.cxx AIS_AnimationObject.cxx
AIS_AnimationObject.hxx AIS_AnimationObject.hxx
AIS_AngleDimension.cxx
AIS_AngleDimension.hxx
AIS_AttributeFilter.cxx AIS_AttributeFilter.cxx
AIS_AttributeFilter.hxx AIS_AttributeFilter.hxx
AIS_AttributeFilter.lxx AIS_AttributeFilter.lxx
@ -20,12 +17,6 @@ AIS_C0RegularityFilter.cxx
AIS_C0RegularityFilter.hxx AIS_C0RegularityFilter.hxx
AIS_CameraFrustum.cxx AIS_CameraFrustum.cxx
AIS_CameraFrustum.hxx AIS_CameraFrustum.hxx
AIS_Chamf2dDimension.cxx
AIS_Chamf2dDimension.hxx
AIS_Chamf2dDimension.lxx
AIS_Chamf3dDimension.cxx
AIS_Chamf3dDimension.hxx
AIS_Chamf3dDimension.lxx
AIS_Circle.cxx AIS_Circle.cxx
AIS_Circle.hxx AIS_Circle.hxx
AIS_ClearMode.hxx AIS_ClearMode.hxx
@ -35,8 +26,6 @@ AIS_ColoredShape.hxx
AIS_DataMapOfShapeDrawer.hxx AIS_DataMapOfShapeDrawer.hxx
AIS_ColorScale.cxx AIS_ColorScale.cxx
AIS_ColorScale.hxx AIS_ColorScale.hxx
AIS_ConcentricRelation.cxx
AIS_ConcentricRelation.hxx
AIS_ConnectedInteractive.cxx AIS_ConnectedInteractive.cxx
AIS_ConnectedInteractive.hxx AIS_ConnectedInteractive.hxx
AIS_ConnectStatus.hxx AIS_ConnectStatus.hxx
@ -46,35 +35,16 @@ AIS_DataMapIteratorOfDataMapOfSelStat.hxx
AIS_DataMapofIntegerListOfinteractive.hxx AIS_DataMapofIntegerListOfinteractive.hxx
AIS_DataMapOfIOStatus.hxx AIS_DataMapOfIOStatus.hxx
AIS_DataMapOfSelStat.hxx AIS_DataMapOfSelStat.hxx
AIS_DiameterDimension.cxx
AIS_DiameterDimension.hxx
AIS_Dimension.cxx
AIS_Dimension.hxx
AIS_DimensionOwner.cxx
AIS_DimensionOwner.hxx
AIS_DimensionSelectionMode.hxx
AIS_DisplayMode.hxx AIS_DisplayMode.hxx
AIS_DisplaySpecialSymbol.hxx
AIS_DisplayStatus.hxx AIS_DisplayStatus.hxx
AIS_DragAction.hxx AIS_DragAction.hxx
AIS_EllipseRadiusDimension.cxx
AIS_EllipseRadiusDimension.hxx
AIS_EqualDistanceRelation.cxx
AIS_EqualDistanceRelation.hxx
AIS_EqualDistanceRelation.lxx
AIS_EqualRadiusRelation.cxx
AIS_EqualRadiusRelation.hxx
AIS_ExclusionFilter.cxx AIS_ExclusionFilter.cxx
AIS_ExclusionFilter.hxx AIS_ExclusionFilter.hxx
AIS_ExclusionFilter.lxx AIS_ExclusionFilter.lxx
AIS_FixRelation.cxx
AIS_FixRelation.hxx
AIS_GlobalStatus.cxx AIS_GlobalStatus.cxx
AIS_GlobalStatus.hxx AIS_GlobalStatus.hxx
AIS_GraphicTool.cxx AIS_GraphicTool.cxx
AIS_GraphicTool.hxx AIS_GraphicTool.hxx
AIS_IdenticRelation.cxx
AIS_IdenticRelation.hxx
AIS_IndexedDataMapOfOwnerPrs.hxx AIS_IndexedDataMapOfOwnerPrs.hxx
AIS_InteractiveContext.cxx AIS_InteractiveContext.cxx
AIS_InteractiveContext.hxx AIS_InteractiveContext.hxx
@ -83,13 +53,7 @@ AIS_InteractiveContext_2.cxx
AIS_InteractiveContext_3.cxx AIS_InteractiveContext_3.cxx
AIS_InteractiveObject.cxx AIS_InteractiveObject.cxx
AIS_InteractiveObject.hxx AIS_InteractiveObject.hxx
AIS_KindOfDimension.hxx
AIS_KindOfInteractive.hxx AIS_KindOfInteractive.hxx
AIS_KindOfRelation.hxx
AIS_KindOfSurface.hxx
AIS_KindOfUnit.hxx
AIS_LengthDimension.cxx
AIS_LengthDimension.hxx
AIS_Line.cxx AIS_Line.cxx
AIS_Line.hxx AIS_Line.hxx
AIS_ListIteratorOfListOfInteractive.hxx AIS_ListIteratorOfListOfInteractive.hxx
@ -101,29 +65,14 @@ AIS_ManipulatorOwner.hxx
AIS_ManipulatorOwner.cxx AIS_ManipulatorOwner.cxx
AIS_MapIteratorOfMapOfInteractive.hxx AIS_MapIteratorOfMapOfInteractive.hxx
AIS_MapOfInteractive.hxx AIS_MapOfInteractive.hxx
AIS_MaxRadiusDimension.cxx
AIS_MaxRadiusDimension.hxx
AIS_MediaPlayer.cxx AIS_MediaPlayer.cxx
AIS_MediaPlayer.hxx AIS_MediaPlayer.hxx
AIS_MouseGesture.hxx AIS_MouseGesture.hxx
AIS_MidPointRelation.cxx
AIS_MidPointRelation.hxx
AIS_MidPointRelation.lxx
AIS_MinRadiusDimension.cxx
AIS_MinRadiusDimension.hxx
AIS_MultipleConnectedInteractive.cxx AIS_MultipleConnectedInteractive.cxx
AIS_MultipleConnectedInteractive.hxx AIS_MultipleConnectedInteractive.hxx
AIS_MultipleConnectedInteractive.lxx AIS_MultipleConnectedInteractive.lxx
AIS_NavigationMode.hxx AIS_NavigationMode.hxx
AIS_NListOfEntityOwner.hxx AIS_NListOfEntityOwner.hxx
AIS_OffsetDimension.cxx
AIS_OffsetDimension.hxx
AIS_OffsetDimension.lxx
AIS_ParallelRelation.cxx
AIS_ParallelRelation.hxx
AIS_ParallelRelation.lxx
AIS_PerpendicularRelation.cxx
AIS_PerpendicularRelation.hxx
AIS_Plane.cxx AIS_Plane.cxx
AIS_Plane.hxx AIS_Plane.hxx
AIS_PlaneTrihedron.cxx AIS_PlaneTrihedron.cxx
@ -132,10 +81,6 @@ AIS_Point.cxx
AIS_Point.hxx AIS_Point.hxx
AIS_PointCloud.cxx AIS_PointCloud.cxx
AIS_PointCloud.hxx AIS_PointCloud.hxx
AIS_RadiusDimension.cxx
AIS_RadiusDimension.hxx
AIS_Relation.cxx
AIS_Relation.hxx
AIS_RotationMode.hxx AIS_RotationMode.hxx
AIS_RubberBand.hxx AIS_RubberBand.hxx
AIS_RubberBand.cxx AIS_RubberBand.cxx
@ -143,20 +88,13 @@ AIS_Selection.cxx
AIS_Selection.hxx AIS_Selection.hxx
AIS_SelectStatus.hxx AIS_SelectStatus.hxx
AIS_SelectionModesConcurrency.hxx AIS_SelectionModesConcurrency.hxx
AIS_SequenceOfDimension.hxx
AIS_SequenceOfInteractive.hxx AIS_SequenceOfInteractive.hxx
AIS_Shape.cxx AIS_Shape.cxx
AIS_Shape.hxx AIS_Shape.hxx
AIS_SignatureFilter.cxx AIS_SignatureFilter.cxx
AIS_SignatureFilter.hxx AIS_SignatureFilter.hxx
AIS_StandardDatum.hxx
AIS_StatusOfDetection.hxx AIS_StatusOfDetection.hxx
AIS_StatusOfPick.hxx AIS_StatusOfPick.hxx
AIS_SymmetricRelation.cxx
AIS_SymmetricRelation.hxx
AIS_SymmetricRelation.lxx
AIS_TangentRelation.cxx
AIS_TangentRelation.hxx
AIS_TextLabel.cxx AIS_TextLabel.cxx
AIS_TextLabel.hxx AIS_TextLabel.hxx
AIS_TexturedShape.cxx AIS_TexturedShape.cxx
@ -170,11 +108,8 @@ AIS_TrihedronOwner.hxx
AIS_TrihedronSelectionMode.hxx AIS_TrihedronSelectionMode.hxx
AIS_TypeFilter.cxx AIS_TypeFilter.cxx
AIS_TypeFilter.hxx AIS_TypeFilter.hxx
AIS_TypeOfAngle.hxx
AIS_TypeOfAngleArrowVisibility.hxx
AIS_TypeOfAttribute.hxx AIS_TypeOfAttribute.hxx
AIS_TypeOfAxis.hxx AIS_TypeOfAxis.hxx
AIS_TypeOfDist.hxx
AIS_TypeOfIso.hxx AIS_TypeOfIso.hxx
AIS_TypeOfPlane.hxx AIS_TypeOfPlane.hxx
AIS_ViewController.cxx AIS_ViewController.cxx

View File

@ -1,7 +1,4 @@
// Created on: 1996-12-11 // Copyright (c) 2020 OPEN CASCADE SAS
// Created by: Robert COUBLANC
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
// //
// This file is part of Open CASCADE Technology software library. // This file is part of Open CASCADE Technology software library.
// //
@ -14,13 +11,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef AIS_SequenceOfDimension_HeaderFile #ifndef _AIS_AngleDimension_HeaderFile
#define AIS_SequenceOfDimension_HeaderFile #define _AIS_AngleDimension_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_AngleDimension.hxx>
#include <NCollection_Sequence.hxx>
typedef NCollection_Sequence<Handle(AIS_Relation)> AIS_SequenceOfDimension; Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_AngleDimension AIS_AngleDimension;
#endif // _AIS_AngleDimension_HeaderFile
#endif

View File

@ -0,0 +1,22 @@
// 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 _AIS_Chamf2dDimension_HeaderFile
#define _AIS_Chamf2dDimension_HeaderFile
#include <PrsDim_Chamf2dDimension.hxx>
Standard_DEPRECATED("Alias to moved class")
typedef PrsDim_Chamf2dDimension AIS_Chamf2dDimension;
#endif // _AIS_Chamf2dDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_Chamf3dDimension_HeaderFile
#define _AIS_Chamf3dDimension_HeaderFile
#include <PrsDim_Chamf3dDimension.hxx>
Standard_DEPRECATED("Alias to moved class")
typedef PrsDim_Chamf3dDimension AIS_Chamf3dDimension;
#endif // _AIS_Chamf3dDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_ConcentricRelation_HeaderFile
#define _AIS_ConcentricRelation_HeaderFile
#include <PrsDim_ConcentricRelation.hxx>
Standard_DEPRECATED("Alias to moved class")
typedef PrsDim_ConcentricRelation AIS_ConcentricRelation;
#endif // _AIS_ConcentricRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_DiameterDimension_HeaderFile
#define _AIS_DiameterDimension_HeaderFile
#include <PrsDim_DiameterDimension.hxx>
Standard_DEPRECATED("Alias to moved class")
typedef PrsDim_DiameterDimension AIS_DiameterDimension;
#endif // _AIS_DiameterDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_Dimension_HeaderFile
#define _AIS_Dimension_HeaderFile
#include <PrsDim_Dimension.hxx>
Standard_DEPRECATED("Alias to moved class")
typedef PrsDim_Dimension AIS_Dimension;
#endif // _AIS_Dimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_DimensionOwner_HeaderFile
#define _AIS_DimensionOwner_HeaderFile
#include <PrsDim_DimensionOwner.hxx>
Standard_DEPRECATED("Alias to moved class")
typedef PrsDim_DimensionOwner AIS_DimensionOwner;
#endif // _AIS_DimensionOwner_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_EllipseRadiusDimension_HeaderFile
#define _AIS_EllipseRadiusDimension_HeaderFile
#include <PrsDim_EllipseRadiusDimension.hxx>
Standard_DEPRECATED("Alias to moved class")
typedef PrsDim_EllipseRadiusDimension AIS_EllipseRadiusDimension;
#endif // _AIS_EllipseRadiusDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_EqualDistanceRelation_HeaderFile
#define _AIS_EqualDistanceRelation_HeaderFile
#include <PrsDim_EqualDistanceRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_EqualDistanceRelation AIS_EqualDistanceRelation;
#endif // _AIS_EqualDistanceRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_EqualRadiusRelation_HeaderFile
#define _AIS_EqualRadiusRelation_HeaderFile
#include <PrsDim_EqualRadiusRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_EqualRadiusRelation AIS_EqualRadiusRelation;
#endif // _AIS_EqualRadiusRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_FixRelation_HeaderFile
#define _AIS_FixRelation_HeaderFile
#include <PrsDim_FixRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_FixRelation AIS_FixRelation;
#endif // _AIS_FixRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_IdenticRelation_HeaderFile
#define _AIS_IdenticRelation_HeaderFile
#include <PrsDim_IdenticRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_IdenticRelation AIS_IdenticRelation;
#endif // _AIS_IdenticRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_LengthDimension_HeaderFile
#define _AIS_LengthDimension_HeaderFile
#include <PrsDim_LengthDimension.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_LengthDimension AIS_LengthDimension;
#endif // _AIS_LengthDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_MaxRadiusDimension_HeaderFile
#define _AIS_MaxRadiusDimension_HeaderFile
#include <PrsDim_MaxRadiusDimension.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_MaxRadiusDimension AIS_MaxRadiusDimension;
#endif // _AIS_MaxRadiusDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_MidPointRelation_HeaderFile
#define _AIS_MidPointRelation_HeaderFile
#include <PrsDim_MidPointRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_MidPointRelation AIS_MidPointRelation;
#endif // _AIS_MidPointRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_MinRadiusDimension_HeaderFile
#define _AIS_MinRadiusDimension_HeaderFile
#include <PrsDim_MinRadiusDimension.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_MinRadiusDimension AIS_MinRadiusDimension;
#endif // _AIS_MinRadiusDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_OffsetDimension_HeaderFile
#define _AIS_OffsetDimension_HeaderFile
#include <PrsDim_OffsetDimension.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_OffsetDimension AIS_OffsetDimension;
#endif // _AIS_OffsetDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_ParallelRelation_HeaderFile
#define _AIS_ParallelRelation_HeaderFile
#include <PrsDim_ParallelRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_ParallelRelation AIS_ParallelRelation;
#endif // _AIS_ParallelRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_PerpendicularRelation_HeaderFile
#define _AIS_PerpendicularRelation_HeaderFile
#include <PrsDim_PerpendicularRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_PerpendicularRelation AIS_PerpendicularRelation;
#endif // _AIS_PerpendicularRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_RadiusDimension_HeaderFile
#define _AIS_RadiusDimension_HeaderFile
#include <PrsDim_RadiusDimension.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_RadiusDimension AIS_RadiusDimension;
#endif // _AIS_RadiusDimension_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_Relation_HeaderFile
#define _AIS_Relation_HeaderFile
#include <PrsDim_Relation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_Relation AIS_Relation;
#endif // _AIS_Relation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_SymmetricRelation_HeaderFile
#define _AIS_SymmetricRelation_HeaderFile
#include <PrsDim_SymmetricRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_SymmetricRelation AIS_SymmetricRelation;
#endif // _AIS_SymmetricRelation_HeaderFile

View File

@ -0,0 +1,22 @@
// 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 _AIS_TangentRelation_HeaderFile
#define _AIS_TangentRelation_HeaderFile
#include <PrsDim_TangentRelation.hxx>
Standard_DEPRECATED("Deprecated alias to moved class")
typedef PrsDim_TangentRelation AIS_TangentRelation;
#endif // _AIS_TangentRelation_HeaderFile

79
src/PrsDim/FILES Normal file
View File

@ -0,0 +1,79 @@
PrsDim.cxx
PrsDim.hxx
PrsDim_AngleDimension.cxx
PrsDim_AngleDimension.hxx
PrsDim_Chamf2dDimension.cxx
PrsDim_Chamf2dDimension.hxx
PrsDim_Chamf3dDimension.cxx
PrsDim_Chamf3dDimension.hxx
PrsDim_ConcentricRelation.cxx
PrsDim_ConcentricRelation.hxx
PrsDim_DiameterDimension.cxx
PrsDim_DiameterDimension.hxx
PrsDim_Dimension.cxx
PrsDim_Dimension.hxx
PrsDim_DimensionOwner.cxx
PrsDim_DimensionOwner.hxx
PrsDim_EllipseRadiusDimension.cxx
PrsDim_EllipseRadiusDimension.hxx
PrsDim_EqualDistanceRelation.cxx
PrsDim_EqualDistanceRelation.hxx
PrsDim_EqualRadiusRelation.cxx
PrsDim_EqualRadiusRelation.hxx
PrsDim_FixRelation.cxx
PrsDim_FixRelation.hxx
PrsDim_IdenticRelation.cxx
PrsDim_IdenticRelation.hxx
PrsDim_LengthDimension.cxx
PrsDim_LengthDimension.hxx
PrsDim_MaxRadiusDimension.cxx
PrsDim_MaxRadiusDimension.hxx
PrsDim_MidPointRelation.cxx
PrsDim_MidPointRelation.hxx
PrsDim_MinRadiusDimension.cxx
PrsDim_MinRadiusDimension.hxx
PrsDim_OffsetDimension.cxx
PrsDim_OffsetDimension.hxx
PrsDim_ParallelRelation.cxx
PrsDim_ParallelRelation.hxx
PrsDim_PerpendicularRelation.cxx
PrsDim_PerpendicularRelation.hxx
PrsDim_RadiusDimension.cxx
PrsDim_RadiusDimension.hxx
PrsDim_Relation.cxx
PrsDim_Relation.hxx
PrsDim_SymmetricRelation.cxx
PrsDim_SymmetricRelation.hxx
PrsDim_TangentRelation.cxx
PrsDim_TangentRelation.hxx
PrsDim_DimensionSelectionMode.hxx
PrsDim_DisplaySpecialSymbol.hxx
PrsDim_KindOfDimension.hxx
PrsDim_KindOfRelation.hxx
PrsDim_KindOfSurface.hxx
PrsDim_TypeOfAngle.hxx
PrsDim_TypeOfAngleArrowVisibility.hxx
PrsDim_TypeOfDist.hxx
AIS_AngleDimension.hxx
AIS_Chamf2dDimension.hxx
AIS_Chamf3dDimension.hxx
AIS_ConcentricRelation.hxx
AIS_DiameterDimension.hxx
AIS_Dimension.hxx
AIS_DimensionOwner.hxx
AIS_EllipseRadiusDimension.hxx
AIS_EqualDistanceRelation.hxx
AIS_EqualRadiusRelation.hxx
AIS_FixRelation.hxx
AIS_IdenticRelation.hxx
AIS_LengthDimension.hxx
AIS_MaxRadiusDimension.hxx
AIS_MidPointRelation.hxx
AIS_MinRadiusDimension.hxx
AIS_OffsetDimension.hxx
AIS_ParallelRelation.hxx
AIS_PerpendicularRelation.hxx
AIS_RadiusDimension.hxx
AIS_Relation.hxx
AIS_SymmetricRelation.hxx
AIS_TangentRelation.hxx

View File

@ -14,7 +14,7 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <AIS.hxx> #include <PrsDim.hxx>
#include <Adaptor3d_HCurve.hxx> #include <Adaptor3d_HCurve.hxx>
#include <Adaptor3d_HSurface.hxx> #include <Adaptor3d_HSurface.hxx>
@ -86,7 +86,7 @@ const Standard_Real SquareTolerance = Precision::SquareConfusion();
//function : Nearest //function : Nearest
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS::Nearest(const TopoDS_Shape& ashape, const gp_Pnt& apoint) gp_Pnt PrsDim::Nearest(const TopoDS_Shape& ashape, const gp_Pnt& apoint)
{ {
Standard_Real dist2 = RealLast(); Standard_Real dist2 = RealLast();
Standard_Real curdist2; Standard_Real curdist2;
@ -111,7 +111,7 @@ gp_Pnt AIS::Nearest(const TopoDS_Shape& ashape, const gp_Pnt& apoint)
//function : Nearest //function : Nearest
//purpose : For <thePoint> finds the nearest point on <theLine>. //purpose : For <thePoint> finds the nearest point on <theLine>.
//======================================================================= //=======================================================================
gp_Pnt AIS::Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint) gp_Pnt PrsDim::Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint)
{ {
Handle(Geom_Line) aLine = new Geom_Line (theLine); Handle(Geom_Line) aLine = new Geom_Line (theLine);
@ -125,7 +125,7 @@ gp_Pnt AIS::Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint)
// return TRUE if found point is belongs to curve // return TRUE if found point is belongs to curve
// and FALSE otherwise. // and FALSE otherwise.
//======================================================================= //=======================================================================
Standard_Boolean AIS::Nearest (const Handle(Geom_Curve)& theCurve, Standard_Boolean PrsDim::Nearest (const Handle(Geom_Curve)& theCurve,
const gp_Pnt& thePoint, const gp_Pnt& thePoint,
const gp_Pnt& theFirstPoint, const gp_Pnt& theFirstPoint,
const gp_Pnt& theLastPoint, const gp_Pnt& theLastPoint,
@ -135,9 +135,8 @@ Standard_Boolean AIS::Nearest (const Handle(Geom_Curve)& theCurve,
theNearestPoint = theCurve->Value (aPointProj.LowerDistanceParameter()); theNearestPoint = theCurve->Value (aPointProj.LowerDistanceParameter());
Standard_Real aLength = theFirstPoint.Distance (theLastPoint); Standard_Real aLength = theFirstPoint.Distance (theLastPoint);
if (theNearestPoint.Distance (theFirstPoint) > aLength if (theNearestPoint.Distance (theFirstPoint) > aLength
|| theNearestPoint.Distance (theLastPoint) >aLength) || theNearestPoint.Distance (theLastPoint) > aLength)
{ {
return Standard_False; return Standard_False;
} }
@ -149,7 +148,7 @@ Standard_Boolean AIS::Nearest (const Handle(Geom_Curve)& theCurve,
//function : Farest //function : Farest
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS::Farest( const TopoDS_Shape& aShape, const gp_Pnt& aPoint ) gp_Pnt PrsDim::Farest( const TopoDS_Shape& aShape, const gp_Pnt& aPoint )
{ {
Standard_Real MaxDist2 = 0.0e0, curdist2; Standard_Real MaxDist2 = 0.0e0, curdist2;
gp_Pnt Result(0.0,0.0,0.0); gp_Pnt Result(0.0,0.0,0.0);
@ -173,7 +172,7 @@ gp_Pnt AIS::Farest( const TopoDS_Shape& aShape, const gp_Pnt& aPoint )
//function : ComputeGeometry //function : ComputeGeometry
//purpose : for line, circle, ellipse. //purpose : for line, circle, ellipse.
//======================================================================= //=======================================================================
Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge, Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theEdge,
Handle(Geom_Curve)& theCurve, Handle(Geom_Curve)& theCurve,
gp_Pnt& theFirstPnt, gp_Pnt& theFirstPnt,
gp_Pnt& theLastPnt) gp_Pnt& theLastPnt)
@ -228,7 +227,7 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
//function : ComputeGeometry //function : ComputeGeometry
//purpose : for line, circle, ellipse. //purpose : for line, circle, ellipse.
//======================================================================= //=======================================================================
Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge, Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theEdge,
Handle(Geom_Curve)& theCurve, Handle(Geom_Curve)& theCurve,
gp_Pnt& theFirstPnt, gp_Pnt& theFirstPnt,
gp_Pnt& theLastPnt, gp_Pnt& theLastPnt,
@ -275,7 +274,7 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge, Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theEdge,
Handle(Geom_Curve)& theCurve, Handle(Geom_Curve)& theCurve,
gp_Pnt& theFirstPnt, gp_Pnt& theFirstPnt,
gp_Pnt& theLastPnt, gp_Pnt& theLastPnt,
@ -371,7 +370,7 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge,
//function : ComputeGeometry //function : ComputeGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge, Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
const TopoDS_Edge& theSecondEdge, const TopoDS_Edge& theSecondEdge,
Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theFirstCurve,
Handle(Geom_Curve)& theSecondCurve, Handle(Geom_Curve)& theSecondCurve,
@ -479,7 +478,7 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
//function : ComputeGeometry //function : ComputeGeometry
//purpose : Computes the geometry of the 2 edges. //purpose : Computes the geometry of the 2 edges.
//======================================================================= //=======================================================================
Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge, Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
const TopoDS_Edge& theSecondEdge, const TopoDS_Edge& theSecondEdge,
Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theFirstCurve,
Handle(Geom_Curve)& theSecondCurve, Handle(Geom_Curve)& theSecondCurve,
@ -492,12 +491,12 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
{ {
theIsInfinite1 = theIsInfinite2 = Standard_False; theIsInfinite1 = theIsInfinite2 = Standard_False;
if (!AIS::ComputeGeometry (theFirstEdge, theFirstCurve,theFirstPnt1, theLastPnt1, theIsInfinite1)) if (!PrsDim::ComputeGeometry (theFirstEdge, theFirstCurve,theFirstPnt1, theLastPnt1, theIsInfinite1))
{ {
return Standard_False; return Standard_False;
} }
if (!AIS::ComputeGeometry (theSecondEdge, theSecondCurve,theFirstPnt2, theLastPnt2, theIsInfinite2)) if (!PrsDim::ComputeGeometry (theSecondEdge, theSecondCurve,theFirstPnt2, theLastPnt2, theIsInfinite2))
{ {
return Standard_False; return Standard_False;
} }
@ -563,7 +562,7 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
// if none of the two edges is in the current wp , // if none of the two edges is in the current wp ,
// it returns Standard_False // it returns Standard_False
//======================================================================= //=======================================================================
Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge, Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
const TopoDS_Edge& theSecondEdge, const TopoDS_Edge& theSecondEdge,
Standard_Integer& theExtIndex, Standard_Integer& theExtIndex,
Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theFirstCurve,
@ -692,7 +691,7 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge,
// and returns aCurveproj; // and returns aCurveproj;
// Return TRUE if ok // Return TRUE if ok
//======================================================================= //=======================================================================
Standard_Boolean AIS::ComputeGeomCurve (Handle(Geom_Curve)& aCurve, Standard_Boolean PrsDim::ComputeGeomCurve (Handle(Geom_Curve)& aCurve,
const Standard_Real first1, const Standard_Real first1,
const Standard_Real last1, const Standard_Real last1,
gp_Pnt& FirstPnt1, gp_Pnt& FirstPnt1,
@ -740,8 +739,8 @@ Standard_Boolean AIS::ComputeGeomCurve (Handle(Geom_Curve)& aCurve,
} }
if (! Precision::IsInfinite(first1) && ! Precision::IsInfinite(last1)) if (! Precision::IsInfinite(first1) && ! Precision::IsInfinite(last1))
{ {
FirstPnt1 = AIS::ProjectPointOnPlane( FirstPnt1, aPlane->Pln() ); FirstPnt1 = PrsDim::ProjectPointOnPlane( FirstPnt1, aPlane->Pln() );
LastPnt1 = AIS::ProjectPointOnPlane( LastPnt1, aPlane->Pln() ); LastPnt1 = PrsDim::ProjectPointOnPlane( LastPnt1, aPlane->Pln() );
} }
} }
return Standard_True; return Standard_True;
@ -754,7 +753,7 @@ Standard_Boolean AIS::ComputeGeomCurve (Handle(Geom_Curve)& aCurve,
// <isOnPlane>, <isOnPlane> = true. // <isOnPlane>, <isOnPlane> = true.
// <point> is the projected vertex in the plane. // <point> is the projected vertex in the plane.
//======================================================================= //=======================================================================
Standard_Boolean AIS::ComputeGeometry(const TopoDS_Vertex& aVertex, Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Vertex& aVertex,
gp_Pnt& point, gp_Pnt& point,
const Handle(Geom_Plane)& aPlane, const Handle(Geom_Plane)& aPlane,
Standard_Boolean& isOnPlane) Standard_Boolean& isOnPlane)
@ -762,7 +761,7 @@ Standard_Boolean AIS::ComputeGeometry(const TopoDS_Vertex& aVertex,
point = BRep_Tool::Pnt(aVertex); point = BRep_Tool::Pnt(aVertex);
isOnPlane = aPlane->Pln().Contains(point, Precision::Confusion()); isOnPlane = aPlane->Pln().Contains(point, Precision::Confusion());
if ( !isOnPlane) { if ( !isOnPlane) {
point = AIS::ProjectPointOnPlane( point, aPlane->Pln() ); point = PrsDim::ProjectPointOnPlane( point, aPlane->Pln() );
} }
return Standard_True; return Standard_True;
} }
@ -772,11 +771,11 @@ Standard_Boolean AIS::ComputeGeometry(const TopoDS_Vertex& aVertex,
//purpose : //purpose :
// Returns type of surface which can be Plane or OtherSurface // Returns type of surface which can be Plane or OtherSurface
//======================================================================= //=======================================================================
Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace, Standard_Boolean PrsDim::GetPlaneFromFace (const TopoDS_Face& aFace,
gp_Pln & aPlane, gp_Pln& aPlane,
Handle( Geom_Surface )& aSurf, Handle(Geom_Surface)& aSurf,
AIS_KindOfSurface & aSurfType, PrsDim_KindOfSurface& aSurfType,
Standard_Real & Offset) Standard_Real& Offset)
{ {
Standard_Boolean Result = Standard_False; Standard_Boolean Result = Standard_False;
@ -801,10 +800,9 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
if (surf2->GetType() == GeomAbs_Plane) if (surf2->GetType() == GeomAbs_Plane)
{ {
aPlane = surf2->Plane(); aPlane = surf2->Plane();
aSurfType = AIS_KOS_Plane; aSurfType = PrsDim_KOS_Plane;
Result = Standard_True; Result = Standard_True;
} }
else if (surf2->GetType() == GeomAbs_SurfaceOfExtrusion) else if (surf2->GetType() == GeomAbs_SurfaceOfExtrusion)
{ {
Handle( Adaptor3d_HCurve ) BasisCurve = surf2->BasisCurve(); Handle( Adaptor3d_HCurve ) BasisCurve = surf2->BasisCurve();
@ -816,7 +814,7 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
gp_Pnt LinePos = BasisLine.Location(); gp_Pnt LinePos = BasisLine.Location();
gp_Pln thePlane( LinePos, LineDir ^ ExtrusionDir); gp_Pln thePlane( LinePos, LineDir ^ ExtrusionDir);
aPlane = thePlane; aPlane = thePlane;
aSurfType = AIS_KOS_Plane; aSurfType = PrsDim_KOS_Plane;
Result = Standard_True; Result = Standard_True;
} }
} }
@ -836,29 +834,29 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
TheType == STANDARD_TYPE(Geom_SphericalSurface) || TheType == STANDARD_TYPE(Geom_SphericalSurface) ||
TheType == STANDARD_TYPE(Geom_ToroidalSurface)) TheType == STANDARD_TYPE(Geom_ToroidalSurface))
{ {
aSurf = (Handle( Geom_OffsetSurface )::DownCast( aSurf ))->Surface(); aSurf = Handle(Geom_OffsetSurface)::DownCast(aSurf)->Surface();
} }
else else
{ {
Offset = (Handle( Geom_OffsetSurface )::DownCast( aSurf ))->Offset(); Offset = Handle(Geom_OffsetSurface)::DownCast(aSurf)->Offset();
aSurf = (Handle( Geom_OffsetSurface )::DownCast( aSurf ))->BasisSurface(); aSurf = Handle(Geom_OffsetSurface)::DownCast(aSurf)->BasisSurface();
} }
} }
Handle( Standard_Type ) TheType = aSurf->DynamicType(); Handle( Standard_Type ) TheType = aSurf->DynamicType();
if (TheType == STANDARD_TYPE(Geom_CylindricalSurface)) if (TheType == STANDARD_TYPE(Geom_CylindricalSurface))
aSurfType = AIS_KOS_Cylinder; aSurfType = PrsDim_KOS_Cylinder;
else if (TheType == STANDARD_TYPE(Geom_ConicalSurface)) else if (TheType == STANDARD_TYPE(Geom_ConicalSurface))
aSurfType = AIS_KOS_Cone; aSurfType = PrsDim_KOS_Cone;
else if (TheType == STANDARD_TYPE(Geom_SphericalSurface)) else if (TheType == STANDARD_TYPE(Geom_SphericalSurface))
aSurfType = AIS_KOS_Sphere; aSurfType = PrsDim_KOS_Sphere;
else if (TheType == STANDARD_TYPE(Geom_ToroidalSurface)) else if (TheType == STANDARD_TYPE(Geom_ToroidalSurface))
aSurfType = AIS_KOS_Torus; aSurfType = PrsDim_KOS_Torus;
else if (TheType == STANDARD_TYPE(Geom_SurfaceOfRevolution)) else if (TheType == STANDARD_TYPE(Geom_SurfaceOfRevolution))
aSurfType = AIS_KOS_Revolution; aSurfType = PrsDim_KOS_Revolution;
else if (TheType == STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion)) else if (TheType == STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))
aSurfType = AIS_KOS_Extrusion; aSurfType = PrsDim_KOS_Extrusion;
else else
aSurfType = AIS_KOS_OtherSurface; aSurfType = PrsDim_KOS_OtherSurface;
} }
return Result; return Result;
} }
@ -869,7 +867,7 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace,
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS::ProjectPointOnPlane( const gp_Pnt & aPoint, const gp_Pln & aPlane ) gp_Pnt PrsDim::ProjectPointOnPlane( const gp_Pnt & aPoint, const gp_Pln & aPlane )
{ {
gp_Vec aVec( aPlane.Location(), aPoint ); gp_Vec aVec( aPlane.Location(), aPoint );
gp_Vec Normal = aPlane.Axis().Direction(); gp_Vec Normal = aPlane.Axis().Direction();
@ -883,7 +881,7 @@ gp_Pnt AIS::ProjectPointOnPlane( const gp_Pnt & aPoint, const gp_Pln & aPlane )
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS::ProjectPointOnLine( const gp_Pnt & aPoint, const gp_Lin & aLine ) gp_Pnt PrsDim::ProjectPointOnLine( const gp_Pnt & aPoint, const gp_Lin & aLine )
{ {
gp_XYZ LinLoc = aLine.Location().XYZ(); gp_XYZ LinLoc = aLine.Location().XYZ();
gp_XYZ LinDir = aLine.Direction().XYZ(); gp_XYZ LinDir = aLine.Direction().XYZ();
@ -896,13 +894,13 @@ gp_Pnt AIS::ProjectPointOnLine( const gp_Pnt & aPoint, const gp_Lin & aLine )
//function : InitFaceLength //function : InitFaceLength
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS::InitFaceLength (const TopoDS_Face& theFace, void PrsDim::InitFaceLength (const TopoDS_Face& theFace,
gp_Pln& thePlane, gp_Pln& thePlane,
Handle(Geom_Surface)& theSurface, Handle(Geom_Surface)& theSurface,
AIS_KindOfSurface& theSurfaceType, PrsDim_KindOfSurface& theSurfaceType,
Standard_Real& theOffset) Standard_Real& theOffset)
{ {
if (AIS::GetPlaneFromFace (theFace, thePlane, theSurface, theSurfaceType, theOffset) if (PrsDim::GetPlaneFromFace (theFace, thePlane, theSurface, theSurfaceType, theOffset)
&& Abs (theOffset) > Precision::Confusion()) && Abs (theOffset) > Precision::Confusion())
{ {
theSurface = new Geom_OffsetSurface (theSurface, theOffset); theSurface = new Geom_OffsetSurface (theSurface, theOffset);
@ -914,11 +912,11 @@ void AIS::InitFaceLength (const TopoDS_Face& theFace,
//function : InitAngleBetweenPlanarFaces //function : InitAngleBetweenPlanarFaces
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS::InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirstFace, Standard_Boolean PrsDim::InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace, const TopoDS_Face& theSecondFace,
gp_Pnt & theCenter, gp_Pnt& theCenter,
gp_Pnt & theFirstAttach, gp_Pnt& theFirstAttach,
gp_Pnt & theSecondAttach, gp_Pnt& theSecondAttach,
const Standard_Boolean theIsFirstPointSet) const Standard_Boolean theIsFirstPointSet)
{ {
Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (BRep_Tool::Surface (theFirstFace)); Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (BRep_Tool::Surface (theFirstFace));
@ -998,10 +996,10 @@ Standard_Boolean AIS::InitAngleBetweenPlanarFaces (const TopoDS_Face& t
//function : InitAngleBetweenCurvilinearFaces //function : InitAngleBetweenCurvilinearFaces
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, Standard_Boolean PrsDim::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace, const TopoDS_Face& theSecondFace,
const AIS_KindOfSurface theFirstSurfType, const PrsDim_KindOfSurface theFirstSurfType,
const AIS_KindOfSurface theSecondSurfType, const PrsDim_KindOfSurface theSecondSurfType,
gp_Pnt& theCenter, gp_Pnt& theCenter,
gp_Pnt& theFirstAttach, gp_Pnt& theFirstAttach,
gp_Pnt& theSecondAttach, gp_Pnt& theSecondAttach,
@ -1048,7 +1046,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face&
aFirstLine = Handle(Geom_Line)::DownCast (aFirstSurf->UIso (aFirstU)); aFirstLine = Handle(Geom_Line)::DownCast (aFirstSurf->UIso (aFirstU));
if (theSecondSurfType == AIS_KOS_Cylinder) if (theSecondSurfType == PrsDim_KOS_Cylinder)
{ {
Handle(Geom_CylindricalSurface) aCylinder = Handle(Geom_CylindricalSurface)::DownCast (aSecondSurf); Handle(Geom_CylindricalSurface) aCylinder = Handle(Geom_CylindricalSurface)::DownCast (aSecondSurf);
@ -1059,7 +1057,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face&
aSecondLine = Handle(Geom_Line)::DownCast (aCylinder->UIso (aSecondU)); aSecondLine = Handle(Geom_Line)::DownCast (aCylinder->UIso (aSecondU));
} }
else if (theSecondSurfType == AIS_KOS_Cone) else if (theSecondSurfType == PrsDim_KOS_Cone)
{ {
Handle(Geom_ConicalSurface) aCone = Handle(Geom_ConicalSurface)::DownCast (aSecondSurf); Handle(Geom_ConicalSurface) aCone = Handle(Geom_ConicalSurface)::DownCast (aSecondSurf);
@ -1100,7 +1098,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face&
// theFirstAttach should be on theFirstSurf. // theFirstAttach should be on theFirstSurf.
Standard_Real anU, aV; Standard_Real anU, aV;
if (theFirstSurfType == AIS_KOS_Cylinder) if (theFirstSurfType == PrsDim_KOS_Cylinder)
{ {
ElSLib::Parameters ((Handle(Geom_CylindricalSurface)::DownCast (aFirstSurf))->Cylinder(), ElSLib::Parameters ((Handle(Geom_CylindricalSurface)::DownCast (aFirstSurf))->Cylinder(),
theFirstAttach, anU, aV); theFirstAttach, anU, aV);
@ -1108,7 +1106,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face&
theFirstAttach = ElSLib::Value (aFirstU, aV, theFirstAttach = ElSLib::Value (aFirstU, aV,
(Handle( Geom_CylindricalSurface )::DownCast (aFirstSurf))->Cylinder() ); (Handle( Geom_CylindricalSurface )::DownCast (aFirstSurf))->Cylinder() );
} }
else if (theFirstSurfType == AIS_KOS_Cone) else if (theFirstSurfType == PrsDim_KOS_Cone)
{ {
ElSLib::Parameters ((Handle(Geom_ConicalSurface)::DownCast (aFirstSurf))->Cone(), ElSLib::Parameters ((Handle(Geom_ConicalSurface)::DownCast (aFirstSurf))->Cone(),
theFirstAttach, anU, aV); theFirstAttach, anU, aV);
@ -1144,7 +1142,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face&
//function : ComputeLengthBetweenCurvilinearFaces //function : ComputeLengthBetweenCurvilinearFaces
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS::InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, void PrsDim::InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace, const TopoDS_Face& theSecondFace,
Handle(Geom_Surface)& theFirstSurf, Handle(Geom_Surface)& theFirstSurf,
Handle(Geom_Surface)& theSecondSurf, Handle(Geom_Surface)& theSecondSurf,
@ -1168,7 +1166,7 @@ void AIS::InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace,
if (aD1U.SquareMagnitude() <= SquareTolerance || aD1V.SquareMagnitude() <= SquareTolerance) if (aD1U.SquareMagnitude() <= SquareTolerance || aD1V.SquareMagnitude() <= SquareTolerance)
{ {
theFirstAttach = AIS::Farest (theFirstFace, theFirstAttach); theFirstAttach = PrsDim::Farest (theFirstFace, theFirstAttach);
aProjector.Init (theFirstAttach, theFirstSurf); aProjector.Init (theFirstAttach, theFirstSurf);
aProjector.LowerDistanceParameters (aPU, aPV); aProjector.LowerDistanceParameters (aPU, aPV);
theFirstSurf->D1 (aPU, aPV, theFirstAttach, aD1U, aD1V); theFirstSurf->D1 (aPU, aPV, theFirstAttach, aD1U, aD1V);
@ -1221,12 +1219,12 @@ void AIS::InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace,
if (aState == TopAbs_OUT || aState == TopAbs_UNKNOWN) if (aState == TopAbs_OUT || aState == TopAbs_UNKNOWN)
{ {
theSecondAttach = AIS::Nearest (theSecondFace, theSecondAttach); theSecondAttach = PrsDim::Nearest (theSecondFace, theSecondAttach);
} }
} }
} }
gp_Pnt AIS::TranslatePointToBound( const gp_Pnt & aPoint, const gp_Dir & aDir, const Bnd_Box & aBndBox ) gp_Pnt PrsDim::TranslatePointToBound( const gp_Pnt & aPoint, const gp_Dir & aDir, const Bnd_Box & aBndBox )
{ {
if (aBndBox.IsOut( aPoint )) if (aBndBox.IsOut( aPoint ))
return aPoint; return aPoint;
@ -1274,7 +1272,7 @@ gp_Pnt AIS::TranslatePointToBound( const gp_Pnt & aPoint, const gp_Dir & aDir, c
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS::InDomain(const Standard_Real fpar, Standard_Boolean PrsDim::InDomain(const Standard_Real fpar,
const Standard_Real lpar, const Standard_Real lpar,
const Standard_Real para) const Standard_Real para)
{ {
@ -1303,7 +1301,7 @@ Standard_Boolean AIS::InDomain(const Standard_Real fpar,
//purpose : calculates parametric length arc of ellipse //purpose : calculates parametric length arc of ellipse
//======================================================================= //=======================================================================
Standard_Real AIS::DistanceFromApex(const gp_Elips & elips, Standard_Real PrsDim::DistanceFromApex(const gp_Elips & elips,
const gp_Pnt & Apex, const gp_Pnt & Apex,
const Standard_Real par) const Standard_Real par)
{ {
@ -1351,7 +1349,7 @@ Standard_Real AIS::DistanceFromApex(const gp_Elips & elips,
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS::NearestApex(const gp_Elips & elips, gp_Pnt PrsDim::NearestApex(const gp_Elips & elips,
const gp_Pnt & pApex, const gp_Pnt & pApex,
const gp_Pnt & nApex, const gp_Pnt & nApex,
const Standard_Real fpara, const Standard_Real fpara,
@ -1387,7 +1385,7 @@ gp_Pnt AIS::NearestApex(const gp_Elips & elips,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresentation, void PrsDim::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresentation,
const Handle(Prs3d_Drawer)& aDrawer, const Handle(Prs3d_Drawer)& aDrawer,
const TopoDS_Edge& anEdge, const TopoDS_Edge& anEdge,
const Handle(Geom_Curve)& ProjCurve, const Handle(Geom_Curve)& ProjCurve,
@ -1490,7 +1488,7 @@ void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresen
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS::ComputeProjVertexPresentation (const Handle( Prs3d_Presentation )& aPresentation, void PrsDim::ComputeProjVertexPresentation (const Handle( Prs3d_Presentation )& aPresentation,
const Handle( Prs3d_Drawer )& aDrawer, const Handle( Prs3d_Drawer )& aDrawer,
const TopoDS_Vertex& aVertex, const TopoDS_Vertex& aVertex,
const gp_Pnt& ProjPoint, const gp_Pnt& ProjPoint,

159
src/PrsDim/PrsDim.hxx Normal file
View File

@ -0,0 +1,159 @@
// Created on: 1996-12-11
// Created by: Robert COUBLANC
// Copyright (c) 1996-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 _PrsDim_HeaderFile
#define _PrsDim_HeaderFile
#include <PrsDim_KindOfSurface.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class Bnd_Box;
class Geom_Curve;
class Geom_Plane;
class Geom_Surface;
class TopoDS_Edge;
class TopoDS_Face;
class TopoDS_Shape;
class TopoDS_Vertex;
//! Auxiliary methods for computing dimensions.
class PrsDim
{
public:
DEFINE_STANDARD_ALLOC
//! Returns the nearest point in a shape. This is used by
//! several classes in calculation of dimensions.
Standard_EXPORT static gp_Pnt Nearest (const TopoDS_Shape& aShape, const gp_Pnt& aPoint);
//! @return the nearest point on the line.
Standard_EXPORT static gp_Pnt Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint);
//! For the given point finds nearest point on the curve,
//! @return TRUE if found point is belongs to the curve
//! and FALSE otherwise.
Standard_EXPORT static Standard_Boolean Nearest (const Handle(Geom_Curve)& theCurve, const gp_Pnt& thePoint, const gp_Pnt& theFirstPoint, const gp_Pnt& theLastPoint, gp_Pnt& theNearestPoint);
Standard_EXPORT static gp_Pnt Farest (const TopoDS_Shape& aShape, const gp_Pnt& aPoint);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt);
//! Used by dimensions only.
//! Computes the 3d geometry of <anEdge>.
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt, Standard_Boolean& theIsInfinite);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any.
//! If <aCurve> is not in the current plane, <extCurve> contains
//! the not projected curve associated to <anEdge>.
//! If <anEdge> is infinite, <isinfinite> = true and the 2
//! parameters <FirstPnt> and <LastPnt> have no signification.
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theEdge, Handle(Geom_Curve)& theCurve, gp_Pnt& theFirstPnt, gp_Pnt& theLastPnt, Handle(Geom_Curve)& theExtCurve, Standard_Boolean& theIsInfinite, Standard_Boolean& theIsOnPlane, const Handle(Geom_Plane)& thePlane);
//! Used by 2d Relation only
//! Computes the 3d geometry of <anEdge> in the current WorkingPlane
//! and the extremities if any
//! Return TRUE if ok.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, const Handle(Geom_Plane)& thePlane);
//! Used by dimensions only.Computes the 3d geometry
//! of<anEdge1> and <anEdge2> and checks if they are infinite.
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, Standard_Boolean& theIsinfinite1, Standard_Boolean& theIsinfinite2);
//! Used by 2d Relation only Computes the 3d geometry
//! of<anEdge1> and <anEdge2> in the current Plane and the
//! extremities if any. Return in ExtCurve the 3d curve
//! (not projected in the plane) of the first edge if
//! <indexExt> =1 or of the 2nd edge if <indexExt> = 2. If
//! <indexExt> = 0, ExtCurve is Null. if there is an edge
//! external to the plane, <isinfinite> is true if this
//! edge is infinite. So, the extremities of it are not
//! significant. Return TRUE if ok
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Edge& theFirstEdge, const TopoDS_Edge& theSecondEdge, Standard_Integer& theExtIndex, Handle(Geom_Curve)& theFirstCurve, Handle(Geom_Curve)& theSecondCurve, gp_Pnt& theFirstPnt1, gp_Pnt& theLastPnt1, gp_Pnt& theFirstPnt2, gp_Pnt& theLastPnt2, Handle(Geom_Curve)& theExtCurve, Standard_Boolean& theIsinfinite1, Standard_Boolean& theIsinfinite2, const Handle(Geom_Plane)& thePlane);
//! Checks if aCurve belongs to aPlane; if not, projects aCurve in aPlane
//! and returns aCurve;
//! Return TRUE if ok
Standard_EXPORT static Standard_Boolean ComputeGeomCurve (Handle(Geom_Curve)& aCurve, const Standard_Real first1, const Standard_Real last1, gp_Pnt& FirstPnt1, gp_Pnt& LastPnt1, const Handle(Geom_Plane)& aPlane, Standard_Boolean& isOnPlane);
Standard_EXPORT static Standard_Boolean ComputeGeometry (const TopoDS_Vertex& aVertex, gp_Pnt& point, const Handle(Geom_Plane)& aPlane, Standard_Boolean& isOnPlane);
//! Tryes to get Plane from Face. Returns Surface of Face
//! in aSurf. Returns Standard_True and Plane of Face in
//! aPlane in following cases:
//! Face is Plane, Offset of Plane,
//! Extrusion of Line and Offset of Extrusion of Line
//! Returns pure type of Surface which can be:
//! Plane, Cylinder, Cone, Sphere, Torus,
//! SurfaceOfRevolution, SurfaceOfExtrusion
Standard_EXPORT static Standard_Boolean GetPlaneFromFace (const TopoDS_Face& aFace, gp_Pln& aPlane, Handle(Geom_Surface)& aSurf, PrsDim_KindOfSurface& aSurfType, Standard_Real& Offset);
Standard_EXPORT static void InitFaceLength (const TopoDS_Face& aFace, gp_Pln& aPlane, Handle(Geom_Surface)& aSurface, PrsDim_KindOfSurface& aSurfaceType, Standard_Real& anOffset);
//! Finds attachment points on two curvilinear faces for length dimension.
//! @param thePlaneDir [in] the direction on the dimension plane to
//! compute the plane automatically. It will not be taken into account if
//! plane is defined by user.
Standard_EXPORT static void InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, Handle(Geom_Surface)& theFirstSurf, Handle(Geom_Surface)& theSecondSurf, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, gp_Dir& theDirOnPlane);
//! Finds three points for the angle dimension between
//! two planes.
Standard_EXPORT static Standard_Boolean InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, gp_Pnt& theCenter, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, const Standard_Boolean theIsFirstPointSet = Standard_False);
//! Finds three points for the angle dimension between
//! two curvilinear surfaces.
Standard_EXPORT static Standard_Boolean InitAngleBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, const TopoDS_Face& theSecondFace, const PrsDim_KindOfSurface theFirstSurfType, const PrsDim_KindOfSurface theSecondSurfType, gp_Pnt& theCenter, gp_Pnt& theFirstAttach, gp_Pnt& theSecondAttach, const Standard_Boolean theIsFirstPointSet = Standard_False);
Standard_EXPORT static gp_Pnt ProjectPointOnPlane (const gp_Pnt& aPoint, const gp_Pln& aPlane);
Standard_EXPORT static gp_Pnt ProjectPointOnLine (const gp_Pnt& aPoint, const gp_Lin& aLine);
Standard_EXPORT static gp_Pnt TranslatePointToBound (const gp_Pnt& aPoint, const gp_Dir& aDir, const Bnd_Box& aBndBox);
//! returns True if point with anAttachPar is
//! in domain of arc
Standard_EXPORT static Standard_Boolean InDomain (const Standard_Real aFirstPar, const Standard_Real aLastPar, const Standard_Real anAttachPar);
//! computes nearest to ellipse arc apex
Standard_EXPORT static gp_Pnt NearestApex (const gp_Elips& elips, const gp_Pnt& pApex, const gp_Pnt& nApex, const Standard_Real fpara, const Standard_Real lpara, Standard_Boolean& IsInDomain);
//! computes length of ellipse arc in parametric units
Standard_EXPORT static Standard_Real DistanceFromApex (const gp_Elips& elips, const gp_Pnt& Apex, const Standard_Real par);
Standard_EXPORT static void ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPres, const Handle(Prs3d_Drawer)& aDrawer, const TopoDS_Edge& anEdge, const Handle(Geom_Curve)& ProjCurve, const gp_Pnt& FirstP, const gp_Pnt& LastP, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfLine aProjTOL = Aspect_TOL_DASH, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
Standard_EXPORT static void ComputeProjVertexPresentation (const Handle(Prs3d_Presentation)& aPres, const Handle(Prs3d_Drawer)& aDrawer, const TopoDS_Vertex& aVertex, const gp_Pnt& ProjPoint, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfMarker aProjTOM = Aspect_TOM_PLUS, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT);
};
#endif // _PrsDim_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <AIS_AngleDimension.hxx> #include <PrsDim_AngleDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <BRepBuilderAPI_MakeFace.hxx> #include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
@ -52,8 +52,7 @@
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
IMPLEMENT_STANDARD_RTTIEXT(PrsDim_AngleDimension, PrsDim_Dimension)
IMPLEMENT_STANDARD_RTTIEXT(AIS_AngleDimension,AIS_Dimension)
namespace namespace
{ {
@ -78,9 +77,9 @@ namespace
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Edge& theFirstEdge, PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Edge& theFirstEdge,
const TopoDS_Edge& theSecondEdge) const TopoDS_Edge& theSecondEdge)
: AIS_Dimension (AIS_KOD_PLANEANGLE) : PrsDim_Dimension (PrsDim_KOD_PLANEANGLE)
{ {
Init(); Init();
SetMeasuredGeometry (theFirstEdge, theSecondEdge); SetMeasuredGeometry (theFirstEdge, theSecondEdge);
@ -90,10 +89,10 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Edge& theFirstEdge,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_AngleDimension::AIS_AngleDimension (const gp_Pnt& theFirstPoint, PrsDim_AngleDimension::PrsDim_AngleDimension (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
const gp_Pnt& theThirdPoint) const gp_Pnt& theThirdPoint)
: AIS_Dimension (AIS_KOD_PLANEANGLE) : PrsDim_Dimension (PrsDim_KOD_PLANEANGLE)
{ {
Init(); Init();
SetMeasuredGeometry (theFirstPoint, theSecondPoint, theThirdPoint); SetMeasuredGeometry (theFirstPoint, theSecondPoint, theThirdPoint);
@ -103,10 +102,10 @@ AIS_AngleDimension::AIS_AngleDimension (const gp_Pnt& theFirstPoint,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Vertex& theFirstVertex, PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Vertex& theFirstVertex,
const TopoDS_Vertex& theSecondVertex, const TopoDS_Vertex& theSecondVertex,
const TopoDS_Vertex& theThirdVertex) const TopoDS_Vertex& theThirdVertex)
: AIS_Dimension (AIS_KOD_PLANEANGLE) : PrsDim_Dimension (PrsDim_KOD_PLANEANGLE)
{ {
Init(); Init();
SetMeasuredGeometry (theFirstVertex, theSecondVertex, theThirdVertex); SetMeasuredGeometry (theFirstVertex, theSecondVertex, theThirdVertex);
@ -116,8 +115,8 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Vertex& theFirstVertex,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theCone) PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Face& theCone)
: AIS_Dimension (AIS_KOD_PLANEANGLE) : PrsDim_Dimension (PrsDim_KOD_PLANEANGLE)
{ {
Init(); Init();
SetMeasuredGeometry (theCone); SetMeasuredGeometry (theCone);
@ -127,9 +126,9 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theCone)
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace, PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace) const TopoDS_Face& theSecondFace)
: AIS_Dimension (AIS_KOD_PLANEANGLE) : PrsDim_Dimension (PrsDim_KOD_PLANEANGLE)
{ {
Init(); Init();
SetMeasuredGeometry (theFirstFace, theSecondFace); SetMeasuredGeometry (theFirstFace, theSecondFace);
@ -139,10 +138,10 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace, PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace, const TopoDS_Face& theSecondFace,
const gp_Pnt& thePoint) const gp_Pnt& thePoint)
: AIS_Dimension (AIS_KOD_PLANEANGLE) : PrsDim_Dimension (PrsDim_KOD_PLANEANGLE)
{ {
Init(); Init();
SetMeasuredGeometry (theFirstFace, theSecondFace, thePoint); SetMeasuredGeometry (theFirstFace, theSecondFace, thePoint);
@ -152,7 +151,7 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge, void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge,
const TopoDS_Edge& theSecondEdge) const TopoDS_Edge& theSecondEdge)
{ {
gp_Pln aComputedPlane; gp_Pln aComputedPlane;
@ -175,7 +174,7 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint, void PrsDim_AngleDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
const gp_Pnt& theThirdPoint) const gp_Pnt& theThirdPoint)
{ {
@ -201,7 +200,7 @@ void AIS_AngleDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Vertex& theFirstVertex, void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Vertex& theFirstVertex,
const TopoDS_Vertex& theSecondVertex, const TopoDS_Vertex& theSecondVertex,
const TopoDS_Vertex& theThirdVertex) const TopoDS_Vertex& theThirdVertex)
{ {
@ -227,7 +226,7 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Vertex& theFirstVerte
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone) void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone)
{ {
myFirstShape = theCone; myFirstShape = theCone;
mySecondShape = TopoDS_Shape(); mySecondShape = TopoDS_Shape();
@ -247,7 +246,7 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone)
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace) const TopoDS_Face& theSecondFace)
{ {
myFirstShape = theFirstFace; myFirstShape = theFirstFace;
@ -268,7 +267,7 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace, const TopoDS_Face& theSecondFace,
const gp_Pnt& thePoint) const gp_Pnt& thePoint)
{ {
@ -290,12 +289,12 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
//function : Init //function : Init
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::Init() void PrsDim_AngleDimension::Init()
{ {
SetType (AIS_TOA_Interior); SetType (PrsDim_TypeOfAngle_Interior);
SetArrowsVisibility (AIS_TOAV_Both); SetArrowsVisibility (PrsDim_TypeOfAngleArrowVisibility_Both);
SetSpecialSymbol (THE_DEGREE_SYMBOL); SetSpecialSymbol (THE_DEGREE_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_After); SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_After);
SetFlyout (15.0); SetFlyout (15.0);
} }
@ -303,7 +302,7 @@ void AIS_AngleDimension::Init()
//function: GetCenterOnArc //function: GetCenterOnArc
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach, gp_Pnt PrsDim_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach,
const gp_Pnt& theSecondAttach, const gp_Pnt& theSecondAttach,
const gp_Pnt& theCenter) const const gp_Pnt& theCenter) const
{ {
@ -316,7 +315,7 @@ gp_Pnt AIS_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach,
gp_Pln aPlane = aConstructPlane.Value(); gp_Pln aPlane = aConstructPlane.Value();
// to have an exterior angle presentation, a plane for further constructed circle should be reversed // to have an exterior angle presentation, a plane for further constructed circle should be reversed
if (myType == AIS_TOA_Exterior) if (myType == PrsDim_TypeOfAngle_Exterior)
{ {
gp_Ax1 anAxis = aPlane.Axis(); gp_Ax1 anAxis = aPlane.Axis();
gp_Dir aDir = anAxis.Direction(); gp_Dir aDir = anAxis.Direction();
@ -347,7 +346,7 @@ gp_Pnt AIS_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach,
//function : GetNormalForMinAngle //function : GetNormalForMinAngle
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Dir AIS_AngleDimension::GetNormalForMinAngle() const gp_Dir PrsDim_AngleDimension::GetNormalForMinAngle() const
{ {
const gp_Dir& aNormal = myPlane.Axis().Direction(); const gp_Dir& aNormal = myPlane.Axis().Direction();
gp_Dir aFirst (gp_Vec (myCenterPoint, myFirstPoint) ); gp_Dir aFirst (gp_Vec (myCenterPoint, myFirstPoint) );
@ -362,7 +361,7 @@ gp_Dir AIS_AngleDimension::GetNormalForMinAngle() const
//function : DrawArc //function : DrawArc
//purpose : draws the arc between two attach points //purpose : draws the arc between two attach points
//======================================================================= //=======================================================================
void AIS_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentation, void PrsDim_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentation,
const gp_Pnt& theFirstAttach, const gp_Pnt& theFirstAttach,
const gp_Pnt& theSecondAttach, const gp_Pnt& theSecondAttach,
const gp_Pnt& theCenter, const gp_Pnt& theCenter,
@ -372,7 +371,7 @@ void AIS_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentat
gp_Pln aPlane (myCenterPoint, GetNormalForMinAngle()); gp_Pln aPlane (myCenterPoint, GetNormalForMinAngle());
// to have an exterior angle presentation, a plane for further constructed circle should be reversed // to have an exterior angle presentation, a plane for further constructed circle should be reversed
if (myType == AIS_TOA_Exterior) if (myType == PrsDim_TypeOfAngle_Exterior)
{ {
gp_Ax1 anAxis = aPlane.Axis(); gp_Ax1 anAxis = aPlane.Axis();
gp_Dir aDir = anAxis.Direction(); gp_Dir aDir = anAxis.Direction();
@ -405,7 +404,7 @@ void AIS_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentat
gp_Vec aCenterToFirstVec (theCenter, theFirstAttach); gp_Vec aCenterToFirstVec (theCenter, theFirstAttach);
gp_Vec aCenterToSecondVec (theCenter, theSecondAttach); gp_Vec aCenterToSecondVec (theCenter, theSecondAttach);
Standard_Real anAngle = aCenterToFirstVec.Angle (aCenterToSecondVec); Standard_Real anAngle = aCenterToFirstVec.Angle (aCenterToSecondVec);
if (myType == AIS_TOA_Exterior) if (myType == PrsDim_TypeOfAngle_Exterior)
anAngle = 2.0 * M_PI - anAngle; anAngle = 2.0 * M_PI - anAngle;
// it sets 50 points on PI, and a part of points if angle is less // it sets 50 points on PI, and a part of points if angle is less
const Standard_Integer aNbPoints = Max (4, Standard_Integer (50.0 * anAngle / M_PI)); const Standard_Integer aNbPoints = Max (4, Standard_Integer (50.0 * anAngle / M_PI));
@ -449,7 +448,7 @@ void AIS_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentat
//function: DrawArcWithText //function: DrawArcWithText
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::DrawArcWithText (const Handle(Prs3d_Presentation)& thePresentation, void PrsDim_AngleDimension::DrawArcWithText (const Handle(Prs3d_Presentation)& thePresentation,
const gp_Pnt& theFirstAttach, const gp_Pnt& theFirstAttach,
const gp_Pnt& theSecondAttach, const gp_Pnt& theSecondAttach,
const gp_Pnt& theCenter, const gp_Pnt& theCenter,
@ -532,7 +531,7 @@ void AIS_AngleDimension::DrawArcWithText (const Handle(Prs3d_Presentation)& theP
//function : CheckPlane //function : CheckPlane
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_AngleDimension::CheckPlane (const gp_Pln& thePlane)const Standard_Boolean PrsDim_AngleDimension::CheckPlane (const gp_Pln& thePlane)const
{ {
if (!thePlane.Contains (myFirstPoint, Precision::Confusion()) && if (!thePlane.Contains (myFirstPoint, Precision::Confusion()) &&
!thePlane.Contains (mySecondPoint, Precision::Confusion()) && !thePlane.Contains (mySecondPoint, Precision::Confusion()) &&
@ -548,7 +547,7 @@ Standard_Boolean AIS_AngleDimension::CheckPlane (const gp_Pln& thePlane)const
//function : ComputePlane //function : ComputePlane
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::ComputePlane() void PrsDim_AngleDimension::ComputePlane()
{ {
if (!myIsGeometryValid) if (!myIsGeometryValid)
{ {
@ -570,7 +569,7 @@ void AIS_AngleDimension::ComputePlane()
//function : GetModelUnits //function : GetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_AngleDimension::GetModelUnits() const const TCollection_AsciiString& PrsDim_AngleDimension::GetModelUnits() const
{ {
return myDrawer->DimAngleModelUnits(); return myDrawer->DimAngleModelUnits();
} }
@ -579,7 +578,7 @@ const TCollection_AsciiString& AIS_AngleDimension::GetModelUnits() const
//function : GetDisplayUnits //function : GetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_AngleDimension::GetDisplayUnits() const const TCollection_AsciiString& PrsDim_AngleDimension::GetDisplayUnits() const
{ {
return myDrawer->DimAngleDisplayUnits(); return myDrawer->DimAngleDisplayUnits();
} }
@ -588,7 +587,7 @@ const TCollection_AsciiString& AIS_AngleDimension::GetDisplayUnits() const
//function : SetModelUnits //function : SetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetModelUnits (const TCollection_AsciiString& theUnits) void PrsDim_AngleDimension::SetModelUnits (const TCollection_AsciiString& theUnits)
{ {
myDrawer->SetDimAngleModelUnits (theUnits); myDrawer->SetDimAngleModelUnits (theUnits);
} }
@ -597,7 +596,7 @@ void AIS_AngleDimension::SetModelUnits (const TCollection_AsciiString& theUnits)
//function : SetDisplayUnits //function : SetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) void PrsDim_AngleDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits)
{ {
myDrawer->SetDimAngleDisplayUnits (theUnits); myDrawer->SetDimAngleDisplayUnits (theUnits);
} }
@ -606,7 +605,7 @@ void AIS_AngleDimension::SetDisplayUnits (const TCollection_AsciiString& theUnit
//function : ComputeValue //function : ComputeValue
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real AIS_AngleDimension::ComputeValue() const Standard_Real PrsDim_AngleDimension::ComputeValue() const
{ {
if (!IsValid()) if (!IsValid())
{ {
@ -625,7 +624,7 @@ Standard_Real AIS_AngleDimension::ComputeValue() const
//function : Compute //function : Compute
//purpose : Having three gp_Pnt points compute presentation //purpose : Having three gp_Pnt points compute presentation
//======================================================================= //=======================================================================
void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, void PrsDim_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/,
const Handle(Prs3d_Presentation)& thePresentation, const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode) const Standard_Integer theMode)
{ {
@ -740,8 +739,8 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
if (theMode == ComputeMode_All || theMode == ComputeMode_Line) if (theMode == ComputeMode_All || theMode == ComputeMode_Line)
{ {
DrawArc (thePresentation, DrawArc (thePresentation,
(isArrowsExternal || !isArrowVisible(AIS_TOAV_First)) ? aFirstAttach : aFirstArrowEnd, (isArrowsExternal || !isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First)) ? aFirstAttach : aFirstArrowEnd,
(isArrowsExternal || !isArrowVisible(AIS_TOAV_Second)) ? aSecondAttach : aSecondArrowEnd, (isArrowsExternal || !isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second)) ? aSecondAttach : aSecondArrowEnd,
myCenterPoint, myCenterPoint,
Abs (GetFlyout()), Abs (GetFlyout()),
theMode); theMode);
@ -753,7 +752,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
{ {
DrawExtension (thePresentation, DrawExtension (thePresentation,
anExtensionSize, anExtensionSize,
(isArrowsExternal && isArrowVisible(AIS_TOAV_First)) ? aFirstArrowEnd : aFirstAttach, (isArrowsExternal && isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First)) ? aFirstArrowEnd : aFirstAttach,
aFirstExtensionDir, aFirstExtensionDir,
aLabelString, aLabelString,
aLabelWidth, aLabelWidth,
@ -766,7 +765,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
{ {
DrawExtension (thePresentation, DrawExtension (thePresentation,
anExtensionSize, anExtensionSize,
(isArrowsExternal && isArrowVisible(AIS_TOAV_Second)) ? aSecondArrowEnd : aSecondAttach, (isArrowsExternal && isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second)) ? aSecondArrowEnd : aSecondAttach,
aSecondExtensionDir, aSecondExtensionDir,
aLabelString, aLabelString,
aLabelWidth, aLabelWidth,
@ -782,8 +781,8 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
Prs3d_Root::NewGroup (thePresentation); Prs3d_Root::NewGroup (thePresentation);
DrawArc (thePresentation, DrawArc (thePresentation,
(isArrowsExternal || !isArrowVisible(AIS_TOAV_First)) ? aFirstAttach : aFirstArrowEnd, (isArrowsExternal || !isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First)) ? aFirstAttach : aFirstArrowEnd,
(isArrowsExternal || !isArrowVisible(AIS_TOAV_Second)) ? aSecondAttach : aSecondArrowEnd, (isArrowsExternal || !isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second)) ? aSecondAttach : aSecondArrowEnd,
myCenterPoint, myCenterPoint,
Abs(GetFlyout ()), Abs(GetFlyout ()),
theMode); theMode);
@ -794,9 +793,9 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
{ {
Prs3d_Root::NewGroup (thePresentation); Prs3d_Root::NewGroup (thePresentation);
if (isArrowVisible(AIS_TOAV_First)) if (isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First))
DrawArrow (thePresentation, aFirstArrowBegin, gp_Dir (aFirstArrowVec)); DrawArrow (thePresentation, aFirstArrowBegin, gp_Dir (aFirstArrowVec));
if (isArrowVisible(AIS_TOAV_Second)) if (isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second))
DrawArrow (thePresentation, aSecondArrowBegin, gp_Dir (aSecondArrowVec)); DrawArrow (thePresentation, aSecondArrowBegin, gp_Dir (aSecondArrowVec));
} }
@ -804,7 +803,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
{ {
Prs3d_Root::NewGroup (thePresentation); Prs3d_Root::NewGroup (thePresentation);
if (aHPosition != LabelPosition_Left && isArrowVisible(AIS_TOAV_First)) if (aHPosition != LabelPosition_Left && isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First))
{ {
DrawExtension (thePresentation, DrawExtension (thePresentation,
aDimensionAspect->ArrowTailSize(), aDimensionAspect->ArrowTailSize(),
@ -816,7 +815,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
LabelPosition_None); LabelPosition_None);
} }
if (aHPosition != LabelPosition_Right && isArrowVisible(AIS_TOAV_Second)) if (aHPosition != LabelPosition_Right && isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second))
{ {
DrawExtension (thePresentation, DrawExtension (thePresentation,
aDimensionAspect->ArrowTailSize(), aDimensionAspect->ArrowTailSize(),
@ -852,7 +851,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
//function : ComputeFlyoutSelection //function : ComputeFlyoutSelection
//purpose : computes selection for flyouts //purpose : computes selection for flyouts
//======================================================================= //=======================================================================
void AIS_AngleDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, void PrsDim_AngleDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection,
const Handle(SelectMgr_EntityOwner)& theOwner) const Handle(SelectMgr_EntityOwner)& theOwner)
{ {
gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec (myCenterPoint, myFirstPoint).Normalized() * GetFlyout()); gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec (myCenterPoint, myFirstPoint).Normalized() * GetFlyout());
@ -869,7 +868,7 @@ void AIS_AngleDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selectio
//function : InitTwoEdgesAngle //function : InitTwoEdgesAngle
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPlane) Standard_Boolean PrsDim_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPlane)
{ {
TopoDS_Edge aFirstEdge = TopoDS::Edge (myFirstShape); TopoDS_Edge aFirstEdge = TopoDS::Edge (myFirstShape);
TopoDS_Edge aSecondEdge = TopoDS::Edge (mySecondShape); TopoDS_Edge aSecondEdge = TopoDS::Edge (mySecondShape);
@ -897,7 +896,7 @@ Standard_Boolean AIS_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPlane
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;
gp_Pnt aFirstPoint1, aLastPoint1, aFirstPoint2, aLastPoint2; gp_Pnt aFirstPoint1, aLastPoint1, aFirstPoint2, aLastPoint2;
Handle(Geom_Curve) aFirstCurve = aFirstLine, aSecondCurve = aSecondLine; Handle(Geom_Curve) aFirstCurve = aFirstLine, aSecondCurve = aSecondLine;
if (!AIS::ComputeGeometry (aFirstEdge, aSecondEdge, if (!PrsDim::ComputeGeometry (aFirstEdge, aSecondEdge,
aFirstCurve, aSecondCurve, aFirstCurve, aSecondCurve,
aFirstPoint1, aLastPoint1, aFirstPoint1, aLastPoint1,
aFirstPoint2, aLastPoint2, aFirstPoint2, aLastPoint2,
@ -976,7 +975,7 @@ Standard_Boolean AIS_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPlane
//function : InitTwoFacesAngle //function : InitTwoFacesAngle
//purpose : initialization of angle dimension between two faces //purpose : initialization of angle dimension between two faces
//======================================================================= //=======================================================================
Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle() Standard_Boolean PrsDim_AngleDimension::InitTwoFacesAngle()
{ {
TopoDS_Face aFirstFace = TopoDS::Face (myFirstShape); TopoDS_Face aFirstFace = TopoDS::Face (myFirstShape);
TopoDS_Face aSecondFace = TopoDS::Face (mySecondShape); TopoDS_Face aSecondFace = TopoDS::Face (mySecondShape);
@ -984,42 +983,31 @@ Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle()
gp_Dir aFirstDir, aSecondDir; gp_Dir aFirstDir, aSecondDir;
gp_Pln aFirstPln, aSecondPln; gp_Pln aFirstPln, aSecondPln;
Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf; Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf;
AIS_KindOfSurface aFirstSurfType, aSecondSurfType; PrsDim_KindOfSurface aFirstSurfType, aSecondSurfType;
Standard_Real aFirstOffset, aSecondOffset; Standard_Real aFirstOffset, aSecondOffset;
AIS::GetPlaneFromFace (aFirstFace, aFirstPln, PrsDim::GetPlaneFromFace (aFirstFace, aFirstPln,
aFirstBasisSurf,aFirstSurfType,aFirstOffset); aFirstBasisSurf,aFirstSurfType,aFirstOffset);
AIS::GetPlaneFromFace (aSecondFace, aSecondPln, PrsDim::GetPlaneFromFace (aSecondFace, aSecondPln,
aSecondBasisSurf, aSecondSurfType, aSecondOffset); aSecondBasisSurf, aSecondSurfType, aSecondOffset);
if (aFirstSurfType == AIS_KOS_Plane && aSecondSurfType == AIS_KOS_Plane) if (aFirstSurfType == PrsDim_KOS_Plane && aSecondSurfType == PrsDim_KOS_Plane)
{ {
//Planar faces angle //Planar faces angle
Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (aFirstBasisSurf); Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (aFirstBasisSurf);
Handle(Geom_Plane) aSecondPlane = Handle(Geom_Plane)::DownCast (aSecondBasisSurf); Handle(Geom_Plane) aSecondPlane = Handle(Geom_Plane)::DownCast (aSecondBasisSurf);
return AIS::InitAngleBetweenPlanarFaces (aFirstFace, return PrsDim::InitAngleBetweenPlanarFaces (aFirstFace, aSecondFace,
aSecondFace, myCenterPoint, myFirstPoint, mySecondPoint)
myCenterPoint, && IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
myFirstPoint,
mySecondPoint)
&& IsValidPoints (myFirstPoint,
myCenterPoint,
mySecondPoint);
} }
else else
{ {
// Curvilinear faces angle // Curvilinear faces angle
return AIS::InitAngleBetweenCurvilinearFaces (aFirstFace, return PrsDim::InitAngleBetweenCurvilinearFaces (aFirstFace, aSecondFace,
aSecondFace, aFirstSurfType, aSecondSurfType,
aFirstSurfType, myCenterPoint, myFirstPoint, mySecondPoint)
aSecondSurfType, && IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
myCenterPoint,
myFirstPoint,
mySecondPoint)
&& IsValidPoints (myFirstPoint,
myCenterPoint,
mySecondPoint);
} }
} }
@ -1027,7 +1015,7 @@ Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle()
//function : InitTwoFacesAngle //function : InitTwoFacesAngle
//purpose : initialization of angle dimension between two faces //purpose : initialization of angle dimension between two faces
//======================================================================= //=======================================================================
Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle (const gp_Pnt thePointOnFirstFace) Standard_Boolean PrsDim_AngleDimension::InitTwoFacesAngle (const gp_Pnt& thePointOnFirstFace)
{ {
TopoDS_Face aFirstFace = TopoDS::Face (myFirstShape); TopoDS_Face aFirstFace = TopoDS::Face (myFirstShape);
TopoDS_Face aSecondFace = TopoDS::Face (mySecondShape); TopoDS_Face aSecondFace = TopoDS::Face (mySecondShape);
@ -1035,45 +1023,34 @@ Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle (const gp_Pnt thePointOnF
gp_Dir aFirstDir, aSecondDir; gp_Dir aFirstDir, aSecondDir;
gp_Pln aFirstPln, aSecondPln; gp_Pln aFirstPln, aSecondPln;
Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf; Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf;
AIS_KindOfSurface aFirstSurfType, aSecondSurfType; PrsDim_KindOfSurface aFirstSurfType, aSecondSurfType;
Standard_Real aFirstOffset, aSecondOffset; Standard_Real aFirstOffset, aSecondOffset;
AIS::GetPlaneFromFace (aFirstFace, aFirstPln, PrsDim::GetPlaneFromFace (aFirstFace, aFirstPln,
aFirstBasisSurf,aFirstSurfType,aFirstOffset); aFirstBasisSurf,aFirstSurfType,aFirstOffset);
AIS::GetPlaneFromFace (aSecondFace, aSecondPln, PrsDim::GetPlaneFromFace (aSecondFace, aSecondPln,
aSecondBasisSurf, aSecondSurfType, aSecondOffset); aSecondBasisSurf, aSecondSurfType, aSecondOffset);
myFirstPoint = thePointOnFirstFace; myFirstPoint = thePointOnFirstFace;
if (aFirstSurfType == AIS_KOS_Plane && aSecondSurfType == AIS_KOS_Plane) if (aFirstSurfType == PrsDim_KOS_Plane && aSecondSurfType == PrsDim_KOS_Plane)
{ {
//Planar faces angle //Planar faces angle
Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (aFirstBasisSurf); Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (aFirstBasisSurf);
Handle(Geom_Plane) aSecondPlane = Handle(Geom_Plane)::DownCast (aSecondBasisSurf); Handle(Geom_Plane) aSecondPlane = Handle(Geom_Plane)::DownCast (aSecondBasisSurf);
return AIS::InitAngleBetweenPlanarFaces (aFirstFace, return PrsDim::InitAngleBetweenPlanarFaces (aFirstFace, aSecondFace,
aSecondFace, myCenterPoint, myFirstPoint, mySecondPoint,
myCenterPoint,
myFirstPoint,
mySecondPoint,
Standard_True) Standard_True)
&& IsValidPoints (myFirstPoint, && IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
myCenterPoint,
mySecondPoint);
} }
else else
{ {
// Curvilinear faces angle // Curvilinear faces angle
return AIS::InitAngleBetweenCurvilinearFaces (aFirstFace, return PrsDim::InitAngleBetweenCurvilinearFaces (aFirstFace, aSecondFace,
aSecondFace, aFirstSurfType, aSecondSurfType,
aFirstSurfType, myCenterPoint, myFirstPoint, mySecondPoint,
aSecondSurfType,
myCenterPoint,
myFirstPoint,
mySecondPoint,
Standard_True) Standard_True)
&& IsValidPoints (myFirstPoint, && IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
myCenterPoint,
mySecondPoint);
} }
} }
@ -1081,7 +1058,7 @@ Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle (const gp_Pnt thePointOnF
//function : InitConeAngle //function : InitConeAngle
//purpose : initialization of the cone angle //purpose : initialization of the cone angle
//======================================================================= //=======================================================================
Standard_Boolean AIS_AngleDimension::InitConeAngle() Standard_Boolean PrsDim_AngleDimension::InitConeAngle()
{ {
if (myFirstShape.IsNull()) if (myFirstShape.IsNull())
{ {
@ -1100,16 +1077,14 @@ Standard_Boolean AIS_AngleDimension::InitConeAngle()
Handle(Geom_Line) aLine; Handle(Geom_Line) aLine;
BRepAdaptor_Surface aConeAdaptor (aConeShape); BRepAdaptor_Surface aConeAdaptor (aConeShape);
TopoDS_Face aFace; TopoDS_Face aFace;
AIS_KindOfSurface aSurfType; PrsDim_KindOfSurface aSurfType;
Standard_Real anOffset = 0.; Standard_Real anOffset = 0.;
Handle(Standard_Type) aType; Handle(Standard_Type) aType;
Standard_Real aMaxV = aConeAdaptor.FirstVParameter(); const Standard_Real aMaxV = aConeAdaptor.FirstVParameter();
Standard_Real aMinV = aConeAdaptor.LastVParameter(); const Standard_Real aMinV = aConeAdaptor.LastVParameter();
PrsDim::GetPlaneFromFace (aConeShape, aPln, aSurf, aSurfType, anOffset);
AIS::GetPlaneFromFace (aConeShape, aPln, aSurf, aSurfType, anOffset); if (aSurfType == PrsDim_KOS_Revolution)
if (aSurfType == AIS_KOS_Revolution)
{ {
// Surface of revolution // Surface of revolution
aRevSurf = Handle(Geom_SurfaceOfRevolution)::DownCast(aSurf); aRevSurf = Handle(Geom_SurfaceOfRevolution)::DownCast(aSurf);
@ -1185,7 +1160,7 @@ Standard_Boolean AIS_AngleDimension::InitConeAngle()
//function : IsValidPoints //function : IsValidPoints
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_AngleDimension::IsValidPoints (const gp_Pnt& theFirstPoint, Standard_Boolean PrsDim_AngleDimension::IsValidPoints (const gp_Pnt& theFirstPoint,
const gp_Pnt& theCenterPoint, const gp_Pnt& theCenterPoint,
const gp_Pnt& theSecondPoint) const const gp_Pnt& theSecondPoint) const
{ {
@ -1199,17 +1174,17 @@ Standard_Boolean AIS_AngleDimension::IsValidPoints (const gp_Pnt& theFirstPoint,
//function : isArrowVisible //function : isArrowVisible
//purpose : compares given and internal arrows types, returns true if the the type should be shown //purpose : compares given and internal arrows types, returns true if the the type should be shown
//======================================================================= //=======================================================================
Standard_Boolean AIS_AngleDimension::isArrowVisible(const AIS_TypeOfAngleArrowVisibility& theArrowType) const Standard_Boolean PrsDim_AngleDimension::isArrowVisible(const PrsDim_TypeOfAngleArrowVisibility theArrowType) const
{ {
switch (theArrowType) switch (theArrowType)
{ {
case AIS_TOAV_Both: case PrsDim_TypeOfAngleArrowVisibility_Both:
return myArrowsVisibility == AIS_TOAV_Both; return myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_Both;
case AIS_TOAV_First: case PrsDim_TypeOfAngleArrowVisibility_First:
return myArrowsVisibility == AIS_TOAV_Both || myArrowsVisibility == AIS_TOAV_First; return myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_Both || myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_First;
case AIS_TOAV_Second: case PrsDim_TypeOfAngleArrowVisibility_Second:
return myArrowsVisibility == AIS_TOAV_Both || myArrowsVisibility == AIS_TOAV_Second; return myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_Both || myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_Second;
case AIS_TOAV_None: case PrsDim_TypeOfAngleArrowVisibility_None:
return false; return false;
} }
return false; return false;
@ -1219,7 +1194,7 @@ Standard_Boolean AIS_AngleDimension::isArrowVisible(const AIS_TypeOfAngleArrowVi
//function : GetTextPosition //function : GetTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Pnt AIS_AngleDimension::GetTextPosition() const gp_Pnt PrsDim_AngleDimension::GetTextPosition() const
{ {
if (!IsValid()) if (!IsValid())
{ {
@ -1290,7 +1265,7 @@ const gp_Pnt AIS_AngleDimension::GetTextPosition() const
//function : SetTextPosition //function : SetTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::SetTextPosition (const gp_Pnt& theTextPos) void PrsDim_AngleDimension::SetTextPosition (const gp_Pnt& theTextPos)
{ {
if (!IsValid()) if (!IsValid())
{ {
@ -1311,7 +1286,7 @@ void AIS_AngleDimension::SetTextPosition (const gp_Pnt& theTextPos)
//function : AdjustParameters //function : AdjustParameters
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos, void PrsDim_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos,
Standard_Real& theExtensionSize, Standard_Real& theExtensionSize,
Prs3d_DimensionTextHorizontalPosition& theAlignment, Prs3d_DimensionTextHorizontalPosition& theAlignment,
Standard_Real& theFlyout) const Standard_Real& theFlyout) const
@ -1369,8 +1344,8 @@ void AIS_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos,
// Text on the extensions // Text on the extensions
gp_Lin aFirstLine = gce_MakeLin (myCenterPoint, myFirstPoint); gp_Lin aFirstLine = gce_MakeLin (myCenterPoint, myFirstPoint);
gp_Lin aSecondLine = gce_MakeLin (myCenterPoint, mySecondPoint); gp_Lin aSecondLine = gce_MakeLin (myCenterPoint, mySecondPoint);
gp_Pnt aFirstTextProj = AIS::Nearest (aFirstLine, theTextPos); gp_Pnt aFirstTextProj = PrsDim::Nearest (aFirstLine, theTextPos);
gp_Pnt aSecondTextProj = AIS::Nearest (aSecondLine, theTextPos); gp_Pnt aSecondTextProj = PrsDim::Nearest (aSecondLine, theTextPos);
Standard_Real aFirstDist = aFirstTextProj.Distance (theTextPos); Standard_Real aFirstDist = aFirstTextProj.Distance (theTextPos);
Standard_Real aSecondDist = aSecondTextProj.Distance (theTextPos); Standard_Real aSecondDist = aSecondTextProj.Distance (theTextPos);
@ -1408,7 +1383,7 @@ void AIS_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos,
//function : FitTextAlignment //function : FitTextAlignment
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_AngleDimension::FitTextAlignment (const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos, void PrsDim_AngleDimension::FitTextAlignment (const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos,
Standard_Integer& theLabelPosition, Standard_Integer& theLabelPosition,
Standard_Boolean& theIsArrowsExternal) const Standard_Boolean& theIsArrowsExternal) const
{ {

View File

@ -12,16 +12,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_AngleDimension_HeaderFile #ifndef _PrsDim_AngleDimension_HeaderFile
#define _AIS_AngleDimension_HeaderFile #define _PrsDim_AngleDimension_HeaderFile
#include <AIS_Dimension.hxx> #include <PrsDim_Dimension.hxx>
#include <AIS_TypeOfAngle.hxx> #include <PrsDim_TypeOfAngle.hxx>
#include <AIS_TypeOfAngleArrowVisibility.hxx> #include <PrsDim_TypeOfAngleArrowVisibility.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Transformation.hxx>
#include <gp.hxx> #include <gp.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
@ -36,8 +35,7 @@
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
class AIS_AngleDimension; DEFINE_STANDARD_HANDLE(PrsDim_AngleDimension, PrsDim_Dimension)
DEFINE_STANDARD_HANDLE (AIS_AngleDimension, AIS_Dimension)
//! Angle dimension. Can be constructed: //! Angle dimension. Can be constructed:
//! - on two intersected edges. //! - on two intersected edges.
@ -61,23 +59,23 @@ DEFINE_STANDARD_HANDLE (AIS_AngleDimension, AIS_Dimension)
//! //!
//! In case of the conical face the center point of the angle is the apex of the conical surface. //! In case of the conical face the center point of the angle is the apex of the conical surface.
//! The attachment points are points of the first and the last parameter of the basis circle of the cone. //! The attachment points are points of the first and the last parameter of the basis circle of the cone.
//! class PrsDim_AngleDimension : public PrsDim_Dimension
class AIS_AngleDimension : public AIS_Dimension
{ {
DEFINE_STANDARD_RTTIEXT(PrsDim_AngleDimension, PrsDim_Dimension)
public: public:
//! Constructs minimum angle dimension between two linear edges (where possible). //! Constructs minimum angle dimension between two linear edges (where possible).
//! These two edges should be intersected by each other. Otherwise the geometry is not valid. //! These two edges should be intersected by each other. Otherwise the geometry is not valid.
//! @param theFirstEdge [in] the first edge. //! @param theFirstEdge [in] the first edge.
//! @param theSecondEdge [in] the second edge. //! @param theSecondEdge [in] the second edge.
Standard_EXPORT AIS_AngleDimension (const TopoDS_Edge& theFirstEdge, Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Edge& theFirstEdge,
const TopoDS_Edge& theSecondEdge); const TopoDS_Edge& theSecondEdge);
//! Constructs the angle display object defined by three points. //! Constructs the angle display object defined by three points.
//! @param theFirstPoint [in] the first point (point on first angle flyout). //! @param theFirstPoint [in] the first point (point on first angle flyout).
//! @param theSecondPoint [in] the center point of angle dimension. //! @param theSecondPoint [in] the center point of angle dimension.
//! @param theThirdPoint [in] the second point (point on second angle flyout). //! @param theThirdPoint [in] the second point (point on second angle flyout).
Standard_EXPORT AIS_AngleDimension (const gp_Pnt& theFirstPoint, Standard_EXPORT PrsDim_AngleDimension (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
const gp_Pnt& theThirdPoint); const gp_Pnt& theThirdPoint);
@ -85,18 +83,18 @@ public:
//! @param theFirstVertex [in] the first vertex (vertex for first angle flyout). //! @param theFirstVertex [in] the first vertex (vertex for first angle flyout).
//! @param theSecondVertex [in] the center vertex of angle dimension. //! @param theSecondVertex [in] the center vertex of angle dimension.
//! @param theThirdPoint [in] the second vertex (vertex for second angle flyout). //! @param theThirdPoint [in] the second vertex (vertex for second angle flyout).
Standard_EXPORT AIS_AngleDimension (const TopoDS_Vertex& theFirstVertex, Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Vertex& theFirstVertex,
const TopoDS_Vertex& theSecondVertex, const TopoDS_Vertex& theSecondVertex,
const TopoDS_Vertex& theThirdVertex); const TopoDS_Vertex& theThirdVertex);
//! Constructs angle dimension for the cone face. //! Constructs angle dimension for the cone face.
//! @param theCone [in] the conical face. //! @param theCone [in] the conical face.
Standard_EXPORT AIS_AngleDimension (const TopoDS_Face& theCone); Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Face& theCone);
//! Constructs angle dimension between two planar faces. //! Constructs angle dimension between two planar faces.
//! @param theFirstFace [in] the first face. //! @param theFirstFace [in] the first face.
//! @param theSecondFace [in] the second face. //! @param theSecondFace [in] the second face.
Standard_EXPORT AIS_AngleDimension (const TopoDS_Face& theFirstFace, Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace); const TopoDS_Face& theSecondFace);
//! Constructs angle dimension between two planar faces. //! Constructs angle dimension between two planar faces.
@ -104,47 +102,29 @@ public:
//! @param theSecondFace [in] the second face. //! @param theSecondFace [in] the second face.
//! @param thePoint [in] the point which the dimension plane should pass through. //! @param thePoint [in] the point which the dimension plane should pass through.
//! This point can lay on the one of the faces or not. //! This point can lay on the one of the faces or not.
Standard_EXPORT AIS_AngleDimension (const TopoDS_Face& theFirstFace, Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace, const TopoDS_Face& theSecondFace,
const gp_Pnt& thePoint); const gp_Pnt& thePoint);
public: public:
//! @return first point forming the angle. //! @return first point forming the angle.
const gp_Pnt& FirstPoint() const const gp_Pnt& FirstPoint() const { return myFirstPoint; }
{
return myFirstPoint;
}
//! @return second point forming the angle. //! @return second point forming the angle.
const gp_Pnt& SecondPoint() const const gp_Pnt& SecondPoint() const { return mySecondPoint; }
{
return mySecondPoint;
}
//! @return center point forming the angle. //! @return center point forming the angle.
const gp_Pnt& CenterPoint() const const gp_Pnt& CenterPoint() const { return myCenterPoint; }
{
return myCenterPoint;
}
//! @return first argument shape. //! @return first argument shape.
const TopoDS_Shape& FirstShape() const const TopoDS_Shape& FirstShape() const { return myFirstShape; }
{
return myFirstShape;
}
//! @return second argument shape. //! @return second argument shape.
const TopoDS_Shape& SecondShape() const const TopoDS_Shape& SecondShape() const { return mySecondShape; }
{
return mySecondShape;
}
//! @return third argument shape. //! @return third argument shape.
const TopoDS_Shape& ThirdShape() const const TopoDS_Shape& ThirdShape() const { return myThirdShape; }
{
return myThirdShape;
}
public: public:
@ -208,37 +188,21 @@ public:
//! - if aTextPos is not between reflections of attach points -> Left or Right + negative flyout //! - if aTextPos is not between reflections of attach points -> Left or Right + negative flyout
Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE; Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE;
Standard_EXPORT virtual const gp_Pnt GetTextPosition () const Standard_OVERRIDE; Standard_EXPORT virtual gp_Pnt GetTextPosition () const Standard_OVERRIDE;
//! Sets angle type. //! Sets angle type.
//! @param theType [in] the type value. //! @param theType [in] the type value.
void SetType(const AIS_TypeOfAngle theType) void SetType (const PrsDim_TypeOfAngle theType) { myType = theType; }
{
myType = theType;
}
//! @return the current angle type. //! @return the current angle type.
AIS_TypeOfAngle GetType() const PrsDim_TypeOfAngle GetType() const { return myType; }
{
return myType;
}
//! Sets visible arrows type //! Sets visible arrows type
//! @param theType [in] the type of visibility of arrows. //! @param theType [in] the type of visibility of arrows.
void SetArrowsVisibility(const AIS_TypeOfAngleArrowVisibility& theType) void SetArrowsVisibility (const PrsDim_TypeOfAngleArrowVisibility& theType) { myArrowsVisibility = theType; }
{
myArrowsVisibility = theType;
}
//! @return the type of visibility of arrows. //! @return the type of visibility of arrows.
AIS_TypeOfAngleArrowVisibility GetArrowsVisibility() const PrsDim_TypeOfAngleArrowVisibility GetArrowsVisibility() const { return myArrowsVisibility; }
{
return myArrowsVisibility;
}
public:
DEFINE_STANDARD_RTTIEXT(AIS_AngleDimension,AIS_Dimension)
protected: protected:
@ -353,7 +317,7 @@ protected:
//! It defines some kind of dimension positioning over the faces. //! It defines some kind of dimension positioning over the faces.
//! @return TRUE if the angular dimension can be constructed //! @return TRUE if the angular dimension can be constructed
//! for the passed faces. //! for the passed faces.
Standard_EXPORT Standard_Boolean InitTwoFacesAngle (const gp_Pnt thePointOnFirstFace); Standard_EXPORT Standard_Boolean InitTwoFacesAngle (const gp_Pnt& thePointOnFirstFace);
//! Init angular dimension to measure cone face. //! Init angular dimension to measure cone face.
//! @return TRUE if the angular dimension can be constructed //! @return TRUE if the angular dimension can be constructed
@ -372,11 +336,11 @@ protected:
//! Returns true if the arrow should be visible //! Returns true if the arrow should be visible
//! @param theArrowType an arrow type //! @param theArrowType an arrow type
//! @return TRUE if the arrow should be visible //! @return TRUE if the arrow should be visible
Standard_EXPORT Standard_Boolean isArrowVisible(const AIS_TypeOfAngleArrowVisibility& theArrowType) const; Standard_EXPORT Standard_Boolean isArrowVisible (const PrsDim_TypeOfAngleArrowVisibility theArrowType) const;
private: private:
AIS_TypeOfAngle myType; //!< type of angle PrsDim_TypeOfAngle myType; //!< type of angle
AIS_TypeOfAngleArrowVisibility myArrowsVisibility; //!< type of arrows visibility PrsDim_TypeOfAngleArrowVisibility myArrowsVisibility; //!< type of arrows visibility
gp_Pnt myFirstPoint; gp_Pnt myFirstPoint;
gp_Pnt mySecondPoint; gp_Pnt mySecondPoint;
@ -386,4 +350,4 @@ private:
TopoDS_Shape myThirdShape; TopoDS_Shape myThirdShape;
}; };
#endif // _AIS_AngleDimension_HeaderFile #endif // _PrsDim_AngleDimension_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_Chamf2dDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_Chamf2dDimension.hxx>
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx> #include <BRepBndLib.hxx>
@ -25,7 +25,6 @@
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
@ -49,17 +48,17 @@
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Chamf2dDimension,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Chamf2dDimension, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, PrsDim_Chamf2dDimension::PrsDim_Chamf2dDimension(const TopoDS_Shape& aFShape,
const Handle(Geom_Plane)& aPlane, const Handle(Geom_Plane)& aPlane,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText) const TCollection_ExtendedString& aText)
:AIS_Relation() :PrsDim_Relation()
{ {
myFShape = aFShape; myFShape = aFShape;
myPlane = aPlane; myPlane = aPlane;
@ -74,14 +73,14 @@ AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, PrsDim_Chamf2dDimension::PrsDim_Chamf2dDimension(const TopoDS_Shape& aFShape,
const Handle(Geom_Plane)& aPlane, const Handle(Geom_Plane)& aPlane,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText, const TCollection_ExtendedString& aText,
const gp_Pnt& aPosition, const gp_Pnt& aPosition,
const DsgPrs_ArrowSide aSymbolPrs , const DsgPrs_ArrowSide aSymbolPrs ,
const Standard_Real anArrowSize) const Standard_Real anArrowSize)
:AIS_Relation() :PrsDim_Relation()
{ {
myFShape = aFShape; myFShape = aFShape;
myPlane = aPlane; myPlane = aPlane;
@ -99,14 +98,14 @@ AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , void PrsDim_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer) const Standard_Integer)
{ {
Handle(Geom_Curve) gcurv; Handle(Geom_Curve) gcurv;
gp_Pnt pfirst,plast; gp_Pnt pfirst,plast;
const TopoDS_Edge& thechamfedge = TopoDS::Edge(myFShape); const TopoDS_Edge& thechamfedge = TopoDS::Edge(myFShape);
if (!AIS::ComputeGeometry (thechamfedge, gcurv, pfirst, plast)) if (!PrsDim::ComputeGeometry (thechamfedge, gcurv, pfirst, plast))
return; return;
Handle(Geom_Line) glin = Handle(Geom_Line)::DownCast (gcurv); Handle(Geom_Line) glin = Handle(Geom_Line)::DownCast (gcurv);
@ -126,7 +125,7 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
gp_Pnt pfirstnext,plastnext; gp_Pnt pfirstnext,plastnext;
Handle(Geom_Line) glinnext; Handle(Geom_Line) glinnext;
if (!AIS::ComputeGeometry(nextedge,glinnext,pfirstnext,plastnext) ) if (!PrsDim::ComputeGeometry(nextedge,glinnext,pfirstnext,plastnext) )
return; return;
gp_Vec v1(pfirst,plast); gp_Vec v1(pfirst,plast);
@ -152,7 +151,7 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
curpos = myPntAttach.Translated(transVec); curpos = myPntAttach.Translated(transVec);
if (myIsSetBndBox) if (myIsSetBndBox)
curpos = AIS::TranslatePointToBound( curpos, myDir, myBndBox ); curpos = PrsDim::TranslatePointToBound( curpos, myDir, myBndBox );
myPosition = curpos; myPosition = curpos;
} }
@ -208,7 +207,7 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Chamf2dDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_Chamf2dDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer) const Standard_Integer)
{ {
Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7);

View File

@ -14,56 +14,56 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_Chamf2dDimension_HeaderFile #ifndef _PrsDim_Chamf2dDimension_HeaderFile
#define _AIS_Chamf2dDimension_HeaderFile #define _PrsDim_Chamf2dDimension_HeaderFile
#include <AIS_KindOfDimension.hxx> #include <PrsDim_KindOfDimension.hxx>
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
#include <DsgPrs_ArrowSide.hxx> #include <DsgPrs_ArrowSide.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
class Geom_Plane; class Geom_Plane;
DEFINE_STANDARD_HANDLE(AIS_Chamf2dDimension, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_Chamf2dDimension, PrsDim_Relation)
//! A framework to define display of 2D chamfers. //! A framework to define display of 2D chamfers.
//! A chamfer is displayed with arrows and text. The text //! A chamfer is displayed with arrows and text. The text
//! gives the length of the chamfer if it is a symmetrical //! gives the length of the chamfer if it is a symmetrical
//! chamfer, or the angle if it is not. //! chamfer, or the angle if it is not.
class AIS_Chamf2dDimension : public AIS_Relation class PrsDim_Chamf2dDimension : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_Chamf2dDimension, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_Chamf2dDimension, PrsDim_Relation)
public: public:
//! Constructs the display object for 2D chamfers. //! Constructs the display object for 2D chamfers.
//! This object is defined by the face aFShape, the //! This object is defined by the face aFShape, the
//! dimension aVal, the plane aPlane and the text aText. //! dimension aVal, the plane aPlane and the text aText.
Standard_EXPORT AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText); Standard_EXPORT PrsDim_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Constructs the display object for 2D chamfers. //! Constructs the display object for 2D chamfers.
//! This object is defined by the face aFShape, the plane //! This object is defined by the face aFShape, the plane
//! aPlane, the dimension aVal, the position aPosition, //! aPlane, the dimension aVal, the position aPosition,
//! the type of arrow aSymbolPrs with the size //! the type of arrow aSymbolPrs with the size
//! anArrowSize, and the text aText. //! anArrowSize, and the text aText.
Standard_EXPORT AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0); Standard_EXPORT PrsDim_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
//! Indicates that we are concerned with a 2d length. //! Indicates that we are concerned with a 2d length.
virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE; virtual PrsDim_KindOfDimension KindOfDimension() const Standard_OVERRIDE { return PrsDim_KOD_LENGTH; }
//! Returns true if the 2d chamfer dimension is movable. //! Returns true if the 2d chamfer dimension is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
private: private:
Standard_EXPORT 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
private:
gp_Pnt myPntAttach; gp_Pnt myPntAttach;
gp_Dir myDir; gp_Dir myDir;
}; };
#include <AIS_Chamf2dDimension.lxx> #endif // _PrsDim_Chamf2dDimension_HeaderFile
#endif // _AIS_Chamf2dDimension_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_Chamf3dDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_Chamf3dDimension.hxx>
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx> #include <BRepBndLib.hxx>
@ -24,7 +24,6 @@
#include <DsgPrs_Chamf2dPresentation.hxx> #include <DsgPrs_Chamf2dPresentation.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
@ -40,7 +39,6 @@
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <TopAbs_Orientation.hxx> #include <TopAbs_Orientation.hxx>
@ -48,16 +46,16 @@
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Chamf3dDimension,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Chamf3dDimension, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, PrsDim_Chamf3dDimension::PrsDim_Chamf3dDimension(const TopoDS_Shape& aFShape,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText) const TCollection_ExtendedString& aText)
:AIS_Relation() :PrsDim_Relation()
{ {
myFShape = aFShape; myFShape = aFShape;
myVal = aVal; myVal = aVal;
@ -71,13 +69,13 @@ AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, PrsDim_Chamf3dDimension::PrsDim_Chamf3dDimension(const TopoDS_Shape& aFShape,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText, const TCollection_ExtendedString& aText,
const gp_Pnt& aPosition, const gp_Pnt& aPosition,
const DsgPrs_ArrowSide aSymbolPrs , const DsgPrs_ArrowSide aSymbolPrs ,
const Standard_Real anArrowSize) const Standard_Real anArrowSize)
:AIS_Relation() :PrsDim_Relation()
{ {
myFShape = aFShape; myFShape = aFShape;
myVal = aVal; myVal = aVal;
@ -94,7 +92,7 @@ AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , void PrsDim_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer) const Standard_Integer)
{ {
@ -130,7 +128,7 @@ void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
curpos = myPntAttach.Translated(transVec); curpos = myPntAttach.Translated(transVec);
if (myIsSetBndBox) if (myIsSetBndBox)
curpos = AIS::TranslatePointToBound( curpos, myDir, myBndBox ); curpos = PrsDim::TranslatePointToBound( curpos, myDir, myBndBox );
myPosition = curpos; myPosition = curpos;
} }
@ -182,7 +180,7 @@ void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Chamf3dDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_Chamf3dDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer) const Standard_Integer)
{ {
Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7);

View File

@ -14,54 +14,54 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_Chamf3dDimension_HeaderFile #ifndef _PrsDim_Chamf3dDimension_HeaderFile
#define _AIS_Chamf3dDimension_HeaderFile #define _PrsDim_Chamf3dDimension_HeaderFile
#include <AIS_KindOfDimension.hxx> #include <PrsDim_KindOfDimension.hxx>
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
#include <DsgPrs_ArrowSide.hxx> #include <DsgPrs_ArrowSide.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_Chamf3dDimension, PrsDim_Relation)
//! A framework to define display of 3D chamfers. //! A framework to define display of 3D chamfers.
//! A chamfer is displayed with arrows and text. The text //! A chamfer is displayed with arrows and text. The text
//! gives the length of the chamfer if it is a symmetrical //! gives the length of the chamfer if it is a symmetrical
//! chamfer, or the angle if it is not. //! chamfer, or the angle if it is not.
class AIS_Chamf3dDimension : public AIS_Relation class PrsDim_Chamf3dDimension : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_Chamf3dDimension, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_Chamf3dDimension, PrsDim_Relation)
public: public:
//! Constructs a display object for 3D chamfers. //! Constructs a display object for 3D chamfers.
//! This object is defined by the shape aFShape, the //! This object is defined by the shape aFShape, the
//! dimension aVal and the text aText. //! dimension aVal and the text aText.
Standard_EXPORT AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, const Standard_Real aVal, const TCollection_ExtendedString& aText); Standard_EXPORT PrsDim_Chamf3dDimension(const TopoDS_Shape& aFShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Constructs a display object for 3D chamfers. //! Constructs a display object for 3D chamfers.
//! This object is defined by the shape aFShape, the //! This object is defined by the shape aFShape, the
//! dimension aVal, the text aText, the point of origin of //! dimension aVal, the text aText, the point of origin of
//! the chamfer aPosition, the type of arrow aSymbolPrs //! the chamfer aPosition, the type of arrow aSymbolPrs
//! with the size anArrowSize. //! with the size anArrowSize.
Standard_EXPORT AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0); Standard_EXPORT PrsDim_Chamf3dDimension(const TopoDS_Shape& aFShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0);
//! Indicates that we are concerned with a 3d length. //! Indicates that we are concerned with a 3d length.
virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE; virtual PrsDim_KindOfDimension KindOfDimension() const Standard_OVERRIDE { return PrsDim_KOD_LENGTH; }
//! Returns true if the 3d chamfer dimension is movable. //! Returns true if the 3d chamfer dimension is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
private: private:
Standard_EXPORT 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
private:
gp_Pnt myPntAttach; gp_Pnt myPntAttach;
gp_Dir myDir; gp_Dir myDir;
}; };
#include <AIS_Chamf3dDimension.lxx> #endif // _PrsDim_Chamf3dDimension_HeaderFile
#endif // _AIS_Chamf3dDimension_HeaderFile

View File

@ -14,14 +14,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_ConcentricRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_ConcentricRelation.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <DsgPrs_ConcentricPresentation.hxx> #include <DsgPrs_ConcentricPresentation.hxx>
#include <Geom_Circle.hxx> #include <Geom_Circle.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAbs_CurveType.hxx> #include <GeomAbs_CurveType.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
@ -35,18 +34,17 @@
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_ConcentricRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_ConcentricRelation, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_ConcentricRelation::AIS_ConcentricRelation( PrsDim_ConcentricRelation::PrsDim_ConcentricRelation(
const TopoDS_Shape& aFShape, const TopoDS_Shape& aFShape,
const TopoDS_Shape& aSShape, const TopoDS_Shape& aSShape,
const Handle(Geom_Plane)& aPlane) const Handle(Geom_Plane)& aPlane)
@ -61,7 +59,7 @@ AIS_ConcentricRelation::AIS_ConcentricRelation(
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer) const Standard_Integer)
{ {
@ -89,7 +87,7 @@ void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&
//function : ComputeTwoEdgesConcentric //function : ComputeTwoEdgesConcentric
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Presentation)& aPresentation)
{ {
TopoDS_Edge E; TopoDS_Edge E;
TopoDS_Vertex V; TopoDS_Vertex V;
@ -106,9 +104,9 @@ void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Pres
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
Standard_Boolean isInfinite; Standard_Boolean isInfinite;
Standard_Boolean isOnPlanEdge, isOnPlanVertex; Standard_Boolean isOnPlanEdge, isOnPlanVertex;
if (!AIS::ComputeGeometry(E,C,p1,p2,extCurv,isInfinite,isOnPlanEdge,myPlane)) return; if (!PrsDim::ComputeGeometry(E,C,p1,p2,extCurv,isInfinite,isOnPlanEdge,myPlane)) return;
gp_Pnt P; gp_Pnt P;
AIS::ComputeGeometry(V,P, myPlane, isOnPlanVertex); PrsDim::ComputeGeometry(V,P, myPlane, isOnPlanVertex);
Handle(Geom_Circle) CIRCLE (Handle(Geom_Circle)::DownCast (C)); Handle(Geom_Circle) CIRCLE (Handle(Geom_Circle)::DownCast (C));
myCenter = CIRCLE->Location(); myCenter = CIRCLE->Location();
@ -117,38 +115,38 @@ void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Pres
gp_Vec vectrans(vec); gp_Vec vectrans(vec);
myPnt = myCenter.Translated(vectrans.Multiplied(myRad)); myPnt = myCenter.Translated(vectrans.Multiplied(myRad));
DsgPrs_ConcentricPresentation::Add(aPresentation,myDrawer,myCenter,myRad,myDir,myPnt); DsgPrs_ConcentricPresentation::Add(aPresentation,myDrawer,myCenter,myRad,myDir,myPnt);
if (!isOnPlanEdge) AIS::ComputeProjEdgePresentation(aPresentation,myDrawer,E,CIRCLE,p1,p2); if (!isOnPlanEdge) PrsDim::ComputeProjEdgePresentation(aPresentation,myDrawer,E,CIRCLE,p1,p2);
if (!isOnPlanVertex) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V,P); if (!isOnPlanVertex) PrsDim::ComputeProjVertexPresentation(aPresentation,myDrawer,V,P);
} }
//======================================================================= //=======================================================================
//function : ComputeTwoEdgesConcentric //function : ComputeTwoEdgesConcentric
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ConcentricRelation::ComputeTwoVerticesConcentric(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_ConcentricRelation::ComputeTwoVerticesConcentric(const Handle(Prs3d_Presentation)& aPresentation)
{ {
TopoDS_Vertex V1,V2; TopoDS_Vertex V1,V2;
V1 = TopoDS::Vertex(myFShape); V1 = TopoDS::Vertex(myFShape);
V2 = TopoDS::Vertex(myFShape); V2 = TopoDS::Vertex(myFShape);
Standard_Boolean isOnPlanVertex1(Standard_True),isOnPlanVertex2(Standard_True); Standard_Boolean isOnPlanVertex1(Standard_True),isOnPlanVertex2(Standard_True);
gp_Pnt P1,P2; gp_Pnt P1,P2;
AIS::ComputeGeometry(V1,P1, myPlane,isOnPlanVertex1); PrsDim::ComputeGeometry(V1,P1, myPlane,isOnPlanVertex1);
AIS::ComputeGeometry(V2,P2, myPlane,isOnPlanVertex2); PrsDim::ComputeGeometry(V2,P2, myPlane,isOnPlanVertex2);
myCenter = P1; myCenter = P1;
myRad = 15.; myRad = 15.;
gp_Dir vec(myPlane->Pln().Position().XDirection()); gp_Dir vec(myPlane->Pln().Position().XDirection());
gp_Vec vectrans(vec); gp_Vec vectrans(vec);
myPnt = myCenter.Translated(vectrans.Multiplied(myRad)); myPnt = myCenter.Translated(vectrans.Multiplied(myRad));
DsgPrs_ConcentricPresentation::Add(aPresentation,myDrawer,myCenter,myRad,myDir,myPnt); DsgPrs_ConcentricPresentation::Add(aPresentation,myDrawer,myCenter,myRad,myDir,myPnt);
if (!isOnPlanVertex1) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V1,P1); if (!isOnPlanVertex1) PrsDim::ComputeProjVertexPresentation(aPresentation,myDrawer,V1,P1);
if (!isOnPlanVertex2) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V2,P2); if (!isOnPlanVertex2) PrsDim::ComputeProjVertexPresentation(aPresentation,myDrawer,V2,P2);
} }
//======================================================================= //=======================================================================
//function : ComputeTwoEdgesConcentric //function : ComputeTwoEdgesConcentric
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presentation)& aPresentation)
{ {
BRepAdaptor_Curve curv1(TopoDS::Edge(myFShape)); BRepAdaptor_Curve curv1(TopoDS::Edge(myFShape));
BRepAdaptor_Curve curv2(TopoDS::Edge(mySShape)); BRepAdaptor_Curve curv2(TopoDS::Edge(mySShape));
@ -157,15 +155,11 @@ void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presen
Handle(Geom_Curve) geom1,geom2; Handle(Geom_Curve) geom1,geom2;
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape), if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), TopoDS::Edge(mySShape),
TopoDS::Edge(mySShape),
myExtShape, myExtShape,
geom1, geom1, geom2,
geom2, ptat11, ptat12,
ptat11, ptat21, ptat22,
ptat12,
ptat21,
ptat22,
extCurv, extCurv,
isInfinite1,isInfinite2, isInfinite1,isInfinite2,
myPlane)) { myPlane)) {
@ -221,7 +215,7 @@ void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presen
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ConcentricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_ConcentricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer) const Standard_Integer)
{ {
Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7);

View File

@ -14,24 +14,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_ConcentricRelation_HeaderFile #ifndef _PrsDim_ConcentricRelation_HeaderFile
#define _AIS_ConcentricRelation_HeaderFile #define _PrsDim_ConcentricRelation_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
class Geom_Plane; class Geom_Plane;
DEFINE_STANDARD_HANDLE(AIS_ConcentricRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_ConcentricRelation, PrsDim_Relation)
//! A framework to define a constraint by a relation of //! A framework to define a constraint by a relation of
//! concentricity between two or more interactive datums. //! concentricity between two or more interactive datums.
//! The display of this constraint is also defined. //! The display of this constraint is also defined.
//! A plane is used to create an axis along which the //! A plane is used to create an axis along which the
//! relation of concentricity can be extended. //! relation of concentricity can be extended.
class AIS_ConcentricRelation : public AIS_Relation class PrsDim_ConcentricRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_ConcentricRelation, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_ConcentricRelation, PrsDim_Relation)
public: public:
//! Constructs the display object for concentric relations //! Constructs the display object for concentric relations
@ -40,11 +40,11 @@ public:
//! and aSShape and the plane aPlane. //! and aSShape and the plane aPlane.
//! aPlane is provided to create an axis along which the //! aPlane is provided to create an axis along which the
//! relation of concentricity can be extended. //! relation of concentricity can be extended.
Standard_EXPORT AIS_ConcentricRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane); Standard_EXPORT PrsDim_ConcentricRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane);
private: private:
Standard_EXPORT 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoEdgesConcentric (const Handle(Prs3d_Presentation)& aPresentationManager); Standard_EXPORT void ComputeTwoEdgesConcentric (const Handle(Prs3d_Presentation)& aPresentationManager);
@ -54,6 +54,8 @@ private:
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
private:
gp_Pnt myCenter; gp_Pnt myCenter;
Standard_Real myRad; Standard_Real myRad;
gp_Dir myDir; gp_Dir myDir;
@ -61,4 +63,4 @@ private:
}; };
#endif // _AIS_ConcentricRelation_HeaderFile #endif // _PrsDim_ConcentricRelation_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <AIS_DiameterDimension.hxx> #include <PrsDim_DiameterDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <BRepLib_MakeEdge.hxx> #include <BRepLib_MakeEdge.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <GeomAPI_IntCS.hxx> #include <GeomAPI_IntCS.hxx>
@ -25,8 +25,7 @@
#include <gce_MakeDir.hxx> #include <gce_MakeDir.hxx>
#include <Standard_ProgramError.hxx> #include <Standard_ProgramError.hxx>
IMPLEMENT_STANDARD_RTTIEXT(PrsDim_DiameterDimension, PrsDim_Dimension)
IMPLEMENT_STANDARD_RTTIEXT(AIS_DiameterDimension,AIS_Dimension)
namespace namespace
{ {
@ -37,12 +36,12 @@ namespace
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle) PrsDim_DiameterDimension::PrsDim_DiameterDimension (const gp_Circ& theCircle)
: AIS_Dimension (AIS_KOD_DIAMETER) : PrsDim_Dimension (PrsDim_KOD_DIAMETER)
{ {
SetMeasuredGeometry (theCircle); SetMeasuredGeometry (theCircle);
SetSpecialSymbol (THE_DIAMETER_SYMBOL); SetSpecialSymbol (THE_DIAMETER_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_Before); SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before);
SetFlyout (0.0); SetFlyout (0.0);
} }
@ -50,14 +49,14 @@ AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle)
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle, PrsDim_DiameterDimension::PrsDim_DiameterDimension (const gp_Circ& theCircle,
const gp_Pln& thePlane) const gp_Pln& thePlane)
: AIS_Dimension (AIS_KOD_DIAMETER) : PrsDim_Dimension (PrsDim_KOD_DIAMETER)
{ {
SetCustomPlane (thePlane); SetCustomPlane (thePlane);
SetMeasuredGeometry (theCircle); SetMeasuredGeometry (theCircle);
SetSpecialSymbol (THE_DIAMETER_SYMBOL); SetSpecialSymbol (THE_DIAMETER_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_Before); SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before);
SetFlyout (0.0); SetFlyout (0.0);
} }
@ -65,12 +64,12 @@ AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape) PrsDim_DiameterDimension::PrsDim_DiameterDimension (const TopoDS_Shape& theShape)
: AIS_Dimension (AIS_KOD_DIAMETER) : PrsDim_Dimension (PrsDim_KOD_DIAMETER)
{ {
SetMeasuredGeometry (theShape); SetMeasuredGeometry (theShape);
SetSpecialSymbol (THE_DIAMETER_SYMBOL); SetSpecialSymbol (THE_DIAMETER_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_Before); SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before);
SetFlyout (0.0); SetFlyout (0.0);
} }
@ -78,14 +77,14 @@ AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape)
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape, PrsDim_DiameterDimension::PrsDim_DiameterDimension (const TopoDS_Shape& theShape,
const gp_Pln& thePlane) const gp_Pln& thePlane)
: AIS_Dimension (AIS_KOD_DIAMETER) : PrsDim_Dimension (PrsDim_KOD_DIAMETER)
{ {
SetCustomPlane (thePlane); SetCustomPlane (thePlane);
SetMeasuredGeometry (theShape); SetMeasuredGeometry (theShape);
SetSpecialSymbol (THE_DIAMETER_SYMBOL); SetSpecialSymbol (THE_DIAMETER_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_Before); SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before);
SetFlyout (0.0); SetFlyout (0.0);
} }
@ -93,7 +92,7 @@ AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape,
//function : AnchorPoint //function : AnchorPoint
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS_DiameterDimension::AnchorPoint() gp_Pnt PrsDim_DiameterDimension::AnchorPoint()
{ {
if (!IsValid()) if (!IsValid())
{ {
@ -107,7 +106,7 @@ gp_Pnt AIS_DiameterDimension::AnchorPoint()
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::SetMeasuredGeometry (const gp_Circ& theCircle) void PrsDim_DiameterDimension::SetMeasuredGeometry (const gp_Circ& theCircle)
{ {
myCircle = theCircle; myCircle = theCircle;
myGeometryType = GeometryType_Edge; myGeometryType = GeometryType_Edge;
@ -132,7 +131,7 @@ void AIS_DiameterDimension::SetMeasuredGeometry (const gp_Circ& theCircle)
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape) void PrsDim_DiameterDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape)
{ {
gp_Pnt aDummyPnt (gp::Origin()); gp_Pnt aDummyPnt (gp::Origin());
Standard_Boolean isClosed = Standard_False; Standard_Boolean isClosed = Standard_False;
@ -161,7 +160,7 @@ void AIS_DiameterDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape)
//function : CheckPlane //function : CheckPlane
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_DiameterDimension::CheckPlane (const gp_Pln& thePlane) const Standard_Boolean PrsDim_DiameterDimension::CheckPlane (const gp_Pln& thePlane) const
{ {
// Check if the circle center point belongs to plane. // Check if the circle center point belongs to plane.
if (!thePlane.Contains (myCircle.Location(), Precision::Confusion())) if (!thePlane.Contains (myCircle.Location(), Precision::Confusion()))
@ -176,7 +175,7 @@ Standard_Boolean AIS_DiameterDimension::CheckPlane (const gp_Pln& thePlane) cons
//function : ComputePlane //function : ComputePlane
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::ComputePlane() void PrsDim_DiameterDimension::ComputePlane()
{ {
if (!myIsGeometryValid) if (!myIsGeometryValid)
{ {
@ -190,7 +189,7 @@ void AIS_DiameterDimension::ComputePlane()
//function : ComputeAnchorPoint //function : ComputeAnchorPoint
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::ComputeAnchorPoint() void PrsDim_DiameterDimension::ComputeAnchorPoint()
{ {
// Anchor point is an intersection of dimension plane and circle. // Anchor point is an intersection of dimension plane and circle.
Handle(Geom_Circle) aCircle = new Geom_Circle (myCircle); Handle(Geom_Circle) aCircle = new Geom_Circle (myCircle);
@ -228,7 +227,7 @@ void AIS_DiameterDimension::ComputeAnchorPoint()
//function : GetModelUnits //function : GetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_DiameterDimension::GetModelUnits() const const TCollection_AsciiString& PrsDim_DiameterDimension::GetModelUnits() const
{ {
return myDrawer->DimLengthModelUnits(); return myDrawer->DimLengthModelUnits();
} }
@ -237,7 +236,7 @@ const TCollection_AsciiString& AIS_DiameterDimension::GetModelUnits() const
//function : GetDisplayUnits //function : GetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_DiameterDimension::GetDisplayUnits() const const TCollection_AsciiString& PrsDim_DiameterDimension::GetDisplayUnits() const
{ {
return myDrawer->DimLengthDisplayUnits(); return myDrawer->DimLengthDisplayUnits();
} }
@ -246,7 +245,7 @@ const TCollection_AsciiString& AIS_DiameterDimension::GetDisplayUnits() const
//function : SetModelUnits //function : SetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::SetModelUnits (const TCollection_AsciiString& theUnits) void PrsDim_DiameterDimension::SetModelUnits (const TCollection_AsciiString& theUnits)
{ {
myDrawer->SetDimLengthModelUnits (theUnits); myDrawer->SetDimLengthModelUnits (theUnits);
} }
@ -255,7 +254,7 @@ void AIS_DiameterDimension::SetModelUnits (const TCollection_AsciiString& theUni
//function : SetDisplayUnits //function : SetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) void PrsDim_DiameterDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits)
{ {
myDrawer->SetDimLengthDisplayUnits (theUnits); myDrawer->SetDimLengthDisplayUnits (theUnits);
} }
@ -264,7 +263,7 @@ void AIS_DiameterDimension::SetDisplayUnits (const TCollection_AsciiString& theU
//function : ComputeValue //function : ComputeValue
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real AIS_DiameterDimension::ComputeValue() const Standard_Real PrsDim_DiameterDimension::ComputeValue() const
{ {
if (!IsValid()) if (!IsValid())
{ {
@ -278,7 +277,7 @@ Standard_Real AIS_DiameterDimension::ComputeValue() const
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, void PrsDim_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/,
const Handle(Prs3d_Presentation)& thePresentation, const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode) const Standard_Integer theMode)
{ {
@ -300,7 +299,7 @@ void AIS_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)&
//function : ComputeFlyoutSelection //function : ComputeFlyoutSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, void PrsDim_DiameterDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection,
const Handle(SelectMgr_EntityOwner)& theEntityOwner) const Handle(SelectMgr_EntityOwner)& theEntityOwner)
{ {
if (!IsValid()) if (!IsValid())
@ -319,7 +318,7 @@ void AIS_DiameterDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selec
//function : ComputeSidePoints //function : ComputeSidePoints
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::ComputeSidePoints (const gp_Circ& theCircle, void PrsDim_DiameterDimension::ComputeSidePoints (const gp_Circ& theCircle,
gp_Pnt& theFirstPnt, gp_Pnt& theFirstPnt,
gp_Pnt& theSecondPnt) gp_Pnt& theSecondPnt)
{ {
@ -333,7 +332,7 @@ void AIS_DiameterDimension::ComputeSidePoints (const gp_Circ& theCircle,
//function : IsValidCircle //function : IsValidCircle
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_DiameterDimension::IsValidCircle (const gp_Circ& theCircle) const Standard_Boolean PrsDim_DiameterDimension::IsValidCircle (const gp_Circ& theCircle) const
{ {
return (theCircle.Radius() * 2.0) > Precision::Confusion(); return (theCircle.Radius() * 2.0) > Precision::Confusion();
} }
@ -342,7 +341,7 @@ Standard_Boolean AIS_DiameterDimension::IsValidCircle (const gp_Circ& theCircle)
//function : IsValidAnchor //function : IsValidAnchor
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_DiameterDimension::IsValidAnchor (const gp_Circ& theCircle, Standard_Boolean PrsDim_DiameterDimension::IsValidAnchor (const gp_Circ& theCircle,
const gp_Pnt& theAnchor) const const gp_Pnt& theAnchor) const
{ {
gp_Pln aCirclePlane (theCircle.Location(), theCircle.Axis().Direction()); gp_Pln aCirclePlane (theCircle.Location(), theCircle.Axis().Direction());
@ -357,7 +356,7 @@ Standard_Boolean AIS_DiameterDimension::IsValidAnchor (const gp_Circ& theCircle,
//function : GetTextPosition //function : GetTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Pnt AIS_DiameterDimension::GetTextPosition() const gp_Pnt PrsDim_DiameterDimension::GetTextPosition() const
{ {
if (IsTextPositionCustom()) if (IsTextPositionCustom())
{ {
@ -372,7 +371,7 @@ const gp_Pnt AIS_DiameterDimension::GetTextPosition() const
//function : GetTextPosition //function : GetTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DiameterDimension::SetTextPosition (const gp_Pnt& theTextPos) void PrsDim_DiameterDimension::SetTextPosition (const gp_Pnt& theTextPos)
{ {
if (!IsValid()) if (!IsValid())
{ {

View File

@ -12,20 +12,17 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _PrsDim_DiameterDimension_HeaderFile
#define _PrsDim_DiameterDimension_HeaderFile
#ifndef _AIS_DiameterDimension_HeaderFile #include <PrsDim_Dimension.hxx>
#define _AIS_DiameterDimension_HeaderFile
#include <AIS.hxx>
#include <AIS_Dimension.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
#include <Standard_Type.hxx> #include <Standard_Type.hxx>
class AIS_DiameterDimension; DEFINE_STANDARD_HANDLE(PrsDim_DiameterDimension, PrsDim_Dimension)
DEFINE_STANDARD_HANDLE (AIS_DiameterDimension, AIS_Dimension)
//! Diameter dimension. Can be constructued: //! Diameter dimension. Can be constructued:
//! - On generic circle. //! - On generic circle.
@ -52,51 +49,45 @@ DEFINE_STANDARD_HANDLE (AIS_DiameterDimension, AIS_Dimension)
//! if the diameter of the circle is less than Precision::Confusion(). //! if the diameter of the circle is less than Precision::Confusion().
//! In case if the dimension is built on the arbitrary shape, it can be considered //! In case if the dimension is built on the arbitrary shape, it can be considered
//! as invalid if the shape does not contain circle geometry. //! as invalid if the shape does not contain circle geometry.
//! class PrsDim_DiameterDimension : public PrsDim_Dimension
class AIS_DiameterDimension : public AIS_Dimension
{ {
DEFINE_STANDARD_RTTIEXT(PrsDim_DiameterDimension, PrsDim_Dimension)
public: public:
//! Construct diameter dimension for the circle. //! Construct diameter dimension for the circle.
//! @param theCircle [in] the circle to measure. //! @param theCircle [in] the circle to measure.
Standard_EXPORT AIS_DiameterDimension (const gp_Circ& theCircle); Standard_EXPORT PrsDim_DiameterDimension (const gp_Circ& theCircle);
//! Construct diameter dimension for the circle and orient it correspondingly //! Construct diameter dimension for the circle and orient it correspondingly
//! to the passed plane. //! to the passed plane.
//! @param theCircle [in] the circle to measure. //! @param theCircle [in] the circle to measure.
//! @param thePlane [in] the plane defining preferred orientation //! @param thePlane [in] the plane defining preferred orientation
//! for dimension. //! for dimension.
Standard_EXPORT AIS_DiameterDimension (const gp_Circ& theCircle, Standard_EXPORT PrsDim_DiameterDimension (const gp_Circ& theCircle,
const gp_Pln& thePlane); const gp_Pln& thePlane);
//! Construct diameter on the passed shape, if applicable. //! Construct diameter on the passed shape, if applicable.
//! @param theShape [in] the shape to measure. //! @param theShape [in] the shape to measure.
Standard_EXPORT AIS_DiameterDimension (const TopoDS_Shape& theShape); Standard_EXPORT PrsDim_DiameterDimension (const TopoDS_Shape& theShape);
//! Construct diameter on the passed shape, if applicable - and //! Construct diameter on the passed shape, if applicable - and
//! define the preferred plane to orient the dimension. //! define the preferred plane to orient the dimension.
//! @param theShape [in] the shape to measure. //! @param theShape [in] the shape to measure.
//! @param thePlane [in] the plane defining preferred orientation //! @param thePlane [in] the plane defining preferred orientation
//! for dimension. //! for dimension.
Standard_EXPORT AIS_DiameterDimension (const TopoDS_Shape& theShape, Standard_EXPORT PrsDim_DiameterDimension (const TopoDS_Shape& theShape,
const gp_Pln& thePlane); const gp_Pln& thePlane);
public: public:
//! @return measured geometry circle. //! @return measured geometry circle.
const gp_Circ& Circle() const const gp_Circ& Circle() const { return myCircle; }
{
return myCircle;
}
//! @return anchor point on circle for diameter dimension. //! @return anchor point on circle for diameter dimension.
Standard_EXPORT gp_Pnt AnchorPoint(); Standard_EXPORT gp_Pnt AnchorPoint();
//! @return the measured shape. //! @return the measured shape.
const TopoDS_Shape& Shape() const const TopoDS_Shape& Shape() const { return myShape; }
{
return myShape;
}
public: public:
@ -126,11 +117,7 @@ public:
Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE; Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE;
Standard_EXPORT virtual const gp_Pnt GetTextPosition() const Standard_OVERRIDE; Standard_EXPORT virtual gp_Pnt GetTextPosition() const Standard_OVERRIDE;
public:
DEFINE_STANDARD_RTTIEXT(AIS_DiameterDimension,AIS_Dimension)
protected: protected:
@ -182,4 +169,4 @@ private:
TopoDS_Shape myShape; TopoDS_Shape myShape;
}; };
#endif // _AIS_DiameterDimension_HeaderFile #endif // _PrsDim_DiameterDimension_HeaderFile

View File

@ -13,10 +13,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <AIS_Dimension.hxx> #include <PrsDim_Dimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_DimensionOwner.hxx> #include <PrsDim_DimensionOwner.hxx>
#include <Adaptor3d_HCurve.hxx> #include <Adaptor3d_HCurve.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
@ -74,8 +74,7 @@
#include <UnitsAPI.hxx> #include <UnitsAPI.hxx>
#include <UnitsAPI_SystemUnits.hxx> #include <UnitsAPI_SystemUnits.hxx>
IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Dimension, AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(AIS_Dimension,AIS_InteractiveObject)
namespace namespace
{ {
@ -96,7 +95,7 @@ namespace
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_Dimension::AIS_Dimension (const AIS_KindOfDimension theType) PrsDim_Dimension::PrsDim_Dimension (const PrsDim_KindOfDimension theType)
: AIS_InteractiveObject (), : AIS_InteractiveObject (),
mySelToleranceForText2d(0.0), mySelToleranceForText2d(0.0),
myValueType (ValueType_Computed), myValueType (ValueType_Computed),
@ -104,7 +103,7 @@ AIS_Dimension::AIS_Dimension (const AIS_KindOfDimension theType)
myCustomStringValue (), myCustomStringValue (),
myIsTextPositionFixed (Standard_False), myIsTextPositionFixed (Standard_False),
mySpecialSymbol (' '), mySpecialSymbol (' '),
myDisplaySpecialSymbol (AIS_DSS_No), myDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No),
myGeometryType (GeometryType_UndefShapes), myGeometryType (GeometryType_UndefShapes),
myIsPlaneCustom (Standard_False), myIsPlaneCustom (Standard_False),
myFlyout (0.0), myFlyout (0.0),
@ -117,7 +116,7 @@ AIS_Dimension::AIS_Dimension (const AIS_KindOfDimension theType)
//function : SetCustomValue //function : SetCustomValue
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::SetCustomValue (const Standard_Real theValue) void PrsDim_Dimension::SetCustomValue (const Standard_Real theValue)
{ {
if (myValueType == ValueType_CustomReal && myCustomValue == theValue) if (myValueType == ValueType_CustomReal && myCustomValue == theValue)
{ {
@ -134,7 +133,7 @@ void AIS_Dimension::SetCustomValue (const Standard_Real theValue)
//function : SetCustomValue //function : SetCustomValue
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::SetCustomValue (const TCollection_ExtendedString& theValue) void PrsDim_Dimension::SetCustomValue (const TCollection_ExtendedString& theValue)
{ {
if (myValueType == ValueType_CustomText && myCustomStringValue == theValue) if (myValueType == ValueType_CustomText && myCustomStringValue == theValue)
{ {
@ -147,29 +146,11 @@ void AIS_Dimension::SetCustomValue (const TCollection_ExtendedString& theValue)
SetToUpdate(); SetToUpdate();
} }
//=======================================================================
//function : GetCustomValue
//purpose :
//=======================================================================
const TCollection_ExtendedString& AIS_Dimension::GetCustomValue () const
{
return myCustomStringValue;
}
//=======================================================================
//function : GetPlane
//purpose :
//=======================================================================
const gp_Pln& AIS_Dimension::GetPlane() const
{
return myPlane;
}
//======================================================================= //=======================================================================
//function : SetUserPlane //function : SetUserPlane
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::SetCustomPlane (const gp_Pln& thePlane) void PrsDim_Dimension::SetCustomPlane (const gp_Pln& thePlane)
{ {
myPlane = thePlane; myPlane = thePlane;
myIsPlaneCustom = Standard_True; myIsPlaneCustom = Standard_True;
@ -188,7 +169,7 @@ void AIS_Dimension::SetCustomPlane (const gp_Pln& thePlane)
//function : SetDimensionAspect //function : SetDimensionAspect
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theDimensionAspect) void PrsDim_Dimension::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theDimensionAspect)
{ {
myDrawer->SetDimensionAspect (theDimensionAspect); myDrawer->SetDimensionAspect (theDimensionAspect);
@ -199,7 +180,7 @@ void AIS_Dimension::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& the
//function : SetDisplaySpecialSymbol //function : SetDisplaySpecialSymbol
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::SetDisplaySpecialSymbol (const AIS_DisplaySpecialSymbol theDisplaySpecSymbol) void PrsDim_Dimension::SetDisplaySpecialSymbol (const PrsDim_DisplaySpecialSymbol theDisplaySpecSymbol)
{ {
if (myDisplaySpecialSymbol == theDisplaySpecSymbol) if (myDisplaySpecialSymbol == theDisplaySpecSymbol)
{ {
@ -215,7 +196,7 @@ void AIS_Dimension::SetDisplaySpecialSymbol (const AIS_DisplaySpecialSymbol theD
//function : SetSpecialSymbol //function : SetSpecialSymbol
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::SetSpecialSymbol (const Standard_ExtCharacter theSpecialSymbol) void PrsDim_Dimension::SetSpecialSymbol (const Standard_ExtCharacter theSpecialSymbol)
{ {
if (mySpecialSymbol == theSpecialSymbol) if (mySpecialSymbol == theSpecialSymbol)
{ {
@ -231,7 +212,7 @@ void AIS_Dimension::SetSpecialSymbol (const Standard_ExtCharacter theSpecialSymb
//function : SetSelToleranceForText2d //function : SetSelToleranceForText2d
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::SetSelToleranceForText2d (const Standard_Real theTol) void PrsDim_Dimension::SetSelToleranceForText2d (const Standard_Real theTol)
{ {
if (mySelToleranceForText2d == theTol) if (mySelToleranceForText2d == theTol)
{ {
@ -247,7 +228,7 @@ void AIS_Dimension::SetSelToleranceForText2d (const Standard_Real theTol)
//function : SetFlyout //function : SetFlyout
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::SetFlyout (const Standard_Real theFlyout) void PrsDim_Dimension::SetFlyout (const Standard_Real theFlyout)
{ {
if (myFlyout == theFlyout) if (myFlyout == theFlyout)
{ {
@ -266,7 +247,7 @@ void AIS_Dimension::SetFlyout (const Standard_Real theFlyout)
//function : GetDisplayUnits //function : GetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_Dimension::GetDisplayUnits() const const TCollection_AsciiString& PrsDim_Dimension::GetDisplayUnits() const
{ {
return THE_UNDEFINED_UNITS; return THE_UNDEFINED_UNITS;
} }
@ -275,7 +256,7 @@ const TCollection_AsciiString& AIS_Dimension::GetDisplayUnits() const
//function : GetModelUnits //function : GetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_Dimension::GetModelUnits() const const TCollection_AsciiString& PrsDim_Dimension::GetModelUnits() const
{ {
return THE_UNDEFINED_UNITS; return THE_UNDEFINED_UNITS;
} }
@ -284,7 +265,7 @@ const TCollection_AsciiString& AIS_Dimension::GetModelUnits() const
//function : ValueToDisplayUnits //function : ValueToDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real AIS_Dimension::ValueToDisplayUnits() const Standard_Real PrsDim_Dimension::ValueToDisplayUnits() const
{ {
return UnitsAPI::AnyToAny (GetValue(), return UnitsAPI::AnyToAny (GetValue(),
GetModelUnits().ToCString(), GetModelUnits().ToCString(),
@ -295,7 +276,7 @@ Standard_Real AIS_Dimension::ValueToDisplayUnits() const
//function : GetValueString //function : GetValueString
//purpose : //purpose :
//======================================================================= //=======================================================================
TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidth) const TCollection_ExtendedString PrsDim_Dimension::GetValueString (Standard_Real& theWidth) const
{ {
TCollection_ExtendedString aValueStr; TCollection_ExtendedString aValueStr;
if (myValueType == ValueType_CustomText) if (myValueType == ValueType_CustomText)
@ -321,9 +302,9 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt
switch (myDisplaySpecialSymbol) switch (myDisplaySpecialSymbol)
{ {
case AIS_DSS_Before : aValueStr.Insert (1, mySpecialSymbol); break; case PrsDim_DisplaySpecialSymbol_Before: aValueStr.Insert (1, mySpecialSymbol); break;
case AIS_DSS_After : aValueStr.Insert (aValueStr.Length() + 1, mySpecialSymbol); break; case PrsDim_DisplaySpecialSymbol_After: aValueStr.Insert (aValueStr.Length() + 1, mySpecialSymbol); break;
case AIS_DSS_No : break; case PrsDim_DisplaySpecialSymbol_No: break;
} }
// Get text style parameters // Get text style parameters
@ -370,7 +351,7 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt
//function : DrawArrow //function : DrawArrow
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation, void PrsDim_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation,
const gp_Pnt& theLocation, const gp_Pnt& theLocation,
const gp_Dir& theDirection) const gp_Dir& theDirection)
{ {
@ -426,7 +407,7 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation
//function : drawText //function : drawText
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation, void PrsDim_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
const gp_Pnt& theTextPos, const gp_Pnt& theTextPos,
const gp_Dir& theTextDir, const gp_Dir& theTextDir,
const TCollection_ExtendedString& theText, const TCollection_ExtendedString& theText,
@ -585,7 +566,7 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation,
//function : DrawExtension //function : DrawExtension
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresentation, void PrsDim_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Real theExtensionSize, const Standard_Real theExtensionSize,
const gp_Pnt& theExtensionStart, const gp_Pnt& theExtensionStart,
const gp_Dir& theExtensionDir, const gp_Dir& theExtensionDir,
@ -654,7 +635,7 @@ void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresenta
//function : DrawLinearDimension //function : DrawLinearDimension
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePresentation, void PrsDim_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode, const Standard_Integer theMode,
const gp_Pnt& theFirstPoint, const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
@ -1002,7 +983,7 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr
//function : ComputeFlyoutLinePoints //function : ComputeFlyoutLinePoints
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint, void PrsDim_Dimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint) gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint)
{ {
// compute dimension line points // compute dimension line points
@ -1023,7 +1004,7 @@ void AIS_Dimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const
//function : ComputeLinearFlyouts //function : ComputeLinearFlyouts
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::ComputeLinearFlyouts (const Handle(SelectMgr_Selection)& theSelection, void PrsDim_Dimension::ComputeLinearFlyouts (const Handle(SelectMgr_Selection)& theSelection,
const Handle(SelectMgr_EntityOwner)& theOwner, const Handle(SelectMgr_EntityOwner)& theOwner,
const gp_Pnt& theFirstPoint, const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint) const gp_Pnt& theSecondPoint)
@ -1054,7 +1035,7 @@ void AIS_Dimension::ComputeLinearFlyouts (const Handle(SelectMgr_Selection)& the
//function : CircleFromPlanarFace //function : CircleFromPlanarFace
//purpose : if possible computes circle from planar face //purpose : if possible computes circle from planar face
//======================================================================= //=======================================================================
Standard_Boolean AIS_Dimension::CircleFromPlanarFace (const TopoDS_Face& theFace, Standard_Boolean PrsDim_Dimension::CircleFromPlanarFace (const TopoDS_Face& theFace,
Handle(Geom_Curve)& theCurve, Handle(Geom_Curve)& theCurve,
gp_Pnt& theFirstPoint, gp_Pnt& theFirstPoint,
gp_Pnt& theLastPoint) gp_Pnt& theLastPoint)
@ -1063,7 +1044,7 @@ Standard_Boolean AIS_Dimension::CircleFromPlanarFace (const TopoDS_Face& theFace
for ( ; anIt.More(); anIt.Next()) for ( ; anIt.More(); anIt.Next())
{ {
TopoDS_Edge aCurEdge = TopoDS::Edge (anIt.Current()); TopoDS_Edge aCurEdge = TopoDS::Edge (anIt.Current());
if (AIS::ComputeGeometry (aCurEdge, theCurve, theFirstPoint, theLastPoint)) if (PrsDim::ComputeGeometry (aCurEdge, theCurve, theFirstPoint, theLastPoint))
{ {
if (theCurve->IsInstance (STANDARD_TYPE(Geom_Circle))) if (theCurve->IsInstance (STANDARD_TYPE(Geom_Circle)))
{ {
@ -1078,7 +1059,7 @@ Standard_Boolean AIS_Dimension::CircleFromPlanarFace (const TopoDS_Face& theFace
//function : CircleFromEdge //function : CircleFromEdge
//purpose : if possible computes circle from edge //purpose : if possible computes circle from edge
//======================================================================= //=======================================================================
Standard_Boolean AIS_Dimension::CircleFromEdge (const TopoDS_Edge& theEdge, Standard_Boolean PrsDim_Dimension::CircleFromEdge (const TopoDS_Edge& theEdge,
gp_Circ& theCircle, gp_Circ& theCircle,
gp_Pnt& theFirstPoint, gp_Pnt& theFirstPoint,
gp_Pnt& theLastPoint) gp_Pnt& theLastPoint)
@ -1120,14 +1101,14 @@ Standard_Boolean AIS_Dimension::CircleFromEdge (const TopoDS_Edge& theEdge,
//function : InitCircularDimension //function : InitCircularDimension
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theShape, Standard_Boolean PrsDim_Dimension::InitCircularDimension (const TopoDS_Shape& theShape,
gp_Circ& theCircle, gp_Circ& theCircle,
gp_Pnt& theMiddleArcPoint, gp_Pnt& theMiddleArcPoint,
Standard_Boolean& theIsClosed) Standard_Boolean& theIsClosed)
{ {
gp_Pln aPln; gp_Pln aPln;
Handle(Geom_Surface) aBasisSurf; Handle(Geom_Surface) aBasisSurf;
AIS_KindOfSurface aSurfType = AIS_KOS_OtherSurface; PrsDim_KindOfSurface aSurfType = PrsDim_KOS_OtherSurface;
gp_Pnt aFirstPoint, aLastPoint; gp_Pnt aFirstPoint, aLastPoint;
Standard_Real anOffset = 0.0; Standard_Real anOffset = 0.0;
Standard_Real aFirstParam = 0.0; Standard_Real aFirstParam = 0.0;
@ -1138,9 +1119,9 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh
{ {
case TopAbs_FACE: case TopAbs_FACE:
{ {
AIS::GetPlaneFromFace (TopoDS::Face (theShape), aPln, aBasisSurf, aSurfType, anOffset); PrsDim::GetPlaneFromFace (TopoDS::Face (theShape), aPln, aBasisSurf, aSurfType, anOffset);
if (aSurfType == AIS_KOS_Plane) if (aSurfType == PrsDim_KOS_Plane)
{ {
Handle(Geom_Curve) aCurve; Handle(Geom_Curve) aCurve;
if (!CircleFromPlanarFace (TopoDS::Face (theShape), aCurve, aFirstPoint, aLastPoint)) if (!CircleFromPlanarFace (TopoDS::Face (theShape), aCurve, aFirstPoint, aLastPoint))
@ -1163,13 +1144,13 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh
aSurf1.D0 (aMidU, aMidV, aCurPos); aSurf1.D0 (aMidU, aMidV, aCurPos);
Handle (Adaptor3d_HCurve) aBasisCurve; Handle (Adaptor3d_HCurve) aBasisCurve;
Standard_Boolean isExpectedType = Standard_False; Standard_Boolean isExpectedType = Standard_False;
if (aSurfType == AIS_KOS_Cylinder) if (aSurfType == PrsDim_KOS_Cylinder)
{ {
isExpectedType = Standard_True; isExpectedType = Standard_True;
} }
else else
{ {
if (aSurfType == AIS_KOS_Revolution) if (aSurfType == PrsDim_KOS_Revolution)
{ {
aBasisCurve = aSurf1.BasisCurve(); aBasisCurve = aSurf1.BasisCurve();
if (aBasisCurve->GetType() == GeomAbs_Line) if (aBasisCurve->GetType() == GeomAbs_Line)
@ -1177,7 +1158,7 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh
isExpectedType = Standard_True; isExpectedType = Standard_True;
} }
} }
else if (aSurfType == AIS_KOS_Extrusion) else if (aSurfType == PrsDim_KOS_Extrusion)
{ {
aBasisCurve = aSurf1.BasisCurve(); aBasisCurve = aSurf1.BasisCurve();
if (aBasisCurve->GetType() == GeomAbs_Circle) if (aBasisCurve->GetType() == GeomAbs_Circle)
@ -1230,7 +1211,7 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh
{ {
anEdge = TopoDS::Edge (anIt.Current()); anEdge = TopoDS::Edge (anIt.Current());
} }
if (!AIS_Dimension::CircleFromEdge (anEdge, theCircle, aFirstPoint, aLastPoint)) if (!PrsDim_Dimension::CircleFromEdge (anEdge, theCircle, aFirstPoint, aLastPoint))
{ {
return Standard_False; return Standard_False;
} }
@ -1239,7 +1220,7 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh
case TopAbs_EDGE: case TopAbs_EDGE:
{ {
TopoDS_Edge anEdge = TopoDS::Edge (theShape); TopoDS_Edge anEdge = TopoDS::Edge (theShape);
if (!AIS_Dimension::CircleFromEdge (anEdge, theCircle, aFirstPoint, aLastPoint)) if (!PrsDim_Dimension::CircleFromEdge (anEdge, theCircle, aFirstPoint, aLastPoint))
{ {
return Standard_False; return Standard_False;
} }
@ -1285,7 +1266,7 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh
//function : ComputeSelection //function : ComputeSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, void PrsDim_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) const Standard_Integer theMode)
{ {
if (!mySelectionGeom.IsComputed) if (!mySelectionGeom.IsComputed)
@ -1293,7 +1274,7 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele
return; return;
} }
AIS_DimensionSelectionMode aSelectionMode = (AIS_DimensionSelectionMode)theMode; PrsDim_DimensionSelectionMode aSelectionMode = (PrsDim_DimensionSelectionMode)theMode;
// init appropriate entity owner // init appropriate entity owner
Handle(SelectMgr_EntityOwner) aSensitiveOwner; Handle(SelectMgr_EntityOwner) aSensitiveOwner;
@ -1301,18 +1282,18 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele
switch (aSelectionMode) switch (aSelectionMode)
{ {
// neutral selection owner // neutral selection owner
case AIS_DSM_All : case PrsDim_DimensionSelectionMode_All:
aSensitiveOwner = new SelectMgr_EntityOwner (this, THE_NEUTRAL_SEL_PRIORITY); aSensitiveOwner = new SelectMgr_EntityOwner (this, THE_NEUTRAL_SEL_PRIORITY);
break; break;
// local selection owners // local selection owners
case AIS_DSM_Line : case PrsDim_DimensionSelectionMode_Line:
case AIS_DSM_Text : case PrsDim_DimensionSelectionMode_Text:
aSensitiveOwner = new AIS_DimensionOwner (this, aSelectionMode, THE_LOCAL_SEL_PRIORITY); aSensitiveOwner = new PrsDim_DimensionOwner (this, aSelectionMode, THE_LOCAL_SEL_PRIORITY);
break; break;
} }
if (aSelectionMode == AIS_DSM_All || aSelectionMode == AIS_DSM_Line) if (aSelectionMode == PrsDim_DimensionSelectionMode_All || aSelectionMode == PrsDim_DimensionSelectionMode_Line)
{ {
// sensitives for dimension line segments // sensitives for dimension line segments
Handle(Select3D_SensitiveGroup) aGroupOfSensitives = new Select3D_SensitiveGroup (aSensitiveOwner); Handle(Select3D_SensitiveGroup) aGroupOfSensitives = new Select3D_SensitiveGroup (aSensitiveOwner);
@ -1368,7 +1349,7 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele
} }
// sensitives for text element // sensitives for text element
if (aSelectionMode == AIS_DSM_All || aSelectionMode == AIS_DSM_Text) if (aSelectionMode == PrsDim_DimensionSelectionMode_All || aSelectionMode == PrsDim_DimensionSelectionMode_Text)
{ {
Handle(Select3D_SensitiveEntity) aTextSensitive; Handle(Select3D_SensitiveEntity) aTextSensitive;
@ -1415,7 +1396,7 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele
} }
// callback for flyout sensitive calculation // callback for flyout sensitive calculation
if (aSelectionMode == AIS_DSM_All) if (aSelectionMode == PrsDim_DimensionSelectionMode_All)
{ {
ComputeFlyoutSelection (theSelection, aSensitiveOwner); ComputeFlyoutSelection (theSelection, aSensitiveOwner);
} }
@ -1425,7 +1406,7 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele
//function : PointsForArrow //function : PointsForArrow
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::PointsForArrow (const gp_Pnt& thePeakPnt, void PrsDim_Dimension::PointsForArrow (const gp_Pnt& thePeakPnt,
const gp_Dir& theDirection, const gp_Dir& theDirection,
const gp_Dir& thePlane, const gp_Dir& thePlane,
const Standard_Real theArrowLength, const Standard_Real theArrowLength,
@ -1447,7 +1428,7 @@ void AIS_Dimension::PointsForArrow (const gp_Pnt& thePeakPnt,
//function : GetTextPositionForLinear //function : GetTextPositionForLinear
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS_Dimension::GetTextPositionForLinear (const gp_Pnt& theFirstPoint, gp_Pnt PrsDim_Dimension::GetTextPositionForLinear (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
const Standard_Boolean theIsOneSide) const const Standard_Boolean theIsOneSide) const
{ {
@ -1522,7 +1503,7 @@ gp_Pnt AIS_Dimension::GetTextPositionForLinear (const gp_Pnt& theFirstPoint,
//function : AdjustParametersForLinear //function : AdjustParametersForLinear
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_Dimension::AdjustParametersForLinear (const gp_Pnt& theTextPos, Standard_Boolean PrsDim_Dimension::AdjustParametersForLinear (const gp_Pnt& theTextPos,
const gp_Pnt& theFirstPoint, const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
Standard_Real& theExtensionSize, Standard_Real& theExtensionSize,
@ -1605,7 +1586,7 @@ Standard_Boolean AIS_Dimension::AdjustParametersForLinear (const gp_Pnt& theText
//function : FitTextAlignmentForLinear //function : FitTextAlignmentForLinear
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::FitTextAlignmentForLinear (const gp_Pnt& theFirstPoint, void PrsDim_Dimension::FitTextAlignmentForLinear (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
const Standard_Boolean theIsOneSide, const Standard_Boolean theIsOneSide,
const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos, const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos,
@ -1697,7 +1678,7 @@ void AIS_Dimension::FitTextAlignmentForLinear (const gp_Pnt& theFirstPoint,
//function : UnsetFixedTextPosition //function : UnsetFixedTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Dimension::UnsetFixedTextPosition() void PrsDim_Dimension::UnsetFixedTextPosition()
{ {
myIsTextPositionFixed = Standard_False; myIsTextPositionFixed = Standard_False;
myFixedTextPosition = gp::Origin(); myFixedTextPosition = gp::Origin();

View File

@ -13,16 +13,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_Dimension_HeaderFile #ifndef _PrsDim_Dimension_HeaderFile
#define _AIS_Dimension_HeaderFile #define _PrsDim_Dimension_HeaderFile
#include <AIS_DimensionSelectionMode.hxx> #include <PrsDim_DimensionSelectionMode.hxx>
#include <AIS_DimensionOwner.hxx> #include <PrsDim_DimensionOwner.hxx>
#include <AIS_DisplaySpecialSymbol.hxx> #include <PrsDim_DisplaySpecialSymbol.hxx>
#include <AIS_InteractiveObject.hxx> #include <AIS_InteractiveObject.hxx>
#include <AIS_KindOfInteractive.hxx> #include <AIS_KindOfInteractive.hxx>
#include <AIS_KindOfDimension.hxx> #include <PrsDim_KindOfDimension.hxx>
#include <AIS_KindOfSurface.hxx> #include <PrsDim_KindOfSurface.hxx>
#include <Geom_Curve.hxx> #include <Geom_Curve.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <Prs3d_ArrowAspect.hxx> #include <Prs3d_ArrowAspect.hxx>
@ -42,10 +42,9 @@
#include <NCollection_Sequence.hxx> #include <NCollection_Sequence.hxx>
#include <NCollection_Handle.hxx> #include <NCollection_Handle.hxx>
class AIS_Dimension; DEFINE_STANDARD_HANDLE(PrsDim_Dimension, AIS_InteractiveObject)
DEFINE_STANDARD_HANDLE(AIS_Dimension, AIS_InteractiveObject)
//! AIS_Dimension is a base class for 2D presentations of linear (length, diameter, radius) //! PrsDim_Dimension is a base class for 2D presentations of linear (length, diameter, radius)
//! and angular dimensions. //! and angular dimensions.
//! //!
//! The dimensions provide measurement of quantities, such as lengths or plane angles. //! The dimensions provide measurement of quantities, such as lengths or plane angles.
@ -131,7 +130,7 @@ DEFINE_STANDARD_HANDLE(AIS_Dimension, AIS_InteractiveObject)
//! //!
//! The dimension support two local selection modes: main dimension line selection and text label //! The dimension support two local selection modes: main dimension line selection and text label
//! selection. These modes can be used to develop interactive modification of dimension presentations. //! selection. These modes can be used to develop interactive modification of dimension presentations.
//! The component highlighting in these selection modes is provided by AIS_DimensionOwner class. //! The component highlighting in these selection modes is provided by PrsDim_DimensionOwner class.
//! Please note that selection is unavailable until the presentation is computed. //! Please note that selection is unavailable until the presentation is computed.
//! //!
//! The specific drawing attributes are controlled through Prs3d_DimensionAspect. The one can change //! The specific drawing attributes are controlled through Prs3d_DimensionAspect. The one can change
@ -164,9 +163,9 @@ DEFINE_STANDARD_HANDLE(AIS_Dimension, AIS_InteractiveObject)
//! it can be converted to the text position by calling the method GetTextPosition(). In this case //! it can be converted to the text position by calling the method GetTextPosition(). In this case
//! the text position is NOT fixed, and SetMeasureGeometry() without user-defined plane adjusts //! the text position is NOT fixed, and SetMeasureGeometry() without user-defined plane adjusts
//! the automatic plane according input geometry (if it is possible). //! the automatic plane according input geometry (if it is possible).
//! class PrsDim_Dimension : public AIS_InteractiveObject
class AIS_Dimension : public AIS_InteractiveObject
{ {
DEFINE_STANDARD_RTTIEXT(PrsDim_Dimension, AIS_InteractiveObject)
protected: protected:
//! Geometry type defines type of shapes on which the dimension is to be built. //! Geometry type defines type of shapes on which the dimension is to be built.
@ -225,7 +224,7 @@ public:
//! Constructor with default parameters values. //! Constructor with default parameters values.
//! @param theType [in] the type of dimension. //! @param theType [in] the type of dimension.
Standard_EXPORT AIS_Dimension (const AIS_KindOfDimension theType); Standard_EXPORT PrsDim_Dimension (const PrsDim_KindOfDimension theType);
//! Gets dimension measurement value. If the value to display is not //! Gets dimension measurement value. If the value to display is not
//! specified by user, then the dimension object is responsible to //! specified by user, then the dimension object is responsible to
@ -256,7 +255,7 @@ public:
//! Gets user-defined dimension value. //! Gets user-defined dimension value.
//! @return dimension value string. //! @return dimension value string.
Standard_EXPORT const TCollection_ExtendedString& GetCustomValue () const; const TCollection_ExtendedString& GetCustomValue() const { return myCustomStringValue; }
//! Get the dimension plane in which the 2D dimension presentation is computed. //! Get the dimension plane in which the 2D dimension presentation is computed.
//! By default, if plane is not defined by user, it is computed automatically //! By default, if plane is not defined by user, it is computed automatically
@ -267,7 +266,7 @@ public:
//! If user-defined plane allow geometry placement on it, it will be used for //! If user-defined plane allow geometry placement on it, it will be used for
//! computing of the dimension presentation. //! computing of the dimension presentation.
//! @return dimension plane used for presentation computing. //! @return dimension plane used for presentation computing.
Standard_EXPORT const gp_Pln& GetPlane() const; const gp_Pln& GetPlane() const { return myPlane; }
//! Geometry type defines type of shapes on which the dimension is to be built. //! Geometry type defines type of shapes on which the dimension is to be built.
//! @return type of geometry on which the dimension will be built. //! @return type of geometry on which the dimension will be built.
@ -297,7 +296,7 @@ public:
//! Computes absolute text position from dimension parameters //! Computes absolute text position from dimension parameters
//! (flyout, plane and text alignment). //! (flyout, plane and text alignment).
virtual const gp_Pnt GetTextPosition () const { return gp_Pnt(); } virtual gp_Pnt GetTextPosition () const { return gp_Pnt(); }
public: public:
@ -314,16 +313,10 @@ public:
Standard_EXPORT void SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theDimensionAspect); Standard_EXPORT void SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theDimensionAspect);
//! @return the kind of dimension. //! @return the kind of dimension.
AIS_KindOfDimension KindOfDimension() const PrsDim_KindOfDimension KindOfDimension() const { return myKindOfDimension; }
{
return myKindOfDimension;
}
//! @return the kind of interactive. //! @return the kind of interactive.
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Dimension; }
{
return AIS_KOI_Dimension;
}
//! Returns true if the class of objects accepts the display mode theMode. //! Returns true if the class of objects accepts the display mode theMode.
//! The interactive context can have a default mode of representation for //! The interactive context can have a default mode of representation for
@ -336,13 +329,10 @@ public:
public: public:
//! @return dimension special symbol display options. //! @return dimension special symbol display options.
AIS_DisplaySpecialSymbol DisplaySpecialSymbol() const PrsDim_DisplaySpecialSymbol DisplaySpecialSymbol() const { return myDisplaySpecialSymbol; }
{
return myDisplaySpecialSymbol;
}
//! Specifies whether to display special symbol or not. //! Specifies whether to display special symbol or not.
Standard_EXPORT void SetDisplaySpecialSymbol (const AIS_DisplaySpecialSymbol theDisplaySpecSymbol); Standard_EXPORT void SetDisplaySpecialSymbol (const PrsDim_DisplaySpecialSymbol theDisplaySpecSymbol);
//! @return special symbol. //! @return special symbol.
Standard_ExtCharacter SpecialSymbol() const Standard_ExtCharacter SpecialSymbol() const
@ -398,10 +388,6 @@ public:
return myIsGeometryValid && CheckPlane (GetPlane()); return myIsGeometryValid && CheckPlane (GetPlane());
} }
public:
DEFINE_STANDARD_RTTIEXT(AIS_Dimension,AIS_InteractiveObject)
protected: protected:
Standard_EXPORT Standard_Real ValueToDisplayUnits() const; Standard_EXPORT Standard_Real ValueToDisplayUnits() const;
@ -692,7 +678,7 @@ protected: //! @name Fixed text position properties
protected: //! @name Units properties protected: //! @name Units properties
Standard_ExtCharacter mySpecialSymbol; //!< Special symbol. Standard_ExtCharacter mySpecialSymbol; //!< Special symbol.
AIS_DisplaySpecialSymbol myDisplaySpecialSymbol; //!< Special symbol display options. PrsDim_DisplaySpecialSymbol myDisplaySpecialSymbol; //!< Special symbol display options.
protected: //! @name Geometrical properties protected: //! @name Geometrical properties
@ -705,7 +691,7 @@ protected: //! @name Geometrical properties
private: private:
AIS_KindOfDimension myKindOfDimension; PrsDim_KindOfDimension myKindOfDimension;
}; };
#endif // _AIS_Dimension_HeaderFile #endif // _PrsDim_Dimension_HeaderFile

View File

@ -14,16 +14,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <AIS_DimensionOwner.hxx> #include <PrsDim_DimensionOwner.hxx>
#include <AIS_Dimension.hxx> #include <PrsDim_Dimension.hxx>
#include <PrsMgr_PresentationManager.hxx> #include <PrsMgr_PresentationManager.hxx>
#include <SelectMgr_SelectableObject.hxx> #include <SelectMgr_SelectableObject.hxx>
#include <Standard_Type.hxx> #include <Standard_Type.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_DimensionOwner,SelectMgr_EntityOwner) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_DimensionOwner, SelectMgr_EntityOwner)
namespace namespace
{ {
@ -31,14 +31,14 @@ namespace
//function : HighlightMode //function : HighlightMode
//purpose : Return corresponding compute mode for selection type. //purpose : Return corresponding compute mode for selection type.
//======================================================================= //=======================================================================
static AIS_Dimension::ComputeMode HighlightMode (const Standard_Integer theSelMode) static PrsDim_Dimension::ComputeMode HighlightMode (const Standard_Integer theSelMode)
{ {
switch (theSelMode) switch (theSelMode)
{ {
case AIS_DSM_Line : return AIS_Dimension::ComputeMode_Line; case PrsDim_DimensionSelectionMode_Line: return PrsDim_Dimension::ComputeMode_Line;
case AIS_DSM_Text : return AIS_Dimension::ComputeMode_Text; case PrsDim_DimensionSelectionMode_Text: return PrsDim_Dimension::ComputeMode_Text;
default: default:
return AIS_Dimension::ComputeMode_All; return PrsDim_Dimension::ComputeMode_All;
} }
} }
} }
@ -47,28 +47,19 @@ namespace
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_DimensionOwner::AIS_DimensionOwner (const Handle(SelectMgr_SelectableObject)& theSelObject, PrsDim_DimensionOwner::PrsDim_DimensionOwner (const Handle(SelectMgr_SelectableObject)& theSelObject,
const AIS_DimensionSelectionMode theMode, const PrsDim_DimensionSelectionMode theMode,
const Standard_Integer thePriority) const Standard_Integer thePriority)
: SelectMgr_EntityOwner(theSelObject, thePriority), : SelectMgr_EntityOwner(theSelObject, thePriority),
mySelectionMode (theMode) mySelectionMode (theMode)
{ {
} }
//=======================================================================
//function : AIS_DimensionSelectionMode
//purpose :
//=======================================================================
AIS_DimensionSelectionMode AIS_DimensionOwner::SelectionMode () const
{
return mySelectionMode;
}
//======================================================================= //=======================================================================
//function : IsHilighted //function : IsHilighted
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_DimensionOwner::IsHilighted (const Handle(PrsMgr_PresentationManager)& thePM, Standard_Boolean PrsDim_DimensionOwner::IsHilighted (const Handle(PrsMgr_PresentationManager)& thePM,
const Standard_Integer /*theMode*/) const const Standard_Integer /*theMode*/) const
{ {
if (!HasSelectable()) if (!HasSelectable())
@ -83,7 +74,7 @@ Standard_Boolean AIS_DimensionOwner::IsHilighted (const Handle(PrsMgr_Presentati
//function : Unhilight //function : Unhilight
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DimensionOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& thePM, void PrsDim_DimensionOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& thePM,
const Standard_Integer /*theMode*/) const Standard_Integer /*theMode*/)
{ {
if (!HasSelectable()) if (!HasSelectable())
@ -98,7 +89,7 @@ void AIS_DimensionOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& th
//function : HilightWithColor //function : HilightWithColor
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_DimensionOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM, void PrsDim_DimensionOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
const Handle(Prs3d_Drawer)& theStyle, const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer /*theMode*/) const Standard_Integer /*theMode*/)
{ {

View File

@ -14,13 +14,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_DimensionOwner_HeaderFile #ifndef _PrsDim_DimensionOwner_HeaderFile
#define _AIS_DimensionOwner_HeaderFile #define _PrsDim_DimensionOwner_HeaderFile
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_Type.hxx> #include <Standard_Type.hxx>
#include <AIS_DimensionSelectionMode.hxx> #include <PrsDim_DimensionSelectionMode.hxx>
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <PrsMgr_PresentationManager3d.hxx> #include <PrsMgr_PresentationManager3d.hxx>
@ -30,7 +30,7 @@
class SelectMgr_SelectableObject; class SelectMgr_SelectableObject;
class PrsMgr_PresentationManager; class PrsMgr_PresentationManager;
DEFINE_STANDARD_HANDLE(AIS_DimensionOwner, SelectMgr_EntityOwner) DEFINE_STANDARD_HANDLE(PrsDim_DimensionOwner, SelectMgr_EntityOwner)
//! The owner is the entity which makes it possible to link //! The owner is the entity which makes it possible to link
//! the sensitive primitives and the reference shapes that //! the sensitive primitives and the reference shapes that
@ -43,16 +43,16 @@ DEFINE_STANDARD_HANDLE(AIS_DimensionOwner, SelectMgr_EntityOwner)
//! higher priority to the one compared to the other. An //! higher priority to the one compared to the other. An
//! edge, could have priority 5, for example, and a face, //! edge, could have priority 5, for example, and a face,
//! priority 4. The default priority is 5. //! priority 4. The default priority is 5.
class AIS_DimensionOwner : public SelectMgr_EntityOwner class PrsDim_DimensionOwner : public SelectMgr_EntityOwner
{ {
DEFINE_STANDARD_RTTIEXT(AIS_DimensionOwner, SelectMgr_EntityOwner) DEFINE_STANDARD_RTTIEXT(PrsDim_DimensionOwner, SelectMgr_EntityOwner)
public: public:
//! Initializes the dimension owner, theSO, and attributes it //! Initializes the dimension owner, theSO, and attributes it
//! the priority, thePriority. //! the priority, thePriority.
Standard_EXPORT AIS_DimensionOwner(const Handle(SelectMgr_SelectableObject)& theSelObject, const AIS_DimensionSelectionMode theSelMode, const Standard_Integer thePriority = 0); Standard_EXPORT PrsDim_DimensionOwner(const Handle(SelectMgr_SelectableObject)& theSelObject, const PrsDim_DimensionSelectionMode theSelMode, const Standard_Integer thePriority = 0);
Standard_EXPORT AIS_DimensionSelectionMode SelectionMode() const; PrsDim_DimensionSelectionMode SelectionMode() const { return mySelectionMode; }
Standard_EXPORT virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM, Standard_EXPORT virtual void HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM,
const Handle(Prs3d_Drawer)& theStyle, const Handle(Prs3d_Drawer)& theStyle,
@ -67,7 +67,7 @@ public:
private: private:
AIS_DimensionSelectionMode mySelectionMode; PrsDim_DimensionSelectionMode mySelectionMode;
}; };

View File

@ -14,15 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_DimensionSelectionMode_HeaderFile #ifndef _PrsDim_DimensionSelectionMode_HeaderFile
#define _AIS_DimensionSelectionMode_HeaderFile #define _PrsDim_DimensionSelectionMode_HeaderFile
//! Specifies dimension selection modes. //! Specifies dimension selection modes.
enum AIS_DimensionSelectionMode enum PrsDim_DimensionSelectionMode
{ {
AIS_DSM_All, PrsDim_DimensionSelectionMode_All,
AIS_DSM_Line, PrsDim_DimensionSelectionMode_Line,
AIS_DSM_Text PrsDim_DimensionSelectionMode_Text
}; };
#endif // _AIS_DimensionSelectionMode_HeaderFile #endif // _PrsDim_DimensionSelectionMode_HeaderFile

View File

@ -14,15 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_DisplaySpecialSymbol_HeaderFile #ifndef _PrsDim_DisplaySpecialSymbol_HeaderFile
#define _AIS_DisplaySpecialSymbol_HeaderFile #define _PrsDim_DisplaySpecialSymbol_HeaderFile
//! Specifies dimension special symbol display options //! Specifies dimension special symbol display options
enum AIS_DisplaySpecialSymbol enum PrsDim_DisplaySpecialSymbol
{ {
AIS_DSS_No, PrsDim_DisplaySpecialSymbol_No,
AIS_DSS_Before, PrsDim_DisplaySpecialSymbol_Before,
AIS_DSS_After PrsDim_DisplaySpecialSymbol_After
}; };
#endif // _AIS_DisplaySpecialSymbol_HeaderFile #endif // _PrsDim_DisplaySpecialSymbol_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_EllipseRadiusDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_EllipseRadiusDimension.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
@ -40,21 +40,20 @@
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Vec.hxx> #include <gp_Vec.hxx>
#include <Precision.hxx> #include <Precision.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_EllipseRadiusDimension,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_EllipseRadiusDimension, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : AIS_EllipseRadiusDimension //function : PrsDim_EllipseRadiusDimension
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_EllipseRadiusDimension::AIS_EllipseRadiusDimension(const TopoDS_Shape& aShape, PrsDim_EllipseRadiusDimension::PrsDim_EllipseRadiusDimension(const TopoDS_Shape& aShape,
const TCollection_ExtendedString& aText) const TCollection_ExtendedString& aText)
:AIS_Relation() :PrsDim_Relation()
{ {
myFShape = aShape; myFShape = aShape;
myText = aText; myText = aText;
@ -66,7 +65,7 @@ AIS_EllipseRadiusDimension::AIS_EllipseRadiusDimension(const TopoDS_Shape& aShap
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EllipseRadiusDimension::ComputeGeometry() void PrsDim_EllipseRadiusDimension::ComputeGeometry()
{ {
switch (myFShape.ShapeType()) { switch (myFShape.ShapeType()) {
@ -95,20 +94,20 @@ void AIS_EllipseRadiusDimension::ComputeGeometry()
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EllipseRadiusDimension::ComputeFaceGeometry() void PrsDim_EllipseRadiusDimension::ComputeFaceGeometry()
{ {
gp_Pln aPln; gp_Pln aPln;
Handle( Geom_Surface ) aBasisSurf; Handle( Geom_Surface ) aBasisSurf;
AIS_KindOfSurface aSurfType; PrsDim_KindOfSurface aSurfType;
Standard_Real Offset; Standard_Real Offset;
AIS::GetPlaneFromFace( TopoDS::Face( myFShape), PrsDim::GetPlaneFromFace( TopoDS::Face( myFShape),
aPln, aPln,
aBasisSurf, aBasisSurf,
aSurfType, aSurfType,
Offset ) ; Offset ) ;
if ( aSurfType == AIS_KOS_Plane ) if ( aSurfType == PrsDim_KOS_Plane )
ComputePlanarFaceGeometry( ); ComputePlanarFaceGeometry( );
else else
ComputeCylFaceGeometry( aSurfType, aBasisSurf, Offset ); ComputeCylFaceGeometry( aSurfType, aBasisSurf, Offset );
@ -120,7 +119,7 @@ void AIS_EllipseRadiusDimension::ComputeFaceGeometry()
//purpose : defines Ellipse and plane of dimension //purpose : defines Ellipse and plane of dimension
//======================================================================= //=======================================================================
void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface aSurfType, void PrsDim_EllipseRadiusDimension::ComputeCylFaceGeometry(const PrsDim_KindOfSurface aSurfType,
const Handle( Geom_Surface )& aBasisSurf, const Handle( Geom_Surface )& aBasisSurf,
const Standard_Real Offset) const Standard_Real Offset)
{ {
@ -133,7 +132,7 @@ void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface
gp_Pln aPlane; gp_Pln aPlane;
gp_Ax1 Axis; gp_Ax1 Axis;
// Standard_Real Param; // Standard_Real Param;
if (aSurfType == AIS_KOS_Extrusion) if (aSurfType == PrsDim_KOS_Extrusion)
{ {
Axis.SetDirection((Handle( Geom_SurfaceOfLinearExtrusion )::DownCast( aBasisSurf )) Axis.SetDirection((Handle( Geom_SurfaceOfLinearExtrusion )::DownCast( aBasisSurf ))
->Direction() ); ->Direction() );
@ -164,7 +163,7 @@ void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface
} }
else else
{ {
throw Standard_ConstructionError("AIS:: Not expected type of surface") ; throw Standard_ConstructionError("PrsDim:: Not expected type of surface") ;
return; return;
} }
@ -174,7 +173,7 @@ void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface
{ {
if(Offset <0.0 && Abs(Offset) > myEllipse.MinorRadius ()) if(Offset <0.0 && Abs(Offset) > myEllipse.MinorRadius ())
{ {
throw Standard_ConstructionError("AIS:: Absolute value of negative offset is larger than MinorRadius"); throw Standard_ConstructionError("PrsDim:: Absolute value of negative offset is larger than MinorRadius");
return; return;
} }
@ -199,7 +198,7 @@ void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EllipseRadiusDimension::ComputePlanarFaceGeometry() void PrsDim_EllipseRadiusDimension::ComputePlanarFaceGeometry()
{ {
Standard_Boolean find = Standard_False; Standard_Boolean find = Standard_False;
@ -210,7 +209,7 @@ void AIS_EllipseRadiusDimension::ComputePlanarFaceGeometry()
TopoDS_Edge curedge = TopoDS::Edge( ExploEd.Current() ); TopoDS_Edge curedge = TopoDS::Edge( ExploEd.Current() );
Handle(Geom_Curve) curv; Handle(Geom_Curve) curv;
Handle(Geom_Ellipse) ellips; Handle(Geom_Ellipse) ellips;
if (AIS::ComputeGeometry(curedge,curv,ptfirst,ptend)) if (PrsDim::ComputeGeometry(curedge,curv,ptfirst,ptend))
{ {
if (curv->DynamicType() == STANDARD_TYPE(Geom_Ellipse)) if (curv->DynamicType() == STANDARD_TYPE(Geom_Ellipse))
{ {
@ -225,7 +224,7 @@ void AIS_EllipseRadiusDimension::ComputePlanarFaceGeometry()
} }
if( !find ) if( !find )
{ {
throw Standard_ConstructionError("AIS:: Curve is not an ellipsee or is Null") ; throw Standard_ConstructionError("PrsDim:: Curve is not an ellipsee or is Null") ;
return; return;
} }
@ -243,18 +242,16 @@ void AIS_EllipseRadiusDimension::ComputePlanarFaceGeometry()
} }
//======================================================================= //=======================================================================
//function : ComputeEdgeGeometry //function : ComputeEdgeGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EllipseRadiusDimension::ComputeEdgeGeometry() void PrsDim_EllipseRadiusDimension::ComputeEdgeGeometry()
{ {
gp_Pnt ptfirst,ptend; gp_Pnt ptfirst,ptend;
Handle(Geom_Curve) curv; Handle(Geom_Curve) curv;
if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape),curv,ptfirst,ptend)) return; if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),curv,ptfirst,ptend)) return;
Handle(Geom_Ellipse) elips = Handle(Geom_Ellipse)::DownCast(curv); Handle(Geom_Ellipse) elips = Handle(Geom_Ellipse)::DownCast(curv);
if ( elips.IsNull()) return; if ( elips.IsNull()) return;
@ -274,20 +271,3 @@ void AIS_EllipseRadiusDimension::ComputeEdgeGeometry()
myLastPar = ElCLib::Parameter(myEllipse, ptend); myLastPar = ElCLib::Parameter(myEllipse, ptend);
} }
} }
//=======================================================================
//function : KindOfDimension
//purpose :
//=======================================================================
AIS_KindOfDimension AIS_EllipseRadiusDimension::KindOfDimension() const
{
return AIS_KOD_ELLIPSERADIUS;
}
//=======================================================================
//function : IsMovable
//purpose :
//=======================================================================
Standard_Boolean AIS_EllipseRadiusDimension::IsMovable() const
{
return Standard_True;
}

View File

@ -14,52 +14,39 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_EllipseRadiusDimension_HeaderFile #ifndef _PrsDim_EllipseRadiusDimension_HeaderFile
#define _AIS_EllipseRadiusDimension_HeaderFile #define _PrsDim_EllipseRadiusDimension_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <gp_Elips.hxx> #include <gp_Elips.hxx>
#include <Standard_Real.hxx> #include <PrsDim_Relation.hxx>
#include <Standard_Boolean.hxx> #include <PrsDim_KindOfSurface.hxx>
#include <AIS_Relation.hxx>
#include <AIS_KindOfDimension.hxx>
#include <AIS_KindOfSurface.hxx>
class Geom_OffsetCurve; class Geom_OffsetCurve;
class TopoDS_Shape; class TopoDS_Shape;
class TCollection_ExtendedString; class TCollection_ExtendedString;
class Geom_Surface; class Geom_Surface;
DEFINE_STANDARD_HANDLE(PrsDim_EllipseRadiusDimension, PrsDim_Relation)
class AIS_EllipseRadiusDimension;
DEFINE_STANDARD_HANDLE(AIS_EllipseRadiusDimension, AIS_Relation)
//! Computes geometry ( basis curve and plane of dimension) //! Computes geometry ( basis curve and plane of dimension)
//! for input shape aShape from TopoDS //! for input shape aShape from TopoDS
//! Root class for MinRadiusDimension and MaxRadiusDimension //! Root class for MinRadiusDimension and MaxRadiusDimension
class AIS_EllipseRadiusDimension : public AIS_Relation class PrsDim_EllipseRadiusDimension : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(PrsDim_EllipseRadiusDimension, PrsDim_Relation)
public: public:
virtual PrsDim_KindOfDimension KindOfDimension() const Standard_OVERRIDE { return PrsDim_KOD_ELLIPSERADIUS; }
Standard_EXPORT virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE; virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
Standard_EXPORT virtual Standard_Boolean IsMovable() const Standard_OVERRIDE;
Standard_EXPORT void ComputeGeometry(); Standard_EXPORT void ComputeGeometry();
DEFINE_STANDARD_RTTIEXT(AIS_EllipseRadiusDimension,AIS_Relation)
protected: protected:
Standard_EXPORT PrsDim_EllipseRadiusDimension(const TopoDS_Shape& aShape, const TCollection_ExtendedString& aText);
Standard_EXPORT AIS_EllipseRadiusDimension(const TopoDS_Shape& aShape, const TCollection_ExtendedString& aText); protected:
gp_Elips myEllipse; gp_Elips myEllipse;
Standard_Real myFirstPar; Standard_Real myFirstPar;
@ -69,26 +56,16 @@ protected:
Standard_Real myOffset; Standard_Real myOffset;
Standard_Boolean myIsOffset; Standard_Boolean myIsOffset;
private: private:
Standard_EXPORT void ComputeFaceGeometry(); Standard_EXPORT void ComputeFaceGeometry();
Standard_EXPORT void ComputeCylFaceGeometry (const AIS_KindOfSurface aSurfType, const Handle(Geom_Surface)& aSurf, const Standard_Real Offset); Standard_EXPORT void ComputeCylFaceGeometry (const PrsDim_KindOfSurface aSurfType, const Handle(Geom_Surface)& aSurf, const Standard_Real Offset);
Standard_EXPORT void ComputePlanarFaceGeometry(); Standard_EXPORT void ComputePlanarFaceGeometry();
Standard_EXPORT void ComputeEdgeGeometry(); Standard_EXPORT void ComputeEdgeGeometry();
}; };
#endif // _PrsDim_EllipseRadiusDimension_HeaderFile
#endif // _AIS_EllipseRadiusDimension_HeaderFile

View File

@ -14,9 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_EqualDistanceRelation.hxx>
#include <AIS_EqualDistanceRelation.hxx> #include <PrsDim.hxx>
#include <AIS_LengthDimension.hxx> #include <PrsDim_LengthDimension.hxx>
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
@ -27,7 +28,6 @@
#include <Geom_Circle.hxx> #include <Geom_Circle.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx> #include <GeomAPI_ProjectPointOnCurve.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx> #include <GeomAPI_ProjectPointOnSurf.hxx>
#include <gp_Lin.hxx> #include <gp_Lin.hxx>
@ -42,23 +42,22 @@
#include <Select3D_SensitiveSegment.hxx> #include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_EqualDistanceRelation, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : AIS_EqualDistanceRelation //function : PrsDim_EqualDistanceRelation
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_EqualDistanceRelation::AIS_EqualDistanceRelation( const TopoDS_Shape& aShape1, PrsDim_EqualDistanceRelation::PrsDim_EqualDistanceRelation( const TopoDS_Shape& aShape1,
const TopoDS_Shape& aShape2, const TopoDS_Shape& aShape2,
const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape3,
const TopoDS_Shape& aShape4, const TopoDS_Shape& aShape4,
const Handle( Geom_Plane )& aPlane ) const Handle( Geom_Plane )& aPlane )
:AIS_Relation() : PrsDim_Relation()
{ {
myFShape = aShape1; myFShape = aShape1;
mySShape = aShape2; mySShape = aShape2;
@ -76,7 +75,7 @@ AIS_EqualDistanceRelation::AIS_EqualDistanceRelation( const TopoDS_Shape& aShape
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManager3d )&, void PrsDim_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManager3d )&,
const Handle( Prs3d_Presentation )& aPresentation, const Handle( Prs3d_Presentation )& aPresentation,
const Standard_Integer ) const Standard_Integer )
{ {
@ -98,7 +97,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
} }
if (myFShape.ShapeType() == TopAbs_EDGE && mySShape.ShapeType() == TopAbs_EDGE) if (myFShape.ShapeType() == TopAbs_EDGE && mySShape.ShapeType() == TopAbs_EDGE)
AIS_EqualDistanceRelation::ComputeTwoEdgesLength(aPresentation, PrsDim_EqualDistanceRelation::ComputeTwoEdgesLength(aPresentation,
myDrawer, myDrawer,
myArrowSize, myArrowSize,
TopoDS::Edge(myFShape), TopoDS::Edge(myFShape),
@ -116,7 +115,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
else if (myFShape.ShapeType() == TopAbs_VERTEX && mySShape.ShapeType() == TopAbs_VERTEX) else if (myFShape.ShapeType() == TopAbs_VERTEX && mySShape.ShapeType() == TopAbs_VERTEX)
AIS_EqualDistanceRelation::ComputeTwoVerticesLength( aPresentation, PrsDim_EqualDistanceRelation::ComputeTwoVerticesLength( aPresentation,
myDrawer, myDrawer,
myArrowSize, myArrowSize,
TopoDS::Vertex(myFShape), TopoDS::Vertex(myFShape),
@ -125,7 +124,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
myAutomaticPosition, myAutomaticPosition,
myIsSetBndBox, myIsSetBndBox,
myBndBox, myBndBox,
AIS_TOD_Unknown, PrsDim_TypeOfDist_Unknown,
Position12, Position12,
myAttachPoint1, myAttachPoint1,
myAttachPoint2, myAttachPoint2,
@ -133,7 +132,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
myPoint2, myPoint2,
mySymbolPrs ); mySymbolPrs );
else else
AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( aPresentation, PrsDim_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( aPresentation,
myDrawer, myDrawer,
myArrowSize, myArrowSize,
myFShape, myFShape,
@ -150,7 +149,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
mySymbolPrs ); mySymbolPrs );
if (myShape3.ShapeType() == TopAbs_EDGE && myShape4.ShapeType() == TopAbs_EDGE) if (myShape3.ShapeType() == TopAbs_EDGE && myShape4.ShapeType() == TopAbs_EDGE)
AIS_EqualDistanceRelation::ComputeTwoEdgesLength(aPresentation, PrsDim_EqualDistanceRelation::ComputeTwoEdgesLength(aPresentation,
myDrawer, myDrawer,
myArrowSize, myArrowSize,
TopoDS::Edge(myShape3), TopoDS::Edge(myShape3),
@ -167,7 +166,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
mySymbolPrs ); mySymbolPrs );
else if (myShape3.ShapeType() == TopAbs_VERTEX && myShape4.ShapeType() == TopAbs_VERTEX) else if (myShape3.ShapeType() == TopAbs_VERTEX && myShape4.ShapeType() == TopAbs_VERTEX)
AIS_EqualDistanceRelation::ComputeTwoVerticesLength( aPresentation, PrsDim_EqualDistanceRelation::ComputeTwoVerticesLength( aPresentation,
myDrawer, myDrawer,
myArrowSize, myArrowSize,
TopoDS::Vertex(myShape3), TopoDS::Vertex(myShape3),
@ -176,7 +175,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
myAutomaticPosition, myAutomaticPosition,
myIsSetBndBox, myIsSetBndBox,
myBndBox, myBndBox,
AIS_TOD_Unknown, PrsDim_TypeOfDist_Unknown,
Position34, Position34,
myAttachPoint3, myAttachPoint3,
myAttachPoint4, myAttachPoint4,
@ -185,7 +184,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
mySymbolPrs ); mySymbolPrs );
else else
AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( aPresentation, PrsDim_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( aPresentation,
myDrawer, myDrawer,
myArrowSize, myArrowSize,
myShape3, myShape3,
@ -210,7 +209,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Selection )& aSelection, void PrsDim_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Selection )& aSelection,
const Standard_Integer ) const Standard_Integer )
{ {
Handle( SelectMgr_EntityOwner ) own = new SelectMgr_EntityOwner( this, 7 ); Handle( SelectMgr_EntityOwner ) own = new SelectMgr_EntityOwner( this, 7 );
@ -339,7 +338,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select
//function : ComputeTwoEdgesLength //function : ComputeTwoEdgesLength
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Presentation )& aPresentation, void PrsDim_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Presentation )& aPresentation,
const Handle( Prs3d_Drawer )& aDrawer, const Handle( Prs3d_Drawer )& aDrawer,
const Standard_Real ArrowSize, const Standard_Real ArrowSize,
const TopoDS_Edge & FirstEdge, const TopoDS_Edge & FirstEdge,
@ -369,9 +368,9 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
Standard_Real Val=0.; Standard_Real Val=0.;
Standard_Boolean isInPlane1, isInPlane2; Standard_Boolean isInPlane1, isInPlane2;
if(!AIS::ComputeGeometry(FirstEdge,geom1, ptat11, ptat12,extCurv,isInfinite1,isInPlane1, Plane )) if(!PrsDim::ComputeGeometry(FirstEdge,geom1, ptat11, ptat12,extCurv,isInfinite1,isInPlane1, Plane ))
return; return;
if(!AIS::ComputeGeometry(SecondEdge, geom2, ptat21, ptat22, extCurv, isInfinite2,isInPlane2, Plane)) if(!PrsDim::ComputeGeometry(SecondEdge, geom2, ptat21, ptat22, extCurv, isInfinite2,isInPlane2, Plane))
return; return;
aPresentation->SetInfiniteState(isInfinite1 || isInfinite2); aPresentation->SetInfiniteState(isInfinite1 || isInfinite2);
@ -424,7 +423,7 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
Position = curpos; Position = curpos;
} }
else { // project point on the plane else { // project point on the plane
Position = AIS::ProjectPointOnPlane( Position, Plane->Pln() ); Position = PrsDim::ProjectPointOnPlane( Position, Plane->Pln() );
} }
// find attach points // find attach points
@ -455,7 +454,7 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
arr->SetLength(arrsize); arr->SetLength(arrsize);
if (AutomaticPos && IsSetBndBox) if (AutomaticPos && IsSetBndBox)
Position = AIS::TranslatePointToBound( Position, DirAttach, BndBox ); Position = PrsDim::TranslatePointToBound( Position, DirAttach, BndBox );
DsgPrs_EqualDistancePresentation::AddInterval(aPresentation, DsgPrs_EqualDistancePresentation::AddInterval(aPresentation,
aDrawer, aDrawer,
@ -490,10 +489,10 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
Standard_Real par1 = 0, par2 = 0; Standard_Real par1 = 0, par2 = 0;
gp_Pln aPln = Plane->Pln(); gp_Pln aPln = Plane->Pln();
//Project ptat12 and ptat22 on constraint plane //Project ptat12 and ptat22 on constraint plane
gp_Pnt PrPnt12 = AIS::ProjectPointOnPlane(ptat12, aPln); gp_Pnt PrPnt12 = PrsDim::ProjectPointOnPlane(ptat12, aPln);
gp_Pnt PrPnt22 = AIS::ProjectPointOnPlane(ptat22, aPln); gp_Pnt PrPnt22 = PrsDim::ProjectPointOnPlane(ptat22, aPln);
//Project circles center on constraint plane //Project circles center on constraint plane
gp_Pnt PrCenter = AIS::ProjectPointOnPlane(aCirc1.Location(), aPln); gp_Pnt PrCenter = PrsDim::ProjectPointOnPlane(aCirc1.Location(), aPln);
gp_Dir XDir = aPln.XAxis().Direction(); gp_Dir XDir = aPln.XAxis().Direction();
gp_Dir YDir = aPln.YAxis().Direction(); gp_Dir YDir = aPln.YAxis().Direction();
@ -555,10 +554,10 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
// gp_Pnt pf, pl; // gp_Pnt pf, pl;
if (!isInPlane1) { if (!isInPlane1) {
AIS::ComputeProjEdgePresentation( aPresentation, aDrawer, FirstEdge, geom1, ptat11, ptat12); PrsDim::ComputeProjEdgePresentation( aPresentation, aDrawer, FirstEdge, geom1, ptat11, ptat12);
} }
if(!isInPlane2) { if(!isInPlane2) {
AIS::ComputeProjEdgePresentation( aPresentation, aDrawer, SecondEdge, geom2, ptat21, ptat22); PrsDim::ComputeProjEdgePresentation( aPresentation, aDrawer, SecondEdge, geom2, ptat21, ptat22);
} }
} }
@ -567,7 +566,7 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Presentation )& aPresentation, void PrsDim_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Presentation )& aPresentation,
const Handle( Prs3d_Drawer )& aDrawer, const Handle( Prs3d_Drawer )& aDrawer,
const Standard_Real ArrowSize, const Standard_Real ArrowSize,
const TopoDS_Vertex& FirstVertex, const TopoDS_Vertex& FirstVertex,
@ -576,7 +575,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
const Standard_Boolean AutomaticPos, const Standard_Boolean AutomaticPos,
const Standard_Boolean IsSetBndBox, const Standard_Boolean IsSetBndBox,
const Bnd_Box& BndBox, const Bnd_Box& BndBox,
const AIS_TypeOfDist TypeDist, const PrsDim_TypeOfDist TypeDist,
gp_Pnt& Position, gp_Pnt& Position,
gp_Pnt& FirstAttach, gp_Pnt& FirstAttach,
gp_Pnt& SecondAttach, gp_Pnt& SecondAttach,
@ -586,14 +585,14 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
{ {
Standard_Boolean isOnPlane1, isOnPlane2; Standard_Boolean isOnPlane1, isOnPlane2;
gp_Dir DirAttach; gp_Dir DirAttach;
AIS::ComputeGeometry( FirstVertex, FirstAttach, Plane, isOnPlane1); PrsDim::ComputeGeometry( FirstVertex, FirstAttach, Plane, isOnPlane1);
AIS::ComputeGeometry( SecondVertex, SecondAttach, Plane, isOnPlane2); PrsDim::ComputeGeometry( SecondVertex, SecondAttach, Plane, isOnPlane2);
Standard_Real confusion(Precision::Confusion()); Standard_Real confusion(Precision::Confusion());
Standard_Boolean samePoint(FirstAttach.IsEqual(SecondAttach,confusion)); Standard_Boolean samePoint(FirstAttach.IsEqual(SecondAttach,confusion));
if (TypeDist == AIS_TOD_Vertical) DirAttach = Plane->Pln().XAxis().Direction(); if (TypeDist == PrsDim_TypeOfDist_Vertical) DirAttach = Plane->Pln().XAxis().Direction();
else if (TypeDist == AIS_TOD_Horizontal) DirAttach = Plane->Pln().YAxis().Direction(); else if (TypeDist == PrsDim_TypeOfDist_Horizontal) DirAttach = Plane->Pln().YAxis().Direction();
else { else {
if (!samePoint) { if (!samePoint) {
DirAttach.SetXYZ(SecondAttach.XYZ() - FirstAttach.XYZ()); DirAttach.SetXYZ(SecondAttach.XYZ() - FirstAttach.XYZ());
@ -616,12 +615,12 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
gp_Vec aVec (aDir.XYZ()*10*ArrowSize); gp_Vec aVec (aDir.XYZ()*10*ArrowSize);
//Position = gp_Pnt(FirstAttach.XYZ()+gp_XYZ(1.,1.,1.)); // not correct //Position = gp_Pnt(FirstAttach.XYZ()+gp_XYZ(1.,1.,1.)); // not correct
Position = FirstAttach.Translated(aVec); Position = FirstAttach.Translated(aVec);
Position = AIS::ProjectPointOnPlane( Position, Plane->Pln() );//not needed really Position = PrsDim::ProjectPointOnPlane( Position, Plane->Pln() );//not needed really
DirAttach.SetXYZ(Position.XYZ() - FirstAttach.XYZ()); DirAttach.SetXYZ(Position.XYZ() - FirstAttach.XYZ());
} }
} }
else { else {
Position = AIS::ProjectPointOnPlane( Position, Plane->Pln() ); Position = PrsDim::ProjectPointOnPlane( Position, Plane->Pln() );
} }
@ -632,7 +631,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
arr->SetLength(ArrowSize); arr->SetLength(ArrowSize);
if (AutomaticPos && IsSetBndBox) if (AutomaticPos && IsSetBndBox)
Position = AIS::TranslatePointToBound( Position, DirAttach, BndBox ); Position = PrsDim::TranslatePointToBound( Position, DirAttach, BndBox );
DsgPrs_EqualDistancePresentation::AddInterval(aPresentation, DsgPrs_EqualDistancePresentation::AddInterval(aPresentation,
aDrawer, aDrawer,
@ -646,9 +645,9 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
// Compute projection // Compute projection
if ( !isOnPlane1) if ( !isOnPlane1)
AIS::ComputeProjVertexPresentation(aPresentation, aDrawer, FirstVertex, FirstAttach); PrsDim::ComputeProjVertexPresentation(aPresentation, aDrawer, FirstVertex, FirstAttach);
if ( !isOnPlane2) if ( !isOnPlane2)
AIS::ComputeProjVertexPresentation(aPresentation, aDrawer, SecondVertex, SecondAttach); PrsDim::ComputeProjVertexPresentation(aPresentation, aDrawer, SecondVertex, SecondAttach);
} }
@ -658,7 +657,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs3d_Presentation )& aPresentation, void PrsDim_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs3d_Presentation )& aPresentation,
const Handle( Prs3d_Drawer )& aDrawer, const Handle( Prs3d_Drawer )& aDrawer,
const Standard_Real ArrowSize, const Standard_Real ArrowSize,
const TopoDS_Shape & FirstShape, const TopoDS_Shape & FirstShape,
@ -695,10 +694,10 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs
theedge = TopoDS::Edge(FirstShape); theedge = TopoDS::Edge(FirstShape);
edgenum = 1;//edge is the first shape edgenum = 1;//edge is the first shape
} }
if (!AIS::ComputeGeometry(theedge,aCurve,ptonedge1,ptonedge2,extCurv,isInfinite,isOnPlanEdge,Plane)) if (!PrsDim::ComputeGeometry(theedge,aCurve,ptonedge1,ptonedge2,extCurv,isInfinite,isOnPlanEdge,Plane))
return; return;
aPresentation->SetInfiniteState(isInfinite); aPresentation->SetInfiniteState(isInfinite);
AIS::ComputeGeometry(thevertex, FirstAttach, Plane, isOnPlanVertex); PrsDim::ComputeGeometry(thevertex, FirstAttach, Plane, isOnPlanVertex);
if ( aCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) if ( aCurve->IsInstance(STANDARD_TYPE(Geom_Line)) )
{ {
@ -723,7 +722,7 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs
Position = curpos; Position = curpos;
} }
else { // project point on the plane else { // project point on the plane
Position = AIS::ProjectPointOnPlane( Position, Plane->Pln() ); Position = PrsDim::ProjectPointOnPlane( Position, Plane->Pln() );
} }
if (!isInfinite) { if (!isInfinite) {
@ -741,7 +740,7 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs
arr->SetLength(arrsize); arr->SetLength(arrsize);
if (AutomaticPos && IsSetBndBox) if (AutomaticPos && IsSetBndBox)
Position = AIS::TranslatePointToBound( Position, DirAttach, BndBox ); Position = PrsDim::TranslatePointToBound( Position, DirAttach, BndBox );
DsgPrs_EqualDistancePresentation::AddInterval(aPresentation, DsgPrs_EqualDistancePresentation::AddInterval(aPresentation,
aDrawer, aDrawer,
FirstAttach, FirstAttach,
@ -793,10 +792,10 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs
//Display the pieces of attached to the curve if it is not //Display the pieces of attached to the curve if it is not
// in the WP // in the WP
if (!isOnPlanEdge) { // add presentation of projection of the edge in WP if (!isOnPlanEdge) { // add presentation of projection of the edge in WP
AIS::ComputeProjEdgePresentation(aPresentation,aDrawer,theedge,aCurve,ptonedge1,ptonedge2); PrsDim::ComputeProjEdgePresentation(aPresentation,aDrawer,theedge,aCurve,ptonedge1,ptonedge2);
} }
if (!isOnPlanVertex) { // add presentation of projection of the vertex in WP if (!isOnPlanVertex) { // add presentation of projection of the vertex in WP
AIS::ComputeProjVertexPresentation(aPresentation,aDrawer,thevertex,FirstAttach); PrsDim::ComputeProjVertexPresentation(aPresentation,aDrawer,thevertex,FirstAttach);
} }
} }

View File

@ -14,25 +14,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_EqualDistanceRelation_HeaderFile #ifndef _PrsDim_EqualDistanceRelation_HeaderFile
#define _AIS_EqualDistanceRelation_HeaderFile #define _PrsDim_EqualDistanceRelation_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
#include <AIS_TypeOfDist.hxx> #include <PrsDim_TypeOfDist.hxx>
#include <DsgPrs_ArrowSide.hxx> #include <DsgPrs_ArrowSide.hxx>
class Geom_Plane; class Geom_Plane;
DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_EqualDistanceRelation, PrsDim_Relation)
//! A framework to display equivalent distances between //! A framework to display equivalent distances between
//! shapes and a given plane. //! shapes and a given plane.
//! The distance is the length of a projection from the //! The distance is the length of a projection from the
//! shape to the plane. //! shape to the plane.
//! These distances are used to compare shapes by this vector alone. //! These distances are used to compare shapes by this vector alone.
class AIS_EqualDistanceRelation : public AIS_Relation class PrsDim_EqualDistanceRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_EqualDistanceRelation, PrsDim_Relation)
public: public:
//! Constructs a framework to display equivalent //! Constructs a framework to display equivalent
@ -40,27 +40,25 @@ public:
//! aShape3, aShape4 and the plane aPlane. //! aShape3, aShape4 and the plane aPlane.
//! The distance is the length of a projection from the //! The distance is the length of a projection from the
//! shape to the plane. //! shape to the plane.
Standard_EXPORT AIS_EqualDistanceRelation(const TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2, const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape4, const Handle(Geom_Plane)& aPlane); Standard_EXPORT PrsDim_EqualDistanceRelation(const TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2, const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape4, const Handle(Geom_Plane)& aPlane);
//! Sets the shape aShape to be used as the shape //! Sets the shape aShape to be used as the shape
//! aShape3 in the framework created at construction time. //! aShape3 in the framework created at construction time.
void SetShape3 (const TopoDS_Shape& aShape); void SetShape3 (const TopoDS_Shape& aShape) { myShape3 = aShape; }
//! Returns the shape aShape3 from the framework //! Returns the shape aShape3 from the framework
//! created at construction time. //! created at construction time.
const TopoDS_Shape& Shape3() const; const TopoDS_Shape& Shape3() const { return myShape3; }
//! Sets the shape aShape to be used as the shape //! Sets the shape aShape to be used as the shape
//! aShape4 in the framework created at construction time. //! aShape4 in the framework created at construction time.
void SetShape4 (const TopoDS_Shape& aShape); void SetShape4 (const TopoDS_Shape& aShape) { myShape4 = aShape; }
//! Returns the shape aShape4 from the framework //! Returns the shape aShape4 from the framework
//! created at construction time. //! created at construction time.
const TopoDS_Shape& Shape4() const; const TopoDS_Shape& Shape4() const { return myShape4; }
public:
//! Computes the location of an intreval between //! Computes the location of an intreval between
//! between two edges. FirstAttach , SecondAttach //! between two edges. FirstAttach , SecondAttach
@ -69,7 +67,7 @@ public:
//! Computes the interval position between two vertexs. FirstAttach, //! Computes the interval position between two vertexs. FirstAttach,
//! SecondAttach are the returned extreme points of the interval. //! SecondAttach are the returned extreme points of the interval.
Standard_EXPORT static void ComputeTwoVerticesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Vertex& FirstVertex, const TopoDS_Vertex& SecondVertex, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, const AIS_TypeOfDist TypeDist, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs); Standard_EXPORT static void ComputeTwoVerticesLength (const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Drawer)& aDrawer, const Standard_Real ArrowSize, const TopoDS_Vertex& FirstVertex, const TopoDS_Vertex& SecondVertex, const Handle(Geom_Plane)& Plane, const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, const PrsDim_TypeOfDist TypeDist, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, gp_Pnt& FirstExtreme, gp_Pnt& SecondExtreme, DsgPrs_ArrowSide& SymbolPrs);
//! Compute the interval location between a vertex and an edge. Edge may be //! Compute the interval location between a vertex and an edge. Edge may be
//! a line or a circle. //! a line or a circle.
@ -77,9 +75,11 @@ public:
private: private:
Standard_EXPORT 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
private:
TopoDS_Shape myShape3; TopoDS_Shape myShape3;
TopoDS_Shape myShape4; TopoDS_Shape myShape4;
@ -94,6 +94,4 @@ private:
}; };
#include <AIS_EqualDistanceRelation.lxx> #endif // _PrsDim_EqualDistanceRelation_HeaderFile
#endif // _AIS_EqualDistanceRelation_HeaderFile

View File

@ -14,15 +14,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_EqualRadiusRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_EqualRadiusRelation.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <DsgPrs_EqualRadiusPresentation.hxx> #include <DsgPrs_EqualRadiusPresentation.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <Geom_Circle.hxx> #include <Geom_Circle.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAPI_ProjectPointOnSurf.hxx> #include <GeomAPI_ProjectPointOnSurf.hxx>
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
#include <Precision.hxx> #include <Precision.hxx>
@ -39,16 +38,16 @@
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_EqualRadiusRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_EqualRadiusRelation, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : AIS_EqualRadiusRelation //function : PrsDim_EqualRadiusRelation
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_EqualRadiusRelation::AIS_EqualRadiusRelation( const TopoDS_Edge& aFirstEdge, PrsDim_EqualRadiusRelation::PrsDim_EqualRadiusRelation( const TopoDS_Edge& aFirstEdge,
const TopoDS_Edge& aSecondEdge, const TopoDS_Edge& aSecondEdge,
const Handle( Geom_Plane )& aPlane ) const Handle( Geom_Plane )& aPlane )
:AIS_Relation() : PrsDim_Relation()
{ {
myFShape = aFirstEdge; myFShape = aFirstEdge;
mySShape = aSecondEdge; mySShape = aSecondEdge;
@ -60,7 +59,7 @@ AIS_EqualRadiusRelation::AIS_EqualRadiusRelation( const TopoDS_Edge& aFirstEdge,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3d )&, void PrsDim_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3d )&,
const Handle( Prs3d_Presentation )& aPresentation, const Handle( Prs3d_Presentation )& aPresentation,
const Standard_Integer ) const Standard_Integer )
{ {
@ -74,8 +73,8 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
gp_Pnt FirstPoint1, LastPoint1, FirstPoint2, LastPoint2; gp_Pnt FirstPoint1, LastPoint1, FirstPoint2, LastPoint2;
Standard_Boolean isFirstOnPlane, isSecondOnPlane; Standard_Boolean isFirstOnPlane, isSecondOnPlane;
AIS::ComputeGeomCurve( FirstProjCurve, FirstPar1, LastPar1, FirstPoint1, LastPoint1, myPlane, isFirstOnPlane ); PrsDim::ComputeGeomCurve (FirstProjCurve, FirstPar1, LastPar1, FirstPoint1, LastPoint1, myPlane, isFirstOnPlane);
AIS::ComputeGeomCurve( SecondProjCurve, FirstPar2, LastPar2, FirstPoint2, LastPoint2, myPlane, isSecondOnPlane ); PrsDim::ComputeGeomCurve (SecondProjCurve, FirstPar2, LastPar2, FirstPoint2, LastPoint2, myPlane, isSecondOnPlane);
if (!isFirstOnPlane) if (!isFirstOnPlane)
ComputeProjEdgePresentation( aPresentation, TopoDS::Edge( myFShape ), FirstProjCurve, FirstPoint1, LastPoint1 ); ComputeProjEdgePresentation( aPresentation, TopoDS::Edge( myFShape ), FirstProjCurve, FirstPoint1, LastPoint1 );
@ -151,7 +150,7 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_EqualRadiusRelation::ComputeSelection( const Handle( SelectMgr_Selection )& aSelection, void PrsDim_EqualRadiusRelation::ComputeSelection( const Handle( SelectMgr_Selection )& aSelection,
const Standard_Integer ) const Standard_Integer )
{ {
Handle( SelectMgr_EntityOwner ) own = new SelectMgr_EntityOwner( this, 7 ); Handle( SelectMgr_EntityOwner ) own = new SelectMgr_EntityOwner( this, 7 );
@ -189,7 +188,7 @@ void AIS_EqualRadiusRelation::ComputeSelection( const Handle( SelectMgr_Selectio
//function : ComputeRadiusPosition //function : ComputeRadiusPosition
//purpose : //purpose :
//================================================================= //=================================================================
void AIS_EqualRadiusRelation::ComputeRadiusPosition() void PrsDim_EqualRadiusRelation::ComputeRadiusPosition()
{ {
if (myAutomaticPosition || if (myAutomaticPosition ||
myFirstCenter.Distance(myPosition) < Precision::Confusion() || myFirstCenter.Distance(myPosition) < Precision::Confusion() ||

View File

@ -14,24 +14,24 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_EqualRadiusRelation_HeaderFile #ifndef _PrsDim_EqualRadiusRelation_HeaderFile
#define _AIS_EqualRadiusRelation_HeaderFile #define _PrsDim_EqualRadiusRelation_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
class Geom_Plane; class Geom_Plane;
DEFINE_STANDARD_HANDLE(AIS_EqualRadiusRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_EqualRadiusRelation, PrsDim_Relation)
class AIS_EqualRadiusRelation : public AIS_Relation class PrsDim_EqualRadiusRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_EqualRadiusRelation, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_EqualRadiusRelation, PrsDim_Relation)
public: public:
//! Creates equal relation of two arc's radiuses. //! Creates equal relation of two arc's radiuses.
//! If one of edges is not in the given plane, //! If one of edges is not in the given plane,
//! the presentation method projects it onto the 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); Standard_EXPORT PrsDim_EqualRadiusRelation(const TopoDS_Edge& aFirstEdge, const TopoDS_Edge& aSecondEdge, const Handle(Geom_Plane)& aPlane);
private: private:
@ -41,6 +41,8 @@ private:
Standard_EXPORT void ComputeRadiusPosition(); Standard_EXPORT void ComputeRadiusPosition();
private:
gp_Pnt myFirstCenter; gp_Pnt myFirstCenter;
gp_Pnt mySecondCenter; gp_Pnt mySecondCenter;
gp_Pnt myFirstPoint; gp_Pnt myFirstPoint;
@ -48,4 +50,4 @@ private:
}; };
#endif // _AIS_EqualRadiusRelation_HeaderFile #endif // _PrsDim_EqualRadiusRelation_HeaderFile

View File

@ -14,10 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_FixRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_FixRelation.hxx>
#include <AIS_Shape.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <DsgPrs_FixPresentation.hxx> #include <DsgPrs_FixPresentation.hxx>
@ -27,7 +26,6 @@
#include <Geom_Curve.hxx> #include <Geom_Curve.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
@ -42,7 +40,6 @@
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_DomainError.hxx> #include <Standard_DomainError.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TColStd_ListIteratorOfListOfTransient.hxx> #include <TColStd_ListIteratorOfListOfTransient.hxx>
#include <TopAbs_ShapeEnum.hxx> #include <TopAbs_ShapeEnum.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
@ -56,7 +53,7 @@
#include <TopTools_IndexedMapOfShape.hxx> #include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_FixRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_FixRelation, PrsDim_Relation)
static Standard_Boolean InDomain(const Standard_Real fpar, static Standard_Boolean InDomain(const Standard_Real fpar,
const Standard_Real lpar, const Standard_Real lpar,
@ -75,10 +72,10 @@ static Standard_Boolean InDomain(const Standard_Real fpar,
//purpose : vertex Fix Relation //purpose : vertex Fix Relation
//======================================================================= //=======================================================================
AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape, PrsDim_FixRelation::PrsDim_FixRelation(const TopoDS_Shape& aShape,
const Handle(Geom_Plane)& aPlane, const Handle(Geom_Plane)& aPlane,
const TopoDS_Wire& aWire) const TopoDS_Wire& aWire)
:AIS_Relation(), : PrsDim_Relation(),
myWire(aWire) myWire(aWire)
{ {
myFShape = aShape; myFShape = aShape;
@ -92,12 +89,12 @@ AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape,
//purpose : vertex Fix Relation //purpose : vertex Fix Relation
//======================================================================= //=======================================================================
AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape, PrsDim_FixRelation::PrsDim_FixRelation(const TopoDS_Shape& aShape,
const Handle(Geom_Plane)& aPlane, const Handle(Geom_Plane)& aPlane,
const TopoDS_Wire& aWire, const TopoDS_Wire& aWire,
const gp_Pnt& aPosition, const gp_Pnt& aPosition,
const Standard_Real anArrowSize) const Standard_Real anArrowSize)
:AIS_Relation(), : PrsDim_Relation(),
myWire(aWire) myWire(aWire)
{ {
myFShape = aShape; myFShape = aShape;
@ -113,7 +110,7 @@ AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape,
//purpose : edge (line or circle) Fix Relation //purpose : edge (line or circle) Fix Relation
//======================================================================= //=======================================================================
AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape, PrsDim_FixRelation::PrsDim_FixRelation (const TopoDS_Shape& aShape,
const Handle(Geom_Plane)& aPlane) const Handle(Geom_Plane)& aPlane)
{ {
myFShape = aShape; myFShape = aShape;
@ -127,7 +124,7 @@ AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape,
//purpose : edge (line or circle) Fix Relation //purpose : edge (line or circle) Fix Relation
//======================================================================= //=======================================================================
AIS_FixRelation::AIS_FixRelation( PrsDim_FixRelation::PrsDim_FixRelation(
const TopoDS_Shape& aShape, const TopoDS_Shape& aShape,
const Handle(Geom_Plane)& aPlane, const Handle(Geom_Plane)& aPlane,
const gp_Pnt& aPosition, const gp_Pnt& aPosition,
@ -140,33 +137,12 @@ AIS_FixRelation::AIS_FixRelation(
myAutomaticPosition = Standard_False; myAutomaticPosition = Standard_False;
} }
//=======================================================================
//function : Wire
//purpose :
//=======================================================================
TopoDS_Wire AIS_FixRelation::Wire()
{
return myWire;
}
//=======================================================================
//function : SetWire
//purpose :
//=======================================================================
void AIS_FixRelation::SetWire(const TopoDS_Wire& aWire)
{
myWire = aWire;
}
//======================================================================= //=======================================================================
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer) const Standard_Integer)
{ {
@ -200,7 +176,7 @@ void AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_FixRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_FixRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer) const Standard_Integer)
{ {
Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7);
@ -265,7 +241,7 @@ void AIS_FixRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelec
// when you fix a vertex // when you fix a vertex
//======================================================================= //=======================================================================
void AIS_FixRelation::ComputeVertex(const TopoDS_Vertex& /*FixVertex*/, void PrsDim_FixRelation::ComputeVertex(const TopoDS_Vertex& /*FixVertex*/,
gp_Pnt& curpos) gp_Pnt& curpos)
{ {
myPntAttach = BRep_Tool::Pnt(TopoDS::Vertex(myFShape)); myPntAttach = BRep_Tool::Pnt(TopoDS::Vertex(myFShape));
@ -285,7 +261,7 @@ void AIS_FixRelation::ComputeVertex(const TopoDS_Vertex& /*FixVertex*/,
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt AIS_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv1, gp_Pnt PrsDim_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv1,
const Handle(Geom_Curve)& curv2, const Handle(Geom_Curve)& curv2,
const gp_Pnt& firstp1, const gp_Pnt& firstp1,
const gp_Pnt& lastp1, const gp_Pnt& lastp1,
@ -336,7 +312,7 @@ gp_Pnt AIS_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv1,
// The "dimension" is in the "middle" of the two edges. // The "dimension" is in the "middle" of the two edges.
//======================================================================= //=======================================================================
gp_Pnt AIS_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv, gp_Pnt PrsDim_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv,
const gp_Pnt& firstp, const gp_Pnt& firstp,
const gp_Pnt& lastp) const const gp_Pnt& lastp) const
{ {
@ -376,11 +352,11 @@ gp_Pnt AIS_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv,
// when you fix an edge // when you fix an edge
//======================================================================= //=======================================================================
void AIS_FixRelation::ComputeEdge(const TopoDS_Edge& FixEdge, gp_Pnt& curpos) void PrsDim_FixRelation::ComputeEdge(const TopoDS_Edge& FixEdge, gp_Pnt& curpos)
{ {
Handle(Geom_Curve) curEdge; Handle(Geom_Curve) curEdge;
gp_Pnt ptbeg,ptend; gp_Pnt ptbeg,ptend;
if (!AIS::ComputeGeometry(FixEdge,curEdge,ptbeg,ptend)) return; if (!PrsDim::ComputeGeometry(FixEdge,curEdge,ptbeg,ptend)) return;
//--------------------------------------------------------- //---------------------------------------------------------
// calcul du point de positionnement du symbole 'fix' // calcul du point de positionnement du symbole 'fix'
@ -415,7 +391,7 @@ void AIS_FixRelation::ComputeEdge(const TopoDS_Edge& FixEdge, gp_Pnt& curpos)
// to a line. // to a line.
//======================================================================= //=======================================================================
void AIS_FixRelation::ComputeLinePosition(const gp_Lin& glin, void PrsDim_FixRelation::ComputeLinePosition(const gp_Lin& glin,
gp_Pnt& pos, gp_Pnt& pos,
Standard_Real& pfirst, Standard_Real& pfirst,
Standard_Real& plast) Standard_Real& plast)
@ -469,7 +445,7 @@ void AIS_FixRelation::ComputeLinePosition(const gp_Lin& glin,
// to a circle. // to a circle.
//======================================================================= //=======================================================================
void AIS_FixRelation::ComputeCirclePosition( void PrsDim_FixRelation::ComputeCirclePosition(
const gp_Circ& gcirc, const gp_Circ& gcirc,
gp_Pnt& pos, gp_Pnt& pos,
Standard_Real& pfirst, Standard_Real& pfirst,
@ -526,7 +502,7 @@ void AIS_FixRelation::ComputeCirclePosition(
//function : ConnectedEdges //function : ConnectedEdges
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_FixRelation::ConnectedEdges(const TopoDS_Wire& WIRE, Standard_Boolean PrsDim_FixRelation::ConnectedEdges(const TopoDS_Wire& WIRE,
const TopoDS_Vertex& V, const TopoDS_Vertex& V,
TopoDS_Edge& E1, TopoDS_Edge& E1,
TopoDS_Edge& E2) TopoDS_Edge& E2)

View File

@ -14,15 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_FixRelation_HeaderFile #ifndef _PrsDim_FixRelation_HeaderFile
#define _AIS_FixRelation_HeaderFile #define _PrsDim_FixRelation_HeaderFile
#include <TopoDS_Wire.hxx> #include <TopoDS_Wire.hxx>
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
class Geom_Plane; class Geom_Plane;
DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_FixRelation, PrsDim_Relation)
//! Constructs and manages a constraint by a fixed //! Constructs and manages a constraint by a fixed
//! relation between two or more interactive datums. This //! relation between two or more interactive datums. This
@ -32,36 +32,36 @@ DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation)
//! Warning: This relation is not bound with any kind of parametric //! Warning: This relation is not bound with any kind of parametric
//! constraint : it represents the "status" of an parametric //! constraint : it represents the "status" of an parametric
//! object. //! object.
class AIS_FixRelation : public AIS_Relation class PrsDim_FixRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_FixRelation, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_FixRelation, PrsDim_Relation)
public: public:
//! initializes the vertex aShape, the //! initializes the vertex aShape, the
//! plane aPlane and the wire aWire, which connects //! plane aPlane and the wire aWire, which connects
//! the two vertices in a fixed relation. //! the two vertices in a fixed relation.
Standard_EXPORT AIS_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire); Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire);
//! initializes the vertex aShape, the //! initializes the vertex aShape, the
//! plane aPlane and the wire aWire, the position //! plane aPlane and the wire aWire, the position
//! aPosition, the arrow size anArrowSize and the //! aPosition, the arrow size anArrowSize and the
//! wire aWire, which connects the two vertices in a fixed relation. //! wire aWire, which connects the two vertices in a fixed relation.
Standard_EXPORT AIS_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire, const gp_Pnt& aPosition, const Standard_Real anArrowSize = 0.01); Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire, const gp_Pnt& aPosition, const Standard_Real anArrowSize = 0.01);
//! initializes the edge aShape and the plane aPlane. //! initializes the edge aShape and the plane aPlane.
Standard_EXPORT AIS_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane); Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane);
//! initializes the edge aShape, the //! initializes the edge aShape, the
//! plane aPlane, the position aPosition and the arrow //! plane aPlane, the position aPosition and the arrow
//! size anArrowSize. //! size anArrowSize.
Standard_EXPORT AIS_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const gp_Pnt& aPosition, const Standard_Real anArrowSize = 0.01); Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const gp_Pnt& aPosition, const Standard_Real anArrowSize = 0.01);
//! Returns the wire which connects vertices in a fixed relation. //! Returns the wire which connects vertices in a fixed relation.
Standard_EXPORT TopoDS_Wire Wire(); const TopoDS_Wire& Wire() { return myWire; }
//! Constructs the wire aWire. This connects vertices //! Constructs the wire aWire. This connects vertices
//! which are in a fixed relation. //! which are in a fixed relation.
Standard_EXPORT void SetWire (const TopoDS_Wire& aWire); void SetWire (const TopoDS_Wire& aWire) { myWire = aWire; }
//! Returns true if the Interactive Objects in the relation //! Returns true if the Interactive Objects in the relation
//! are movable. //! are movable.
@ -69,8 +69,7 @@ public:
private: 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
@ -92,10 +91,11 @@ private:
Standard_EXPORT static Standard_Boolean ConnectedEdges (const TopoDS_Wire& aWire, const TopoDS_Vertex& aVertex, TopoDS_Edge& Edge1, TopoDS_Edge& Edge2); Standard_EXPORT static Standard_Boolean ConnectedEdges (const TopoDS_Wire& aWire, const TopoDS_Vertex& aVertex, TopoDS_Edge& Edge1, TopoDS_Edge& Edge2);
private:
TopoDS_Wire myWire; TopoDS_Wire myWire;
gp_Pnt myPntAttach; gp_Pnt myPntAttach;
}; };
#endif // _AIS_FixRelation_HeaderFile #endif // _PrsDim_FixRelation_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_IdenticRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_IdenticRelation.hxx>
#include <AIS_Shape.hxx> #include <AIS_Shape.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <DsgPrs_IdenticPresentation.hxx> #include <DsgPrs_IdenticPresentation.hxx>
@ -25,7 +25,6 @@
#include <Geom_Ellipse.hxx> #include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx> #include <Geom_TrimmedCurve.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx> #include <GeomAPI_ProjectPointOnCurve.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
@ -41,7 +40,6 @@
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <TColStd_ListIteratorOfListOfTransient.hxx> #include <TColStd_ListIteratorOfListOfTransient.hxx>
#include <TopAbs.hxx> #include <TopAbs.hxx>
@ -54,7 +52,7 @@
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx> #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx> #include <TopTools_ListIteratorOfListOfShape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_IdenticRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_IdenticRelation, PrsDim_Relation)
// jfa 15/10/2000 // jfa 15/10/2000
static Standard_Real Modulo2PI(const Standard_Real ANGLE) static Standard_Real Modulo2PI(const Standard_Real ANGLE)
@ -75,11 +73,11 @@ static Standard_Boolean IsEqual2PI(const Standard_Real angle1,
// jfa 15/10/2000 end // jfa 15/10/2000 end
//======================================================================= //=======================================================================
//function : AIS_Sort //function : PrsDim_Sort
//purpose : sort an array of parameters <tab1> in increasing order //purpose : sort an array of parameters <tab1> in increasing order
// updates <tab2> and <tab3> according to <tab1> // updates <tab2> and <tab3> according to <tab1>
//======================================================================= //=======================================================================
static void AIS_Sort(Standard_Real tab1[4], static void PrsDim_Sort(Standard_Real tab1[4],
gp_Pnt tab2[4], gp_Pnt tab2[4],
Standard_Integer tab3[4]) Standard_Integer tab3[4])
{ {
@ -287,10 +285,10 @@ static Standard_Boolean ComputeAttach(const gp_Elips& theEll,
// jfa 16/10/2000 end // jfa 16/10/2000 end
//======================================================================= //=======================================================================
//function : AIS_IdenticRelation //function : PrsDim_IdenticRelation
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_IdenticRelation::AIS_IdenticRelation(const TopoDS_Shape& FirstShape, PrsDim_IdenticRelation::PrsDim_IdenticRelation(const TopoDS_Shape& FirstShape,
const TopoDS_Shape& SecondShape, const TopoDS_Shape& SecondShape,
const Handle(Geom_Plane)& aPlane) const Handle(Geom_Plane)& aPlane)
:isCircle(Standard_False) :isCircle(Standard_False)
@ -304,7 +302,7 @@ AIS_IdenticRelation::AIS_IdenticRelation(const TopoDS_Shape& FirstShape,
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aprs, const Handle(Prs3d_Presentation)& aprs,
const Standard_Integer) const Standard_Integer)
{ {
@ -362,7 +360,7 @@ void AIS_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
// before. // before.
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer) const Standard_Integer)
{ {
Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7);
@ -385,7 +383,7 @@ void AIS_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aS
gp_Pnt firstp1,lastp1,firstp2,lastp2; gp_Pnt firstp1,lastp1,firstp2,lastp2;
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
if ( !AIS::ComputeGeometry(TopoDS::Edge(myFShape),TopoDS::Edge(mySShape), if ( !PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),TopoDS::Edge(mySShape),
myExtShape,curv1,curv2, myExtShape,curv1,curv2,
firstp1,lastp1,firstp2,lastp2, firstp1,lastp1,firstp2,lastp2,
extCurv,isInfinite1,isInfinite2,myPlane) ) return; extCurv,isInfinite1,isInfinite2,myPlane) ) return;
@ -456,14 +454,14 @@ void AIS_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aS
//function : ComputeTwoEdgesPresentation //function : ComputeTwoEdgesPresentation
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Presentation)& aPrs) void PrsDim_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Presentation)& aPrs)
{ {
Handle(Geom_Curve) curv1,curv2; Handle(Geom_Curve) curv1,curv2;
gp_Pnt firstp1,lastp1,firstp2,lastp2; gp_Pnt firstp1,lastp1,firstp2,lastp2;
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape), if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),
TopoDS::Edge(mySShape), TopoDS::Edge(mySShape),
myExtShape, myExtShape,
curv1, curv1,
@ -526,7 +524,7 @@ void AIS_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Present
// <firstp2>: first extremity of the 2nd curve of the constraint // <firstp2>: first extremity of the 2nd curve of the constraint
// <lastp2> :last extremity of the 2nd curve of the constraint // <lastp2> :last extremity of the 2nd curve of the constraint
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeTwoLinesPresentation(const Handle(Prs3d_Presentation)& aPrs, void PrsDim_IdenticRelation::ComputeTwoLinesPresentation(const Handle(Prs3d_Presentation)& aPrs,
const Handle(Geom_Line)& thelin, const Handle(Geom_Line)& thelin,
gp_Pnt& firstp1, gp_Pnt& firstp1,
gp_Pnt& lastp1, gp_Pnt& lastp1,
@ -595,7 +593,7 @@ void AIS_IdenticRelation::ComputeTwoLinesPresentation(const Handle(Prs3d_Present
tabRang1[3] = pl2; tabRang2[3] = lastp2; tabRang3[3] = 2; tabRang1[3] = pl2; tabRang2[3] = lastp2; tabRang3[3] = 2;
// Sort of the array of parameters (tabRang1) // Sort of the array of parameters (tabRang1)
AIS_Sort(tabRang1, tabRang2, tabRang3); PrsDim_Sort(tabRang1, tabRang2, tabRang3);
// Computation of myFAttach and mySAttach according to the // Computation of myFAttach and mySAttach according to the
// position of the 2 linear edges // position of the 2 linear edges
@ -701,7 +699,7 @@ void AIS_IdenticRelation::ComputeTwoLinesPresentation(const Handle(Prs3d_Present
// <firstp2>: first extremity of the 2nd curve of the constraint // <firstp2>: first extremity of the 2nd curve of the constraint
// <lastp2> :last extremity of the 2nd curve of the constraint // <lastp2> :last extremity of the 2nd curve of the constraint
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeTwoCirclesPresentation(const Handle(Prs3d_Presentation)& aPrs, void PrsDim_IdenticRelation::ComputeTwoCirclesPresentation(const Handle(Prs3d_Presentation)& aPrs,
const Handle(Geom_Circle)& thecirc, const Handle(Geom_Circle)& thecirc,
const gp_Pnt& firstp1, const gp_Pnt& firstp1,
const gp_Pnt& lastp1, const gp_Pnt& lastp1,
@ -948,7 +946,7 @@ void AIS_IdenticRelation::ComputeTwoCirclesPresentation(const Handle(Prs3d_Prese
//purpose : Compute the presentation of the constraint where we are //purpose : Compute the presentation of the constraint where we are
// not in the case of dragging. // not in the case of dragging.
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Circle)& thecirc, void PrsDim_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Circle)& thecirc,
const gp_Pnt& firstp, const gp_Pnt& firstp,
const gp_Pnt& lastp, const gp_Pnt& lastp,
const Standard_Boolean isstatic) const Standard_Boolean isstatic)
@ -981,7 +979,7 @@ void AIS_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Circle)&
// The symbol of the constraint moves together with arc // The symbol of the constraint moves together with arc
// representing the constraint around all the circle. // representing the constraint around all the circle.
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeNotAutoCircPresentation(const Handle(Geom_Circle)& thecirc) void PrsDim_IdenticRelation::ComputeNotAutoCircPresentation(const Handle(Geom_Circle)& thecirc)
{ {
gp_Pnt curpos = myPosition; gp_Pnt curpos = myPosition;
@ -1013,7 +1011,7 @@ void AIS_IdenticRelation::ComputeNotAutoCircPresentation(const Handle(Geom_Circl
// The symbol of the constraint moves only between myFAttach // The symbol of the constraint moves only between myFAttach
// and mySAttach. // and mySAttach.
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Circle)& thecirc, void PrsDim_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Circle)& thecirc,
const gp_Pnt& pntfirst, const gp_Pnt& pntfirst,
const gp_Pnt& pntlast) const gp_Pnt& pntlast)
{ {
@ -1056,7 +1054,7 @@ void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Circle
// <firstp2>: first extremity of the 2nd curve of the constraint // <firstp2>: first extremity of the 2nd curve of the constraint
// <lastp2> :last extremity of the 2nd curve of the constraint // <lastp2> :last extremity of the 2nd curve of the constraint
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeTwoEllipsesPresentation(const Handle(Prs3d_Presentation)& aPrs, void PrsDim_IdenticRelation::ComputeTwoEllipsesPresentation(const Handle(Prs3d_Presentation)& aPrs,
const Handle(Geom_Ellipse)& theEll, const Handle(Geom_Ellipse)& theEll,
const gp_Pnt& firstp1, const gp_Pnt& firstp1,
const gp_Pnt& lastp1, const gp_Pnt& lastp1,
@ -1302,7 +1300,7 @@ void AIS_IdenticRelation::ComputeTwoEllipsesPresentation(const Handle(Prs3d_Pres
//purpose : Compute the presentation of the constraint where we are //purpose : Compute the presentation of the constraint where we are
// not in the case of dragging. // not in the case of dragging.
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Ellipse)& theEll, void PrsDim_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Ellipse)& theEll,
const gp_Pnt& firstp, const gp_Pnt& firstp,
const gp_Pnt& lastp, const gp_Pnt& lastp,
const Standard_Boolean isstatic) const Standard_Boolean isstatic)
@ -1337,7 +1335,7 @@ void AIS_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Ellipse)&
// The symbol of the constraint moves only between myFAttach // The symbol of the constraint moves only between myFAttach
// and mySAttach. // and mySAttach.
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeNotAutoElipsPresentation(const Handle(Geom_Ellipse)& theEll) void PrsDim_IdenticRelation::ComputeNotAutoElipsPresentation(const Handle(Geom_Ellipse)& theEll)
{ {
gp_Pnt curpos = myPosition; gp_Pnt curpos = myPosition;
@ -1372,7 +1370,7 @@ void AIS_IdenticRelation::ComputeNotAutoElipsPresentation(const Handle(Geom_Elli
// The symbol of the constraint moves only between myFAttach // The symbol of the constraint moves only between myFAttach
// and mySAttach. // and mySAttach.
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Ellipse)& theEll, void PrsDim_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Ellipse)& theEll,
const gp_Pnt& pntfirst, const gp_Pnt& pntfirst,
const gp_Pnt& pntlast) const gp_Pnt& pntlast)
{ {
@ -1411,14 +1409,14 @@ void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Ellips
//function : ComputeTwoVerticesPresentation //function : ComputeTwoVerticesPresentation
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Presentation)& aPrs) void PrsDim_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Presentation)& aPrs)
{ {
Standard_Boolean isOnPlane1, isOnPlane2; Standard_Boolean isOnPlane1, isOnPlane2;
const TopoDS_Vertex& FVertex = TopoDS::Vertex(myFShape); const TopoDS_Vertex& FVertex = TopoDS::Vertex(myFShape);
const TopoDS_Vertex& SVertex = TopoDS::Vertex(mySShape); const TopoDS_Vertex& SVertex = TopoDS::Vertex(mySShape);
AIS::ComputeGeometry(FVertex, myFAttach, myPlane, isOnPlane1); PrsDim::ComputeGeometry(FVertex, myFAttach, myPlane, isOnPlane1);
AIS::ComputeGeometry(SVertex, mySAttach, myPlane, isOnPlane2); PrsDim::ComputeGeometry(SVertex, mySAttach, myPlane, isOnPlane2);
if (isOnPlane1 && isOnPlane2) if (isOnPlane1 && isOnPlane2)
myExtShape = 0; myExtShape = 0;
@ -1512,7 +1510,7 @@ void AIS_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Pres
//function : ComputeSegSize //function : ComputeSegSize
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real AIS_IdenticRelation::ComputeSegSize() const Standard_Real PrsDim_IdenticRelation::ComputeSegSize() const
{ {
return 1.; return 1.;
} }
@ -1523,7 +1521,7 @@ Standard_Real AIS_IdenticRelation::ComputeSegSize() const
// elements connected to the vertex <VERT>, in way to not have // elements connected to the vertex <VERT>, in way to not have
// overlap between the symbol and them. // overlap between the symbol and them.
//======================================================================= //=======================================================================
Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire, Standard_Boolean PrsDim_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire,
const TopoDS_Vertex& VERT, const TopoDS_Vertex& VERT,
gp_Dir& dF) const gp_Dir& dF) const
{ {
@ -1540,7 +1538,7 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire,
// Case with 2 edges connected to the vertex <VERT> // Case with 2 edges connected to the vertex <VERT>
if ( !edg1.IsNull() && !edg2.IsNull() ) { if ( !edg1.IsNull() && !edg2.IsNull() ) {
if ( !AIS::ComputeGeometry(edg1,edg2, if ( !PrsDim::ComputeGeometry(edg1,edg2,
curv1,curv2, curv1,curv2,
firstp1, lastp1, firstp1, lastp1,
firstp2, lastp2,myPlane)) firstp2, lastp2,myPlane))
@ -1582,7 +1580,7 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire,
else else
return Standard_False; return Standard_False;
if ( !AIS::ComputeGeometry(VEdge, curv1, firstp1, lastp1) ) if ( !PrsDim::ComputeGeometry(VEdge, curv1, firstp1, lastp1) )
return Standard_False; return Standard_False;
if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) ) { if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) ) {
dF = ComputeCircleDirection( Handle(Geom_Circle)::DownCast (curv1), VERT); dF = ComputeCircleDirection( Handle(Geom_Circle)::DownCast (curv1), VERT);
@ -1601,7 +1599,7 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire,
//function : ComputeLineDirection //function : ComputeLineDirection
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Dir AIS_IdenticRelation::ComputeLineDirection(const Handle(Geom_Line)& lin, gp_Dir PrsDim_IdenticRelation::ComputeLineDirection(const Handle(Geom_Line)& lin,
const gp_Pnt& firstP) const const gp_Pnt& firstP) const
{ {
gp_Dir dir; gp_Dir dir;
@ -1615,7 +1613,7 @@ gp_Dir AIS_IdenticRelation::ComputeLineDirection(const Handle(Geom_Line)& lin,
//function : ComputeCircleDirection //function : ComputeCircleDirection
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Dir AIS_IdenticRelation::ComputeCircleDirection(const Handle(Geom_Circle)& circ, gp_Dir PrsDim_IdenticRelation::ComputeCircleDirection(const Handle(Geom_Circle)& circ,
const TopoDS_Vertex& VERT) const const TopoDS_Vertex& VERT) const
{ {
gp_Vec V(circ->Location(),BRep_Tool::Pnt(VERT)); gp_Vec V(circ->Location(),BRep_Tool::Pnt(VERT));
@ -1626,7 +1624,7 @@ gp_Dir AIS_IdenticRelation::ComputeCircleDirection(const Handle(Geom_Circle)& ci
//function : ComputeOneEdgeOVertexPresentation //function : ComputeOneEdgeOVertexPresentation
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_Presentation)& aPrs) void PrsDim_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_Presentation)& aPrs)
{ {
TopoDS_Vertex V; TopoDS_Vertex V;
TopoDS_Edge E; TopoDS_Edge E;
@ -1647,10 +1645,10 @@ void AIS_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_P
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
Standard_Boolean isInfinite; Standard_Boolean isInfinite;
Standard_Boolean isOnPlanEdge, isOnPlanVertex; Standard_Boolean isOnPlanEdge, isOnPlanVertex;
if (!AIS::ComputeGeometry(E,aCurve,ptonedge1,ptonedge2,extCurv,isInfinite,isOnPlanEdge,myPlane)) if (!PrsDim::ComputeGeometry(E,aCurve,ptonedge1,ptonedge2,extCurv,isInfinite,isOnPlanEdge,myPlane))
return; return;
aPrs->SetInfiniteState(isInfinite); aPrs->SetInfiniteState(isInfinite);
AIS::ComputeGeometry(V, myFAttach, myPlane, isOnPlanVertex); PrsDim::ComputeGeometry(V, myFAttach, myPlane, isOnPlanVertex);
// only the curve can be projected // only the curve can be projected
if (!isOnPlanEdge && !isOnPlanVertex) return; if (!isOnPlanEdge && !isOnPlanVertex) return;

View File

@ -14,10 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_IdenticRelation_HeaderFile #ifndef _PrsDim_IdenticRelation_HeaderFile
#define _AIS_IdenticRelation_HeaderFile #define _PrsDim_IdenticRelation_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <PrsMgr_PresentationManager3d.hxx> #include <PrsMgr_PresentationManager3d.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
@ -33,21 +33,21 @@ class TopoDS_Wire;
class TopoDS_Vertex; class TopoDS_Vertex;
class gp_Dir; class gp_Dir;
DEFINE_STANDARD_HANDLE(AIS_IdenticRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_IdenticRelation, PrsDim_Relation)
//! Constructs a constraint by a relation of identity //! Constructs a constraint by a relation of identity
//! between two or more datums figuring in shape //! between two or more datums figuring in shape
//! Interactive Objects. //! Interactive Objects.
class AIS_IdenticRelation : public AIS_Relation class PrsDim_IdenticRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(PrsDim_IdenticRelation, PrsDim_Relation)
public: public:
//! Initializes the relation of identity between the two //! Initializes the relation of identity between the two
//! entities, FirstShape and SecondShape. The plane //! entities, FirstShape and SecondShape. The plane
//! aPlane is initialized in case a visual reference is //! aPlane is initialized in case a visual reference is
//! needed to show identity. //! needed to show identity.
Standard_EXPORT AIS_IdenticRelation(const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane); Standard_EXPORT PrsDim_IdenticRelation(const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
Standard_Boolean HasUsers() const { return !myUsers.IsEmpty(); } Standard_Boolean HasUsers() const { return !myUsers.IsEmpty(); }
@ -60,8 +60,6 @@ public:
//! Returns true if the interactive object is movable. //! Returns true if the interactive object is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
DEFINE_STANDARD_RTTIEXT(AIS_IdenticRelation,AIS_Relation)
private: private:
@ -123,4 +121,4 @@ private:
}; };
#endif // _AIS_IdenticRelation_HeaderFile #endif // _PrsDim_IdenticRelation_HeaderFile

View File

@ -14,27 +14,27 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_KindOfDimension_HeaderFile #ifndef _PrsDim_KindOfDimension_HeaderFile
#define _AIS_KindOfDimension_HeaderFile #define _PrsDim_KindOfDimension_HeaderFile
//! Declares the kinds of dimensions needed in the //! Declares the kinds of dimensions needed in the
//! display of Interactive Objects. //! display of Interactive Objects.
enum AIS_KindOfDimension enum PrsDim_KindOfDimension
{ {
AIS_KOD_NONE, PrsDim_KOD_NONE,
AIS_KOD_LENGTH, PrsDim_KOD_LENGTH,
AIS_KOD_PLANEANGLE, PrsDim_KOD_PLANEANGLE,
AIS_KOD_SOLIDANGLE, PrsDim_KOD_SOLIDANGLE,
AIS_KOD_AREA, PrsDim_KOD_AREA,
AIS_KOD_VOLUME, PrsDim_KOD_VOLUME,
AIS_KOD_MASS, PrsDim_KOD_MASS,
AIS_KOD_TIME, PrsDim_KOD_TIME,
AIS_KOD_RADIUS, PrsDim_KOD_RADIUS,
AIS_KOD_DIAMETER, PrsDim_KOD_DIAMETER,
AIS_KOD_CHAMF2D, PrsDim_KOD_CHAMF2D,
AIS_KOD_CHAMF3D, PrsDim_KOD_CHAMF3D,
AIS_KOD_OFFSET, PrsDim_KOD_OFFSET,
AIS_KOD_ELLIPSERADIUS PrsDim_KOD_ELLIPSERADIUS
}; };
#endif // _AIS_KindOfDimension_HeaderFile #endif // _PrsDim_KindOfDimension_HeaderFile

View File

@ -12,22 +12,22 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_KindOfRelation_HeaderFile #ifndef _PrsDim_KindOfRelation_HeaderFile
#define _AIS_KindOfRelation_HeaderFile #define _PrsDim_KindOfRelation_HeaderFile
enum AIS_KindOfRelation enum PrsDim_KindOfRelation
{ {
AIS_KOR_NONE = 0, PrsDim_KOR_NONE = 0,
AIS_KOR_CONCENTRIC, PrsDim_KOR_CONCENTRIC,
AIS_KOR_EQUALDISTANCE, PrsDim_KOR_EQUALDISTANCE,
AIS_KOR_EQUALRADIUS, PrsDim_KOR_EQUALRADIUS,
AIS_KOR_FIX, PrsDim_KOR_FIX,
AIS_KOR_IDENTIC, PrsDim_KOR_IDENTIC,
AIS_KOR_OFFSET, PrsDim_KOR_OFFSET,
AIS_KOR_PARALLEL, PrsDim_KOR_PARALLEL,
AIS_KOR_PERPENDICULAR, PrsDim_KOR_PERPENDICULAR,
AIS_KOR_TANGENT, PrsDim_KOR_TANGENT,
AIS_KOR_SYMMETRIC PrsDim_KOR_SYMMETRIC
}; };
#endif #endif

View File

@ -14,20 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_KindOfUnit_HeaderFile #ifndef _PrsDim_KindOfSurface_HeaderFile
#define _AIS_KindOfUnit_HeaderFile #define _PrsDim_KindOfSurface_HeaderFile
//! Declares the type of Interactive Object unit. enum PrsDim_KindOfSurface
enum AIS_KindOfUnit
{ {
AIS_TOU_LENGTH, PrsDim_KOS_Plane,
AIS_TOU_SURFACE, PrsDim_KOS_Cylinder,
AIS_TOU_VOLUME, PrsDim_KOS_Cone,
AIS_TOU_PLANE_ANGLE, PrsDim_KOS_Sphere,
AIS_TOU_SOLID_ANGLE, PrsDim_KOS_Torus,
AIS_TOU_MASS, PrsDim_KOS_Revolution,
AIS_TOU_FORCE, PrsDim_KOS_Extrusion,
AIS_TOU_TIME PrsDim_KOS_OtherSurface
}; };
#endif // _AIS_KindOfUnit_HeaderFile #endif // _PrsDim_KindOfSurface_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <AIS_LengthDimension.hxx> #include <PrsDim_LengthDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepExtrema_DistShapeShape.hxx> #include <BRepExtrema_DistShapeShape.hxx>
@ -35,16 +35,15 @@
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(PrsDim_LengthDimension, PrsDim_Dimension)
IMPLEMENT_STANDARD_RTTIEXT(AIS_LengthDimension,AIS_Dimension)
//======================================================================= //=======================================================================
//function : Constructor //function : Constructor
//purpose : Dimension between two faces //purpose : Dimension between two faces
//======================================================================= //=======================================================================
AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace, PrsDim_LengthDimension::PrsDim_LengthDimension (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace) const TopoDS_Face& theSecondFace)
: AIS_Dimension (AIS_KOD_LENGTH), : PrsDim_Dimension (PrsDim_KOD_LENGTH),
myHasCustomDirection (Standard_False) myHasCustomDirection (Standard_False)
{ {
SetMeasuredGeometry (theFirstFace, theSecondFace); SetMeasuredGeometry (theFirstFace, theSecondFace);
@ -55,9 +54,9 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace,
//function : Constructor //function : Constructor
//purpose : Dimension between two shape //purpose : Dimension between two shape
//======================================================================= //=======================================================================
AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace, PrsDim_LengthDimension::PrsDim_LengthDimension (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge) const TopoDS_Edge& theEdge)
: AIS_Dimension (AIS_KOD_LENGTH), : PrsDim_Dimension (PrsDim_KOD_LENGTH),
myHasCustomDirection (Standard_False) myHasCustomDirection (Standard_False)
{ {
SetMeasuredGeometry (theFace, theEdge); SetMeasuredGeometry (theFace, theEdge);
@ -68,10 +67,10 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace,
//function : Constructor //function : Constructor
//purpose : Dimension between two points //purpose : Dimension between two points
//======================================================================= //=======================================================================
AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, PrsDim_LengthDimension::PrsDim_LengthDimension (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
const gp_Pln& thePlane) const gp_Pln& thePlane)
: AIS_Dimension (AIS_KOD_LENGTH), : PrsDim_Dimension (PrsDim_KOD_LENGTH),
myHasCustomDirection (Standard_False) myHasCustomDirection (Standard_False)
{ {
SetMeasuredGeometry (theFirstPoint, theSecondPoint, thePlane); SetMeasuredGeometry (theFirstPoint, theSecondPoint, thePlane);
@ -82,10 +81,10 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint,
//function : Constructor //function : Constructor
//purpose : Dimension between two shape //purpose : Dimension between two shape
//======================================================================= //=======================================================================
AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape, PrsDim_LengthDimension::PrsDim_LengthDimension (const TopoDS_Shape& theFirstShape,
const TopoDS_Shape& theSecondShape, const TopoDS_Shape& theSecondShape,
const gp_Pln& thePlane) const gp_Pln& thePlane)
: AIS_Dimension (AIS_KOD_LENGTH), : PrsDim_Dimension (PrsDim_KOD_LENGTH),
myHasCustomDirection (Standard_False) myHasCustomDirection (Standard_False)
{ {
SetCustomPlane (thePlane); SetCustomPlane (thePlane);
@ -97,9 +96,9 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape,
//function : Constructor //function : Constructor
//purpose : Dimension of one edge //purpose : Dimension of one edge
//======================================================================= //=======================================================================
AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge, PrsDim_LengthDimension::PrsDim_LengthDimension (const TopoDS_Edge& theEdge,
const gp_Pln& thePlane) const gp_Pln& thePlane)
: AIS_Dimension (AIS_KOD_LENGTH), : PrsDim_Dimension (PrsDim_KOD_LENGTH),
myHasCustomDirection (Standard_False) myHasCustomDirection (Standard_False)
{ {
SetMeasuredGeometry (theEdge, thePlane); SetMeasuredGeometry (theEdge, thePlane);
@ -110,7 +109,7 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint, void PrsDim_LengthDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
const gp_Pln& thePlane) const gp_Pln& thePlane)
{ {
@ -129,7 +128,7 @@ void AIS_LengthDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Edge& theEdge, void PrsDim_LengthDimension::SetMeasuredGeometry (const TopoDS_Edge& theEdge,
const gp_Pln& thePlane) const gp_Pln& thePlane)
{ {
myFirstShape = theEdge; myFirstShape = theEdge;
@ -145,7 +144,7 @@ void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Edge& theEdge,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, void PrsDim_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace) const TopoDS_Face& theSecondFace)
{ {
SetMeasuredShapes (theFirstFace, theSecondFace); SetMeasuredShapes (theFirstFace, theSecondFace);
@ -155,7 +154,7 @@ void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFace, void PrsDim_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge) const TopoDS_Edge& theEdge)
{ {
SetMeasuredShapes (theFace, theEdge); SetMeasuredShapes (theFace, theEdge);
@ -165,7 +164,7 @@ void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFace,
//function : SetMeasuredShapes //function : SetMeasuredShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetMeasuredShapes (const TopoDS_Shape& theFirstShape, void PrsDim_LengthDimension::SetMeasuredShapes (const TopoDS_Shape& theFirstShape,
const TopoDS_Shape& theSecondShape) const TopoDS_Shape& theSecondShape)
{ {
gp_Pln aComputedPlane; gp_Pln aComputedPlane;
@ -194,7 +193,7 @@ void AIS_LengthDimension::SetMeasuredShapes (const TopoDS_Shape& theFirstShape,
//function : CheckPlane //function : CheckPlane
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_LengthDimension::CheckPlane (const gp_Pln& thePlane) const Standard_Boolean PrsDim_LengthDimension::CheckPlane (const gp_Pln& thePlane) const
{ {
Standard_Boolean anIsFaultyNormal = Standard_Boolean anIsFaultyNormal =
thePlane.Axis().Direction().IsParallel(gce_MakeDir (myFirstPoint, mySecondPoint), Precision::Angular()); thePlane.Axis().Direction().IsParallel(gce_MakeDir (myFirstPoint, mySecondPoint), Precision::Angular());
@ -212,7 +211,7 @@ Standard_Boolean AIS_LengthDimension::CheckPlane (const gp_Pln& thePlane) const
//function : ComputePlane //function : ComputePlane
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pln AIS_LengthDimension::ComputePlane (const gp_Dir& theAttachDir) const gp_Pln PrsDim_LengthDimension::ComputePlane (const gp_Dir& theAttachDir) const
{ {
if (!IsValidPoints (myFirstPoint, mySecondPoint)) if (!IsValidPoints (myFirstPoint, mySecondPoint))
{ {
@ -228,7 +227,7 @@ gp_Pln AIS_LengthDimension::ComputePlane (const gp_Dir& theAttachDir) const
//function : GetModelUnits //function : GetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_LengthDimension::GetModelUnits() const const TCollection_AsciiString& PrsDim_LengthDimension::GetModelUnits() const
{ {
return myDrawer->DimLengthModelUnits(); return myDrawer->DimLengthModelUnits();
} }
@ -237,7 +236,7 @@ const TCollection_AsciiString& AIS_LengthDimension::GetModelUnits() const
//function : GetDisplayUnits //function : GetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_LengthDimension::GetDisplayUnits() const const TCollection_AsciiString& PrsDim_LengthDimension::GetDisplayUnits() const
{ {
return myDrawer->DimLengthDisplayUnits(); return myDrawer->DimLengthDisplayUnits();
} }
@ -246,7 +245,7 @@ const TCollection_AsciiString& AIS_LengthDimension::GetDisplayUnits() const
//function : SetModelUnits //function : SetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetModelUnits (const TCollection_AsciiString& theUnits) void PrsDim_LengthDimension::SetModelUnits (const TCollection_AsciiString& theUnits)
{ {
myDrawer->SetDimLengthModelUnits (theUnits); myDrawer->SetDimLengthModelUnits (theUnits);
} }
@ -255,7 +254,7 @@ void AIS_LengthDimension::SetModelUnits (const TCollection_AsciiString& theUnits
//function : SetDisplayUnits //function : SetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) void PrsDim_LengthDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits)
{ {
myDrawer->SetDimLengthDisplayUnits (theUnits); myDrawer->SetDimLengthDisplayUnits (theUnits);
} }
@ -264,7 +263,7 @@ void AIS_LengthDimension::SetDisplayUnits (const TCollection_AsciiString& theUni
//function : ComputeValue //function : ComputeValue
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real AIS_LengthDimension::ComputeValue() const Standard_Real PrsDim_LengthDimension::ComputeValue() const
{ {
if (!IsValid()) if (!IsValid())
return 0.0; return 0.0;
@ -279,7 +278,7 @@ Standard_Real AIS_LengthDimension::ComputeValue() const
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, void PrsDim_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/,
const Handle(Prs3d_Presentation)& thePresentation, const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode) const Standard_Integer theMode)
{ {
@ -297,12 +296,12 @@ void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /
//function : ComputeFlyoutLinePoints //function : ComputeFlyoutLinePoints
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint, void PrsDim_LengthDimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint,
gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint) gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint)
{ {
if (!myHasCustomDirection) if (!myHasCustomDirection)
{ {
AIS_Dimension::ComputeFlyoutLinePoints (theFirstPoint, theSecondPoint, theLineBegPoint, theLineEndPoint); PrsDim_Dimension::ComputeFlyoutLinePoints (theFirstPoint, theSecondPoint, theLineBegPoint, theLineEndPoint);
return; return;
} }
@ -326,7 +325,7 @@ void AIS_LengthDimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint,
//function : ComputeFlyoutSelection //function : ComputeFlyoutSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, void PrsDim_LengthDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection,
const Handle(SelectMgr_EntityOwner)& theEntityOwner) const Handle(SelectMgr_EntityOwner)& theEntityOwner)
{ {
if (!IsValid()) if (!IsValid())
@ -341,7 +340,7 @@ void AIS_LengthDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selecti
//function : IsValidPoints //function : IsValidPoints
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_LengthDimension::IsValidPoints (const gp_Pnt& theFirstPoint, Standard_Boolean PrsDim_LengthDimension::IsValidPoints (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint) const const gp_Pnt& theSecondPoint) const
{ {
return theFirstPoint.Distance (theSecondPoint) > Precision::Confusion(); return theFirstPoint.Distance (theSecondPoint) > Precision::Confusion();
@ -351,7 +350,7 @@ Standard_Boolean AIS_LengthDimension::IsValidPoints (const gp_Pnt& theFirstPoint
//function : InitTwoEdgesLength //function : InitTwoEdgesLength
//purpose : Initialization of dimension between two linear edges //purpose : Initialization of dimension between two linear edges
//======================================================================= //=======================================================================
Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& theFirstEdge, Standard_Boolean PrsDim_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& theFirstEdge,
const TopoDS_Edge& theSecondEdge, const TopoDS_Edge& theSecondEdge,
gp_Dir& theDirAttach) gp_Dir& theDirAttach)
{ {
@ -377,7 +376,7 @@ Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& the
Standard_Boolean isFirstInfinite = Standard_False; Standard_Boolean isFirstInfinite = Standard_False;
Standard_Boolean isSecondInfinite = Standard_False; Standard_Boolean isSecondInfinite = Standard_False;
if (!AIS::ComputeGeometry (theFirstEdge, theSecondEdge, if (!PrsDim::ComputeGeometry (theFirstEdge, theSecondEdge,
aFirstCurve, aSecondCurve, aFirstCurve, aSecondCurve,
aPoint11, aPoint12, aPoint11, aPoint12,
aPoint21, aPoint22, aPoint21, aPoint22,
@ -401,13 +400,13 @@ Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& the
if (!isFirstInfinite) if (!isFirstInfinite)
{ {
if (AIS::Nearest (aSecondCurve, aPoint11, aPoint21, aPoint22, aPoint)) if (PrsDim::Nearest (aSecondCurve, aPoint11, aPoint21, aPoint22, aPoint))
{ {
myFirstPoint = aPoint11; myFirstPoint = aPoint11;
mySecondPoint = aPoint; mySecondPoint = aPoint;
return IsValidPoints (myFirstPoint, mySecondPoint); return IsValidPoints (myFirstPoint, mySecondPoint);
} }
else if (AIS::Nearest (aSecondCurve, aPoint12, aPoint21, aPoint22, aPoint)) else if (PrsDim::Nearest (aSecondCurve, aPoint12, aPoint21, aPoint22, aPoint))
{ {
myFirstPoint = aPoint12; myFirstPoint = aPoint12;
mySecondPoint = aPoint; mySecondPoint = aPoint;
@ -417,13 +416,13 @@ Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& the
if (!isSecondInfinite) if (!isSecondInfinite)
{ {
if (AIS::Nearest (aFirstCurve, aPoint21, aPoint11, aPoint12, aPoint)) if (PrsDim::Nearest (aFirstCurve, aPoint21, aPoint11, aPoint12, aPoint))
{ {
myFirstPoint = aPoint; myFirstPoint = aPoint;
mySecondPoint = aPoint21; mySecondPoint = aPoint21;
return IsValidPoints (myFirstPoint, mySecondPoint); return IsValidPoints (myFirstPoint, mySecondPoint);
} }
if (AIS::Nearest (aFirstCurve, aPoint22, aPoint11, aPoint12, aPoint)) if (PrsDim::Nearest (aFirstCurve, aPoint22, aPoint11, aPoint12, aPoint))
{ {
myFirstPoint = aPoint; myFirstPoint = aPoint;
mySecondPoint = aPoint22; mySecondPoint = aPoint22;
@ -440,7 +439,7 @@ Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& the
//function : InitEdgeVertexLength //function : InitEdgeVertexLength
//purpose : for first edge and second vertex shapes //purpose : for first edge and second vertex shapes
//======================================================================= //=======================================================================
Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& theEdge, Standard_Boolean PrsDim_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& theEdge,
const TopoDS_Vertex& theVertex, const TopoDS_Vertex& theVertex,
gp_Dir& theEdgeDir, gp_Dir& theEdgeDir,
Standard_Boolean isInfinite) Standard_Boolean isInfinite)
@ -449,7 +448,7 @@ Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& t
gp_Pnt anEdgePoint2 (gp::Origin()); gp_Pnt anEdgePoint2 (gp::Origin());
Handle(Geom_Curve) aCurve; Handle(Geom_Curve) aCurve;
if (!AIS::ComputeGeometry (theEdge, aCurve, anEdgePoint1, anEdgePoint2, isInfinite)) if (!PrsDim::ComputeGeometry (theEdge, aCurve, anEdgePoint1, anEdgePoint2, isInfinite))
{ {
return Standard_False; return Standard_False;
} }
@ -462,7 +461,7 @@ Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& t
// Get direction of edge to build plane automatically. // Get direction of edge to build plane automatically.
theEdgeDir = aLin.Direction(); theEdgeDir = aLin.Direction();
mySecondPoint = AIS::Nearest (aLin, myFirstPoint); mySecondPoint = PrsDim::Nearest (aLin, myFirstPoint);
return IsValidPoints (myFirstPoint, mySecondPoint); return IsValidPoints (myFirstPoint, mySecondPoint);
} }
@ -471,7 +470,7 @@ Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& t
//function : InitEdgeFaceLength //function : InitEdgeFaceLength
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_LengthDimension::InitEdgeFaceLength (const TopoDS_Edge& theEdge, Standard_Boolean PrsDim_LengthDimension::InitEdgeFaceLength (const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace, const TopoDS_Face& theFace,
gp_Dir& theEdgeDir) gp_Dir& theEdgeDir)
{ {
@ -522,7 +521,7 @@ Standard_Boolean AIS_LengthDimension::InitEdgeFaceLength (const TopoDS_Edge& the
//purpose : Initialization of two points where dimension layouts //purpose : Initialization of two points where dimension layouts
// will be attached // will be attached
//======================================================================= //=======================================================================
Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& theFirstShape, Standard_Boolean PrsDim_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& theFirstShape,
const TopoDS_Shape& theSecondShape, const TopoDS_Shape& theSecondShape,
gp_Pln& theComputedPlane, gp_Pln& theComputedPlane,
Standard_Boolean& theIsPlaneComputed) Standard_Boolean& theIsPlaneComputed)
@ -538,12 +537,12 @@ Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& t
// Initialization for face // Initialization for face
gp_Pln aFirstPlane; gp_Pln aFirstPlane;
Handle(Geom_Surface) aFirstSurface; Handle(Geom_Surface) aFirstSurface;
AIS_KindOfSurface aFirstSurfKind; PrsDim_KindOfSurface aFirstSurfKind;
Standard_Real aFirstOffset; Standard_Real aFirstOffset;
TopoDS_Face aFirstFace = TopoDS::Face (theFirstShape); TopoDS_Face aFirstFace = TopoDS::Face (theFirstShape);
AIS::InitFaceLength (TopoDS::Face (theFirstShape), PrsDim::InitFaceLength (TopoDS::Face (theFirstShape),
aFirstPlane, aFirstPlane,
aFirstSurface, aFirstSurface,
aFirstSurfKind, aFirstSurfKind,
@ -555,18 +554,18 @@ Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& t
myGeometryType = GeometryType_Faces; myGeometryType = GeometryType_Faces;
gp_Pln aSecondPlane; gp_Pln aSecondPlane;
Handle(Geom_Surface) aSecondSurface; Handle(Geom_Surface) aSecondSurface;
AIS_KindOfSurface aSecondSurfKind; PrsDim_KindOfSurface aSecondSurfKind;
Standard_Real aSecondOffset; Standard_Real aSecondOffset;
TopoDS_Face aSecondFace = TopoDS::Face (theSecondShape); TopoDS_Face aSecondFace = TopoDS::Face (theSecondShape);
AIS::InitFaceLength (aSecondFace, PrsDim::InitFaceLength (aSecondFace,
aSecondPlane, aSecondPlane,
aSecondSurface, aSecondSurface,
aSecondSurfKind, aSecondSurfKind,
aSecondOffset); aSecondOffset);
if (aFirstSurfKind == AIS_KOS_Plane) if (aFirstSurfKind == PrsDim_KOS_Plane)
{ {
if (!aFirstPlane.Axis().Direction().IsParallel (aSecondPlane.Axis().Direction(), Precision::Angular())) if (!aFirstPlane.Axis().Direction().IsParallel (aSecondPlane.Axis().Direction(), Precision::Angular()))
{ {
@ -585,7 +584,7 @@ Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& t
myFirstPoint = BRep_Tool::Pnt (TopoDS::Vertex (anExplorer.Current())); myFirstPoint = BRep_Tool::Pnt (TopoDS::Vertex (anExplorer.Current()));
} }
mySecondPoint = AIS::ProjectPointOnPlane (myFirstPoint, aSecondPlane); mySecondPoint = PrsDim::ProjectPointOnPlane (myFirstPoint, aSecondPlane);
Standard_Real anU, aV; Standard_Real anU, aV;
ElSLib::Parameters (aSecondPlane, mySecondPoint, anU, aV); ElSLib::Parameters (aSecondPlane, mySecondPoint, anU, aV);
@ -595,7 +594,7 @@ Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& t
if (aState == TopAbs_OUT || aState == TopAbs_UNKNOWN) if (aState == TopAbs_OUT || aState == TopAbs_UNKNOWN)
{ {
mySecondPoint = AIS::Nearest (aSecondFace, myFirstPoint); mySecondPoint = PrsDim::Nearest (aSecondFace, myFirstPoint);
} }
isSuccess = IsValidPoints (myFirstPoint, mySecondPoint); isSuccess = IsValidPoints (myFirstPoint, mySecondPoint);
@ -752,7 +751,7 @@ Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& t
// Attention: 1) <theShape> can be only the edge in currect implementation // Attention: 1) <theShape> can be only the edge in currect implementation
// 2) No length for infinite edge // 2) No length for infinite edge
//======================================================================= //=======================================================================
Standard_Boolean AIS_LengthDimension::InitOneShapePoints (const TopoDS_Shape& theShape) Standard_Boolean PrsDim_LengthDimension::InitOneShapePoints (const TopoDS_Shape& theShape)
{ {
if (theShape.ShapeType() != TopAbs_EDGE) if (theShape.ShapeType() != TopAbs_EDGE)
{ {
@ -786,7 +785,7 @@ Standard_Boolean AIS_LengthDimension::InitOneShapePoints (const TopoDS_Shape& th
//function : GetTextPosition //function : GetTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Pnt AIS_LengthDimension::GetTextPosition() const gp_Pnt PrsDim_LengthDimension::GetTextPosition() const
{ {
if (IsTextPositionCustom()) if (IsTextPositionCustom())
{ {
@ -801,7 +800,7 @@ const gp_Pnt AIS_LengthDimension::GetTextPosition() const
//function : SetTextPosition //function : SetTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos) void PrsDim_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos)
{ {
if (!IsValid()) if (!IsValid())
{ {
@ -818,7 +817,7 @@ void AIS_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos)
//function : SetDirection //function : SetDirection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_LengthDimension::SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection) void PrsDim_LengthDimension::SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection)
{ {
myHasCustomDirection = theUseDirection; myHasCustomDirection = theUseDirection;
if (myHasCustomDirection) if (myHasCustomDirection)

View File

@ -11,12 +11,11 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_LengthDimension_HeaderFile #ifndef _PrsDim_LengthDimension_HeaderFile
#define _AIS_LengthDimension_HeaderFile #define _PrsDim_LengthDimension_HeaderFile
#include <AIS.hxx> #include <PrsDim_Dimension.hxx>
#include <AIS_Dimension.hxx> #include <PrsDim_KindOfDimension.hxx>
#include <AIS_KindOfDimension.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
@ -25,7 +24,7 @@
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
DEFINE_STANDARD_HANDLE (AIS_LengthDimension, AIS_Dimension) DEFINE_STANDARD_HANDLE (PrsDim_LengthDimension, PrsDim_Dimension)
//! Length dimension. Can be constructued: //! Length dimension. Can be constructued:
//! - Between two generic points. //! - Between two generic points.
@ -45,21 +44,22 @@ DEFINE_STANDARD_HANDLE (AIS_LengthDimension, AIS_Dimension)
//! or the distance between measured points is less than //! or the distance between measured points is less than
//! Precision::Confusion(), the dimension is invalid and its //! Precision::Confusion(), the dimension is invalid and its
//! presentation can not be computed. //! presentation can not be computed.
class AIS_LengthDimension : public AIS_Dimension class PrsDim_LengthDimension : public PrsDim_Dimension
{ {
DEFINE_STANDARD_RTTIEXT(PrsDim_LengthDimension, PrsDim_Dimension)
public: public:
//! Construct length dimension between face and edge. //! Construct length dimension between face and edge.
//! Here dimension can be built without user-defined plane. //! Here dimension can be built without user-defined plane.
//! @param theFace [in] the face (first shape). //! @param theFace [in] the face (first shape).
//! @param theEdge [in] the edge (second shape). //! @param theEdge [in] the edge (second shape).
Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFace, Standard_EXPORT PrsDim_LengthDimension (const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge); const TopoDS_Edge& theEdge);
//! Construct length dimension between two faces. //! Construct length dimension between two faces.
//! @param theFirstFace [in] the first face (first shape). //! @param theFirstFace [in] the first face (first shape).
//! @param theSecondFace [in] the second face (second shape). //! @param theSecondFace [in] the second face (second shape).
Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFirstFace, Standard_EXPORT PrsDim_LengthDimension (const TopoDS_Face& theFirstFace,
const TopoDS_Face& theSecondFace); const TopoDS_Face& theSecondFace);
//! Construct length dimension between two points in //! Construct length dimension between two points in
@ -67,7 +67,7 @@ public:
//! @param theFirstPoint [in] the first point. //! @param theFirstPoint [in] the first point.
//! @param theSecondPoint [in] the second point. //! @param theSecondPoint [in] the second point.
//! @param thePlane [in] the plane to orient dimension. //! @param thePlane [in] the plane to orient dimension.
Standard_EXPORT AIS_LengthDimension (const gp_Pnt& theFirstPoint, Standard_EXPORT PrsDim_LengthDimension (const gp_Pnt& theFirstPoint,
const gp_Pnt& theSecondPoint, const gp_Pnt& theSecondPoint,
const gp_Pln& thePlane); const gp_Pln& thePlane);
@ -76,41 +76,29 @@ public:
//! @param theFirstShape [in] the first shape. //! @param theFirstShape [in] the first shape.
//! @param theSecondShape [in] the second shape. //! @param theSecondShape [in] the second shape.
//! @param thePlane [in] the plane to orient dimension. //! @param thePlane [in] the plane to orient dimension.
Standard_EXPORT AIS_LengthDimension (const TopoDS_Shape& theFirstShape, Standard_EXPORT PrsDim_LengthDimension (const TopoDS_Shape& theFirstShape,
const TopoDS_Shape& theSecondShape, const TopoDS_Shape& theSecondShape,
const gp_Pln& thePlane); const gp_Pln& thePlane);
//! Construct length dimension of linear edge. //! Construct length dimension of linear edge.
//! @param theEdge [in] the edge to measure. //! @param theEdge [in] the edge to measure.
//! @param thePlane [in] the plane to orient dimension. //! @param thePlane [in] the plane to orient dimension.
Standard_EXPORT AIS_LengthDimension (const TopoDS_Edge& theEdge, Standard_EXPORT PrsDim_LengthDimension (const TopoDS_Edge& theEdge,
const gp_Pln& thePlane); const gp_Pln& thePlane);
public: public:
//! @return first attachement point. //! @return first attachement point.
const gp_Pnt& FirstPoint() const const gp_Pnt& FirstPoint() const { return myFirstPoint; }
{
return myFirstPoint;
}
//! @return second attachement point. //! @return second attachement point.
const gp_Pnt& SecondPoint() const const gp_Pnt& SecondPoint() const { return mySecondPoint; }
{
return mySecondPoint;
}
//! @return first attachement shape. //! @return first attachement shape.
const TopoDS_Shape& FirstShape() const const TopoDS_Shape& FirstShape() const { return myFirstShape; }
{
return myFirstShape;
}
//! @return second attachement shape. //! @return second attachement shape.
const TopoDS_Shape& SecondShape() const const TopoDS_Shape& SecondShape() const { return mySecondShape; }
{
return mySecondShape;
}
public: public:
@ -167,7 +155,7 @@ public:
Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE; Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE;
Standard_EXPORT virtual const gp_Pnt GetTextPosition() const Standard_OVERRIDE; Standard_EXPORT virtual gp_Pnt GetTextPosition() const Standard_OVERRIDE;
//! Set custom direction for dimension. If it is not set, the direction is obtained //! Set custom direction for dimension. If it is not set, the direction is obtained
//! from the measured geometry (e.g. line between points of dimension) //! from the measured geometry (e.g. line between points of dimension)
@ -176,10 +164,6 @@ public:
//! @param theUseDirection [in] boolean value if custom direction should be used. //! @param theUseDirection [in] boolean value if custom direction should be used.
Standard_EXPORT void SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection = Standard_True); Standard_EXPORT void SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection = Standard_True);
public:
DEFINE_STANDARD_RTTIEXT(AIS_LengthDimension,AIS_Dimension)
protected: protected:
//! Checks if the plane includes first and second points to build dimension. //! Checks if the plane includes first and second points to build dimension.
@ -262,4 +246,4 @@ private:
Standard_Boolean myHasCustomDirection; Standard_Boolean myHasCustomDirection;
}; };
#endif // _AIS_LengthDimension_HeaderFile #endif // _PrsDim_LengthDimension_HeaderFile

View File

@ -14,10 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_EllipseRadiusDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_EllipseRadiusDimension.hxx> #include <PrsDim_MaxRadiusDimension.hxx>
#include <AIS_MaxRadiusDimension.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <DsgPrs_EllipseRadiusPresentation.hxx> #include <DsgPrs_EllipseRadiusPresentation.hxx>
@ -30,7 +30,6 @@
#include <Geom_Surface.hxx> #include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx> #include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx> #include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx> #include <Geom_TrimmedCurve.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
@ -52,21 +51,20 @@
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_ConstructionError.hxx> #include <Standard_ConstructionError.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_MaxRadiusDimension,AIS_EllipseRadiusDimension) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_MaxRadiusDimension, PrsDim_EllipseRadiusDimension)
//======================================================================= //=======================================================================
//function : AIS_MaxRadiusDimension //function : PrsDim_MaxRadiusDimension
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, PrsDim_MaxRadiusDimension::PrsDim_MaxRadiusDimension(const TopoDS_Shape& aShape,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText) const TCollection_ExtendedString& aText)
:AIS_EllipseRadiusDimension(aShape, aText) :PrsDim_EllipseRadiusDimension(aShape, aText)
{ {
myVal = aVal; myVal = aVal;
mySymbolPrs = DsgPrs_AS_LASTAR; mySymbolPrs = DsgPrs_AS_LASTAR;
@ -75,17 +73,17 @@ AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape,
} }
//======================================================================= //=======================================================================
//function : AIS_MaxRadiusDimension //function : PrsDim_MaxRadiusDimension
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, PrsDim_MaxRadiusDimension::PrsDim_MaxRadiusDimension(const TopoDS_Shape& aShape,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText, const TCollection_ExtendedString& aText,
const gp_Pnt& aPosition, const gp_Pnt& aPosition,
const DsgPrs_ArrowSide aSymbolPrs, const DsgPrs_ArrowSide aSymbolPrs,
const Standard_Real anArrowSize) const Standard_Real anArrowSize)
:AIS_EllipseRadiusDimension(aShape, aText) :PrsDim_EllipseRadiusDimension(aShape, aText)
{ {
myVal = aVal; myVal = aVal;
mySymbolPrs = aSymbolPrs; mySymbolPrs = aSymbolPrs;
@ -99,7 +97,7 @@ AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MaxRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/, void PrsDim_MaxRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer /*aMode*/) const Standard_Integer /*aMode*/)
{ {
@ -122,7 +120,7 @@ void AIS_MaxRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aPresentation)
{ {
Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
@ -144,7 +142,7 @@ void AIS_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP
myAutomaticPosition = Standard_True; myAutomaticPosition = Standard_True;
if ( myIsSetBndBox ) if ( myIsSetBndBox )
myPosition = AIS::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), myPosition = PrsDim::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )),
myBndBox ); myBndBox );
curPos = myPosition; curPos = myPosition;
} }
@ -171,7 +169,7 @@ void AIS_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation)& aPresentation)
{ {
Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
@ -189,12 +187,12 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
Standard_Boolean IsInDomain = Standard_True; Standard_Boolean IsInDomain = Standard_True;
if( myAutomaticPosition ) if( myAutomaticPosition )
{ {
myEndOfArrow = AIS::NearestApex(myEllipse, myApexP, myApexN, myEndOfArrow = PrsDim::NearestApex(myEllipse, myApexP, myApexN,
myFirstPar, myLastPar, IsInDomain); myFirstPar, myLastPar, IsInDomain);
myPosition = Center; myPosition = Center;
myAutomaticPosition = Standard_True; myAutomaticPosition = Standard_True;
if ( myIsSetBndBox ) if ( myIsSetBndBox )
myPosition = AIS::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), myPosition = PrsDim::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )),
myBndBox ); myBndBox );
curPos = myPosition; curPos = myPosition;
} }
@ -211,7 +209,7 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
else else
myEndOfArrow = myApexN ; myEndOfArrow = myApexN ;
par = ElCLib::Parameter ( myEllipse, myEndOfArrow ); par = ElCLib::Parameter ( myEllipse, myEndOfArrow );
IsInDomain = AIS::InDomain( myFirstPar, myLastPar, par ); IsInDomain = PrsDim::InDomain( myFirstPar, myLastPar, par );
myPosition = curPos; myPosition = curPos;
} }
@ -219,8 +217,8 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
Standard_Real parStart = 0.; Standard_Real parStart = 0.;
if( !IsInDomain ) if( !IsInDomain )
{ {
if(AIS::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) <
AIS::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar))
parStart = myFirstPar; parStart = myFirstPar;
else else
parStart = myLastPar; parStart = myLastPar;
@ -240,7 +238,7 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer /*aMode*/) const Standard_Integer /*aMode*/)
{ {
@ -274,11 +272,11 @@ void AIS_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)&
{ {
Standard_Real parEnd = ElCLib::Parameter ( myEllipse, myEndOfArrow ); Standard_Real parEnd = ElCLib::Parameter ( myEllipse, myEndOfArrow );
if(!AIS::InDomain(myFirstPar, myLastPar, parEnd)) if(!PrsDim::InDomain(myFirstPar, myLastPar, parEnd))
{ {
Standard_Real parStart, par; Standard_Real parStart, par;
if(AIS::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) <
AIS::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar))
par = myFirstPar; par = myFirstPar;
else else
par = myLastPar; par = myLastPar;

View File

@ -14,29 +14,29 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_MaxRadiusDimension_HeaderFile #ifndef _PrsDim_MaxRadiusDimension_HeaderFile
#define _AIS_MaxRadiusDimension_HeaderFile #define _PrsDim_MaxRadiusDimension_HeaderFile
#include <AIS_EllipseRadiusDimension.hxx> #include <PrsDim_EllipseRadiusDimension.hxx>
#include <DsgPrs_ArrowSide.hxx> #include <DsgPrs_ArrowSide.hxx>
DEFINE_STANDARD_HANDLE(AIS_MaxRadiusDimension, AIS_EllipseRadiusDimension) DEFINE_STANDARD_HANDLE(PrsDim_MaxRadiusDimension, PrsDim_EllipseRadiusDimension)
//! Ellipse Max radius dimension of a Shape which can be Edge //! Ellipse Max radius dimension of a Shape which can be Edge
//! or Face (planar or cylindrical(surface of extrusion or //! or Face (planar or cylindrical(surface of extrusion or
//! surface of offset)) //! surface of offset))
class AIS_MaxRadiusDimension : public AIS_EllipseRadiusDimension class PrsDim_MaxRadiusDimension : public PrsDim_EllipseRadiusDimension
{ {
DEFINE_STANDARD_RTTIEXT(AIS_MaxRadiusDimension, AIS_EllipseRadiusDimension) DEFINE_STANDARD_RTTIEXT(PrsDim_MaxRadiusDimension, PrsDim_EllipseRadiusDimension)
public: public:
//! Max Ellipse radius dimension //! Max Ellipse radius dimension
//! Shape can be edge , planar face or cylindrical face //! 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); Standard_EXPORT PrsDim_MaxRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Max Ellipse radius dimension with position //! Max Ellipse radius dimension with position
//! Shape can be edge , planar face or cylindrical face //! 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); Standard_EXPORT PrsDim_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);
private: private:
@ -48,10 +48,12 @@ private:
Standard_EXPORT void ComputeArcOfEllipse (const Handle(Prs3d_Presentation)& aPresentation); Standard_EXPORT void ComputeArcOfEllipse (const Handle(Prs3d_Presentation)& aPresentation);
private:
gp_Pnt myApexP; gp_Pnt myApexP;
gp_Pnt myApexN; gp_Pnt myApexN;
gp_Pnt myEndOfArrow; gp_Pnt myEndOfArrow;
}; };
#endif // _AIS_MaxRadiusDimension_HeaderFile #endif // _PrsDim_MaxRadiusDimension_HeaderFile

View File

@ -13,9 +13,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_MidPointRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_MidPointRelation.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
@ -26,7 +26,6 @@
#include <Geom_Ellipse.hxx> #include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx> #include <Geom_TrimmedCurve.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
@ -46,23 +45,22 @@
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_MidPointRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_MidPointRelation, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : AIS_MidPointRelation //function : PrsDim_MidPointRelation
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_MidPointRelation::AIS_MidPointRelation(const TopoDS_Shape& aMidPointTool, PrsDim_MidPointRelation::PrsDim_MidPointRelation(const TopoDS_Shape& aMidPointTool,
const TopoDS_Shape& FirstShape, const TopoDS_Shape& FirstShape,
const TopoDS_Shape& SecondShape, const TopoDS_Shape& SecondShape,
const Handle(Geom_Plane)& aPlane) const Handle(Geom_Plane)& aPlane)
:AIS_Relation(), :PrsDim_Relation(),
myTool(aMidPointTool) myTool(aMidPointTool)
{ {
SetFirstShape(FirstShape); SetFirstShape(FirstShape);
@ -75,7 +73,7 @@ AIS_MidPointRelation::AIS_MidPointRelation(const TopoDS_Shape& aMidPointTool,
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aprs, const Handle(Prs3d_Presentation)& aprs,
const Standard_Integer) const Standard_Integer)
{ {
@ -83,7 +81,7 @@ void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
{ {
gp_Pnt pp; gp_Pnt pp;
Standard_Boolean isonplane; Standard_Boolean isonplane;
if ( AIS::ComputeGeometry(TopoDS::Vertex(myTool),pp,myPlane,isonplane) ) if ( PrsDim::ComputeGeometry(TopoDS::Vertex(myTool),pp,myPlane,isonplane) )
{ {
if ( !isonplane ) ComputeProjVertexPresentation(aprs,TopoDS::Vertex(myTool),pp); if ( !isonplane ) ComputeProjVertexPresentation(aprs,TopoDS::Vertex(myTool),pp);
} }
@ -140,7 +138,7 @@ void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
//function : ComputeSelection //function : ComputeSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSel, void PrsDim_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSel,
const Standard_Integer) const Standard_Integer)
{ {
Handle(Select3D_SensitiveSegment) seg; Handle(Select3D_SensitiveSegment) seg;
@ -180,7 +178,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a
if ( myFShape.ShapeType() == TopAbs_EDGE ) if ( myFShape.ShapeType() == TopAbs_EDGE )
{ {
TopoDS_Edge E = TopoDS::Edge(myFShape); TopoDS_Edge E = TopoDS::Edge(myFShape);
if ( !AIS::ComputeGeometry(E,curv,firstp,lastp,extCurv,isInfinite,isOnPlane,myPlane) ) return; if ( !PrsDim::ComputeGeometry(E,curv,firstp,lastp,extCurv,isInfinite,isOnPlane,myPlane) ) return;
if ( curv->IsInstance(STANDARD_TYPE(Geom_Line)) ) // case of line if ( curv->IsInstance(STANDARD_TYPE(Geom_Line)) ) // case of line
{ {
// segment on line // segment on line
@ -215,7 +213,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a
if ( mySShape.ShapeType() == TopAbs_EDGE ) if ( mySShape.ShapeType() == TopAbs_EDGE )
{ {
TopoDS_Edge E = TopoDS::Edge(mySShape); TopoDS_Edge E = TopoDS::Edge(mySShape);
if ( !AIS::ComputeGeometry(E,curv,firstp,lastp,extCurv,isInfinite,isOnPlane,myPlane) ) return; if ( !PrsDim::ComputeGeometry(E,curv,firstp,lastp,extCurv,isInfinite,isOnPlane,myPlane) ) return;
if ( curv->IsInstance(STANDARD_TYPE(Geom_Line)) ) // case of line if ( curv->IsInstance(STANDARD_TYPE(Geom_Line)) ) // case of line
{ {
// segment on line // segment on line
@ -251,7 +249,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a
//function : ComputeFaceFromPnt //function : ComputeFaceFromPnt
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::ComputeFaceFromPnt(const Handle(Prs3d_Presentation)&, void PrsDim_MidPointRelation::ComputeFaceFromPnt(const Handle(Prs3d_Presentation)&,
const Standard_Boolean /*first*/) const Standard_Boolean /*first*/)
{ {
} }
@ -260,7 +258,7 @@ void AIS_MidPointRelation::ComputeFaceFromPnt(const Handle(Prs3d_Presentation)&,
//function : ComputeEdgeFromPnt //function : ComputeEdgeFromPnt
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)& aprs, void PrsDim_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)& aprs,
const Standard_Boolean first) const Standard_Boolean first)
{ {
TopoDS_Edge E; TopoDS_Edge E;
@ -271,7 +269,7 @@ void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)&
gp_Pnt ptat1,ptat2; gp_Pnt ptat1,ptat2;
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
Standard_Boolean isInfinite,isOnPlane; Standard_Boolean isInfinite,isOnPlane;
if ( !AIS::ComputeGeometry(E, geom, ptat1, ptat2, extCurv, isInfinite, isOnPlane, myPlane) ) return; if ( !PrsDim::ComputeGeometry(E, geom, ptat1, ptat2, extCurv, isInfinite, isOnPlane, myPlane) ) return;
gp_Ax2 ax = myPlane->Pln().Position().Ax2(); gp_Ax2 ax = myPlane->Pln().Position().Ax2();
@ -318,7 +316,7 @@ void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)&
//function : ComputeVertexFromPnt //function : ComputeVertexFromPnt
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation)& aprs, void PrsDim_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation)& aprs,
const Standard_Boolean first) const Standard_Boolean first)
{ {
gp_Ax2 ax = myPlane->Pln().Position().Ax2(); gp_Ax2 ax = myPlane->Pln().Position().Ax2();
@ -326,7 +324,7 @@ void AIS_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation)
{ {
Standard_Boolean isOnPlane; Standard_Boolean isOnPlane;
TopoDS_Vertex V = TopoDS::Vertex(myFShape); TopoDS_Vertex V = TopoDS::Vertex(myFShape);
AIS::ComputeGeometry(V, myFAttach, myPlane, isOnPlane); PrsDim::ComputeGeometry(V, myFAttach, myPlane, isOnPlane);
DsgPrs_MidPointPresentation::Add(aprs,myDrawer,ax,myMidPoint,myPosition,myFAttach,first); DsgPrs_MidPointPresentation::Add(aprs,myDrawer,ax,myMidPoint,myPosition,myFAttach,first);
if ( !isOnPlane ) ComputeProjVertexPresentation(aprs,V,myFAttach); if ( !isOnPlane ) ComputeProjVertexPresentation(aprs,V,myFAttach);
} }
@ -334,7 +332,7 @@ void AIS_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation)
{ {
Standard_Boolean isOnPlane; Standard_Boolean isOnPlane;
TopoDS_Vertex V = TopoDS::Vertex(mySShape); TopoDS_Vertex V = TopoDS::Vertex(mySShape);
AIS::ComputeGeometry(V, mySAttach, myPlane, isOnPlane); PrsDim::ComputeGeometry(V, mySAttach, myPlane, isOnPlane);
DsgPrs_MidPointPresentation::Add(aprs,myDrawer,ax,myMidPoint,myPosition,mySAttach,first); DsgPrs_MidPointPresentation::Add(aprs,myDrawer,ax,myMidPoint,myPosition,mySAttach,first);
if ( !isOnPlane ) ComputeProjVertexPresentation(aprs,V,mySAttach); if ( !isOnPlane ) ComputeProjVertexPresentation(aprs,V,mySAttach);
} }
@ -344,7 +342,7 @@ void AIS_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation)
//function : ComputePointsOnLine //function : ComputePointsOnLine
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::ComputePointsOnLine(const gp_Lin& aLin, void PrsDim_MidPointRelation::ComputePointsOnLine(const gp_Lin& aLin,
const Standard_Boolean first) const Standard_Boolean first)
{ {
Standard_Real ppar = ElCLib::Parameter(aLin,myMidPoint); Standard_Real ppar = ElCLib::Parameter(aLin,myMidPoint);
@ -377,7 +375,7 @@ void AIS_MidPointRelation::ComputePointsOnLine(const gp_Lin& aLin,
//function : ComputePointsOnLine //function : ComputePointsOnLine
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::ComputePointsOnLine(const gp_Pnt& pnt1, const gp_Pnt& pnt2, void PrsDim_MidPointRelation::ComputePointsOnLine(const gp_Pnt& pnt1, const gp_Pnt& pnt2,
const Standard_Boolean first) const Standard_Boolean first)
{ {
gp_Vec aVec (pnt1,pnt2); gp_Vec aVec (pnt1,pnt2);
@ -444,7 +442,7 @@ void AIS_MidPointRelation::ComputePointsOnLine(const gp_Pnt& pnt1, const gp_Pnt&
//function : ComputePointsOnCirc //function : ComputePointsOnCirc
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc, void PrsDim_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc,
const gp_Pnt& pnt1, const gp_Pnt& pnt2, const gp_Pnt& pnt1, const gp_Pnt& pnt2,
const Standard_Boolean first) const Standard_Boolean first)
{ {
@ -571,7 +569,7 @@ void AIS_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc,
//function : ComputePointsOnElips //function : ComputePointsOnElips
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll, void PrsDim_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll,
const gp_Pnt& pnt1, const gp_Pnt& pnt2, const gp_Pnt& pnt1, const gp_Pnt& pnt2,
const Standard_Boolean first) const Standard_Boolean first)
{ {

View File

@ -13,10 +13,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_MidPointRelation_HeaderFile #ifndef _PrsDim_MidPointRelation_HeaderFile
#define _AIS_MidPointRelation_HeaderFile #define _PrsDim_MidPointRelation_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
class Geom_Plane; class Geom_Plane;
class gp_Lin; class gp_Lin;
@ -24,21 +24,21 @@ class gp_Pnt;
class gp_Circ; class gp_Circ;
class gp_Elips; class gp_Elips;
DEFINE_STANDARD_HANDLE(AIS_MidPointRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_MidPointRelation, PrsDim_Relation)
//! presentation of equal distance to point myMidPoint //! presentation of equal distance to point myMidPoint
class AIS_MidPointRelation : public AIS_Relation class PrsDim_MidPointRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_MidPointRelation, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_MidPointRelation, PrsDim_Relation)
public: public:
Standard_EXPORT AIS_MidPointRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane); Standard_EXPORT PrsDim_MidPointRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
void SetTool (const TopoDS_Shape& aMidPointTool); void SetTool (const TopoDS_Shape& aMidPointTool) { myTool = aMidPointTool; }
const TopoDS_Shape& GetTool() const; const TopoDS_Shape& GetTool() const { return myTool; }
private: private:
@ -72,6 +72,8 @@ private:
//! .______. myFirstPnt //! .______. myFirstPnt
Standard_EXPORT void ComputePointsOnElips (const gp_Elips& anEll, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first); Standard_EXPORT void ComputePointsOnElips (const gp_Elips& anEll, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first);
private:
TopoDS_Shape myTool; TopoDS_Shape myTool;
gp_Pnt myMidPoint; gp_Pnt myMidPoint;
gp_Pnt myFAttach; gp_Pnt myFAttach;
@ -83,6 +85,4 @@ private:
}; };
#include <AIS_MidPointRelation.lxx>
#endif // _AIS_MidPointRelation_HeaderFile #endif // _AIS_MidPointRelation_HeaderFile

View File

@ -14,10 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_MinRadiusDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_EllipseRadiusDimension.hxx> #include <PrsDim_EllipseRadiusDimension.hxx>
#include <AIS_MinRadiusDimension.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <DsgPrs_EllipseRadiusPresentation.hxx> #include <DsgPrs_EllipseRadiusPresentation.hxx>
@ -30,7 +30,6 @@
#include <Geom_Surface.hxx> #include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx> #include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_SurfaceOfRevolution.hxx> #include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_Transformation.hxx>
#include <Geom_TrimmedCurve.hxx> #include <Geom_TrimmedCurve.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
@ -52,21 +51,20 @@
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_ConstructionError.hxx> #include <Standard_ConstructionError.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_MinRadiusDimension,AIS_EllipseRadiusDimension) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_MinRadiusDimension, PrsDim_EllipseRadiusDimension)
//======================================================================= //=======================================================================
//function : AIS_MinRadiusDimension //function : PrsDim_MinRadiusDimension
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape, PrsDim_MinRadiusDimension::PrsDim_MinRadiusDimension(const TopoDS_Shape& aShape,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText) const TCollection_ExtendedString& aText)
:AIS_EllipseRadiusDimension(aShape, aText) :PrsDim_EllipseRadiusDimension(aShape, aText)
{ {
myVal = aVal; myVal = aVal;
mySymbolPrs = DsgPrs_AS_LASTAR; mySymbolPrs = DsgPrs_AS_LASTAR;
@ -75,17 +73,17 @@ AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape,
} }
//======================================================================= //=======================================================================
//function : AIS_MinRadiusDimension //function : PrsDim_MinRadiusDimension
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape, PrsDim_MinRadiusDimension::PrsDim_MinRadiusDimension(const TopoDS_Shape& aShape,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText, const TCollection_ExtendedString& aText,
const gp_Pnt& aPosition, const gp_Pnt& aPosition,
const DsgPrs_ArrowSide aSymbolPrs, const DsgPrs_ArrowSide aSymbolPrs,
const Standard_Real anArrowSize) const Standard_Real anArrowSize)
:AIS_EllipseRadiusDimension(aShape, aText) :PrsDim_EllipseRadiusDimension(aShape, aText)
{ {
myVal = aVal; myVal = aVal;
mySymbolPrs = aSymbolPrs; mySymbolPrs = aSymbolPrs;
@ -99,7 +97,7 @@ AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape,
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MinRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/, void PrsDim_MinRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer /*aMode*/) const Standard_Integer /*aMode*/)
{ {
@ -122,7 +120,7 @@ void AIS_MinRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aPresentation)
{ {
Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
@ -144,7 +142,7 @@ void AIS_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP
myAutomaticPosition = Standard_True; myAutomaticPosition = Standard_True;
if ( myIsSetBndBox ) if ( myIsSetBndBox )
myPosition = AIS::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), myPosition = PrsDim::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )),
myBndBox ); myBndBox );
curPos = myPosition; curPos = myPosition;
} }
@ -172,7 +170,7 @@ void AIS_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation)& aPresentation)
{ {
Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
@ -190,12 +188,12 @@ void AIS_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
Standard_Boolean IsInDomain = Standard_True; Standard_Boolean IsInDomain = Standard_True;
if( myAutomaticPosition ) if( myAutomaticPosition )
{ {
myEndOfArrow = AIS::NearestApex(myEllipse, myApexP, myApexN, myEndOfArrow = PrsDim::NearestApex(myEllipse, myApexP, myApexN,
myFirstPar, myLastPar, IsInDomain); myFirstPar, myLastPar, IsInDomain);
myPosition = Center; myPosition = Center;
myAutomaticPosition = Standard_True; myAutomaticPosition = Standard_True;
if ( myIsSetBndBox ) if ( myIsSetBndBox )
myPosition = AIS::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), myPosition = PrsDim::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )),
myBndBox ); myBndBox );
curPos = myPosition; curPos = myPosition;
@ -211,15 +209,15 @@ void AIS_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
else else
myEndOfArrow = myApexN ; myEndOfArrow = myApexN ;
par = ElCLib::Parameter ( myEllipse, myEndOfArrow ); par = ElCLib::Parameter ( myEllipse, myEndOfArrow );
IsInDomain = AIS::InDomain(myFirstPar, myLastPar, par); IsInDomain = PrsDim::InDomain(myFirstPar, myLastPar, par);
myPosition = curPos; myPosition = curPos;
} }
Standard_Real parStart =0.; Standard_Real parStart =0.;
if( !IsInDomain ) if( !IsInDomain )
{ {
if(AIS::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) <
AIS::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar))
parStart = myFirstPar; parStart = myFirstPar;
else else
parStart = myLastPar; parStart = myLastPar;
@ -242,7 +240,7 @@ void AIS_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer /*aMode*/) const Standard_Integer /*aMode*/)
{ {
@ -276,11 +274,11 @@ void AIS_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)&
{ {
Standard_Real parEnd = ElCLib::Parameter ( myEllipse, myEndOfArrow ); Standard_Real parEnd = ElCLib::Parameter ( myEllipse, myEndOfArrow );
if(!AIS::InDomain(myFirstPar, myLastPar, parEnd)) if(!PrsDim::InDomain(myFirstPar, myLastPar, parEnd))
{ {
Standard_Real parStart, par; Standard_Real parStart, par;
if(AIS::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) <
AIS::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar))
par = myFirstPar; par = myFirstPar;
else else
par = myLastPar; par = myLastPar;

View File

@ -14,29 +14,29 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_MinRadiusDimension_HeaderFile #ifndef _PrsDim_MinRadiusDimension_HeaderFile
#define _AIS_MinRadiusDimension_HeaderFile #define _PrsDim_MinRadiusDimension_HeaderFile
#include <AIS_EllipseRadiusDimension.hxx> #include <PrsDim_EllipseRadiusDimension.hxx>
#include <DsgPrs_ArrowSide.hxx> #include <DsgPrs_ArrowSide.hxx>
DEFINE_STANDARD_HANDLE(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension) DEFINE_STANDARD_HANDLE(PrsDim_MinRadiusDimension, PrsDim_EllipseRadiusDimension)
//! -- Ellipse Min radius dimension of a Shape which //! -- Ellipse Min radius dimension of a Shape which
//! can be Edge or Face (planar or cylindrical(surface of //! can be Edge or Face (planar or cylindrical(surface of
//! extrusion or surface of offset)) //! extrusion or surface of offset))
class AIS_MinRadiusDimension : public AIS_EllipseRadiusDimension class PrsDim_MinRadiusDimension : public PrsDim_EllipseRadiusDimension
{ {
DEFINE_STANDARD_RTTIEXT(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension) DEFINE_STANDARD_RTTIEXT(PrsDim_MinRadiusDimension, PrsDim_EllipseRadiusDimension)
public: public:
//! Max Ellipse radius dimension //! Max Ellipse radius dimension
//! Shape can be edge , planar face or cylindrical face //! 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); Standard_EXPORT PrsDim_MinRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Max Ellipse radius dimension with position //! Max Ellipse radius dimension with position
//! Shape can be edge , planar face or cylindrical face //! 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); Standard_EXPORT PrsDim_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);
private: private:
@ -48,10 +48,12 @@ private:
Standard_EXPORT void ComputeArcOfEllipse (const Handle(Prs3d_Presentation)& aPresentation); Standard_EXPORT void ComputeArcOfEllipse (const Handle(Prs3d_Presentation)& aPresentation);
private:
gp_Pnt myApexP; gp_Pnt myApexP;
gp_Pnt myApexN; gp_Pnt myApexN;
gp_Pnt myEndOfArrow; gp_Pnt myEndOfArrow;
}; };
#endif // _AIS_MinRadiusDimension_HeaderFile #endif // _PrsDim_MinRadiusDimension_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_OffsetDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_OffsetDimension.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <BRepBuilderAPI_Transform.hxx> #include <BRepBuilderAPI_Transform.hxx>
@ -24,7 +24,6 @@
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <ElSLib.hxx> #include <ElSLib.hxx>
#include <gce_MakeLin.hxx> #include <gce_MakeLin.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAbs_SurfaceType.hxx> #include <GeomAbs_SurfaceType.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
@ -46,7 +45,6 @@
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_WFShape.hxx> #include <StdPrs_WFShape.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <TColStd_Array2OfReal.hxx> #include <TColStd_Array2OfReal.hxx>
@ -55,17 +53,17 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_OffsetDimension,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_OffsetDimension, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : AIS_OffsetDimension //function : PrsDim_OffsetDimension
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_OffsetDimension::AIS_OffsetDimension(const TopoDS_Shape& FistShape, PrsDim_OffsetDimension::PrsDim_OffsetDimension(const TopoDS_Shape& FistShape,
const TopoDS_Shape& SecondShape, const TopoDS_Shape& SecondShape,
const Standard_Real aVal, const Standard_Real aVal,
const TCollection_ExtendedString& aText) const TCollection_ExtendedString& aText)
:AIS_Relation(), :PrsDim_Relation(),
myFAttach(0.,0.,0.), myFAttach(0.,0.,0.),
mySAttach(0.,0.,0.) mySAttach(0.,0.,0.)
{ {
@ -78,14 +76,14 @@ mySAttach(0.,0.,0.)
myArrowSize = fabs (myVal/10.0); myArrowSize = fabs (myVal/10.0);
if (myArrowSize > 30.) myArrowSize = 30.; if (myArrowSize > 30.) myArrowSize = 30.;
if (myArrowSize < 15.) myArrowSize = 15.; if (myArrowSize < 15.) myArrowSize = 15.;
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl; //std::cout<<"PrsDim_OffsetDimension::PrsDim_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
} }
//======================================================================= //=======================================================================
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aprs, const Handle(Prs3d_Presentation)& aprs,
const Standard_Integer) const Standard_Integer)
{ {
@ -94,7 +92,7 @@ void AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&,
myArrowSize = fabs (myVal/10.0); myArrowSize = fabs (myVal/10.0);
if (myArrowSize > 30.) myArrowSize = 30.; if (myArrowSize > 30.) myArrowSize = 30.;
if (myArrowSize < 15.) myArrowSize = 15.; if (myArrowSize < 15.) myArrowSize = 15.;
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl; //std::cout<<"PrsDim_OffsetDimension::PrsDim_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
BRepAdaptor_Surface surf1(TopoDS::Face(myFShape)); BRepAdaptor_Surface surf1(TopoDS::Face(myFShape));
BRepAdaptor_Surface surf2(TopoDS::Face(mySShape)); BRepAdaptor_Surface surf2(TopoDS::Face(mySShape));
@ -135,14 +133,14 @@ void AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&,
//function : ComputeSelection //function : ComputeSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSel, void PrsDim_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSel,
const Standard_Integer) const Standard_Integer)
{ {
//myArrowSize = fabs (myVal/5.); //myArrowSize = fabs (myVal/5.);
myArrowSize = fabs (myVal/10.0); myArrowSize = fabs (myVal/10.0);
if (myArrowSize > 30.) myArrowSize = 30.; if (myArrowSize > 30.) myArrowSize = 30.;
if (myArrowSize < 15.) myArrowSize = 15.; if (myArrowSize < 15.) myArrowSize = 15.;
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl; //std::cout<<"PrsDim_OffsetDimension::PrsDim_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
gp_Pnt myTFAttach = myFAttach.Transformed (myRelativePos); gp_Pnt myTFAttach = myFAttach.Transformed (myRelativePos);
gp_Pnt myTSAttach = mySAttach.Transformed (myRelativePos); gp_Pnt myTSAttach = mySAttach.Transformed (myRelativePos);
gp_Dir myTDirAttach = myDirAttach.Transformed (myRelativePos); gp_Dir myTDirAttach = myDirAttach.Transformed (myRelativePos);
@ -222,7 +220,7 @@ void AIS_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aS
//function : ComputeTwoAxesOffset //function : ComputeTwoAxesOffset
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)& aprs, void PrsDim_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)& aprs,
const gp_Trsf& aTrsf) const gp_Trsf& aTrsf)
{ {
BRepAdaptor_Surface surf1(TopoDS::Face(myFShape)); BRepAdaptor_Surface surf1(TopoDS::Face(myFShape));
@ -304,7 +302,7 @@ void AIS_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)&
Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect(); Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl; //std::cout<<"PrsDim_OffsetDimension::PrsDim_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
arr->SetLength(myArrowSize); arr->SetLength(myArrowSize);
arr = la->ArrowAspect(); arr = la->ArrowAspect();
arr->SetLength(myArrowSize); arr->SetLength(myArrowSize);
@ -316,7 +314,7 @@ void AIS_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)&
gp_Pnt Tcurpos = curpos.Transformed (aTrsf); gp_Pnt Tcurpos = curpos.Transformed (aTrsf);
if (myIsSetBndBox) if (myIsSetBndBox)
Tcurpos = AIS::TranslatePointToBound( Tcurpos, myDirAttach, myBndBox ); Tcurpos = PrsDim::TranslatePointToBound( Tcurpos, myDirAttach, myBndBox );
DsgPrs_OffsetPresentation::AddAxes(aprs, DsgPrs_OffsetPresentation::AddAxes(aprs,
myDrawer, myDrawer,
@ -340,7 +338,7 @@ void AIS_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)&
//function : ComputeTwoFacesOffset //function : ComputeTwoFacesOffset
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)& aprs, void PrsDim_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)& aprs,
const gp_Trsf& aTrsf) const gp_Trsf& aTrsf)
{ {
gp_Dir norm1 = myDirAttach; gp_Dir norm1 = myDirAttach;
@ -372,7 +370,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)
} }
curpos = myPosition; curpos = myPosition;
myFAttach = AIS::Nearest(myFShape,curpos); myFAttach = PrsDim::Nearest(myFShape,curpos);
if (myFAttach.Distance(curpos) <= Precision::Confusion()) { if (myFAttach.Distance(curpos) <= Precision::Confusion()) {
gp_Ax2 ax2(myFAttach,norm1); gp_Ax2 ax2(myFAttach,norm1);
myDirAttach = ax2.XDirection(); myDirAttach = ax2.XDirection();
@ -392,7 +390,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)
} }
} }
// en attendant mieux // en attendant mieux
mySAttach = AIS::Nearest(mySShape,curpos); mySAttach = PrsDim::Nearest(mySShape,curpos);
gp_Ax3 anax3 (myax2); gp_Ax3 anax3 (myax2);
gp_Pln apln (anax3); gp_Pln apln (anax3);
@ -410,7 +408,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)
Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect();
Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect(); Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect();
//std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl; //std::cout<<"PrsDim_OffsetDimension::PrsDim_OffsetDimension " << myArrowSize << " myArrowSize"<<std::endl;
arr->SetLength(myArrowSize); arr->SetLength(myArrowSize);
arr = la->ArrowAspect(); arr = la->ArrowAspect();
arr->SetLength(myArrowSize); arr->SetLength(myArrowSize);
@ -425,7 +423,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)
if (myIsSetBndBox) if (myIsSetBndBox)
{ {
BRepAdaptor_Surface surf1(TopoDS::Face(myFShape)); BRepAdaptor_Surface surf1(TopoDS::Face(myFShape));
Tcurpos = AIS::TranslatePointToBound( Tcurpos, surf1.Plane().XAxis().Direction(), myBndBox ); Tcurpos = PrsDim::TranslatePointToBound( Tcurpos, surf1.Plane().XAxis().Direction(), myBndBox );
} }
*/ */
DsgPrs_OffsetPresentation::Add(aprs, DsgPrs_OffsetPresentation::Add(aprs,
@ -451,7 +449,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)
//function : ComputeAxeFaceOffset //function : ComputeAxeFaceOffset
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_OffsetDimension::ComputeAxeFaceOffset(const Handle(Prs3d_Presentation)& aprs, void PrsDim_OffsetDimension::ComputeAxeFaceOffset(const Handle(Prs3d_Presentation)& aprs,
const gp_Trsf& aTrsf) const gp_Trsf& aTrsf)
{ {
BRepBuilderAPI_Transform transform1 (myFShape, aTrsf, Standard_True); BRepBuilderAPI_Transform transform1 (myFShape, aTrsf, Standard_True);

View File

@ -14,38 +14,38 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_OffsetDimension_HeaderFile #ifndef _PrsDim_OffsetDimension_HeaderFile
#define _AIS_OffsetDimension_HeaderFile #define _PrsDim_OffsetDimension_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
#include <AIS_KindOfDimension.hxx> #include <PrsDim_KindOfDimension.hxx>
DEFINE_STANDARD_HANDLE(AIS_OffsetDimension, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_OffsetDimension, PrsDim_Relation)
//! A framework to display dimensions of offsets. //! A framework to display dimensions of offsets.
//! The relation between the offset and the basis shape //! The relation between the offset and the basis shape
//! is indicated. This relation is displayed with arrows and //! is indicated. This relation is displayed with arrows and
//! text. The text gives the dsitance between the offset //! text. The text gives the dsitance between the offset
//! and the basis shape. //! and the basis shape.
class AIS_OffsetDimension : public AIS_Relation class PrsDim_OffsetDimension : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_OffsetDimension, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_OffsetDimension, PrsDim_Relation)
public: public:
//! Constructs the offset display object defined by the //! Constructs the offset display object defined by the
//! first shape aFShape, the second shape aSShape, the //! first shape aFShape, the second shape aSShape, the
//! dimension aVal, and the text aText. //! 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); Standard_EXPORT PrsDim_OffsetDimension(const TopoDS_Shape& FistShape, const TopoDS_Shape& SecondShape, const Standard_Real aVal, const TCollection_ExtendedString& aText);
//! Indicates that the dimension we are concerned with is an offset. //! Indicates that the dimension we are concerned with is an offset.
virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE; virtual PrsDim_KindOfDimension KindOfDimension() const Standard_OVERRIDE { return PrsDim_KOD_OFFSET; }
//! Returns true if the offset datum is movable. //! Returns true if the offset datum is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
//! Sets a transformation aTrsf for presentation and //! Sets a transformation aTrsf for presentation and
//! selection to a relative position. //! selection to a relative position.
void SetRelativePos (const gp_Trsf& aTrsf); void SetRelativePos (const gp_Trsf& aTrsf) { myRelativePos = aTrsf; }
private: private:
@ -59,6 +59,8 @@ private:
Standard_EXPORT void ComputeAxeFaceOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf); Standard_EXPORT void ComputeAxeFaceOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf);
private:
gp_Pnt myFAttach; gp_Pnt myFAttach;
gp_Pnt mySAttach; gp_Pnt mySAttach;
gp_Dir myDirAttach; gp_Dir myDirAttach;
@ -67,6 +69,4 @@ private:
}; };
#include <AIS_OffsetDimension.lxx> #endif // _PrsDim_OffsetDimension_HeaderFile
#endif // _AIS_OffsetDimension_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_ParallelRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_ParallelRelation.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
@ -26,7 +26,6 @@
#include <Geom_Ellipse.hxx> #include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
@ -44,19 +43,18 @@
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_DomainError.hxx> #include <Standard_DomainError.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_ParallelRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_ParallelRelation, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape, PrsDim_ParallelRelation::PrsDim_ParallelRelation(const TopoDS_Shape& aFShape,
const TopoDS_Shape& aSShape, const TopoDS_Shape& aSShape,
const Handle(Geom_Plane)& aPlane) const Handle(Geom_Plane)& aPlane)
{ {
@ -72,7 +70,7 @@ AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape, PrsDim_ParallelRelation::PrsDim_ParallelRelation(const TopoDS_Shape& aFShape,
const TopoDS_Shape& aSShape, const TopoDS_Shape& aSShape,
const Handle(Geom_Plane)& aPlane, const Handle(Geom_Plane)& aPlane,
const gp_Pnt& aPosition, const gp_Pnt& aPosition,
@ -92,7 +90,7 @@ AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape,
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer) const Standard_Integer)
{ {
@ -119,7 +117,7 @@ void AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
//function : ComputeSelection //function : ComputeSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer) const Standard_Integer)
{ {
gp_Lin L1 (myFAttach,myDirAttach); gp_Lin L1 (myFAttach,myDirAttach);
@ -188,16 +186,16 @@ void AIS_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a
//function : ComputeTwoFacesParallel //function : ComputeTwoFacesParallel
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ParallelRelation::ComputeTwoFacesParallel(const Handle(Prs3d_Presentation)&) void PrsDim_ParallelRelation::ComputeTwoFacesParallel(const Handle(Prs3d_Presentation)&)
{ {
throw Standard_NotImplemented("AIS_ParallelRelation::ComputeTwoFacesParallel not implemented"); throw Standard_NotImplemented("PrsDim_ParallelRelation::ComputeTwoFacesParallel not implemented");
} }
//======================================================================= //=======================================================================
//function : ComputeTwoEdgesParallel //function : ComputeTwoEdgesParallel
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentation)& aPresentation)
{ {
TopoDS_Edge E1 = TopoDS::Edge(myFShape); TopoDS_Edge E1 = TopoDS::Edge(myFShape);
TopoDS_Edge E2 = TopoDS::Edge(mySShape); TopoDS_Edge E2 = TopoDS::Edge(mySShape);
@ -206,7 +204,7 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati
Handle(Geom_Curve) geom1,geom2; Handle(Geom_Curve) geom1,geom2;
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
if (!AIS::ComputeGeometry(E1,E2,myExtShape, if (!PrsDim::ComputeGeometry(E1,E2,myExtShape,
geom1,geom2, geom1,geom2,
ptat11,ptat12,ptat21,ptat22, ptat11,ptat12,ptat21,ptat22,
extCurv, extCurv,

View File

@ -14,54 +14,54 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_ParallelRelation_HeaderFile #ifndef _PrsDim_ParallelRelation_HeaderFile
#define _AIS_ParallelRelation_HeaderFile #define _PrsDim_ParallelRelation_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
#include <DsgPrs_ArrowSide.hxx> #include <DsgPrs_ArrowSide.hxx>
DEFINE_STANDARD_HANDLE(AIS_ParallelRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_ParallelRelation, PrsDim_Relation)
//! A framework to display constraints of parallelism //! A framework to display constraints of parallelism
//! between two or more Interactive Objects. These //! between two or more Interactive Objects. These
//! entities can be faces or edges. //! entities can be faces or edges.
class AIS_ParallelRelation : public AIS_Relation class PrsDim_ParallelRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_ParallelRelation, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_ParallelRelation, PrsDim_Relation)
public: public:
//! Constructs an object to display parallel constraints. //! Constructs an object to display parallel constraints.
//! This object is defined by the first shape aFShape and //! This object is defined by the first shape aFShape and
//! the second shape aSShape and the plane aPlane. //! the second shape aSShape and the plane aPlane.
Standard_EXPORT AIS_ParallelRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane); Standard_EXPORT PrsDim_ParallelRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane);
//! Constructs an object to display parallel constraints. //! Constructs an object to display parallel constraints.
//! This object is defined by the first shape aFShape and //! This object is defined by the first shape aFShape and
//! the second shape aSShape the plane aPlane, the //! the second shape aSShape the plane aPlane, the
//! position aPosition, the type of arrow, aSymbolPrs and //! position aPosition, the type of arrow, aSymbolPrs and
//! its size anArrowSize. //! its size anArrowSize.
Standard_EXPORT AIS_ParallelRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.01); Standard_EXPORT PrsDim_ParallelRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.01);
//! Returns true if the parallelism is movable. //! Returns true if the parallelism is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
private: private:
Standard_EXPORT 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoFacesParallel (const Handle(Prs3d_Presentation)& aPresentation); Standard_EXPORT void ComputeTwoFacesParallel (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeTwoEdgesParallel (const Handle(Prs3d_Presentation)& aPresentation); Standard_EXPORT void ComputeTwoEdgesParallel (const Handle(Prs3d_Presentation)& aPresentation);
private:
gp_Pnt myFAttach; gp_Pnt myFAttach;
gp_Pnt mySAttach; gp_Pnt mySAttach;
gp_Dir myDirAttach; gp_Dir myDirAttach;
}; };
#include <AIS_ParallelRelation.lxx> #endif // _PrsDim_ParallelRelation_HeaderFile
#endif // _AIS_ParallelRelation_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_PerpendicularRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_PerpendicularRelation.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
#include <BRepBuilderAPI_MakeFace.hxx> #include <BRepBuilderAPI_MakeFace.hxx>
@ -27,7 +27,6 @@
#include <Geom_Ellipse.hxx> #include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAPI.hxx> #include <GeomAPI.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
@ -42,23 +41,22 @@
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Edge.hxx> #include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_PerpendicularRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_PerpendicularRelation, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : Constructor //function : Constructor
//purpose : TwoEdgesPerpendicular //purpose : TwoEdgesPerpendicular
//======================================================================= //=======================================================================
AIS_PerpendicularRelation::AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, PrsDim_PerpendicularRelation::PrsDim_PerpendicularRelation(const TopoDS_Shape& aFShape,
const TopoDS_Shape& aSShape, const TopoDS_Shape& aSShape,
const Handle(Geom_Plane)& aPlane) const Handle(Geom_Plane)& aPlane)
:AIS_Relation() :PrsDim_Relation()
{ {
myFShape = aFShape; myFShape = aFShape;
mySShape = aSShape; mySShape = aSShape;
@ -69,9 +67,9 @@ AIS_PerpendicularRelation::AIS_PerpendicularRelation(const TopoDS_Shape& aFShape
//function : Constructor //function : Constructor
//purpose : TwoFacesPerpendicular //purpose : TwoFacesPerpendicular
//======================================================================= //=======================================================================
AIS_PerpendicularRelation::AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, PrsDim_PerpendicularRelation::PrsDim_PerpendicularRelation(const TopoDS_Shape& aFShape,
const TopoDS_Shape& aSShape) const TopoDS_Shape& aSShape)
:AIS_Relation() :PrsDim_Relation()
{ {
myFShape = aFShape; myFShape = aFShape;
mySShape = aSShape; mySShape = aSShape;
@ -81,7 +79,7 @@ AIS_PerpendicularRelation::AIS_PerpendicularRelation(const TopoDS_Shape& aFShape
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer) const Standard_Integer)
{ {
@ -110,7 +108,7 @@ void AIS_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager3
//function : ComputeSelection //function : ComputeSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_PerpendicularRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_PerpendicularRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer) const Standard_Integer)
{ {
Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7);
@ -157,7 +155,7 @@ void AIS_PerpendicularRelation::ComputeSelection(const Handle(SelectMgr_Selectio
//function : ComputeTwoFacesPerpendicular //function : ComputeTwoFacesPerpendicular
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_PerpendicularRelation::ComputeTwoFacesPerpendicular void PrsDim_PerpendicularRelation::ComputeTwoFacesPerpendicular
(const Handle(Prs3d_Presentation)& /*aPresentation*/) (const Handle(Prs3d_Presentation)& /*aPresentation*/)
{ {
} }
@ -166,14 +164,14 @@ void AIS_PerpendicularRelation::ComputeTwoFacesPerpendicular
//function : ComputeTwoEdgesPerpendicular //function : ComputeTwoEdgesPerpendicular
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_Presentation)& aPresentation)
{ {
// 3d lines // 3d lines
Handle(Geom_Curve) geom1,geom2; Handle(Geom_Curve) geom1,geom2;
gp_Pnt pint3d,p1,p2,pAx1,pAx2,ptat11,ptat12,ptat21,ptat22; gp_Pnt pint3d,p1,p2,pAx1,pAx2,ptat11,ptat12,ptat21,ptat22;
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
if ( !AIS::ComputeGeometry(TopoDS::Edge(myFShape),TopoDS::Edge(mySShape), if ( !PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),TopoDS::Edge(mySShape),
myExtShape, myExtShape,
geom1,geom2, geom1,geom2,
ptat11,ptat12,ptat21,ptat22, ptat11,ptat12,ptat21,ptat22,

View File

@ -14,19 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_PerpendicularRelation_HeaderFile #ifndef _PrsDim_PerpendicularRelation_HeaderFile
#define _AIS_PerpendicularRelation_HeaderFile #define _PrsDim_PerpendicularRelation_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
DEFINE_STANDARD_HANDLE(AIS_PerpendicularRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_PerpendicularRelation, PrsDim_Relation)
//! A framework to display constraints of perpendicularity //! A framework to display constraints of perpendicularity
//! between two or more interactive datums. These //! between two or more interactive datums. These
//! datums can be edges or faces. //! datums can be edges or faces.
class AIS_PerpendicularRelation : public AIS_Relation class PrsDim_PerpendicularRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_PerpendicularRelation, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_PerpendicularRelation, PrsDim_Relation)
public: public:
//! Constructs an object to display constraints of //! Constructs an object to display constraints of
@ -36,28 +36,29 @@ public:
//! aPlane is the plane of reference to show and test the //! aPlane is the plane of reference to show and test the
//! perpendicular relation between two shapes, at least //! perpendicular relation between two shapes, at least
//! one of which has a revolved surface. //! one of which has a revolved surface.
Standard_EXPORT AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane); Standard_EXPORT PrsDim_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane);
//! Constructs an object to display constraints of //! Constructs an object to display constraints of
//! perpendicularity on shapes. //! perpendicularity on shapes.
//! This object is defined by a first shape aFShape and a //! This object is defined by a first shape aFShape and a
//! second shape aSShape. //! second shape aSShape.
Standard_EXPORT AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape); Standard_EXPORT PrsDim_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape);
private: 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) 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); Standard_EXPORT void ComputeTwoFacesPerpendicular (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeTwoEdgesPerpendicular (const Handle(Prs3d_Presentation)& aPresentation); Standard_EXPORT void ComputeTwoEdgesPerpendicular (const Handle(Prs3d_Presentation)& aPresentation);
private:
gp_Pnt myFAttach; gp_Pnt myFAttach;
gp_Pnt mySAttach; gp_Pnt mySAttach;
}; };
#endif // _AIS_PerpendicularRelation_HeaderFile #endif // _PrsDim_PerpendicularRelation_HeaderFile

View File

@ -14,15 +14,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <AIS_RadiusDimension.hxx> #include <PrsDim_RadiusDimension.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <BRepLib_MakeEdge.hxx> #include <BRepLib_MakeEdge.hxx>
#include <ElCLib.hxx> #include <ElCLib.hxx>
#include <gce_MakeDir.hxx> #include <gce_MakeDir.hxx>
IMPLEMENT_STANDARD_RTTIEXT(PrsDim_RadiusDimension, PrsDim_Dimension)
IMPLEMENT_STANDARD_RTTIEXT(AIS_RadiusDimension,AIS_Dimension)
namespace namespace
{ {
@ -33,12 +32,12 @@ namespace
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle) PrsDim_RadiusDimension::PrsDim_RadiusDimension (const gp_Circ& theCircle)
: AIS_Dimension (AIS_KOD_RADIUS) : PrsDim_Dimension (PrsDim_KOD_RADIUS)
{ {
SetMeasuredGeometry (theCircle); SetMeasuredGeometry (theCircle);
SetSpecialSymbol (THE_RADIUS_SYMBOL); SetSpecialSymbol (THE_RADIUS_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_Before); SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before);
SetFlyout (0.0); SetFlyout (0.0);
} }
@ -46,13 +45,13 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle)
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle, PrsDim_RadiusDimension::PrsDim_RadiusDimension (const gp_Circ& theCircle,
const gp_Pnt& theAttachPoint) const gp_Pnt& theAttachPoint)
: AIS_Dimension (AIS_KOD_RADIUS) : PrsDim_Dimension (PrsDim_KOD_RADIUS)
{ {
SetMeasuredGeometry (theCircle, theAttachPoint); SetMeasuredGeometry (theCircle, theAttachPoint);
SetSpecialSymbol (THE_RADIUS_SYMBOL); SetSpecialSymbol (THE_RADIUS_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_Before); SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before);
SetFlyout (0.0); SetFlyout (0.0);
} }
@ -60,12 +59,12 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle,
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_RadiusDimension::AIS_RadiusDimension (const TopoDS_Shape& theShape) PrsDim_RadiusDimension::PrsDim_RadiusDimension (const TopoDS_Shape& theShape)
: AIS_Dimension (AIS_KOD_RADIUS) : PrsDim_Dimension (PrsDim_KOD_RADIUS)
{ {
SetMeasuredGeometry (theShape); SetMeasuredGeometry (theShape);
SetSpecialSymbol (THE_RADIUS_SYMBOL); SetSpecialSymbol (THE_RADIUS_SYMBOL);
SetDisplaySpecialSymbol (AIS_DSS_Before); SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before);
SetFlyout (0.0); SetFlyout (0.0);
} }
@ -73,7 +72,7 @@ AIS_RadiusDimension::AIS_RadiusDimension (const TopoDS_Shape& theShape)
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle, void PrsDim_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle,
const gp_Pnt& theAnchorPoint, const gp_Pnt& theAnchorPoint,
const Standard_Boolean theHasAnchor) const Standard_Boolean theHasAnchor)
{ {
@ -95,7 +94,7 @@ void AIS_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle,
//function : SetMeasuredGeometry //function : SetMeasuredGeometry
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_RadiusDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape, void PrsDim_RadiusDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape,
const gp_Pnt& theAnchorPoint, const gp_Pnt& theAnchorPoint,
const Standard_Boolean theHasAnchor) const Standard_Boolean theHasAnchor)
{ {
@ -122,7 +121,7 @@ void AIS_RadiusDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape,
//function : CheckPlane //function : CheckPlane
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_RadiusDimension::CheckPlane (const gp_Pln& thePlane) const Standard_Boolean PrsDim_RadiusDimension::CheckPlane (const gp_Pln& thePlane) const
{ {
// Check if anchor point and circle center point belong to plane. // Check if anchor point and circle center point belong to plane.
if (!thePlane.Contains (myAnchorPoint, Precision::Confusion()) && if (!thePlane.Contains (myAnchorPoint, Precision::Confusion()) &&
@ -138,7 +137,7 @@ Standard_Boolean AIS_RadiusDimension::CheckPlane (const gp_Pln& thePlane) const
//function : ComputePlane //function : ComputePlane
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_RadiusDimension::ComputePlane() void PrsDim_RadiusDimension::ComputePlane()
{ {
if (!myIsGeometryValid) if (!myIsGeometryValid)
{ {
@ -156,7 +155,7 @@ void AIS_RadiusDimension::ComputePlane()
//function : GetModelUnits //function : GetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_RadiusDimension::GetModelUnits() const const TCollection_AsciiString& PrsDim_RadiusDimension::GetModelUnits() const
{ {
return myDrawer->DimLengthModelUnits(); return myDrawer->DimLengthModelUnits();
} }
@ -165,7 +164,7 @@ const TCollection_AsciiString& AIS_RadiusDimension::GetModelUnits() const
//function : GetDisplayUnits //function : GetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
const TCollection_AsciiString& AIS_RadiusDimension::GetDisplayUnits() const const TCollection_AsciiString& PrsDim_RadiusDimension::GetDisplayUnits() const
{ {
return myDrawer->DimLengthDisplayUnits(); return myDrawer->DimLengthDisplayUnits();
} }
@ -174,7 +173,7 @@ const TCollection_AsciiString& AIS_RadiusDimension::GetDisplayUnits() const
//function : SetModelUnits //function : SetModelUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_RadiusDimension::SetModelUnits (const TCollection_AsciiString& theUnits) void PrsDim_RadiusDimension::SetModelUnits (const TCollection_AsciiString& theUnits)
{ {
myDrawer->SetDimLengthModelUnits (theUnits); myDrawer->SetDimLengthModelUnits (theUnits);
} }
@ -183,7 +182,7 @@ void AIS_RadiusDimension::SetModelUnits (const TCollection_AsciiString& theUnits
//function : SetDisplayUnits //function : SetDisplayUnits
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_RadiusDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) void PrsDim_RadiusDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits)
{ {
myDrawer->SetDimLengthDisplayUnits(theUnits); myDrawer->SetDimLengthDisplayUnits(theUnits);
} }
@ -192,7 +191,7 @@ void AIS_RadiusDimension::SetDisplayUnits (const TCollection_AsciiString& theUni
//function : ComputeValue //function : ComputeValue
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Real AIS_RadiusDimension::ComputeValue() const Standard_Real PrsDim_RadiusDimension::ComputeValue() const
{ {
if (!IsValid()) if (!IsValid())
{ {
@ -206,7 +205,7 @@ Standard_Real AIS_RadiusDimension::ComputeValue() const
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_RadiusDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, void PrsDim_RadiusDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/,
const Handle(Prs3d_Presentation)& thePresentation, const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode) const Standard_Integer theMode)
{ {
@ -224,7 +223,7 @@ void AIS_RadiusDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /
//function : IsValidCircle //function : IsValidCircle
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_RadiusDimension::IsValidCircle (const gp_Circ& theCircle) const Standard_Boolean PrsDim_RadiusDimension::IsValidCircle (const gp_Circ& theCircle) const
{ {
return theCircle.Radius() > Precision::Confusion(); return theCircle.Radius() > Precision::Confusion();
} }
@ -233,7 +232,7 @@ Standard_Boolean AIS_RadiusDimension::IsValidCircle (const gp_Circ& theCircle) c
//function : IsValidAnchor //function : IsValidAnchor
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean AIS_RadiusDimension::IsValidAnchor (const gp_Circ& theCircle, Standard_Boolean PrsDim_RadiusDimension::IsValidAnchor (const gp_Circ& theCircle,
const gp_Pnt& theAnchor) const const gp_Pnt& theAnchor) const
{ {
gp_Pln aCirclePlane (theCircle.Location(), theCircle.Axis().Direction()); gp_Pln aCirclePlane (theCircle.Location(), theCircle.Axis().Direction());
@ -247,7 +246,7 @@ Standard_Boolean AIS_RadiusDimension::IsValidAnchor (const gp_Circ& theCircle,
//function : GetTextPosition //function : GetTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
const gp_Pnt AIS_RadiusDimension::GetTextPosition() const gp_Pnt PrsDim_RadiusDimension::GetTextPosition() const
{ {
if (IsTextPositionCustom()) if (IsTextPositionCustom())
{ {
@ -262,7 +261,7 @@ const gp_Pnt AIS_RadiusDimension::GetTextPosition() const
//function : GetTextPosition //function : GetTextPosition
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_RadiusDimension::SetTextPosition (const gp_Pnt& theTextPos) void PrsDim_RadiusDimension::SetTextPosition (const gp_Pnt& theTextPos)
{ {
if (!myIsGeometryValid) if (!myIsGeometryValid)
{ {

View File

@ -12,18 +12,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_RadiusDimension_HeaderFile #ifndef _PrsDim_RadiusDimension_HeaderFile
#define _AIS_RadiusDimension_HeaderFile #define _PrsDim_RadiusDimension_HeaderFile
#include <AIS.hxx> #include <PrsDim_Dimension.hxx>
#include <AIS_Dimension.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
#include <Standard.hxx> #include <Standard.hxx>
#include <Standard_Macro.hxx> #include <Standard_Macro.hxx>
class AIS_RadiusDimension; DEFINE_STANDARD_HANDLE(PrsDim_RadiusDimension, PrsDim_Dimension)
DEFINE_STANDARD_HANDLE (AIS_RadiusDimension,AIS_Dimension)
//! Radius dimension. Can be constructued: //! Radius dimension. Can be constructued:
//! - On generic circle. //! - On generic circle.
@ -39,45 +37,37 @@ DEFINE_STANDARD_HANDLE (AIS_RadiusDimension,AIS_Dimension)
//! In case if the dimension is built on the arbitrary shape, //! In case if the dimension is built on the arbitrary shape,
//! it can be considered as invalid if the shape does not contain //! it can be considered as invalid if the shape does not contain
//! circle geometry. //! circle geometry.
class AIS_RadiusDimension : public AIS_Dimension class PrsDim_RadiusDimension : public PrsDim_Dimension
{ {
DEFINE_STANDARD_RTTIEXT(PrsDim_RadiusDimension, PrsDim_Dimension)
public: public:
//! Create radius dimension for the circle geometry. //! Create radius dimension for the circle geometry.
//! @param theCircle [in] the circle to measure. //! @param theCircle [in] the circle to measure.
Standard_EXPORT AIS_RadiusDimension (const gp_Circ& theCircle); Standard_EXPORT PrsDim_RadiusDimension (const gp_Circ& theCircle);
//! Create radius dimension for the circle geometry and define its //! Create radius dimension for the circle geometry and define its
//! orientation by location of the first point on that circle. //! orientation by location of the first point on that circle.
//! @param theCircle [in] the circle to measure. //! @param theCircle [in] the circle to measure.
//! @param theAnchorPoint [in] the point to define the position //! @param theAnchorPoint [in] the point to define the position
//! of the dimension attachment on the circle. //! of the dimension attachment on the circle.
Standard_EXPORT AIS_RadiusDimension (const gp_Circ& theCircle, Standard_EXPORT PrsDim_RadiusDimension (const gp_Circ& theCircle,
const gp_Pnt& theAnchorPoint); const gp_Pnt& theAnchorPoint);
//! Create radius dimension for the arbitrary shape (if possible). //! Create radius dimension for the arbitrary shape (if possible).
//! @param theShape [in] the shape to measure. //! @param theShape [in] the shape to measure.
Standard_EXPORT AIS_RadiusDimension (const TopoDS_Shape& theShape); Standard_EXPORT PrsDim_RadiusDimension (const TopoDS_Shape& theShape);
public: public:
//! @return measured geometry circle. //! @return measured geometry circle.
const gp_Circ& Circle() const const gp_Circ& Circle() const { return myCircle; }
{
return myCircle;
}
//! @return anchor point on circle for radius dimension. //! @return anchor point on circle for radius dimension.
const gp_Pnt& AnchorPoint() const const gp_Pnt& AnchorPoint() const { return myAnchorPoint; }
{
return myAnchorPoint;
}
//! @return the measured shape. //! @return the measured shape.
const TopoDS_Shape& Shape() const const TopoDS_Shape& Shape() const { return myShape; }
{
return myShape;
}
public: public:
@ -126,11 +116,7 @@ public:
Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE; Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE;
Standard_EXPORT virtual const gp_Pnt GetTextPosition() const Standard_OVERRIDE; Standard_EXPORT virtual gp_Pnt GetTextPosition() const Standard_OVERRIDE;
public:
DEFINE_STANDARD_RTTIEXT(AIS_RadiusDimension,AIS_Dimension)
protected: protected:
@ -159,4 +145,4 @@ private:
TopoDS_Shape myShape; TopoDS_Shape myShape;
}; };
#endif // _AIS_RadiusDimension_HeaderFile #endif // _PrsDim_RadiusDimension_HeaderFile

View File

@ -14,10 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_Relation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_GraphicTool.hxx> #include <AIS_GraphicTool.hxx>
#include <AIS_Relation.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx> #include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx> #include <BRepBuilderAPI_MakeVertex.hxx>
@ -41,7 +41,6 @@
#include <Prs3d_Presentation.hxx> #include <Prs3d_Presentation.hxx>
#include <Prs3d_TextAspect.hxx> #include <Prs3d_TextAspect.hxx>
#include <Quantity_Color.hxx> #include <Quantity_Color.hxx>
#include <Standard_Type.hxx>
#include <StdPrs_Point.hxx> #include <StdPrs_Point.hxx>
#include <StdPrs_WFShape.hxx> #include <StdPrs_WFShape.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
@ -51,13 +50,13 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_Relation,AIS_InteractiveObject) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Relation, AIS_InteractiveObject)
//======================================================================= //=======================================================================
//function : AIS_Relation //function : PrsDim_Relation
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_Relation::AIS_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d) PrsDim_Relation::PrsDim_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d)
:AIS_InteractiveObject(aTypeOfPresentation3d), :AIS_InteractiveObject(aTypeOfPresentation3d),
myVal(1.), myVal(1.),
myPosition(0.,0.,0.), myPosition(0.,0.,0.),
@ -70,14 +69,12 @@ AIS_Relation::AIS_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation
{ {
} }
//======================================================================= //=======================================================================
//function : ComputeProjEdgePresentation //function : ComputeProjEdgePresentation
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)& aPrs, void PrsDim_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)& aPrs,
const TopoDS_Edge& anEdge, const TopoDS_Edge& anEdge,
const Handle(Geom_Curve)& ProjCurv, const Handle(Geom_Curve)& ProjCurv,
const gp_Pnt& FirstP, const gp_Pnt& FirstP,
@ -169,7 +166,7 @@ void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)&
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation)& aPrs, void PrsDim_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation)& aPrs,
const TopoDS_Vertex& aVertex, const TopoDS_Vertex& aVertex,
const gp_Pnt& ProjPoint, const gp_Pnt& ProjPoint,
const Quantity_NameOfColor aColor, const Quantity_NameOfColor aColor,
@ -218,7 +215,7 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
//function : SetColor //function : SetColor
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Relation::SetColor(const Quantity_Color &aCol) void PrsDim_Relation::SetColor(const Quantity_Color &aCol)
{ {
if(hasOwnColor && myDrawer->Color() == aCol) return; if(hasOwnColor && myDrawer->Color() == aCol) return;
@ -249,7 +246,7 @@ void AIS_Relation::SetColor(const Quantity_Color &aCol)
//function : UnsetColor //function : UnsetColor
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_Relation::UnsetColor() void PrsDim_Relation::UnsetColor()
{ {
if (!hasOwnColor) return; if (!hasOwnColor) return;
hasOwnColor = Standard_False; hasOwnColor = Standard_False;
@ -263,50 +260,3 @@ void AIS_Relation::UnsetColor()
LA->SetColor(CC); LA->SetColor(CC);
myDrawer->DimensionAspect()->SetLineAspect(LA); myDrawer->DimensionAspect()->SetLineAspect(LA);
} }
//=======================================================================
//function : AcceptDisplayMode
//purpose :
//=======================================================================
Standard_Boolean AIS_Relation::
AcceptDisplayMode(const Standard_Integer aMode) const
{return aMode == 0;}
//=======================================================================
//function : SetFirstShape
//purpose :
//=======================================================================
void AIS_Relation::SetFirstShape(const TopoDS_Shape& aFShape)
{
myFShape = aFShape;
}
//=======================================================================
//function : SetSecondShape
//purpose :
//=======================================================================
void AIS_Relation::SetSecondShape(const TopoDS_Shape& aSShape)
{
mySShape = aSShape;
}
//=======================================================================
//function : KindOfDimension
//purpose :
//=======================================================================
AIS_KindOfDimension AIS_Relation::KindOfDimension() const
{return AIS_KOD_NONE;}
//=======================================================================
//function : IsMovable
//purpose :
//=======================================================================
Standard_Boolean AIS_Relation::IsMovable() const
{return Standard_False;}

View File

@ -14,12 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_Relation_HeaderFile #ifndef _PrsDim_Relation_HeaderFile
#define _AIS_Relation_HeaderFile #define _PrsDim_Relation_HeaderFile
#include <AIS_KindOfDimension.hxx>
#include <AIS_KindOfInteractive.hxx> #include <AIS_KindOfInteractive.hxx>
#include <AIS_KindOfSurface.hxx>
#include <AIS_InteractiveObject.hxx> #include <AIS_InteractiveObject.hxx>
#include <Aspect_TypeOfLine.hxx> #include <Aspect_TypeOfLine.hxx>
#include <Aspect_TypeOfMarker.hxx> #include <Aspect_TypeOfMarker.hxx>
@ -27,6 +25,8 @@
#include <DsgPrs_ArrowSide.hxx> #include <DsgPrs_ArrowSide.hxx>
#include <gp_Pln.hxx> #include <gp_Pln.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <PrsDim_KindOfDimension.hxx>
#include <PrsDim_KindOfSurface.hxx>
#include <TCollection_ExtendedString.hxx> #include <TCollection_ExtendedString.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
@ -45,9 +45,9 @@ class TopoDS_Vertex;
//! - 1 - there is a connection to the first shape; //! - 1 - there is a connection to the first shape;
//! - 2 - there is a connection to the second shape. //! - 2 - there is a connection to the second shape.
//! The connection takes the form of an edge between the two shapes. //! The connection takes the form of an edge between the two shapes.
class AIS_Relation : public AIS_InteractiveObject class PrsDim_Relation : public AIS_InteractiveObject
{ {
DEFINE_STANDARD_RTTIEXT(AIS_Relation, AIS_InteractiveObject) DEFINE_STANDARD_RTTIEXT(PrsDim_Relation, AIS_InteractiveObject)
public: public:
//! Allows you to provide settings for the color theColor //! Allows you to provide settings for the color theColor
@ -61,21 +61,21 @@ public:
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Relation; } virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Relation; }
//! Indicates that the type of dimension is unknown. //! Indicates that the type of dimension is unknown.
Standard_EXPORT virtual AIS_KindOfDimension KindOfDimension() const; virtual PrsDim_KindOfDimension KindOfDimension() const { return PrsDim_KOD_NONE; }
//! Returns true if the interactive object is movable. //! Returns true if the interactive object is movable.
Standard_EXPORT virtual Standard_Boolean IsMovable() const; virtual Standard_Boolean IsMovable() const { return Standard_False; }
const TopoDS_Shape& FirstShape() const { return myFShape; } const TopoDS_Shape& FirstShape() const { return myFShape; }
Standard_EXPORT virtual void SetFirstShape (const TopoDS_Shape& aFShape); virtual void SetFirstShape (const TopoDS_Shape& aFShape) { myFShape = aFShape; }
//! Returns the second shape. //! Returns the second shape.
const TopoDS_Shape& SecondShape() const { return mySShape; } const TopoDS_Shape& SecondShape() const { return mySShape; }
//! Allows you to identify the second shape aSShape //! Allows you to identify the second shape aSShape
//! relative to the first. //! relative to the first.
Standard_EXPORT virtual void SetSecondShape (const TopoDS_Shape& aSShape); virtual void SetSecondShape (const TopoDS_Shape& aSShape) { mySShape = aSShape; }
void SetBndBox (const Standard_Real theXmin, const Standard_Real theYmin, const Standard_Real theZmin, void SetBndBox (const Standard_Real theXmin, const Standard_Real theYmin, const Standard_Real theZmin,
const Standard_Real theXmax, const Standard_Real theYmax, const Standard_Real theZmax) const Standard_Real theXmax, const Standard_Real theYmax, const Standard_Real theZmax)
@ -168,7 +168,7 @@ public:
//! aWidth : Real from Standard = 2; //! aWidth : Real from Standard = 2;
//! aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH; //! aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
//! aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT) //! aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
Standard_EXPORT virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE; virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
void SetAutomaticPosition (const Standard_Boolean theStatus) { myAutomaticPosition = theStatus; } void SetAutomaticPosition (const Standard_Boolean theStatus) { myAutomaticPosition = theStatus; }
@ -176,7 +176,7 @@ public:
protected: protected:
Standard_EXPORT AIS_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView); Standard_EXPORT PrsDim_Relation (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
//! Calculates the presentation aPres of the the edge //! Calculates the presentation aPres of the the edge
//! anEdge and the curve it defines, ProjCurve. The later //! anEdge and the curve it defines, ProjCurve. The later
@ -207,8 +207,8 @@ protected:
gp_Pln mySecondPlane; gp_Pln mySecondPlane;
Handle(Geom_Surface) myFirstBasisSurf; Handle(Geom_Surface) myFirstBasisSurf;
Handle(Geom_Surface) mySecondBasisSurf; Handle(Geom_Surface) mySecondBasisSurf;
AIS_KindOfSurface myFirstSurfType; PrsDim_KindOfSurface myFirstSurfType;
AIS_KindOfSurface mySecondSurfType; PrsDim_KindOfSurface mySecondSurfType;
Standard_Real myFirstOffset; Standard_Real myFirstOffset;
Standard_Real mySecondOffset; Standard_Real mySecondOffset;
Bnd_Box myBndBox; Bnd_Box myBndBox;
@ -217,6 +217,6 @@ protected:
}; };
DEFINE_STANDARD_HANDLE(AIS_Relation, AIS_InteractiveObject) DEFINE_STANDARD_HANDLE(PrsDim_Relation, AIS_InteractiveObject)
#endif // _AIS_Relation_HeaderFile #endif // _AIS_Relation_HeaderFile

View File

@ -14,9 +14,9 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_SymmetricRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_SymmetricRelation.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
@ -26,7 +26,6 @@
#include <Geom_Circle.hxx> #include <Geom_Circle.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <gp_Ax1.hxx> #include <gp_Ax1.hxx>
#include <gp_Ax2.hxx> #include <gp_Ax2.hxx>
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
@ -44,21 +43,20 @@
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_SymmetricRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_SymmetricRelation, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : AIS_SymmetricRelation //function : PrsDim_SymmetricRelation
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_SymmetricRelation::AIS_SymmetricRelation(const TopoDS_Shape& aSymmTool, PrsDim_SymmetricRelation::PrsDim_SymmetricRelation(const TopoDS_Shape& aSymmTool,
const TopoDS_Shape& FirstShape, const TopoDS_Shape& FirstShape,
const TopoDS_Shape& SecondShape, const TopoDS_Shape& SecondShape,
const Handle(Geom_Plane)& aPlane) const Handle(Geom_Plane)& aPlane)
:AIS_Relation(), :PrsDim_Relation(),
myTool(aSymmTool) myTool(aSymmTool)
{ {
SetFirstShape(FirstShape); SetFirstShape(FirstShape);
@ -71,7 +69,7 @@ AIS_SymmetricRelation::AIS_SymmetricRelation(const TopoDS_Shape& aSymmTool,
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aprs, const Handle(Prs3d_Presentation)& aprs,
const Standard_Integer) const Standard_Integer)
{ {
@ -101,7 +99,7 @@ void AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
Handle(Geom_Curve) aCurve,extcurve; Handle(Geom_Curve) aCurve,extcurve;
gp_Pnt p1,p2; gp_Pnt p1,p2;
Standard_Boolean isinfinite,isonplane; Standard_Boolean isinfinite,isonplane;
if (AIS::ComputeGeometry(TopoDS::Edge(myTool), if (PrsDim::ComputeGeometry(TopoDS::Edge(myTool),
aCurve,p1,p2, aCurve,p1,p2,
extcurve, extcurve,
isinfinite, isinfinite,
@ -124,7 +122,7 @@ void AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
//function : ComputeSelection //function : ComputeSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSel, void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSel,
const Standard_Integer) const Standard_Integer)
{ {
Handle(Select3D_SensitiveSegment) seg; Handle(Select3D_SensitiveSegment) seg;
@ -134,7 +132,7 @@ void AIS_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)&
Handle(Geom_Curve) geom_axis, extcurve; Handle(Geom_Curve) geom_axis, extcurve;
gp_Pnt p1,p2; gp_Pnt p1,p2;
Standard_Boolean isinfinite,isonplane; Standard_Boolean isinfinite,isonplane;
if (!AIS::ComputeGeometry(TopoDS::Edge(myTool), if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool),
geom_axis,p1,p2, geom_axis,p1,p2,
extcurve, extcurve,
isinfinite, isinfinite,
@ -346,7 +344,7 @@ void AIS_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)&
//function : ComputeTwoFacesSymmetric //function : ComputeTwoFacesSymmetric
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_SymmetricRelation::ComputeTwoFacesSymmetric(const Handle(Prs3d_Presentation)&) void PrsDim_SymmetricRelation::ComputeTwoFacesSymmetric(const Handle(Prs3d_Presentation)&)
{ {
} }
@ -354,7 +352,7 @@ void AIS_SymmetricRelation::ComputeTwoFacesSymmetric(const Handle(Prs3d_Presenta
//function : ComputeTwoEdgesSymmetric //function : ComputeTwoEdgesSymmetric
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presentation)& aprs) void PrsDim_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presentation)& aprs)
{ {
BRepAdaptor_Curve cu1(TopoDS::Edge(myFShape)); BRepAdaptor_Curve cu1(TopoDS::Edge(myFShape));
if (cu1.GetType() != GeomAbs_Line && cu1.GetType() != GeomAbs_Circle) return; if (cu1.GetType() != GeomAbs_Line && cu1.GetType() != GeomAbs_Circle) return;
@ -365,7 +363,7 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
Handle(Geom_Curve) geom1,geom2; Handle(Geom_Curve) geom1,geom2;
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape), if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),
TopoDS::Edge(mySShape), TopoDS::Edge(mySShape),
myExtShape, myExtShape,
geom1, geom1,
@ -383,7 +381,7 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
Handle(Geom_Curve) geom_axis,extcurve; Handle(Geom_Curve) geom_axis,extcurve;
gp_Pnt p1,p2; gp_Pnt p1,p2;
Standard_Boolean isinfinite,isonplane; Standard_Boolean isinfinite,isonplane;
if (!AIS::ComputeGeometry(TopoDS::Edge(myTool), if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool),
geom_axis,p1,p2, geom_axis,p1,p2,
extcurve, extcurve,
isinfinite, isinfinite,
@ -554,13 +552,13 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta
//function : ComputeTwoVertexsSymmetric //function : ComputeTwoVertexsSymmetric
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_SymmetricRelation::ComputeTwoVerticesSymmetric(const Handle(Prs3d_Presentation)& aprs) void PrsDim_SymmetricRelation::ComputeTwoVerticesSymmetric(const Handle(Prs3d_Presentation)& aprs)
{ {
if(myFShape.ShapeType() != TopAbs_VERTEX || mySShape.ShapeType() != TopAbs_VERTEX) return; if(myFShape.ShapeType() != TopAbs_VERTEX || mySShape.ShapeType() != TopAbs_VERTEX) return;
Handle(Geom_Curve) geom_axis,extcurve; Handle(Geom_Curve) geom_axis,extcurve;
gp_Pnt p1,p2; gp_Pnt p1,p2;
Standard_Boolean isinfinite,isonplane; Standard_Boolean isinfinite,isonplane;
if (!AIS::ComputeGeometry(TopoDS::Edge(myTool), if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool),
geom_axis,p1,p2, geom_axis,p1,p2,
extcurve, extcurve,
isinfinite, isinfinite,
@ -569,8 +567,8 @@ void AIS_SymmetricRelation::ComputeTwoVerticesSymmetric(const Handle(Prs3d_Prese
Standard_Boolean isOnPlane1, isOnPlane2; Standard_Boolean isOnPlane1, isOnPlane2;
AIS::ComputeGeometry(TopoDS::Vertex(myFShape), myFAttach, myPlane, isOnPlane1); PrsDim::ComputeGeometry(TopoDS::Vertex(myFShape), myFAttach, myPlane, isOnPlane1);
AIS::ComputeGeometry(TopoDS::Vertex(mySShape), mySAttach, myPlane, isOnPlane2); PrsDim::ComputeGeometry(TopoDS::Vertex(mySShape), mySAttach, myPlane, isOnPlane2);
if( !myArrowSizeIsDefined ) if( !myArrowSizeIsDefined )
myArrowSize = myFAttach.Distance(mySAttach)/50.; myArrowSize = myFAttach.Distance(mySAttach)/50.;

View File

@ -14,23 +14,23 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_SymmetricRelation_HeaderFile #ifndef _PrsDim_SymmetricRelation_HeaderFile
#define _AIS_SymmetricRelation_HeaderFile #define _PrsDim_SymmetricRelation_HeaderFile
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <gp_Pnt.hxx> #include <gp_Pnt.hxx>
#include <gp_Dir.hxx> #include <gp_Dir.hxx>
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
DEFINE_STANDARD_HANDLE(AIS_SymmetricRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_SymmetricRelation, PrsDim_Relation)
//! A framework to display constraints of symmetricity //! A framework to display constraints of symmetricity
//! between two or more datum Interactive Objects. //! between two or more datum Interactive Objects.
//! A plane serves as the axis of symmetry between the //! A plane serves as the axis of symmetry between the
//! shapes of which the datums are parts. //! shapes of which the datums are parts.
class AIS_SymmetricRelation : public AIS_Relation class PrsDim_SymmetricRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_SymmetricRelation, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_SymmetricRelation, PrsDim_Relation)
public: public:
//! Constructs an object to display constraints of symmetricity. //! Constructs an object to display constraints of symmetricity.
@ -41,25 +41,25 @@ public:
//! SecondShape and aPlane. It may be queried and //! SecondShape and aPlane. It may be queried and
//! edited using the functions GetTool and SetTool. //! edited using the functions GetTool and SetTool.
//! The two shapes are typically two edges, two vertices or two points. //! The two shapes are typically two edges, two vertices or two points.
Standard_EXPORT AIS_SymmetricRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane); Standard_EXPORT PrsDim_SymmetricRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane);
//! Returns true if the symmetric constraint display is movable. //! Returns true if the symmetric constraint display is movable.
virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; }
//! Sets the tool aSymmetricTool composed of a first //! Sets the tool aSymmetricTool composed of a first
//! shape, a second shape, and a plane. //! shape, a second shape, and a plane.
//! This tool is initially created at construction time. //! This tool is initially created at construction time.
void SetTool (const TopoDS_Shape& aSymmetricTool); void SetTool (const TopoDS_Shape& aSymmetricTool) { myTool = aSymmetricTool; }
//! Returns the tool composed of a first shape, a second //! Returns the tool composed of a first shape, a second
//! shape, and a plane. This tool is created at construction time. //! shape, and a plane. This tool is created at construction time.
const TopoDS_Shape& GetTool() const; const TopoDS_Shape& GetTool() const { return myTool; }
private: private:
Standard_EXPORT 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoFacesSymmetric (const Handle(Prs3d_Presentation)& aprs); Standard_EXPORT void ComputeTwoFacesSymmetric (const Handle(Prs3d_Presentation)& aprs);
@ -67,6 +67,8 @@ private:
Standard_EXPORT void ComputeTwoVerticesSymmetric (const Handle(Prs3d_Presentation)& aprs); Standard_EXPORT void ComputeTwoVerticesSymmetric (const Handle(Prs3d_Presentation)& aprs);
private:
TopoDS_Shape myTool; TopoDS_Shape myTool;
gp_Pnt myFAttach; gp_Pnt myFAttach;
gp_Pnt mySAttach; gp_Pnt mySAttach;
@ -75,6 +77,4 @@ private:
}; };
#include <AIS_SymmetricRelation.lxx> #endif // _PrsDim_SymmetricRelation_HeaderFile
#endif // _AIS_SymmetricRelation_HeaderFile

View File

@ -14,10 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <PrsDim_TangentRelation.hxx>
#include <AIS.hxx> #include <PrsDim.hxx>
#include <AIS_Shape.hxx> #include <AIS_Shape.hxx>
#include <AIS_TangentRelation.hxx>
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx> #include <BRepAdaptor_Surface.hxx>
@ -28,7 +28,6 @@
#include <Geom_Ellipse.hxx> #include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx> #include <Geom_Line.hxx>
#include <Geom_Plane.hxx> #include <Geom_Plane.hxx>
#include <Geom_Transformation.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx> #include <GeomAPI_ExtremaCurveCurve.hxx>
#include <gp_Circ.hxx> #include <gp_Circ.hxx>
#include <gp_Lin.hxx> #include <gp_Lin.hxx>
@ -41,7 +40,6 @@
#include <SelectMgr_EntityOwner.hxx> #include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx> #include <SelectMgr_Selection.hxx>
#include <Standard_NotImplemented.hxx> #include <Standard_NotImplemented.hxx>
#include <Standard_Type.hxx>
#include <TColStd_ListIteratorOfListOfTransient.hxx> #include <TColStd_ListIteratorOfListOfTransient.hxx>
#include <TopAbs_ShapeEnum.hxx> #include <TopAbs_ShapeEnum.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
@ -51,13 +49,13 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
IMPLEMENT_STANDARD_RTTIEXT(AIS_TangentRelation,AIS_Relation) IMPLEMENT_STANDARD_RTTIEXT(PrsDim_TangentRelation, PrsDim_Relation)
//======================================================================= //=======================================================================
//function : Constructor //function : Constructor
//purpose : //purpose :
//======================================================================= //=======================================================================
AIS_TangentRelation::AIS_TangentRelation(const TopoDS_Shape& aFShape, PrsDim_TangentRelation::PrsDim_TangentRelation(const TopoDS_Shape& aFShape,
const TopoDS_Shape& aSShape, const TopoDS_Shape& aSShape,
const Handle(Geom_Plane)& aPlane, const Handle(Geom_Plane)& aPlane,
const Standard_Integer anExternRef) const Standard_Integer anExternRef)
@ -69,29 +67,11 @@ AIS_TangentRelation::AIS_TangentRelation(const TopoDS_Shape& aFShape,
myAutomaticPosition = Standard_False; myAutomaticPosition = Standard_False;
} }
//=======================================================================
//function : ExternRef
//purpose :
//=======================================================================
Standard_Integer AIS_TangentRelation::ExternRef()
{
return myExternRef;
}
//=======================================================================
//function : SetExternRef
//purpose :
//=======================================================================
void AIS_TangentRelation::SetExternRef(const Standard_Integer aRef)
{
myExternRef = aRef;
}
//======================================================================= //=======================================================================
//function : Compute //function : Compute
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, void PrsDim_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
const Handle(Prs3d_Presentation)& aPresentation, const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer) const Standard_Integer)
{ {
@ -116,7 +96,7 @@ void AIS_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&,
//function : ComputeSelection //function : ComputeSelection
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_TangentRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, void PrsDim_TangentRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
const Standard_Integer) const Standard_Integer)
{ {
gp_Vec vec(myDir); gp_Vec vec(myDir);
@ -134,7 +114,7 @@ void AIS_TangentRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aS
//function : ComputeTwoFacesTangent //function : ComputeTwoFacesTangent
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_TangentRelation::ComputeTwoFacesTangent void PrsDim_TangentRelation::ComputeTwoFacesTangent
(const Handle(Prs3d_Presentation)& /*aPresentation*/) (const Handle(Prs3d_Presentation)& /*aPresentation*/)
{ {
} }
@ -218,13 +198,13 @@ static Standard_Boolean ComputeTangencyPoint(const Handle(Geom_Curve)& GC1,
//function : ComputeTwoEdgesTangent //function : ComputeTwoEdgesTangent
//purpose : //purpose :
//======================================================================= //=======================================================================
void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation)& aPresentation) void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation)& aPresentation)
{ {
Handle(Geom_Curve) copy1,copy2; Handle(Geom_Curve) copy1,copy2;
gp_Pnt ptat11,ptat12,ptat21,ptat22; gp_Pnt ptat11,ptat12,ptat21,ptat22;
Standard_Boolean isInfinite1,isInfinite2; Standard_Boolean isInfinite1,isInfinite2;
Handle(Geom_Curve) extCurv; Handle(Geom_Curve) extCurv;
if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape), if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),
TopoDS::Edge(mySShape), TopoDS::Edge(mySShape),
myExtShape, myExtShape,
copy1, copy1,

View File

@ -14,19 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_TangentRelation_HeaderFile #ifndef _PrsDim_TangentRelation_HeaderFile
#define _AIS_TangentRelation_HeaderFile #define _PrsDim_TangentRelation_HeaderFile
#include <AIS_Relation.hxx> #include <PrsDim_Relation.hxx>
DEFINE_STANDARD_HANDLE(AIS_TangentRelation, AIS_Relation) DEFINE_STANDARD_HANDLE(PrsDim_TangentRelation, PrsDim_Relation)
//! A framework to display tangency constraints between //! A framework to display tangency constraints between
//! two or more Interactive Objects of the datum type. //! two or more Interactive Objects of the datum type.
//! The datums are normally faces or edges. //! The datums are normally faces or edges.
class AIS_TangentRelation : public AIS_Relation class PrsDim_TangentRelation : public PrsDim_Relation
{ {
DEFINE_STANDARD_RTTIEXT(AIS_TangentRelation, AIS_Relation) DEFINE_STANDARD_RTTIEXT(PrsDim_TangentRelation, PrsDim_Relation)
public: public:
//! TwoFacesTangent or TwoEdgesTangent relation //! TwoFacesTangent or TwoEdgesTangent relation
@ -35,7 +35,7 @@ public:
//! second shape aSShape, the plane aPlane and the index anExternRef. //! second shape aSShape, the plane aPlane and the index anExternRef.
//! aPlane serves as an optional axis. //! aPlane serves as an optional axis.
//! anExternRef set to 0 indicates that there is no relation. //! anExternRef set to 0 indicates that there is no relation.
Standard_EXPORT AIS_TangentRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane, const Standard_Integer anExternRef = 0); Standard_EXPORT PrsDim_TangentRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane, const Standard_Integer anExternRef = 0);
//! Returns the external reference for tangency. //! Returns the external reference for tangency.
//! The values are as follows: //! The values are as follows:
@ -43,7 +43,7 @@ public:
//! - 1 - there is a connection to the first shape; //! - 1 - there is a connection to the first shape;
//! - 2 - there is a connection to the second shape. //! - 2 - there is a connection to the second shape.
//! This reference is defined at construction time. //! This reference is defined at construction time.
Standard_EXPORT Standard_Integer ExternRef(); Standard_Integer ExternRef() { return myExternRef; }
//! Sets the external reference for tangency, aRef. //! Sets the external reference for tangency, aRef.
//! The values are as follows: //! The values are as follows:
@ -51,18 +51,20 @@ public:
//! - 1 - there is a connection to the first shape; //! - 1 - there is a connection to the first shape;
//! - 2 - there is a connection to the second shape. //! - 2 - there is a connection to the second shape.
//! This reference is initially defined at construction time. //! This reference is initially defined at construction time.
Standard_EXPORT void SetExternRef (const Standard_Integer aRef); void SetExternRef (const Standard_Integer aRef) { myExternRef = aRef; }
private: private:
Standard_EXPORT 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(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
Standard_EXPORT void ComputeTwoFacesTangent (const Handle(Prs3d_Presentation)& aPresentation); Standard_EXPORT void ComputeTwoFacesTangent (const Handle(Prs3d_Presentation)& aPresentation);
Standard_EXPORT void ComputeTwoEdgesTangent (const Handle(Prs3d_Presentation)& aPresentation); Standard_EXPORT void ComputeTwoEdgesTangent (const Handle(Prs3d_Presentation)& aPresentation);
private:
gp_Pnt myAttach; gp_Pnt myAttach;
gp_Dir myDir; gp_Dir myDir;
Standard_Real myLength; Standard_Real myLength;
@ -70,4 +72,4 @@ private:
}; };
#endif // _AIS_TangentRelation_HeaderFile #endif // _PrsDim_TangentRelation_HeaderFile

View File

@ -14,14 +14,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_TypeOfAngle_HeaderFile #ifndef _PrsDim_TypeOfAngle_HeaderFile
#define _AIS_TypeOfAngle_HeaderFile #define _PrsDim_TypeOfAngle_HeaderFile
//! Declares the type of angle. //! Declares the type of angle.
enum AIS_TypeOfAngle enum PrsDim_TypeOfAngle
{ {
AIS_TOA_Interior, //!< the angle between two lines built on geometry parameters PrsDim_TypeOfAngle_Interior, //!< the angle between two lines built on geometry parameters
AIS_TOA_Exterior //!< the angle equal 2 PI minus the interior angle PrsDim_TypeOfAngle_Exterior, //!< the angle equal 2 PI minus the interior angle
}; };
#endif // _AIS_TypeOfAngle_HeaderFile #endif // _PrsDim_TypeOfAngle_HeaderFile

View File

@ -14,16 +14,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_TypeOfAngleArrowVisibility_HeaderFile #ifndef _PrsDim_TypeOfAngleArrowVisibility_HeaderFile
#define _AIS_TypeOfAngleArrowVisibility_HeaderFile #define _PrsDim_TypeOfAngleArrowVisibility_HeaderFile
//! Declares what arrows are visible on angle presentation //! Declares what arrows are visible on angle presentation
enum AIS_TypeOfAngleArrowVisibility enum PrsDim_TypeOfAngleArrowVisibility
{ {
AIS_TOAV_Both, //!< both arrows of the first and the second angle tips PrsDim_TypeOfAngleArrowVisibility_Both, //!< both arrows of the first and the second angle tips
AIS_TOAV_First, //!< only first point arrow PrsDim_TypeOfAngleArrowVisibility_First, //!< only first point arrow
AIS_TOAV_Second, //!< only second point arrow PrsDim_TypeOfAngleArrowVisibility_Second, //!< only second point arrow
AIS_TOAV_None //!< arrows are not visible PrsDim_TypeOfAngleArrowVisibility_None, //!< arrows are not visible
}; };
#endif // _AIS_TypeOfAngleArrowVisibility_HeaderFile #endif // _PrsDim_TypeOfAngleArrowVisibility_HeaderFile

View File

@ -14,15 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#ifndef _AIS_TypeOfDist_HeaderFile #ifndef _PrsDim_TypeOfDist_HeaderFile
#define _AIS_TypeOfDist_HeaderFile #define _PrsDim_TypeOfDist_HeaderFile
//! To declare the type of distance. //! To declare the type of distance.
enum AIS_TypeOfDist enum PrsDim_TypeOfDist
{ {
AIS_TOD_Unknown, PrsDim_TypeOfDist_Unknown,
AIS_TOD_Horizontal, PrsDim_TypeOfDist_Horizontal,
AIS_TOD_Vertical PrsDim_TypeOfDist_Vertical
}; };
#endif // _AIS_TypeOfDist_HeaderFile #endif // _PrsDim_TypeOfDist_HeaderFile

Some files were not shown because too many files have changed in this diff Show More