0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
[occt.git] / src / PrsDim / PrsDim.cxx
similarity index 80%
rename from src/AIS/AIS.cxx
rename to src/PrsDim/PrsDim.cxx
index d9129b0..169bd59 100644 (file)
@@ -14,7 +14,7 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <AIS.hxx>
+#include <PrsDim.hxx>
 
 #include <Adaptor3d_HCurve.hxx>
 #include <Adaptor3d_HSurface.hxx>
@@ -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 <thePoint> finds the nearest point on <theLine>.
 //=======================================================================
-gp_Pnt AIS::Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint)
+gp_Pnt PrsDim::Nearest (const gp_Lin& theLine, const gp_Pnt& thePoint)
 {
   Handle(Geom_Line) aLine = new Geom_Line (theLine);
 
@@ -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,
 //           <isOnPlane>, <isOnPlane> = true.
 //           <point> 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));}