diff --git a/adm/UDLIST b/adm/UDLIST index f9645d7303..b81cd39c31 100644 --- a/adm/UDLIST +++ b/adm/UDLIST @@ -202,6 +202,7 @@ n InterfaceGraphic n AIS n Aspect n DsgPrs +n PrsDim n Graphic3d n Image n Media diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index 45c48ea1c6..9f70d21deb 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -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()* 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 The method Select3D_SensitiveEntity::NbSubElements() has been changed to be constant. Select3D_SensitiveEntity subclasses at application level should be updated accordingly. diff --git a/dox/user_guides/visualization/visualization.md b/dox/user_guides/visualization/visualization.md index 17735f363e..2fc8473f97 100644 --- a/dox/user_guides/visualization/visualization.md +++ b/dox/user_guides/visualization/visualization.md @@ -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 following relations are provided by *AIS*: - * *AIS_ConcentricRelation* - * *AIS_FixRelation* - * *AIS_IdenticRelation* - * *AIS_ParallelRelation* - * *AIS_PerpendicularRelation* - * *AIS_Relation* - * *AIS_SymmetricRelation* - * *AIS_TangentRelation* +The following relations are provided by *PrsDim*: + * *PrsDim_ConcentricRelation* + * *PrsDim_FixRelation* + * *PrsDim_IdenticRelation* + * *PrsDim_ParallelRelation* + * *PrsDim_PerpendicularRelation* + * *PrsDim_Relation* + * *PrsDim_SymmetricRelation* + * *PrsDim_TangentRelation* The list of relations is not exhaustive. @subsubsection occt_visu_3_5_4 Dimensions - * *AIS_AngleDimension* - * *AIS_Chamf3dDimension* - * *AIS_DiameterDimension* - * *AIS_DimensionOwner* - * *AIS_LengthDimension* - * *AIS_OffsetDimension* - * *AIS_RadiusDimension* + * *PrsDim_AngleDimension* + * *PrsDim_Chamf3dDimension* + * *PrsDim_DiameterDimension* + * *PrsDim_DimensionOwner* + * *PrsDim_LengthDimension* + * *PrsDim_OffsetDimension* + * *PrsDim_RadiusDimension* @subsubsection occt_visu_3_5_5 MeshVS_Mesh diff --git a/samples/mfc/standard/Common/AngleParamsVerticesPage.cpp b/samples/mfc/standard/Common/AngleParamsVerticesPage.cpp index 7bc3364e59..cb39df9c7c 100644 --- a/samples/mfc/standard/Common/AngleParamsVerticesPage.cpp +++ b/samples/mfc/standard/Common/AngleParamsVerticesPage.cpp @@ -6,8 +6,7 @@ #include "DimensionDlg.h" #include -#include -#include +#include #include #include #include @@ -128,7 +127,7 @@ void CAngleParamsVerticesPage::OnBnClickedVertex3Btn() GC_MakePlane aPlaneBuilder (aP1,aP2,aP3); 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(); anAspect->MakeArrows3d (Standard_False); anAspect->MakeText3d (aDimDlg->GetTextType()); @@ -146,7 +145,7 @@ void CAngleParamsVerticesPage::OnBnClickedVertex3Btn() } else // radians - no special symbol { - anAngleDim->SetDisplaySpecialSymbol (AIS_DSS_No); + anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No); } } anAngleDim->SetDimensionAspect (anAspect); diff --git a/samples/mfc/standard/Common/LengthParamsEdgePage.cpp b/samples/mfc/standard/Common/LengthParamsEdgePage.cpp index 02252f67df..89c90ce6eb 100644 --- a/samples/mfc/standard/Common/LengthParamsEdgePage.cpp +++ b/samples/mfc/standard/Common/LengthParamsEdgePage.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include @@ -91,7 +91,7 @@ void CLengthParamsEdgePage::OnBnClickedChooseEdgeBtn() 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(); anAspect->MakeArrows3d (Standard_False); anAspect->MakeText3d (aDimDlg->GetTextType()); diff --git a/samples/mfc/standard/Common/LengthParamsEdgesPage.cpp b/samples/mfc/standard/Common/LengthParamsEdgesPage.cpp index f4042b1824..6a2814888f 100644 --- a/samples/mfc/standard/Common/LengthParamsEdgesPage.cpp +++ b/samples/mfc/standard/Common/LengthParamsEdgesPage.cpp @@ -5,8 +5,8 @@ #include "LengthParamsEdgesPage.h" #include "DimensionDlg.h" #include -#include -#include +#include +#include #include // CLengthParamsEdgesPage dialog @@ -119,7 +119,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn() if (myIsAngleDimension) { // 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->DimensionAspect()->MakeUnitsDisplayed (aDimDlg->IsUnitsDisplayed()); if (aDimDlg->IsUnitsDisplayed()) @@ -131,7 +131,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn() } else { - anAngleDim->SetDisplaySpecialSymbol (AIS_DSS_No); + anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No); } } @@ -140,7 +140,7 @@ void CLengthParamsEdgesPage::OnBnClickedEdge2Btn() } 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->SetFlyout (aDimDlg->GetFlyout()); if (aDimDlg->IsUnitsDisplayed()) diff --git a/samples/mfc/standard/Common/LengthParamsVerticesPage.cpp b/samples/mfc/standard/Common/LengthParamsVerticesPage.cpp index ca61a5d129..6b00519e24 100644 --- a/samples/mfc/standard/Common/LengthParamsVerticesPage.cpp +++ b/samples/mfc/standard/Common/LengthParamsVerticesPage.cpp @@ -6,7 +6,7 @@ #include "DimensionDlg.h" #include #include -#include +#include #include @@ -103,7 +103,7 @@ void CLengthParamsVerticesPage::OnBnClickedVertex2Btn() 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(); anAspect->MakeArrows3d (Standard_False); diff --git a/samples/mfc/standard/Common/ParamsFacesPage.cpp b/samples/mfc/standard/Common/ParamsFacesPage.cpp index 05c99d703c..99d17479e4 100644 --- a/samples/mfc/standard/Common/ParamsFacesPage.cpp +++ b/samples/mfc/standard/Common/ParamsFacesPage.cpp @@ -5,8 +5,8 @@ #include "ParamsFacesPage.h" #include "DimensionDlg.h" #include -#include -#include +#include +#include // CParamsFacesPage dialog @@ -87,7 +87,7 @@ void CParamsFacesPage::OnBnClickedFacesbtn2() if (myIsAngleDimension) { // 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); if (aDimDlg->IsUnitsDisplayed()) @@ -99,7 +99,7 @@ void CParamsFacesPage::OnBnClickedFacesbtn2() } else { - anAngleDim->SetDisplaySpecialSymbol (AIS_DSS_No); + anAngleDim->SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No); } } @@ -108,7 +108,7 @@ void CParamsFacesPage::OnBnClickedFacesbtn2() } else { - Handle(AIS_LengthDimension) aLenDim = new AIS_LengthDimension (myFirstFace, mySecondFace); + Handle(PrsDim_LengthDimension) aLenDim = new PrsDim_LengthDimension (myFirstFace, mySecondFace); aLenDim->SetDimensionAspect (anAspect); if (aLenDim->DimensionAspect()->IsUnitsDisplayed()) diff --git a/samples/mfc/standard/Common/RadiusParamsPage.cpp b/samples/mfc/standard/Common/RadiusParamsPage.cpp index deadf5d5b6..f2275d1a04 100644 --- a/samples/mfc/standard/Common/RadiusParamsPage.cpp +++ b/samples/mfc/standard/Common/RadiusParamsPage.cpp @@ -4,8 +4,8 @@ #include "DimensionDlg.h" #include -#include -#include +#include +#include #include #include @@ -96,16 +96,16 @@ void CRadiusParamsPage::OnBnClickedObjectBtn() myAISContext->ClearSelected (Standard_False); CDimensionDlg *aDimDlg = (CDimensionDlg*)(this->GetParentOwner()); // Try to create dimension if it is possible - Handle(AIS_Dimension) aDim; + Handle(PrsDim_Dimension) aDim; if (myIsDiameterDimension) { - aDim = new AIS_DiameterDimension (aCircle); - Handle(AIS_DiameterDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout()); + aDim = new PrsDim_DiameterDimension (aCircle); + Handle(PrsDim_DiameterDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout()); } else { - aDim = new AIS_RadiusDimension (aCircle); - Handle(AIS_RadiusDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout()); + aDim = new PrsDim_RadiusDimension (aCircle); + Handle(PrsDim_RadiusDimension)::DownCast(aDim)->SetFlyout (aDimDlg->GetFlyout()); } Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); diff --git a/src/AIS/AIS.hxx b/src/AIS/AIS.hxx index 70cc8ce6a3..579f156194 100644 --- a/src/AIS/AIS.hxx +++ b/src/AIS/AIS.hxx @@ -17,26 +17,9 @@ #ifndef _AIS_HeaderFile #define _AIS_HeaderFile -#include -#include -#include -#include -#include -#include -#include #include #include #include -#include - -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 //! the packages which are used to manage selection and presentation. @@ -90,119 +73,6 @@ 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 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 . - //! 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 in the current WorkingPlane - //! and the extremities if any. - //! If is not in the current plane, contains - //! the not projected curve associated to . - //! If is infinite, = true and the 2 - //! parameters and 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 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 and 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 and 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 - //! =1 or of the 2nd edge if = 2. If - //! = 0, ExtCurve is Null. if there is an edge - //! external to the plane, 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 diff --git a/src/AIS/AIS_Chamf2dDimension.lxx b/src/AIS/AIS_Chamf2dDimension.lxx deleted file mode 100644 index ff9fb7f3d9..0000000000 --- a/src/AIS/AIS_Chamf2dDimension.lxx +++ /dev/null @@ -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; -} diff --git a/src/AIS/AIS_Chamf3dDimension.lxx b/src/AIS/AIS_Chamf3dDimension.lxx deleted file mode 100644 index 4b1bcdc3db..0000000000 --- a/src/AIS/AIS_Chamf3dDimension.lxx +++ /dev/null @@ -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; -} diff --git a/src/AIS/AIS_EqualDistanceRelation.lxx b/src/AIS/AIS_EqualDistanceRelation.lxx deleted file mode 100644 index 3d06e6843e..0000000000 --- a/src/AIS/AIS_EqualDistanceRelation.lxx +++ /dev/null @@ -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; -} - diff --git a/src/AIS/AIS_KindOfSurface.hxx b/src/AIS/AIS_KindOfSurface.hxx deleted file mode 100644 index b20773d724..0000000000 --- a/src/AIS/AIS_KindOfSurface.hxx +++ /dev/null @@ -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 diff --git a/src/AIS/AIS_MidPointRelation.lxx b/src/AIS/AIS_MidPointRelation.lxx deleted file mode 100644 index 3cae1f0c4a..0000000000 --- a/src/AIS/AIS_MidPointRelation.lxx +++ /dev/null @@ -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; -} diff --git a/src/AIS/AIS_OffsetDimension.lxx b/src/AIS/AIS_OffsetDimension.lxx deleted file mode 100644 index 7585db9e71..0000000000 --- a/src/AIS/AIS_OffsetDimension.lxx +++ /dev/null @@ -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; -} diff --git a/src/AIS/AIS_ParallelRelation.lxx b/src/AIS/AIS_ParallelRelation.lxx deleted file mode 100644 index d6720fe414..0000000000 --- a/src/AIS/AIS_ParallelRelation.lxx +++ /dev/null @@ -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; -} diff --git a/src/AIS/AIS_StandardDatum.hxx b/src/AIS/AIS_StandardDatum.hxx deleted file mode 100644 index 39dab81dce..0000000000 --- a/src/AIS/AIS_StandardDatum.hxx +++ /dev/null @@ -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 diff --git a/src/AIS/AIS_SymmetricRelation.lxx b/src/AIS/AIS_SymmetricRelation.lxx deleted file mode 100644 index 8feca7b2df..0000000000 --- a/src/AIS/AIS_SymmetricRelation.lxx +++ /dev/null @@ -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; -} diff --git a/src/AIS/FILES b/src/AIS/FILES index 7b21d4f4bb..0343a90f69 100644 --- a/src/AIS/FILES +++ b/src/AIS/FILES @@ -1,4 +1,3 @@ -AIS.cxx AIS.hxx AIS_Animation.cxx AIS_Animation.hxx @@ -7,8 +6,6 @@ AIS_AnimationCamera.cxx AIS_AnimationCamera.hxx AIS_AnimationObject.cxx AIS_AnimationObject.hxx -AIS_AngleDimension.cxx -AIS_AngleDimension.hxx AIS_AttributeFilter.cxx AIS_AttributeFilter.hxx AIS_AttributeFilter.lxx @@ -20,12 +17,6 @@ AIS_C0RegularityFilter.cxx AIS_C0RegularityFilter.hxx AIS_CameraFrustum.cxx 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.hxx AIS_ClearMode.hxx @@ -35,8 +26,6 @@ AIS_ColoredShape.hxx AIS_DataMapOfShapeDrawer.hxx AIS_ColorScale.cxx AIS_ColorScale.hxx -AIS_ConcentricRelation.cxx -AIS_ConcentricRelation.hxx AIS_ConnectedInteractive.cxx AIS_ConnectedInteractive.hxx AIS_ConnectStatus.hxx @@ -46,35 +35,16 @@ AIS_DataMapIteratorOfDataMapOfSelStat.hxx AIS_DataMapofIntegerListOfinteractive.hxx AIS_DataMapOfIOStatus.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_DisplaySpecialSymbol.hxx AIS_DisplayStatus.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.hxx AIS_ExclusionFilter.lxx -AIS_FixRelation.cxx -AIS_FixRelation.hxx AIS_GlobalStatus.cxx AIS_GlobalStatus.hxx AIS_GraphicTool.cxx AIS_GraphicTool.hxx -AIS_IdenticRelation.cxx -AIS_IdenticRelation.hxx AIS_IndexedDataMapOfOwnerPrs.hxx AIS_InteractiveContext.cxx AIS_InteractiveContext.hxx @@ -83,13 +53,7 @@ AIS_InteractiveContext_2.cxx AIS_InteractiveContext_3.cxx AIS_InteractiveObject.cxx AIS_InteractiveObject.hxx -AIS_KindOfDimension.hxx AIS_KindOfInteractive.hxx -AIS_KindOfRelation.hxx -AIS_KindOfSurface.hxx -AIS_KindOfUnit.hxx -AIS_LengthDimension.cxx -AIS_LengthDimension.hxx AIS_Line.cxx AIS_Line.hxx AIS_ListIteratorOfListOfInteractive.hxx @@ -101,29 +65,14 @@ AIS_ManipulatorOwner.hxx AIS_ManipulatorOwner.cxx AIS_MapIteratorOfMapOfInteractive.hxx AIS_MapOfInteractive.hxx -AIS_MaxRadiusDimension.cxx -AIS_MaxRadiusDimension.hxx AIS_MediaPlayer.cxx AIS_MediaPlayer.hxx AIS_MouseGesture.hxx -AIS_MidPointRelation.cxx -AIS_MidPointRelation.hxx -AIS_MidPointRelation.lxx -AIS_MinRadiusDimension.cxx -AIS_MinRadiusDimension.hxx AIS_MultipleConnectedInteractive.cxx AIS_MultipleConnectedInteractive.hxx AIS_MultipleConnectedInteractive.lxx AIS_NavigationMode.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.hxx AIS_PlaneTrihedron.cxx @@ -132,10 +81,6 @@ AIS_Point.cxx AIS_Point.hxx AIS_PointCloud.cxx AIS_PointCloud.hxx -AIS_RadiusDimension.cxx -AIS_RadiusDimension.hxx -AIS_Relation.cxx -AIS_Relation.hxx AIS_RotationMode.hxx AIS_RubberBand.hxx AIS_RubberBand.cxx @@ -143,20 +88,13 @@ AIS_Selection.cxx AIS_Selection.hxx AIS_SelectStatus.hxx AIS_SelectionModesConcurrency.hxx -AIS_SequenceOfDimension.hxx AIS_SequenceOfInteractive.hxx AIS_Shape.cxx AIS_Shape.hxx AIS_SignatureFilter.cxx AIS_SignatureFilter.hxx -AIS_StandardDatum.hxx AIS_StatusOfDetection.hxx AIS_StatusOfPick.hxx -AIS_SymmetricRelation.cxx -AIS_SymmetricRelation.hxx -AIS_SymmetricRelation.lxx -AIS_TangentRelation.cxx -AIS_TangentRelation.hxx AIS_TextLabel.cxx AIS_TextLabel.hxx AIS_TexturedShape.cxx @@ -170,11 +108,8 @@ AIS_TrihedronOwner.hxx AIS_TrihedronSelectionMode.hxx AIS_TypeFilter.cxx AIS_TypeFilter.hxx -AIS_TypeOfAngle.hxx -AIS_TypeOfAngleArrowVisibility.hxx AIS_TypeOfAttribute.hxx AIS_TypeOfAxis.hxx -AIS_TypeOfDist.hxx AIS_TypeOfIso.hxx AIS_TypeOfPlane.hxx AIS_ViewController.cxx diff --git a/src/AIS/AIS_SequenceOfDimension.hxx b/src/PrsDim/AIS_AngleDimension.hxx similarity index 61% rename from src/AIS/AIS_SequenceOfDimension.hxx rename to src/PrsDim/AIS_AngleDimension.hxx index d887ea0394..5e99810f7c 100644 --- a/src/AIS/AIS_SequenceOfDimension.hxx +++ b/src/PrsDim/AIS_AngleDimension.hxx @@ -1,7 +1,4 @@ -// Created on: 1996-12-11 -// Created by: Robert COUBLANC -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS +// Copyright (c) 2020 OPEN CASCADE SAS // // 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 // commercial license or contractual agreement. -#ifndef AIS_SequenceOfDimension_HeaderFile -#define AIS_SequenceOfDimension_HeaderFile +#ifndef _AIS_AngleDimension_HeaderFile +#define _AIS_AngleDimension_HeaderFile -#include -#include +#include -typedef NCollection_Sequence AIS_SequenceOfDimension; +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_AngleDimension AIS_AngleDimension; - -#endif +#endif // _AIS_AngleDimension_HeaderFile diff --git a/src/PrsDim/AIS_Chamf2dDimension.hxx b/src/PrsDim/AIS_Chamf2dDimension.hxx new file mode 100644 index 0000000000..4ebb17eb20 --- /dev/null +++ b/src/PrsDim/AIS_Chamf2dDimension.hxx @@ -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 + +Standard_DEPRECATED("Alias to moved class") +typedef PrsDim_Chamf2dDimension AIS_Chamf2dDimension; + +#endif // _AIS_Chamf2dDimension_HeaderFile diff --git a/src/PrsDim/AIS_Chamf3dDimension.hxx b/src/PrsDim/AIS_Chamf3dDimension.hxx new file mode 100644 index 0000000000..92446f7ce4 --- /dev/null +++ b/src/PrsDim/AIS_Chamf3dDimension.hxx @@ -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 + +Standard_DEPRECATED("Alias to moved class") +typedef PrsDim_Chamf3dDimension AIS_Chamf3dDimension; + +#endif // _AIS_Chamf3dDimension_HeaderFile diff --git a/src/PrsDim/AIS_ConcentricRelation.hxx b/src/PrsDim/AIS_ConcentricRelation.hxx new file mode 100644 index 0000000000..46d570f9e6 --- /dev/null +++ b/src/PrsDim/AIS_ConcentricRelation.hxx @@ -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 + +Standard_DEPRECATED("Alias to moved class") +typedef PrsDim_ConcentricRelation AIS_ConcentricRelation; + +#endif // _AIS_ConcentricRelation_HeaderFile diff --git a/src/PrsDim/AIS_DiameterDimension.hxx b/src/PrsDim/AIS_DiameterDimension.hxx new file mode 100644 index 0000000000..bc13501993 --- /dev/null +++ b/src/PrsDim/AIS_DiameterDimension.hxx @@ -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 + +Standard_DEPRECATED("Alias to moved class") +typedef PrsDim_DiameterDimension AIS_DiameterDimension; + +#endif // _AIS_DiameterDimension_HeaderFile diff --git a/src/PrsDim/AIS_Dimension.hxx b/src/PrsDim/AIS_Dimension.hxx new file mode 100644 index 0000000000..0892585945 --- /dev/null +++ b/src/PrsDim/AIS_Dimension.hxx @@ -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 + +Standard_DEPRECATED("Alias to moved class") +typedef PrsDim_Dimension AIS_Dimension; + +#endif // _AIS_Dimension_HeaderFile diff --git a/src/PrsDim/AIS_DimensionOwner.hxx b/src/PrsDim/AIS_DimensionOwner.hxx new file mode 100644 index 0000000000..e0c714d8ca --- /dev/null +++ b/src/PrsDim/AIS_DimensionOwner.hxx @@ -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 + +Standard_DEPRECATED("Alias to moved class") +typedef PrsDim_DimensionOwner AIS_DimensionOwner; + +#endif // _AIS_DimensionOwner_HeaderFile diff --git a/src/PrsDim/AIS_EllipseRadiusDimension.hxx b/src/PrsDim/AIS_EllipseRadiusDimension.hxx new file mode 100644 index 0000000000..5d20c5f2d3 --- /dev/null +++ b/src/PrsDim/AIS_EllipseRadiusDimension.hxx @@ -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 + +Standard_DEPRECATED("Alias to moved class") +typedef PrsDim_EllipseRadiusDimension AIS_EllipseRadiusDimension; + +#endif // _AIS_EllipseRadiusDimension_HeaderFile diff --git a/src/PrsDim/AIS_EqualDistanceRelation.hxx b/src/PrsDim/AIS_EqualDistanceRelation.hxx new file mode 100644 index 0000000000..10102cbb5e --- /dev/null +++ b/src/PrsDim/AIS_EqualDistanceRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_EqualDistanceRelation AIS_EqualDistanceRelation; + +#endif // _AIS_EqualDistanceRelation_HeaderFile diff --git a/src/PrsDim/AIS_EqualRadiusRelation.hxx b/src/PrsDim/AIS_EqualRadiusRelation.hxx new file mode 100644 index 0000000000..3f924301f7 --- /dev/null +++ b/src/PrsDim/AIS_EqualRadiusRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_EqualRadiusRelation AIS_EqualRadiusRelation; + +#endif // _AIS_EqualRadiusRelation_HeaderFile diff --git a/src/PrsDim/AIS_FixRelation.hxx b/src/PrsDim/AIS_FixRelation.hxx new file mode 100644 index 0000000000..1adedde858 --- /dev/null +++ b/src/PrsDim/AIS_FixRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_FixRelation AIS_FixRelation; + +#endif // _AIS_FixRelation_HeaderFile diff --git a/src/PrsDim/AIS_IdenticRelation.hxx b/src/PrsDim/AIS_IdenticRelation.hxx new file mode 100644 index 0000000000..02eb6e406b --- /dev/null +++ b/src/PrsDim/AIS_IdenticRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_IdenticRelation AIS_IdenticRelation; + +#endif // _AIS_IdenticRelation_HeaderFile diff --git a/src/PrsDim/AIS_LengthDimension.hxx b/src/PrsDim/AIS_LengthDimension.hxx new file mode 100644 index 0000000000..a79cf351a0 --- /dev/null +++ b/src/PrsDim/AIS_LengthDimension.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_LengthDimension AIS_LengthDimension; + +#endif // _AIS_LengthDimension_HeaderFile diff --git a/src/PrsDim/AIS_MaxRadiusDimension.hxx b/src/PrsDim/AIS_MaxRadiusDimension.hxx new file mode 100644 index 0000000000..e8614a4ce3 --- /dev/null +++ b/src/PrsDim/AIS_MaxRadiusDimension.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_MaxRadiusDimension AIS_MaxRadiusDimension; + +#endif // _AIS_MaxRadiusDimension_HeaderFile diff --git a/src/PrsDim/AIS_MidPointRelation.hxx b/src/PrsDim/AIS_MidPointRelation.hxx new file mode 100644 index 0000000000..a58e049005 --- /dev/null +++ b/src/PrsDim/AIS_MidPointRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_MidPointRelation AIS_MidPointRelation; + +#endif // _AIS_MidPointRelation_HeaderFile diff --git a/src/PrsDim/AIS_MinRadiusDimension.hxx b/src/PrsDim/AIS_MinRadiusDimension.hxx new file mode 100644 index 0000000000..dce761bb13 --- /dev/null +++ b/src/PrsDim/AIS_MinRadiusDimension.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_MinRadiusDimension AIS_MinRadiusDimension; + +#endif // _AIS_MinRadiusDimension_HeaderFile diff --git a/src/PrsDim/AIS_OffsetDimension.hxx b/src/PrsDim/AIS_OffsetDimension.hxx new file mode 100644 index 0000000000..cb9b27f2cf --- /dev/null +++ b/src/PrsDim/AIS_OffsetDimension.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_OffsetDimension AIS_OffsetDimension; + +#endif // _AIS_OffsetDimension_HeaderFile diff --git a/src/PrsDim/AIS_ParallelRelation.hxx b/src/PrsDim/AIS_ParallelRelation.hxx new file mode 100644 index 0000000000..c4b0d78f48 --- /dev/null +++ b/src/PrsDim/AIS_ParallelRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_ParallelRelation AIS_ParallelRelation; + +#endif // _AIS_ParallelRelation_HeaderFile diff --git a/src/PrsDim/AIS_PerpendicularRelation.hxx b/src/PrsDim/AIS_PerpendicularRelation.hxx new file mode 100644 index 0000000000..1e1a08933e --- /dev/null +++ b/src/PrsDim/AIS_PerpendicularRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_PerpendicularRelation AIS_PerpendicularRelation; + +#endif // _AIS_PerpendicularRelation_HeaderFile diff --git a/src/PrsDim/AIS_RadiusDimension.hxx b/src/PrsDim/AIS_RadiusDimension.hxx new file mode 100644 index 0000000000..c48e4ebdc0 --- /dev/null +++ b/src/PrsDim/AIS_RadiusDimension.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_RadiusDimension AIS_RadiusDimension; + +#endif // _AIS_RadiusDimension_HeaderFile diff --git a/src/PrsDim/AIS_Relation.hxx b/src/PrsDim/AIS_Relation.hxx new file mode 100644 index 0000000000..45dfe3f843 --- /dev/null +++ b/src/PrsDim/AIS_Relation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_Relation AIS_Relation; + +#endif // _AIS_Relation_HeaderFile diff --git a/src/PrsDim/AIS_SymmetricRelation.hxx b/src/PrsDim/AIS_SymmetricRelation.hxx new file mode 100644 index 0000000000..d452b8b364 --- /dev/null +++ b/src/PrsDim/AIS_SymmetricRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_SymmetricRelation AIS_SymmetricRelation; + +#endif // _AIS_SymmetricRelation_HeaderFile diff --git a/src/PrsDim/AIS_TangentRelation.hxx b/src/PrsDim/AIS_TangentRelation.hxx new file mode 100644 index 0000000000..ea7159f050 --- /dev/null +++ b/src/PrsDim/AIS_TangentRelation.hxx @@ -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 + +Standard_DEPRECATED("Deprecated alias to moved class") +typedef PrsDim_TangentRelation AIS_TangentRelation; + +#endif // _AIS_TangentRelation_HeaderFile diff --git a/src/PrsDim/FILES b/src/PrsDim/FILES new file mode 100644 index 0000000000..d0efcd91cb --- /dev/null +++ b/src/PrsDim/FILES @@ -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 diff --git a/src/AIS/AIS.cxx b/src/PrsDim/PrsDim.cxx similarity index 80% rename from src/AIS/AIS.cxx rename to src/PrsDim/PrsDim.cxx index d9129b05e4..169bd59453 100644 --- a/src/AIS/AIS.cxx +++ b/src/PrsDim/PrsDim.cxx @@ -14,7 +14,7 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include #include #include @@ -86,7 +86,7 @@ const Standard_Real SquareTolerance = Precision::SquareConfusion(); //function : Nearest //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 curdist2; @@ -111,7 +111,7 @@ gp_Pnt AIS::Nearest(const TopoDS_Shape& ashape, const gp_Pnt& apoint) //function : Nearest //purpose : For finds the nearest point on . //======================================================================= -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); @@ -125,19 +125,18 @@ gp_Pnt AIS::Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint) // return TRUE if found point is belongs to curve // and FALSE otherwise. //======================================================================= -Standard_Boolean AIS::Nearest (const Handle(Geom_Curve)& theCurve, - const gp_Pnt& thePoint, - const gp_Pnt& theFirstPoint, - const gp_Pnt& theLastPoint, - gp_Pnt& theNearestPoint) +Standard_Boolean PrsDim::Nearest (const Handle(Geom_Curve)& theCurve, + const gp_Pnt& thePoint, + const gp_Pnt& theFirstPoint, + const gp_Pnt& theLastPoint, + gp_Pnt& theNearestPoint) { GeomAPI_ProjectPointOnCurve aPointProj (thePoint, theCurve); theNearestPoint = theCurve->Value (aPointProj.LowerDistanceParameter()); Standard_Real aLength = theFirstPoint.Distance (theLastPoint); - if (theNearestPoint.Distance (theFirstPoint) > aLength - || theNearestPoint.Distance (theLastPoint) >aLength) + || theNearestPoint.Distance (theLastPoint) > aLength) { return Standard_False; } @@ -149,7 +148,7 @@ Standard_Boolean AIS::Nearest (const Handle(Geom_Curve)& theCurve, //function : Farest //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; gp_Pnt Result(0.0,0.0,0.0); @@ -173,10 +172,10 @@ gp_Pnt AIS::Farest( const TopoDS_Shape& aShape, const gp_Pnt& aPoint ) //function : ComputeGeometry //purpose : for line, circle, ellipse. //======================================================================= -Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge, - Handle(Geom_Curve)& theCurve, - gp_Pnt& theFirstPnt, - gp_Pnt& theLastPnt) +Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theEdge, + Handle(Geom_Curve)& theCurve, + gp_Pnt& theFirstPnt, + gp_Pnt& theLastPnt) { TopLoc_Location anEdgeLoc; Standard_Real aFirst, aLast; @@ -228,11 +227,11 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge, //function : ComputeGeometry //purpose : for line, circle, ellipse. //======================================================================= -Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge, - Handle(Geom_Curve)& theCurve, - gp_Pnt& theFirstPnt, - gp_Pnt& theLastPnt, - Standard_Boolean& theIsInfinite) +Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Edge& theEdge, + Handle(Geom_Curve)& theCurve, + gp_Pnt& theFirstPnt, + gp_Pnt& theLastPnt, + Standard_Boolean& theIsInfinite) { Standard_Real aFirst, aLast; @@ -275,14 +274,14 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge, //purpose : //======================================================================= -Standard_Boolean AIS::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) +Standard_Boolean PrsDim::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) { if (thePlane.IsNull()) { @@ -371,15 +370,15 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theEdge, //function : ComputeGeometry //purpose : //======================================================================= -Standard_Boolean AIS::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) +Standard_Boolean PrsDim::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) { if (thePlane.IsNull()) { @@ -479,25 +478,25 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge, //function : ComputeGeometry //purpose : Computes the geometry of the 2 edges. //======================================================================= -Standard_Boolean AIS::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) +Standard_Boolean PrsDim::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) { theIsInfinite1 = theIsInfinite2 = Standard_False; - if (!AIS::ComputeGeometry (theFirstEdge, theFirstCurve,theFirstPnt1, theLastPnt1, theIsInfinite1)) + if (!PrsDim::ComputeGeometry (theFirstEdge, theFirstCurve,theFirstPnt1, theLastPnt1, theIsInfinite1)) { return Standard_False; } - if (!AIS::ComputeGeometry (theSecondEdge, theSecondCurve,theFirstPnt2, theLastPnt2, theIsInfinite2)) + if (!PrsDim::ComputeGeometry (theSecondEdge, theSecondCurve,theFirstPnt2, theLastPnt2, theIsInfinite2)) { return Standard_False; } @@ -563,19 +562,19 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge, // if none of the two edges is in the current wp , // it returns Standard_False //======================================================================= -Standard_Boolean AIS::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) +Standard_Boolean PrsDim::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) { if (thePlane.IsNull()) { @@ -692,13 +691,13 @@ Standard_Boolean AIS::ComputeGeometry (const TopoDS_Edge& theFirstEdge, // and returns aCurveproj; // Return TRUE if ok //======================================================================= -Standard_Boolean AIS::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_Boolean PrsDim::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) { isOnPlane = Standard_True; const Standard_Integer NodeNumber = 20; @@ -740,8 +739,8 @@ Standard_Boolean AIS::ComputeGeomCurve (Handle(Geom_Curve)& aCurve, } if (! Precision::IsInfinite(first1) && ! Precision::IsInfinite(last1)) { - FirstPnt1 = AIS::ProjectPointOnPlane( FirstPnt1, aPlane->Pln() ); - LastPnt1 = AIS::ProjectPointOnPlane( LastPnt1, aPlane->Pln() ); + FirstPnt1 = PrsDim::ProjectPointOnPlane( FirstPnt1, aPlane->Pln() ); + LastPnt1 = PrsDim::ProjectPointOnPlane( LastPnt1, aPlane->Pln() ); } } return Standard_True; @@ -754,15 +753,15 @@ Standard_Boolean AIS::ComputeGeomCurve (Handle(Geom_Curve)& aCurve, // , = true. // is the projected vertex in the plane. //======================================================================= -Standard_Boolean AIS::ComputeGeometry(const TopoDS_Vertex& aVertex, - gp_Pnt& point, - const Handle(Geom_Plane)& aPlane, - Standard_Boolean& isOnPlane) +Standard_Boolean PrsDim::ComputeGeometry (const TopoDS_Vertex& aVertex, + gp_Pnt& point, + const Handle(Geom_Plane)& aPlane, + Standard_Boolean& isOnPlane) { point = BRep_Tool::Pnt(aVertex); isOnPlane = aPlane->Pln().Contains(point, Precision::Confusion()); if ( !isOnPlane) { - point = AIS::ProjectPointOnPlane( point, aPlane->Pln() ); + point = PrsDim::ProjectPointOnPlane( point, aPlane->Pln() ); } return Standard_True; } @@ -772,11 +771,11 @@ Standard_Boolean AIS::ComputeGeometry(const TopoDS_Vertex& aVertex, //purpose : // Returns type of surface which can be Plane or OtherSurface //======================================================================= -Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace, - gp_Pln & aPlane, - Handle( Geom_Surface )& aSurf, - AIS_KindOfSurface & aSurfType, - Standard_Real & Offset) +Standard_Boolean PrsDim::GetPlaneFromFace (const TopoDS_Face& aFace, + gp_Pln& aPlane, + Handle(Geom_Surface)& aSurf, + PrsDim_KindOfSurface& aSurfType, + Standard_Real& Offset) { Standard_Boolean Result = Standard_False; @@ -801,10 +800,9 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace, if (surf2->GetType() == GeomAbs_Plane) { aPlane = surf2->Plane(); - aSurfType = AIS_KOS_Plane; + aSurfType = PrsDim_KOS_Plane; Result = Standard_True; } - else if (surf2->GetType() == GeomAbs_SurfaceOfExtrusion) { Handle( Adaptor3d_HCurve ) BasisCurve = surf2->BasisCurve(); @@ -816,7 +814,7 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace, gp_Pnt LinePos = BasisLine.Location(); gp_Pln thePlane( LinePos, LineDir ^ ExtrusionDir); aPlane = thePlane; - aSurfType = AIS_KOS_Plane; + aSurfType = PrsDim_KOS_Plane; Result = Standard_True; } } @@ -836,29 +834,29 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace, TheType == STANDARD_TYPE(Geom_SphericalSurface) || TheType == STANDARD_TYPE(Geom_ToroidalSurface)) { - aSurf = (Handle( Geom_OffsetSurface )::DownCast( aSurf ))->Surface(); + aSurf = Handle(Geom_OffsetSurface)::DownCast(aSurf)->Surface(); } else { - Offset = (Handle( Geom_OffsetSurface )::DownCast( aSurf ))->Offset(); - aSurf = (Handle( Geom_OffsetSurface )::DownCast( aSurf ))->BasisSurface(); + Offset = Handle(Geom_OffsetSurface)::DownCast(aSurf)->Offset(); + aSurf = Handle(Geom_OffsetSurface)::DownCast(aSurf)->BasisSurface(); } } Handle( Standard_Type ) TheType = aSurf->DynamicType(); if (TheType == STANDARD_TYPE(Geom_CylindricalSurface)) - aSurfType = AIS_KOS_Cylinder; + aSurfType = PrsDim_KOS_Cylinder; else if (TheType == STANDARD_TYPE(Geom_ConicalSurface)) - aSurfType = AIS_KOS_Cone; + aSurfType = PrsDim_KOS_Cone; else if (TheType == STANDARD_TYPE(Geom_SphericalSurface)) - aSurfType = AIS_KOS_Sphere; + aSurfType = PrsDim_KOS_Sphere; else if (TheType == STANDARD_TYPE(Geom_ToroidalSurface)) - aSurfType = AIS_KOS_Torus; + aSurfType = PrsDim_KOS_Torus; else if (TheType == STANDARD_TYPE(Geom_SurfaceOfRevolution)) - aSurfType = AIS_KOS_Revolution; + aSurfType = PrsDim_KOS_Revolution; else if (TheType == STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion)) - aSurfType = AIS_KOS_Extrusion; + aSurfType = PrsDim_KOS_Extrusion; else - aSurfType = AIS_KOS_OtherSurface; + aSurfType = PrsDim_KOS_OtherSurface; } return Result; } @@ -869,7 +867,7 @@ Standard_Boolean AIS::GetPlaneFromFace(const TopoDS_Face& aFace, //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 Normal = aPlane.Axis().Direction(); @@ -883,7 +881,7 @@ gp_Pnt AIS::ProjectPointOnPlane( const gp_Pnt & aPoint, const gp_Pln & aPlane ) //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 LinDir = aLine.Direction().XYZ(); @@ -896,13 +894,13 @@ gp_Pnt AIS::ProjectPointOnLine( const gp_Pnt & aPoint, const gp_Lin & aLine ) //function : InitFaceLength //purpose : //======================================================================= -void AIS::InitFaceLength (const TopoDS_Face& theFace, - gp_Pln& thePlane, - Handle(Geom_Surface)& theSurface, - AIS_KindOfSurface& theSurfaceType, - Standard_Real& theOffset) +void PrsDim::InitFaceLength (const TopoDS_Face& theFace, + gp_Pln& thePlane, + Handle(Geom_Surface)& theSurface, + PrsDim_KindOfSurface& theSurfaceType, + Standard_Real& theOffset) { - if (AIS::GetPlaneFromFace (theFace, thePlane, theSurface, theSurfaceType, theOffset) + if (PrsDim::GetPlaneFromFace (theFace, thePlane, theSurface, theSurfaceType, theOffset) && Abs (theOffset) > Precision::Confusion()) { theSurface = new Geom_OffsetSurface (theSurface, theOffset); @@ -914,12 +912,12 @@ void AIS::InitFaceLength (const TopoDS_Face& theFace, //function : InitAngleBetweenPlanarFaces //purpose : //======================================================================= -Standard_Boolean AIS::InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace, - gp_Pnt & theCenter, - gp_Pnt & theFirstAttach, - gp_Pnt & theSecondAttach, - const Standard_Boolean theIsFirstPointSet) +Standard_Boolean PrsDim::InitAngleBetweenPlanarFaces (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace, + gp_Pnt& theCenter, + gp_Pnt& theFirstAttach, + gp_Pnt& theSecondAttach, + const Standard_Boolean theIsFirstPointSet) { Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (BRep_Tool::Surface (theFirstFace)); Handle(Geom_Plane) aSecondPlane = Handle(Geom_Plane)::DownCast (BRep_Tool::Surface (theSecondFace)); @@ -998,14 +996,14 @@ Standard_Boolean AIS::InitAngleBetweenPlanarFaces (const TopoDS_Face& t //function : InitAngleBetweenCurvilinearFaces //purpose : //======================================================================= -Standard_Boolean AIS::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_Boolean PrsDim::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) { Handle(Geom_Surface) aFirstSurf = BRep_Tool::Surface (theFirstFace); Handle(Geom_Surface) aSecondSurf = BRep_Tool::Surface (theSecondFace); @@ -1048,7 +1046,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& 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); @@ -1059,7 +1057,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& 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); @@ -1100,7 +1098,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& // theFirstAttach should be on theFirstSurf. Standard_Real anU, aV; - if (theFirstSurfType == AIS_KOS_Cylinder) + if (theFirstSurfType == PrsDim_KOS_Cylinder) { ElSLib::Parameters ((Handle(Geom_CylindricalSurface)::DownCast (aFirstSurf))->Cylinder(), theFirstAttach, anU, aV); @@ -1108,7 +1106,7 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& theFirstAttach = ElSLib::Value (aFirstU, aV, (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(), theFirstAttach, anU, aV); @@ -1144,13 +1142,13 @@ Standard_Boolean AIS::InitAngleBetweenCurvilinearFaces (const TopoDS_Face& //function : ComputeLengthBetweenCurvilinearFaces //purpose : //======================================================================= -void AIS::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) +void PrsDim::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) { GeomAPI_ProjectPointOnSurf aProjector; Standard_Real aPU, aPV; @@ -1168,7 +1166,7 @@ void AIS::InitLengthBetweenCurvilinearFaces (const TopoDS_Face& theFirstFace, if (aD1U.SquareMagnitude() <= SquareTolerance || aD1V.SquareMagnitude() <= SquareTolerance) { - theFirstAttach = AIS::Farest (theFirstFace, theFirstAttach); + theFirstAttach = PrsDim::Farest (theFirstFace, theFirstAttach); aProjector.Init (theFirstAttach, theFirstSurf); aProjector.LowerDistanceParameters (aPU, aPV); 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) { - 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 )) return aPoint; @@ -1274,7 +1272,7 @@ gp_Pnt AIS::TranslatePointToBound( const gp_Pnt & aPoint, const gp_Dir & aDir, c //purpose : //======================================================================= -Standard_Boolean AIS::InDomain(const Standard_Real fpar, +Standard_Boolean PrsDim::InDomain(const Standard_Real fpar, const Standard_Real lpar, const Standard_Real para) { @@ -1303,7 +1301,7 @@ Standard_Boolean AIS::InDomain(const Standard_Real fpar, //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 Standard_Real par) { @@ -1351,7 +1349,7 @@ Standard_Real AIS::DistanceFromApex(const gp_Elips & elips, //purpose : //======================================================================= -gp_Pnt AIS::NearestApex(const gp_Elips & elips, +gp_Pnt PrsDim::NearestApex(const gp_Elips & elips, const gp_Pnt & pApex, const gp_Pnt & nApex, const Standard_Real fpara, @@ -1387,16 +1385,16 @@ gp_Pnt AIS::NearestApex(const gp_Elips & elips, //purpose : //======================================================================= -void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresentation, - 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, - const Standard_Real aWidth, - const Aspect_TypeOfLine aProjTOL, - const Aspect_TypeOfLine aCallTOL) +void PrsDim::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresentation, + 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, + const Standard_Real aWidth, + const Aspect_TypeOfLine aProjTOL, + const Aspect_TypeOfLine aCallTOL) { if (!aDrawer->HasOwnWireAspect()){ aDrawer->SetWireAspect(new Prs3d_LineAspect(aColor,aProjTOL,2.));} @@ -1490,14 +1488,14 @@ void AIS::ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPresen //purpose : //======================================================================= -void AIS::ComputeProjVertexPresentation (const Handle( Prs3d_Presentation )& aPresentation, - const Handle( Prs3d_Drawer )& aDrawer, - const TopoDS_Vertex& aVertex, - const gp_Pnt& ProjPoint, - const Quantity_NameOfColor aColor, - const Standard_Real aWidth, - const Aspect_TypeOfMarker aProjTOM, - const Aspect_TypeOfLine aCallTOL) +void PrsDim::ComputeProjVertexPresentation (const Handle( Prs3d_Presentation )& aPresentation, + const Handle( Prs3d_Drawer )& aDrawer, + const TopoDS_Vertex& aVertex, + const gp_Pnt& ProjPoint, + const Quantity_NameOfColor aColor, + const Standard_Real aWidth, + const Aspect_TypeOfMarker aProjTOM, + const Aspect_TypeOfLine aCallTOL) { if (!aDrawer->HasOwnPointAspect()){ aDrawer->SetPointAspect(new Prs3d_PointAspect(aProjTOM, aColor,1));} diff --git a/src/PrsDim/PrsDim.hxx b/src/PrsDim/PrsDim.hxx new file mode 100644 index 0000000000..c865cb71af --- /dev/null +++ b/src/PrsDim/PrsDim.hxx @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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 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 . + //! 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 in the current WorkingPlane + //! and the extremities if any. + //! If is not in the current plane, contains + //! the not projected curve associated to . + //! If is infinite, = true and the 2 + //! parameters and 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 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 and 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 and 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 + //! =1 or of the 2nd edge if = 2. If + //! = 0, ExtCurve is Null. if there is an edge + //! external to the plane, 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 diff --git a/src/AIS/AIS_AngleDimension.cxx b/src/PrsDim/PrsDim_AngleDimension.cxx similarity index 81% rename from src/AIS/AIS_AngleDimension.cxx rename to src/PrsDim/PrsDim_AngleDimension.cxx index f55900bba9..41702f5268 100644 --- a/src/AIS/AIS_AngleDimension.cxx +++ b/src/PrsDim/PrsDim_AngleDimension.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include -#include +#include #include #include #include @@ -52,8 +52,7 @@ #include #include - -IMPLEMENT_STANDARD_RTTIEXT(AIS_AngleDimension,AIS_Dimension) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_AngleDimension, PrsDim_Dimension) namespace { @@ -78,9 +77,9 @@ namespace //function : Constructor //purpose : //======================================================================= -AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Edge& theFirstEdge, - const TopoDS_Edge& theSecondEdge) -: AIS_Dimension (AIS_KOD_PLANEANGLE) +PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Edge& theFirstEdge, + const TopoDS_Edge& theSecondEdge) +: PrsDim_Dimension (PrsDim_KOD_PLANEANGLE) { Init(); SetMeasuredGeometry (theFirstEdge, theSecondEdge); @@ -90,10 +89,10 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Edge& theFirstEdge, //function : Constructor //purpose : //======================================================================= -AIS_AngleDimension::AIS_AngleDimension (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const gp_Pnt& theThirdPoint) -: AIS_Dimension (AIS_KOD_PLANEANGLE) +PrsDim_AngleDimension::PrsDim_AngleDimension (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const gp_Pnt& theThirdPoint) +: PrsDim_Dimension (PrsDim_KOD_PLANEANGLE) { Init(); SetMeasuredGeometry (theFirstPoint, theSecondPoint, theThirdPoint); @@ -103,10 +102,10 @@ AIS_AngleDimension::AIS_AngleDimension (const gp_Pnt& theFirstPoint, //function : Constructor //purpose : //======================================================================= -AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Vertex& theFirstVertex, - const TopoDS_Vertex& theSecondVertex, - const TopoDS_Vertex& theThirdVertex) -: AIS_Dimension (AIS_KOD_PLANEANGLE) +PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Vertex& theFirstVertex, + const TopoDS_Vertex& theSecondVertex, + const TopoDS_Vertex& theThirdVertex) +: PrsDim_Dimension (PrsDim_KOD_PLANEANGLE) { Init(); SetMeasuredGeometry (theFirstVertex, theSecondVertex, theThirdVertex); @@ -116,8 +115,8 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Vertex& theFirstVertex, //function : Constructor //purpose : //======================================================================= -AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theCone) -: AIS_Dimension (AIS_KOD_PLANEANGLE) +PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Face& theCone) +: PrsDim_Dimension (PrsDim_KOD_PLANEANGLE) { Init(); SetMeasuredGeometry (theCone); @@ -127,9 +126,9 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theCone) //function : Constructor //purpose : //======================================================================= -AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace) -: AIS_Dimension (AIS_KOD_PLANEANGLE) +PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace) +: PrsDim_Dimension (PrsDim_KOD_PLANEANGLE) { Init(); SetMeasuredGeometry (theFirstFace, theSecondFace); @@ -139,10 +138,10 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace, //function : Constructor //purpose : //======================================================================= -AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace, - const gp_Pnt& thePoint) -: AIS_Dimension (AIS_KOD_PLANEANGLE) +PrsDim_AngleDimension::PrsDim_AngleDimension (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace, + const gp_Pnt& thePoint) +: PrsDim_Dimension (PrsDim_KOD_PLANEANGLE) { Init(); SetMeasuredGeometry (theFirstFace, theSecondFace, thePoint); @@ -152,8 +151,8 @@ AIS_AngleDimension::AIS_AngleDimension (const TopoDS_Face& theFirstFace, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge, - const TopoDS_Edge& theSecondEdge) +void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge, + const TopoDS_Edge& theSecondEdge) { gp_Pln aComputedPlane; @@ -175,9 +174,9 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_AngleDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const gp_Pnt& theThirdPoint) +void PrsDim_AngleDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const gp_Pnt& theThirdPoint) { myFirstPoint = theFirstPoint; myCenterPoint = theSecondPoint; @@ -201,9 +200,9 @@ void AIS_AngleDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Vertex& theFirstVertex, - const TopoDS_Vertex& theSecondVertex, - const TopoDS_Vertex& theThirdVertex) +void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Vertex& theFirstVertex, + const TopoDS_Vertex& theSecondVertex, + const TopoDS_Vertex& theThirdVertex) { myFirstShape = theFirstVertex; mySecondShape = theSecondVertex; @@ -227,7 +226,7 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Vertex& theFirstVerte //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone) +void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone) { myFirstShape = theCone; mySecondShape = TopoDS_Shape(); @@ -247,8 +246,8 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone) //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace) +void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace) { myFirstShape = theFirstFace; mySecondShape = theSecondFace; @@ -268,9 +267,9 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace, - const gp_Pnt& thePoint) +void PrsDim_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace, + const gp_Pnt& thePoint) { myFirstShape = theFirstFace; mySecondShape = theSecondFace; @@ -290,12 +289,12 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, //function : Init //purpose : //======================================================================= -void AIS_AngleDimension::Init() +void PrsDim_AngleDimension::Init() { - SetType (AIS_TOA_Interior); - SetArrowsVisibility (AIS_TOAV_Both); + SetType (PrsDim_TypeOfAngle_Interior); + SetArrowsVisibility (PrsDim_TypeOfAngleArrowVisibility_Both); SetSpecialSymbol (THE_DEGREE_SYMBOL); - SetDisplaySpecialSymbol (AIS_DSS_After); + SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_After); SetFlyout (15.0); } @@ -303,9 +302,9 @@ void AIS_AngleDimension::Init() //function: GetCenterOnArc //purpose : //======================================================================= -gp_Pnt AIS_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach, - const gp_Pnt& theSecondAttach, - const gp_Pnt& theCenter) const +gp_Pnt PrsDim_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach, + const gp_Pnt& theSecondAttach, + const gp_Pnt& theCenter) const { // construct plane where the circle and the arc are located gce_MakePln aConstructPlane (theFirstAttach, theSecondAttach, theCenter); @@ -316,7 +315,7 @@ gp_Pnt AIS_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach, gp_Pln aPlane = aConstructPlane.Value(); // 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_Dir aDir = anAxis.Direction(); @@ -347,7 +346,7 @@ gp_Pnt AIS_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach, //function : GetNormalForMinAngle //purpose : //======================================================================= -gp_Dir AIS_AngleDimension::GetNormalForMinAngle() const +gp_Dir PrsDim_AngleDimension::GetNormalForMinAngle() const { const gp_Dir& aNormal = myPlane.Axis().Direction(); gp_Dir aFirst (gp_Vec (myCenterPoint, myFirstPoint) ); @@ -362,17 +361,17 @@ gp_Dir AIS_AngleDimension::GetNormalForMinAngle() const //function : DrawArc //purpose : draws the arc between two attach points //======================================================================= -void AIS_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentation, - const gp_Pnt& theFirstAttach, - const gp_Pnt& theSecondAttach, - const gp_Pnt& theCenter, - const Standard_Real theRadius, - const Standard_Integer theMode) +void PrsDim_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentation, + const gp_Pnt& theFirstAttach, + const gp_Pnt& theSecondAttach, + const gp_Pnt& theCenter, + const Standard_Real theRadius, + const Standard_Integer theMode) { gp_Pln aPlane (myCenterPoint, GetNormalForMinAngle()); // 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_Dir aDir = anAxis.Direction(); @@ -405,7 +404,7 @@ void AIS_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentat gp_Vec aCenterToFirstVec (theCenter, theFirstAttach); gp_Vec aCenterToSecondVec (theCenter, theSecondAttach); Standard_Real anAngle = aCenterToFirstVec.Angle (aCenterToSecondVec); - if (myType == AIS_TOA_Exterior) + if (myType == PrsDim_TypeOfAngle_Exterior) anAngle = 2.0 * M_PI - anAngle; // 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)); @@ -449,14 +448,14 @@ void AIS_AngleDimension::DrawArc (const Handle(Prs3d_Presentation)& thePresentat //function: DrawArcWithText //purpose : //======================================================================= -void AIS_AngleDimension::DrawArcWithText (const Handle(Prs3d_Presentation)& thePresentation, - const gp_Pnt& theFirstAttach, - const gp_Pnt& theSecondAttach, - const gp_Pnt& theCenter, - const TCollection_ExtendedString& theText, - const Standard_Real theTextWidth, - const Standard_Integer theMode, - const Standard_Integer theLabelPosition) +void PrsDim_AngleDimension::DrawArcWithText (const Handle(Prs3d_Presentation)& thePresentation, + const gp_Pnt& theFirstAttach, + const gp_Pnt& theSecondAttach, + const gp_Pnt& theCenter, + const TCollection_ExtendedString& theText, + const Standard_Real theTextWidth, + const Standard_Integer theMode, + const Standard_Integer theLabelPosition) { gp_Pln aPlane (myCenterPoint, GetNormalForMinAngle()); @@ -532,7 +531,7 @@ void AIS_AngleDimension::DrawArcWithText (const Handle(Prs3d_Presentation)& theP //function : CheckPlane //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()) && !thePlane.Contains (mySecondPoint, Precision::Confusion()) && @@ -548,7 +547,7 @@ Standard_Boolean AIS_AngleDimension::CheckPlane (const gp_Pln& thePlane)const //function : ComputePlane //purpose : //======================================================================= -void AIS_AngleDimension::ComputePlane() +void PrsDim_AngleDimension::ComputePlane() { if (!myIsGeometryValid) { @@ -570,7 +569,7 @@ void AIS_AngleDimension::ComputePlane() //function : GetModelUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_AngleDimension::GetModelUnits() const +const TCollection_AsciiString& PrsDim_AngleDimension::GetModelUnits() const { return myDrawer->DimAngleModelUnits(); } @@ -579,7 +578,7 @@ const TCollection_AsciiString& AIS_AngleDimension::GetModelUnits() const //function : GetDisplayUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_AngleDimension::GetDisplayUnits() const +const TCollection_AsciiString& PrsDim_AngleDimension::GetDisplayUnits() const { return myDrawer->DimAngleDisplayUnits(); } @@ -588,7 +587,7 @@ const TCollection_AsciiString& AIS_AngleDimension::GetDisplayUnits() const //function : SetModelUnits //purpose : //======================================================================= -void AIS_AngleDimension::SetModelUnits (const TCollection_AsciiString& theUnits) +void PrsDim_AngleDimension::SetModelUnits (const TCollection_AsciiString& theUnits) { myDrawer->SetDimAngleModelUnits (theUnits); } @@ -597,7 +596,7 @@ void AIS_AngleDimension::SetModelUnits (const TCollection_AsciiString& theUnits) //function : SetDisplayUnits //purpose : //======================================================================= -void AIS_AngleDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) +void PrsDim_AngleDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) { myDrawer->SetDimAngleDisplayUnits (theUnits); } @@ -606,7 +605,7 @@ void AIS_AngleDimension::SetDisplayUnits (const TCollection_AsciiString& theUnit //function : ComputeValue //purpose : //======================================================================= -Standard_Real AIS_AngleDimension::ComputeValue() const +Standard_Real PrsDim_AngleDimension::ComputeValue() const { if (!IsValid()) { @@ -625,9 +624,9 @@ Standard_Real AIS_AngleDimension::ComputeValue() const //function : Compute //purpose : Having three gp_Pnt points compute presentation //======================================================================= -void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) +void PrsDim_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, + const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Integer theMode) { mySelectionGeom.Clear (theMode); @@ -740,8 +739,8 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* if (theMode == ComputeMode_All || theMode == ComputeMode_Line) { DrawArc (thePresentation, - (isArrowsExternal || !isArrowVisible(AIS_TOAV_First)) ? aFirstAttach : aFirstArrowEnd, - (isArrowsExternal || !isArrowVisible(AIS_TOAV_Second)) ? aSecondAttach : aSecondArrowEnd, + (isArrowsExternal || !isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First)) ? aFirstAttach : aFirstArrowEnd, + (isArrowsExternal || !isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second)) ? aSecondAttach : aSecondArrowEnd, myCenterPoint, Abs (GetFlyout()), theMode); @@ -753,7 +752,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* { DrawExtension (thePresentation, anExtensionSize, - (isArrowsExternal && isArrowVisible(AIS_TOAV_First)) ? aFirstArrowEnd : aFirstAttach, + (isArrowsExternal && isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First)) ? aFirstArrowEnd : aFirstAttach, aFirstExtensionDir, aLabelString, aLabelWidth, @@ -766,7 +765,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* { DrawExtension (thePresentation, anExtensionSize, - (isArrowsExternal && isArrowVisible(AIS_TOAV_Second)) ? aSecondArrowEnd : aSecondAttach, + (isArrowsExternal && isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second)) ? aSecondArrowEnd : aSecondAttach, aSecondExtensionDir, aLabelString, aLabelWidth, @@ -782,8 +781,8 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* Prs3d_Root::NewGroup (thePresentation); DrawArc (thePresentation, - (isArrowsExternal || !isArrowVisible(AIS_TOAV_First)) ? aFirstAttach : aFirstArrowEnd, - (isArrowsExternal || !isArrowVisible(AIS_TOAV_Second)) ? aSecondAttach : aSecondArrowEnd, + (isArrowsExternal || !isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First)) ? aFirstAttach : aFirstArrowEnd, + (isArrowsExternal || !isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second)) ? aSecondAttach : aSecondArrowEnd, myCenterPoint, Abs(GetFlyout ()), theMode); @@ -794,9 +793,9 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* { Prs3d_Root::NewGroup (thePresentation); - if (isArrowVisible(AIS_TOAV_First)) + if (isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First)) DrawArrow (thePresentation, aFirstArrowBegin, gp_Dir (aFirstArrowVec)); - if (isArrowVisible(AIS_TOAV_Second)) + if (isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second)) DrawArrow (thePresentation, aSecondArrowBegin, gp_Dir (aSecondArrowVec)); } @@ -804,7 +803,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* { Prs3d_Root::NewGroup (thePresentation); - if (aHPosition != LabelPosition_Left && isArrowVisible(AIS_TOAV_First)) + if (aHPosition != LabelPosition_Left && isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_First)) { DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(), @@ -816,7 +815,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* LabelPosition_None); } - if (aHPosition != LabelPosition_Right && isArrowVisible(AIS_TOAV_Second)) + if (aHPosition != LabelPosition_Right && isArrowVisible(PrsDim_TypeOfAngleArrowVisibility_Second)) { DrawExtension (thePresentation, aDimensionAspect->ArrowTailSize(), @@ -852,8 +851,8 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /* //function : ComputeFlyoutSelection //purpose : computes selection for flyouts //======================================================================= -void AIS_AngleDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, - const Handle(SelectMgr_EntityOwner)& theOwner) +void PrsDim_AngleDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, + const Handle(SelectMgr_EntityOwner)& theOwner) { gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec (myCenterPoint, myFirstPoint).Normalized() * GetFlyout()); gp_Pnt aSecondAttach = myCenterPoint.Translated (gp_Vec (myCenterPoint, mySecondPoint).Normalized() * GetFlyout()); @@ -869,7 +868,7 @@ void AIS_AngleDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selectio //function : InitTwoEdgesAngle //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 aSecondEdge = TopoDS::Edge (mySecondShape); @@ -897,11 +896,11 @@ Standard_Boolean AIS_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPlane Standard_Boolean isInfinite1,isInfinite2; gp_Pnt aFirstPoint1, aLastPoint1, aFirstPoint2, aLastPoint2; Handle(Geom_Curve) aFirstCurve = aFirstLine, aSecondCurve = aSecondLine; - if (!AIS::ComputeGeometry (aFirstEdge, aSecondEdge, - aFirstCurve, aSecondCurve, - aFirstPoint1, aLastPoint1, - aFirstPoint2, aLastPoint2, - isInfinite1, isInfinite2)) + if (!PrsDim::ComputeGeometry (aFirstEdge, aSecondEdge, + aFirstCurve, aSecondCurve, + aFirstPoint1, aLastPoint1, + aFirstPoint2, aLastPoint2, + isInfinite1, isInfinite2)) { return Standard_False; } @@ -976,7 +975,7 @@ Standard_Boolean AIS_AngleDimension::InitTwoEdgesAngle (gp_Pln& theComputedPlane //function : InitTwoFacesAngle //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 aSecondFace = TopoDS::Face (mySecondShape); @@ -984,42 +983,31 @@ Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle() gp_Dir aFirstDir, aSecondDir; gp_Pln aFirstPln, aSecondPln; Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf; - AIS_KindOfSurface aFirstSurfType, aSecondSurfType; + PrsDim_KindOfSurface aFirstSurfType, aSecondSurfType; Standard_Real aFirstOffset, aSecondOffset; - AIS::GetPlaneFromFace (aFirstFace, aFirstPln, - aFirstBasisSurf,aFirstSurfType,aFirstOffset); + PrsDim::GetPlaneFromFace (aFirstFace, aFirstPln, + aFirstBasisSurf,aFirstSurfType,aFirstOffset); - AIS::GetPlaneFromFace (aSecondFace, aSecondPln, - aSecondBasisSurf, aSecondSurfType, aSecondOffset); + PrsDim::GetPlaneFromFace (aSecondFace, aSecondPln, + aSecondBasisSurf, aSecondSurfType, aSecondOffset); - if (aFirstSurfType == AIS_KOS_Plane && aSecondSurfType == AIS_KOS_Plane) + if (aFirstSurfType == PrsDim_KOS_Plane && aSecondSurfType == PrsDim_KOS_Plane) { //Planar faces angle Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (aFirstBasisSurf); Handle(Geom_Plane) aSecondPlane = Handle(Geom_Plane)::DownCast (aSecondBasisSurf); - return AIS::InitAngleBetweenPlanarFaces (aFirstFace, - aSecondFace, - myCenterPoint, - myFirstPoint, - mySecondPoint) - && IsValidPoints (myFirstPoint, - myCenterPoint, - mySecondPoint); + return PrsDim::InitAngleBetweenPlanarFaces (aFirstFace, aSecondFace, + myCenterPoint, myFirstPoint, mySecondPoint) + && IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint); } else { // Curvilinear faces angle - return AIS::InitAngleBetweenCurvilinearFaces (aFirstFace, - aSecondFace, - aFirstSurfType, - aSecondSurfType, - myCenterPoint, - myFirstPoint, - mySecondPoint) - && IsValidPoints (myFirstPoint, - myCenterPoint, - mySecondPoint); + return PrsDim::InitAngleBetweenCurvilinearFaces (aFirstFace, aSecondFace, + aFirstSurfType, aSecondSurfType, + myCenterPoint, myFirstPoint, mySecondPoint) + && IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint); } } @@ -1027,7 +1015,7 @@ Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle() //function : InitTwoFacesAngle //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 aSecondFace = TopoDS::Face (mySecondShape); @@ -1035,45 +1023,34 @@ Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle (const gp_Pnt thePointOnF gp_Dir aFirstDir, aSecondDir; gp_Pln aFirstPln, aSecondPln; Handle(Geom_Surface) aFirstBasisSurf, aSecondBasisSurf; - AIS_KindOfSurface aFirstSurfType, aSecondSurfType; + PrsDim_KindOfSurface aFirstSurfType, aSecondSurfType; Standard_Real aFirstOffset, aSecondOffset; - AIS::GetPlaneFromFace (aFirstFace, aFirstPln, - aFirstBasisSurf,aFirstSurfType,aFirstOffset); + PrsDim::GetPlaneFromFace (aFirstFace, aFirstPln, + aFirstBasisSurf,aFirstSurfType,aFirstOffset); - AIS::GetPlaneFromFace (aSecondFace, aSecondPln, - aSecondBasisSurf, aSecondSurfType, aSecondOffset); + PrsDim::GetPlaneFromFace (aSecondFace, aSecondPln, + aSecondBasisSurf, aSecondSurfType, aSecondOffset); myFirstPoint = thePointOnFirstFace; - if (aFirstSurfType == AIS_KOS_Plane && aSecondSurfType == AIS_KOS_Plane) + if (aFirstSurfType == PrsDim_KOS_Plane && aSecondSurfType == PrsDim_KOS_Plane) { //Planar faces angle Handle(Geom_Plane) aFirstPlane = Handle(Geom_Plane)::DownCast (aFirstBasisSurf); Handle(Geom_Plane) aSecondPlane = Handle(Geom_Plane)::DownCast (aSecondBasisSurf); - return AIS::InitAngleBetweenPlanarFaces (aFirstFace, - aSecondFace, - myCenterPoint, - myFirstPoint, - mySecondPoint, - Standard_True) - && IsValidPoints (myFirstPoint, - myCenterPoint, - mySecondPoint); + return PrsDim::InitAngleBetweenPlanarFaces (aFirstFace, aSecondFace, + myCenterPoint, myFirstPoint, mySecondPoint, + Standard_True) + && IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint); } else { // Curvilinear faces angle - return AIS::InitAngleBetweenCurvilinearFaces (aFirstFace, - aSecondFace, - aFirstSurfType, - aSecondSurfType, - myCenterPoint, - myFirstPoint, - mySecondPoint, - Standard_True) - && IsValidPoints (myFirstPoint, - myCenterPoint, - mySecondPoint); + return PrsDim::InitAngleBetweenCurvilinearFaces (aFirstFace, aSecondFace, + aFirstSurfType, aSecondSurfType, + myCenterPoint, myFirstPoint, mySecondPoint, + Standard_True) + && IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint); } } @@ -1081,7 +1058,7 @@ Standard_Boolean AIS_AngleDimension::InitTwoFacesAngle (const gp_Pnt thePointOnF //function : InitConeAngle //purpose : initialization of the cone angle //======================================================================= -Standard_Boolean AIS_AngleDimension::InitConeAngle() +Standard_Boolean PrsDim_AngleDimension::InitConeAngle() { if (myFirstShape.IsNull()) { @@ -1100,16 +1077,14 @@ Standard_Boolean AIS_AngleDimension::InitConeAngle() Handle(Geom_Line) aLine; BRepAdaptor_Surface aConeAdaptor (aConeShape); TopoDS_Face aFace; - AIS_KindOfSurface aSurfType; + PrsDim_KindOfSurface aSurfType; Standard_Real anOffset = 0.; Handle(Standard_Type) aType; - Standard_Real aMaxV = aConeAdaptor.FirstVParameter(); - Standard_Real aMinV = aConeAdaptor.LastVParameter(); - - AIS::GetPlaneFromFace (aConeShape, aPln, aSurf, aSurfType, anOffset); - - if (aSurfType == AIS_KOS_Revolution) + const Standard_Real aMaxV = aConeAdaptor.FirstVParameter(); + const Standard_Real aMinV = aConeAdaptor.LastVParameter(); + PrsDim::GetPlaneFromFace (aConeShape, aPln, aSurf, aSurfType, anOffset); + if (aSurfType == PrsDim_KOS_Revolution) { // Surface of revolution aRevSurf = Handle(Geom_SurfaceOfRevolution)::DownCast(aSurf); @@ -1185,9 +1160,9 @@ Standard_Boolean AIS_AngleDimension::InitConeAngle() //function : IsValidPoints //purpose : //======================================================================= -Standard_Boolean AIS_AngleDimension::IsValidPoints (const gp_Pnt& theFirstPoint, - const gp_Pnt& theCenterPoint, - const gp_Pnt& theSecondPoint) const +Standard_Boolean PrsDim_AngleDimension::IsValidPoints (const gp_Pnt& theFirstPoint, + const gp_Pnt& theCenterPoint, + const gp_Pnt& theSecondPoint) const { return theFirstPoint.Distance (theCenterPoint) > Precision::Confusion() && theSecondPoint.Distance (theCenterPoint) > Precision::Confusion() @@ -1199,17 +1174,17 @@ Standard_Boolean AIS_AngleDimension::IsValidPoints (const gp_Pnt& theFirstPoint, //function : isArrowVisible //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) { - case AIS_TOAV_Both: - return myArrowsVisibility == AIS_TOAV_Both; - case AIS_TOAV_First: - return myArrowsVisibility == AIS_TOAV_Both || myArrowsVisibility == AIS_TOAV_First; - case AIS_TOAV_Second: - return myArrowsVisibility == AIS_TOAV_Both || myArrowsVisibility == AIS_TOAV_Second; - case AIS_TOAV_None: + case PrsDim_TypeOfAngleArrowVisibility_Both: + return myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_Both; + case PrsDim_TypeOfAngleArrowVisibility_First: + return myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_Both || myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_First; + case PrsDim_TypeOfAngleArrowVisibility_Second: + return myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_Both || myArrowsVisibility == PrsDim_TypeOfAngleArrowVisibility_Second; + case PrsDim_TypeOfAngleArrowVisibility_None: return false; } return false; @@ -1219,7 +1194,7 @@ Standard_Boolean AIS_AngleDimension::isArrowVisible(const AIS_TypeOfAngleArrowVi //function : GetTextPosition //purpose : //======================================================================= -const gp_Pnt AIS_AngleDimension::GetTextPosition() const +gp_Pnt PrsDim_AngleDimension::GetTextPosition() const { if (!IsValid()) { @@ -1290,7 +1265,7 @@ const gp_Pnt AIS_AngleDimension::GetTextPosition() const //function : SetTextPosition //purpose : //======================================================================= -void AIS_AngleDimension::SetTextPosition (const gp_Pnt& theTextPos) +void PrsDim_AngleDimension::SetTextPosition (const gp_Pnt& theTextPos) { if (!IsValid()) { @@ -1311,10 +1286,10 @@ void AIS_AngleDimension::SetTextPosition (const gp_Pnt& theTextPos) //function : AdjustParameters //purpose : //======================================================================= -void AIS_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos, - Standard_Real& theExtensionSize, - Prs3d_DimensionTextHorizontalPosition& theAlignment, - Standard_Real& theFlyout) const +void PrsDim_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos, + Standard_Real& theExtensionSize, + Prs3d_DimensionTextHorizontalPosition& theAlignment, + Standard_Real& theFlyout) const { Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect(); Standard_Real anArrowLength = aDimensionAspect->ArrowAspect()->Length(); @@ -1369,8 +1344,8 @@ void AIS_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos, // Text on the extensions gp_Lin aFirstLine = gce_MakeLin (myCenterPoint, myFirstPoint); gp_Lin aSecondLine = gce_MakeLin (myCenterPoint, mySecondPoint); - gp_Pnt aFirstTextProj = AIS::Nearest (aFirstLine, theTextPos); - gp_Pnt aSecondTextProj = AIS::Nearest (aSecondLine, theTextPos); + gp_Pnt aFirstTextProj = PrsDim::Nearest (aFirstLine, theTextPos); + gp_Pnt aSecondTextProj = PrsDim::Nearest (aSecondLine, theTextPos); Standard_Real aFirstDist = aFirstTextProj.Distance (theTextPos); Standard_Real aSecondDist = aSecondTextProj.Distance (theTextPos); @@ -1408,9 +1383,9 @@ void AIS_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos, //function : FitTextAlignment //purpose : //======================================================================= -void AIS_AngleDimension::FitTextAlignment (const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos, - Standard_Integer& theLabelPosition, - Standard_Boolean& theIsArrowsExternal) const +void PrsDim_AngleDimension::FitTextAlignment (const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos, + Standard_Integer& theLabelPosition, + Standard_Boolean& theIsArrowsExternal) const { Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect(); diff --git a/src/AIS/AIS_AngleDimension.hxx b/src/PrsDim/PrsDim_AngleDimension.hxx old mode 100755 new mode 100644 similarity index 85% rename from src/AIS/AIS_AngleDimension.hxx rename to src/PrsDim/PrsDim_AngleDimension.hxx index 7c9c1ce09f..b46ea7ab8f --- a/src/AIS/AIS_AngleDimension.hxx +++ b/src/PrsDim/PrsDim_AngleDimension.hxx @@ -12,16 +12,15 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_AngleDimension_HeaderFile -#define _AIS_AngleDimension_HeaderFile +#ifndef _PrsDim_AngleDimension_HeaderFile +#define _PrsDim_AngleDimension_HeaderFile -#include -#include -#include +#include +#include +#include #include #include -#include #include #include #include @@ -36,8 +35,7 @@ #include #include -class AIS_AngleDimension; -DEFINE_STANDARD_HANDLE (AIS_AngleDimension, AIS_Dimension) +DEFINE_STANDARD_HANDLE(PrsDim_AngleDimension, PrsDim_Dimension) //! Angle dimension. Can be constructed: //! - on two intersected edges. @@ -61,90 +59,72 @@ 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. //! The attachment points are points of the first and the last parameter of the basis circle of the cone. -//! -class AIS_AngleDimension : public AIS_Dimension +class PrsDim_AngleDimension : public PrsDim_Dimension { + DEFINE_STANDARD_RTTIEXT(PrsDim_AngleDimension, PrsDim_Dimension) public: //! 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. //! @param theFirstEdge [in] the first edge. //! @param theSecondEdge [in] the second edge. - Standard_EXPORT AIS_AngleDimension (const TopoDS_Edge& theFirstEdge, - const TopoDS_Edge& theSecondEdge); + Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Edge& theFirstEdge, + const TopoDS_Edge& theSecondEdge); //! Constructs the angle display object defined by three points. //! @param theFirstPoint [in] the first point (point on first angle flyout). //! @param theSecondPoint [in] the center point of angle dimension. //! @param theThirdPoint [in] the second point (point on second angle flyout). - Standard_EXPORT AIS_AngleDimension (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const gp_Pnt& theThirdPoint); + Standard_EXPORT PrsDim_AngleDimension (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const gp_Pnt& theThirdPoint); //! Constructs the angle display object defined by three vertices. //! @param theFirstVertex [in] the first vertex (vertex for first angle flyout). //! @param theSecondVertex [in] the center vertex of angle dimension. //! @param theThirdPoint [in] the second vertex (vertex for second angle flyout). - Standard_EXPORT AIS_AngleDimension (const TopoDS_Vertex& theFirstVertex, - const TopoDS_Vertex& theSecondVertex, - const TopoDS_Vertex& theThirdVertex); + Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Vertex& theFirstVertex, + const TopoDS_Vertex& theSecondVertex, + const TopoDS_Vertex& theThirdVertex); //! Constructs angle dimension for the cone 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. //! @param theFirstFace [in] the first face. //! @param theSecondFace [in] the second face. - Standard_EXPORT AIS_AngleDimension (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace); + Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace); //! Constructs angle dimension between two planar faces. //! @param theFirstFace [in] the first face. //! @param theSecondFace [in] the second face. //! @param thePoint [in] the point which the dimension plane should pass through. //! This point can lay on the one of the faces or not. - Standard_EXPORT AIS_AngleDimension (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace, - const gp_Pnt& thePoint); + Standard_EXPORT PrsDim_AngleDimension (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace, + const gp_Pnt& thePoint); public: //! @return first point forming the angle. - const gp_Pnt& FirstPoint() const - { - return myFirstPoint; - } + const gp_Pnt& FirstPoint() const { return myFirstPoint; } //! @return second point forming the angle. - const gp_Pnt& SecondPoint() const - { - return mySecondPoint; - } + const gp_Pnt& SecondPoint() const { return mySecondPoint; } //! @return center point forming the angle. - const gp_Pnt& CenterPoint() const - { - return myCenterPoint; - } + const gp_Pnt& CenterPoint() const { return myCenterPoint; } //! @return first argument shape. - const TopoDS_Shape& FirstShape() const - { - return myFirstShape; - } + const TopoDS_Shape& FirstShape() const { return myFirstShape; } //! @return second argument shape. - const TopoDS_Shape& SecondShape() const - { - return mySecondShape; - } + const TopoDS_Shape& SecondShape() const { return mySecondShape; } //! @return third argument shape. - const TopoDS_Shape& ThirdShape() const - { - return myThirdShape; - } + const TopoDS_Shape& ThirdShape() const { return myThirdShape; } public: @@ -208,37 +188,21 @@ public: //! - 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 const gp_Pnt GetTextPosition () const Standard_OVERRIDE; + Standard_EXPORT virtual gp_Pnt GetTextPosition () const Standard_OVERRIDE; //! Sets angle type. //! @param theType [in] the type value. - void SetType(const AIS_TypeOfAngle theType) - { - myType = theType; - } + void SetType (const PrsDim_TypeOfAngle theType) { myType = theType; } //! @return the current angle type. - AIS_TypeOfAngle GetType() const - { - return myType; - } + PrsDim_TypeOfAngle GetType() const { return myType; } //! Sets visible arrows type //! @param theType [in] the type of visibility of arrows. - void SetArrowsVisibility(const AIS_TypeOfAngleArrowVisibility& theType) - { - myArrowsVisibility = theType; - } + void SetArrowsVisibility (const PrsDim_TypeOfAngleArrowVisibility& theType) { myArrowsVisibility = theType; } //! @return the type of visibility of arrows. - AIS_TypeOfAngleArrowVisibility GetArrowsVisibility() const - { - return myArrowsVisibility; - } - -public: - - DEFINE_STANDARD_RTTIEXT(AIS_AngleDimension,AIS_Dimension) + PrsDim_TypeOfAngleArrowVisibility GetArrowsVisibility() const { return myArrowsVisibility; } protected: @@ -353,7 +317,7 @@ protected: //! It defines some kind of dimension positioning over the faces. //! @return TRUE if the angular dimension can be constructed //! 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. //! @return TRUE if the angular dimension can be constructed @@ -372,11 +336,11 @@ protected: //! Returns true if the arrow should be visible //! @param theArrowType an arrow type //! @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: - AIS_TypeOfAngle myType; //!< type of angle - AIS_TypeOfAngleArrowVisibility myArrowsVisibility; //!< type of arrows visibility + PrsDim_TypeOfAngle myType; //!< type of angle + PrsDim_TypeOfAngleArrowVisibility myArrowsVisibility; //!< type of arrows visibility gp_Pnt myFirstPoint; gp_Pnt mySecondPoint; @@ -386,4 +350,4 @@ private: TopoDS_Shape myThirdShape; }; -#endif // _AIS_AngleDimension_HeaderFile +#endif // _PrsDim_AngleDimension_HeaderFile diff --git a/src/AIS/AIS_Chamf2dDimension.cxx b/src/PrsDim/PrsDim_Chamf2dDimension.cxx similarity index 90% rename from src/AIS/AIS_Chamf2dDimension.cxx rename to src/PrsDim/PrsDim_Chamf2dDimension.cxx index d9c59829af..854b41720c 100644 --- a/src/AIS/AIS_Chamf2dDimension.cxx +++ b/src/PrsDim/PrsDim_Chamf2dDimension.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -49,17 +48,17 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_Chamf2dDimension,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Chamf2dDimension, PrsDim_Relation) //======================================================================= //function : Constructor //purpose : //======================================================================= -AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, +PrsDim_Chamf2dDimension::PrsDim_Chamf2dDimension(const TopoDS_Shape& aFShape, const Handle(Geom_Plane)& aPlane, const Standard_Real aVal, const TCollection_ExtendedString& aText) -:AIS_Relation() +:PrsDim_Relation() { myFShape = aFShape; myPlane = aPlane; @@ -74,14 +73,14 @@ AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, //function : Constructor //purpose : //======================================================================= -AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, +PrsDim_Chamf2dDimension::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) -:AIS_Relation() +:PrsDim_Relation() { myFShape = aFShape; myPlane = aPlane; @@ -99,14 +98,14 @@ AIS_Chamf2dDimension::AIS_Chamf2dDimension(const TopoDS_Shape& aFShape, //purpose : //======================================================================= -void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , +void PrsDim_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer) { Handle(Geom_Curve) gcurv; gp_Pnt pfirst,plast; const TopoDS_Edge& thechamfedge = TopoDS::Edge(myFShape); - if (!AIS::ComputeGeometry (thechamfedge, gcurv, pfirst, plast)) + if (!PrsDim::ComputeGeometry (thechamfedge, gcurv, pfirst, plast)) return; 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; Handle(Geom_Line) glinnext; - if (!AIS::ComputeGeometry(nextedge,glinnext,pfirstnext,plastnext) ) + if (!PrsDim::ComputeGeometry(nextedge,glinnext,pfirstnext,plastnext) ) return; gp_Vec v1(pfirst,plast); @@ -152,7 +151,7 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , curpos = myPntAttach.Translated(transVec); if (myIsSetBndBox) - curpos = AIS::TranslatePointToBound( curpos, myDir, myBndBox ); + curpos = PrsDim::TranslatePointToBound( curpos, myDir, myBndBox ); myPosition = curpos; } @@ -208,7 +207,7 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , //purpose : //======================================================================= -void AIS_Chamf2dDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_Chamf2dDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer) { Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); diff --git a/src/AIS/AIS_Chamf2dDimension.hxx b/src/PrsDim/PrsDim_Chamf2dDimension.hxx similarity index 59% rename from src/AIS/AIS_Chamf2dDimension.hxx rename to src/PrsDim/PrsDim_Chamf2dDimension.hxx index 0b145aeba1..3678d01773 100644 --- a/src/AIS/AIS_Chamf2dDimension.hxx +++ b/src/PrsDim/PrsDim_Chamf2dDimension.hxx @@ -14,56 +14,56 @@ // 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 +#ifndef _PrsDim_Chamf2dDimension_HeaderFile +#define _PrsDim_Chamf2dDimension_HeaderFile -#include -#include +#include +#include #include #include 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 chamfer is displayed with arrows and text. The text //! gives the length of the chamfer if it is a symmetrical //! 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: //! Constructs the display object for 2D chamfers. //! This object is defined by the face aFShape, the //! 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. //! This object is defined by the face aFShape, the plane //! aPlane, the dimension aVal, the position aPosition, //! the type of arrow aSymbolPrs with the size //! 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. - 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. - virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; + virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } 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; +private: + gp_Pnt myPntAttach; gp_Dir myDir; }; -#include - -#endif // _AIS_Chamf2dDimension_HeaderFile +#endif // _PrsDim_Chamf2dDimension_HeaderFile diff --git a/src/AIS/AIS_Chamf3dDimension.cxx b/src/PrsDim/PrsDim_Chamf3dDimension.cxx similarity index 90% rename from src/AIS/AIS_Chamf3dDimension.cxx rename to src/PrsDim/PrsDim_Chamf3dDimension.cxx index c3edce7187..d48146592e 100644 --- a/src/AIS/AIS_Chamf3dDimension.cxx +++ b/src/PrsDim/PrsDim_Chamf3dDimension.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -40,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -48,16 +46,16 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_Chamf3dDimension,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Chamf3dDimension, PrsDim_Relation) //======================================================================= //function : Constructor //purpose : //======================================================================= -AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, +PrsDim_Chamf3dDimension::PrsDim_Chamf3dDimension(const TopoDS_Shape& aFShape, const Standard_Real aVal, const TCollection_ExtendedString& aText) -:AIS_Relation() +:PrsDim_Relation() { myFShape = aFShape; myVal = aVal; @@ -71,13 +69,13 @@ AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, //function : Constructor //purpose : //======================================================================= -AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, +PrsDim_Chamf3dDimension::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) -:AIS_Relation() +:PrsDim_Relation() { myFShape = aFShape; myVal = aVal; @@ -94,7 +92,7 @@ AIS_Chamf3dDimension::AIS_Chamf3dDimension(const TopoDS_Shape& aFShape, //purpose : //======================================================================= -void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , +void PrsDim_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer) { @@ -130,7 +128,7 @@ void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , curpos = myPntAttach.Translated(transVec); if (myIsSetBndBox) - curpos = AIS::TranslatePointToBound( curpos, myDir, myBndBox ); + curpos = PrsDim::TranslatePointToBound( curpos, myDir, myBndBox ); myPosition = curpos; } @@ -182,7 +180,7 @@ void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , //purpose : //======================================================================= -void AIS_Chamf3dDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_Chamf3dDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer) { Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); diff --git a/src/AIS/AIS_Chamf3dDimension.hxx b/src/PrsDim/PrsDim_Chamf3dDimension.hxx similarity index 59% rename from src/AIS/AIS_Chamf3dDimension.hxx rename to src/PrsDim/PrsDim_Chamf3dDimension.hxx index d33117aa93..c23d9e13ce 100644 --- a/src/AIS/AIS_Chamf3dDimension.hxx +++ b/src/PrsDim/PrsDim_Chamf3dDimension.hxx @@ -14,54 +14,54 @@ // 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 +#ifndef _PrsDim_Chamf3dDimension_HeaderFile +#define _PrsDim_Chamf3dDimension_HeaderFile -#include -#include +#include +#include #include #include -DEFINE_STANDARD_HANDLE(AIS_Chamf3dDimension, AIS_Relation) +DEFINE_STANDARD_HANDLE(PrsDim_Chamf3dDimension, PrsDim_Relation) //! A framework to define display of 3D chamfers. //! A chamfer is displayed with arrows and text. The text //! gives the length of the chamfer if it is a symmetrical //! 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: //! Constructs a display object for 3D chamfers. //! This object is defined by the shape aFShape, the //! 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. //! This object is defined by the shape aFShape, the //! dimension aVal, the text aText, the point of origin of //! the chamfer aPosition, the type of arrow aSymbolPrs //! 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. - 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. - virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; + virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } 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; +private: + gp_Pnt myPntAttach; gp_Dir myDir; }; -#include - -#endif // _AIS_Chamf3dDimension_HeaderFile +#endif // _PrsDim_Chamf3dDimension_HeaderFile diff --git a/src/AIS/AIS_ConcentricRelation.cxx b/src/PrsDim/PrsDim_ConcentricRelation.cxx similarity index 83% rename from src/AIS/AIS_ConcentricRelation.cxx rename to src/PrsDim/PrsDim_ConcentricRelation.cxx index bf03ae487d..e759fab084 100644 --- a/src/AIS/AIS_ConcentricRelation.cxx +++ b/src/PrsDim/PrsDim_ConcentricRelation.cxx @@ -14,14 +14,13 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include #include -#include #include #include #include @@ -35,18 +34,17 @@ #include #include #include -#include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_ConcentricRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_ConcentricRelation, PrsDim_Relation) //======================================================================= //function : Constructor //purpose : //======================================================================= -AIS_ConcentricRelation::AIS_ConcentricRelation( +PrsDim_ConcentricRelation::PrsDim_ConcentricRelation( const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane) @@ -61,7 +59,7 @@ AIS_ConcentricRelation::AIS_ConcentricRelation( //function : Compute //purpose : //======================================================================= -void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, +void PrsDim_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer) { @@ -89,7 +87,7 @@ void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)& //function : ComputeTwoEdgesConcentric //purpose : //======================================================================= -void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Presentation)& aPresentation) +void PrsDim_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Presentation)& aPresentation) { TopoDS_Edge E; TopoDS_Vertex V; @@ -106,9 +104,9 @@ void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Pres Handle(Geom_Curve) extCurv; Standard_Boolean isInfinite; 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; - AIS::ComputeGeometry(V,P, myPlane, isOnPlanVertex); + PrsDim::ComputeGeometry(V,P, myPlane, isOnPlanVertex); Handle(Geom_Circle) CIRCLE (Handle(Geom_Circle)::DownCast (C)); myCenter = CIRCLE->Location(); @@ -117,38 +115,38 @@ void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Pres gp_Vec vectrans(vec); myPnt = myCenter.Translated(vectrans.Multiplied(myRad)); DsgPrs_ConcentricPresentation::Add(aPresentation,myDrawer,myCenter,myRad,myDir,myPnt); - if (!isOnPlanEdge) AIS::ComputeProjEdgePresentation(aPresentation,myDrawer,E,CIRCLE,p1,p2); - if (!isOnPlanVertex) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V,P); + if (!isOnPlanEdge) PrsDim::ComputeProjEdgePresentation(aPresentation,myDrawer,E,CIRCLE,p1,p2); + if (!isOnPlanVertex) PrsDim::ComputeProjVertexPresentation(aPresentation,myDrawer,V,P); } //======================================================================= //function : ComputeTwoEdgesConcentric //purpose : //======================================================================= -void AIS_ConcentricRelation::ComputeTwoVerticesConcentric(const Handle(Prs3d_Presentation)& aPresentation) +void PrsDim_ConcentricRelation::ComputeTwoVerticesConcentric(const Handle(Prs3d_Presentation)& aPresentation) { TopoDS_Vertex V1,V2; V1 = TopoDS::Vertex(myFShape); V2 = TopoDS::Vertex(myFShape); Standard_Boolean isOnPlanVertex1(Standard_True),isOnPlanVertex2(Standard_True); gp_Pnt P1,P2; - AIS::ComputeGeometry(V1,P1, myPlane,isOnPlanVertex1); - AIS::ComputeGeometry(V2,P2, myPlane,isOnPlanVertex2); + PrsDim::ComputeGeometry(V1,P1, myPlane,isOnPlanVertex1); + PrsDim::ComputeGeometry(V2,P2, myPlane,isOnPlanVertex2); myCenter = P1; myRad = 15.; gp_Dir vec(myPlane->Pln().Position().XDirection()); gp_Vec vectrans(vec); myPnt = myCenter.Translated(vectrans.Multiplied(myRad)); DsgPrs_ConcentricPresentation::Add(aPresentation,myDrawer,myCenter,myRad,myDir,myPnt); - if (!isOnPlanVertex1) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V1,P1); - if (!isOnPlanVertex2) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V2,P2); + if (!isOnPlanVertex1) PrsDim::ComputeProjVertexPresentation(aPresentation,myDrawer,V1,P1); + if (!isOnPlanVertex2) PrsDim::ComputeProjVertexPresentation(aPresentation,myDrawer,V2,P2); } //======================================================================= //function : ComputeTwoEdgesConcentric //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 curv2(TopoDS::Edge(mySShape)); @@ -157,15 +155,11 @@ void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presen Handle(Geom_Curve) geom1,geom2; Standard_Boolean isInfinite1,isInfinite2; Handle(Geom_Curve) extCurv; - if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape), - TopoDS::Edge(mySShape), + if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), TopoDS::Edge(mySShape), myExtShape, - geom1, - geom2, - ptat11, - ptat12, - ptat21, - ptat22, + geom1, geom2, + ptat11, ptat12, + ptat21, ptat22, extCurv, isInfinite1,isInfinite2, myPlane)) { @@ -221,7 +215,7 @@ void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presen //purpose : //======================================================================= -void AIS_ConcentricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_ConcentricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer) { Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); diff --git a/src/AIS/AIS_ConcentricRelation.hxx b/src/PrsDim/PrsDim_ConcentricRelation.hxx similarity index 72% rename from src/AIS/AIS_ConcentricRelation.hxx rename to src/PrsDim/PrsDim_ConcentricRelation.hxx index 8bcbccf309..f9c67126df 100644 --- a/src/AIS/AIS_ConcentricRelation.hxx +++ b/src/PrsDim/PrsDim_ConcentricRelation.hxx @@ -14,24 +14,24 @@ // 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 +#ifndef _PrsDim_ConcentricRelation_HeaderFile +#define _PrsDim_ConcentricRelation_HeaderFile -#include +#include #include 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 //! concentricity between two or more interactive datums. //! The display of this constraint is also defined. //! A plane is used to create an axis along which the //! 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: //! Constructs the display object for concentric relations @@ -40,11 +40,11 @@ public: //! and aSShape and the plane aPlane. //! aPlane is provided to create an axis along which the //! relation of concentricity can be extended. - Standard_EXPORT AIS_ConcentricRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane); + Standard_EXPORT PrsDim_ConcentricRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane); 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); @@ -54,6 +54,8 @@ private: Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; +private: + gp_Pnt myCenter; Standard_Real myRad; gp_Dir myDir; @@ -61,4 +63,4 @@ private: }; -#endif // _AIS_ConcentricRelation_HeaderFile +#endif // _PrsDim_ConcentricRelation_HeaderFile diff --git a/src/AIS/AIS_DiameterDimension.cxx b/src/PrsDim/PrsDim_DiameterDimension.cxx similarity index 77% rename from src/AIS/AIS_DiameterDimension.cxx rename to src/PrsDim/PrsDim_DiameterDimension.cxx index d9da0eac9c..c86a4474ec 100644 --- a/src/AIS/AIS_DiameterDimension.cxx +++ b/src/PrsDim/PrsDim_DiameterDimension.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include -#include +#include #include #include #include @@ -25,8 +25,7 @@ #include #include - -IMPLEMENT_STANDARD_RTTIEXT(AIS_DiameterDimension,AIS_Dimension) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_DiameterDimension, PrsDim_Dimension) namespace { @@ -37,12 +36,12 @@ namespace //function : Constructor //purpose : //======================================================================= -AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle) -: AIS_Dimension (AIS_KOD_DIAMETER) +PrsDim_DiameterDimension::PrsDim_DiameterDimension (const gp_Circ& theCircle) +: PrsDim_Dimension (PrsDim_KOD_DIAMETER) { SetMeasuredGeometry (theCircle); SetSpecialSymbol (THE_DIAMETER_SYMBOL); - SetDisplaySpecialSymbol (AIS_DSS_Before); + SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before); SetFlyout (0.0); } @@ -50,14 +49,14 @@ AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle) //function : Constructor //purpose : //======================================================================= -AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle, - const gp_Pln& thePlane) -: AIS_Dimension (AIS_KOD_DIAMETER) +PrsDim_DiameterDimension::PrsDim_DiameterDimension (const gp_Circ& theCircle, + const gp_Pln& thePlane) +: PrsDim_Dimension (PrsDim_KOD_DIAMETER) { SetCustomPlane (thePlane); SetMeasuredGeometry (theCircle); SetSpecialSymbol (THE_DIAMETER_SYMBOL); - SetDisplaySpecialSymbol (AIS_DSS_Before); + SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before); SetFlyout (0.0); } @@ -65,12 +64,12 @@ AIS_DiameterDimension::AIS_DiameterDimension (const gp_Circ& theCircle, //function : Constructor //purpose : //======================================================================= -AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape) -: AIS_Dimension (AIS_KOD_DIAMETER) +PrsDim_DiameterDimension::PrsDim_DiameterDimension (const TopoDS_Shape& theShape) +: PrsDim_Dimension (PrsDim_KOD_DIAMETER) { SetMeasuredGeometry (theShape); SetSpecialSymbol (THE_DIAMETER_SYMBOL); - SetDisplaySpecialSymbol (AIS_DSS_Before); + SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before); SetFlyout (0.0); } @@ -78,14 +77,14 @@ AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape) //function : Constructor //purpose : //======================================================================= -AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape, - const gp_Pln& thePlane) -: AIS_Dimension (AIS_KOD_DIAMETER) +PrsDim_DiameterDimension::PrsDim_DiameterDimension (const TopoDS_Shape& theShape, + const gp_Pln& thePlane) +: PrsDim_Dimension (PrsDim_KOD_DIAMETER) { SetCustomPlane (thePlane); SetMeasuredGeometry (theShape); SetSpecialSymbol (THE_DIAMETER_SYMBOL); - SetDisplaySpecialSymbol (AIS_DSS_Before); + SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before); SetFlyout (0.0); } @@ -93,7 +92,7 @@ AIS_DiameterDimension::AIS_DiameterDimension (const TopoDS_Shape& theShape, //function : AnchorPoint //purpose : //======================================================================= -gp_Pnt AIS_DiameterDimension::AnchorPoint() +gp_Pnt PrsDim_DiameterDimension::AnchorPoint() { if (!IsValid()) { @@ -107,7 +106,7 @@ gp_Pnt AIS_DiameterDimension::AnchorPoint() //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_DiameterDimension::SetMeasuredGeometry (const gp_Circ& theCircle) +void PrsDim_DiameterDimension::SetMeasuredGeometry (const gp_Circ& theCircle) { myCircle = theCircle; myGeometryType = GeometryType_Edge; @@ -132,7 +131,7 @@ void AIS_DiameterDimension::SetMeasuredGeometry (const gp_Circ& theCircle) //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_DiameterDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape) +void PrsDim_DiameterDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape) { gp_Pnt aDummyPnt (gp::Origin()); Standard_Boolean isClosed = Standard_False; @@ -161,7 +160,7 @@ void AIS_DiameterDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape) //function : CheckPlane //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. if (!thePlane.Contains (myCircle.Location(), Precision::Confusion())) @@ -176,7 +175,7 @@ Standard_Boolean AIS_DiameterDimension::CheckPlane (const gp_Pln& thePlane) cons //function : ComputePlane //purpose : //======================================================================= -void AIS_DiameterDimension::ComputePlane() +void PrsDim_DiameterDimension::ComputePlane() { if (!myIsGeometryValid) { @@ -190,7 +189,7 @@ void AIS_DiameterDimension::ComputePlane() //function : ComputeAnchorPoint //purpose : //======================================================================= -void AIS_DiameterDimension::ComputeAnchorPoint() +void PrsDim_DiameterDimension::ComputeAnchorPoint() { // Anchor point is an intersection of dimension plane and circle. Handle(Geom_Circle) aCircle = new Geom_Circle (myCircle); @@ -228,7 +227,7 @@ void AIS_DiameterDimension::ComputeAnchorPoint() //function : GetModelUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_DiameterDimension::GetModelUnits() const +const TCollection_AsciiString& PrsDim_DiameterDimension::GetModelUnits() const { return myDrawer->DimLengthModelUnits(); } @@ -237,7 +236,7 @@ const TCollection_AsciiString& AIS_DiameterDimension::GetModelUnits() const //function : GetDisplayUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_DiameterDimension::GetDisplayUnits() const +const TCollection_AsciiString& PrsDim_DiameterDimension::GetDisplayUnits() const { return myDrawer->DimLengthDisplayUnits(); } @@ -246,7 +245,7 @@ const TCollection_AsciiString& AIS_DiameterDimension::GetDisplayUnits() const //function : SetModelUnits //purpose : //======================================================================= -void AIS_DiameterDimension::SetModelUnits (const TCollection_AsciiString& theUnits) +void PrsDim_DiameterDimension::SetModelUnits (const TCollection_AsciiString& theUnits) { myDrawer->SetDimLengthModelUnits (theUnits); } @@ -255,7 +254,7 @@ void AIS_DiameterDimension::SetModelUnits (const TCollection_AsciiString& theUni //function : SetDisplayUnits //purpose : //======================================================================= -void AIS_DiameterDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) +void PrsDim_DiameterDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) { myDrawer->SetDimLengthDisplayUnits (theUnits); } @@ -264,7 +263,7 @@ void AIS_DiameterDimension::SetDisplayUnits (const TCollection_AsciiString& theU //function : ComputeValue //purpose : //======================================================================= -Standard_Real AIS_DiameterDimension::ComputeValue() const +Standard_Real PrsDim_DiameterDimension::ComputeValue() const { if (!IsValid()) { @@ -278,9 +277,9 @@ Standard_Real AIS_DiameterDimension::ComputeValue() const //function : Compute //purpose : //======================================================================= -void AIS_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) +void PrsDim_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, + const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Integer theMode) { mySelectionGeom.Clear (theMode); @@ -300,8 +299,8 @@ void AIS_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& //function : ComputeFlyoutSelection //purpose : //======================================================================= -void AIS_DiameterDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, - const Handle(SelectMgr_EntityOwner)& theEntityOwner) +void PrsDim_DiameterDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, + const Handle(SelectMgr_EntityOwner)& theEntityOwner) { if (!IsValid()) { @@ -319,9 +318,9 @@ void AIS_DiameterDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selec //function : ComputeSidePoints //purpose : //======================================================================= -void AIS_DiameterDimension::ComputeSidePoints (const gp_Circ& theCircle, - gp_Pnt& theFirstPnt, - gp_Pnt& theSecondPnt) +void PrsDim_DiameterDimension::ComputeSidePoints (const gp_Circ& theCircle, + gp_Pnt& theFirstPnt, + gp_Pnt& theSecondPnt) { theFirstPnt = AnchorPoint(); @@ -333,7 +332,7 @@ void AIS_DiameterDimension::ComputeSidePoints (const gp_Circ& theCircle, //function : IsValidCircle //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(); } @@ -342,8 +341,8 @@ Standard_Boolean AIS_DiameterDimension::IsValidCircle (const gp_Circ& theCircle) //function : IsValidAnchor //purpose : //======================================================================= -Standard_Boolean AIS_DiameterDimension::IsValidAnchor (const gp_Circ& theCircle, - const gp_Pnt& theAnchor) const +Standard_Boolean PrsDim_DiameterDimension::IsValidAnchor (const gp_Circ& theCircle, + const gp_Pnt& theAnchor) const { gp_Pln aCirclePlane (theCircle.Location(), theCircle.Axis().Direction()); Standard_Real anAnchorDist = theAnchor.Distance (theCircle.Location()); @@ -357,7 +356,7 @@ Standard_Boolean AIS_DiameterDimension::IsValidAnchor (const gp_Circ& theCircle, //function : GetTextPosition //purpose : //======================================================================= -const gp_Pnt AIS_DiameterDimension::GetTextPosition() const +gp_Pnt PrsDim_DiameterDimension::GetTextPosition() const { if (IsTextPositionCustom()) { @@ -372,7 +371,7 @@ const gp_Pnt AIS_DiameterDimension::GetTextPosition() const //function : GetTextPosition //purpose : //======================================================================= -void AIS_DiameterDimension::SetTextPosition (const gp_Pnt& theTextPos) +void PrsDim_DiameterDimension::SetTextPosition (const gp_Pnt& theTextPos) { if (!IsValid()) { diff --git a/src/AIS/AIS_DiameterDimension.hxx b/src/PrsDim/PrsDim_DiameterDimension.hxx similarity index 87% rename from src/AIS/AIS_DiameterDimension.hxx rename to src/PrsDim/PrsDim_DiameterDimension.hxx index 0217edb23b..7fb2e1beb7 100644 --- a/src/AIS/AIS_DiameterDimension.hxx +++ b/src/PrsDim/PrsDim_DiameterDimension.hxx @@ -12,20 +12,17 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#ifndef _PrsDim_DiameterDimension_HeaderFile +#define _PrsDim_DiameterDimension_HeaderFile -#ifndef _AIS_DiameterDimension_HeaderFile -#define _AIS_DiameterDimension_HeaderFile - -#include -#include +#include #include #include #include #include #include -class AIS_DiameterDimension; -DEFINE_STANDARD_HANDLE (AIS_DiameterDimension, AIS_Dimension) +DEFINE_STANDARD_HANDLE(PrsDim_DiameterDimension, PrsDim_Dimension) //! Diameter dimension. Can be constructued: //! - 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(). //! 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. -//! -class AIS_DiameterDimension : public AIS_Dimension +class PrsDim_DiameterDimension : public PrsDim_Dimension { + DEFINE_STANDARD_RTTIEXT(PrsDim_DiameterDimension, PrsDim_Dimension) public: //! Construct diameter dimension for the circle. //! @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 //! to the passed plane. //! @param theCircle [in] the circle to measure. //! @param thePlane [in] the plane defining preferred orientation //! for dimension. - Standard_EXPORT AIS_DiameterDimension (const gp_Circ& theCircle, - const gp_Pln& thePlane); + Standard_EXPORT PrsDim_DiameterDimension (const gp_Circ& theCircle, + const gp_Pln& thePlane); //! Construct diameter on the passed shape, if applicable. //! @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 //! define the preferred plane to orient the dimension. //! @param theShape [in] the shape to measure. //! @param thePlane [in] the plane defining preferred orientation //! for dimension. - Standard_EXPORT AIS_DiameterDimension (const TopoDS_Shape& theShape, - const gp_Pln& thePlane); + Standard_EXPORT PrsDim_DiameterDimension (const TopoDS_Shape& theShape, + const gp_Pln& thePlane); public: //! @return measured geometry circle. - const gp_Circ& Circle() const - { - return myCircle; - } + const gp_Circ& Circle() const { return myCircle; } //! @return anchor point on circle for diameter dimension. Standard_EXPORT gp_Pnt AnchorPoint(); //! @return the measured shape. - const TopoDS_Shape& Shape() const - { - return myShape; - } + const TopoDS_Shape& Shape() const { return myShape; } public: @@ -126,11 +117,7 @@ public: Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE; - Standard_EXPORT virtual const gp_Pnt GetTextPosition() const Standard_OVERRIDE; - -public: - - DEFINE_STANDARD_RTTIEXT(AIS_DiameterDimension,AIS_Dimension) + Standard_EXPORT virtual gp_Pnt GetTextPosition() const Standard_OVERRIDE; protected: @@ -182,4 +169,4 @@ private: TopoDS_Shape myShape; }; -#endif // _AIS_DiameterDimension_HeaderFile +#endif // _PrsDim_DiameterDimension_HeaderFile diff --git a/src/AIS/AIS_Dimension.cxx b/src/PrsDim/PrsDim_Dimension.cxx old mode 100755 new mode 100644 similarity index 87% rename from src/AIS/AIS_Dimension.cxx rename to src/PrsDim/PrsDim_Dimension.cxx index 4fcfd6fdd3..17e989097f --- a/src/AIS/AIS_Dimension.cxx +++ b/src/PrsDim/PrsDim_Dimension.cxx @@ -13,10 +13,10 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include -#include -#include +#include +#include #include #include #include @@ -74,8 +74,7 @@ #include #include - -IMPLEMENT_STANDARD_RTTIEXT(AIS_Dimension,AIS_InteractiveObject) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Dimension, AIS_InteractiveObject) namespace { @@ -96,7 +95,7 @@ namespace //function : Constructor //purpose : //======================================================================= -AIS_Dimension::AIS_Dimension (const AIS_KindOfDimension theType) +PrsDim_Dimension::PrsDim_Dimension (const PrsDim_KindOfDimension theType) : AIS_InteractiveObject (), mySelToleranceForText2d(0.0), myValueType (ValueType_Computed), @@ -104,7 +103,7 @@ AIS_Dimension::AIS_Dimension (const AIS_KindOfDimension theType) myCustomStringValue (), myIsTextPositionFixed (Standard_False), mySpecialSymbol (' '), - myDisplaySpecialSymbol (AIS_DSS_No), + myDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_No), myGeometryType (GeometryType_UndefShapes), myIsPlaneCustom (Standard_False), myFlyout (0.0), @@ -117,7 +116,7 @@ AIS_Dimension::AIS_Dimension (const AIS_KindOfDimension theType) //function : SetCustomValue //purpose : //======================================================================= -void AIS_Dimension::SetCustomValue (const Standard_Real theValue) +void PrsDim_Dimension::SetCustomValue (const Standard_Real theValue) { if (myValueType == ValueType_CustomReal && myCustomValue == theValue) { @@ -134,7 +133,7 @@ void AIS_Dimension::SetCustomValue (const Standard_Real theValue) //function : SetCustomValue //purpose : //======================================================================= -void AIS_Dimension::SetCustomValue (const TCollection_ExtendedString& theValue) +void PrsDim_Dimension::SetCustomValue (const TCollection_ExtendedString& theValue) { if (myValueType == ValueType_CustomText && myCustomStringValue == theValue) { @@ -147,29 +146,11 @@ void AIS_Dimension::SetCustomValue (const TCollection_ExtendedString& theValue) 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 //purpose : //======================================================================= -void AIS_Dimension::SetCustomPlane (const gp_Pln& thePlane) +void PrsDim_Dimension::SetCustomPlane (const gp_Pln& thePlane) { myPlane = thePlane; myIsPlaneCustom = Standard_True; @@ -188,7 +169,7 @@ void AIS_Dimension::SetCustomPlane (const gp_Pln& thePlane) //function : SetDimensionAspect //purpose : //======================================================================= -void AIS_Dimension::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theDimensionAspect) +void PrsDim_Dimension::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theDimensionAspect) { myDrawer->SetDimensionAspect (theDimensionAspect); @@ -199,7 +180,7 @@ void AIS_Dimension::SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& the //function : SetDisplaySpecialSymbol //purpose : //======================================================================= -void AIS_Dimension::SetDisplaySpecialSymbol (const AIS_DisplaySpecialSymbol theDisplaySpecSymbol) +void PrsDim_Dimension::SetDisplaySpecialSymbol (const PrsDim_DisplaySpecialSymbol theDisplaySpecSymbol) { if (myDisplaySpecialSymbol == theDisplaySpecSymbol) { @@ -215,7 +196,7 @@ void AIS_Dimension::SetDisplaySpecialSymbol (const AIS_DisplaySpecialSymbol theD //function : SetSpecialSymbol //purpose : //======================================================================= -void AIS_Dimension::SetSpecialSymbol (const Standard_ExtCharacter theSpecialSymbol) +void PrsDim_Dimension::SetSpecialSymbol (const Standard_ExtCharacter theSpecialSymbol) { if (mySpecialSymbol == theSpecialSymbol) { @@ -231,7 +212,7 @@ void AIS_Dimension::SetSpecialSymbol (const Standard_ExtCharacter theSpecialSymb //function : SetSelToleranceForText2d //purpose : //======================================================================= -void AIS_Dimension::SetSelToleranceForText2d (const Standard_Real theTol) +void PrsDim_Dimension::SetSelToleranceForText2d (const Standard_Real theTol) { if (mySelToleranceForText2d == theTol) { @@ -247,7 +228,7 @@ void AIS_Dimension::SetSelToleranceForText2d (const Standard_Real theTol) //function : SetFlyout //purpose : //======================================================================= -void AIS_Dimension::SetFlyout (const Standard_Real theFlyout) +void PrsDim_Dimension::SetFlyout (const Standard_Real theFlyout) { if (myFlyout == theFlyout) { @@ -266,7 +247,7 @@ void AIS_Dimension::SetFlyout (const Standard_Real theFlyout) //function : GetDisplayUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_Dimension::GetDisplayUnits() const +const TCollection_AsciiString& PrsDim_Dimension::GetDisplayUnits() const { return THE_UNDEFINED_UNITS; } @@ -275,7 +256,7 @@ const TCollection_AsciiString& AIS_Dimension::GetDisplayUnits() const //function : GetModelUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_Dimension::GetModelUnits() const +const TCollection_AsciiString& PrsDim_Dimension::GetModelUnits() const { return THE_UNDEFINED_UNITS; } @@ -284,7 +265,7 @@ const TCollection_AsciiString& AIS_Dimension::GetModelUnits() const //function : ValueToDisplayUnits //purpose : //======================================================================= -Standard_Real AIS_Dimension::ValueToDisplayUnits() const +Standard_Real PrsDim_Dimension::ValueToDisplayUnits() const { return UnitsAPI::AnyToAny (GetValue(), GetModelUnits().ToCString(), @@ -295,7 +276,7 @@ Standard_Real AIS_Dimension::ValueToDisplayUnits() const //function : GetValueString //purpose : //======================================================================= -TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidth) const +TCollection_ExtendedString PrsDim_Dimension::GetValueString (Standard_Real& theWidth) const { TCollection_ExtendedString aValueStr; if (myValueType == ValueType_CustomText) @@ -321,9 +302,9 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt switch (myDisplaySpecialSymbol) { - case AIS_DSS_Before : aValueStr.Insert (1, mySpecialSymbol); break; - case AIS_DSS_After : aValueStr.Insert (aValueStr.Length() + 1, mySpecialSymbol); break; - case AIS_DSS_No : break; + case PrsDim_DisplaySpecialSymbol_Before: aValueStr.Insert (1, mySpecialSymbol); break; + case PrsDim_DisplaySpecialSymbol_After: aValueStr.Insert (aValueStr.Length() + 1, mySpecialSymbol); break; + case PrsDim_DisplaySpecialSymbol_No: break; } // Get text style parameters @@ -370,9 +351,9 @@ TCollection_ExtendedString AIS_Dimension::GetValueString (Standard_Real& theWidt //function : DrawArrow //purpose : //======================================================================= -void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation, - const gp_Pnt& theLocation, - const gp_Dir& theDirection) +void PrsDim_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation, + const gp_Pnt& theLocation, + const gp_Dir& theDirection) { Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup (thePresentation); @@ -426,11 +407,11 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation //function : drawText //purpose : //======================================================================= -void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation, - const gp_Pnt& theTextPos, - const gp_Dir& theTextDir, - const TCollection_ExtendedString& theText, - const Standard_Integer theLabelPosition) +void PrsDim_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation, + const gp_Pnt& theTextPos, + const gp_Dir& theTextDir, + const TCollection_ExtendedString& theText, + const Standard_Integer theLabelPosition) { Handle(Graphic3d_Group) aGroup = thePresentation->NewGroup(); if (myDrawer->DimensionAspect()->IsText3d()) @@ -585,14 +566,14 @@ void AIS_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentation, //function : DrawExtension //purpose : //======================================================================= -void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Real theExtensionSize, - const gp_Pnt& theExtensionStart, - const gp_Dir& theExtensionDir, - const TCollection_ExtendedString& theLabelString, - const Standard_Real theLabelWidth, - const Standard_Integer theMode, - const Standard_Integer theLabelPosition) +void PrsDim_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Real theExtensionSize, + const gp_Pnt& theExtensionStart, + const gp_Dir& theExtensionDir, + const TCollection_ExtendedString& theLabelString, + const Standard_Real theLabelWidth, + const Standard_Integer theMode, + const Standard_Integer theLabelPosition) { // reference line for extension starting at its connection point gp_Lin anExtensionLine (theExtensionStart, theExtensionDir); @@ -654,11 +635,11 @@ void AIS_Dimension::DrawExtension (const Handle(Prs3d_Presentation)& thePresenta //function : DrawLinearDimension //purpose : //======================================================================= -void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode, - const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const Standard_Boolean theIsOneSide) +void PrsDim_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Integer theMode, + const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const Standard_Boolean theIsOneSide) { // do not build any dimension for equal points if (theFirstPoint.IsEqual (theSecondPoint, Precision::Confusion())) @@ -1002,8 +983,8 @@ void AIS_Dimension::DrawLinearDimension (const Handle(Prs3d_Presentation)& thePr //function : ComputeFlyoutLinePoints //purpose : //======================================================================= -void AIS_Dimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint, - gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint) +void PrsDim_Dimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint, + gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint) { // compute dimension line points gp_Ax1 aPlaneNormal = GetPlane().Axis(); @@ -1023,10 +1004,10 @@ void AIS_Dimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const //function : ComputeLinearFlyouts //purpose : //======================================================================= -void AIS_Dimension::ComputeLinearFlyouts (const Handle(SelectMgr_Selection)& theSelection, - const Handle(SelectMgr_EntityOwner)& theOwner, - const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint) +void PrsDim_Dimension::ComputeLinearFlyouts (const Handle(SelectMgr_Selection)& theSelection, + const Handle(SelectMgr_EntityOwner)& theOwner, + const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint) { // count flyout direction gp_Ax1 aPlaneNormal = GetPlane().Axis(); @@ -1054,16 +1035,16 @@ void AIS_Dimension::ComputeLinearFlyouts (const Handle(SelectMgr_Selection)& the //function : CircleFromPlanarFace //purpose : if possible computes circle from planar face //======================================================================= -Standard_Boolean AIS_Dimension::CircleFromPlanarFace (const TopoDS_Face& theFace, - Handle(Geom_Curve)& theCurve, - gp_Pnt& theFirstPoint, - gp_Pnt& theLastPoint) +Standard_Boolean PrsDim_Dimension::CircleFromPlanarFace (const TopoDS_Face& theFace, + Handle(Geom_Curve)& theCurve, + gp_Pnt& theFirstPoint, + gp_Pnt& theLastPoint) { TopExp_Explorer anIt (theFace, TopAbs_EDGE); for ( ; anIt.More(); anIt.Next()) { 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))) { @@ -1078,10 +1059,10 @@ Standard_Boolean AIS_Dimension::CircleFromPlanarFace (const TopoDS_Face& theFace //function : CircleFromEdge //purpose : if possible computes circle from edge //======================================================================= -Standard_Boolean AIS_Dimension::CircleFromEdge (const TopoDS_Edge& theEdge, - gp_Circ& theCircle, - gp_Pnt& theFirstPoint, - gp_Pnt& theLastPoint) +Standard_Boolean PrsDim_Dimension::CircleFromEdge (const TopoDS_Edge& theEdge, + gp_Circ& theCircle, + gp_Pnt& theFirstPoint, + gp_Pnt& theLastPoint) { BRepAdaptor_Curve anAdaptedCurve (theEdge); switch (anAdaptedCurve.GetType()) @@ -1120,14 +1101,14 @@ Standard_Boolean AIS_Dimension::CircleFromEdge (const TopoDS_Edge& theEdge, //function : InitCircularDimension //purpose : //======================================================================= -Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theShape, - gp_Circ& theCircle, - gp_Pnt& theMiddleArcPoint, - Standard_Boolean& theIsClosed) +Standard_Boolean PrsDim_Dimension::InitCircularDimension (const TopoDS_Shape& theShape, + gp_Circ& theCircle, + gp_Pnt& theMiddleArcPoint, + Standard_Boolean& theIsClosed) { gp_Pln aPln; Handle(Geom_Surface) aBasisSurf; - AIS_KindOfSurface aSurfType = AIS_KOS_OtherSurface; + PrsDim_KindOfSurface aSurfType = PrsDim_KOS_OtherSurface; gp_Pnt aFirstPoint, aLastPoint; Standard_Real anOffset = 0.0; Standard_Real aFirstParam = 0.0; @@ -1138,9 +1119,9 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh { 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; 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); Handle (Adaptor3d_HCurve) aBasisCurve; Standard_Boolean isExpectedType = Standard_False; - if (aSurfType == AIS_KOS_Cylinder) + if (aSurfType == PrsDim_KOS_Cylinder) { isExpectedType = Standard_True; } else { - if (aSurfType == AIS_KOS_Revolution) + if (aSurfType == PrsDim_KOS_Revolution) { aBasisCurve = aSurf1.BasisCurve(); if (aBasisCurve->GetType() == GeomAbs_Line) @@ -1177,7 +1158,7 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh isExpectedType = Standard_True; } } - else if (aSurfType == AIS_KOS_Extrusion) + else if (aSurfType == PrsDim_KOS_Extrusion) { aBasisCurve = aSurf1.BasisCurve(); if (aBasisCurve->GetType() == GeomAbs_Circle) @@ -1230,7 +1211,7 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh { anEdge = TopoDS::Edge (anIt.Current()); } - if (!AIS_Dimension::CircleFromEdge (anEdge, theCircle, aFirstPoint, aLastPoint)) + if (!PrsDim_Dimension::CircleFromEdge (anEdge, theCircle, aFirstPoint, aLastPoint)) { return Standard_False; } @@ -1239,7 +1220,7 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh case TopAbs_EDGE: { 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; } @@ -1285,15 +1266,15 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh //function : ComputeSelection //purpose : //======================================================================= -void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, - const Standard_Integer theMode) +void PrsDim_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, + const Standard_Integer theMode) { if (!mySelectionGeom.IsComputed) { return; } - AIS_DimensionSelectionMode aSelectionMode = (AIS_DimensionSelectionMode)theMode; + PrsDim_DimensionSelectionMode aSelectionMode = (PrsDim_DimensionSelectionMode)theMode; // init appropriate entity owner Handle(SelectMgr_EntityOwner) aSensitiveOwner; @@ -1301,18 +1282,18 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele switch (aSelectionMode) { // neutral selection owner - case AIS_DSM_All : + case PrsDim_DimensionSelectionMode_All: aSensitiveOwner = new SelectMgr_EntityOwner (this, THE_NEUTRAL_SEL_PRIORITY); break; // local selection owners - case AIS_DSM_Line : - case AIS_DSM_Text : - aSensitiveOwner = new AIS_DimensionOwner (this, aSelectionMode, THE_LOCAL_SEL_PRIORITY); + case PrsDim_DimensionSelectionMode_Line: + case PrsDim_DimensionSelectionMode_Text: + aSensitiveOwner = new PrsDim_DimensionOwner (this, aSelectionMode, THE_LOCAL_SEL_PRIORITY); break; } - if (aSelectionMode == AIS_DSM_All || aSelectionMode == AIS_DSM_Line) + if (aSelectionMode == PrsDim_DimensionSelectionMode_All || aSelectionMode == PrsDim_DimensionSelectionMode_Line) { // sensitives for dimension line segments 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 - if (aSelectionMode == AIS_DSM_All || aSelectionMode == AIS_DSM_Text) + if (aSelectionMode == PrsDim_DimensionSelectionMode_All || aSelectionMode == PrsDim_DimensionSelectionMode_Text) { Handle(Select3D_SensitiveEntity) aTextSensitive; @@ -1415,7 +1396,7 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele } // callback for flyout sensitive calculation - if (aSelectionMode == AIS_DSM_All) + if (aSelectionMode == PrsDim_DimensionSelectionMode_All) { ComputeFlyoutSelection (theSelection, aSensitiveOwner); } @@ -1425,13 +1406,13 @@ void AIS_Dimension::ComputeSelection (const Handle(SelectMgr_Selection)& theSele //function : PointsForArrow //purpose : //======================================================================= -void AIS_Dimension::PointsForArrow (const gp_Pnt& thePeakPnt, - const gp_Dir& theDirection, - const gp_Dir& thePlane, - const Standard_Real theArrowLength, - const Standard_Real theArrowAngle, - gp_Pnt& theSidePnt1, - gp_Pnt& theSidePnt2) +void PrsDim_Dimension::PointsForArrow (const gp_Pnt& thePeakPnt, + const gp_Dir& theDirection, + const gp_Dir& thePlane, + const Standard_Real theArrowLength, + const Standard_Real theArrowAngle, + gp_Pnt& theSidePnt1, + gp_Pnt& theSidePnt2) { gp_Lin anArrowLin (thePeakPnt, theDirection.Reversed()); gp_Pnt anArrowEnd = ElCLib::Value (theArrowLength, anArrowLin); @@ -1447,9 +1428,9 @@ void AIS_Dimension::PointsForArrow (const gp_Pnt& thePeakPnt, //function : GetTextPositionForLinear //purpose : //======================================================================= -gp_Pnt AIS_Dimension::GetTextPositionForLinear (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const Standard_Boolean theIsOneSide) const +gp_Pnt PrsDim_Dimension::GetTextPositionForLinear (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const Standard_Boolean theIsOneSide) const { if (!IsValid()) { @@ -1522,14 +1503,14 @@ gp_Pnt AIS_Dimension::GetTextPositionForLinear (const gp_Pnt& theFirstPoint, //function : AdjustParametersForLinear //purpose : //======================================================================= -Standard_Boolean AIS_Dimension::AdjustParametersForLinear (const gp_Pnt& theTextPos, - const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - Standard_Real& theExtensionSize, - Prs3d_DimensionTextHorizontalPosition& theAlignment, - Standard_Real& theFlyout, - gp_Pln& thePlane, - Standard_Boolean& theIsPlaneOld) const +Standard_Boolean PrsDim_Dimension::AdjustParametersForLinear (const gp_Pnt& theTextPos, + const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + Standard_Real& theExtensionSize, + Prs3d_DimensionTextHorizontalPosition& theAlignment, + Standard_Real& theFlyout, + gp_Pln& thePlane, + Standard_Boolean& theIsPlaneOld) const { Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect(); Standard_Real anArrowLength = aDimensionAspect->ArrowAspect()->Length(); @@ -1605,12 +1586,12 @@ Standard_Boolean AIS_Dimension::AdjustParametersForLinear (const gp_Pnt& theText //function : FitTextAlignmentForLinear //purpose : //======================================================================= -void AIS_Dimension::FitTextAlignmentForLinear (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const Standard_Boolean theIsOneSide, - const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos, - Standard_Integer& theLabelPosition, - Standard_Boolean& theIsArrowsExternal) const +void PrsDim_Dimension::FitTextAlignmentForLinear (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const Standard_Boolean theIsOneSide, + const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos, + Standard_Integer& theLabelPosition, + Standard_Boolean& theIsArrowsExternal) const { theLabelPosition = LabelPosition_None; theIsArrowsExternal = Standard_False; @@ -1697,7 +1678,7 @@ void AIS_Dimension::FitTextAlignmentForLinear (const gp_Pnt& theFirstPoint, //function : UnsetFixedTextPosition //purpose : //======================================================================= -void AIS_Dimension::UnsetFixedTextPosition() +void PrsDim_Dimension::UnsetFixedTextPosition() { myIsTextPositionFixed = Standard_False; myFixedTextPosition = gp::Origin(); diff --git a/src/AIS/AIS_Dimension.hxx b/src/PrsDim/PrsDim_Dimension.hxx old mode 100755 new mode 100644 similarity index 95% rename from src/AIS/AIS_Dimension.hxx rename to src/PrsDim/PrsDim_Dimension.hxx index 6e923db2f8..769d015f59 --- a/src/AIS/AIS_Dimension.hxx +++ b/src/PrsDim/PrsDim_Dimension.hxx @@ -13,16 +13,16 @@ // 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 +#ifndef _PrsDim_Dimension_HeaderFile +#define _PrsDim_Dimension_HeaderFile -#include -#include -#include +#include +#include +#include #include #include -#include -#include +#include +#include #include #include #include @@ -42,10 +42,9 @@ #include #include -class AIS_Dimension; -DEFINE_STANDARD_HANDLE(AIS_Dimension, AIS_InteractiveObject) +DEFINE_STANDARD_HANDLE(PrsDim_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. //! //! 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 //! 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. //! //! 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 //! the text position is NOT fixed, and SetMeasureGeometry() without user-defined plane adjusts //! the automatic plane according input geometry (if it is possible). -//! -class AIS_Dimension : public AIS_InteractiveObject +class PrsDim_Dimension : public AIS_InteractiveObject { + DEFINE_STANDARD_RTTIEXT(PrsDim_Dimension, AIS_InteractiveObject) protected: //! Geometry type defines type of shapes on which the dimension is to be built. @@ -225,7 +224,7 @@ public: //! Constructor with default parameters values. //! @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 //! specified by user, then the dimension object is responsible to @@ -256,7 +255,7 @@ public: //! Gets user-defined dimension value. //! @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. //! 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 //! computing of the dimension presentation. //! @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. //! @return type of geometry on which the dimension will be built. @@ -297,7 +296,7 @@ public: //! Computes absolute text position from dimension parameters //! (flyout, plane and text alignment). - virtual const gp_Pnt GetTextPosition () const { return gp_Pnt(); } + virtual gp_Pnt GetTextPosition () const { return gp_Pnt(); } public: @@ -314,16 +313,10 @@ public: Standard_EXPORT void SetDimensionAspect (const Handle(Prs3d_DimensionAspect)& theDimensionAspect); //! @return the kind of dimension. - AIS_KindOfDimension KindOfDimension() const - { - return myKindOfDimension; - } + PrsDim_KindOfDimension KindOfDimension() const { return myKindOfDimension; } //! @return the kind of interactive. - virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE - { - return AIS_KOI_Dimension; - } + virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Dimension; } //! Returns true if the class of objects accepts the display mode theMode. //! The interactive context can have a default mode of representation for @@ -336,13 +329,10 @@ public: public: //! @return dimension special symbol display options. - AIS_DisplaySpecialSymbol DisplaySpecialSymbol() const - { - return myDisplaySpecialSymbol; - } + PrsDim_DisplaySpecialSymbol DisplaySpecialSymbol() const { return myDisplaySpecialSymbol; } //! 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. Standard_ExtCharacter SpecialSymbol() const @@ -398,10 +388,6 @@ public: return myIsGeometryValid && CheckPlane (GetPlane()); } -public: - - DEFINE_STANDARD_RTTIEXT(AIS_Dimension,AIS_InteractiveObject) - protected: Standard_EXPORT Standard_Real ValueToDisplayUnits() const; @@ -691,8 +677,8 @@ protected: //! @name Fixed text position properties protected: //! @name Units properties - Standard_ExtCharacter mySpecialSymbol; //!< Special symbol. - AIS_DisplaySpecialSymbol myDisplaySpecialSymbol; //!< Special symbol display options. + Standard_ExtCharacter mySpecialSymbol; //!< Special symbol. + PrsDim_DisplaySpecialSymbol myDisplaySpecialSymbol; //!< Special symbol display options. protected: //! @name Geometrical properties @@ -705,7 +691,7 @@ protected: //! @name Geometrical properties private: - AIS_KindOfDimension myKindOfDimension; + PrsDim_KindOfDimension myKindOfDimension; }; -#endif // _AIS_Dimension_HeaderFile +#endif // _PrsDim_Dimension_HeaderFile diff --git a/src/AIS/AIS_DimensionOwner.cxx b/src/PrsDim/PrsDim_DimensionOwner.cxx old mode 100755 new mode 100644 similarity index 60% rename from src/AIS/AIS_DimensionOwner.cxx rename to src/PrsDim/PrsDim_DimensionOwner.cxx index d0ae5acc0c..1a3f83103c --- a/src/AIS/AIS_DimensionOwner.cxx +++ b/src/PrsDim/PrsDim_DimensionOwner.cxx @@ -14,16 +14,16 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include -#include +#include #include #include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_DimensionOwner,SelectMgr_EntityOwner) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_DimensionOwner, SelectMgr_EntityOwner) namespace { @@ -31,14 +31,14 @@ namespace //function : HighlightMode //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) { - case AIS_DSM_Line : return AIS_Dimension::ComputeMode_Line; - case AIS_DSM_Text : return AIS_Dimension::ComputeMode_Text; + case PrsDim_DimensionSelectionMode_Line: return PrsDim_Dimension::ComputeMode_Line; + case PrsDim_DimensionSelectionMode_Text: return PrsDim_Dimension::ComputeMode_Text; default: - return AIS_Dimension::ComputeMode_All; + return PrsDim_Dimension::ComputeMode_All; } } } @@ -47,29 +47,20 @@ namespace //function : Constructor //purpose : //======================================================================= -AIS_DimensionOwner::AIS_DimensionOwner (const Handle(SelectMgr_SelectableObject)& theSelObject, - const AIS_DimensionSelectionMode theMode, - const Standard_Integer thePriority) +PrsDim_DimensionOwner::PrsDim_DimensionOwner (const Handle(SelectMgr_SelectableObject)& theSelObject, + const PrsDim_DimensionSelectionMode theMode, + const Standard_Integer thePriority) : SelectMgr_EntityOwner(theSelObject, thePriority), mySelectionMode (theMode) { } -//======================================================================= -//function : AIS_DimensionSelectionMode -//purpose : -//======================================================================= -AIS_DimensionSelectionMode AIS_DimensionOwner::SelectionMode () const -{ - return mySelectionMode; -} - //======================================================================= //function : IsHilighted //purpose : //======================================================================= -Standard_Boolean AIS_DimensionOwner::IsHilighted (const Handle(PrsMgr_PresentationManager)& thePM, - const Standard_Integer /*theMode*/) const +Standard_Boolean PrsDim_DimensionOwner::IsHilighted (const Handle(PrsMgr_PresentationManager)& thePM, + const Standard_Integer /*theMode*/) const { if (!HasSelectable()) { @@ -83,8 +74,8 @@ Standard_Boolean AIS_DimensionOwner::IsHilighted (const Handle(PrsMgr_Presentati //function : Unhilight //purpose : //======================================================================= -void AIS_DimensionOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& thePM, - const Standard_Integer /*theMode*/) +void PrsDim_DimensionOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& thePM, + const Standard_Integer /*theMode*/) { if (!HasSelectable()) { @@ -98,9 +89,9 @@ void AIS_DimensionOwner::Unhilight (const Handle(PrsMgr_PresentationManager)& th //function : HilightWithColor //purpose : //======================================================================= -void AIS_DimensionOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM, - const Handle(Prs3d_Drawer)& theStyle, - const Standard_Integer /*theMode*/) +void PrsDim_DimensionOwner::HilightWithColor (const Handle(PrsMgr_PresentationManager3d)& thePM, + const Handle(Prs3d_Drawer)& theStyle, + const Standard_Integer /*theMode*/) { thePM->Color (Selectable(), theStyle, HighlightMode (mySelectionMode)); } diff --git a/src/AIS/AIS_DimensionOwner.hxx b/src/PrsDim/PrsDim_DimensionOwner.hxx similarity index 80% rename from src/AIS/AIS_DimensionOwner.hxx rename to src/PrsDim/PrsDim_DimensionOwner.hxx index 1049791c7f..5ce4a42cea 100644 --- a/src/AIS/AIS_DimensionOwner.hxx +++ b/src/PrsDim/PrsDim_DimensionOwner.hxx @@ -14,13 +14,13 @@ // 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 +#ifndef _PrsDim_DimensionOwner_HeaderFile +#define _PrsDim_DimensionOwner_HeaderFile #include #include -#include +#include #include #include #include @@ -30,7 +30,7 @@ class SelectMgr_SelectableObject; 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 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 //! edge, could have priority 5, for example, and a face, //! 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: //! Initializes the dimension owner, theSO, and attributes it //! 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, const Handle(Prs3d_Drawer)& theStyle, @@ -67,7 +67,7 @@ public: private: - AIS_DimensionSelectionMode mySelectionMode; + PrsDim_DimensionSelectionMode mySelectionMode; }; diff --git a/src/AIS/AIS_DimensionSelectionMode.hxx b/src/PrsDim/PrsDim_DimensionSelectionMode.hxx similarity index 72% rename from src/AIS/AIS_DimensionSelectionMode.hxx rename to src/PrsDim/PrsDim_DimensionSelectionMode.hxx index e8c088499f..e519facce6 100644 --- a/src/AIS/AIS_DimensionSelectionMode.hxx +++ b/src/PrsDim/PrsDim_DimensionSelectionMode.hxx @@ -14,15 +14,15 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_DimensionSelectionMode_HeaderFile -#define _AIS_DimensionSelectionMode_HeaderFile +#ifndef _PrsDim_DimensionSelectionMode_HeaderFile +#define _PrsDim_DimensionSelectionMode_HeaderFile //! Specifies dimension selection modes. -enum AIS_DimensionSelectionMode +enum PrsDim_DimensionSelectionMode { -AIS_DSM_All, -AIS_DSM_Line, -AIS_DSM_Text + PrsDim_DimensionSelectionMode_All, + PrsDim_DimensionSelectionMode_Line, + PrsDim_DimensionSelectionMode_Text }; -#endif // _AIS_DimensionSelectionMode_HeaderFile +#endif // _PrsDim_DimensionSelectionMode_HeaderFile diff --git a/src/AIS/AIS_DisplaySpecialSymbol.hxx b/src/PrsDim/PrsDim_DisplaySpecialSymbol.hxx similarity index 73% rename from src/AIS/AIS_DisplaySpecialSymbol.hxx rename to src/PrsDim/PrsDim_DisplaySpecialSymbol.hxx index 6ba30a7422..edef53ae58 100644 --- a/src/AIS/AIS_DisplaySpecialSymbol.hxx +++ b/src/PrsDim/PrsDim_DisplaySpecialSymbol.hxx @@ -14,15 +14,15 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_DisplaySpecialSymbol_HeaderFile -#define _AIS_DisplaySpecialSymbol_HeaderFile +#ifndef _PrsDim_DisplaySpecialSymbol_HeaderFile +#define _PrsDim_DisplaySpecialSymbol_HeaderFile //! Specifies dimension special symbol display options -enum AIS_DisplaySpecialSymbol +enum PrsDim_DisplaySpecialSymbol { -AIS_DSS_No, -AIS_DSS_Before, -AIS_DSS_After + PrsDim_DisplaySpecialSymbol_No, + PrsDim_DisplaySpecialSymbol_Before, + PrsDim_DisplaySpecialSymbol_After }; -#endif // _AIS_DisplaySpecialSymbol_HeaderFile +#endif // _PrsDim_DisplaySpecialSymbol_HeaderFile diff --git a/src/AIS/AIS_EllipseRadiusDimension.cxx b/src/PrsDim/PrsDim_EllipseRadiusDimension.cxx similarity index 80% rename from src/AIS/AIS_EllipseRadiusDimension.cxx rename to src/PrsDim/PrsDim_EllipseRadiusDimension.cxx index a5ed32f77d..59262acf5e 100644 --- a/src/AIS/AIS_EllipseRadiusDimension.cxx +++ b/src/PrsDim/PrsDim_EllipseRadiusDimension.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -40,21 +40,20 @@ #include #include #include -#include #include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_EllipseRadiusDimension,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_EllipseRadiusDimension, PrsDim_Relation) //======================================================================= -//function : AIS_EllipseRadiusDimension +//function : PrsDim_EllipseRadiusDimension //purpose : //======================================================================= -AIS_EllipseRadiusDimension::AIS_EllipseRadiusDimension(const TopoDS_Shape& aShape, +PrsDim_EllipseRadiusDimension::PrsDim_EllipseRadiusDimension(const TopoDS_Shape& aShape, const TCollection_ExtendedString& aText) -:AIS_Relation() +:PrsDim_Relation() { myFShape = aShape; myText = aText; @@ -66,7 +65,7 @@ AIS_EllipseRadiusDimension::AIS_EllipseRadiusDimension(const TopoDS_Shape& aShap //purpose : //======================================================================= -void AIS_EllipseRadiusDimension::ComputeGeometry() +void PrsDim_EllipseRadiusDimension::ComputeGeometry() { switch (myFShape.ShapeType()) { @@ -95,20 +94,20 @@ void AIS_EllipseRadiusDimension::ComputeGeometry() //purpose : //======================================================================= -void AIS_EllipseRadiusDimension::ComputeFaceGeometry() +void PrsDim_EllipseRadiusDimension::ComputeFaceGeometry() { gp_Pln aPln; Handle( Geom_Surface ) aBasisSurf; - AIS_KindOfSurface aSurfType; + PrsDim_KindOfSurface aSurfType; Standard_Real Offset; - AIS::GetPlaneFromFace( TopoDS::Face( myFShape), + PrsDim::GetPlaneFromFace( TopoDS::Face( myFShape), aPln, aBasisSurf, aSurfType, Offset ) ; - if ( aSurfType == AIS_KOS_Plane ) + if ( aSurfType == PrsDim_KOS_Plane ) ComputePlanarFaceGeometry( ); else ComputeCylFaceGeometry( aSurfType, aBasisSurf, Offset ); @@ -120,7 +119,7 @@ void AIS_EllipseRadiusDimension::ComputeFaceGeometry() //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 Standard_Real Offset) { @@ -133,7 +132,7 @@ void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface gp_Pln aPlane; gp_Ax1 Axis; // Standard_Real Param; - if (aSurfType == AIS_KOS_Extrusion) + if (aSurfType == PrsDim_KOS_Extrusion) { Axis.SetDirection((Handle( Geom_SurfaceOfLinearExtrusion )::DownCast( aBasisSurf )) ->Direction() ); @@ -164,7 +163,7 @@ void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface } else { - throw Standard_ConstructionError("AIS:: Not expected type of surface") ; + throw Standard_ConstructionError("PrsDim:: Not expected type of surface") ; return; } @@ -174,7 +173,7 @@ void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface { 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; } @@ -199,7 +198,7 @@ void AIS_EllipseRadiusDimension::ComputeCylFaceGeometry(const AIS_KindOfSurface //purpose : //======================================================================= -void AIS_EllipseRadiusDimension::ComputePlanarFaceGeometry() +void PrsDim_EllipseRadiusDimension::ComputePlanarFaceGeometry() { Standard_Boolean find = Standard_False; @@ -210,7 +209,7 @@ void AIS_EllipseRadiusDimension::ComputePlanarFaceGeometry() TopoDS_Edge curedge = TopoDS::Edge( ExploEd.Current() ); Handle(Geom_Curve) curv; 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)) { @@ -225,7 +224,7 @@ void AIS_EllipseRadiusDimension::ComputePlanarFaceGeometry() } 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; } @@ -243,18 +242,16 @@ void AIS_EllipseRadiusDimension::ComputePlanarFaceGeometry() } - - //======================================================================= //function : ComputeEdgeGeometry //purpose : //======================================================================= -void AIS_EllipseRadiusDimension::ComputeEdgeGeometry() +void PrsDim_EllipseRadiusDimension::ComputeEdgeGeometry() { gp_Pnt ptfirst,ptend; 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); if ( elips.IsNull()) return; @@ -274,20 +271,3 @@ void AIS_EllipseRadiusDimension::ComputeEdgeGeometry() 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; -} diff --git a/src/AIS/AIS_EllipseRadiusDimension.hxx b/src/PrsDim/PrsDim_EllipseRadiusDimension.hxx similarity index 59% rename from src/AIS/AIS_EllipseRadiusDimension.hxx rename to src/PrsDim/PrsDim_EllipseRadiusDimension.hxx index cb04856c3b..d7f0eee586 100644 --- a/src/AIS/AIS_EllipseRadiusDimension.hxx +++ b/src/PrsDim/PrsDim_EllipseRadiusDimension.hxx @@ -14,52 +14,39 @@ // 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 -#include +#ifndef _PrsDim_EllipseRadiusDimension_HeaderFile +#define _PrsDim_EllipseRadiusDimension_HeaderFile #include -#include -#include -#include -#include -#include +#include +#include + class Geom_OffsetCurve; class TopoDS_Shape; class TCollection_ExtendedString; class Geom_Surface; - -class AIS_EllipseRadiusDimension; -DEFINE_STANDARD_HANDLE(AIS_EllipseRadiusDimension, AIS_Relation) - +DEFINE_STANDARD_HANDLE(PrsDim_EllipseRadiusDimension, PrsDim_Relation) //! Computes geometry ( basis curve and plane of dimension) //! for input shape aShape from TopoDS //! 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: + virtual PrsDim_KindOfDimension KindOfDimension() const Standard_OVERRIDE { return PrsDim_KOD_ELLIPSERADIUS; } - Standard_EXPORT virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE; - - Standard_EXPORT virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; + virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } Standard_EXPORT void ComputeGeometry(); - - - - DEFINE_STANDARD_RTTIEXT(AIS_EllipseRadiusDimension,AIS_Relation) - protected: - - Standard_EXPORT AIS_EllipseRadiusDimension(const TopoDS_Shape& aShape, const TCollection_ExtendedString& aText); + Standard_EXPORT PrsDim_EllipseRadiusDimension(const TopoDS_Shape& aShape, const TCollection_ExtendedString& aText); + +protected: gp_Elips myEllipse; Standard_Real myFirstPar; @@ -69,26 +56,16 @@ protected: Standard_Real myOffset; Standard_Boolean myIsOffset; - private: - 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 ComputeEdgeGeometry(); - - }; - - - - - - -#endif // _AIS_EllipseRadiusDimension_HeaderFile +#endif // _PrsDim_EllipseRadiusDimension_HeaderFile diff --git a/src/AIS/AIS_EqualDistanceRelation.cxx b/src/PrsDim/PrsDim_EqualDistanceRelation.cxx similarity index 87% rename from src/AIS/AIS_EqualDistanceRelation.cxx rename to src/PrsDim/PrsDim_EqualDistanceRelation.cxx index 39fbb700ca..72c2868c3b 100644 --- a/src/AIS/AIS_EqualDistanceRelation.cxx +++ b/src/PrsDim/PrsDim_EqualDistanceRelation.cxx @@ -14,9 +14,10 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include +#include #include #include #include @@ -27,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -42,23 +42,22 @@ #include #include #include -#include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_EqualDistanceRelation, PrsDim_Relation) //======================================================================= -//function : AIS_EqualDistanceRelation +//function : PrsDim_EqualDistanceRelation //purpose : //======================================================================= -AIS_EqualDistanceRelation::AIS_EqualDistanceRelation( const TopoDS_Shape& aShape1, +PrsDim_EqualDistanceRelation::PrsDim_EqualDistanceRelation( const TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2, const TopoDS_Shape& aShape3, const TopoDS_Shape& aShape4, const Handle( Geom_Plane )& aPlane ) - :AIS_Relation() +: PrsDim_Relation() { myFShape = aShape1; mySShape = aShape2; @@ -76,7 +75,7 @@ AIS_EqualDistanceRelation::AIS_EqualDistanceRelation( const TopoDS_Shape& aShape //purpose : //======================================================================= -void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManager3d )&, +void PrsDim_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManager3d )&, const Handle( Prs3d_Presentation )& aPresentation, const Standard_Integer ) { @@ -98,7 +97,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage } if (myFShape.ShapeType() == TopAbs_EDGE && mySShape.ShapeType() == TopAbs_EDGE) - AIS_EqualDistanceRelation::ComputeTwoEdgesLength(aPresentation, + PrsDim_EqualDistanceRelation::ComputeTwoEdgesLength(aPresentation, myDrawer, myArrowSize, 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) - AIS_EqualDistanceRelation::ComputeTwoVerticesLength( aPresentation, + PrsDim_EqualDistanceRelation::ComputeTwoVerticesLength( aPresentation, myDrawer, myArrowSize, TopoDS::Vertex(myFShape), @@ -125,7 +124,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage myAutomaticPosition, myIsSetBndBox, myBndBox, - AIS_TOD_Unknown, + PrsDim_TypeOfDist_Unknown, Position12, myAttachPoint1, myAttachPoint2, @@ -133,7 +132,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage myPoint2, mySymbolPrs ); else - AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( aPresentation, + PrsDim_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( aPresentation, myDrawer, myArrowSize, myFShape, @@ -150,7 +149,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage mySymbolPrs ); if (myShape3.ShapeType() == TopAbs_EDGE && myShape4.ShapeType() == TopAbs_EDGE) - AIS_EqualDistanceRelation::ComputeTwoEdgesLength(aPresentation, + PrsDim_EqualDistanceRelation::ComputeTwoEdgesLength(aPresentation, myDrawer, myArrowSize, TopoDS::Edge(myShape3), @@ -167,7 +166,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage mySymbolPrs ); else if (myShape3.ShapeType() == TopAbs_VERTEX && myShape4.ShapeType() == TopAbs_VERTEX) - AIS_EqualDistanceRelation::ComputeTwoVerticesLength( aPresentation, + PrsDim_EqualDistanceRelation::ComputeTwoVerticesLength( aPresentation, myDrawer, myArrowSize, TopoDS::Vertex(myShape3), @@ -176,7 +175,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage myAutomaticPosition, myIsSetBndBox, myBndBox, - AIS_TOD_Unknown, + PrsDim_TypeOfDist_Unknown, Position34, myAttachPoint3, myAttachPoint4, @@ -185,7 +184,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage mySymbolPrs ); else - AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( aPresentation, + PrsDim_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( aPresentation, myDrawer, myArrowSize, myShape3, @@ -210,7 +209,7 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage //purpose : //======================================================================= -void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Selection )& aSelection, +void PrsDim_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Selection )& aSelection, const Standard_Integer ) { Handle( SelectMgr_EntityOwner ) own = new SelectMgr_EntityOwner( this, 7 ); @@ -339,7 +338,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select //function : ComputeTwoEdgesLength //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 Standard_Real ArrowSize, const TopoDS_Edge & FirstEdge, @@ -369,9 +368,9 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese Standard_Real Val=0.; 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; - if(!AIS::ComputeGeometry(SecondEdge, geom2, ptat21, ptat22, extCurv, isInfinite2,isInPlane2, Plane)) + if(!PrsDim::ComputeGeometry(SecondEdge, geom2, ptat21, ptat22, extCurv, isInfinite2,isInPlane2, Plane)) return; aPresentation->SetInfiniteState(isInfinite1 || isInfinite2); @@ -424,7 +423,7 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese Position = curpos; } else { // project point on the plane - Position = AIS::ProjectPointOnPlane( Position, Plane->Pln() ); + Position = PrsDim::ProjectPointOnPlane( Position, Plane->Pln() ); } // find attach points @@ -455,7 +454,7 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese arr->SetLength(arrsize); if (AutomaticPos && IsSetBndBox) - Position = AIS::TranslatePointToBound( Position, DirAttach, BndBox ); + Position = PrsDim::TranslatePointToBound( Position, DirAttach, BndBox ); DsgPrs_EqualDistancePresentation::AddInterval(aPresentation, aDrawer, @@ -490,10 +489,10 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese Standard_Real par1 = 0, par2 = 0; gp_Pln aPln = Plane->Pln(); //Project ptat12 and ptat22 on constraint plane - gp_Pnt PrPnt12 = AIS::ProjectPointOnPlane(ptat12, aPln); - gp_Pnt PrPnt22 = AIS::ProjectPointOnPlane(ptat22, aPln); + gp_Pnt PrPnt12 = PrsDim::ProjectPointOnPlane(ptat12, aPln); + gp_Pnt PrPnt22 = PrsDim::ProjectPointOnPlane(ptat22, aPln); //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 YDir = aPln.YAxis().Direction(); @@ -555,10 +554,10 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese // gp_Pnt pf, pl; if (!isInPlane1) { - AIS::ComputeProjEdgePresentation( aPresentation, aDrawer, FirstEdge, geom1, ptat11, ptat12); + PrsDim::ComputeProjEdgePresentation( aPresentation, aDrawer, FirstEdge, geom1, ptat11, ptat12); } 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 : //======================================================================= -void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Presentation )& aPresentation, +void PrsDim_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Presentation )& aPresentation, const Handle( Prs3d_Drawer )& aDrawer, const Standard_Real ArrowSize, const TopoDS_Vertex& FirstVertex, @@ -576,7 +575,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr const Standard_Boolean AutomaticPos, const Standard_Boolean IsSetBndBox, const Bnd_Box& BndBox, - const AIS_TypeOfDist TypeDist, + const PrsDim_TypeOfDist TypeDist, gp_Pnt& Position, gp_Pnt& FirstAttach, gp_Pnt& SecondAttach, @@ -586,14 +585,14 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr { Standard_Boolean isOnPlane1, isOnPlane2; gp_Dir DirAttach; - AIS::ComputeGeometry( FirstVertex, FirstAttach, Plane, isOnPlane1); - AIS::ComputeGeometry( SecondVertex, SecondAttach, Plane, isOnPlane2); + PrsDim::ComputeGeometry( FirstVertex, FirstAttach, Plane, isOnPlane1); + PrsDim::ComputeGeometry( SecondVertex, SecondAttach, Plane, isOnPlane2); Standard_Real confusion(Precision::Confusion()); Standard_Boolean samePoint(FirstAttach.IsEqual(SecondAttach,confusion)); - if (TypeDist == AIS_TOD_Vertical) DirAttach = Plane->Pln().XAxis().Direction(); - else if (TypeDist == AIS_TOD_Horizontal) DirAttach = Plane->Pln().YAxis().Direction(); + if (TypeDist == PrsDim_TypeOfDist_Vertical) DirAttach = Plane->Pln().XAxis().Direction(); + else if (TypeDist == PrsDim_TypeOfDist_Horizontal) DirAttach = Plane->Pln().YAxis().Direction(); else { if (!samePoint) { 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); //Position = gp_Pnt(FirstAttach.XYZ()+gp_XYZ(1.,1.,1.)); // not correct 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()); } } 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); if (AutomaticPos && IsSetBndBox) - Position = AIS::TranslatePointToBound( Position, DirAttach, BndBox ); + Position = PrsDim::TranslatePointToBound( Position, DirAttach, BndBox ); DsgPrs_EqualDistancePresentation::AddInterval(aPresentation, aDrawer, @@ -646,9 +645,9 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr // Compute projection if ( !isOnPlane1) - AIS::ComputeProjVertexPresentation(aPresentation, aDrawer, FirstVertex, FirstAttach); + PrsDim::ComputeProjVertexPresentation(aPresentation, aDrawer, FirstVertex, FirstAttach); 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 : //======================================================================= -void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs3d_Presentation )& aPresentation, +void PrsDim_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs3d_Presentation )& aPresentation, const Handle( Prs3d_Drawer )& aDrawer, const Standard_Real ArrowSize, const TopoDS_Shape & FirstShape, @@ -695,10 +694,10 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs theedge = TopoDS::Edge(FirstShape); 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; aPresentation->SetInfiniteState(isInfinite); - AIS::ComputeGeometry(thevertex, FirstAttach, Plane, isOnPlanVertex); + PrsDim::ComputeGeometry(thevertex, FirstAttach, Plane, isOnPlanVertex); if ( aCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) { @@ -723,7 +722,7 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs Position = curpos; } else { // project point on the plane - Position = AIS::ProjectPointOnPlane( Position, Plane->Pln() ); + Position = PrsDim::ProjectPointOnPlane( Position, Plane->Pln() ); } if (!isInfinite) { @@ -741,7 +740,7 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs arr->SetLength(arrsize); if (AutomaticPos && IsSetBndBox) - Position = AIS::TranslatePointToBound( Position, DirAttach, BndBox ); + Position = PrsDim::TranslatePointToBound( Position, DirAttach, BndBox ); DsgPrs_EqualDistancePresentation::AddInterval(aPresentation, aDrawer, FirstAttach, @@ -793,10 +792,10 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs //Display the pieces of attached to the curve if it is not // in the 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 - AIS::ComputeProjVertexPresentation(aPresentation,aDrawer,thevertex,FirstAttach); + PrsDim::ComputeProjVertexPresentation(aPresentation,aDrawer,thevertex,FirstAttach); } } diff --git a/src/AIS/AIS_EqualDistanceRelation.hxx b/src/PrsDim/PrsDim_EqualDistanceRelation.hxx similarity index 71% rename from src/AIS/AIS_EqualDistanceRelation.hxx rename to src/PrsDim/PrsDim_EqualDistanceRelation.hxx index 644afd1b0f..8c07112c17 100644 --- a/src/AIS/AIS_EqualDistanceRelation.hxx +++ b/src/PrsDim/PrsDim_EqualDistanceRelation.hxx @@ -14,25 +14,25 @@ // 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 +#ifndef _PrsDim_EqualDistanceRelation_HeaderFile +#define _PrsDim_EqualDistanceRelation_HeaderFile -#include -#include +#include +#include #include class Geom_Plane; -DEFINE_STANDARD_HANDLE(AIS_EqualDistanceRelation, AIS_Relation) +DEFINE_STANDARD_HANDLE(PrsDim_EqualDistanceRelation, PrsDim_Relation) //! A framework to display equivalent distances between //! shapes and a given plane. //! The distance is the length of a projection from the //! shape to the plane. //! 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: //! Constructs a framework to display equivalent @@ -40,27 +40,25 @@ public: //! aShape3, aShape4 and the plane aPlane. //! The distance is the length of a projection from the //! 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 //! 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 //! 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 //! 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 //! created at construction time. - const TopoDS_Shape& Shape4() const; + const TopoDS_Shape& Shape4() const { return myShape4; } + +public: //! Computes the location of an intreval between //! between two edges. FirstAttach , SecondAttach @@ -69,7 +67,7 @@ public: //! Computes the interval position between two vertexs. FirstAttach, //! 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 //! a line or a circle. @@ -77,9 +75,11 @@ public: 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 myShape4; @@ -94,6 +94,4 @@ private: }; -#include - -#endif // _AIS_EqualDistanceRelation_HeaderFile +#endif // _PrsDim_EqualDistanceRelation_HeaderFile diff --git a/src/AIS/AIS_EqualRadiusRelation.cxx b/src/PrsDim/PrsDim_EqualRadiusRelation.cxx similarity index 90% rename from src/AIS/AIS_EqualRadiusRelation.cxx rename to src/PrsDim/PrsDim_EqualRadiusRelation.cxx index 4a1dfea6a0..28578317a3 100644 --- a/src/AIS/AIS_EqualRadiusRelation.cxx +++ b/src/PrsDim/PrsDim_EqualRadiusRelation.cxx @@ -14,15 +14,14 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include #include #include -#include #include #include #include @@ -39,16 +38,16 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_EqualRadiusRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_EqualRadiusRelation, PrsDim_Relation) //======================================================================= -//function : AIS_EqualRadiusRelation +//function : PrsDim_EqualRadiusRelation //purpose : //======================================================================= -AIS_EqualRadiusRelation::AIS_EqualRadiusRelation( const TopoDS_Edge& aFirstEdge, +PrsDim_EqualRadiusRelation::PrsDim_EqualRadiusRelation( const TopoDS_Edge& aFirstEdge, const TopoDS_Edge& aSecondEdge, const Handle( Geom_Plane )& aPlane ) - :AIS_Relation() +: PrsDim_Relation() { myFShape = aFirstEdge; mySShape = aSecondEdge; @@ -60,7 +59,7 @@ AIS_EqualRadiusRelation::AIS_EqualRadiusRelation( const TopoDS_Edge& aFirstEdge, //purpose : //======================================================================= -void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3d )&, +void PrsDim_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3d )&, const Handle( Prs3d_Presentation )& aPresentation, const Standard_Integer ) { @@ -74,8 +73,8 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3 gp_Pnt FirstPoint1, LastPoint1, FirstPoint2, LastPoint2; Standard_Boolean isFirstOnPlane, isSecondOnPlane; - AIS::ComputeGeomCurve( FirstProjCurve, FirstPar1, LastPar1, FirstPoint1, LastPoint1, myPlane, isFirstOnPlane ); - AIS::ComputeGeomCurve( SecondProjCurve, FirstPar2, LastPar2, FirstPoint2, LastPoint2, myPlane, isSecondOnPlane ); + PrsDim::ComputeGeomCurve (FirstProjCurve, FirstPar1, LastPar1, FirstPoint1, LastPoint1, myPlane, isFirstOnPlane); + PrsDim::ComputeGeomCurve (SecondProjCurve, FirstPar2, LastPar2, FirstPoint2, LastPoint2, myPlane, isSecondOnPlane); if (!isFirstOnPlane) ComputeProjEdgePresentation( aPresentation, TopoDS::Edge( myFShape ), FirstProjCurve, FirstPoint1, LastPoint1 ); @@ -151,7 +150,7 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3 //purpose : //======================================================================= -void AIS_EqualRadiusRelation::ComputeSelection( const Handle( SelectMgr_Selection )& aSelection, +void PrsDim_EqualRadiusRelation::ComputeSelection( const Handle( SelectMgr_Selection )& aSelection, const Standard_Integer ) { Handle( SelectMgr_EntityOwner ) own = new SelectMgr_EntityOwner( this, 7 ); @@ -189,7 +188,7 @@ void AIS_EqualRadiusRelation::ComputeSelection( const Handle( SelectMgr_Selectio //function : ComputeRadiusPosition //purpose : //================================================================= -void AIS_EqualRadiusRelation::ComputeRadiusPosition() +void PrsDim_EqualRadiusRelation::ComputeRadiusPosition() { if (myAutomaticPosition || myFirstCenter.Distance(myPosition) < Precision::Confusion() || diff --git a/src/AIS/AIS_EqualRadiusRelation.hxx b/src/PrsDim/PrsDim_EqualRadiusRelation.hxx similarity index 73% rename from src/AIS/AIS_EqualRadiusRelation.hxx rename to src/PrsDim/PrsDim_EqualRadiusRelation.hxx index 9d4917fd0b..b2f8e349bd 100644 --- a/src/AIS/AIS_EqualRadiusRelation.hxx +++ b/src/PrsDim/PrsDim_EqualRadiusRelation.hxx @@ -14,24 +14,24 @@ // 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 +#ifndef _PrsDim_EqualRadiusRelation_HeaderFile +#define _PrsDim_EqualRadiusRelation_HeaderFile -#include +#include 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: //! Creates equal relation of two arc's radiuses. //! If one of edges is not in the given plane, //! the presentation method projects it onto the plane. - Standard_EXPORT AIS_EqualRadiusRelation(const TopoDS_Edge& aFirstEdge, const TopoDS_Edge& aSecondEdge, const Handle(Geom_Plane)& aPlane); + Standard_EXPORT PrsDim_EqualRadiusRelation(const TopoDS_Edge& aFirstEdge, const TopoDS_Edge& aSecondEdge, const Handle(Geom_Plane)& aPlane); private: @@ -41,6 +41,8 @@ private: Standard_EXPORT void ComputeRadiusPosition(); +private: + gp_Pnt myFirstCenter; gp_Pnt mySecondCenter; gp_Pnt myFirstPoint; @@ -48,4 +50,4 @@ private: }; -#endif // _AIS_EqualRadiusRelation_HeaderFile +#endif // _PrsDim_EqualRadiusRelation_HeaderFile diff --git a/src/AIS/AIS_FixRelation.cxx b/src/PrsDim/PrsDim_FixRelation.cxx similarity index 90% rename from src/AIS/AIS_FixRelation.cxx rename to src/PrsDim/PrsDim_FixRelation.cxx index e4ea9b585a..cf31fd563d 100644 --- a/src/AIS/AIS_FixRelation.cxx +++ b/src/PrsDim/PrsDim_FixRelation.cxx @@ -14,10 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include -#include +#include #include #include #include @@ -27,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -42,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -56,7 +53,7 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_FixRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_FixRelation, PrsDim_Relation) static Standard_Boolean InDomain(const Standard_Real fpar, const Standard_Real lpar, @@ -75,10 +72,10 @@ static Standard_Boolean InDomain(const Standard_Real fpar, //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 TopoDS_Wire& aWire) -:AIS_Relation(), +: PrsDim_Relation(), myWire(aWire) { myFShape = aShape; @@ -92,12 +89,12 @@ AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape, //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 TopoDS_Wire& aWire, const gp_Pnt& aPosition, const Standard_Real anArrowSize) -:AIS_Relation(), +: PrsDim_Relation(), myWire(aWire) { myFShape = aShape; @@ -113,8 +110,8 @@ AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape, //purpose : edge (line or circle) Fix Relation //======================================================================= -AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape, - const Handle(Geom_Plane)& aPlane) +PrsDim_FixRelation::PrsDim_FixRelation (const TopoDS_Shape& aShape, + const Handle(Geom_Plane)& aPlane) { myFShape = aShape; myPlane = aPlane; @@ -127,7 +124,7 @@ AIS_FixRelation::AIS_FixRelation(const TopoDS_Shape& aShape, //purpose : edge (line or circle) Fix Relation //======================================================================= -AIS_FixRelation::AIS_FixRelation( +PrsDim_FixRelation::PrsDim_FixRelation( const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const gp_Pnt& aPosition, @@ -140,33 +137,12 @@ AIS_FixRelation::AIS_FixRelation( 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 //purpose : //======================================================================= -void AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, +void PrsDim_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer) { @@ -200,7 +176,7 @@ void AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, //purpose : //======================================================================= -void AIS_FixRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_FixRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer) { 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 //======================================================================= -void AIS_FixRelation::ComputeVertex(const TopoDS_Vertex& /*FixVertex*/, +void PrsDim_FixRelation::ComputeVertex(const TopoDS_Vertex& /*FixVertex*/, gp_Pnt& curpos) { myPntAttach = BRep_Tool::Pnt(TopoDS::Vertex(myFShape)); @@ -285,7 +261,7 @@ void AIS_FixRelation::ComputeVertex(const TopoDS_Vertex& /*FixVertex*/, //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 gp_Pnt& firstp1, 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. //======================================================================= -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& lastp) const { @@ -376,11 +352,11 @@ gp_Pnt AIS_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv, // 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; 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' @@ -415,7 +391,7 @@ void AIS_FixRelation::ComputeEdge(const TopoDS_Edge& FixEdge, gp_Pnt& curpos) // to a line. //======================================================================= -void AIS_FixRelation::ComputeLinePosition(const gp_Lin& glin, +void PrsDim_FixRelation::ComputeLinePosition(const gp_Lin& glin, gp_Pnt& pos, Standard_Real& pfirst, Standard_Real& plast) @@ -469,7 +445,7 @@ void AIS_FixRelation::ComputeLinePosition(const gp_Lin& glin, // to a circle. //======================================================================= -void AIS_FixRelation::ComputeCirclePosition( +void PrsDim_FixRelation::ComputeCirclePosition( const gp_Circ& gcirc, gp_Pnt& pos, Standard_Real& pfirst, @@ -526,7 +502,7 @@ void AIS_FixRelation::ComputeCirclePosition( //function : ConnectedEdges //purpose : //======================================================================= -Standard_Boolean AIS_FixRelation::ConnectedEdges(const TopoDS_Wire& WIRE, +Standard_Boolean PrsDim_FixRelation::ConnectedEdges(const TopoDS_Wire& WIRE, const TopoDS_Vertex& V, TopoDS_Edge& E1, TopoDS_Edge& E2) diff --git a/src/AIS/AIS_FixRelation.hxx b/src/PrsDim/PrsDim_FixRelation.hxx similarity index 73% rename from src/AIS/AIS_FixRelation.hxx rename to src/PrsDim/PrsDim_FixRelation.hxx index 5c904c05e3..fbea2fd471 100644 --- a/src/AIS/AIS_FixRelation.hxx +++ b/src/PrsDim/PrsDim_FixRelation.hxx @@ -14,15 +14,15 @@ // 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 +#ifndef _PrsDim_FixRelation_HeaderFile +#define _PrsDim_FixRelation_HeaderFile #include -#include +#include 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 //! relation between two or more interactive datums. This @@ -32,45 +32,44 @@ DEFINE_STANDARD_HANDLE(AIS_FixRelation, AIS_Relation) //! Warning: This relation is not bound with any kind of parametric //! constraint : it represents the "status" of an parametric //! 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: //! initializes the vertex aShape, the //! plane aPlane and the 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); + Standard_EXPORT PrsDim_FixRelation(const TopoDS_Shape& aShape, const Handle(Geom_Plane)& aPlane, const TopoDS_Wire& aWire); //! initializes the vertex aShape, the //! plane aPlane and the wire aWire, the position //! aPosition, the arrow size anArrowSize and the //! 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. - 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 //! plane aPlane, the position aPosition and the arrow //! 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. - Standard_EXPORT TopoDS_Wire Wire(); + const TopoDS_Wire& Wire() { return myWire; } //! Constructs the wire aWire. This connects vertices //! 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 //! are movable. virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } 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; @@ -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); +private: + TopoDS_Wire myWire; gp_Pnt myPntAttach; - }; -#endif // _AIS_FixRelation_HeaderFile +#endif // _PrsDim_FixRelation_HeaderFile diff --git a/src/AIS/AIS_IdenticRelation.cxx b/src/PrsDim/PrsDim_IdenticRelation.cxx similarity index 95% rename from src/AIS/AIS_IdenticRelation.cxx rename to src/PrsDim/PrsDim_IdenticRelation.cxx index fe394d4de6..127c65a81c 100644 --- a/src/AIS/AIS_IdenticRelation.cxx +++ b/src/PrsDim/PrsDim_IdenticRelation.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -41,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -54,7 +52,7 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_IdenticRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_IdenticRelation, PrsDim_Relation) // jfa 15/10/2000 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 //======================================================================= -//function : AIS_Sort +//function : PrsDim_Sort //purpose : sort an array of parameters in increasing order // updates and according to //======================================================================= -static void AIS_Sort(Standard_Real tab1[4], +static void PrsDim_Sort(Standard_Real tab1[4], gp_Pnt tab2[4], Standard_Integer tab3[4]) { @@ -287,10 +285,10 @@ static Standard_Boolean ComputeAttach(const gp_Elips& theEll, // jfa 16/10/2000 end //======================================================================= -//function : AIS_IdenticRelation +//function : PrsDim_IdenticRelation //purpose : //======================================================================= -AIS_IdenticRelation::AIS_IdenticRelation(const TopoDS_Shape& FirstShape, +PrsDim_IdenticRelation::PrsDim_IdenticRelation(const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane) :isCircle(Standard_False) @@ -304,7 +302,7 @@ AIS_IdenticRelation::AIS_IdenticRelation(const TopoDS_Shape& FirstShape, //function : Compute //purpose : //======================================================================= -void AIS_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, +void PrsDim_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, const Handle(Prs3d_Presentation)& aprs, const Standard_Integer) { @@ -362,7 +360,7 @@ void AIS_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, // before. //======================================================================= -void AIS_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer) { 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; Standard_Boolean isInfinite1,isInfinite2; 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, firstp1,lastp1,firstp2,lastp2, extCurv,isInfinite1,isInfinite2,myPlane) ) return; @@ -456,14 +454,14 @@ void AIS_IdenticRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aS //function : ComputeTwoEdgesPresentation //purpose : //======================================================================= -void AIS_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Presentation)& aPrs) +void PrsDim_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Presentation)& aPrs) { Handle(Geom_Curve) curv1,curv2; gp_Pnt firstp1,lastp1,firstp2,lastp2; Standard_Boolean isInfinite1,isInfinite2; Handle(Geom_Curve) extCurv; - if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape), + if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), TopoDS::Edge(mySShape), myExtShape, curv1, @@ -526,7 +524,7 @@ void AIS_IdenticRelation::ComputeTwoEdgesPresentation(const Handle(Prs3d_Present // : first extremity of the 2nd curve of the constraint // :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, gp_Pnt& firstp1, gp_Pnt& lastp1, @@ -595,7 +593,7 @@ void AIS_IdenticRelation::ComputeTwoLinesPresentation(const Handle(Prs3d_Present tabRang1[3] = pl2; tabRang2[3] = lastp2; tabRang3[3] = 2; // 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 // position of the 2 linear edges @@ -701,7 +699,7 @@ void AIS_IdenticRelation::ComputeTwoLinesPresentation(const Handle(Prs3d_Present // : first extremity of the 2nd curve of the constraint // :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 gp_Pnt& firstp1, 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 // 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& lastp, 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 // 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; @@ -1013,7 +1011,7 @@ void AIS_IdenticRelation::ComputeNotAutoCircPresentation(const Handle(Geom_Circl // The symbol of the constraint moves only between myFAttach // 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& pntlast) { @@ -1056,7 +1054,7 @@ void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Circle // : first extremity of the 2nd curve of the constraint // :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 gp_Pnt& firstp1, 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 // 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& lastp, 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 // and mySAttach. //======================================================================= -void AIS_IdenticRelation::ComputeNotAutoElipsPresentation(const Handle(Geom_Ellipse)& theEll) +void PrsDim_IdenticRelation::ComputeNotAutoElipsPresentation(const Handle(Geom_Ellipse)& theEll) { 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 // 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& pntlast) { @@ -1411,14 +1409,14 @@ void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Ellips //function : ComputeTwoVerticesPresentation //purpose : //======================================================================= -void AIS_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Presentation)& aPrs) +void PrsDim_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Presentation)& aPrs) { Standard_Boolean isOnPlane1, isOnPlane2; const TopoDS_Vertex& FVertex = TopoDS::Vertex(myFShape); const TopoDS_Vertex& SVertex = TopoDS::Vertex(mySShape); - AIS::ComputeGeometry(FVertex, myFAttach, myPlane, isOnPlane1); - AIS::ComputeGeometry(SVertex, mySAttach, myPlane, isOnPlane2); + PrsDim::ComputeGeometry(FVertex, myFAttach, myPlane, isOnPlane1); + PrsDim::ComputeGeometry(SVertex, mySAttach, myPlane, isOnPlane2); if (isOnPlane1 && isOnPlane2) myExtShape = 0; @@ -1512,7 +1510,7 @@ void AIS_IdenticRelation::ComputeTwoVerticesPresentation(const Handle(Prs3d_Pres //function : ComputeSegSize //purpose : //======================================================================= -Standard_Real AIS_IdenticRelation::ComputeSegSize() const +Standard_Real PrsDim_IdenticRelation::ComputeSegSize() const { return 1.; } @@ -1523,7 +1521,7 @@ Standard_Real AIS_IdenticRelation::ComputeSegSize() const // elements connected to the vertex , in way to not have // 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, 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 if ( !edg1.IsNull() && !edg2.IsNull() ) { - if ( !AIS::ComputeGeometry(edg1,edg2, + if ( !PrsDim::ComputeGeometry(edg1,edg2, curv1,curv2, firstp1, lastp1, firstp2, lastp2,myPlane)) @@ -1582,7 +1580,7 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire, else return Standard_False; - if ( !AIS::ComputeGeometry(VEdge, curv1, firstp1, lastp1) ) + if ( !PrsDim::ComputeGeometry(VEdge, curv1, firstp1, lastp1) ) return Standard_False; if ( curv1->IsInstance(STANDARD_TYPE(Geom_Circle)) ) { dF = ComputeCircleDirection( Handle(Geom_Circle)::DownCast (curv1), VERT); @@ -1601,7 +1599,7 @@ Standard_Boolean AIS_IdenticRelation::ComputeDirection(const TopoDS_Wire& aWire, //function : ComputeLineDirection //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 { gp_Dir dir; @@ -1615,7 +1613,7 @@ gp_Dir AIS_IdenticRelation::ComputeLineDirection(const Handle(Geom_Line)& lin, //function : ComputeCircleDirection //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 { 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 //purpose : //======================================================================= -void AIS_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_Presentation)& aPrs) +void PrsDim_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_Presentation)& aPrs) { TopoDS_Vertex V; TopoDS_Edge E; @@ -1647,10 +1645,10 @@ void AIS_IdenticRelation::ComputeOneEdgeOVertexPresentation(const Handle(Prs3d_P Handle(Geom_Curve) extCurv; Standard_Boolean isInfinite; 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; aPrs->SetInfiniteState(isInfinite); - AIS::ComputeGeometry(V, myFAttach, myPlane, isOnPlanVertex); + PrsDim::ComputeGeometry(V, myFAttach, myPlane, isOnPlanVertex); // only the curve can be projected if (!isOnPlanEdge && !isOnPlanVertex) return; diff --git a/src/AIS/AIS_IdenticRelation.hxx b/src/PrsDim/PrsDim_IdenticRelation.hxx similarity index 91% rename from src/AIS/AIS_IdenticRelation.hxx rename to src/PrsDim/PrsDim_IdenticRelation.hxx index ef729100d9..2cc184f45d 100644 --- a/src/AIS/AIS_IdenticRelation.hxx +++ b/src/PrsDim/PrsDim_IdenticRelation.hxx @@ -14,10 +14,10 @@ // 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 +#ifndef _PrsDim_IdenticRelation_HeaderFile +#define _PrsDim_IdenticRelation_HeaderFile -#include +#include #include #include #include @@ -33,21 +33,21 @@ class TopoDS_Wire; class TopoDS_Vertex; 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 //! between two or more datums figuring in shape //! Interactive Objects. -class AIS_IdenticRelation : public AIS_Relation +class PrsDim_IdenticRelation : public PrsDim_Relation { - + DEFINE_STANDARD_RTTIEXT(PrsDim_IdenticRelation, PrsDim_Relation) public: //! Initializes the relation of identity between the two //! entities, FirstShape and SecondShape. The plane //! aPlane is initialized in case a visual reference is //! 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(); } @@ -60,8 +60,6 @@ public: //! Returns true if the interactive object is movable. virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } - DEFINE_STANDARD_RTTIEXT(AIS_IdenticRelation,AIS_Relation) - private: @@ -123,4 +121,4 @@ private: }; -#endif // _AIS_IdenticRelation_HeaderFile +#endif // _PrsDim_IdenticRelation_HeaderFile diff --git a/src/AIS/AIS_KindOfDimension.hxx b/src/PrsDim/PrsDim_KindOfDimension.hxx similarity index 64% rename from src/AIS/AIS_KindOfDimension.hxx rename to src/PrsDim/PrsDim_KindOfDimension.hxx index a4e910cddb..b42a0b97ad 100644 --- a/src/AIS/AIS_KindOfDimension.hxx +++ b/src/PrsDim/PrsDim_KindOfDimension.hxx @@ -14,27 +14,27 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_KindOfDimension_HeaderFile -#define _AIS_KindOfDimension_HeaderFile +#ifndef _PrsDim_KindOfDimension_HeaderFile +#define _PrsDim_KindOfDimension_HeaderFile //! Declares the kinds of dimensions needed in the //! display of Interactive Objects. -enum AIS_KindOfDimension +enum PrsDim_KindOfDimension { -AIS_KOD_NONE, -AIS_KOD_LENGTH, -AIS_KOD_PLANEANGLE, -AIS_KOD_SOLIDANGLE, -AIS_KOD_AREA, -AIS_KOD_VOLUME, -AIS_KOD_MASS, -AIS_KOD_TIME, -AIS_KOD_RADIUS, -AIS_KOD_DIAMETER, -AIS_KOD_CHAMF2D, -AIS_KOD_CHAMF3D, -AIS_KOD_OFFSET, -AIS_KOD_ELLIPSERADIUS + PrsDim_KOD_NONE, + PrsDim_KOD_LENGTH, + PrsDim_KOD_PLANEANGLE, + PrsDim_KOD_SOLIDANGLE, + PrsDim_KOD_AREA, + PrsDim_KOD_VOLUME, + PrsDim_KOD_MASS, + PrsDim_KOD_TIME, + PrsDim_KOD_RADIUS, + PrsDim_KOD_DIAMETER, + PrsDim_KOD_CHAMF2D, + PrsDim_KOD_CHAMF3D, + PrsDim_KOD_OFFSET, + PrsDim_KOD_ELLIPSERADIUS }; -#endif // _AIS_KindOfDimension_HeaderFile +#endif // _PrsDim_KindOfDimension_HeaderFile diff --git a/src/AIS/AIS_KindOfRelation.hxx b/src/PrsDim/PrsDim_KindOfRelation.hxx similarity index 64% rename from src/AIS/AIS_KindOfRelation.hxx rename to src/PrsDim/PrsDim_KindOfRelation.hxx index d503082d0f..2d7cbb540e 100644 --- a/src/AIS/AIS_KindOfRelation.hxx +++ b/src/PrsDim/PrsDim_KindOfRelation.hxx @@ -12,22 +12,22 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_KindOfRelation_HeaderFile -#define _AIS_KindOfRelation_HeaderFile +#ifndef _PrsDim_KindOfRelation_HeaderFile +#define _PrsDim_KindOfRelation_HeaderFile -enum AIS_KindOfRelation +enum PrsDim_KindOfRelation { - AIS_KOR_NONE = 0, - AIS_KOR_CONCENTRIC, - AIS_KOR_EQUALDISTANCE, - AIS_KOR_EQUALRADIUS, - AIS_KOR_FIX, - AIS_KOR_IDENTIC, - AIS_KOR_OFFSET, - AIS_KOR_PARALLEL, - AIS_KOR_PERPENDICULAR, - AIS_KOR_TANGENT, - AIS_KOR_SYMMETRIC + PrsDim_KOR_NONE = 0, + PrsDim_KOR_CONCENTRIC, + PrsDim_KOR_EQUALDISTANCE, + PrsDim_KOR_EQUALRADIUS, + PrsDim_KOR_FIX, + PrsDim_KOR_IDENTIC, + PrsDim_KOR_OFFSET, + PrsDim_KOR_PARALLEL, + PrsDim_KOR_PERPENDICULAR, + PrsDim_KOR_TANGENT, + PrsDim_KOR_SYMMETRIC }; #endif diff --git a/src/AIS/AIS_KindOfUnit.hxx b/src/PrsDim/PrsDim_KindOfSurface.hxx similarity index 69% rename from src/AIS/AIS_KindOfUnit.hxx rename to src/PrsDim/PrsDim_KindOfSurface.hxx index 835bfa24de..06f423e627 100644 --- a/src/AIS/AIS_KindOfUnit.hxx +++ b/src/PrsDim/PrsDim_KindOfSurface.hxx @@ -14,20 +14,19 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_KindOfUnit_HeaderFile -#define _AIS_KindOfUnit_HeaderFile +#ifndef _PrsDim_KindOfSurface_HeaderFile +#define _PrsDim_KindOfSurface_HeaderFile -//! Declares the type of Interactive Object unit. -enum AIS_KindOfUnit +enum PrsDim_KindOfSurface { -AIS_TOU_LENGTH, -AIS_TOU_SURFACE, -AIS_TOU_VOLUME, -AIS_TOU_PLANE_ANGLE, -AIS_TOU_SOLID_ANGLE, -AIS_TOU_MASS, -AIS_TOU_FORCE, -AIS_TOU_TIME + PrsDim_KOS_Plane, + PrsDim_KOS_Cylinder, + PrsDim_KOS_Cone, + PrsDim_KOS_Sphere, + PrsDim_KOS_Torus, + PrsDim_KOS_Revolution, + PrsDim_KOS_Extrusion, + PrsDim_KOS_OtherSurface }; -#endif // _AIS_KindOfUnit_HeaderFile +#endif // _PrsDim_KindOfSurface_HeaderFile diff --git a/src/AIS/AIS_LengthDimension.cxx b/src/PrsDim/PrsDim_LengthDimension.cxx old mode 100755 new mode 100644 similarity index 76% rename from src/AIS/AIS_LengthDimension.cxx rename to src/PrsDim/PrsDim_LengthDimension.cxx index 6b919881b6..60f536adb6 --- a/src/AIS/AIS_LengthDimension.cxx +++ b/src/PrsDim/PrsDim_LengthDimension.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include -#include +#include #include #include #include @@ -35,16 +35,15 @@ #include #include - -IMPLEMENT_STANDARD_RTTIEXT(AIS_LengthDimension,AIS_Dimension) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_LengthDimension, PrsDim_Dimension) //======================================================================= //function : Constructor //purpose : Dimension between two faces //======================================================================= -AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace) -: AIS_Dimension (AIS_KOD_LENGTH), +PrsDim_LengthDimension::PrsDim_LengthDimension (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace) +: PrsDim_Dimension (PrsDim_KOD_LENGTH), myHasCustomDirection (Standard_False) { SetMeasuredGeometry (theFirstFace, theSecondFace); @@ -55,9 +54,9 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFirstFace, //function : Constructor //purpose : Dimension between two shape //======================================================================= -AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace, - const TopoDS_Edge& theEdge) -: AIS_Dimension (AIS_KOD_LENGTH), +PrsDim_LengthDimension::PrsDim_LengthDimension (const TopoDS_Face& theFace, + const TopoDS_Edge& theEdge) +: PrsDim_Dimension (PrsDim_KOD_LENGTH), myHasCustomDirection (Standard_False) { SetMeasuredGeometry (theFace, theEdge); @@ -68,10 +67,10 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Face& theFace, //function : Constructor //purpose : Dimension between two points //======================================================================= -AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const gp_Pln& thePlane) -: AIS_Dimension (AIS_KOD_LENGTH), +PrsDim_LengthDimension::PrsDim_LengthDimension (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const gp_Pln& thePlane) +: PrsDim_Dimension (PrsDim_KOD_LENGTH), myHasCustomDirection (Standard_False) { SetMeasuredGeometry (theFirstPoint, theSecondPoint, thePlane); @@ -82,10 +81,10 @@ AIS_LengthDimension::AIS_LengthDimension (const gp_Pnt& theFirstPoint, //function : Constructor //purpose : Dimension between two shape //======================================================================= -AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape, - const TopoDS_Shape& theSecondShape, - const gp_Pln& thePlane) -: AIS_Dimension (AIS_KOD_LENGTH), +PrsDim_LengthDimension::PrsDim_LengthDimension (const TopoDS_Shape& theFirstShape, + const TopoDS_Shape& theSecondShape, + const gp_Pln& thePlane) +: PrsDim_Dimension (PrsDim_KOD_LENGTH), myHasCustomDirection (Standard_False) { SetCustomPlane (thePlane); @@ -97,9 +96,9 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Shape& theFirstShape, //function : Constructor //purpose : Dimension of one edge //======================================================================= -AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge, - const gp_Pln& thePlane) -: AIS_Dimension (AIS_KOD_LENGTH), +PrsDim_LengthDimension::PrsDim_LengthDimension (const TopoDS_Edge& theEdge, + const gp_Pln& thePlane) +: PrsDim_Dimension (PrsDim_KOD_LENGTH), myHasCustomDirection (Standard_False) { SetMeasuredGeometry (theEdge, thePlane); @@ -110,9 +109,9 @@ AIS_LengthDimension::AIS_LengthDimension (const TopoDS_Edge& theEdge, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_LengthDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const gp_Pln& thePlane) +void PrsDim_LengthDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const gp_Pln& thePlane) { myFirstPoint = theFirstPoint; mySecondPoint = theSecondPoint; @@ -129,8 +128,8 @@ void AIS_LengthDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Edge& theEdge, - const gp_Pln& thePlane) +void PrsDim_LengthDimension::SetMeasuredGeometry (const TopoDS_Edge& theEdge, + const gp_Pln& thePlane) { myFirstShape = theEdge; mySecondShape = TopoDS_Shape(); @@ -145,8 +144,8 @@ void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Edge& theEdge, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace) +void PrsDim_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace) { SetMeasuredShapes (theFirstFace, theSecondFace); } @@ -155,8 +154,8 @@ void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFace, - const TopoDS_Edge& theEdge) +void PrsDim_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFace, + const TopoDS_Edge& theEdge) { SetMeasuredShapes (theFace, theEdge); } @@ -165,8 +164,8 @@ void AIS_LengthDimension::SetMeasuredGeometry (const TopoDS_Face& theFace, //function : SetMeasuredShapes //purpose : //======================================================================= -void AIS_LengthDimension::SetMeasuredShapes (const TopoDS_Shape& theFirstShape, - const TopoDS_Shape& theSecondShape) +void PrsDim_LengthDimension::SetMeasuredShapes (const TopoDS_Shape& theFirstShape, + const TopoDS_Shape& theSecondShape) { gp_Pln aComputedPlane; Standard_Boolean isPlaneReturned = Standard_False; @@ -194,7 +193,7 @@ void AIS_LengthDimension::SetMeasuredShapes (const TopoDS_Shape& theFirstShape, //function : CheckPlane //purpose : //======================================================================= -Standard_Boolean AIS_LengthDimension::CheckPlane (const gp_Pln& thePlane) const +Standard_Boolean PrsDim_LengthDimension::CheckPlane (const gp_Pln& thePlane) const { Standard_Boolean anIsFaultyNormal = 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 //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)) { @@ -228,7 +227,7 @@ gp_Pln AIS_LengthDimension::ComputePlane (const gp_Dir& theAttachDir) const //function : GetModelUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_LengthDimension::GetModelUnits() const +const TCollection_AsciiString& PrsDim_LengthDimension::GetModelUnits() const { return myDrawer->DimLengthModelUnits(); } @@ -237,7 +236,7 @@ const TCollection_AsciiString& AIS_LengthDimension::GetModelUnits() const //function : GetDisplayUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_LengthDimension::GetDisplayUnits() const +const TCollection_AsciiString& PrsDim_LengthDimension::GetDisplayUnits() const { return myDrawer->DimLengthDisplayUnits(); } @@ -246,7 +245,7 @@ const TCollection_AsciiString& AIS_LengthDimension::GetDisplayUnits() const //function : SetModelUnits //purpose : //======================================================================= -void AIS_LengthDimension::SetModelUnits (const TCollection_AsciiString& theUnits) +void PrsDim_LengthDimension::SetModelUnits (const TCollection_AsciiString& theUnits) { myDrawer->SetDimLengthModelUnits (theUnits); } @@ -255,7 +254,7 @@ void AIS_LengthDimension::SetModelUnits (const TCollection_AsciiString& theUnits //function : SetDisplayUnits //purpose : //======================================================================= -void AIS_LengthDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) +void PrsDim_LengthDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) { myDrawer->SetDimLengthDisplayUnits (theUnits); } @@ -264,7 +263,7 @@ void AIS_LengthDimension::SetDisplayUnits (const TCollection_AsciiString& theUni //function : ComputeValue //purpose : //======================================================================= -Standard_Real AIS_LengthDimension::ComputeValue() const +Standard_Real PrsDim_LengthDimension::ComputeValue() const { if (!IsValid()) return 0.0; @@ -279,9 +278,9 @@ Standard_Real AIS_LengthDimension::ComputeValue() const //function : Compute //purpose : //======================================================================= -void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) +void PrsDim_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, + const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Integer theMode) { mySelectionGeom.Clear (theMode); @@ -297,12 +296,12 @@ void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& / //function : ComputeFlyoutLinePoints //purpose : //======================================================================= -void AIS_LengthDimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint, - gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint) +void PrsDim_LengthDimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, const gp_Pnt& theSecondPoint, + gp_Pnt& theLineBegPoint, gp_Pnt& theLineEndPoint) { if (!myHasCustomDirection) { - AIS_Dimension::ComputeFlyoutLinePoints (theFirstPoint, theSecondPoint, theLineBegPoint, theLineEndPoint); + PrsDim_Dimension::ComputeFlyoutLinePoints (theFirstPoint, theSecondPoint, theLineBegPoint, theLineEndPoint); return; } @@ -326,8 +325,8 @@ void AIS_LengthDimension::ComputeFlyoutLinePoints (const gp_Pnt& theFirstPoint, //function : ComputeFlyoutSelection //purpose : //======================================================================= -void AIS_LengthDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, - const Handle(SelectMgr_EntityOwner)& theEntityOwner) +void PrsDim_LengthDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selection)& theSelection, + const Handle(SelectMgr_EntityOwner)& theEntityOwner) { if (!IsValid()) { @@ -341,8 +340,8 @@ void AIS_LengthDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selecti //function : IsValidPoints //purpose : //======================================================================= -Standard_Boolean AIS_LengthDimension::IsValidPoints (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint) const +Standard_Boolean PrsDim_LengthDimension::IsValidPoints (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint) const { return theFirstPoint.Distance (theSecondPoint) > Precision::Confusion(); } @@ -351,9 +350,9 @@ Standard_Boolean AIS_LengthDimension::IsValidPoints (const gp_Pnt& theFirstPoint //function : InitTwoEdgesLength //purpose : Initialization of dimension between two linear edges //======================================================================= -Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& theFirstEdge, - const TopoDS_Edge& theSecondEdge, - gp_Dir& theDirAttach) +Standard_Boolean PrsDim_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& theFirstEdge, + const TopoDS_Edge& theSecondEdge, + gp_Dir& theDirAttach) { BRepAdaptor_Curve aFirstCurveAdapt (theFirstEdge); if (aFirstCurveAdapt.GetType() != GeomAbs_Line) @@ -377,12 +376,12 @@ Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& the Standard_Boolean isFirstInfinite = Standard_False; Standard_Boolean isSecondInfinite = Standard_False; - if (!AIS::ComputeGeometry (theFirstEdge, theSecondEdge, - aFirstCurve, aSecondCurve, - aPoint11, aPoint12, - aPoint21, aPoint22, - isFirstInfinite, - isSecondInfinite)) + if (!PrsDim::ComputeGeometry (theFirstEdge, theSecondEdge, + aFirstCurve, aSecondCurve, + aPoint11, aPoint12, + aPoint21, aPoint22, + isFirstInfinite, + isSecondInfinite)) { return Standard_False; } @@ -401,13 +400,13 @@ Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& the if (!isFirstInfinite) { - if (AIS::Nearest (aSecondCurve, aPoint11, aPoint21, aPoint22, aPoint)) + if (PrsDim::Nearest (aSecondCurve, aPoint11, aPoint21, aPoint22, aPoint)) { myFirstPoint = aPoint11; mySecondPoint = aPoint; return IsValidPoints (myFirstPoint, mySecondPoint); } - else if (AIS::Nearest (aSecondCurve, aPoint12, aPoint21, aPoint22, aPoint)) + else if (PrsDim::Nearest (aSecondCurve, aPoint12, aPoint21, aPoint22, aPoint)) { myFirstPoint = aPoint12; mySecondPoint = aPoint; @@ -417,13 +416,13 @@ Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& the if (!isSecondInfinite) { - if (AIS::Nearest (aFirstCurve, aPoint21, aPoint11, aPoint12, aPoint)) + if (PrsDim::Nearest (aFirstCurve, aPoint21, aPoint11, aPoint12, aPoint)) { myFirstPoint = aPoint; mySecondPoint = aPoint21; return IsValidPoints (myFirstPoint, mySecondPoint); } - if (AIS::Nearest (aFirstCurve, aPoint22, aPoint11, aPoint12, aPoint)) + if (PrsDim::Nearest (aFirstCurve, aPoint22, aPoint11, aPoint12, aPoint)) { myFirstPoint = aPoint; mySecondPoint = aPoint22; @@ -440,16 +439,16 @@ Standard_Boolean AIS_LengthDimension::InitTwoEdgesLength (const TopoDS_Edge& the //function : InitEdgeVertexLength //purpose : for first edge and second vertex shapes //======================================================================= -Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& theEdge, - const TopoDS_Vertex& theVertex, - gp_Dir& theEdgeDir, - Standard_Boolean isInfinite) +Standard_Boolean PrsDim_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& theEdge, + const TopoDS_Vertex& theVertex, + gp_Dir& theEdgeDir, + Standard_Boolean isInfinite) { gp_Pnt anEdgePoint1 (gp::Origin()); gp_Pnt anEdgePoint2 (gp::Origin()); Handle(Geom_Curve) aCurve; - if (!AIS::ComputeGeometry (theEdge, aCurve, anEdgePoint1, anEdgePoint2, isInfinite)) + if (!PrsDim::ComputeGeometry (theEdge, aCurve, anEdgePoint1, anEdgePoint2, isInfinite)) { return Standard_False; } @@ -462,7 +461,7 @@ Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& t // Get direction of edge to build plane automatically. theEdgeDir = aLin.Direction(); - mySecondPoint = AIS::Nearest (aLin, myFirstPoint); + mySecondPoint = PrsDim::Nearest (aLin, myFirstPoint); return IsValidPoints (myFirstPoint, mySecondPoint); } @@ -471,9 +470,9 @@ Standard_Boolean AIS_LengthDimension::InitEdgeVertexLength (const TopoDS_Edge& t //function : InitEdgeFaceLength //purpose : //======================================================================= -Standard_Boolean AIS_LengthDimension::InitEdgeFaceLength (const TopoDS_Edge& theEdge, - const TopoDS_Face& theFace, - gp_Dir& theEdgeDir) +Standard_Boolean PrsDim_LengthDimension::InitEdgeFaceLength (const TopoDS_Edge& theEdge, + const TopoDS_Face& theFace, + gp_Dir& theEdgeDir) { theEdgeDir = gp::DX(); @@ -522,10 +521,10 @@ Standard_Boolean AIS_LengthDimension::InitEdgeFaceLength (const TopoDS_Edge& the //purpose : Initialization of two points where dimension layouts // will be attached //======================================================================= -Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& theFirstShape, - const TopoDS_Shape& theSecondShape, - gp_Pln& theComputedPlane, - Standard_Boolean& theIsPlaneComputed) +Standard_Boolean PrsDim_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& theFirstShape, + const TopoDS_Shape& theSecondShape, + gp_Pln& theComputedPlane, + Standard_Boolean& theIsPlaneComputed) { theIsPlaneComputed = Standard_False; gp_Dir aDirAttach; @@ -538,16 +537,16 @@ Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& t // Initialization for face gp_Pln aFirstPlane; Handle(Geom_Surface) aFirstSurface; - AIS_KindOfSurface aFirstSurfKind; + PrsDim_KindOfSurface aFirstSurfKind; Standard_Real aFirstOffset; TopoDS_Face aFirstFace = TopoDS::Face (theFirstShape); - AIS::InitFaceLength (TopoDS::Face (theFirstShape), - aFirstPlane, - aFirstSurface, - aFirstSurfKind, - aFirstOffset); + PrsDim::InitFaceLength (TopoDS::Face (theFirstShape), + aFirstPlane, + aFirstSurface, + aFirstSurfKind, + aFirstOffset); if (theSecondShape.ShapeType() == TopAbs_FACE) { @@ -555,18 +554,18 @@ Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& t myGeometryType = GeometryType_Faces; gp_Pln aSecondPlane; Handle(Geom_Surface) aSecondSurface; - AIS_KindOfSurface aSecondSurfKind; + PrsDim_KindOfSurface aSecondSurfKind; Standard_Real aSecondOffset; TopoDS_Face aSecondFace = TopoDS::Face (theSecondShape); - AIS::InitFaceLength (aSecondFace, - aSecondPlane, - aSecondSurface, - aSecondSurfKind, - aSecondOffset); + PrsDim::InitFaceLength (aSecondFace, + aSecondPlane, + aSecondSurface, + aSecondSurfKind, + aSecondOffset); - if (aFirstSurfKind == AIS_KOS_Plane) + if (aFirstSurfKind == PrsDim_KOS_Plane) { 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())); } - mySecondPoint = AIS::ProjectPointOnPlane (myFirstPoint, aSecondPlane); + mySecondPoint = PrsDim::ProjectPointOnPlane (myFirstPoint, aSecondPlane); Standard_Real 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) { - mySecondPoint = AIS::Nearest (aSecondFace, myFirstPoint); + mySecondPoint = PrsDim::Nearest (aSecondFace, myFirstPoint); } isSuccess = IsValidPoints (myFirstPoint, mySecondPoint); @@ -752,7 +751,7 @@ Standard_Boolean AIS_LengthDimension::InitTwoShapesPoints (const TopoDS_Shape& t // Attention: 1) can be only the edge in currect implementation // 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) { @@ -786,7 +785,7 @@ Standard_Boolean AIS_LengthDimension::InitOneShapePoints (const TopoDS_Shape& th //function : GetTextPosition //purpose : //======================================================================= -const gp_Pnt AIS_LengthDimension::GetTextPosition() const +gp_Pnt PrsDim_LengthDimension::GetTextPosition() const { if (IsTextPositionCustom()) { @@ -801,7 +800,7 @@ const gp_Pnt AIS_LengthDimension::GetTextPosition() const //function : SetTextPosition //purpose : //======================================================================= -void AIS_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos) +void PrsDim_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos) { if (!IsValid()) { @@ -818,7 +817,7 @@ void AIS_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos) //function : SetDirection //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; if (myHasCustomDirection) diff --git a/src/AIS/AIS_LengthDimension.hxx b/src/PrsDim/PrsDim_LengthDimension.hxx old mode 100755 new mode 100644 similarity index 86% rename from src/AIS/AIS_LengthDimension.hxx rename to src/PrsDim/PrsDim_LengthDimension.hxx index 44eef508e6..e2d989ca5c --- a/src/AIS/AIS_LengthDimension.hxx +++ b/src/PrsDim/PrsDim_LengthDimension.hxx @@ -11,12 +11,11 @@ // 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 +#ifndef _PrsDim_LengthDimension_HeaderFile +#define _PrsDim_LengthDimension_HeaderFile -#include -#include -#include +#include +#include #include #include #include @@ -25,7 +24,7 @@ #include #include -DEFINE_STANDARD_HANDLE (AIS_LengthDimension, AIS_Dimension) +DEFINE_STANDARD_HANDLE (PrsDim_LengthDimension, PrsDim_Dimension) //! Length dimension. Can be constructued: //! - Between two generic points. @@ -45,72 +44,61 @@ DEFINE_STANDARD_HANDLE (AIS_LengthDimension, AIS_Dimension) //! or the distance between measured points is less than //! Precision::Confusion(), the dimension is invalid and its //! 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: //! Construct length dimension between face and edge. //! Here dimension can be built without user-defined plane. //! @param theFace [in] the face (first shape). //! @param theEdge [in] the edge (second shape). - Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFace, - const TopoDS_Edge& theEdge); + Standard_EXPORT PrsDim_LengthDimension (const TopoDS_Face& theFace, + const TopoDS_Edge& theEdge); //! Construct length dimension between two faces. //! @param theFirstFace [in] the first face (first shape). //! @param theSecondFace [in] the second face (second shape). - Standard_EXPORT AIS_LengthDimension (const TopoDS_Face& theFirstFace, - const TopoDS_Face& theSecondFace); + Standard_EXPORT PrsDim_LengthDimension (const TopoDS_Face& theFirstFace, + const TopoDS_Face& theSecondFace); //! Construct length dimension between two points in //! the specified plane. //! @param theFirstPoint [in] the first point. //! @param theSecondPoint [in] the second point. //! @param thePlane [in] the plane to orient dimension. - Standard_EXPORT AIS_LengthDimension (const gp_Pnt& theFirstPoint, - const gp_Pnt& theSecondPoint, - const gp_Pln& thePlane); + Standard_EXPORT PrsDim_LengthDimension (const gp_Pnt& theFirstPoint, + const gp_Pnt& theSecondPoint, + const gp_Pln& thePlane); //! Construct length dimension between two arbitrary shapes in //! the specified plane. //! @param theFirstShape [in] the first shape. //! @param theSecondShape [in] the second shape. //! @param thePlane [in] the plane to orient dimension. - Standard_EXPORT AIS_LengthDimension (const TopoDS_Shape& theFirstShape, - const TopoDS_Shape& theSecondShape, - const gp_Pln& thePlane); + Standard_EXPORT PrsDim_LengthDimension (const TopoDS_Shape& theFirstShape, + const TopoDS_Shape& theSecondShape, + const gp_Pln& thePlane); //! Construct length dimension of linear edge. //! @param theEdge [in] the edge to measure. //! @param thePlane [in] the plane to orient dimension. - Standard_EXPORT AIS_LengthDimension (const TopoDS_Edge& theEdge, - const gp_Pln& thePlane); + Standard_EXPORT PrsDim_LengthDimension (const TopoDS_Edge& theEdge, + const gp_Pln& thePlane); public: //! @return first attachement point. - const gp_Pnt& FirstPoint() const - { - return myFirstPoint; - } + const gp_Pnt& FirstPoint() const { return myFirstPoint; } //! @return second attachement point. - const gp_Pnt& SecondPoint() const - { - return mySecondPoint; - } + const gp_Pnt& SecondPoint() const { return mySecondPoint; } //! @return first attachement shape. - const TopoDS_Shape& FirstShape() const - { - return myFirstShape; - } + const TopoDS_Shape& FirstShape() const { return myFirstShape; } //! @return second attachement shape. - const TopoDS_Shape& SecondShape() const - { - return mySecondShape; - } + const TopoDS_Shape& SecondShape() const { return mySecondShape; } public: @@ -167,7 +155,7 @@ public: 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 //! 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. Standard_EXPORT void SetDirection (const gp_Dir& theDirection, const Standard_Boolean theUseDirection = Standard_True); -public: - - DEFINE_STANDARD_RTTIEXT(AIS_LengthDimension,AIS_Dimension) - protected: //! Checks if the plane includes first and second points to build dimension. @@ -262,4 +246,4 @@ private: Standard_Boolean myHasCustomDirection; }; -#endif // _AIS_LengthDimension_HeaderFile +#endif // _PrsDim_LengthDimension_HeaderFile diff --git a/src/AIS/AIS_MaxRadiusDimension.cxx b/src/PrsDim/PrsDim_MaxRadiusDimension.cxx similarity index 84% rename from src/AIS/AIS_MaxRadiusDimension.cxx rename to src/PrsDim/PrsDim_MaxRadiusDimension.cxx index 0efd40848b..271304c896 100644 --- a/src/AIS/AIS_MaxRadiusDimension.cxx +++ b/src/PrsDim/PrsDim_MaxRadiusDimension.cxx @@ -14,10 +14,10 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include -#include +#include +#include #include #include #include @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -52,21 +51,20 @@ #include #include #include -#include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_MaxRadiusDimension,AIS_EllipseRadiusDimension) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_MaxRadiusDimension, PrsDim_EllipseRadiusDimension) //======================================================================= -//function : AIS_MaxRadiusDimension +//function : PrsDim_MaxRadiusDimension //purpose : //======================================================================= -AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, +PrsDim_MaxRadiusDimension::PrsDim_MaxRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText) -:AIS_EllipseRadiusDimension(aShape, aText) +:PrsDim_EllipseRadiusDimension(aShape, aText) { myVal = aVal; mySymbolPrs = DsgPrs_AS_LASTAR; @@ -75,17 +73,17 @@ AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, } //======================================================================= -//function : AIS_MaxRadiusDimension +//function : PrsDim_MaxRadiusDimension //purpose : //======================================================================= -AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, +PrsDim_MaxRadiusDimension::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) -:AIS_EllipseRadiusDimension(aShape, aText) +:PrsDim_EllipseRadiusDimension(aShape, aText) { myVal = aVal; mySymbolPrs = aSymbolPrs; @@ -99,7 +97,7 @@ AIS_MaxRadiusDimension::AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, //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 Standard_Integer /*aMode*/) { @@ -122,7 +120,7 @@ void AIS_MaxRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& //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(); @@ -144,7 +142,7 @@ void AIS_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP myAutomaticPosition = Standard_True; if ( myIsSetBndBox ) - myPosition = AIS::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), + myPosition = PrsDim::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), myBndBox ); curPos = myPosition; } @@ -171,7 +169,7 @@ void AIS_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP //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(); @@ -189,12 +187,12 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation Standard_Boolean IsInDomain = Standard_True; if( myAutomaticPosition ) { - myEndOfArrow = AIS::NearestApex(myEllipse, myApexP, myApexN, + myEndOfArrow = PrsDim::NearestApex(myEllipse, myApexP, myApexN, myFirstPar, myLastPar, IsInDomain); myPosition = Center; myAutomaticPosition = Standard_True; if ( myIsSetBndBox ) - myPosition = AIS::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), + myPosition = PrsDim::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), myBndBox ); curPos = myPosition; } @@ -211,7 +209,7 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation else myEndOfArrow = myApexN ; par = ElCLib::Parameter ( myEllipse, myEndOfArrow ); - IsInDomain = AIS::InDomain( myFirstPar, myLastPar, par ); + IsInDomain = PrsDim::InDomain( myFirstPar, myLastPar, par ); myPosition = curPos; } @@ -219,8 +217,8 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation Standard_Real parStart = 0.; if( !IsInDomain ) { - if(AIS::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < - AIS::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) + if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < + PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) parStart = myFirstPar; else parStart = myLastPar; @@ -240,7 +238,7 @@ void AIS_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation //purpose : //======================================================================= -void AIS_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer /*aMode*/) { @@ -274,11 +272,11 @@ void AIS_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& { Standard_Real parEnd = ElCLib::Parameter ( myEllipse, myEndOfArrow ); - if(!AIS::InDomain(myFirstPar, myLastPar, parEnd)) + if(!PrsDim::InDomain(myFirstPar, myLastPar, parEnd)) { Standard_Real parStart, par; - if(AIS::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < - AIS::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) + if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < + PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) par = myFirstPar; else par = myLastPar; diff --git a/src/AIS/AIS_MaxRadiusDimension.hxx b/src/PrsDim/PrsDim_MaxRadiusDimension.hxx similarity index 69% rename from src/AIS/AIS_MaxRadiusDimension.hxx rename to src/PrsDim/PrsDim_MaxRadiusDimension.hxx index a952ceb601..73bf38cba0 100644 --- a/src/AIS/AIS_MaxRadiusDimension.hxx +++ b/src/PrsDim/PrsDim_MaxRadiusDimension.hxx @@ -14,29 +14,29 @@ // 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 +#ifndef _PrsDim_MaxRadiusDimension_HeaderFile +#define _PrsDim_MaxRadiusDimension_HeaderFile -#include +#include #include -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 //! or Face (planar or cylindrical(surface of extrusion or //! 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: //! Max Ellipse radius dimension //! 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 //! 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: @@ -48,10 +48,12 @@ private: Standard_EXPORT void ComputeArcOfEllipse (const Handle(Prs3d_Presentation)& aPresentation); +private: + gp_Pnt myApexP; gp_Pnt myApexN; gp_Pnt myEndOfArrow; }; -#endif // _AIS_MaxRadiusDimension_HeaderFile +#endif // _PrsDim_MaxRadiusDimension_HeaderFile diff --git a/src/AIS/AIS_MidPointRelation.cxx b/src/PrsDim/PrsDim_MidPointRelation.cxx similarity index 92% rename from src/AIS/AIS_MidPointRelation.cxx rename to src/PrsDim/PrsDim_MidPointRelation.cxx index 13e8dee989..b2eb17892b 100644 --- a/src/AIS/AIS_MidPointRelation.cxx +++ b/src/PrsDim/PrsDim_MidPointRelation.cxx @@ -13,9 +13,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -46,23 +45,22 @@ #include #include #include -#include #include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_MidPointRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_MidPointRelation, PrsDim_Relation) //======================================================================= -//function : AIS_MidPointRelation +//function : PrsDim_MidPointRelation //purpose : //======================================================================= -AIS_MidPointRelation::AIS_MidPointRelation(const TopoDS_Shape& aMidPointTool, +PrsDim_MidPointRelation::PrsDim_MidPointRelation(const TopoDS_Shape& aMidPointTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane) -:AIS_Relation(), +:PrsDim_Relation(), myTool(aMidPointTool) { SetFirstShape(FirstShape); @@ -75,7 +73,7 @@ AIS_MidPointRelation::AIS_MidPointRelation(const TopoDS_Shape& aMidPointTool, //function : Compute //purpose : //======================================================================= -void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, +void PrsDim_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, const Handle(Prs3d_Presentation)& aprs, const Standard_Integer) { @@ -83,7 +81,7 @@ void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, { gp_Pnt pp; 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); } @@ -140,7 +138,7 @@ void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, //function : ComputeSelection //purpose : //======================================================================= -void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSel, +void PrsDim_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSel, const Standard_Integer) { Handle(Select3D_SensitiveSegment) seg; @@ -180,7 +178,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a if ( myFShape.ShapeType() == TopAbs_EDGE ) { 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 { // segment on line @@ -215,7 +213,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a if ( mySShape.ShapeType() == TopAbs_EDGE ) { 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 { // segment on line @@ -251,7 +249,7 @@ void AIS_MidPointRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a //function : ComputeFaceFromPnt //purpose : //======================================================================= -void AIS_MidPointRelation::ComputeFaceFromPnt(const Handle(Prs3d_Presentation)&, +void PrsDim_MidPointRelation::ComputeFaceFromPnt(const Handle(Prs3d_Presentation)&, const Standard_Boolean /*first*/) { } @@ -260,7 +258,7 @@ void AIS_MidPointRelation::ComputeFaceFromPnt(const Handle(Prs3d_Presentation)&, //function : ComputeEdgeFromPnt //purpose : //======================================================================= -void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)& aprs, +void PrsDim_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first) { TopoDS_Edge E; @@ -271,7 +269,7 @@ void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)& gp_Pnt ptat1,ptat2; Handle(Geom_Curve) extCurv; 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(); @@ -318,7 +316,7 @@ void AIS_MidPointRelation::ComputeEdgeFromPnt(const Handle(Prs3d_Presentation)& //function : ComputeVertexFromPnt //purpose : //======================================================================= -void AIS_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation)& aprs, +void PrsDim_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first) { gp_Ax2 ax = myPlane->Pln().Position().Ax2(); @@ -326,7 +324,7 @@ void AIS_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation) { Standard_Boolean isOnPlane; 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); if ( !isOnPlane ) ComputeProjVertexPresentation(aprs,V,myFAttach); } @@ -334,7 +332,7 @@ void AIS_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation) { Standard_Boolean isOnPlane; 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); if ( !isOnPlane ) ComputeProjVertexPresentation(aprs,V,mySAttach); } @@ -344,7 +342,7 @@ void AIS_MidPointRelation::ComputeVertexFromPnt(const Handle(Prs3d_Presentation) //function : ComputePointsOnLine //purpose : //======================================================================= -void AIS_MidPointRelation::ComputePointsOnLine(const gp_Lin& aLin, +void PrsDim_MidPointRelation::ComputePointsOnLine(const gp_Lin& aLin, const Standard_Boolean first) { Standard_Real ppar = ElCLib::Parameter(aLin,myMidPoint); @@ -377,7 +375,7 @@ void AIS_MidPointRelation::ComputePointsOnLine(const gp_Lin& aLin, //function : ComputePointsOnLine //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) { gp_Vec aVec (pnt1,pnt2); @@ -444,7 +442,7 @@ void AIS_MidPointRelation::ComputePointsOnLine(const gp_Pnt& pnt1, const gp_Pnt& //function : ComputePointsOnCirc //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 Standard_Boolean first) { @@ -571,7 +569,7 @@ void AIS_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc, //function : ComputePointsOnElips //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 Standard_Boolean first) { diff --git a/src/AIS/AIS_MidPointRelation.hxx b/src/PrsDim/PrsDim_MidPointRelation.hxx similarity index 79% rename from src/AIS/AIS_MidPointRelation.hxx rename to src/PrsDim/PrsDim_MidPointRelation.hxx index ca13b551b9..a34a441675 100644 --- a/src/AIS/AIS_MidPointRelation.hxx +++ b/src/PrsDim/PrsDim_MidPointRelation.hxx @@ -13,10 +13,10 @@ // 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 +#ifndef _PrsDim_MidPointRelation_HeaderFile +#define _PrsDim_MidPointRelation_HeaderFile -#include +#include class Geom_Plane; class gp_Lin; @@ -24,21 +24,21 @@ class gp_Pnt; class gp_Circ; class gp_Elips; -DEFINE_STANDARD_HANDLE(AIS_MidPointRelation, AIS_Relation) +DEFINE_STANDARD_HANDLE(PrsDim_MidPointRelation, PrsDim_Relation) //! 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: - Standard_EXPORT AIS_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; - - void SetTool (const TopoDS_Shape& aMidPointTool); - - const TopoDS_Shape& GetTool() const; + 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 { return Standard_True; } + + void SetTool (const TopoDS_Shape& aMidPointTool) { myTool = aMidPointTool; } + + const TopoDS_Shape& GetTool() const { return myTool; } private: @@ -72,6 +72,8 @@ private: //! .______. myFirstPnt Standard_EXPORT void ComputePointsOnElips (const gp_Elips& anEll, const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Boolean first); +private: + TopoDS_Shape myTool; gp_Pnt myMidPoint; gp_Pnt myFAttach; @@ -83,6 +85,4 @@ private: }; -#include - #endif // _AIS_MidPointRelation_HeaderFile diff --git a/src/AIS/AIS_MinRadiusDimension.cxx b/src/PrsDim/PrsDim_MinRadiusDimension.cxx similarity index 84% rename from src/AIS/AIS_MinRadiusDimension.cxx rename to src/PrsDim/PrsDim_MinRadiusDimension.cxx index d49da7f06c..4281d20015 100644 --- a/src/AIS/AIS_MinRadiusDimension.cxx +++ b/src/PrsDim/PrsDim_MinRadiusDimension.cxx @@ -14,10 +14,10 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include -#include +#include +#include #include #include #include @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -52,21 +51,20 @@ #include #include #include -#include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_MinRadiusDimension,AIS_EllipseRadiusDimension) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_MinRadiusDimension, PrsDim_EllipseRadiusDimension) //======================================================================= -//function : AIS_MinRadiusDimension +//function : PrsDim_MinRadiusDimension //purpose : //======================================================================= -AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape, +PrsDim_MinRadiusDimension::PrsDim_MinRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText) -:AIS_EllipseRadiusDimension(aShape, aText) +:PrsDim_EllipseRadiusDimension(aShape, aText) { myVal = aVal; mySymbolPrs = DsgPrs_AS_LASTAR; @@ -75,17 +73,17 @@ AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape, } //======================================================================= -//function : AIS_MinRadiusDimension +//function : PrsDim_MinRadiusDimension //purpose : //======================================================================= -AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape, +PrsDim_MinRadiusDimension::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) -:AIS_EllipseRadiusDimension(aShape, aText) +:PrsDim_EllipseRadiusDimension(aShape, aText) { myVal = aVal; mySymbolPrs = aSymbolPrs; @@ -99,7 +97,7 @@ AIS_MinRadiusDimension::AIS_MinRadiusDimension(const TopoDS_Shape& aShape, //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 Standard_Integer /*aMode*/) { @@ -122,7 +120,7 @@ void AIS_MinRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& //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(); @@ -144,7 +142,7 @@ void AIS_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP myAutomaticPosition = Standard_True; if ( myIsSetBndBox ) - myPosition = AIS::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), + myPosition = PrsDim::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), myBndBox ); curPos = myPosition; } @@ -172,7 +170,7 @@ void AIS_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& aP //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(); @@ -190,12 +188,12 @@ void AIS_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation Standard_Boolean IsInDomain = Standard_True; if( myAutomaticPosition ) { - myEndOfArrow = AIS::NearestApex(myEllipse, myApexP, myApexN, + myEndOfArrow = PrsDim::NearestApex(myEllipse, myApexP, myApexN, myFirstPar, myLastPar, IsInDomain); myPosition = Center; myAutomaticPosition = Standard_True; if ( myIsSetBndBox ) - myPosition = AIS::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), + myPosition = PrsDim::TranslatePointToBound(myPosition, gp_Dir(gp_Vec( Center, myPosition )), myBndBox ); curPos = myPosition; @@ -211,15 +209,15 @@ void AIS_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation else myEndOfArrow = myApexN ; par = ElCLib::Parameter ( myEllipse, myEndOfArrow ); - IsInDomain = AIS::InDomain(myFirstPar, myLastPar, par); + IsInDomain = PrsDim::InDomain(myFirstPar, myLastPar, par); myPosition = curPos; } Standard_Real parStart =0.; if( !IsInDomain ) { - if(AIS::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < - AIS::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) + if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < + PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) parStart = myFirstPar; else parStart = myLastPar; @@ -242,7 +240,7 @@ void AIS_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentation //purpose : //======================================================================= -void AIS_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer /*aMode*/) { @@ -276,11 +274,11 @@ void AIS_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)& { Standard_Real parEnd = ElCLib::Parameter ( myEllipse, myEndOfArrow ); - if(!AIS::InDomain(myFirstPar, myLastPar, parEnd)) + if(!PrsDim::InDomain(myFirstPar, myLastPar, parEnd)) { Standard_Real parStart, par; - if(AIS::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < - AIS::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) + if(PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myFirstPar) < + PrsDim::DistanceFromApex (myEllipse, myEndOfArrow, myLastPar)) par = myFirstPar; else par = myLastPar; diff --git a/src/AIS/AIS_MinRadiusDimension.hxx b/src/PrsDim/PrsDim_MinRadiusDimension.hxx similarity index 69% rename from src/AIS/AIS_MinRadiusDimension.hxx rename to src/PrsDim/PrsDim_MinRadiusDimension.hxx index 7eda655a6d..89a14185fe 100644 --- a/src/AIS/AIS_MinRadiusDimension.hxx +++ b/src/PrsDim/PrsDim_MinRadiusDimension.hxx @@ -14,29 +14,29 @@ // 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 +#ifndef _PrsDim_MinRadiusDimension_HeaderFile +#define _PrsDim_MinRadiusDimension_HeaderFile -#include +#include #include -DEFINE_STANDARD_HANDLE(AIS_MinRadiusDimension, AIS_EllipseRadiusDimension) +DEFINE_STANDARD_HANDLE(PrsDim_MinRadiusDimension, PrsDim_EllipseRadiusDimension) //! -- Ellipse Min radius dimension of a Shape which //! can be Edge or Face (planar or cylindrical(surface of //! 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: //! Max Ellipse radius dimension //! 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 //! 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: @@ -48,10 +48,12 @@ private: Standard_EXPORT void ComputeArcOfEllipse (const Handle(Prs3d_Presentation)& aPresentation); +private: + gp_Pnt myApexP; gp_Pnt myApexN; gp_Pnt myEndOfArrow; }; -#endif // _AIS_MinRadiusDimension_HeaderFile +#endif // _PrsDim_MinRadiusDimension_HeaderFile diff --git a/src/AIS/AIS_OffsetDimension.cxx b/src/PrsDim/PrsDim_OffsetDimension.cxx similarity index 90% rename from src/AIS/AIS_OffsetDimension.cxx rename to src/PrsDim/PrsDim_OffsetDimension.cxx index eaf8623f13..9dfed5f9e0 100644 --- a/src/AIS/AIS_OffsetDimension.cxx +++ b/src/PrsDim/PrsDim_OffsetDimension.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -46,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -55,17 +53,17 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_OffsetDimension,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_OffsetDimension, PrsDim_Relation) //======================================================================= -//function : AIS_OffsetDimension +//function : PrsDim_OffsetDimension //purpose : //======================================================================= -AIS_OffsetDimension::AIS_OffsetDimension(const TopoDS_Shape& FistShape, +PrsDim_OffsetDimension::PrsDim_OffsetDimension(const TopoDS_Shape& FistShape, const TopoDS_Shape& SecondShape, const Standard_Real aVal, const TCollection_ExtendedString& aText) -:AIS_Relation(), +:PrsDim_Relation(), myFAttach(0.,0.,0.), mySAttach(0.,0.,0.) { @@ -78,14 +76,14 @@ mySAttach(0.,0.,0.) myArrowSize = fabs (myVal/10.0); if (myArrowSize > 30.) myArrowSize = 30.; if (myArrowSize < 15.) myArrowSize = 15.; - //std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"< 30.) myArrowSize = 30.; if (myArrowSize < 15.) myArrowSize = 15.; - //std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"< 30.) myArrowSize = 30.; if (myArrowSize < 15.) myArrowSize = 15.; - //std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<DimensionAspect(); Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect(); - //std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<SetLength(myArrowSize); arr = la->ArrowAspect(); arr->SetLength(myArrowSize); @@ -316,7 +314,7 @@ void AIS_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)& gp_Pnt Tcurpos = curpos.Transformed (aTrsf); if (myIsSetBndBox) - Tcurpos = AIS::TranslatePointToBound( Tcurpos, myDirAttach, myBndBox ); + Tcurpos = PrsDim::TranslatePointToBound( Tcurpos, myDirAttach, myBndBox ); DsgPrs_OffsetPresentation::AddAxes(aprs, myDrawer, @@ -340,7 +338,7 @@ void AIS_OffsetDimension::ComputeTwoAxesOffset(const Handle(Prs3d_Presentation)& //function : ComputeTwoFacesOffset //purpose : //======================================================================= -void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)& aprs, +void PrsDim_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation)& aprs, const gp_Trsf& aTrsf) { gp_Dir norm1 = myDirAttach; @@ -372,7 +370,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation) } curpos = myPosition; - myFAttach = AIS::Nearest(myFShape,curpos); + myFAttach = PrsDim::Nearest(myFShape,curpos); if (myFAttach.Distance(curpos) <= Precision::Confusion()) { gp_Ax2 ax2(myFAttach,norm1); myDirAttach = ax2.XDirection(); @@ -392,7 +390,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation) } } // en attendant mieux - mySAttach = AIS::Nearest(mySShape,curpos); + mySAttach = PrsDim::Nearest(mySShape,curpos); gp_Ax3 anax3 (myax2); gp_Pln apln (anax3); @@ -410,7 +408,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation) Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect(); - //std::cout<<"AIS_OffsetDimension::AIS_OffsetDimension " << myArrowSize << " myArrowSize"<SetLength(myArrowSize); arr = la->ArrowAspect(); arr->SetLength(myArrowSize); @@ -425,7 +423,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation) if (myIsSetBndBox) { 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, @@ -451,7 +449,7 @@ void AIS_OffsetDimension::ComputeTwoFacesOffset(const Handle(Prs3d_Presentation) //function : ComputeAxeFaceOffset //purpose : //======================================================================= -void AIS_OffsetDimension::ComputeAxeFaceOffset(const Handle(Prs3d_Presentation)& aprs, +void PrsDim_OffsetDimension::ComputeAxeFaceOffset(const Handle(Prs3d_Presentation)& aprs, const gp_Trsf& aTrsf) { BRepBuilderAPI_Transform transform1 (myFShape, aTrsf, Standard_True); diff --git a/src/AIS/AIS_OffsetDimension.hxx b/src/PrsDim/PrsDim_OffsetDimension.hxx similarity index 72% rename from src/AIS/AIS_OffsetDimension.hxx rename to src/PrsDim/PrsDim_OffsetDimension.hxx index d0d254f327..784f1da699 100644 --- a/src/AIS/AIS_OffsetDimension.hxx +++ b/src/PrsDim/PrsDim_OffsetDimension.hxx @@ -14,38 +14,38 @@ // 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 +#ifndef _PrsDim_OffsetDimension_HeaderFile +#define _PrsDim_OffsetDimension_HeaderFile -#include -#include +#include +#include -DEFINE_STANDARD_HANDLE(AIS_OffsetDimension, AIS_Relation) +DEFINE_STANDARD_HANDLE(PrsDim_OffsetDimension, PrsDim_Relation) //! A framework to display dimensions of offsets. //! The relation between the offset and the basis shape //! is indicated. This relation is displayed with arrows and //! text. The text gives the dsitance between the offset //! 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: //! Constructs the offset display object defined by the //! first shape aFShape, the second shape aSShape, the //! dimension aVal, and the text aText. - Standard_EXPORT AIS_OffsetDimension(const TopoDS_Shape& FistShape, const TopoDS_Shape& SecondShape, const Standard_Real aVal, const TCollection_ExtendedString& aText); + 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. - 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. - virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; - + virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } + //! Sets a transformation aTrsf for presentation and //! selection to a relative position. - void SetRelativePos (const gp_Trsf& aTrsf); + void SetRelativePos (const gp_Trsf& aTrsf) { myRelativePos = aTrsf; } private: @@ -59,6 +59,8 @@ private: Standard_EXPORT void ComputeAxeFaceOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf); +private: + gp_Pnt myFAttach; gp_Pnt mySAttach; gp_Dir myDirAttach; @@ -67,6 +69,4 @@ private: }; -#include - -#endif // _AIS_OffsetDimension_HeaderFile +#endif // _PrsDim_OffsetDimension_HeaderFile diff --git a/src/AIS/AIS_ParallelRelation.cxx b/src/PrsDim/PrsDim_ParallelRelation.cxx similarity index 92% rename from src/AIS/AIS_ParallelRelation.cxx rename to src/PrsDim/PrsDim_ParallelRelation.cxx index ed515f7cce..bf8ebf42f5 100644 --- a/src/AIS/AIS_ParallelRelation.cxx +++ b/src/PrsDim/PrsDim_ParallelRelation.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -44,19 +43,18 @@ #include #include #include -#include #include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_ParallelRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_ParallelRelation, PrsDim_Relation) //======================================================================= //function : Constructor //purpose : //======================================================================= -AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape, +PrsDim_ParallelRelation::PrsDim_ParallelRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane) { @@ -72,7 +70,7 @@ AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape, //function : Constructor //purpose : //======================================================================= -AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape, +PrsDim_ParallelRelation::PrsDim_ParallelRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane, const gp_Pnt& aPosition, @@ -92,7 +90,7 @@ AIS_ParallelRelation::AIS_ParallelRelation(const TopoDS_Shape& aFShape, //function : Compute //purpose : //======================================================================= -void AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, +void PrsDim_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer) { @@ -119,7 +117,7 @@ void AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, //function : ComputeSelection //purpose : //======================================================================= -void AIS_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer) { gp_Lin L1 (myFAttach,myDirAttach); @@ -188,16 +186,16 @@ void AIS_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection)& a //function : ComputeTwoFacesParallel //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 //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 E2 = TopoDS::Edge(mySShape); @@ -206,7 +204,7 @@ void AIS_ParallelRelation::ComputeTwoEdgesParallel(const Handle(Prs3d_Presentati Handle(Geom_Curve) geom1,geom2; Standard_Boolean isInfinite1,isInfinite2; Handle(Geom_Curve) extCurv; - if (!AIS::ComputeGeometry(E1,E2,myExtShape, + if (!PrsDim::ComputeGeometry(E1,E2,myExtShape, geom1,geom2, ptat11,ptat12,ptat21,ptat22, extCurv, diff --git a/src/AIS/AIS_ParallelRelation.hxx b/src/PrsDim/PrsDim_ParallelRelation.hxx similarity index 59% rename from src/AIS/AIS_ParallelRelation.hxx rename to src/PrsDim/PrsDim_ParallelRelation.hxx index 7fb1708548..a85f0e2f76 100644 --- a/src/AIS/AIS_ParallelRelation.hxx +++ b/src/PrsDim/PrsDim_ParallelRelation.hxx @@ -14,54 +14,54 @@ // 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 +#ifndef _PrsDim_ParallelRelation_HeaderFile +#define _PrsDim_ParallelRelation_HeaderFile -#include +#include #include -DEFINE_STANDARD_HANDLE(AIS_ParallelRelation, AIS_Relation) +DEFINE_STANDARD_HANDLE(PrsDim_ParallelRelation, PrsDim_Relation) //! A framework to display constraints of parallelism //! between two or more Interactive Objects. These //! 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: //! Constructs an object to display parallel constraints. //! This object is defined by the first shape aFShape and //! 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. //! This object is defined by the first shape aFShape and //! the second shape aSShape the plane aPlane, the //! position aPosition, the type of arrow, aSymbolPrs and //! 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. - virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; + virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } 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 ComputeTwoEdgesParallel (const Handle(Prs3d_Presentation)& aPresentation); +private: + gp_Pnt myFAttach; gp_Pnt mySAttach; gp_Dir myDirAttach; }; -#include - -#endif // _AIS_ParallelRelation_HeaderFile +#endif // _PrsDim_ParallelRelation_HeaderFile diff --git a/src/AIS/AIS_PerpendicularRelation.cxx b/src/PrsDim/PrsDim_PerpendicularRelation.cxx similarity index 92% rename from src/AIS/AIS_PerpendicularRelation.cxx rename to src/PrsDim/PrsDim_PerpendicularRelation.cxx index 34091cd258..4ddea4ecd2 100644 --- a/src/AIS/AIS_PerpendicularRelation.cxx +++ b/src/PrsDim/PrsDim_PerpendicularRelation.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -42,23 +41,22 @@ #include #include #include -#include #include #include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_PerpendicularRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_PerpendicularRelation, PrsDim_Relation) //======================================================================= //function : Constructor //purpose : TwoEdgesPerpendicular //======================================================================= -AIS_PerpendicularRelation::AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, +PrsDim_PerpendicularRelation::PrsDim_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane) -:AIS_Relation() +:PrsDim_Relation() { myFShape = aFShape; mySShape = aSShape; @@ -69,9 +67,9 @@ AIS_PerpendicularRelation::AIS_PerpendicularRelation(const TopoDS_Shape& aFShape //function : Constructor //purpose : TwoFacesPerpendicular //======================================================================= -AIS_PerpendicularRelation::AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, +PrsDim_PerpendicularRelation::PrsDim_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape) -:AIS_Relation() +:PrsDim_Relation() { myFShape = aFShape; mySShape = aSShape; @@ -81,7 +79,7 @@ AIS_PerpendicularRelation::AIS_PerpendicularRelation(const TopoDS_Shape& aFShape //function : Compute //purpose : //======================================================================= -void AIS_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, +void PrsDim_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer) { @@ -110,7 +108,7 @@ void AIS_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager3 //function : ComputeSelection //purpose : //======================================================================= -void AIS_PerpendicularRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_PerpendicularRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer) { Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); @@ -157,7 +155,7 @@ void AIS_PerpendicularRelation::ComputeSelection(const Handle(SelectMgr_Selectio //function : ComputeTwoFacesPerpendicular //purpose : //======================================================================= -void AIS_PerpendicularRelation::ComputeTwoFacesPerpendicular +void PrsDim_PerpendicularRelation::ComputeTwoFacesPerpendicular (const Handle(Prs3d_Presentation)& /*aPresentation*/) { } @@ -166,14 +164,14 @@ void AIS_PerpendicularRelation::ComputeTwoFacesPerpendicular //function : ComputeTwoEdgesPerpendicular //purpose : //======================================================================= -void AIS_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_Presentation)& aPresentation) +void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular(const Handle(Prs3d_Presentation)& aPresentation) { // 3d lines Handle(Geom_Curve) geom1,geom2; gp_Pnt pint3d,p1,p2,pAx1,pAx2,ptat11,ptat12,ptat21,ptat22; Standard_Boolean isInfinite1,isInfinite2; Handle(Geom_Curve) extCurv; - if ( !AIS::ComputeGeometry(TopoDS::Edge(myFShape),TopoDS::Edge(mySShape), + if ( !PrsDim::ComputeGeometry(TopoDS::Edge(myFShape),TopoDS::Edge(mySShape), myExtShape, geom1,geom2, ptat11,ptat12,ptat21,ptat22, diff --git a/src/AIS/AIS_PerpendicularRelation.hxx b/src/PrsDim/PrsDim_PerpendicularRelation.hxx similarity index 63% rename from src/AIS/AIS_PerpendicularRelation.hxx rename to src/PrsDim/PrsDim_PerpendicularRelation.hxx index d27baeaa5a..7409038b0f 100644 --- a/src/AIS/AIS_PerpendicularRelation.hxx +++ b/src/PrsDim/PrsDim_PerpendicularRelation.hxx @@ -14,19 +14,19 @@ // 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 +#ifndef _PrsDim_PerpendicularRelation_HeaderFile +#define _PrsDim_PerpendicularRelation_HeaderFile -#include +#include -DEFINE_STANDARD_HANDLE(AIS_PerpendicularRelation, AIS_Relation) +DEFINE_STANDARD_HANDLE(PrsDim_PerpendicularRelation, PrsDim_Relation) //! A framework to display constraints of perpendicularity //! between two or more interactive datums. These //! 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: //! Constructs an object to display constraints of @@ -36,28 +36,29 @@ public: //! aPlane is the plane of reference to show and test the //! perpendicular relation between two shapes, at least //! 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 //! perpendicularity on shapes. //! This object is defined by a first shape aFShape and a //! second shape aSShape. - Standard_EXPORT AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape); + Standard_EXPORT PrsDim_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape); 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 ComputeTwoFacesPerpendicular (const Handle(Prs3d_Presentation)& aPresentation); Standard_EXPORT void ComputeTwoEdgesPerpendicular (const Handle(Prs3d_Presentation)& aPresentation); +private: + gp_Pnt myFAttach; gp_Pnt mySAttach; }; -#endif // _AIS_PerpendicularRelation_HeaderFile +#endif // _PrsDim_PerpendicularRelation_HeaderFile diff --git a/src/AIS/AIS_RadiusDimension.cxx b/src/PrsDim/PrsDim_RadiusDimension.cxx similarity index 74% rename from src/AIS/AIS_RadiusDimension.cxx rename to src/PrsDim/PrsDim_RadiusDimension.cxx index 435448d492..57a5f51d39 100644 --- a/src/AIS/AIS_RadiusDimension.cxx +++ b/src/PrsDim/PrsDim_RadiusDimension.cxx @@ -14,15 +14,14 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include -#include +#include #include #include #include - -IMPLEMENT_STANDARD_RTTIEXT(AIS_RadiusDimension,AIS_Dimension) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_RadiusDimension, PrsDim_Dimension) namespace { @@ -33,12 +32,12 @@ namespace //function : Constructor //purpose : //======================================================================= -AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle) -: AIS_Dimension (AIS_KOD_RADIUS) +PrsDim_RadiusDimension::PrsDim_RadiusDimension (const gp_Circ& theCircle) +: PrsDim_Dimension (PrsDim_KOD_RADIUS) { SetMeasuredGeometry (theCircle); SetSpecialSymbol (THE_RADIUS_SYMBOL); - SetDisplaySpecialSymbol (AIS_DSS_Before); + SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before); SetFlyout (0.0); } @@ -46,13 +45,13 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle) //function : Constructor //purpose : //======================================================================= -AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle, - const gp_Pnt& theAttachPoint) -: AIS_Dimension (AIS_KOD_RADIUS) +PrsDim_RadiusDimension::PrsDim_RadiusDimension (const gp_Circ& theCircle, + const gp_Pnt& theAttachPoint) +: PrsDim_Dimension (PrsDim_KOD_RADIUS) { SetMeasuredGeometry (theCircle, theAttachPoint); SetSpecialSymbol (THE_RADIUS_SYMBOL); - SetDisplaySpecialSymbol (AIS_DSS_Before); + SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before); SetFlyout (0.0); } @@ -60,12 +59,12 @@ AIS_RadiusDimension::AIS_RadiusDimension (const gp_Circ& theCircle, //function : Constructor //purpose : //======================================================================= -AIS_RadiusDimension::AIS_RadiusDimension (const TopoDS_Shape& theShape) -: AIS_Dimension (AIS_KOD_RADIUS) +PrsDim_RadiusDimension::PrsDim_RadiusDimension (const TopoDS_Shape& theShape) +: PrsDim_Dimension (PrsDim_KOD_RADIUS) { SetMeasuredGeometry (theShape); SetSpecialSymbol (THE_RADIUS_SYMBOL); - SetDisplaySpecialSymbol (AIS_DSS_Before); + SetDisplaySpecialSymbol (PrsDim_DisplaySpecialSymbol_Before); SetFlyout (0.0); } @@ -73,9 +72,9 @@ AIS_RadiusDimension::AIS_RadiusDimension (const TopoDS_Shape& theShape) //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle, - const gp_Pnt& theAnchorPoint, - const Standard_Boolean theHasAnchor) +void PrsDim_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle, + const gp_Pnt& theAnchorPoint, + const Standard_Boolean theHasAnchor) { myCircle = theCircle; myGeometryType = GeometryType_Edge; @@ -95,9 +94,9 @@ void AIS_RadiusDimension::SetMeasuredGeometry (const gp_Circ& theCircle, //function : SetMeasuredGeometry //purpose : //======================================================================= -void AIS_RadiusDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape, - const gp_Pnt& theAnchorPoint, - const Standard_Boolean theHasAnchor) +void PrsDim_RadiusDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape, + const gp_Pnt& theAnchorPoint, + const Standard_Boolean theHasAnchor) { Standard_Boolean isClosed = Standard_False; myShape = theShape; @@ -122,7 +121,7 @@ void AIS_RadiusDimension::SetMeasuredGeometry (const TopoDS_Shape& theShape, //function : CheckPlane //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. if (!thePlane.Contains (myAnchorPoint, Precision::Confusion()) && @@ -138,7 +137,7 @@ Standard_Boolean AIS_RadiusDimension::CheckPlane (const gp_Pln& thePlane) const //function : ComputePlane //purpose : //======================================================================= -void AIS_RadiusDimension::ComputePlane() +void PrsDim_RadiusDimension::ComputePlane() { if (!myIsGeometryValid) { @@ -156,7 +155,7 @@ void AIS_RadiusDimension::ComputePlane() //function : GetModelUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_RadiusDimension::GetModelUnits() const +const TCollection_AsciiString& PrsDim_RadiusDimension::GetModelUnits() const { return myDrawer->DimLengthModelUnits(); } @@ -165,7 +164,7 @@ const TCollection_AsciiString& AIS_RadiusDimension::GetModelUnits() const //function : GetDisplayUnits //purpose : //======================================================================= -const TCollection_AsciiString& AIS_RadiusDimension::GetDisplayUnits() const +const TCollection_AsciiString& PrsDim_RadiusDimension::GetDisplayUnits() const { return myDrawer->DimLengthDisplayUnits(); } @@ -174,7 +173,7 @@ const TCollection_AsciiString& AIS_RadiusDimension::GetDisplayUnits() const //function : SetModelUnits //purpose : //======================================================================= -void AIS_RadiusDimension::SetModelUnits (const TCollection_AsciiString& theUnits) +void PrsDim_RadiusDimension::SetModelUnits (const TCollection_AsciiString& theUnits) { myDrawer->SetDimLengthModelUnits (theUnits); } @@ -183,7 +182,7 @@ void AIS_RadiusDimension::SetModelUnits (const TCollection_AsciiString& theUnits //function : SetDisplayUnits //purpose : //======================================================================= -void AIS_RadiusDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) +void PrsDim_RadiusDimension::SetDisplayUnits (const TCollection_AsciiString& theUnits) { myDrawer->SetDimLengthDisplayUnits(theUnits); } @@ -192,7 +191,7 @@ void AIS_RadiusDimension::SetDisplayUnits (const TCollection_AsciiString& theUni //function : ComputeValue //purpose : //======================================================================= -Standard_Real AIS_RadiusDimension::ComputeValue() const +Standard_Real PrsDim_RadiusDimension::ComputeValue() const { if (!IsValid()) { @@ -206,9 +205,9 @@ Standard_Real AIS_RadiusDimension::ComputeValue() const //function : Compute //purpose : //======================================================================= -void AIS_RadiusDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) +void PrsDim_RadiusDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*thePM*/, + const Handle(Prs3d_Presentation)& thePresentation, + const Standard_Integer theMode) { mySelectionGeom.Clear (theMode); @@ -224,7 +223,7 @@ void AIS_RadiusDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& / //function : IsValidCircle //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(); } @@ -233,8 +232,8 @@ Standard_Boolean AIS_RadiusDimension::IsValidCircle (const gp_Circ& theCircle) c //function : IsValidAnchor //purpose : //======================================================================= -Standard_Boolean AIS_RadiusDimension::IsValidAnchor (const gp_Circ& theCircle, - const gp_Pnt& theAnchor) const +Standard_Boolean PrsDim_RadiusDimension::IsValidAnchor (const gp_Circ& theCircle, + const gp_Pnt& theAnchor) const { gp_Pln aCirclePlane (theCircle.Location(), theCircle.Axis().Direction()); Standard_Real anAnchorDist = theAnchor.Distance (theCircle.Location()); @@ -247,7 +246,7 @@ Standard_Boolean AIS_RadiusDimension::IsValidAnchor (const gp_Circ& theCircle, //function : GetTextPosition //purpose : //======================================================================= -const gp_Pnt AIS_RadiusDimension::GetTextPosition() const +gp_Pnt PrsDim_RadiusDimension::GetTextPosition() const { if (IsTextPositionCustom()) { @@ -262,7 +261,7 @@ const gp_Pnt AIS_RadiusDimension::GetTextPosition() const //function : GetTextPosition //purpose : //======================================================================= -void AIS_RadiusDimension::SetTextPosition (const gp_Pnt& theTextPos) +void PrsDim_RadiusDimension::SetTextPosition (const gp_Pnt& theTextPos) { if (!myIsGeometryValid) { diff --git a/src/AIS/AIS_RadiusDimension.hxx b/src/PrsDim/PrsDim_RadiusDimension.hxx similarity index 86% rename from src/AIS/AIS_RadiusDimension.hxx rename to src/PrsDim/PrsDim_RadiusDimension.hxx index 8376927bbf..4250190a2c 100644 --- a/src/AIS/AIS_RadiusDimension.hxx +++ b/src/PrsDim/PrsDim_RadiusDimension.hxx @@ -12,18 +12,16 @@ // 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 +#ifndef _PrsDim_RadiusDimension_HeaderFile +#define _PrsDim_RadiusDimension_HeaderFile -#include -#include +#include #include #include #include #include -class AIS_RadiusDimension; -DEFINE_STANDARD_HANDLE (AIS_RadiusDimension,AIS_Dimension) +DEFINE_STANDARD_HANDLE(PrsDim_RadiusDimension, PrsDim_Dimension) //! Radius dimension. Can be constructued: //! - 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, //! it can be considered as invalid if the shape does not contain //! circle geometry. -class AIS_RadiusDimension : public AIS_Dimension +class PrsDim_RadiusDimension : public PrsDim_Dimension { + DEFINE_STANDARD_RTTIEXT(PrsDim_RadiusDimension, PrsDim_Dimension) public: //! Create radius dimension for the circle geometry. //! @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 //! orientation by location of the first point on that circle. //! @param theCircle [in] the circle to measure. //! @param theAnchorPoint [in] the point to define the position //! of the dimension attachment on the circle. - Standard_EXPORT AIS_RadiusDimension (const gp_Circ& theCircle, - const gp_Pnt& theAnchorPoint); + Standard_EXPORT PrsDim_RadiusDimension (const gp_Circ& theCircle, + const gp_Pnt& theAnchorPoint); //! Create radius dimension for the arbitrary shape (if possible). //! @param theShape [in] the shape to measure. - Standard_EXPORT AIS_RadiusDimension (const TopoDS_Shape& theShape); + Standard_EXPORT PrsDim_RadiusDimension (const TopoDS_Shape& theShape); public: //! @return measured geometry circle. - const gp_Circ& Circle() const - { - return myCircle; - } + const gp_Circ& Circle() const { return myCircle; } //! @return anchor point on circle for radius dimension. - const gp_Pnt& AnchorPoint() const - { - return myAnchorPoint; - } + const gp_Pnt& AnchorPoint() const { return myAnchorPoint; } //! @return the measured shape. - const TopoDS_Shape& Shape() const - { - return myShape; - } + const TopoDS_Shape& Shape() const { return myShape; } public: @@ -126,11 +116,7 @@ public: Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos) Standard_OVERRIDE; - Standard_EXPORT virtual const gp_Pnt GetTextPosition() const Standard_OVERRIDE; - -public: - - DEFINE_STANDARD_RTTIEXT(AIS_RadiusDimension,AIS_Dimension) + Standard_EXPORT virtual gp_Pnt GetTextPosition() const Standard_OVERRIDE; protected: @@ -159,4 +145,4 @@ private: TopoDS_Shape myShape; }; -#endif // _AIS_RadiusDimension_HeaderFile +#endif // _PrsDim_RadiusDimension_HeaderFile diff --git a/src/AIS/AIS_Relation.cxx b/src/PrsDim/PrsDim_Relation.cxx similarity index 81% rename from src/AIS/AIS_Relation.cxx rename to src/PrsDim/PrsDim_Relation.cxx index 12cbc9ef0a..90117b459a 100644 --- a/src/AIS/AIS_Relation.cxx +++ b/src/PrsDim/PrsDim_Relation.cxx @@ -14,10 +14,10 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include +#include #include -#include #include #include #include @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -51,13 +50,13 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_Relation,AIS_InteractiveObject) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Relation, AIS_InteractiveObject) //======================================================================= -//function : AIS_Relation +//function : PrsDim_Relation //purpose : //======================================================================= -AIS_Relation::AIS_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d) +PrsDim_Relation::PrsDim_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d) :AIS_InteractiveObject(aTypeOfPresentation3d), myVal(1.), myPosition(0.,0.,0.), @@ -70,14 +69,12 @@ AIS_Relation::AIS_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation { } - - //======================================================================= //function : ComputeProjEdgePresentation //purpose : //======================================================================= -void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)& aPrs, +void PrsDim_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)& aPrs, const TopoDS_Edge& anEdge, const Handle(Geom_Curve)& ProjCurv, const gp_Pnt& FirstP, @@ -169,7 +166,7 @@ void AIS_Relation::ComputeProjEdgePresentation(const Handle(Prs3d_Presentation)& //purpose : //======================================================================= -void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation)& aPrs, +void PrsDim_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation)& aPrs, const TopoDS_Vertex& aVertex, const gp_Pnt& ProjPoint, const Quantity_NameOfColor aColor, @@ -218,7 +215,7 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation //function : SetColor //purpose : //======================================================================= -void AIS_Relation::SetColor(const Quantity_Color &aCol) +void PrsDim_Relation::SetColor(const Quantity_Color &aCol) { if(hasOwnColor && myDrawer->Color() == aCol) return; @@ -249,7 +246,7 @@ void AIS_Relation::SetColor(const Quantity_Color &aCol) //function : UnsetColor //purpose : //======================================================================= -void AIS_Relation::UnsetColor() +void PrsDim_Relation::UnsetColor() { if (!hasOwnColor) return; hasOwnColor = Standard_False; @@ -263,50 +260,3 @@ void AIS_Relation::UnsetColor() LA->SetColor(CC); 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;} - - diff --git a/src/AIS/AIS_Relation.hxx b/src/PrsDim/PrsDim_Relation.hxx similarity index 89% rename from src/AIS/AIS_Relation.hxx rename to src/PrsDim/PrsDim_Relation.hxx index 4246abf454..2d99c13330 100644 --- a/src/AIS/AIS_Relation.hxx +++ b/src/PrsDim/PrsDim_Relation.hxx @@ -14,12 +14,10 @@ // 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 +#ifndef _PrsDim_Relation_HeaderFile +#define _PrsDim_Relation_HeaderFile -#include #include -#include #include #include #include @@ -27,6 +25,8 @@ #include #include #include +#include +#include #include #include @@ -45,9 +45,9 @@ class TopoDS_Vertex; //! - 1 - there is a connection to the first shape; //! - 2 - there is a connection to the second shape. //! 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: //! Allows you to provide settings for the color theColor @@ -59,23 +59,23 @@ public: Standard_EXPORT void UnsetColor() Standard_OVERRIDE; virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Relation; } - + //! 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. - Standard_EXPORT virtual Standard_Boolean IsMovable() const; + virtual Standard_Boolean IsMovable() const { return Standard_False; } 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. const TopoDS_Shape& SecondShape() const { return mySShape; } //! Allows you to identify the second shape aSShape //! 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, const Standard_Real theXmax, const Standard_Real theYmax, const Standard_Real theZmax) @@ -168,7 +168,7 @@ public: //! aWidth : Real from Standard = 2; //! aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH; //! 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; } @@ -176,7 +176,7 @@ public: 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 //! anEdge and the curve it defines, ProjCurve. The later @@ -207,8 +207,8 @@ protected: gp_Pln mySecondPlane; Handle(Geom_Surface) myFirstBasisSurf; Handle(Geom_Surface) mySecondBasisSurf; - AIS_KindOfSurface myFirstSurfType; - AIS_KindOfSurface mySecondSurfType; + PrsDim_KindOfSurface myFirstSurfType; + PrsDim_KindOfSurface mySecondSurfType; Standard_Real myFirstOffset; Standard_Real mySecondOffset; 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 diff --git a/src/AIS/AIS_SymmetricRelation.cxx b/src/PrsDim/PrsDim_SymmetricRelation.cxx similarity index 94% rename from src/AIS/AIS_SymmetricRelation.cxx rename to src/PrsDim/PrsDim_SymmetricRelation.cxx index 336480c56d..e0e882cf48 100644 --- a/src/AIS/AIS_SymmetricRelation.cxx +++ b/src/PrsDim/PrsDim_SymmetricRelation.cxx @@ -14,9 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include -#include +#include #include #include #include @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -44,21 +43,20 @@ #include #include #include -#include #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_SymmetricRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_SymmetricRelation, PrsDim_Relation) //======================================================================= -//function : AIS_SymmetricRelation +//function : PrsDim_SymmetricRelation //purpose : //======================================================================= -AIS_SymmetricRelation::AIS_SymmetricRelation(const TopoDS_Shape& aSymmTool, +PrsDim_SymmetricRelation::PrsDim_SymmetricRelation(const TopoDS_Shape& aSymmTool, const TopoDS_Shape& FirstShape, const TopoDS_Shape& SecondShape, const Handle(Geom_Plane)& aPlane) -:AIS_Relation(), +:PrsDim_Relation(), myTool(aSymmTool) { SetFirstShape(FirstShape); @@ -71,7 +69,7 @@ AIS_SymmetricRelation::AIS_SymmetricRelation(const TopoDS_Shape& aSymmTool, //function : Compute //purpose : //======================================================================= -void AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, +void PrsDim_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, const Handle(Prs3d_Presentation)& aprs, const Standard_Integer) { @@ -101,7 +99,7 @@ void AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, Handle(Geom_Curve) aCurve,extcurve; gp_Pnt p1,p2; Standard_Boolean isinfinite,isonplane; - if (AIS::ComputeGeometry(TopoDS::Edge(myTool), + if (PrsDim::ComputeGeometry(TopoDS::Edge(myTool), aCurve,p1,p2, extcurve, isinfinite, @@ -124,7 +122,7 @@ void AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, //function : ComputeSelection //purpose : //======================================================================= -void AIS_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSel, +void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSel, const Standard_Integer) { Handle(Select3D_SensitiveSegment) seg; @@ -134,7 +132,7 @@ void AIS_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& Handle(Geom_Curve) geom_axis, extcurve; gp_Pnt p1,p2; Standard_Boolean isinfinite,isonplane; - if (!AIS::ComputeGeometry(TopoDS::Edge(myTool), + if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool), geom_axis,p1,p2, extcurve, isinfinite, @@ -346,7 +344,7 @@ void AIS_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& //function : ComputeTwoFacesSymmetric //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 //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)); 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; Standard_Boolean isInfinite1,isInfinite2; Handle(Geom_Curve) extCurv; - if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape), + if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), TopoDS::Edge(mySShape), myExtShape, geom1, @@ -383,7 +381,7 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta Handle(Geom_Curve) geom_axis,extcurve; gp_Pnt p1,p2; Standard_Boolean isinfinite,isonplane; - if (!AIS::ComputeGeometry(TopoDS::Edge(myTool), + if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool), geom_axis,p1,p2, extcurve, isinfinite, @@ -554,13 +552,13 @@ void AIS_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Presenta //function : ComputeTwoVertexsSymmetric //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; Handle(Geom_Curve) geom_axis,extcurve; gp_Pnt p1,p2; Standard_Boolean isinfinite,isonplane; - if (!AIS::ComputeGeometry(TopoDS::Edge(myTool), + if (!PrsDim::ComputeGeometry(TopoDS::Edge(myTool), geom_axis,p1,p2, extcurve, isinfinite, @@ -569,8 +567,8 @@ void AIS_SymmetricRelation::ComputeTwoVerticesSymmetric(const Handle(Prs3d_Prese Standard_Boolean isOnPlane1, isOnPlane2; - AIS::ComputeGeometry(TopoDS::Vertex(myFShape), myFAttach, myPlane, isOnPlane1); - AIS::ComputeGeometry(TopoDS::Vertex(mySShape), mySAttach, myPlane, isOnPlane2); + PrsDim::ComputeGeometry(TopoDS::Vertex(myFShape), myFAttach, myPlane, isOnPlane1); + PrsDim::ComputeGeometry(TopoDS::Vertex(mySShape), mySAttach, myPlane, isOnPlane2); if( !myArrowSizeIsDefined ) myArrowSize = myFAttach.Distance(mySAttach)/50.; diff --git a/src/AIS/AIS_SymmetricRelation.hxx b/src/PrsDim/PrsDim_SymmetricRelation.hxx similarity index 66% rename from src/AIS/AIS_SymmetricRelation.hxx rename to src/PrsDim/PrsDim_SymmetricRelation.hxx index 1f3ce3c6d1..639d7ad456 100644 --- a/src/AIS/AIS_SymmetricRelation.hxx +++ b/src/PrsDim/PrsDim_SymmetricRelation.hxx @@ -14,23 +14,23 @@ // 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 +#ifndef _PrsDim_SymmetricRelation_HeaderFile +#define _PrsDim_SymmetricRelation_HeaderFile #include #include #include -#include +#include -DEFINE_STANDARD_HANDLE(AIS_SymmetricRelation, AIS_Relation) +DEFINE_STANDARD_HANDLE(PrsDim_SymmetricRelation, PrsDim_Relation) //! A framework to display constraints of symmetricity //! between two or more datum Interactive Objects. //! A plane serves as the axis of symmetry between the //! 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: //! Constructs an object to display constraints of symmetricity. @@ -41,25 +41,25 @@ public: //! SecondShape and aPlane. It may be queried and //! edited using the functions GetTool and SetTool. //! 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. - 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 //! shape, a second shape, and a plane. //! 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 //! shape, and a plane. This tool is created at construction time. - const TopoDS_Shape& GetTool() const; + const TopoDS_Shape& GetTool() const { return myTool; } 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); @@ -67,6 +67,8 @@ private: Standard_EXPORT void ComputeTwoVerticesSymmetric (const Handle(Prs3d_Presentation)& aprs); +private: + TopoDS_Shape myTool; gp_Pnt myFAttach; gp_Pnt mySAttach; @@ -75,6 +77,4 @@ private: }; -#include - -#endif // _AIS_SymmetricRelation_HeaderFile +#endif // _PrsDim_SymmetricRelation_HeaderFile diff --git a/src/AIS/AIS_TangentRelation.cxx b/src/PrsDim/PrsDim_TangentRelation.cxx similarity index 92% rename from src/AIS/AIS_TangentRelation.cxx rename to src/PrsDim/PrsDim_TangentRelation.cxx index c5b6eac123..149b3c3a96 100644 --- a/src/AIS/AIS_TangentRelation.cxx +++ b/src/PrsDim/PrsDim_TangentRelation.cxx @@ -14,10 +14,10 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include -#include +#include #include -#include #include #include #include @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -41,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -51,13 +49,13 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(AIS_TangentRelation,AIS_Relation) +IMPLEMENT_STANDARD_RTTIEXT(PrsDim_TangentRelation, PrsDim_Relation) //======================================================================= //function : Constructor //purpose : //======================================================================= -AIS_TangentRelation::AIS_TangentRelation(const TopoDS_Shape& aFShape, +PrsDim_TangentRelation::PrsDim_TangentRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane, const Standard_Integer anExternRef) @@ -69,29 +67,11 @@ AIS_TangentRelation::AIS_TangentRelation(const TopoDS_Shape& aFShape, 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 //purpose : //======================================================================= -void AIS_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, +void PrsDim_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer) { @@ -116,7 +96,7 @@ void AIS_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, //function : ComputeSelection //purpose : //======================================================================= -void AIS_TangentRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, +void PrsDim_TangentRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer) { gp_Vec vec(myDir); @@ -134,7 +114,7 @@ void AIS_TangentRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aS //function : ComputeTwoFacesTangent //purpose : //======================================================================= -void AIS_TangentRelation::ComputeTwoFacesTangent +void PrsDim_TangentRelation::ComputeTwoFacesTangent (const Handle(Prs3d_Presentation)& /*aPresentation*/) { } @@ -218,13 +198,13 @@ static Standard_Boolean ComputeTangencyPoint(const Handle(Geom_Curve)& GC1, //function : ComputeTwoEdgesTangent //purpose : //======================================================================= -void AIS_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation)& aPresentation) +void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentation)& aPresentation) { Handle(Geom_Curve) copy1,copy2; gp_Pnt ptat11,ptat12,ptat21,ptat22; Standard_Boolean isInfinite1,isInfinite2; Handle(Geom_Curve) extCurv; - if (!AIS::ComputeGeometry(TopoDS::Edge(myFShape), + if (!PrsDim::ComputeGeometry(TopoDS::Edge(myFShape), TopoDS::Edge(mySShape), myExtShape, copy1, diff --git a/src/AIS/AIS_TangentRelation.hxx b/src/PrsDim/PrsDim_TangentRelation.hxx similarity index 68% rename from src/AIS/AIS_TangentRelation.hxx rename to src/PrsDim/PrsDim_TangentRelation.hxx index a9da68daf4..501366ff3b 100644 --- a/src/AIS/AIS_TangentRelation.hxx +++ b/src/PrsDim/PrsDim_TangentRelation.hxx @@ -14,19 +14,19 @@ // 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 +#ifndef _PrsDim_TangentRelation_HeaderFile +#define _PrsDim_TangentRelation_HeaderFile -#include +#include -DEFINE_STANDARD_HANDLE(AIS_TangentRelation, AIS_Relation) +DEFINE_STANDARD_HANDLE(PrsDim_TangentRelation, PrsDim_Relation) //! A framework to display tangency constraints between //! two or more Interactive Objects of the datum type. //! 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: //! TwoFacesTangent or TwoEdgesTangent relation @@ -35,7 +35,7 @@ public: //! second shape aSShape, the plane aPlane and the index anExternRef. //! aPlane serves as an optional axis. //! 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. //! The values are as follows: @@ -43,26 +43,28 @@ public: //! - 1 - there is a connection to the first shape; //! - 2 - there is a connection to the second shape. //! This reference is defined at construction time. - Standard_EXPORT Standard_Integer ExternRef(); - + Standard_Integer ExternRef() { return myExternRef; } + //! Sets the external reference for tangency, aRef. //! The values are as follows: //! - 0 - there is no connection; //! - 1 - there is a connection to the first shape; //! - 2 - there is a connection to the second shape. //! This reference is initially defined at construction time. - Standard_EXPORT void SetExternRef (const Standard_Integer aRef); + void SetExternRef (const Standard_Integer aRef) { myExternRef = aRef; } 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 ComputeTwoEdgesTangent (const Handle(Prs3d_Presentation)& aPresentation); +private: + gp_Pnt myAttach; gp_Dir myDir; Standard_Real myLength; @@ -70,4 +72,4 @@ private: }; -#endif // _AIS_TangentRelation_HeaderFile +#endif // _PrsDim_TangentRelation_HeaderFile diff --git a/src/AIS/AIS_TypeOfAngle.hxx b/src/PrsDim/PrsDim_TypeOfAngle.hxx similarity index 71% rename from src/AIS/AIS_TypeOfAngle.hxx rename to src/PrsDim/PrsDim_TypeOfAngle.hxx index 2d28c32578..82388b68f0 100644 --- a/src/AIS/AIS_TypeOfAngle.hxx +++ b/src/PrsDim/PrsDim_TypeOfAngle.hxx @@ -14,14 +14,14 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_TypeOfAngle_HeaderFile -#define _AIS_TypeOfAngle_HeaderFile +#ifndef _PrsDim_TypeOfAngle_HeaderFile +#define _PrsDim_TypeOfAngle_HeaderFile //! Declares the type of angle. -enum AIS_TypeOfAngle +enum PrsDim_TypeOfAngle { -AIS_TOA_Interior, //!< the angle between two lines built on geometry parameters -AIS_TOA_Exterior //!< the angle equal 2 PI minus the interior angle + PrsDim_TypeOfAngle_Interior, //!< the angle between two lines built on geometry parameters + PrsDim_TypeOfAngle_Exterior, //!< the angle equal 2 PI minus the interior angle }; -#endif // _AIS_TypeOfAngle_HeaderFile +#endif // _PrsDim_TypeOfAngle_HeaderFile diff --git a/src/AIS/AIS_TypeOfAngleArrowVisibility.hxx b/src/PrsDim/PrsDim_TypeOfAngleArrowVisibility.hxx similarity index 60% rename from src/AIS/AIS_TypeOfAngleArrowVisibility.hxx rename to src/PrsDim/PrsDim_TypeOfAngleArrowVisibility.hxx index 8915bced09..29a3cc7d10 100644 --- a/src/AIS/AIS_TypeOfAngleArrowVisibility.hxx +++ b/src/PrsDim/PrsDim_TypeOfAngleArrowVisibility.hxx @@ -14,16 +14,16 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_TypeOfAngleArrowVisibility_HeaderFile -#define _AIS_TypeOfAngleArrowVisibility_HeaderFile +#ifndef _PrsDim_TypeOfAngleArrowVisibility_HeaderFile +#define _PrsDim_TypeOfAngleArrowVisibility_HeaderFile //! 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 -AIS_TOAV_First, //!< only first point arrow -AIS_TOAV_Second, //!< only second point arrow -AIS_TOAV_None //!< arrows are not visible + PrsDim_TypeOfAngleArrowVisibility_Both, //!< both arrows of the first and the second angle tips + PrsDim_TypeOfAngleArrowVisibility_First, //!< only first point arrow + PrsDim_TypeOfAngleArrowVisibility_Second, //!< only second point arrow + PrsDim_TypeOfAngleArrowVisibility_None, //!< arrows are not visible }; -#endif // _AIS_TypeOfAngleArrowVisibility_HeaderFile +#endif // _PrsDim_TypeOfAngleArrowVisibility_HeaderFile diff --git a/src/AIS/AIS_TypeOfDist.hxx b/src/PrsDim/PrsDim_TypeOfDist.hxx similarity index 77% rename from src/AIS/AIS_TypeOfDist.hxx rename to src/PrsDim/PrsDim_TypeOfDist.hxx index 38cbb3087e..1a9c6f8ac0 100644 --- a/src/AIS/AIS_TypeOfDist.hxx +++ b/src/PrsDim/PrsDim_TypeOfDist.hxx @@ -14,15 +14,15 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _AIS_TypeOfDist_HeaderFile -#define _AIS_TypeOfDist_HeaderFile +#ifndef _PrsDim_TypeOfDist_HeaderFile +#define _PrsDim_TypeOfDist_HeaderFile //! To declare the type of distance. -enum AIS_TypeOfDist +enum PrsDim_TypeOfDist { -AIS_TOD_Unknown, -AIS_TOD_Horizontal, -AIS_TOD_Vertical + PrsDim_TypeOfDist_Unknown, + PrsDim_TypeOfDist_Horizontal, + PrsDim_TypeOfDist_Vertical }; -#endif // _AIS_TypeOfDist_HeaderFile +#endif // _PrsDim_TypeOfDist_HeaderFile diff --git a/src/QABugs/QABugs_16.cxx b/src/QABugs/QABugs_16.cxx index 6622ba1171..bdecc0cd74 100644 --- a/src/QABugs/QABugs_16.cxx +++ b/src/QABugs/QABugs_16.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -241,7 +241,7 @@ static Standard_Integer BUC60972 (Draw_Interpretor& di, Standard_Integer argc, c //di << ExtString_aText << " " << Draw::Atof(argv[4]) << "\n"; di << argv[5] << " " << Draw::Atof(argv[4]) << "\n"; - Handle(AIS_AngleDimension) aDim = new AIS_AngleDimension(aFirst, aSecond); + Handle(PrsDim_AngleDimension) aDim = new PrsDim_AngleDimension(aFirst, aSecond); aContext->Display (aDim, Standard_True); return 0; @@ -620,7 +620,7 @@ static Standard_Integer OCC301 (Draw_Interpretor& di, Standard_Integer argc, con gp_Dir plndir(0, 0, 1); Handle(Geom_Plane) pln = new Geom_Plane(plnpt,plndir); - Handle(AIS_AngleDimension) anAngleDimension = new AIS_AngleDimension (p1.Mirrored (p2), p2, p3); + Handle(PrsDim_AngleDimension) anAngleDimension = new PrsDim_AngleDimension (p1.Mirrored (p2), p2, p3); Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect; anAspect->MakeArrows3d (Standard_True); diff --git a/src/QABugs/QABugs_17.cxx b/src/QABugs/QABugs_17.cxx index 60102a94f7..a4c7c94b3a 100644 --- a/src/QABugs/QABugs_17.cxx +++ b/src/QABugs/QABugs_17.cxx @@ -56,8 +56,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -286,14 +286,14 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, /***************************************/ //dimension "L 502.51" /***************************************/ - Handle(AIS_LengthDimension) len = new AIS_LengthDimension(V2, V3, pln->Pln()); + Handle(PrsDim_LengthDimension) len = new PrsDim_LengthDimension(V2, V3, pln->Pln()); anAspect->ArrowAspect()->SetLength (30.0); len->SetDimensionAspect (anAspect); context->Display (len, Standard_False); /***************************************/ //dimension "L 90" /***************************************/ - Handle(AIS_LengthDimension) len1 = new AIS_LengthDimension(V7, V4, pln->Pln()); + Handle(PrsDim_LengthDimension) len1 = new PrsDim_LengthDimension(V7, V4, pln->Pln()); len1->SetDimensionAspect (anAspect); len1->SetFlyout (30.0); anAspect->ArrowAspect()->SetLength (100.0); @@ -301,7 +301,7 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, /***************************************/ //dimension "L 150" /***************************************/ - Handle(AIS_LengthDimension) len2 = new AIS_LengthDimension(V1, V2, pln->Pln()); + Handle(PrsDim_LengthDimension) len2 = new PrsDim_LengthDimension(V1, V2, pln->Pln()); len2->SetDimensionAspect (anAspect); context->Display (len2, Standard_False); /***************************************/ @@ -309,7 +309,7 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, /***************************************/ gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58); TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir,gp_Pnt(191.09,0,0.),gp_Pnt(191.09,-177.16,0.) ); - Handle(AIS_RadiusDimension) dim1 = new AIS_RadiusDimension(E1); + Handle(PrsDim_RadiusDimension) dim1 = new PrsDim_RadiusDimension(E1); dim1->SetDimensionAspect (anAspect); context->Display (dim1, Standard_False); /***************************************/ @@ -317,7 +317,7 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, /***************************************/ gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80); TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1); - dim1 = new AIS_RadiusDimension(E_cir1); + dim1 = new PrsDim_RadiusDimension(E_cir1); anAspect->ArrowAspect()->SetLength (60.0); dim1->SetDimensionAspect (anAspect); context->Display (dim1, Standard_False); @@ -326,7 +326,7 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, /***************************************/ gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86); TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2); - dim1 = new AIS_RadiusDimension(E_cir2); + dim1 = new PrsDim_RadiusDimension(E_cir2); anAspect->ArrowAspect()->SetLength (40.0); dim1->SetDimensionAspect (anAspect); context->Display (dim1, Standard_True); diff --git a/src/QABugs/QABugs_3.cxx b/src/QABugs/QABugs_3.cxx index c3d6882024..4af05434f0 100644 --- a/src/QABugs/QABugs_3.cxx +++ b/src/QABugs/QABugs_3.cxx @@ -69,7 +69,7 @@ static int BUC60623(Draw_Interpretor& di, Standard_Integer argc, const char ** a #include #include #include -#include +#include static Standard_Integer BUC60632(Draw_Interpretor& di, Standard_Integer /*n*/, const char ** a) { @@ -92,7 +92,7 @@ static Standard_Integer BUC60632(Draw_Interpretor& di, Standard_Integer /*n*/, c Handle(Geom_Plane) Plane1 = new Geom_Plane(gp_Pnt(0,0,0),gp_Dir(0,0,1)); TCollection_ExtendedString Ext1("Dim1"); - Handle(AIS_LengthDimension) Dim1 = new AIS_LengthDimension(V1,V2,Plane1->Pln()); + Handle(PrsDim_LengthDimension) Dim1 = new PrsDim_LengthDimension(V1,V2,Plane1->Pln()); Dim1->SetCustomValue (Draw::Atof(a[2])); Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); diff --git a/src/TKV3d/PACKAGES b/src/TKV3d/PACKAGES index c7f1082589..cf8000db28 100755 --- a/src/TKV3d/PACKAGES +++ b/src/TKV3d/PACKAGES @@ -7,5 +7,6 @@ SelectBasics SelectMgr PrsMgr AIS -DsgPrs StdSelect +DsgPrs +PrsDim diff --git a/src/TPrsStd/TPrsStd_ConstraintDriver.cxx b/src/TPrsStd/TPrsStd_ConstraintDriver.cxx index d51087b79e..60172ef493 100644 --- a/src/TPrsStd/TPrsStd_ConstraintDriver.cxx +++ b/src/TPrsStd/TPrsStd_ConstraintDriver.cxx @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include @@ -181,7 +181,7 @@ Standard_Boolean TPrsStd_ConstraintDriver::Update (const TDF_Label& aLabel, Handle(TDataXtd_Position) Position; if (aLabel.FindAttribute(TDataXtd_Position::GetID(),Position)) { - Handle(AIS_Relation)::DownCast(anAISObject)->SetPosition(Position->GetPosition()); + Handle(PrsDim_Relation)::DownCast(anAISObject)->SetPosition(Position->GetPosition()); } if (anAISObject->HasInteractiveContext()) { diff --git a/src/TPrsStd/TPrsStd_ConstraintTools.cxx b/src/TPrsStd/TPrsStd_ConstraintTools.cxx index 9e7cd95a4e..a67704eb27 100644 --- a/src/TPrsStd/TPrsStd_ConstraintTools.cxx +++ b/src/TPrsStd/TPrsStd_ConstraintTools.cxx @@ -16,26 +16,28 @@ // Purpose: Update AIS object from a TDataXtd_Constraint. // Modified Mon 30 10:15:43 1998 by SZY -#include -#include -#include -#include -#include -#include -#include +#include + #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -79,7 +81,6 @@ #include #include #include -#include #include #include @@ -220,7 +221,7 @@ void TPrsStd_ConstraintTools::UpdateOnlyValue(const Handle(TDataXtd_Constraint)& Standard_Real val; TCollection_ExtendedString txt; TPrsStd_ConstraintTools:: ComputeTextAndValue(aConst,val,txt,aConst->GetType() == TDataXtd_ANGLE); - Handle(AIS_Relation) rel = Handle(AIS_Relation)::DownCast(anAIS); + Handle(PrsDim_Relation) rel = Handle(PrsDim_Relation)::DownCast(anAIS); if (!rel.IsNull()) rel->SetText(txt); } @@ -305,11 +306,11 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint) Standard_Boolean SaveDrw = Standard_False; Handle(Prs3d_Drawer) aDrawer; - Handle(AIS_LengthDimension) aDim; + Handle(PrsDim_LengthDimension) aDim; if (!theAIS.IsNull()) { - aDim = Handle(AIS_LengthDimension)::DownCast (theAIS); + aDim = Handle(PrsDim_LengthDimension)::DownCast (theAIS); } // Check shapes for AIS dimension @@ -417,15 +418,15 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint) { if (isEdge) { - aDim = new AIS_LengthDimension (GetEdge (aShape1), aPlane->Pln()); + aDim = new PrsDim_LengthDimension (GetEdge (aShape1), aPlane->Pln()); } else if (isFaces) { - aDim = new AIS_LengthDimension (GetFace (aShape1), GetFace (aShape2)); + aDim = new PrsDim_LengthDimension (GetFace (aShape1), GetFace (aShape2)); } else { - aDim = new AIS_LengthDimension (aShape1, aShape2, aPlane->Pln()); + aDim = new PrsDim_LengthDimension (aShape1, aShape2, aPlane->Pln()); } if (SaveDrw) @@ -487,12 +488,12 @@ void TPrsStd_ConstraintTools::ComputePerpendicular(const Handle(TDataXtd_Constra GetGoodShape(shape1); GetGoodShape(shape2); // Update de l'AIS - Handle(AIS_PerpendicularRelation) ais; - if (anAIS.IsNull()) ais = new AIS_PerpendicularRelation(shape1,shape2); + Handle(PrsDim_PerpendicularRelation) ais; + if (anAIS.IsNull()) ais = new PrsDim_PerpendicularRelation(shape1,shape2); else { - ais = Handle(AIS_PerpendicularRelation)::DownCast(anAIS); + ais = Handle(PrsDim_PerpendicularRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_PerpendicularRelation(shape1,shape2); + ais = new PrsDim_PerpendicularRelation(shape1,shape2); } else { ais->SetFirstShape(shape1); @@ -560,12 +561,12 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)& // Update de l'AIS GetGoodShape(shape1); GetGoodShape(shape2); - Handle(AIS_ParallelRelation) ais; - if (anAIS.IsNull()) ais = new AIS_ParallelRelation(shape1,shape2,aplane); + Handle(PrsDim_ParallelRelation) ais; + if (anAIS.IsNull()) ais = new PrsDim_ParallelRelation(shape1,shape2,aplane); else { - ais = Handle(AIS_ParallelRelation)::DownCast(anAIS); + ais = Handle(PrsDim_ParallelRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_ParallelRelation(shape1,shape2,aplane); + ais = new PrsDim_ParallelRelation(shape1,shape2,aplane); } else { ais->SetFirstShape(shape1); @@ -623,12 +624,12 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)& return; } // Update de l'AIS - Handle(AIS_SymmetricRelation) ais; - if (anAIS.IsNull()) ais = new AIS_SymmetricRelation(shape3,shape1,shape2,aplane); + Handle(PrsDim_SymmetricRelation) ais; + if (anAIS.IsNull()) ais = new PrsDim_SymmetricRelation(shape3,shape1,shape2,aplane); else { - ais = Handle(AIS_SymmetricRelation)::DownCast(anAIS); + ais = Handle(PrsDim_SymmetricRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_SymmetricRelation(shape3,shape1,shape2,aplane); + ais = new PrsDim_SymmetricRelation(shape3,shape1,shape2,aplane); } else { ais->SetFirstShape(shape1); @@ -694,14 +695,14 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)& } // Update de l'AIS - Handle(AIS_MidPointRelation) ais; - if ( anAIS.IsNull() ) ais = new AIS_MidPointRelation(shape3,shape1,shape2,aplane); + Handle(PrsDim_MidPointRelation) ais; + if ( anAIS.IsNull() ) ais = new PrsDim_MidPointRelation(shape3,shape1,shape2,aplane); else { - ais = Handle(AIS_MidPointRelation)::DownCast(anAIS); + ais = Handle(PrsDim_MidPointRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_MidPointRelation(shape3,shape1,shape2,aplane); + ais = new PrsDim_MidPointRelation(shape3,shape1,shape2,aplane); } else { @@ -758,18 +759,18 @@ void TPrsStd_ConstraintTools::ComputeTangent (const Handle(TDataXtd_Constraint)& return; } // Update de l'AIS - Handle(AIS_TangentRelation) ais; + Handle(PrsDim_TangentRelation) ais; if (anAIS.IsNull()) { - ais = new AIS_TangentRelation(shape1,shape2,aplane); + ais = new PrsDim_TangentRelation(shape1,shape2,aplane); ais->SetArrowSize(10000000); // jfa 9/10/2000 } else { - ais = Handle(AIS_TangentRelation)::DownCast(anAIS); + ais = Handle(PrsDim_TangentRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_TangentRelation(shape1,shape2,aplane); + ais = new PrsDim_TangentRelation(shape1,shape2,aplane); ais->SetArrowSize(10000000); // jfa 9/10/2000 } else @@ -807,13 +808,13 @@ void TPrsStd_ConstraintTools::ComputeAngleForOneFace (const Handle(TDataXtd_Cons TCollection_ExtendedString txt; TPrsStd_ConstraintTools::ComputeTextAndValue (aConst,val1,txt,Standard_True); - Handle(AIS_AngleDimension) ais; + Handle(PrsDim_AngleDimension) ais; TopoDS_Face face; if (!anAIS.IsNull()) { - ais = Handle(AIS_AngleDimension)::DownCast(anAIS); + ais = Handle(PrsDim_AngleDimension)::DownCast(anAIS); if(ais.IsNull()) { face = TopoDS::Face( shape ); - ais = new AIS_AngleDimension (face); + ais = new PrsDim_AngleDimension (face); } else { ais->SetMeasuredGeometry(TopoDS::Face( shape )); @@ -821,7 +822,7 @@ void TPrsStd_ConstraintTools::ComputeAngleForOneFace (const Handle(TDataXtd_Cons } else { face = TopoDS::Face (shape); - ais = new AIS_AngleDimension (face); + ais = new PrsDim_AngleDimension (face); } anAIS = ais; @@ -1027,9 +1028,9 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a Standard_Boolean toCreate (Standard_True); Standard_Boolean isface(shape1.ShapeType()==TopAbs_FACE); - Handle(AIS_AngleDimension) ais; + Handle(PrsDim_AngleDimension) ais; if (!anAIS.IsNull()) { - ais = Handle(AIS_AngleDimension)::DownCast(anAIS); + ais = Handle(PrsDim_AngleDimension)::DownCast(anAIS); if( ais.IsNull() ) { toCreate = Standard_True; } @@ -1044,17 +1045,17 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a FindExternalShape(aConst,ExtShape); GetGoodShape(shape1); GetGoodShape(shape2); - ais = new AIS_AngleDimension (TopoDS::Edge(shape1), + ais = new PrsDim_AngleDimension (TopoDS::Edge(shape1), TopoDS::Edge(shape2)); } } else { if (isCurvilinear) { - ais = new AIS_AngleDimension (TopoDS::Face(shape1), + ais = new PrsDim_AngleDimension (TopoDS::Face(shape1), TopoDS::Face(shape2)); } else if (isface) { - ais = new AIS_AngleDimension (TopoDS::Face(shape1), + ais = new PrsDim_AngleDimension (TopoDS::Face(shape1), TopoDS::Face(shape2)); } } @@ -1130,11 +1131,11 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint return; } // Update de l'AIS - Handle(AIS_ConcentricRelation) ais; + Handle(PrsDim_ConcentricRelation) ais; if (!anAIS.IsNull()) { - ais = Handle(AIS_ConcentricRelation)::DownCast(anAIS); + ais = Handle(PrsDim_ConcentricRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_ConcentricRelation (shape1,shape2,aplane); + ais = new PrsDim_ConcentricRelation (shape1,shape2,aplane); } else { ais->SetFirstShape(shape1); @@ -1143,7 +1144,7 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint } } else { - ais = new AIS_ConcentricRelation (shape1,shape2,aplane); + ais = new PrsDim_ConcentricRelation (shape1,shape2,aplane); } anAIS = ais; @@ -1198,17 +1199,17 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)& Standard_Boolean isplanar(aConst->IsPlanar()); if (isplanar) GetGoodShape(shape1); - Handle(AIS_RadiusDimension) ais; + Handle(PrsDim_RadiusDimension) ais; if (!anAIS.IsNull()) { - ais = Handle(AIS_RadiusDimension)::DownCast(anAIS); + ais = Handle(PrsDim_RadiusDimension)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_RadiusDimension (shape1); + ais = new PrsDim_RadiusDimension (shape1); } else { ais->SetMeasuredGeometry(shape1); } } - else ais = new AIS_RadiusDimension (shape1); + else ais = new PrsDim_RadiusDimension (shape1); if (isplanar) { Handle(Geom_Geometry) ageom2; @@ -1275,11 +1276,11 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint Standard_Boolean isplanar(aConst->IsPlanar()); if (isplanar) GetGoodShape(shape1); - Handle(AIS_MinRadiusDimension) ais; + Handle(PrsDim_MinRadiusDimension) ais; if (!anAIS.IsNull()) { - ais = Handle(AIS_MinRadiusDimension)::DownCast(anAIS); + ais = Handle(PrsDim_MinRadiusDimension)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_MinRadiusDimension (shape1,val1,txt); + ais = new PrsDim_MinRadiusDimension (shape1,val1,txt); } else { ais->SetValue(val1); @@ -1287,7 +1288,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint ais->SetText(txt); } } - else ais = new AIS_MinRadiusDimension (shape1,val1,txt); + else ais = new PrsDim_MinRadiusDimension (shape1,val1,txt); if (isplanar) { Handle(Geom_Geometry) ageom2; @@ -1354,11 +1355,11 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint Standard_Boolean isplanar(aConst->IsPlanar()); if (isplanar) GetGoodShape(shape1); - Handle(AIS_MaxRadiusDimension) ais; + Handle(PrsDim_MaxRadiusDimension) ais; if (!anAIS.IsNull()) { - ais = Handle(AIS_MaxRadiusDimension)::DownCast(anAIS); + ais = Handle(PrsDim_MaxRadiusDimension)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_MaxRadiusDimension (shape1,val1,txt); + ais = new PrsDim_MaxRadiusDimension (shape1,val1,txt); } else { ais->SetValue(val1); @@ -1366,7 +1367,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint ais->SetText(txt); } } - else ais = new AIS_MaxRadiusDimension (shape1,val1,txt); + else ais = new PrsDim_MaxRadiusDimension (shape1,val1,txt); if (isplanar) { Handle(Geom_Geometry) ageom2; @@ -1440,13 +1441,13 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra } //Update AIS - Handle(AIS_EqualDistanceRelation) ais; + Handle(PrsDim_EqualDistanceRelation) ais; if (!anAIS.IsNull()) { { - ais = Handle(AIS_EqualDistanceRelation)::DownCast(anAIS); + ais = Handle(PrsDim_EqualDistanceRelation)::DownCast(anAIS); if (ais.IsNull()) - ais = new AIS_EqualDistanceRelation(aShape1, aShape2, aShape3, aShape4, aPlane); + ais = new PrsDim_EqualDistanceRelation(aShape1, aShape2, aShape3, aShape4, aPlane); else { ais->SetFirstShape(aShape1); @@ -1457,7 +1458,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra } } } - else ais = new AIS_EqualDistanceRelation(aShape1, aShape2, aShape3, aShape4, aPlane); + else ais = new PrsDim_EqualDistanceRelation(aShape1, aShape2, aShape3, aShape4, aPlane); anAIS = ais; @@ -1608,12 +1609,12 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain return; } } - Handle(AIS_EqualRadiusRelation) ais; + Handle(PrsDim_EqualRadiusRelation) ais; if (!anAIS.IsNull()) { - ais = Handle(AIS_EqualRadiusRelation)::DownCast(anAIS); + ais = Handle(PrsDim_EqualRadiusRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_EqualRadiusRelation(edge1, edge2, aplane); + ais = new PrsDim_EqualRadiusRelation(edge1, edge2, aplane); } else { ais->SetFirstShape(shape1); @@ -1622,7 +1623,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain } } else { - ais = new AIS_EqualRadiusRelation(edge1, edge2, aplane); + ais = new PrsDim_EqualRadiusRelation(edge1, edge2, aplane); } anAIS = ais; @@ -1661,17 +1662,17 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)& // Update de l'AIS Standard_Boolean IsPlanar(aConst->IsPlanar()); if (IsPlanar) GetGoodShape(shape1); - Handle(AIS_DiameterDimension) ais; + Handle(PrsDim_DiameterDimension) ais; if (!anAIS.IsNull()) { - ais = Handle(AIS_DiameterDimension)::DownCast(anAIS); + ais = Handle(PrsDim_DiameterDimension)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_DiameterDimension (shape1); + ais = new PrsDim_DiameterDimension (shape1); } else { ais->SetMeasuredGeometry(shape1); } } - else ais = new AIS_DiameterDimension (shape1); + else ais = new PrsDim_DiameterDimension (shape1); if (IsPlanar) { Handle(Geom_Geometry) ageom2; @@ -1735,18 +1736,18 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon return; } // Update de l'AIS - Handle(AIS_FixRelation) ais; + Handle(PrsDim_FixRelation) ais; if (!anAIS.IsNull()) { - ais = Handle(AIS_FixRelation)::DownCast(anAIS); + ais = Handle(PrsDim_FixRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_FixRelation (shape1,aplane); + ais = new PrsDim_FixRelation (shape1,aplane); } else { ais->SetFirstShape(shape1); ais->SetPlane(aplane); } } - else ais = new AIS_FixRelation (shape1,aplane); + else ais = new PrsDim_FixRelation (shape1,aplane); anAIS = ais; } @@ -1803,7 +1804,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)& Standard_Real val1; TCollection_ExtendedString txt; - Handle(AIS_LengthDimension) ais; + Handle(PrsDim_LengthDimension) ais; //Handle(Prs3d_Drawer) aDrawer; if (nbgeom == 1) @@ -1811,14 +1812,14 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)& ComputeTextAndValue (aConst,val1,txt,Standard_False); if (!anAIS.IsNull()) { - ais = Handle(AIS_LengthDimension)::DownCast(anAIS); + ais = Handle(PrsDim_LengthDimension)::DownCast(anAIS); } if (S1.ShapeType() == TopAbs_FACE && S2.ShapeType() == TopAbs_FACE) { if (ais.IsNull()) { - ais = new AIS_LengthDimension (TopoDS::Face(S1),TopoDS::Face(S2)); + ais = new PrsDim_LengthDimension (TopoDS::Face(S1),TopoDS::Face(S2)); } else { @@ -1851,7 +1852,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)& aplane = new Geom_Plane (NLin.Location(),NLin.Direction()^TDir); if (ais.IsNull()) { - ais = new AIS_LengthDimension (S1,S2,aplane->Pln()); + ais = new PrsDim_LengthDimension (S1,S2,aplane->Pln()); } else { ais->SetMeasuredShapes (S1, S2); @@ -1912,9 +1913,9 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)& } } S2 = nearest; - ais = Handle(AIS_LengthDimension)::DownCast(anAIS); + ais = Handle(PrsDim_LengthDimension)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_LengthDimension (S1,S2,aplane->Pln()); + ais = new PrsDim_LengthDimension (S1,S2,aplane->Pln()); } else { ais->SetMeasuredShapes (S1, S2); @@ -1960,14 +1961,14 @@ void TPrsStd_ConstraintTools::ComputePlacement ComputeTextAndValue(aConst,val1,txt,Standard_False); } // Update de l'AIS - Handle(AIS_OffsetDimension) ais; + Handle(PrsDim_OffsetDimension) ais; if (anAIS.IsNull()) { - ais = new AIS_OffsetDimension(GetFace(shape1),GetFace(shape2),val1,txt); + ais = new PrsDim_OffsetDimension(GetFace(shape1),GetFace(shape2),val1,txt); ais->SetArrowSize(val1/20.); } else { - ais = Handle(AIS_OffsetDimension)::DownCast(anAIS); + ais = Handle(PrsDim_OffsetDimension)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_OffsetDimension(GetFace(shape1),GetFace(shape2),val1,txt); + ais = new PrsDim_OffsetDimension(GetFace(shape1),GetFace(shape2),val1,txt); ais->SetArrowSize(val1/20.); } else { ais->SetFirstShape(GetFace(shape1)); @@ -2116,12 +2117,12 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint } // Update de l'AIS - Handle(AIS_IdenticRelation) ais; - if (anAIS.IsNull()) ais = new AIS_IdenticRelation(shape1,shape2,aplane); + Handle(PrsDim_IdenticRelation) ais; + if (anAIS.IsNull()) ais = new PrsDim_IdenticRelation(shape1,shape2,aplane); else { - ais = Handle(AIS_IdenticRelation)::DownCast(anAIS); + ais = Handle(PrsDim_IdenticRelation)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_IdenticRelation(shape1,shape2,aplane); + ais = new PrsDim_IdenticRelation(shape1,shape2,aplane); } else { ais->SetFirstShape(shape1); @@ -2162,17 +2163,17 @@ void TPrsStd_ConstraintTools::ComputeRound(const Handle(TDataXtd_Constraint)& aC ComputeTextAndValue(aConst,val1,txt,Standard_False); // Update de l'AIS - Handle(AIS_RadiusDimension) ais; + Handle(PrsDim_RadiusDimension) ais; { try { OCC_CATCH_SIGNALS if (anAIS.IsNull()) ais = - new AIS_RadiusDimension(shape1); + new PrsDim_RadiusDimension(shape1); else { - ais = Handle(AIS_RadiusDimension)::DownCast(anAIS); + ais = Handle(PrsDim_RadiusDimension)::DownCast(anAIS); if (ais.IsNull()) { - ais = new AIS_RadiusDimension(shape1); + ais = new PrsDim_RadiusDimension(shape1); } else { ais->SetMeasuredGeometry(shape1); diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index fad405c6f3..029a5c4de6 100644 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -33,12 +33,12 @@ #include #include #include -#include #include #include #include #include -#include +#include +#include #include #include #include @@ -5441,17 +5441,17 @@ static void objInfo (const NCollection_Map& theDe } else if (theObj->Type() == AIS_KOI_Relation) { - // AIS_Dimention and AIS_Relation - Handle(AIS_Relation) aRelation = Handle(AIS_Relation)::DownCast (theObj); + // PrsDim_Dimention and AIS_Relation + Handle(PrsDim_Relation) aRelation = Handle(PrsDim_Relation)::DownCast (theObj); switch (aRelation->KindOfDimension()) { - case AIS_KOD_PLANEANGLE: theDI << " AIS_AngleDimension"; break; - case AIS_KOD_LENGTH: theDI << " AIS_Chamf2/3dDimension/AIS_LengthDimension"; break; - case AIS_KOD_DIAMETER: theDI << " AIS_DiameterDimension"; break; - case AIS_KOD_ELLIPSERADIUS: theDI << " AIS_EllipseRadiusDimension"; break; - //case AIS_KOD_FILLETRADIUS: theDI << " AIS_FilletRadiusDimension "; break; - case AIS_KOD_OFFSET: theDI << " AIS_OffsetDimension"; break; - case AIS_KOD_RADIUS: theDI << " AIS_RadiusDimension"; break; + case PrsDim_KOD_PLANEANGLE: theDI << " PrsDim_AngleDimension"; break; + case PrsDim_KOD_LENGTH: theDI << " PrsDim_Chamf2/3dDimension/PrsDim_LengthDimension"; break; + case PrsDim_KOD_DIAMETER: theDI << " PrsDim_DiameterDimension"; break; + case PrsDim_KOD_ELLIPSERADIUS: theDI << " PrsDim_EllipseRadiusDimension"; break; + //case PrsDim_KOD_FILLETRADIUS: theDI << " PrsDim_FilletRadiusDimension "; break; + case PrsDim_KOD_OFFSET: theDI << " PrsDim_OffsetDimension"; break; + case PrsDim_KOD_RADIUS: theDI << " PrsDim_RadiusDimension"; break; default: theDI << " UNKNOWN dimension"; break; } } @@ -6133,9 +6133,9 @@ static int VEraseType( Draw_Interpretor& , Standard_Integer argc, const char** a if(dimension_status == -1) TheAISContext()->Erase(curio,Standard_False); else { - AIS_KindOfDimension KOD = Handle(AIS_Relation)::DownCast (curio)->KindOfDimension(); - if ((dimension_status==0 && KOD == AIS_KOD_NONE)|| - (dimension_status==1 && KOD != AIS_KOD_NONE)) + PrsDim_KindOfDimension KOD = Handle(PrsDim_Relation)::DownCast (curio)->KindOfDimension(); + if ((dimension_status==0 && KOD == PrsDim_KOD_NONE)|| + (dimension_status==1 && KOD != PrsDim_KOD_NONE)) TheAISContext()->Erase(curio,Standard_False); } } @@ -6166,9 +6166,9 @@ static int VDisplayType(Draw_Interpretor& , Standard_Integer argc, const char** if(dimension_status == -1) TheAISContext()->Display(curio,Standard_False); else { - AIS_KindOfDimension KOD = Handle(AIS_Relation)::DownCast (curio)->KindOfDimension(); - if ((dimension_status==0 && KOD == AIS_KOD_NONE)|| - (dimension_status==1 && KOD != AIS_KOD_NONE)) + PrsDim_KindOfDimension KOD = Handle(PrsDim_Relation)::DownCast (curio)->KindOfDimension(); + if ((dimension_status==0 && KOD == PrsDim_KOD_NONE)|| + (dimension_status==1 && KOD != PrsDim_KOD_NONE)) TheAISContext()->Display(curio,Standard_False); } @@ -6928,17 +6928,11 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands) #include #include #include -#include #include #include #include #include #include -//#include -//#include - - - //======================================================================= //function : IsValid @@ -7000,7 +6994,7 @@ static Standard_Integer TDraft(Draw_Interpretor& di, Standard_Integer argc, cons anAngle = 2*M_PI * anAngle / 360.0; gp_Pln aPln; Handle( Geom_Surface )aSurf; - AIS_KindOfSurface aSurfType; + PrsDim_KindOfSurface aSurfType; Standard_Real Offset; gp_Dir aDir; if(argc > 4) { // == 5 @@ -7009,7 +7003,7 @@ static Standard_Integer TDraft(Draw_Interpretor& di, Standard_Integer argc, cons } TopoDS_Face face2 = TopoDS::Face(Plane); - if(!AIS::GetPlaneFromFace(face2, aPln, aSurf, aSurfType, Offset)) + if(!PrsDim::GetPlaneFromFace(face2, aPln, aSurf, aSurfType, Offset)) { di << "TEST : Can't find plane\n"; return 1; diff --git a/src/ViewerTest/ViewerTest_RelationCommands.cxx b/src/ViewerTest/ViewerTest_RelationCommands.cxx index 9fc8f1e8b7..9fe3682487 100644 --- a/src/ViewerTest/ViewerTest_RelationCommands.cxx +++ b/src/ViewerTest/ViewerTest_RelationCommands.cxx @@ -16,30 +16,30 @@ #include -#include #include -#include -#include #include -#include -#include -#include -#include #include -#include -#include #include #include #include -#include -#include -#include #include -#include -#include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -89,8 +89,6 @@ #include #include #include -#include -#include extern Standard_Boolean VDisplayAISObject (const TCollection_AsciiString& theName, const Handle(AIS_InteractiveObject)& theAISObj, @@ -491,7 +489,7 @@ static int ParseDimensionParams (Standard_Integer theArgNum, //function : SetDimensionParams //purpose : Sets parameters for dimension //======================================================================= -static void SetDimensionParams (const Handle(AIS_Dimension)& theDim, +static void SetDimensionParams (const Handle(PrsDim_Dimension)& theDim, const NCollection_DataMap& theRealParams, const NCollection_DataMap& theStringParams) { @@ -585,11 +583,11 @@ static int ParseAngleDimensionParams (Standard_Integer theArgNum, //function : SetAngleDimensionParams //purpose : Sets parameters for angle dimension //======================================================================= -static void SetAngleDimensionParams (const Handle(AIS_Dimension)& theDim, +static void SetAngleDimensionParams (const Handle(PrsDim_Dimension)& theDim, const NCollection_DataMap& theStringParams) { - Handle(AIS_AngleDimension) anAngleDim = Handle(AIS_AngleDimension)::DownCast (theDim); + Handle(PrsDim_AngleDimension) anAngleDim = Handle(PrsDim_AngleDimension)::DownCast (theDim); if (anAngleDim.IsNull()) { return; @@ -597,15 +595,15 @@ static void SetAngleDimensionParams (const Handle(AIS_Dimension)& theDim, if (theStringParams.IsBound ("type")) { - AIS_TypeOfAngle anAngleType = AIS_TOA_Interior; + PrsDim_TypeOfAngle anAngleType = PrsDim_TypeOfAngle_Interior; TCollection_AsciiString anAngleTypeStr = theStringParams.Find ("type"); if (anAngleTypeStr.IsEqual("interior")) { - anAngleType = AIS_TOA_Interior; + anAngleType = PrsDim_TypeOfAngle_Interior; } else if (anAngleTypeStr.IsEqual("exterior")) { - anAngleType = AIS_TOA_Exterior; + anAngleType = PrsDim_TypeOfAngle_Exterior; } else { @@ -616,23 +614,23 @@ static void SetAngleDimensionParams (const Handle(AIS_Dimension)& theDim, if (theStringParams.IsBound ("showarrow")) { - AIS_TypeOfAngleArrowVisibility anArrowType = AIS_TOAV_Both; + PrsDim_TypeOfAngleArrowVisibility anArrowType = PrsDim_TypeOfAngleArrowVisibility_Both; TCollection_AsciiString anArrowTypeStr = theStringParams.Find ("showarrow"); if (anArrowTypeStr.IsEqual("both")) { - anArrowType = AIS_TOAV_Both; + anArrowType = PrsDim_TypeOfAngleArrowVisibility_Both; } else if (anArrowTypeStr.IsEqual("first")) { - anArrowType = AIS_TOAV_First; + anArrowType = PrsDim_TypeOfAngleArrowVisibility_First; } else if (anArrowTypeStr.IsEqual("second")) { - anArrowType = AIS_TOAV_Second; + anArrowType = PrsDim_TypeOfAngleArrowVisibility_Second; } else if (anArrowTypeStr.IsEqual("none")) { - anArrowType = AIS_TOAV_None; + anArrowType = PrsDim_TypeOfAngleArrowVisibility_None; } else { @@ -670,22 +668,22 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, TCollection_AsciiString aDimType(theArgs[2]); aDimType.LowerCase(); - AIS_KindOfDimension aKindOfDimension; + PrsDim_KindOfDimension aKindOfDimension; if (aDimType == "-length") { - aKindOfDimension = AIS_KOD_LENGTH; + aKindOfDimension = PrsDim_KOD_LENGTH; } else if (aDimType == "-angle") { - aKindOfDimension = AIS_KOD_PLANEANGLE; + aKindOfDimension = PrsDim_KOD_PLANEANGLE; } else if (aDimType == "-radius") { - aKindOfDimension = AIS_KOD_RADIUS; + aKindOfDimension = PrsDim_KOD_RADIUS; } else if (aDimType == "-diameter" || aDimType == "-diam") { - aKindOfDimension = AIS_KOD_DIAMETER; + aKindOfDimension = PrsDim_KOD_DIAMETER; } else { @@ -702,10 +700,10 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, } // Build dimension - Handle(AIS_Dimension) aDim; + Handle(PrsDim_Dimension) aDim; switch (aKindOfDimension) { - case AIS_KOD_LENGTH: + case PrsDim_KOD_LENGTH: { if (aShapes.Extent() == 1) { @@ -725,10 +723,10 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, TopoDS_Edge anEdge = TopoDS::Edge ((Handle(AIS_Shape)::DownCast(aShapes.First()))->Shape()); TopoDS_Vertex aFirst, aSecond; TopExp::Vertices (anEdge, aFirst, aSecond); - aDim = new AIS_LengthDimension (anEdge, aWorkingPlane); + aDim = new PrsDim_LengthDimension (anEdge, aWorkingPlane); // Move standard plane (XOY, YOZ or ZOX) to the first point to make it working for dimension - aWorkingPlane.SetLocation (Handle(AIS_LengthDimension)::DownCast (aDim)->FirstPoint()); + aWorkingPlane.SetLocation (Handle(PrsDim_LengthDimension)::DownCast (aDim)->FirstPoint()); } else if (aShapes.Extent() == 2) { @@ -762,15 +760,15 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, // Face-Face case if (aShape1.ShapeType() == TopAbs_FACE && aShape2.ShapeType() == TopAbs_FACE) { - aDim = new AIS_LengthDimension (TopoDS::Face (aShape1), TopoDS::Face (aShape2)); + aDim = new PrsDim_LengthDimension (TopoDS::Face (aShape1), TopoDS::Face (aShape2)); } else if (aShape1.ShapeType() == TopAbs_FACE && aShape2.ShapeType() == TopAbs_EDGE) { - aDim = new AIS_LengthDimension (TopoDS::Face (aShape1), TopoDS::Edge (aShape2)); + aDim = new PrsDim_LengthDimension (TopoDS::Face (aShape1), TopoDS::Edge (aShape2)); } else if (aShape1.ShapeType() == TopAbs_EDGE && aShape2.ShapeType() == TopAbs_FACE) { - aDim = new AIS_LengthDimension (TopoDS::Face (aShape2), TopoDS::Edge (aShape1)); + aDim = new PrsDim_LengthDimension (TopoDS::Face (aShape2), TopoDS::Edge (aShape1)); } else { @@ -789,7 +787,7 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, aWorkingPlane.SetLocation (BRep_Tool::Pnt (TopoDS::Vertex (aShape2))); } - aDim = new AIS_LengthDimension (aShape1, aShape2, aWorkingPlane); + aDim = new PrsDim_LengthDimension (aShape1, aShape2, aWorkingPlane); } } else @@ -800,13 +798,13 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, break; } - case AIS_KOD_PLANEANGLE: + case PrsDim_KOD_PLANEANGLE: { if (aShapes.Extent() == 1 && aShapes.First()->Type()==AIS_KOI_Shape) { Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(aShapes.First()); if (aShape->Shape().ShapeType() == TopAbs_FACE) - aDim = new AIS_AngleDimension (TopoDS::Face(aShape->Shape())); + aDim = new PrsDim_AngleDimension (TopoDS::Face(aShape->Shape())); } if (aShapes.Extent() == 2) { @@ -815,7 +813,7 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, if (!aShape1.IsNull() && !aShape2.IsNull() && aShape1->Shape().ShapeType() == TopAbs_EDGE && aShape2->Shape().ShapeType() == TopAbs_EDGE) - aDim = new AIS_AngleDimension (TopoDS::Edge(aShape1->Shape()),TopoDS::Edge(aShape2->Shape())); + aDim = new PrsDim_AngleDimension (TopoDS::Edge(aShape1->Shape()),TopoDS::Edge(aShape2->Shape())); else { std::cerr << theArgs[0] << ": wrong shapes for angle dimension.\n"; @@ -839,7 +837,7 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, if (aPoint.IsNull()) return 1; aP3 = aPoint->Component()->Pnt(); - aDim = new AIS_AngleDimension (aP1, aP2, aP3); + aDim = new PrsDim_AngleDimension (aP1, aP2, aP3); } else { @@ -849,7 +847,7 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, break; } - case AIS_KOD_RADIUS: // radius of the circle + case PrsDim_KOD_RADIUS: // radius of the circle { gp_Pnt anAnchor; bool hasAnchor = false; @@ -874,16 +872,16 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, gp_Circ aCircle = aShapeCirc->Circle()->Circ(); if (hasAnchor) { - aDim = new AIS_RadiusDimension (aCircle, anAnchor); + aDim = new PrsDim_RadiusDimension (aCircle, anAnchor); } else { - aDim = new AIS_RadiusDimension (aCircle); + aDim = new PrsDim_RadiusDimension (aCircle); } } else if (Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast(aShapes.First())) { - Handle(AIS_RadiusDimension) aRadDim = new AIS_RadiusDimension (aShape->Shape()); + Handle(PrsDim_RadiusDimension) aRadDim = new PrsDim_RadiusDimension (aShape->Shape()); if (hasAnchor) { aRadDim->SetMeasuredGeometry (aShape->Shape(), anAnchor); @@ -897,7 +895,7 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, } break; } - case AIS_KOD_DIAMETER: + case PrsDim_KOD_DIAMETER: { if (aShapes.Extent() == 1) { @@ -905,7 +903,7 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, { Handle(AIS_Circle) aShape = Handle(AIS_Circle)::DownCast (aShapes.First()); gp_Circ aCircle = aShape->Circle()->Circ(); - aDim = new AIS_DiameterDimension (aCircle); + aDim = new PrsDim_DiameterDimension (aCircle); } else { @@ -915,7 +913,7 @@ static int VDimBuilder (Draw_Interpretor& /*theDi*/, std::cerr << "Error: shape for radius is of wrong type.\n"; return 1; } - aDim = new AIS_DiameterDimension (aShape->Shape()); + aDim = new PrsDim_DiameterDimension (aShape->Shape()); } } else @@ -984,56 +982,56 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, TCollection_AsciiString aName (theArgs[1]); TCollection_AsciiString aType (theArgs[2]); - AIS_KindOfRelation aKindOfRelation = AIS_KOR_NONE; + PrsDim_KindOfRelation aKindOfRelation = PrsDim_KOR_NONE; if (aType == "-concentric") { - aKindOfRelation = AIS_KOR_CONCENTRIC; + aKindOfRelation = PrsDim_KOR_CONCENTRIC; } else if (aType == "-equaldistance") { - aKindOfRelation = AIS_KOR_EQUALDISTANCE; + aKindOfRelation = PrsDim_KOR_EQUALDISTANCE; } else if (aType == "-equalradius") { - aKindOfRelation = AIS_KOR_EQUALRADIUS; + aKindOfRelation = PrsDim_KOR_EQUALRADIUS; } else if (aType == "-fix") { - aKindOfRelation = AIS_KOR_FIX; + aKindOfRelation = PrsDim_KOR_FIX; } else if (aType == "-identic") { - aKindOfRelation = AIS_KOR_IDENTIC; + aKindOfRelation = PrsDim_KOR_IDENTIC; } else if (aType == "-offset") { - aKindOfRelation = AIS_KOR_OFFSET; + aKindOfRelation = PrsDim_KOR_OFFSET; } else if (aType == "-parallel") { - aKindOfRelation = AIS_KOR_PARALLEL; + aKindOfRelation = PrsDim_KOR_PARALLEL; } else if (aType == "-perpendicular") { - aKindOfRelation = AIS_KOR_PERPENDICULAR; + aKindOfRelation = PrsDim_KOR_PERPENDICULAR; } else if (aType == "-tangent") { - aKindOfRelation = AIS_KOR_TANGENT; + aKindOfRelation = PrsDim_KOR_TANGENT; } else if (aType == "-symmetric") { - aKindOfRelation = AIS_KOR_SYMMETRIC; + aKindOfRelation = PrsDim_KOR_SYMMETRIC; } TopTools_ListOfShape aShapes; ViewerTest::GetSelectedShapes (aShapes); // Build relation. - Handle(AIS_Relation) aRelation; + Handle(PrsDim_Relation) aRelation; switch (aKindOfRelation) { - case AIS_KOR_CONCENTRIC: + case PrsDim_KOR_CONCENTRIC: { if (aShapes.Extent() != 2) { @@ -1058,12 +1056,11 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, gp_Pnt C = aCurve1.Value (0.75); GC_MakePlane aMkPlane (aCenter1, B, C); - aRelation = new AIS_ConcentricRelation (aShape1, aShape2, aMkPlane.Value()); + aRelation = new PrsDim_ConcentricRelation (aShape1, aShape2, aMkPlane.Value()); break; } - - case AIS_KOR_EQUALDISTANCE: + case PrsDim_KOR_EQUALDISTANCE: { if (aShapes.Extent() != 4) { @@ -1129,16 +1126,11 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, } GC_MakePlane aMkPlane (A, B, C); - aRelation = new AIS_EqualDistanceRelation (aSelectedShapes[0], - aSelectedShapes[1], - aSelectedShapes[2], - aSelectedShapes[3], - aMkPlane.Value()); + aRelation = new PrsDim_EqualDistanceRelation (aSelectedShapes[0], aSelectedShapes[1], aSelectedShapes[2], aSelectedShapes[3], aMkPlane.Value()); break; } - - case AIS_KOR_EQUALRADIUS: + case PrsDim_KOR_EQUALRADIUS: { if (aShapes.Extent() != 2 && aShapes.Extent() != 1) { @@ -1163,11 +1155,10 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, gp_Pnt C = aCurve1.Value (0.9); GC_MakePlane aMkPlane (A, B, C); - aRelation = new AIS_EqualRadiusRelation (anEdge1, anEdge2, aMkPlane.Value()); + aRelation = new PrsDim_EqualRadiusRelation (anEdge1, anEdge2, aMkPlane.Value()); break; } - - case AIS_KOR_FIX: + case PrsDim_KOR_FIX: { if (aShapes.Extent() != 1) { @@ -1190,11 +1181,10 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, gp_Pnt C (B.X() + 5.0, B.Y() + 5.0, B.Z() + 5.0); GC_MakePlane aMkPlane (A, D, C); - aRelation = new AIS_FixRelation (anEdge, aMkPlane.Value()); + aRelation = new PrsDim_FixRelation (anEdge, aMkPlane.Value()); break; } - - case AIS_KOR_IDENTIC: + case PrsDim_KOR_IDENTIC: { if (aShapes.Extent() != 2) { @@ -1261,11 +1251,10 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, } GC_MakePlane aMkPlane (A ,B ,C); - aRelation = new AIS_IdenticRelation (aShapeA, aShapeB, aMkPlane.Value()); + aRelation = new PrsDim_IdenticRelation (aShapeA, aShapeB, aMkPlane.Value()); break; } - - case AIS_KOR_OFFSET: + case PrsDim_KOR_OFFSET: { if (aShapes.Extent() != 2) { @@ -1294,13 +1283,10 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, Standard_Real aDist = Round (sqrt (aDelta.SquareDistance (1)) * 10.0) / 10.0; TCollection_ExtendedString aMessage (TCollection_ExtendedString ("offset=") + TCollection_ExtendedString (aDist)); - - aRelation = new AIS_OffsetDimension (aFace1, aFace2, aDist, aMessage); - + aRelation = new PrsDim_OffsetDimension (aFace1, aFace2, aDist, aMessage); break; } - - case AIS_KOR_PARALLEL: + case PrsDim_KOR_PARALLEL: { if (aShapes.Extent() != 2) { @@ -1331,7 +1317,7 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, GC_MakePlane aMkPlane (A, B, C); - aRelation = new AIS_ParallelRelation (anEdgeA, anEdgeB, aMkPlane.Value()); + aRelation = new PrsDim_ParallelRelation (anEdgeA, anEdgeB, aMkPlane.Value()); } else { @@ -1359,12 +1345,11 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, GC_MakePlane aMkPlane (A, B, C); - aRelation = new AIS_ParallelRelation (aFaceA, aFaceB, aMkPlane.Value()); + aRelation = new PrsDim_ParallelRelation (aFaceA, aFaceB, aMkPlane.Value()); } break; } - - case AIS_KOR_PERPENDICULAR: + case PrsDim_KOR_PERPENDICULAR: { if (aShapes.Extent() != 2) { @@ -1389,7 +1374,7 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, GC_MakePlane aMkPlane (A, B, C); - aRelation = new AIS_PerpendicularRelation (anEdgeA, anEdgeB, aMkPlane.Value()); + aRelation = new PrsDim_PerpendicularRelation (anEdgeA, anEdgeB, aMkPlane.Value()); } else { @@ -1411,13 +1396,12 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, GC_MakePlane aMkPlane (A, B, C); - aRelation = new AIS_PerpendicularRelation (aFaceA, aFaceB); + aRelation = new PrsDim_PerpendicularRelation (aFaceA, aFaceB); } break; } - - case AIS_KOR_TANGENT: + case PrsDim_KOR_TANGENT: { if (aShapes.Extent() != 2) { @@ -1442,7 +1426,7 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, GC_MakePlane aMkPlane (A,B,C); - aRelation = new AIS_TangentRelation (anEdgeA, anEdgeB, aMkPlane.Value()); + aRelation = new PrsDim_TangentRelation (anEdgeA, anEdgeB, aMkPlane.Value()); } else { @@ -1464,12 +1448,11 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, GC_MakePlane aMkPlane (A,B,C); - aRelation = new AIS_TangentRelation (aFaceA, aFaceB, aMkPlane.Value()); + aRelation = new PrsDim_TangentRelation (aFaceA, aFaceB, aMkPlane.Value()); } break; } - - case AIS_KOR_SYMMETRIC: + case PrsDim_KOR_SYMMETRIC: { if (aShapes.Extent() != 3) { @@ -1515,7 +1498,7 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, GC_MakePlane aMkPlane (A, B, C); - aRelation = new AIS_SymmetricRelation (anEdgeA, anEdgeB, anEdgeC, aMkPlane.Value()); + aRelation = new PrsDim_SymmetricRelation (anEdgeA, anEdgeB, anEdgeC, aMkPlane.Value()); } else { @@ -1531,13 +1514,12 @@ static int VRelationBuilder (Draw_Interpretor& /*theDi*/, gp_Pnt A = BRep_Tool::Pnt (Va); GC_MakePlane aMkPlane(A, B, C); - aRelation = new AIS_SymmetricRelation (anEdgeA, aVertexB, aVertexC, aMkPlane.Value()); + aRelation = new PrsDim_SymmetricRelation (anEdgeA, aVertexB, aVertexC, aMkPlane.Value()); } break; } - - case AIS_KOR_NONE: + case PrsDim_KOR_NONE: { std::cerr << "Error: Unknown type of relation!\n"; return 1; @@ -1575,7 +1557,7 @@ static int VDimParam (Draw_Interpretor& theDi, Standard_Integer theArgNum, const theDi << theArgVec[0] << "error: no object with this name.\n"; return 1; } - Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast (anObject); + Handle(PrsDim_Dimension) aDim = Handle(PrsDim_Dimension)::DownCast (anObject); if (aDim.IsNull()) { theDi << theArgVec[0] << "error: no dimension with this name.\n"; @@ -1633,7 +1615,7 @@ static int VLengthParam (Draw_Interpretor&, Standard_Integer theArgNum, const ch return 1; } - Handle(AIS_LengthDimension) aLengthDim = Handle(AIS_LengthDimension)::DownCast (anObject); + Handle(PrsDim_LengthDimension) aLengthDim = Handle(PrsDim_LengthDimension)::DownCast (anObject); if (aLengthDim.IsNull()) { std::cout << theArgVec[0] << "error: no length dimension with this name.\n"; @@ -1735,7 +1717,7 @@ static int VAngleParam (Draw_Interpretor& theDi, Standard_Integer theArgNum, con return 1; } - Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast (anObject); + Handle(PrsDim_Dimension) aDim = Handle(PrsDim_Dimension)::DownCast (anObject); if (aDim.IsNull()) { theDi << theArgVec[0] << "error: no dimension with this name.\n"; @@ -1853,36 +1835,36 @@ static int VMoveDim (Draw_Interpretor& theDi, Standard_Integer theArgNum, const // Set text position, update relation or dimension. if (aPickedObj->Type() == AIS_KOI_Relation) { - Handle(AIS_Relation) aRelation = Handle(AIS_Relation)::DownCast (aPickedObj); + Handle(PrsDim_Relation) aRelation = Handle(PrsDim_Relation)::DownCast (aPickedObj); aPoint = Get3DPointAtMousePosition(); aRelation->SetPosition (aPoint); TheAISContext()->Redisplay (aRelation, Standard_True); } else { - Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast (aPickedObj); + Handle(PrsDim_Dimension) aDim = Handle(PrsDim_Dimension)::DownCast (aPickedObj); gp_Pnt aFirstPoint, aSecondPoint; - if (aDim->KindOfDimension() == AIS_KOD_PLANEANGLE) + if (aDim->KindOfDimension() == PrsDim_KOD_PLANEANGLE) { - Handle(AIS_AngleDimension) anAngleDim = Handle(AIS_AngleDimension)::DownCast (aDim); + Handle(PrsDim_AngleDimension) anAngleDim = Handle(PrsDim_AngleDimension)::DownCast (aDim); aFirstPoint = anAngleDim->FirstPoint(); aSecondPoint = anAngleDim->SecondPoint(); } - else if (aDim->KindOfDimension() == AIS_KOD_LENGTH) + else if (aDim->KindOfDimension() == PrsDim_KOD_LENGTH) { - Handle(AIS_LengthDimension) aLengthDim = Handle(AIS_LengthDimension)::DownCast (aDim); + Handle(PrsDim_LengthDimension) aLengthDim = Handle(PrsDim_LengthDimension)::DownCast (aDim); aFirstPoint = aLengthDim->FirstPoint(); aSecondPoint = aLengthDim->SecondPoint(); } - else if (aDim->KindOfDimension() == AIS_KOD_RADIUS) + else if (aDim->KindOfDimension() == PrsDim_KOD_RADIUS) { - Handle(AIS_RadiusDimension) aRadiusDim = Handle(AIS_RadiusDimension)::DownCast (aDim); + Handle(PrsDim_RadiusDimension) aRadiusDim = Handle(PrsDim_RadiusDimension)::DownCast (aDim); aFirstPoint = aRadiusDim->AnchorPoint(); aSecondPoint = aRadiusDim->Circle().Location(); } - else if (aDim->KindOfDimension() == AIS_KOD_DIAMETER) + else if (aDim->KindOfDimension() == PrsDim_KOD_DIAMETER) { - Handle(AIS_DiameterDimension) aDiameterDim = Handle(AIS_DiameterDimension)::DownCast (aDim); + Handle(PrsDim_DiameterDimension) aDiameterDim = Handle(PrsDim_DiameterDimension)::DownCast (aDim); aFirstPoint = aDiameterDim->AnchorPoint(); aSecondPoint = aDiameterDim->Circle().Location(); } @@ -1901,13 +1883,13 @@ static int VMoveDim (Draw_Interpretor& theDi, Standard_Integer theArgNum, const // Set text position, update relation or dimension. if (aPickedObj->Type() == AIS_KOI_Relation) { - Handle(AIS_Relation) aRelation = Handle(AIS_Relation)::DownCast (aPickedObj); + Handle(PrsDim_Relation) aRelation = Handle(PrsDim_Relation)::DownCast (aPickedObj); aRelation->SetPosition (aPoint); TheAISContext()->Redisplay (aRelation, Standard_True); } else { - Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast (aPickedObj); + Handle(PrsDim_Dimension) aDim = Handle(PrsDim_Dimension)::DownCast (aPickedObj); aDim->SetTextPosition (aPoint); TheAISContext()->Redisplay (aDim, Standard_True); }