0025180: Visualization - Homogeneous transformation API in TKV3d
[occt.git] / src / AIS / AIS_ConcentricRelation.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 78a29ad..aa11bce
@@ -1,55 +1,52 @@
 // Created on: 1996-12-05
 // Created by: Flore Lantheaume/Odile Olivier
 // Copyright (c) 1996-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 
-#include <Standard_NotImplemented.hxx>
-
-#include <AIS_ConcentricRelation.ixx>
-
-#include <SelectMgr_EntityOwner.hxx>
-#include <Select3D_SensitiveCircle.hxx>
-#include <Select3D_SensitiveSegment.hxx>
-
-#include <DsgPrs_ConcentricPresentation.hxx>
-
-#include <TopoDS.hxx>
-
+#include <AIS.hxx>
+#include <AIS_ConcentricRelation.hxx>
 #include <BRepAdaptor_Curve.hxx>
-
-#include <GeomAbs_CurveType.hxx>
+#include <DsgPrs_ConcentricPresentation.hxx>
 #include <Geom_Circle.hxx>
-#include <gp_Dir.hxx>
-#include <gp_Vec.hxx>
-#include <gp_Ax2.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_Transformation.hxx>
+#include <GeomAbs_CurveType.hxx>
 #include <gp_Ax1.hxx>
-#include <gp_Pnt.hxx>
+#include <gp_Ax2.hxx>
+#include <gp_Dir.hxx>
 #include <gp_Pln.hxx>
-
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+#include <Prs3d_Presentation.hxx>
+#include <Prs3d_Projector.hxx>
+#include <Select3D_SensitiveCircle.hxx>
+#include <Select3D_SensitiveSegment.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_Selection.hxx>
+#include <Standard_NotImplemented.hxx>
+#include <Standard_Type.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
 #include <TopoDS_Vertex.hxx>
-#include <AIS.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(AIS_ConcentricRelation,AIS_Relation)
 
 //=======================================================================
 //function : Constructor
 //purpose  : 
 //=======================================================================
-
 AIS_ConcentricRelation::AIS_ConcentricRelation(
        const TopoDS_Shape& aFShape, 
        const TopoDS_Shape& aSShape, 
@@ -91,9 +88,9 @@ void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&
   }  
 }
 
-void AIS_ConcentricRelation::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
+void AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation)
 {
-// Standard_NotImplemented::Raise("AIS_ConcentricRelation::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");
+// Standard_NotImplemented::Raise("AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)");
   PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ;
 }
 
@@ -122,7 +119,7 @@ void AIS_ConcentricRelation::ComputeEdgeVertexConcentric(const Handle(Prs3d_Pres
   gp_Pnt P;
   AIS::ComputeGeometry(V,P, myPlane, isOnPlanVertex);
 
-  const Handle(Geom_Circle)& CIRCLE = (Handle(Geom_Circle)&) C;
+  Handle(Geom_Circle) CIRCLE (Handle(Geom_Circle)::DownCast (C));
   myCenter = CIRCLE->Location();
   myRad = Min(CIRCLE->Radius()/5.,15.);
   gp_Dir vec(p1.XYZ() - myCenter.XYZ() );
@@ -153,7 +150,7 @@ void AIS_ConcentricRelation::ComputeTwoVerticesConcentric(const Handle(Prs3d_Pre
   myPnt = myCenter.Translated(vectrans.Multiplied(myRad));
   DsgPrs_ConcentricPresentation::Add(aPresentation,myDrawer,myCenter,myRad,myDir,myPnt);
   if (!isOnPlanVertex1) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V1,P1);
-  if (!isOnPlanVertex1) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V2,P2);
+  if (!isOnPlanVertex2) AIS::ComputeProjVertexPresentation(aPresentation,myDrawer,V2,P2);
 }
 
 //=======================================================================
@@ -184,8 +181,8 @@ void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presen
     return;
   }
   
-  const Handle(Geom_Circle)& gcirc1 = (Handle(Geom_Circle)&) geom1;
-  const Handle(Geom_Circle)& gcirc2 = (Handle(Geom_Circle)&) geom2;
+  Handle(Geom_Circle) gcirc1 (Handle(Geom_Circle)::DownCast (geom1));
+  Handle(Geom_Circle) gcirc2 (Handle(Geom_Circle)::DownCast (geom2));
   
   myCenter = gcirc1->Location();
   
@@ -238,17 +235,6 @@ void AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&,
 {
 }
 
-//=======================================================================
-//function : Compute
-//purpose  : to avoid warning
-//=======================================================================
-
-void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager2d)&, 
-                                    const Handle(Graphic2d_GraphicObject)&,
-                                    const Standard_Integer)
-{
-}
-
 //=======================================================================
 //function : ComputeSelection
 //purpose  :