0031456: Visualization - move out Dimensions and Relations from package AIS to PrsDims
[occt.git] / src / TPrsStd / TPrsStd_ConstraintTools.cxx
index b6e162b..a67704e 100644 (file)
 // Purpose:     Update AIS object from a TDataXtd_Constraint.
 // Modified     Mon 30 10:15:43 1998 by SZY
 
+#include <TPrsStd_ConstraintTools.hxx>
 
-#include <TPrsStd_ConstraintTools.ixx>
-
-#include <stdio.h>
-#include <UnitsAPI.hxx>
-#include <TCollection_ExtendedString.hxx>
-
-#include <TNaming_Tool.hxx>
-#include <TNaming_Iterator.hxx>
-#include <TNaming_NamedShape.hxx>
-#include <TDF_Label.hxx>
-#include <TDataStd_Real.hxx>
-#include <TDataStd_Name.hxx>
-#include <TDataXtd_Geometry.hxx>
-#include <TDF_Reference.hxx>
-
-
-#include <AIS_OffsetDimension.hxx>
-#include <AIS_LengthDimension.hxx>
-#include <AIS_ParallelRelation.hxx>
-#include <AIS_TangentRelation.hxx>
-#include <AIS_IdenticRelation.hxx>
-#include <AIS_AngleDimension.hxx>
-#include <AIS_RadiusDimension.hxx>
-#include <AIS_DiameterDimension.hxx>
-#include <AIS_FixRelation.hxx>
-#include <AIS_PerpendicularRelation.hxx>
-#include <AIS_ConcentricRelation.hxx>
-#include <AIS_SymmetricRelation.hxx>
-#include <AIS_MidPointRelation.hxx>
 #include <AIS_InteractiveContext.hxx>
-#include <AIS_EqualRadiusRelation.hxx>
-#include <AIS_EqualDistanceRelation.hxx>
-#include <AIS_MinRadiusDimension.hxx> 
-#include <AIS_MaxRadiusDimension.hxx>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-
-#include <BRep_Tool.hxx>
+#include <AIS_InteractiveObject.hxx>
+#include <PrsDim_AngleDimension.hxx>
+#include <PrsDim_ConcentricRelation.hxx>
+#include <PrsDim_DiameterDimension.hxx>
+#include <PrsDim_EqualDistanceRelation.hxx>
+#include <PrsDim_EqualRadiusRelation.hxx>
+#include <PrsDim_FixRelation.hxx>
+#include <PrsDim_IdenticRelation.hxx>
+#include <PrsDim_LengthDimension.hxx>
+#include <PrsDim_MaxRadiusDimension.hxx>
+#include <PrsDim_MidPointRelation.hxx>
+#include <PrsDim_MinRadiusDimension.hxx>
+#include <PrsDim_OffsetDimension.hxx>
+#include <PrsDim_ParallelRelation.hxx>
+#include <PrsDim_PerpendicularRelation.hxx>
+#include <PrsDim_RadiusDimension.hxx>
+#include <PrsDim_Relation.hxx>
+#include <PrsDim_SymmetricRelation.hxx>
+#include <PrsDim_TangentRelation.hxx>
 #include <BRep_Builder.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRep_Tool.hxx>
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepAdaptor_Surface.hxx>
-
-#include <GeomAbs_SurfaceType.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <GC_MakePlane.hxx>
+#include <Geom_CartesianPoint.hxx>
+#include <Geom_Circle.hxx>
 #include <Geom_Geometry.hxx>
 #include <Geom_Line.hxx>
 #include <Geom_Plane.hxx>
-#include <Geom_CartesianPoint.hxx>
-#include <Geom_Circle.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Dir.hxx>
+#include <GeomAbs_SurfaceType.hxx>
 #include <gp_Ax1.hxx>
+#include <gp_Cone.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Dir.hxx>
 #include <gp_Lin.hxx>
+#include <gp_Pln.hxx>
 #include <gp_Pnt.hxx>
-#include <gp_Cylinder.hxx>
-#include <gp_Cone.hxx>
 #include <gp_Torus.hxx>
-#include <GC_MakePlane.hxx> 
-
-#include <Precision.hxx>
 #include <IntAna_QuadQuadGeo.hxx>
-
-#include <Standard_ProgramError.hxx>
+#include <Precision.hxx>
+#include <Prs3d_Drawer.hxx>
 #include <Standard_ErrorHandler.hxx>
-
+#include <Standard_ProgramError.hxx>
+#include <TCollection_ExtendedString.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDataStd_Real.hxx>
+#include <TDataXtd_Constraint.hxx>
+#include <TDataXtd_Geometry.hxx>
+#include <TDF_Label.hxx>
+#include <TDF_Reference.hxx>
+#include <TNaming_Iterator.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TNaming_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
-#include <Prs3d_Drawer.hxx>
+#include <UnitsAPI.hxx>
 
+#include <stdio.h>
 static Standard_Boolean CheckShapesPair(const TopoDS_Shape& , const TopoDS_Shape& ); //ota
 
 //=======================================================================
@@ -228,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); 
 }
 
@@ -246,7 +239,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
   if (aGeomNum < 1 || aGeomNum > 2)
   {
 #ifdef OCCT_DEBUG
-    cout <<  "TPrsStd_ConstraintTools::ComputeDistance: 1 or 2 geometries are needed" << endl;
+    std::cout <<  "TPrsStd_ConstraintTools::ComputeDistance: 1 or 2 geometries are needed" << std::endl;
 #endif
     NullifyAIS(theAIS);
     return;
@@ -264,7 +257,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
     if (aShape1.IsNull())
     {
       #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << std::endl;
       #endif
       NullifyAIS (theAIS);
       return;
@@ -277,7 +270,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
     if (aShape1.IsNull() || aShape2.IsNull())
     {
       #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeDistance : null shape" << std::endl;
       #endif
       NullifyAIS (theAIS);
       return;
@@ -313,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
@@ -326,7 +319,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
     if (aShape1.ShapeType () != TopAbs_EDGE)
     {
       #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeDistance : shape should be edge" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeDistance : shape should be edge" << std::endl;
       #endif
       NullifyAIS (theAIS);
       return;
@@ -414,7 +407,7 @@ void TPrsStd_ConstraintTools::ComputeDistance (const Handle(TDataXtd_Constraint)
   if (isCheckPlane && aPlane.IsNull())
   {
     #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeDistance : null plane" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeDistance : null plane" << std::endl;
     #endif
     NullifyAIS (theAIS);
     return;
@@ -425,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)
@@ -473,7 +466,7 @@ void TPrsStd_ConstraintTools::ComputePerpendicular(const Handle(TDataXtd_Constra
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputePerpendicular: at leat two constraintes are needed" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputePerpendicular: at leat two constraintes are needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -487,7 +480,7 @@ void TPrsStd_ConstraintTools::ComputePerpendicular(const Handle(TDataXtd_Constra
   else GetTwoShapes(aConst,shape1,shape2); 
   if (shape1.IsNull() || shape2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputePerpendicular : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputePerpendicular : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -495,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);
@@ -512,7 +505,7 @@ void TPrsStd_ConstraintTools::ComputePerpendicular(const Handle(TDataXtd_Constra
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
     if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputePerpendicular: nul plane" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputePerpendicular: nul plane" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -532,7 +525,7 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)&
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeParallel: at least 2 constraintes are needed" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeParallel: at least 2 constraintes are needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -540,7 +533,7 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)&
   
   if (!aConst->IsPlanar()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeParallel: must be a planar constraint" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeParallel: must be a planar constraint" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -552,7 +545,7 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)&
   GetShapesAndGeom(aConst,shape1,shape2,ageom3);
   if (shape1.IsNull() || shape2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeParallel : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeParallel : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -560,7 +553,7 @@ void TPrsStd_ConstraintTools::ComputeParallel(const Handle(TDataXtd_Constraint)&
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeParallel: nul plane" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeParallel: nul plane" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -568,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);
@@ -593,7 +586,7 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)&
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 3) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraintes are needed" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraintes are needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -602,7 +595,7 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)&
   Standard_Boolean is_planar(aConst->IsPlanar());
   if (!is_planar) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -614,7 +607,7 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)&
 
   if (shape1.IsNull() || shape2.IsNull() || shape3.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -625,18 +618,18 @@ void TPrsStd_ConstraintTools::ComputeSymmetry(const Handle(TDataXtd_Constraint)&
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << std::endl;
 #endif
     NullifyAIS(anAIS);
     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);
@@ -659,7 +652,7 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)&
   if (nbgeom < 3)
     {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraints are needed" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: at least 3 constraints are needed" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -669,7 +662,7 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)&
   if ( !is_planar )
     {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: must be a planar constraint" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -682,7 +675,7 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)&
   if (shape1.IsNull() || shape2.IsNull() || shape3.IsNull())
     {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry : null shape" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -695,21 +688,21 @@ void TPrsStd_ConstraintTools::ComputeMidPoint(const Handle(TDataXtd_Constraint)&
   if (aplane.IsNull())
     {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeSymmetry: null plane" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
     }
 
   //  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
        {
@@ -732,14 +725,14 @@ void TPrsStd_ConstraintTools::ComputeTangent (const Handle(TDataXtd_Constraint)&
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeTangent: at leat two constraintes are needed" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeTangent: at leat two constraintes are needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
   }
   if (!aConst->IsPlanar()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeTangent: must be a planar constraint" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeTangent: must be a planar constraint" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -750,7 +743,7 @@ void TPrsStd_ConstraintTools::ComputeTangent (const Handle(TDataXtd_Constraint)&
   GetShapesAndGeom(aConst,shape1,shape2,ageom3);
   if (shape1.IsNull() || shape2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeTangent : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeTangent : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -760,24 +753,24 @@ void TPrsStd_ConstraintTools::ComputeTangent (const Handle(TDataXtd_Constraint)&
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeTangent: nul plane" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeTangent: nul plane" << std::endl;
 #endif
     NullifyAIS(anAIS);
     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
@@ -805,7 +798,7 @@ void TPrsStd_ConstraintTools::ComputeAngleForOneFace (const Handle(TDataXtd_Cons
   GetOneShape( aConst, shape ); 
   if (shape.IsNull() ) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeAngleForOneFace : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeAngleForOneFace : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -815,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 ));
@@ -829,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;
@@ -855,7 +848,7 @@ static Standard_Boolean CheckIsShapeCompound(TopoDS_Shape& shape, TopoDS_Face& a
       }
   }
 #ifdef OCCT_DEBUG
-  cout << "TPrsStd::Compute angle : Shape is not Compound or is Null" <<endl;
+  std::cout << "TPrsStd::Compute angle : Shape is not Compound or is Null" <<std::endl;
 #endif
   return (Standard_False);
 }
@@ -872,7 +865,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
   if (nbgeom < 2) {
     if( nbgeom == 1 ) { ComputeAngleForOneFace( aConst, anAIS ); return; }
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeAngle: at least 2 constraints are needed" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeAngle: at least 2 constraints are needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -884,7 +877,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
   GetShapesAndGeom (aConst,shape1,shape2,ageom3);
   if (shape1.IsNull() || shape2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeAngle : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeAngle : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -908,8 +901,8 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
       else
        if(!CheckIsShapeCompound(shape1, aFace)) {
 #ifdef OCCT_DEBUG
-       cout << "Compute angle : Geom type = " << shape1.ShapeType()
-         << " non traite"<<endl;
+       std::cout << "Compute angle : Geom type = " << shape1.ShapeType()
+         << " non traite"<<std::endl;
 #endif
        NullifyAIS(anAIS);
        return;      
@@ -934,7 +927,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
       anax1aFace1 = aTore.Axis();  
     } else {
 #ifdef OCCT_DEBUG
-      cout<<"Compute angle"<<aTypeaFace<<" non traite"<<endl;
+      std::cout<<"Compute angle"<<aTypeaFace<<" non traite"<<std::endl;
 #endif
       NullifyAIS(anAIS);
       return;      
@@ -955,8 +948,8 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
     else  
       if(!CheckIsShapeCompound(shape2, aFace)) {
 #ifdef OCCT_DEBUG
-       cout << "Compute angle : Geom type = " << shape2.ShapeType()
-         << " non traite"<<endl;
+       std::cout << "Compute angle : Geom type = " << shape2.ShapeType()
+         << " non traite"<<std::endl;
 #endif
        NullifyAIS(anAIS);
        return;      
@@ -978,7 +971,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
       anax1aFace2 = aTore.Axis();  
     } else {
 #ifdef OCCT_DEBUG
-      cout << "Compute angle " << aTypeaFace << " non traite"<<endl;
+      std::cout << "Compute angle " << aTypeaFace << " non traite"<<std::endl;
 #endif
       NullifyAIS(anAIS);
       return;      
@@ -995,7 +988,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
          ageom3 = computedgeom3;
        } else {
 #ifdef OCCT_DEBUG
-         cout<<"Compute angle insertection of planes failed"<<endl;
+         std::cout<<"Compute angle insertection of planes failed"<<std::endl;
 #endif
          NullifyAIS(anAIS);
          return;            
@@ -1003,7 +996,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
       } else {
        
 #ifdef OCCT_DEBUG
-       cout<<"Compute angle faces are //"<<endl;
+       std::cout<<"Compute angle faces are //"<<std::endl;
 #endif
        NullifyAIS(anAIS);
        return;            
@@ -1022,7 +1015,7 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
     else if (ageom3->IsKind(STANDARD_TYPE(Geom_Line))) isplan = Standard_False;
     else {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeAngle: unknown 3rd arg " << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeAngle: unknown 3rd arg " << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -1035,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;
     }
@@ -1052,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));
       }
     }
@@ -1075,11 +1068,11 @@ void TPrsStd_ConstraintTools::ComputeAngle (const Handle(TDataXtd_Constraint)& a
     }
     ais->SetMeasuredGeometry (TopoDS::Face (shape1), TopoDS::Face (shape2));
     if (isplan)
-      ais->SetCustomPlane (((Handle(Geom_Plane)&) ageom3)->Pln());
+      ais->SetCustomPlane (Handle(Geom_Plane)::DownCast (ageom3)->Pln());
     else if (!isCurvilinear)
     {
       gp_Pln aPlane;
-      aPlane.SetAxis (((Handle(Geom_Line)&) ageom3)->Position());
+      aPlane.SetAxis (Handle(Geom_Line)::DownCast (ageom3)->Position());
       ais->SetCustomPlane (aPlane);
     }
   }
@@ -1096,11 +1089,11 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
-    Standard_ProgramError::Raise ("TPrsStd_ConstraintTools::ComputeConcentric: at least 2 constraintes are needed");
+    throw Standard_ProgramError("TPrsStd_ConstraintTools::ComputeConcentric: at least 2 constraintes are needed");
   }
   if (!aConst->IsPlanar()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeConcentric: must be a planar constraint" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeConcentric: must be a planar constraint" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1111,7 +1104,7 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint
   GetShapesAndGeom(aConst,shape1,shape2,ageom3);
   if (shape1.IsNull() || shape2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeConcentric : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeConcentric : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1123,7 +1116,7 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint
 //ota : to allow concentric constraint display between vertex and edge
   if (shape1.ShapeType() != TopAbs_EDGE && shape2.ShapeType() != TopAbs_EDGE) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeConcentric: concentric between two vertexes : NOT DISPLAYED" << endl;;
+    std::cout << "TPrsStd_ConstraintTools::ComputeConcentric: concentric between two vertexes : NOT DISPLAYED" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1132,17 +1125,17 @@ void TPrsStd_ConstraintTools::ComputeConcentric(const Handle(TDataXtd_Constraint
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom3);
   if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeConcentric: nul plane" << endl;;
+    std::cout << "TPrsStd_ConstraintTools::ComputeConcentric: nul plane" << std::endl;
 #endif
     NullifyAIS(anAIS);
     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);
@@ -1151,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;
@@ -1167,7 +1160,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)&
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeRadius: at least one constrainte is needed" << endl;    
+    std::cout << "TPrsStd_ConstraintTools::ComputeRadius: at least one constrainte is needed" << std::endl;    
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1177,7 +1170,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)&
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeRadius: null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeRadius: null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1189,7 +1182,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)&
       shape1.ShapeType()==TopAbs_SOLID ||
       shape1.ShapeType()==TopAbs_SHELL ) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeRadius: not good shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeRadius: not good shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1206,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;
@@ -1224,7 +1217,7 @@ void TPrsStd_ConstraintTools::ComputeRadius (const Handle(TDataXtd_Constraint)&
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
     if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeRadius: nul plane" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeRadius: nul plane" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -1244,7 +1237,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeMinRadius: at least one constrainte is needed" << endl;    
+    std::cout << "TPrsStd_ConstraintTools::ComputeMinRadius: at least one constrainte is needed" << std::endl;    
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1254,7 +1247,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeMinradius: null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeMinradius: null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1266,7 +1259,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint
       shape1.ShapeType()==TopAbs_SOLID ||
       shape1.ShapeType()==TopAbs_SHELL ) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeMinRadius: not good shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeMinRadius: not good shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1283,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);
@@ -1295,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;
@@ -1303,7 +1296,7 @@ void TPrsStd_ConstraintTools::ComputeMinRadius (const Handle(TDataXtd_Constraint
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
     if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeMinRadius: nul plane" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeMinRadius: nul plane" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -1323,7 +1316,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: at least one constrainte is needed" << endl;    
+    std::cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: at least one constrainte is needed" << std::endl;    
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1333,7 +1326,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeMaxradius: null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeMaxradius: null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1345,7 +1338,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint
       shape1.ShapeType()==TopAbs_SOLID ||
       shape1.ShapeType()==TopAbs_SHELL ) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: not good shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: not good shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1362,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);
@@ -1374,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;
@@ -1382,7 +1375,7 @@ void TPrsStd_ConstraintTools::ComputeMaxRadius (const Handle(TDataXtd_Constraint
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
     if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: nul plane" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeMaxRadius: nul plane" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -1402,7 +1395,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 4) {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeEqual: at least four geometries are needed" << endl;;
+      std::cout << "TPrsStd_ConstraintTools::ComputeEqual: at least four geometries are needed" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -1413,7 +1406,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
    if (aShape1.IsNull()||aShape2.IsNull()||
        aShape3.IsNull()||aShape4.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1427,7 +1420,7 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
   if (!CheckShapesPair(aShape1, aShape2) || 
       !CheckShapesPair(aShape3, aShape4)){
 #ifdef OCCT_DEBUG
-       cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : at least one pair of shapes is incorrect"<<endl;
+       std::cout << "TPrsStd_ConstraintTools::ComputeEqualDistance : at least one pair of shapes is incorrect"<<std::endl;
 #endif
        NullifyAIS(anAIS);
        return;
@@ -1441,20 +1434,20 @@ void TPrsStd_ConstraintTools::ComputeEqualDistance(const Handle(TDataXtd_Constra
   if (!IsPlanar || aPlane.IsNull()) {
     //create the plane
 #ifdef OCCT_DEBUG
-    cout<< "The constraint plane is not assigned "<< endl;
+    std::cout<< "The constraint plane is not assigned "<< std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
   }
   
   //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);
@@ -1465,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;  
 
@@ -1496,7 +1489,7 @@ static Standard_Boolean CheckShapesPair(const TopoDS_Shape& aShape1,
          gp_Dir aDir2 = aCurve2.Line().Direction();
          if (!(aDir1.IsParallel(aDir2, Precision::Confusion()))) {
 #ifdef OCCT_DEBUG
-           cout << " Lines are not parallel"<<endl;
+           std::cout << " Lines are not parallel"<<std::endl;
 #endif
            return Standard_False;
          }
@@ -1507,14 +1500,14 @@ static Standard_Boolean CheckShapesPair(const TopoDS_Shape& aShape1,
          gp_Pnt aCntr2 = aCurve2.Circle().Location(); //get the circle center
          if (!aCntr1.IsEqual(aCntr2,Precision::Confusion())){
 #ifdef OCCT_DEBUG
-           cout << " Circles are not concentric"<<endl;
+           std::cout << " Circles are not concentric"<<std::endl;
 #endif
            return Standard_False;
          }
        }
       else {
 #ifdef OCCT_DEBUG
-       cout << "Incorrect pair of curves "<<endl;
+       std::cout << "Incorrect pair of curves "<<std::endl;
 #endif
        return Standard_False;
       }
@@ -1536,7 +1529,7 @@ static Standard_Boolean CheckShapesPair(const TopoDS_Shape& aShape1,
          gp_Pnt aCntr = aCurve.Circle().Location();
          if (!aCntr.IsEqual(aPnt, Precision::Confusion())){
 #ifdef OCCT_DEBUG
-           cout << " The point doesn't coincide with the circle center"<<endl;
+           std::cout << " The point doesn't coincide with the circle center"<<std::endl;
 #endif
            return Standard_False;
          }
@@ -1555,7 +1548,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeEqualRadius: at least two geometries are needed" << endl;;
+    std::cout << "TPrsStd_ConstraintTools::ComputeEqualRadius: at least two geometries are needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1566,7 +1559,7 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
   GetShapesAndGeom(aConst, shape1, shape2, ageom3);
   if (shape1.IsNull()||shape2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeEqualRadius : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeEqualRadius : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1610,18 +1603,18 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
       aplane = aPlane2;
     else {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeRadiusRelation: nul plane" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeRadiusRelation: nul plane" << std::endl;
 #endif
       NullifyAIS(anAIS);
       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);
@@ -1630,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;
@@ -1647,7 +1640,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)&
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeDiameter: at least one constrainte is needed" << endl;;
+    std::cout << "TPrsStd_ConstraintTools::ComputeDiameter: at least one constrainte is needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1657,7 +1650,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)&
   GetOneShape(aConst,shape1);
   if (shape1.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeDiameter : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeDiameter : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1669,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;
@@ -1687,7 +1680,7 @@ void TPrsStd_ConstraintTools::ComputeDiameter(const Handle(TDataXtd_Constraint)&
     Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
     if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeDiameter: nul plane" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeDiameter: nul plane" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -1708,14 +1701,14 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeFix: at least one constrainte is needed" << endl;;
+    std::cout << "TPrsStd_ConstraintTools::ComputeFix: at least one constrainte is needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
   }
   if (!aConst->IsPlanar()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeFix: must be a planar constraint" << endl;;
+    std::cout << "TPrsStd_ConstraintTools::ComputeFix: must be a planar constraint" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1727,7 +1720,7 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon
   GetOneShape(aConst,shape1);
   if (shape1.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeFix : null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeFix : null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1737,24 +1730,24 @@ void TPrsStd_ConstraintTools::ComputeFix(const Handle(TDataXtd_Constraint)& aCon
   Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast(ageom2);
   if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeFix: nul plane" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeFix: nul plane" << std::endl;
 #endif
     NullifyAIS(anAIS);
     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;
 }
@@ -1770,10 +1763,12 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
   Standard_Boolean is_planar (aConst->IsPlanar());
   Handle(Geom_Plane) aplane;      
   if (is_planar) {
-    GetGeom (aConst,aplane);
+    Handle(Geom_Geometry) ageom;
+    GetGeom (aConst,ageom);
+    aplane = Handle(Geom_Plane)::DownCast (ageom);
     if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-      cout << "TPrsStd_ConstraintTools::ComputeOffset: null plane" << endl;
+      std::cout << "TPrsStd_ConstraintTools::ComputeOffset: null plane" << std::endl;
 #endif
       NullifyAIS(anAIS);
       return;
@@ -1800,7 +1795,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
 
   if (S1.IsNull() || S2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeOffset: null shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeOffset: null shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1809,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)
@@ -1817,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
       {
@@ -1833,8 +1828,11 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
       }
 
       if (is_planar)
+      {
         ais->SetCustomPlane (aplane->Pln());
-        anAIS = ais;
+      }
+
+      anAIS = ais;
       return;
     }
     else
@@ -1844,25 +1842,17 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
       BRepAdaptor_Curve CURVE(OE);
       if (CURVE.GetType() == GeomAbs_Line)  {
        // Works only with line !!
-//#ifndef OCCT_DEBUG
         Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
-        gp_Lin OLin = ((Handle(Geom_Line)&) aGeomGeometry)->Lin();
-//#else
-//     gp_Lin OLin = ((Handle(Geom_Line)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Lin();
-//#endif
+        gp_Lin OLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
        TopoDS_Edge NE = TopoDS::Edge(S2);
        CURVE.Initialize (NE);
-//#ifndef OCCT_DEBUG
         aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
-        gp_Lin NLin = ((Handle(Geom_Line)&)aGeomGeometry)->Lin();
-//#else
-//     gp_Lin NLin = ((Handle(Geom_Line)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Lin();
-//#endif
+        gp_Lin NLin = Handle(Geom_Line)::DownCast (aGeomGeometry)->Lin();
        gp_Dir TDir (NLin.Location().XYZ() - OLin.Location().XYZ());
        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);
@@ -1875,12 +1865,8 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
       }
       else
       if (CURVE.GetType() == GeomAbs_Circle)  {
-//#ifndef OCCT_DEBUG
         Handle(Geom_Geometry) aGeomGeometry = CURVE.Curve().Curve()->Transformed(CURVE.Trsf()) ;
-        gp_Ax1 ax = ((Handle(Geom_Circle)&) aGeomGeometry)->Circ().Axis();
-//#else
-//     gp_Ax1 ax = ((Handle(Geom_Circle)&) CURVE.Curve().Curve()->Transformed(CURVE.Trsf()))->Circ().Axis();
-//#endif
+        gp_Ax1 ax = Handle(Geom_Circle)::DownCast (aGeomGeometry)->Circ().Axis();
        aplane = new Geom_Plane (ax.Location(),ax.Direction());
        is_planar = Standard_True;
       }
@@ -1901,12 +1887,8 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
 
       BRepBuilderAPI_MakeFace MkF (w1,Standard_True);
       if (MkF.IsDone())  {
-//#ifndef OCCT_DEBUG
         Handle(Geom_Surface) aGeomSurface = BRep_Tool::Surface(MkF.Face());
-        aplane = (Handle(Geom_Plane)&) aGeomSurface ;
-//#else
-//     aplane = ((Handle(Geom_Plane)&) BRep_Tool::Surface(MkF.Face()));
-//#endif
+        aplane = Handle(Geom_Plane)::DownCast (aGeomSurface);
        is_planar = Standard_True;
       }
     }
@@ -1931,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);
@@ -1945,7 +1927,7 @@ void TPrsStd_ConstraintTools::ComputeOffset (const Handle(TDataXtd_Constraint)&
   }
 
 #ifdef OCCT_DEBUG
-  cout << "TPrsStd_ConstraintTools::ComputeOffset: Case not implemented" << endl;
+  std::cout << "TPrsStd_ConstraintTools::ComputeOffset: Case not implemented" << std::endl;
 #endif
   NullifyAIS(anAIS);
 }
@@ -1961,14 +1943,13 @@ void TPrsStd_ConstraintTools::ComputePlacement
 {
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) 
-    Standard_ProgramError::Raise
-      ("TPrsStd_ConstraintTools::ComputePlacement: at leat two constraints are needed");
+    throw Standard_ProgramError("TPrsStd_ConstraintTools::ComputePlacement: at leat two constraints are needed");
   
   TopoDS_Shape shape1,shape2 ;
   GetTwoShapes(aConst,shape1,shape2);
   if (shape1.IsNull() || shape2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -1980,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));
@@ -2099,7 +2080,7 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 2) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeCoincident: at leat two constraintes are needed" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeCoincident: at leat two constraintes are needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return; 
@@ -2107,18 +2088,19 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
   
   if (!aConst->IsPlanar()) { 
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeCoincident: must be a planar constraint" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeCoincident: must be a planar constraint" << std::endl;
 #endif
     anAIS.Nullify() ; 
     return;
   }
   
   TopoDS_Shape shape1,shape2 ;
-  Handle(Geom_Plane) aplane;
-  GetShapesAndGeom(aConst,shape1,shape2,aplane);
+  Handle(Geom_Geometry) ageom;
+  GetShapesAndGeom(aConst,shape1,shape2,ageom);
+  Handle(Geom_Plane) aplane = Handle(Geom_Plane)::DownCast (ageom);
   if (shape1.IsNull() || shape2.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -2128,19 +2110,19 @@ void TPrsStd_ConstraintTools::ComputeCoincident(const Handle(TDataXtd_Constraint
   GetGoodShape(shape2);
   if (aplane.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul plane" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeCoincident: nul plane" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
   }
   
   //  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);
@@ -2161,7 +2143,7 @@ void TPrsStd_ConstraintTools::ComputeRound(const Handle(TDataXtd_Constraint)& aC
   Standard_Integer nbgeom = aConst->NbGeometries();
   if (nbgeom < 1) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputeRound: at leat one geometry is needed" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputeRound: at leat one geometry is needed" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return; 
@@ -2170,7 +2152,7 @@ void TPrsStd_ConstraintTools::ComputeRound(const Handle(TDataXtd_Constraint)& aC
   GetOneShape (aConst,shape1);
   if (shape1.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << endl;
+    std::cout << "TPrsStd_ConstraintTools::ComputePlacement: nul shape" << std::endl;
 #endif
     NullifyAIS(anAIS);
     return;
@@ -2181,24 +2163,24 @@ 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);
        }
      }
    }
-   catch(Standard_Failure) {
+   catch(Standard_Failure const&) {
      ais.Nullify();
    }
  }
@@ -2215,7 +2197,7 @@ void TPrsStd_ConstraintTools::GetGeom(const Handle(TDataXtd_Constraint)& aConst,
   Handle(TNaming_NamedShape) atgeom = aConst->GetPlane();
   if (atgeom.IsNull()) {
 #ifdef OCCT_DEBUG
-    cout<<"TPrsStd_ConstraintTools::GetGeom : aConst->GetPlane().IsNull()"<<endl;
+    std::cout<<"TPrsStd_ConstraintTools::GetGeom : aConst->GetPlane().IsNull()"<<std::endl;
 #endif
     return;
   }
@@ -2236,7 +2218,7 @@ void TPrsStd_ConstraintTools::GetGeom(const Handle(TDataXtd_Constraint)& aConst,
   else if (TDataXtd_Geometry::Point(label,apoint)) aGeom =  new Geom_CartesianPoint(apoint);
 #ifdef OCCT_DEBUG
   else {
-    cout << "TPrsStd_ConstraintTools::GetGeom no geom on label " << endl;
+    std::cout << "TPrsStd_ConstraintTools::GetGeom no geom on label " << std::endl;
   }
 #endif  
 }