]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
It removes AIS curve presentation.
authornds <nds@opencascade.com>
Wed, 4 Dec 2013 10:47:45 +0000 (10:47 +0000)
committernds <nds@opencascade.com>
Wed, 4 Dec 2013 10:47:45 +0000 (10:47 +0000)
src/HYDROCurveCreator/CMakeLists.txt
src/HYDROCurveCreator/CurveCreator_AISCurve.cxx [deleted file]
src/HYDROCurveCreator/CurveCreator_AISCurve.hxx [deleted file]
src/HYDROCurveCreator/CurveCreator_Curve.cxx
src/HYDROCurveCreator/CurveCreator_Curve.hxx
src/HYDROCurveCreator/CurveCreator_Profile.cxx
src/HYDROCurveCreator/CurveCreator_Utils.cxx
src/HYDROCurveCreator/CurveCreator_UtilsICurve.cxx
src/HYDROCurveCreator/CurveCreator_Widget.cxx

index 1914ee4c8bdba39cd9ab8e05172080ee128fccfa..2ff0e0984d3280634f27cbd25374e75e02b0b6c4 100644 (file)
@@ -70,7 +70,6 @@ ENDIF(SALOME_BUILD_GUI)
 SET(_other_HEADERS
   CurveCreator.hxx
   CurveCreator_Displayer.h
-  CurveCreator_AISCurve.hxx
   CurveCreator_Curve.hxx
   CurveCreator_Diff.hxx
   CurveCreator_ICurve.hxx
@@ -96,7 +95,6 @@ ENDIF(SALOME_BUILD_GUI)
 # sources / static
 SET(_other_SOURCES
   CurveCreator_Displayer.cxx
-  CurveCreator_AISCurve.cxx
   CurveCreator_Curve.cxx
   CurveCreator_Diff.cxx
   CurveCreator_Operation.cxx
diff --git a/src/HYDROCurveCreator/CurveCreator_AISCurve.cxx b/src/HYDROCurveCreator/CurveCreator_AISCurve.cxx
deleted file mode 100644 (file)
index 923d038..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "CurveCreator_AISCurve.hxx"
-#include "CurveCreator_Curve.hxx"
-
-#include <Quantity_Color.hxx>
-#include <Prs3d_Presentation.hxx>
-#include <StdPrs_WFDeflectionShape.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-#include <GeomAPI_Interpolate.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Wire.hxx>
-
-#include <Graphic3d_Array1OfVertex.hxx>
-#include <Graphic3d_Group.hxx>
-#include <Graphic3d_ArrayOfSegments.hxx>
-#include <Prs3d_Root.hxx>
-
-IMPLEMENT_STANDARD_HANDLE(CurveCreator_AISCurve, AIS_Shape)
-IMPLEMENT_STANDARD_RTTIEXT(CurveCreator_AISCurve, AIS_Shape)
-
-CurveCreator_AISCurve::CurveCreator_AISCurve( CurveCreator_Curve* theCurve )
-: AIS_Shape( TopoDS_Shape() ), myCurve( theCurve )
-{
-}
-
-void CurveCreator_AISCurve::getPoint( const int theISection, const int theIPoint,
-                                      gp_Pnt& thePoint )
-{
-  double anX, anY, aZ;
-  myCurve->getCoordinates( theISection, theIPoint, anX, anY, aZ );
-  thePoint = gp_Pnt( anX, anY, aZ);
-}
-
-#define MAKE_BUILDER_USE
-void CurveCreator_AISCurve::Compute( const Handle(PrsMgr_PresentationManager3d)& thePM,
-                                     const Handle(Prs3d_Presentation)& thePrs,
-                                     const Standard_Integer theMode )
-{
-  thePrs->Clear();
-
-  for( int iSection = 0 ; iSection < myCurve->getNbSections() ; iSection++ ) {
-    CurveCreator::SectionType aSectType = myCurve->getSectionType( iSection );
-    int aPointSize = myCurve->getNbPoints( iSection );
-    bool aSectIsClosed = myCurve->isClosed( iSection );
-    if( aSectType == CurveCreator::Polyline )
-    {
-      int iPoint = 0;
-      gp_Pnt aPrevPoint, aPoint;
-      if ( aPointSize == 1 ) {
-        getPoint( iSection, iPoint, aPrevPoint );
-        TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex( aPrevPoint ).Vertex();
-        Set( aVertex );
-      }
-      else if ( aPointSize > 1 ) {
-#ifdef MAKE_BUILDER_USE
-        TopoDS_Edge aPointEdge;
-        BRepBuilderAPI_MakeWire aMakeWire;
-        getPoint( iSection, iPoint, aPrevPoint );
-        iPoint++;
-        for( ; iPoint < aPointSize; iPoint++ ) {
-          getPoint( iSection, iPoint, aPoint );
-          aPointEdge = BRepBuilderAPI_MakeEdge( aPrevPoint, aPoint ).Edge();
-          aMakeWire.Add( BRepBuilderAPI_MakeWire( aPointEdge ) );
-          aPrevPoint = aPoint;
-        }
-        if( myCurve->isClosed( iSection ) && ( aPointSize > 2 ) ) {
-          getPoint( iSection, 0, aPoint );
-          aPointEdge = BRepBuilderAPI_MakeEdge( aPrevPoint, aPoint ).Edge();
-          aMakeWire.Add( BRepBuilderAPI_MakeWire( aPointEdge ) );
-        }
-
-        TopoDS_Wire aLineWire = aMakeWire.Wire();
-        Set( aLineWire );
-        AIS_Shape::Compute( thePM, thePrs, theMode );
-      }
-#else
-      bool isClosed = myCurve->isClosed( iSection ) && ( aPointSize > 2 );
-      Handle(Graphic3d_ArrayOfPolylines) anArray = new Graphic3d_ArrayOfPolylines
-                                             ( !isClosed ? aPointSize : aPointSize+1 );
-      for( ; iPoint < aPointSize; iPoint++ ) {
-        getPoint( iSection, iPoint, aPoint );
-        anArray->AddVertex(aPoint.X(), aPoint.Y(), aPoint.Z());
-      }
-
-      if( myCurve->isClosed( iSection ) && ( aPointSize > 2 ) ) {
-        getPoint( iSection, 0, aPoint );
-        anArray->AddVertex(aPoint.X(), aPoint.Y(), aPoint.Z());
-      }
-      Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( thePrs );
-      aGroup->AddPrimitiveArray(anArray);
-#endif
-    }
-    else if( aSectType == CurveCreator::Spline )
-    {
-      std::vector<double> aPoints;
-      for( int iPoint = 0; iPoint < aPointSize; iPoint++ )
-      {
-        CurveCreator::Coordinates aCoords = myCurve->getPoint( iSection, iPoint );
-        double aX = aCoords[0];
-        double aY = aCoords[1];
-        double aZ = aCoords[2];
-        aPoints.push_back( aX );
-        aPoints.push_back( aY );
-      }
-      if( aPointSize > 1 )
-      {
-        Handle(Geom_BSplineCurve) aBSplineCurve;
-        Handle(Geom_Curve) aGeomCurve;
-        // fill array for algorithm by the received coordinates
-        int aLen = aPoints.size() / 2;
-        Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt (1, aLen);
-        std::vector<double>::const_iterator aListIter = aPoints.begin();
-        for (int ind = 1; ind <= aLen; ind++) {
-          gp_Pnt aPnt(gp::Origin());
-          aPnt.SetX(*aListIter);
-          aListIter++;
-          aPnt.SetY(*aListIter);
-          aListIter++;
-          aPnt.SetZ(0);
-          aHCurvePoints->SetValue(ind, aPnt);
-        }
-        // compute BSpline
-        GeomAPI_Interpolate aGBC(aHCurvePoints, aSectIsClosed, gp::Resolution());
-        aGBC.Perform();
-        if (aGBC.IsDone()) {
-          aBSplineCurve = aGBC.Curve();
-        }
-        TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aBSplineCurve ).Edge();
-
-        TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( anEdge ).Wire();
-
-        Set( aWire );
-        AIS_Shape::Compute( thePM, thePrs, theMode );
-      }
-    }
-  }
-}
-
-void CurveCreator_AISCurve::ComputeSelection( const Handle(SelectMgr_Selection)& theSelection,
-                                              const Standard_Integer theMode )
-{
-  AIS_Shape::ComputeSelection( theSelection, theMode );
-}
diff --git a/src/HYDROCurveCreator/CurveCreator_AISCurve.hxx b/src/HYDROCurveCreator/CurveCreator_AISCurve.hxx
deleted file mode 100644 (file)
index 5c01627..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef CURVECREATOR_AIS_CURVE_H
-#define CURVECREATOR_AIS_CURVE_H
-
-#include "CurveCreator.hxx"
-#include "CurveCreator_Macro.hxx"
-
-#include <Standard_DefineHandle.hxx>   
-
-#include <AIS_Shape.hxx>
-#include <gp_Pnt.hxx>
-
-class CurveCreator_Curve;
-
-DEFINE_STANDARD_HANDLE(CurveCreator_AISCurve, AIS_Shape)
-
-/**
- * \class CurveCreator_AISCurve
- * \brief This class builds an AIS presentation for a curve creator interface
- */
-class CurveCreator_AISCurve : public AIS_Shape
-{
-public:
-  Standard_EXPORT CurveCreator_AISCurve( CurveCreator_Curve* theCurve );
-
-protected:
-  /**
-   * Computes the 3D presentation
-   * \param thePM a presentation Manager
-   * \param thePrs a presentation
-   * \theMode a compute mode
-   */
-  Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePM,
-                                       const Handle(Prs3d_Presentation)& thePrs,
-                                       const Standard_Integer theMode);
-  
-  /**
-   * Computes the 3D selection
-   * \param theSelection a selection manager
-   * \theMode a selection mode
-   */
-  Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
-                                                const Standard_Integer theMode);
-
-public:
-  DEFINE_STANDARD_RTTI(CurveCreator_AISCurve)
-
-protected:
-  void getPoint( const int theSectionId, const int thePointId, gp_Pnt& thePoint );
-
-protected:
-  CurveCreator_Curve* myCurve;
-};
-
-#endif // CURVECREATOR_AIS_CURVE_H
index ac43473ce7d33d1cdcd1ff670a13285470571b53..7e814ade601bf9866a61b389c28608b0f9014461 100644 (file)
@@ -38,8 +38,6 @@
 
 #include <stdio.h>
 
-//#define AIS_CURVE_DISPLAY
-
 //=======================================================================
 // function: Constructor
 // purpose:
@@ -53,9 +51,6 @@ CurveCreator_Curve::CurveCreator_Curve( const CurveCreator::Dimension theDimensi
   myUndoDepth (-1),
   myOpLevel(0)
 {
-#ifdef AIS_CURVE_DISPLAY
-  myAISCurve = new CurveCreator_AISCurve( this );
-#endif
 }
 
 //=======================================================================
@@ -105,10 +100,6 @@ std::string CurveCreator_Curve::getUniqSectionName() const
 void CurveCreator_Curve::setDisplayer( CurveCreator_Displayer* theDisplayer )
 {
   myDisplayer = theDisplayer;
-  
-#ifdef AIS_CURVE_DISPLAY
-  myDisplayer->displayAIS( myAISCurve, false );
-#endif
 }
 
 //=======================================================================
@@ -249,30 +240,11 @@ void CurveCreator_Curve::getCoordinates( int theISection, int theIPoint, double&
   }
 }
 
-//#define USE_COMPOUND
 void CurveCreator_Curve::redisplayCurve()
 {
   if( myDisplayer ) {
-#ifdef AIS_CURVE_DISPLAY
-    myDisplayer->redisplayAIS(myAISCurve, false);
-#else
     myDisplayer->erase( false );
-//#ifndef USE_COMPOUND
     myDisplayer->display( constructWire(), true );
-//#else
-    /*std::vector<Handle_AIS_InteractiveObject> anAISObjects = constructWire();
-    int aSelMode = AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)TopAbs_VERTEX );
-    Handle(AIS_InteractiveContext) aContext = myDisplayer->getAISContext();
-    for( int i = 0 ; i < anAISObjects.size() ; i++ ){
-      Handle_AIS_InteractiveObject anAISObject = anAISObjects[i];
-      //anAISObject->SetSelectionMode( aSelMode );
-      aContext->Display( anAISObject, Standard_False );
-      //aContext->Display( anAISObject, 0, aSelMode, Standard_False, Standard_True );
-    }
-      aContext->UpdateCurrentViewer();
-    */
-//#endif
-#endif
   }
 }
 
index 67f0242f3d68da2e7b6d7064220b7657a29eb924..abefa0d5d729a6af305c5fe4441bd4d6e5f4830c 100644 (file)
@@ -28,7 +28,6 @@
 #include "CurveCreator_Macro.hxx"
 #include "CurveCreator.hxx"
 #include "CurveCreator_Diff.hxx"
-#include "CurveCreator_AISCurve.hxx"
 
 #include <AIS_InteractiveObject.hxx>
 
@@ -265,7 +264,6 @@ public:
   virtual ListAISObjects constructWire() const;
 
 public:
-  Handle(CurveCreator_AISCurve)   myAISCurve;
   bool                            myIsLocked;
   CurveCreator::Sections          mySections;   //!< curve data
   CurveCreator::Dimension         myDimension;  //!< curve dimension
index 0c11fc18e92643cfa9401a7717ed1c52fe2022ea..ee0d204bd4f2e3bd02142c6310822bc3454a8f5f 100644 (file)
@@ -24,9 +24,6 @@
 #include "CurveCreator_Section.hxx"
 #include "CurveCreator_Displayer.h"
 
-#include <AIS_Point.hxx>
-#include <AIS_Line.hxx>
-#include <AIS_Shape.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <Geom_CartesianPoint.hxx>
index a8514964c58c1de6407973e694eb8a292b870345..e237e6ee69c3ec77f69f2da87834ae1db8124fc3 100644 (file)
@@ -34,7 +34,6 @@
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <AIS_Shape.hxx>
-#include <AIS_Point.hxx>
 #include <AIS_Line.hxx>
 #include <AIS_Trihedron.hxx>
 
index cc717a08d449fe7f5c91405139f7520976b1a257..d11598e257661b781a0191e3ec7694c1a4a22faa 100644 (file)
@@ -20,6 +20,7 @@
 #include "CurveCreator_UtilsICurve.hxx"
 
 #include "CurveCreator.hxx"
+#include <gp_Pnt.hxx>
 
 const double LOCAL_SELECTION_TOLERANCE = 0.0001;
 
@@ -82,7 +83,7 @@ void CurveCreator_UtilsICurve::convert( const CurveCreator_ICurve::SectionToPoin
   }
 }
 
-#include "CurveCreator_Curve.hxx"
+#include "CurveCreator_Curve.hxx" // TODO
 void CurveCreator_UtilsICurve::getPoint( const CurveCreator_ICurve* theCurve, const int theISection,
                                          const int theIPoint, gp_Pnt& thePoint )
 {
index 66534638175a8a784e944b657fc2302d2a2edddf..f3c5b8e85f2c971c216cc6264cbd0a406be343c0 100644 (file)
@@ -52,8 +52,6 @@
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <AIS_Shape.hxx>
-#include <AIS_Point.hxx>
-#include <AIS_Line.hxx>
 #include <AIS_LocalContext.hxx>
 #include <Geom_Point.hxx>
 #include <Geom_BSplineCurve.hxx>