0025180: Visualization - Homogeneous transformation API in TKV3d
[occt.git] / src / AIS / AIS_EqualDistanceRelation.cxx
index e4c7bcc..f999dc3 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <Standard_NotImplemented.hxx>
-
-#include <AIS_EqualDistanceRelation.ixx>
 
-#include <DsgPrs_EqualDistancePresentation.hxx>
+#include <AIS_EqualDistanceRelation.hxx>
 #include <AIS_LengthDimension.hxx>
-#include <gp_Lin.hxx>
-#include <DsgPrs_EqualDistancePresentation.hxx>
-#include <SelectMgr_EntityOwner.hxx>
-#include <Select3D_SensitiveSegment.hxx>
-#include <Select3D_SensitiveBox.hxx>
-#include <Select3D_SensitiveCircle.hxx>
-#include <Precision.hxx>
+#include <Bnd_Box.hxx>
+#include <BRep_Tool.hxx>
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRepBuilderAPI_MakeVertex.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <BRep_Tool.hxx>
+#include <DsgPrs_EqualDistancePresentation.hxx>
+#include <ElCLib.hxx>
+#include <Geom_Circle.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_Transformation.hxx>
 #include <GeomAPI_ProjectPointOnCurve.hxx>
 #include <GeomAPI_ProjectPointOnSurf.hxx>
-#include <Prs3d_DimensionAspect.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Pnt.hxx>
+#include <Precision.hxx>
 #include <Prs3d_ArrowAspect.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_Circle.hxx>
+#include <Prs3d_DimensionAspect.hxx>
 #include <Prs3d_Drawer.hxx>
-#include <ElCLib.hxx>
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_Projector.hxx>
+#include <Select3D_SensitiveBox.hxx>
+#include <Select3D_SensitiveCircle.hxx>
+#include <Select3D_SensitiveSegment.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <Standard_NotImplemented.hxx>
+#include <Standard_Type.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(AIS_EqualDistanceRelation,AIS_Relation)
+
 //=======================================================================
 //function : AIS_EqualDistanceRelation
 //purpose  : 
 //=======================================================================
-
 AIS_EqualDistanceRelation::AIS_EqualDistanceRelation( const TopoDS_Shape& aShape1,
                                                      const TopoDS_Shape& aShape2,
                                                      const TopoDS_Shape& aShape3,
@@ -401,8 +409,8 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
   
   if (cu1.GetType() == GeomAbs_Line && cu2.GetType() == GeomAbs_Line) 
     {
-      const Handle(Geom_Line)& geom_lin1 = (Handle(Geom_Line)&) geom1;
-      const Handle(Geom_Line)& geom_lin2 = (Handle(Geom_Line)&) geom2;
+      Handle(Geom_Line) geom_lin1 (Handle(Geom_Line)::DownCast (geom1));
+      Handle(Geom_Line) geom_lin2 (Handle(Geom_Line)::DownCast (geom2));
       const gp_Lin& l1 = geom_lin1->Lin();
       const gp_Lin& l2 = geom_lin2->Lin();
       
@@ -494,8 +502,8 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese
 }
   if (cu1.GetType() == GeomAbs_Circle && cu2.GetType() == GeomAbs_Circle){
     //Get first and last points of circles
-    const Handle(Geom_Circle)& aCir1 = Handle(Geom_Circle)::DownCast(geom1);
-    const Handle(Geom_Circle)& aCir2 = Handle(Geom_Circle)::DownCast(geom2);
+    Handle(Geom_Circle) aCir1 (Handle(Geom_Circle)::DownCast(geom1));
+    Handle(Geom_Circle) aCir2 (Handle(Geom_Circle)::DownCast(geom2));
     gp_Circ aCirc1 = aCir1->Circ();
     gp_Circ aCirc2 = aCir2->Circ();
 
@@ -725,7 +733,7 @@ void AIS_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( const Handle( Prs
 
   if ( aCurve->IsInstance(STANDARD_TYPE(Geom_Line)) ) 
     {
-  const Handle(Geom_Line)& geom_lin = (Handle(Geom_Line)&) aCurve;
+  Handle(Geom_Line) geom_lin (Handle(Geom_Line)::DownCast (aCurve));
   const gp_Lin& l = geom_lin->Lin();
 
   // computation of Val