]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make highlight of points as a circle instead of +
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 16 Jun 2016 15:54:55 +0000 (18:54 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 16 Jun 2016 15:55:10 +0000 (18:55 +0300)
src/ModuleBase/ModuleBase_ResultPrs.cpp
src/ModuleBase/ModuleBase_Tools.cpp
src/ModuleBase/ModuleBase_Tools.h
src/PartSet/PartSet_ResultSketchPrs.cpp
src/XGUI/XGUI_Displayer.cpp

index 75c326a27bd3b7a337f3d322706da0ffcc2b536b..128770c2f7f8db6e86c8ba14972e748ec7a16341 100755 (executable)
@@ -21,6 +21,7 @@
 #include <Prs3d_PointAspect.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <TopoDS_Builder.hxx>
+#include <TopoDS.hxx>
 #include <SelectMgr_SequenceOfOwner.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 #include <SelectMgr_SelectionManager.hxx>
@@ -29,6 +30,7 @@
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_Selection.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <Graphic3d_AspectMarker3d.hxx>
 
 IMPLEMENT_STANDARD_HANDLE(ModuleBase_BRepOwner, StdSelect_BRepOwner);
 IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_BRepOwner, StdSelect_BRepOwner);
@@ -57,6 +59,8 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult)
   // Activate individual repaintng if this is a part of compsolid
   ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(myResult);
   SetAutoHilight(aCompSolid.get() == NULL);
+
+  ModuleBase_Tools::setPointBallHighlighting(this);
 }
 
 void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
index 169f911d3a0655e8053ee26f71d6579a7953d2e4..986d22d18a5f707545ee2f583f80e4f58037504c 100755 (executable)
@@ -41,6 +41,9 @@
 #include <Config_PropManager.h>
 #include <Config_Translator.h>
 
+#include <Prs3d_PointAspect.hxx>
+#include <Graphic3d_AspectMarker3d.hxx>
+
 #include <QWidget>
 #include <QLayout>
 #include <QPainter>
@@ -1150,6 +1153,17 @@ void translate(const std::string& theContext, std::string& theMessage)
   }
 }
 
+void setPointBallHighlighting(AIS_Shape* theAIS)
+{
+  Handle(Prs3d_Drawer) aDrawer = theAIS->HilightAttributes();
+  if (aDrawer->HasOwnPointAspect()) {
+    Handle(Prs3d_PointAspect) aPntAspect = aDrawer->PointAspect();
+    aPntAspect->Aspect()->SetType(Aspect_TOM_BALL);
+    aDrawer->SetPointAspect(aPntAspect);
+    theAIS->SetHilightAttributes(aDrawer);
+  }
+}
+
 } // namespace ModuleBase_Tools
 
 
index ad735c09b6d0d36947b59a6b941977d59cd1770d..376337dc4f0b3e62d82e5b57492c5d2e0ea14a85 100755 (executable)
@@ -16,6 +16,7 @@
 #include <TopAbs_ShapeEnum.hxx>
 #include <TopoDS_Shape.hxx>
 #include <Prs3d_Drawer.hxx>
+#include <AIS_Shape.hxx>
 
 #include <Quantity_Color.hxx>
 
@@ -311,6 +312,10 @@ void MODULEBASE_EXPORT convertToFeatures(const QObjectPtrList& theObjects, std::
 /// \param theParams a list of parameters (can be empty)
 void MODULEBASE_EXPORT translate(const std::string& theContext, std::string& theMessage);
 
+/// Set Highlighting of points as a Ball shape
+/// \param theAIS - the presentation
+void MODULEBASE_EXPORT setPointBallHighlighting(AIS_Shape* theAIS);
+
 }
 
 #endif
index d23125683ca8ae9868af9b340982a876810e5b84..ccf60f8ae03f377030bd71253211166e982b2e4e 100755 (executable)
@@ -32,6 +32,7 @@
 #include <StdSelect_BRepSelectionTool.hxx>
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Prs3d_LineAspect.hxx>
+#include <Graphic3d_AspectMarker3d.hxx>
 
 #define DEBUG_WIRE
 
@@ -61,6 +62,8 @@ PartSet_ResultSketchPrs::PartSet_ResultSketchPrs(ResultPtr theResult)
   // Activate individual repaintng if this is a part of compsolid
   ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(myResult);
   SetAutoHilight(aCompSolid.get() == NULL);
+
+  ModuleBase_Tools::setPointBallHighlighting(this);
 }
 
 void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
index 48559568c7bb14f265118780cf1ecc7ea514c399..091cd446cca37ed7bf98a69e2582d9049eb59b48 100644 (file)
@@ -186,6 +186,11 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer)
           Handle(AIS_InteractiveObject) anAISPrs = myWorkshop->module()->createPresentation(aResult);
           if (anAISPrs.IsNull())
             anAISPrs = new ModuleBase_ResultPrs(aResult);
+          else {
+            Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(anAISPrs);
+            if (!aShapePrs.IsNull())
+              ModuleBase_Tools::setPointBallHighlighting((AIS_Shape*) aShapePrs.Access());
+          }
           anAIS->setImpl(new Handle(AIS_InteractiveObject)(anAISPrs));
           //anAIS->createShape(aShapePtr);
           isShading = true;