Salome HOME
Porting on SALOME 7.6.0
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 3 Jun 2015 15:26:38 +0000 (18:26 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 3 Jun 2015 15:26:53 +0000 (18:26 +0300)
12 files changed:
env_Salome.bat
src/GeomAPI/GeomAPI_AISObject.cpp
src/ModuleBase/ModuleBase_ResultPrs.cpp
src/SketcherPrs/CMakeLists.txt
src/SketcherPrs/SketcherPrs_Coincident.cpp
src/SketcherPrs/SketcherPrs_Rigid.cpp
src/SketcherPrs/SketcherPrs_SensitivePoint.cpp
src/SketcherPrs/SketcherPrs_SensitivePoint.h
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.h
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Selection.cpp

index 86b26cfbc1e18b272d8fdb447f3b41d81f1ce8a9..6f145aa304fc94f3542c3dfe1277b9a507677694 100644 (file)
@@ -57,20 +57,14 @@ cd %ROOT_DIR%
 @REM -------------------------
 
 @REM -------------------------
-@REM Create launch path
-rem @SET PATH=%LIBXML2_ROOT_DIR%\bin;%PATH%
-rem @SET PATH=%PDIR%\tbb\bin;%PATH%
-rem @SET PATH=%PDIR%\freeimage-3.15.4\bin;%PATH%
-rem @SET PATH=%PDIR%\ftgl-2.1.3\bin;%PATH%
-rem @SET PATH=%PDIR%\freetype-2.4.11\bin;%PATH%
-rem @SET PATH=%PDIR%\gl2ps-1.3.8\bin;%PATH%
-rem @SET PATH=%PDIR%\qwt-5.2.1\lib;%PATH%
-rem @SET PATH=%SOLVESPACE_ROOT_DIR%\lib;%PATH%
+@SET PYTHONHOME=%PYTHON_ROOT_DIR%
+@SET PYTHON_INCLUDE=%PYTHONHOME%\include
 @REM -------------------------
 
+
 @REM -------------------------
-@SET PYTHONHOME=%PYTHON_ROOT_DIR%
-@SET PYTHON_INCLUDE=%PYTHONHOME%\include
+@REM Some OCCT headers include FREETYPE headers
+@SET FREETYPE_DIR=%PDIR%\freetype-2.4.11
 @REM -------------------------
 
 @SET PATH=%GEOM_ROOT_DIR%\lib\salome;%PATH%
index 57d192bbac49556cfb921e703022e28009797cfe..c09d9a421d56aac93ae942bcebacaaeb72cae8d2 100644 (file)
@@ -353,8 +353,8 @@ void GeomAPI_AISObject::setPointMarker(int theType, double theScale)
 {
   Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
   if (!anAIS.IsNull()) {
-    Handle(AIS_Drawer) aDrawer = anAIS->Attributes();
-    if (aDrawer->HasPointAspect()) {
+    Handle(Prs3d_Drawer) aDrawer = anAIS->Attributes();
+    if (aDrawer->HasOwnPointAspect()) {
       Handle(Prs3d_PointAspect) aPA = aDrawer->PointAspect();
       aPA->SetTypeOfMarker((Aspect_TypeOfMarker)theType);
       aPA->SetScale(theScale);
@@ -370,14 +370,14 @@ bool GeomAPI_AISObject::setLineStyle(int theStyle)
   bool isChanged = false;
   Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
   if (!anAIS.IsNull()) {
-    Handle(AIS_Drawer) aDrawer = anAIS->Attributes();
+    Handle(Prs3d_Drawer) aDrawer = anAIS->Attributes();
     Handle(Prs3d_LineAspect) aLineAspect;
 
     Aspect_TypeOfLine aType = (Aspect_TypeOfLine)theStyle;
-    if (aDrawer->HasLineAspect()) {
+    if (aDrawer->HasOwnLineAspect()) {
       aLineAspect = aDrawer->LineAspect();
     }
-    if (aDrawer->HasWireAspect()) {
+    if (aDrawer->HasOwnWireAspect()) {
       aLineAspect = aDrawer->WireAspect();
     }
     Quantity_Color aCurrentColor;
index 2f85e9a992f03f38b128adedf969a5700818f3b9..211fdde73eaf137bffbf5561039171d38c328670 100644 (file)
@@ -11,7 +11,6 @@
 #include <GeomAPI_PlanarEdges.h>
 
 #include <BRep_Builder.hxx>
-#include <AIS_Drawer.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <TopoDS_Builder.hxx>
 
index fb508fed714d25e78555e2b5c2dc50e2a7cb611c..b67e917de93308d48f2ac50255179039cca2fe0a 100644 (file)
@@ -83,6 +83,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
   ${PROJECT_SOURCE_DIR}/src/SketchPlugin
   ${CAS_INCLUDE_DIRS}
+  $ENV{FREETYPE_DIR}/include
 )
 
 TARGET_LINK_LIBRARIES(SketcherPrs ${PROJECT_LIBRARIES})
index 7bd3d30ef4f347eeef10d7302de8dc3929fe1962..8b533fdba3e19c95d8d53d6d34f23a697806c2f1 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <SketchPlugin_Constraint.h>
 
-#include <AIS_Drawer.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
 #include <Graphic3d_ArrayOfPoints.hxx>
 #include <Prs3d_PointAspect.hxx>
index 109d3a6871ebfed7df2f125f35850feaff856562..7ef19eef99015c7aed1e9c62e05fa8b58495de27 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <SketchPlugin_Constraint.h>
 
-#include <AIS_Drawer.hxx>
 #include <gp_Pnt2d.hxx>
 
 #include <Graphic3d_AspectLine3d.hxx>
index ac89d78a6b0f842d32bc1955300da516b5443785..f9a49e9d1dc5aab6e79ac398026d097672cf7e66 100644 (file)
@@ -7,12 +7,10 @@
 
 #include "SketcherPrs_SensitivePoint.h"
 
-#include <Select3D_Projector.hxx>
 #include <Bnd_Box2d.hxx>
 #include <CSLib_Class2d.hxx>
 #include <ElCLib.hxx>
 #include <TopLoc_Location.hxx>
-#include <SelectBasics_ListOfBox2d.hxx>
 
 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
@@ -22,103 +20,50 @@ SketcherPrs_SensitivePoint::SketcherPrs_SensitivePoint(const Handle(SelectBasics
                                                         int theId)
 :Select3D_SensitiveEntity(anOwner), myId(theId), myPntArray(thePntArray)
 {
-  SetSensitivityFactor(4.);
+  SetSensitivityFactor(12.);
 }
 
-void SketcherPrs_SensitivePoint::Project (const Handle(Select3D_Projector)& aProj)
+Standard_Boolean SketcherPrs_SensitivePoint::Matches (SelectBasics_SelectingVolumeManager& theMgr,
+                                                   SelectBasics_PickResult& thePickResult)
 {
-  gp_Pnt2d aPoint2d;
-  gp_Pnt aPnt = Point();
-  if(!HasLocation())
-    aProj->Project(aPnt, aPoint2d);
-  else
-  {
-    gp_Pnt aP(aPnt.X(), aPnt.Y(), aPnt.Z());
-    aProj->Project(aP.Transformed(Location().Transformation()), aPoint2d);
-  }
-  myprojpt = aPoint2d;
-}
-
-void SketcherPrs_SensitivePoint::Areas(SelectBasics_ListOfBox2d& boxes)
-{
-  Bnd_Box2d abox;
-  abox.Set(myprojpt);
-  boxes.Append(abox);
-}
-
-Standard_Boolean SketcherPrs_SensitivePoint::Matches(const SelectBasics_PickArgs& thePickArgs,
-                                                      Standard_Real& theMatchDMin,
-                                                      Standard_Real& theMatchDepth)
-{
-  // check coordinate matching
-  Standard_Real aDist = gp_Pnt2d (thePickArgs.X(), thePickArgs.Y()).Distance (myprojpt);
-  if (aDist > thePickArgs.Tolerance() * SensitivityFactor())
-  {
-    return Standard_False;
-  }
-
-  Standard_Real aDepth = ComputeDepth (thePickArgs.PickLine());
-  if (thePickArgs.IsClipped (aDepth))
+  Standard_Real aDepth      = RealLast();
+  Standard_Real aDistToCOG  = RealLast();
+  gp_Pnt aPnt = myPntArray->Vertice(myId);
+  if (!theMgr.Overlaps (aPnt, aDepth))
   {
+    thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
     return Standard_False;
   }
 
-  theMatchDMin = aDist;
-  theMatchDepth = aDepth;
+  aDistToCOG = aDepth;
+  thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
   return Standard_True;
 }
 
-Standard_Boolean SketcherPrs_SensitivePoint::Matches(const Standard_Real XMin,
-                                                     const Standard_Real YMin,
-                                                     const Standard_Real XMax,
-                                                     const Standard_Real YMax,
-                                                     const Standard_Real aTol)
-{
-  Bnd_Box2d B;
-  B.Update(Min(XMin,XMax),Min(YMin,YMax),Max(XMin,XMax),Max(YMin,YMax));
-  B.Enlarge(aTol);
-  return !B.IsOut(myprojpt);
-}
-
-Standard_Boolean SketcherPrs_SensitivePoint::Matches(const TColgp_Array1OfPnt2d& aPoly,
-                                                     const Bnd_Box2d& aBox,
-                                                     const Standard_Real aTol)
-{
-  Standard_Real Umin,Vmin,Umax,Vmax;
-  aBox.Get(Umin,Vmin,Umax,Vmax);
-  CSLib_Class2d aClassifier2d(aPoly,aTol,aTol,Umin,Vmin,Umax,Vmax);
-
-  Standard_Integer RES = aClassifier2d.SiDans(myprojpt);
-  if(RES==1) return Standard_True;
-
-  return Standard_False;
-}
-
 gp_Pnt SketcherPrs_SensitivePoint::Point() const
 {
   return myPntArray->Vertice(myId);
 }
 
-Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected(const TopLoc_Location& aLoc)
+Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected()
 {
-  Handle(SketcherPrs_SensitivePoint) NiouEnt = new SketcherPrs_SensitivePoint(myOwnerId,myPntArray,myId);
-  if(HasLocation()) NiouEnt->SetLocation(Location());
-  NiouEnt->UpdateLocation(aLoc);
-  return NiouEnt;
+  Handle(SketcherPrs_SensitivePoint) aNewEntity = new SketcherPrs_SensitivePoint (myOwnerId, myPntArray, myId);
+  return aNewEntity;
 }
 
-void SketcherPrs_SensitivePoint::Dump(Standard_OStream& S,const Standard_Boolean /*FullDump*/) const
+gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const
 {
-  gp_Pnt aPnt = Point();
-  S<<"\tSensitivePoint 3D :";
-  if(HasLocation())
-    S<<"\t\tExisting Location"<<endl;
+  return Point();
+}
 
-  S<<"\t\t P3d [ "<<aPnt.X()<<" , "<<aPnt.Y()<<" , "<<aPnt.Z()<<" ]"<<endl;
-  S<<"\t\t P2d [ "<<myprojpt.x<<" , "<<myprojpt.y<<" ]"<<endl;
+Select3D_BndBox3d SketcherPrs_SensitivePoint::BoundingBox()
+{
+  gp_Pnt aPnt = myPntArray->Vertice(myId);
+  return Select3D_BndBox3d (SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()),
+                            SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()));
 }
 
-Standard_Real SketcherPrs_SensitivePoint::ComputeDepth(const gp_Lin& EyeLine) const
+Standard_Integer SketcherPrs_SensitivePoint::NbSubElements()
 {
-  return ElCLib::Parameter(EyeLine, Point());
+  return 1;
 }
index ca30fe4344b58f39f5bad8b54deb50c30c475e2e..31cad7bb22473e9ac0b8eb0bb23b3920e29b7d6b 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <Select3D_SensitiveEntity.hxx>
 #include <Graphic3d_ArrayOfPoints.hxx>
-#include <Select3D_Pnt2d.hxx>
 #include <Standard_DefineHandle.hxx>
 
 
@@ -28,46 +27,33 @@ public:
   Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId, 
     const Handle(Graphic3d_ArrayOfPoints)& thePntArray, int theId);
   
-  //! Converts the stored 3D point into a 2D point according
-  //! to <aProjector> ; this method is called by the selection Manager.
-  Standard_EXPORT   void Project (const Handle(Select3D_Projector)& aProjector) ;
-  
-  //! stores in <aresult> the 2D sensitive box which represents
-  //! the point area in the selection process.
-  Standard_EXPORT   void Areas (SelectBasics_ListOfBox2d& aresult) ;
-  
+  Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
+
   //! Update location of the point
   //! \param aLocation a new location
-  Standard_EXPORT   Handle(Select3D_SensitiveEntity) GetConnected (const TopLoc_Location& aLocation) ;
-  
-  //! Checks whether the sensitive entity matches the picking
-  //! detection area (close to the picking line).
-  //! For details please refer to base class declaration.
-  Standard_EXPORT   Standard_Boolean Matches (const SelectBasics_PickArgs& thePickArgs, Standard_Real& theMatchDMin, Standard_Real& theMatchDepth) ;
-  
-  /// Returns true if the current point is matches with given rectangle
-  /// \param XMin an X min coordinate
-  /// \param YMin an Y min coordinate
-  /// \param XMax an X max coordinate
-  /// \param YMax an Y max coordinate
-  /// \param aTol a tolerance
-  Standard_EXPORT   Standard_Boolean Matches (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real aTol) ;
-  
-  Standard_EXPORT virtual   Standard_Boolean Matches (const TColgp_Array1OfPnt2d& Polyline, const Bnd_Box2d& aBox, const Standard_Real aTol) ;
-  
-  Standard_EXPORT   Standard_Real ComputeDepth (const gp_Lin& EyeLine)  const;
-  
+  Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
+
+  //! Checks whether the point overlaps current selecting volume
+  Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
+                                                    SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
+
   //! Returns the point used at the time of construction.
-  Standard_EXPORT   gp_Pnt Point()  const;
+  Standard_EXPORT gp_Pnt Point() const;
+
+  //! Returns center of point. If location transformation
+  //! is set, it will be applied
+  Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
 
-  Standard_EXPORT virtual   void Dump (Standard_OStream& S, const Standard_Boolean FullDump = Standard_True)  const;
+  //! Returns bounding box of the point. If location
+  //! transformation is set, it will be applied
+  Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
+  
 
   DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint)
 
 private: 
   int myId;
   Handle(Graphic3d_ArrayOfPoints) myPntArray;
-  Select3D_Pnt2d myprojpt;
 };
 
 
index 224a4b1dc36bbfac20152273288ea4042be96ce0..a039cd1199251b71a1cceb1a7147bc6434ba49b1 100644 (file)
@@ -18,7 +18,6 @@
 #include <Graphic3d_BndBox4f.hxx>
 
 #include <SelectMgr_Selection.hxx>
-#include <SelectMgr_SelectionManager.hxx>
 #include <Select3D_SensitivePoint.hxx>
 #include <TopLoc_Location.hxx>
 #include <AIS_InteractiveContext.hxx>
@@ -37,8 +36,6 @@
 #include <OpenGl_PointSprite.hxx>
 #include <OpenGl_VertexBuffer.hxx>
 #include <OpenGl_ShaderManager.hxx>
-#include <OpenGl_VertexBufferCompat.hxx>
-#include <OpenGl_GraphicDriver.hxx>
 
 #ifdef WIN32
 # define FSEP "\\"
index d2202bacf6f84cbb6f3fa0838e41fde18d73b291..d03bb437bf8ab04024079e349cc91f078214c786 100644 (file)
@@ -17,7 +17,7 @@
 #include <Graphic3d_AspectMarker3d.hxx>
 #include <Image_AlienPixMap.hxx>
 #include <SelectMgr_EntityOwner.hxx>
-#include <Select3D_SensitiveEntitySequence.hxx>
+#include <Select3D_EntitySequence.hxx>
 
 #include <Standard_DefineHandle.hxx>
 #include <map>
@@ -144,7 +144,7 @@ private:
 
   mutable Handle(OpenGl_VertexBuffer) myVboAttribs;
 
-  Select3D_SensitiveEntitySequence mySPoints;
+  Select3D_EntitySequence mySPoints;
 };
 
 #endif
\ No newline at end of file
index a3d8b3f9fd86f34a40a9640bf73479077397a2ac..be4b2cee5cec3ddceb395fa7894554352f5375b2 100644 (file)
@@ -47,7 +47,7 @@
 const int MOUSE_SENSITIVITY_IN_PIXEL = 10;  ///< defines the local context mouse selection sensitivity
 
 //#define DEBUG_DISPLAY
-//#define DEBUG_ACTIVATE
+#define DEBUG_ACTIVATE
 //#define DEBUG_FEATURE_REDISPLAY
 //#define DEBUG_SELECTION_FILTERS
 //#define DEBUG_USE_CLEAR_OUTDATED_SELECTION
@@ -149,13 +149,8 @@ void XGUI_Displayer::display(ObjectPtr theObject, AISObjectPtr theAIS,
   if (!anAISIO.IsNull()) {
     appendResultObject(theObject, theAIS);
 
-    bool aCanBeShaded = ::canBeShaded(anAISIO);
     // In order to avoid extra closing/opening context
     SelectMgr_IndexedMapOfOwner aSelectedOwners;
-    if (aCanBeShaded) {
-      myWorkshop->selector()->selection()->selectedOwners(aSelectedOwners);
-      closeLocalContexts(false);
-    }
     aContext->Display(anAISIO, false);
     aContext->SetDisplayMode(anAISIO, isShading? Shading : Wireframe, false);
     if (isShading)
@@ -166,13 +161,7 @@ void XGUI_Displayer::display(ObjectPtr theObject, AISObjectPtr theAIS,
     if (isCustomized)
       aContext->Redisplay(anAISIO, false);
 
-    if (aCanBeShaded) {
-      openLocalContext();
-      activateObjects(myActiveSelectionModes);
-      myWorkshop->selector()->setSelectedOwners(aSelectedOwners, false);
-    }
-    else
-      activate(anAISIO, myActiveSelectionModes);
+    activate(anAISIO, myActiveSelectionModes);
  }
   if (isUpdateViewer)
     updateViewer();
@@ -701,21 +690,10 @@ void XGUI_Displayer::setDisplayMode(ObjectPtr theObject, DisplayMode theMode, bo
     return;
 
   Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
-  bool aCanBeShaded = ::canBeShaded(aAISIO);
-  // In order to avoid extra closing/opening context
   SelectMgr_IndexedMapOfOwner aSelectedOwners;
-  if (aCanBeShaded) {
-    myWorkshop->selector()->selection()->selectedOwners(aSelectedOwners);
-    closeLocalContexts(false);
-  }
   aContext->SetDisplayMode(aAISIO, theMode, false);
   // Redisplay in order to update new mode because it could be not computed before
   aContext->Redisplay(aAISIO, false);
-  if (aCanBeShaded) {
-    openLocalContext();
-    activateObjects(myActiveSelectionModes);
-    myWorkshop->selector()->setSelectedOwners(aSelectedOwners, false);
-  }
   if (toUpdate)
     updateViewer();
 }
index 3f93b29ac9002770b910a309d33f48634a344c63..ea99308aa7a2cabdc93d9082c86d382db1b6a5f7 100644 (file)
 
 #include <AIS_InteractiveContext.hxx>
 
-#include <SelectMgr_Selection.hxx>
-#include <SelectMgr_EntityOwner.hxx>
-
-#include <SelectBasics_SensitiveEntity.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <StdSelect_BRepOwner.hxx>
 
@@ -227,11 +223,11 @@ void XGUI_Selection::entityOwners(const Handle(AIS_InteractiveObject)& theObject
 
     Handle(SelectMgr_Selection) aSelection = theObject->Selection(aMode);
     for (aSelection->Init(); aSelection->More(); aSelection->Next()) {
-      Handle(SelectBasics_SensitiveEntity) anEntity = aSelection->Sensitive();
+      Handle(SelectMgr_SensitiveEntity) anEntity = aSelection->Sensitive();
       if (anEntity.IsNull())
         continue;
       Handle(SelectMgr_EntityOwner) anOwner =
-        Handle(SelectMgr_EntityOwner)::DownCast(anEntity->OwnerId());
+        Handle(SelectMgr_EntityOwner)::DownCast(anEntity->BaseSensitive()->OwnerId());
       if (!anOwner.IsNull())
         theOwners.Add(anOwner);
     }