0031779: Visualization, AIS_ViewController - controller should handle selection schemes
authormkrylova <mkrylova@opencascade.com>
Fri, 22 Jan 2021 07:44:42 +0000 (10:44 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 4 Mar 2021 16:43:13 +0000 (19:43 +0300)
Added AIS_ViewController::MouseSelectionSchemes() property defining map of selection schemes for mouse+modifier combinations.
IsXOR flag has been replaced by AIS_SelectionScheme in interfaces.

Rubber-band selection with Shift key pressed now applies XOR selection scheme in in Draw Harness.
Command vselect has been extended to specify selection scheme by name.

22 files changed:
src/AIS/AIS_MouseGesture.hxx
src/AIS/AIS_ViewController.cxx
src/AIS/AIS_ViewController.hxx
src/AIS/AIS_ViewInputBuffer.hxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/bugs/vis/bug10702
tests/bugs/vis/bug22048
tests/bugs/vis/bug23539_2
tests/bugs/vis/bug23649_1
tests/bugs/vis/bug23649_2
tests/bugs/vis/bug23649_3
tests/bugs/vis/bug23649_4
tests/bugs/vis/bug26147
tests/bugs/vis/bug26209
tests/bugs/vis/bug26462_1
tests/bugs/vis/bug26779
tests/bugs/vis/bug727
tests/v3d/materials/bug27818_2
tests/v3d/mesh/A1
tests/v3d/mesh/A2
tests/v3d/mesh/B2
tests/v3d/mesh/B3

index 22c9086..121b746 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef _AIS_MouseGesture_HeaderFile
 #define _AIS_MouseGesture_HeaderFile
 
+#include <AIS_SelectionScheme.hxx>
 #include <NCollection_DataMap.hxx>
 
 //! Mouse gesture - only one can be active at one moment.
@@ -37,5 +38,6 @@ enum AIS_MouseGesture
 
 //! Map defining mouse gestures.
 typedef NCollection_DataMap<unsigned int, AIS_MouseGesture> AIS_MouseGestureMap;
+typedef NCollection_DataMap<unsigned int, AIS_SelectionScheme> AIS_MouseSelectionSchemeMap;
 
 #endif // _AIS_MouseGesture_HeaderFile
index 7dd9c08..3d9ac79 100644 (file)
@@ -128,6 +128,12 @@ AIS_ViewController::AIS_ViewController()
   myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_CTRL,   AIS_MouseGesture_Zoom);
   myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_SHIFT,  AIS_MouseGesture_Pan);
   myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT,    AIS_MouseGesture_SelectRectangle);
+  myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT | Aspect_VKeyFlags_SHIFT, AIS_MouseGesture_SelectRectangle);
+
+  myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton,                          AIS_SelectionScheme_Replace);
+  myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT,   AIS_SelectionScheme_Replace);
+  myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_SHIFT, AIS_SelectionScheme_XOR);
+  myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT | Aspect_VKeyFlags_SHIFT, AIS_SelectionScheme_XOR);
 
   myMouseGestureMap.Bind (Aspect_VKeyMouse_RightButton,                          AIS_MouseGesture_Zoom);
   myMouseGestureMap.Bind (Aspect_VKeyMouse_RightButton | Aspect_VKeyFlags_CTRL,  AIS_MouseGesture_RotateOrbit);
@@ -223,9 +229,9 @@ void AIS_ViewController::flushBuffers (const Handle(AIS_InteractiveContext)& ,
 
   {
     myGL.Selection.Tool   = myUI.Selection.Tool;
-    myGL.Selection.IsXOR  = myUI.Selection.IsXOR;
+    myGL.Selection.Scheme = myUI.Selection.Scheme;
     myGL.Selection.Points = myUI.Selection.Points;
-    myUI.Selection.IsXOR  = false;
+    //myGL.Selection.Scheme = AIS_SelectionScheme_UNKNOWN; // no need
     if (myUI.Selection.Tool == AIS_ViewSelectionTool_Picking)
     {
       myUI.Selection.Points.Clear();
@@ -472,7 +478,7 @@ void AIS_ViewController::UpdateViewOrientation (V3d_TypeOfOrientation theOrienta
 // purpose  :
 // =======================================================================
 void AIS_ViewController::SelectInViewer (const Graphic3d_Vec2i& thePnt,
-                                         const bool theIsXOR)
+                                         const AIS_SelectionScheme theScheme)
 {
   if (myUI.Selection.Tool != AIS_ViewSelectionTool_Picking)
   {
@@ -480,7 +486,7 @@ void AIS_ViewController::SelectInViewer (const Graphic3d_Vec2i& thePnt,
     myUI.Selection.Points.Clear();
   }
 
-  myUI.Selection.IsXOR = theIsXOR;
+  myUI.Selection.Scheme = theScheme;
   myUI.Selection.Points.Append (thePnt);
 }
 
@@ -489,9 +495,9 @@ void AIS_ViewController::SelectInViewer (const Graphic3d_Vec2i& thePnt,
 // purpose  :
 // =======================================================================
 void AIS_ViewController::SelectInViewer (const NCollection_Sequence<Graphic3d_Vec2i>& thePnts,
-                                         const bool theIsXOR)
+                                         const AIS_SelectionScheme theScheme)
 {
-  myUI.Selection.IsXOR = theIsXOR;
+  myUI.Selection.Scheme = theScheme;
   myUI.Selection.Points = thePnts;
   myUI.Selection.ToApplyTool = true;
   if (thePnts.Length() == 1)
@@ -513,11 +519,9 @@ void AIS_ViewController::SelectInViewer (const NCollection_Sequence<Graphic3d_Ve
 // purpose  :
 // =======================================================================
 void AIS_ViewController::UpdateRubberBand (const Graphic3d_Vec2i& thePntFrom,
-                                           const Graphic3d_Vec2i& thePntTo,
-                                           const bool theIsXOR)
+                                           const Graphic3d_Vec2i& thePntTo)
 {
   myUI.Selection.Tool = AIS_ViewSelectionTool_RubberBand;
-  myUI.Selection.IsXOR = theIsXOR;
   myUI.Selection.Points.Clear();
   myUI.Selection.Points.Append (thePntFrom);
   myUI.Selection.Points.Append (thePntTo);
@@ -613,9 +617,10 @@ bool AIS_ViewController::UpdateMouseClick (const Graphic3d_Vec2i& thePoint,
                                            bool theIsDoubleClick)
 {
   (void )theIsDoubleClick;
-  if (theButton == Aspect_VKeyMouse_LeftButton)
+  AIS_SelectionScheme aScheme = AIS_SelectionScheme_UNKNOWN;
+  if (myMouseSelectionSchemes.Find (theButton | theModifiers, aScheme))
   {
-    SelectInViewer (thePoint, (theModifiers & Aspect_VKeyFlags_SHIFT) != 0);
+    SelectInViewer (thePoint, aScheme);
     return true;
   }
   return false;
@@ -713,6 +718,8 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
   }
 
   const AIS_MouseGesture aPrevGesture = myMouseActiveGesture;
+  const Aspect_VKeyMouse aPrevButtons = myMousePressed;
+  const Aspect_VKeyFlags aPrevModifiers = myMouseModifiers;
   myMouseModifiers = theModifiers;
   myMousePressed   = theButtons;
   if (theIsEmulated
@@ -796,11 +803,14 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
      || aPrevGesture == AIS_MouseGesture_ZoomWindow)
     {
       myUI.Selection.ToApplyTool = true;
+      myUI.Selection.Scheme = AIS_SelectionScheme_Replace;
+      myMouseSelectionSchemes.Find (aPrevButtons | aPrevModifiers, myUI.Selection.Scheme);
     }
 
     myUI.IsNewGesture = true;
     toUpdateView = true;
   }
+
   return toUpdateView;
 }
 
@@ -2755,7 +2765,7 @@ void AIS_ViewController::handleSelectionPick (const Handle(AIS_InteractiveContex
         ResetPreviousMoveTo();
       }
 
-      theCtx->SelectDetected (myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
+      theCtx->SelectDetected (myGL.Selection.Scheme);
 
       // selection affects all Views
       theView->Viewer()->Invalidate();
@@ -2859,8 +2869,8 @@ void AIS_ViewController::handleSelectionPoly (const Handle(AIS_InteractiveContex
             theCtx->MainSelector()->AllowOverlapDetection (aPnt1.y() != Min (aPnt1.y(), aPnt2.y()));
             theCtx->SelectRectangle (Graphic3d_Vec2i (Min (aPnt1.x(), aPnt2.x()), Min (aPnt1.y(), aPnt2.y())),
                                      Graphic3d_Vec2i (Max (aPnt1.x(), aPnt2.x()), Max (aPnt1.y(), aPnt2.y())),
-                                      theView,
-                                      myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
+                                     theView,
+                                     myGL.Selection.Scheme);
             theCtx->MainSelector()->AllowOverlapDetection (false);
           }
         }
@@ -2875,8 +2885,7 @@ void AIS_ViewController::handleSelectionPoly (const Handle(AIS_InteractiveContex
             aPolyIter.ChangeValue() = gp_Pnt2d (aNewPnt.x(), -aNewPnt.y());
           }
 
-          theCtx->SelectPolygon (aPolyline, theView,
-                                 myGL.Selection.IsXOR ? AIS_SelectionScheme_XOR : AIS_SelectionScheme_Replace);
+          theCtx->SelectPolygon (aPolyline, theView, myGL.Selection.Scheme);
           theCtx->MainSelector()->AllowOverlapDetection (false);
         }
       }
index bb5636b..7cfcfbc 100644 (file)
@@ -258,6 +258,12 @@ public: //! @name mouse input
   //! Return map defining mouse gestures.
   AIS_MouseGestureMap& ChangeMouseGestureMap() { return myMouseGestureMap; }
 
+  //! Return map defining mouse selection schemes.
+  const AIS_MouseSelectionSchemeMap& MouseSelectionSchemes() const { return myMouseSelectionSchemes; }
+
+  //! Return map defining mouse gestures.
+  AIS_MouseSelectionSchemeMap& ChangeMouseSelectionSchemes() { return myMouseSelectionSchemes; }
+
   //! Return double click interval in seconds; 0.4 by default.
   double MouseDoubleClickInterval() const { return myMouseDoubleClickInt; }
 
@@ -267,25 +273,23 @@ public: //! @name mouse input
   //! Perform selection in 3D viewer.
   //! This method is expected to be called from UI thread.
   //! @param thePnt picking point
-  //! @param theIsXOR XOR selection flag
+  //! @param theScheme selection scheme
   Standard_EXPORT virtual void SelectInViewer (const Graphic3d_Vec2i& thePnt,
-                                               const bool theIsXOR = false);
+                                               const AIS_SelectionScheme theScheme = AIS_SelectionScheme_Replace);
 
   //! Perform selection in 3D viewer.
   //! This method is expected to be called from UI thread.
   //! @param thePnts picking point
-  //! @param theIsXOR XOR selection flag
+  //! @param theScheme selection scheme
   Standard_EXPORT virtual void SelectInViewer (const NCollection_Sequence<Graphic3d_Vec2i>& thePnts,
-                                               const bool theIsXOR = false);
+                                               const AIS_SelectionScheme theScheme = AIS_SelectionScheme_Replace);
 
   //! Update rectangle selection tool.
   //! This method is expected to be called from UI thread.
   //! @param thePntFrom rectangle first   corner
   //! @param thePntTo   rectangle another corner
-  //! @param theIsXOR XOR selection flag
   Standard_EXPORT virtual void UpdateRubberBand (const Graphic3d_Vec2i& thePntFrom,
-                                                 const Graphic3d_Vec2i& thePntTo,
-                                                 const bool theIsXOR = false);
+                                                 const Graphic3d_Vec2i& thePntTo);
 
   //! Update polygonal selection tool.
   //! This method is expected to be called from UI thread.
@@ -772,6 +776,8 @@ protected: //! @name mouse input variables
 
   AIS_MouseGestureMap myMouseGestureMap;          //!< map defining mouse gestures
   AIS_MouseGesture    myMouseActiveGesture;       //!< initiated mouse gesture (by pressing mouse button)
+  AIS_MouseSelectionSchemeMap
+                      myMouseSelectionSchemes;    //!< map defining selection schemes bound to mouse + modifiers
   Standard_Boolean    myMouseActiveIdleRotation;  //!< flag indicating view idle rotation state
   Graphic3d_Vec2i     myMousePositionLast;        //!< last mouse position
   Graphic3d_Vec2i     myMousePressPoint;          //!< mouse position where active gesture was been initiated
index c73b163..9db6fa4 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <Aspect_ScrollDelta.hxx>
 
+#include <AIS_SelectionScheme.hxx>
 #include <Graphic3d_Vec2.hxx>
 #include <NCollection_Sequence.hxx>
 #include <V3d_TypeOfOrientation.hxx>
@@ -65,12 +66,12 @@ public:
   struct _selection
   {
     AIS_ViewSelectionTool Tool;          //!< perform selection
-    bool                  IsXOR;         //!< perform shift selection
+    AIS_SelectionScheme   Scheme;        //!< selection scheme
     NCollection_Sequence<Graphic3d_Vec2i>
                           Points;        //!< the points for selection
     bool                  ToApplyTool;   //!< apply rubber-band selection tool
 
-    _selection() : Tool (AIS_ViewSelectionTool_Picking), IsXOR (false), ToApplyTool (false) {}
+    _selection() : Tool (AIS_ViewSelectionTool_Picking), Scheme (AIS_SelectionScheme_UNKNOWN), ToApplyTool (false) {}
   } Selection;
 
   struct _panningParams
index 1ddf765..29b7d26 100644 (file)
@@ -7603,6 +7603,23 @@ static Standard_Integer VSelect (Draw_Interpretor& ,
         ++anArgIter;
       }
     }
+    else if (anArg == "-replace")
+    {
+      aSelScheme = AIS_SelectionScheme_Replace;
+    }
+    else if (anArg == "-xor"
+          || anArg == "-shift")
+    {
+      aSelScheme = AIS_SelectionScheme_XOR;
+    }
+    else if (anArg == "-add")
+    {
+      aSelScheme = AIS_SelectionScheme_Add;
+    }
+    else if (anArg == "-remove")
+    {
+      aSelScheme = AIS_SelectionScheme_Remove;
+    }
     else if (anArgIter + 1 < theNbArgs
           && anArg.IsIntegerValue()
           && TCollection_AsciiString (theArgVec[anArgIter + 1]).IsIntegerValue())
@@ -7648,11 +7665,12 @@ static Standard_Integer VSelect (Draw_Interpretor& ,
     {
       std::swap (aPnts.ChangeFirst(), aPnts.ChangeLast());
     }
-    aCurrentEventManager->SelectInViewer (aPnts, aSelScheme == AIS_SelectionScheme_XOR);
+
+    aCurrentEventManager->SelectInViewer (aPnts, aSelScheme);
   }
   else
   {
-    aCurrentEventManager->SelectInViewer (aPnts, aSelScheme == AIS_SelectionScheme_XOR);
+    aCurrentEventManager->SelectInViewer (aPnts, aSelScheme);
   }
   aCurrentEventManager->FlushViewEvents (aCtx, ViewerTest::CurrentView(), true);
   return 0;
@@ -15096,7 +15114,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
     "\n\t\t: When -closeOnEscape is specified, view will be closed on pressing Escape.",
     __FILE__, VDiffImage, group);
   theCommands.Add ("vselect",
-    "vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [-allowoverlap 0|1] [shift_selection = 0|1]\n"
+    "vselect x1 y1 [x2 y2 [x3 y3 ... xn yn]] [-allowoverlap 0|1] [-replace|-xor|-add|-remove]\n"
     "- emulates different types of selection:\n"
     "- 1) single click selection\n"
     "- 2) selection with rectangle having corners at pixel positions (x1,y1) and (x2,y2)\n"
@@ -15105,7 +15123,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
     "     If the flag is set to 1, both sensitives that were included completely and overlapped partially by defined \n"
     "     rectangle or polygon will be detected, otherwise algorithm will chose only fully included sensitives.\n"
     "     Default behavior is to detect only full inclusion. (partial inclusion - overlap - is not allowed by default)\n"
-    "- 5) any of these selections with shift button pressed",
+    "- 5) selection scheme replace, xor, add or remove (replace by default)",
     __FILE__, VSelect, group);
   theCommands.Add ("vmoveto",
     "vmoveto [x y] [-reset]"
index 7100c9f..f1575bb 100755 (executable)
@@ -25,8 +25,7 @@ checkcolor $x_coord $y_coord 0 0 0.36
 vselmode m 8 1
 puts "\nSelection of elements is activated"
 
-vselect $x_coord $y_coord 1
-###vselect $x_coord $y_coord 1
+vselect $x_coord $y_coord -xor
 
 meshhidesel m
 puts "\nSelected element is hidden"
index ec92e58..6d75bae 100644 (file)
@@ -12,7 +12,7 @@ vaxo
 vdisplay -dispMode 1 b1 b2
 vfit
 vselprops selHighlight -dispMode -1
-vselect 0 0 400 400 1
+vselect 0 0 400 400 -xor
 if { [vreadpixel  50 300 rgb name] != "GRAY73"        } { puts "Error: b1 should be selected."}
 if { [vreadpixel 300 200 rgb name] != "GRAY73"        } { puts "Error: b2 should be selected."}
 vselect 200 200
index e64fd7a..cc71f86 100644 (file)
@@ -16,14 +16,14 @@ vfit
 vselmode 2 1
 vselect 0 0
 vselect 58 300
-vselect 300 200 300 60 400 60 407 150 1
+vselect 300 200 300 60 400 60 407 150 -xor
 
 set NbSelected1 [vnbselected]
 if { ${NbSelected1} != 13 } {
   puts "Error : Polygonal shift selection doesn't work properly"
 }
 
-vselect 350 120 1
+vselect 350 120 -xor
 
 set NbSelected1 [vnbselected]
 if { ${NbSelected1} != 12 } {
index 9a5d3fb..112f7be 100644 (file)
@@ -21,7 +21,7 @@ vselmode b 2 1
 #select the first edge
 vselect 232 368
 #select the second edge
-vselect 165 278 1
+vselect 165 278 -xor
 vmoveto 0 0 
 vdump ${anImage1}
 
index dddc281..8ad4f04 100644 (file)
@@ -20,7 +20,7 @@ vselmode b 2 1
 #select the first edge
 vselect 232 368
 #select the second edge
-vselect 165 278 1
+vselect 165 278 -xor
 vmoveto 0 0 
 
 #enable 'highlight selected' mode
index 0b7cbb4..bf4faa6 100644 (file)
@@ -21,7 +21,7 @@ vfit
 #select the first shape
 vselect 70 230
 #select the second shape
-vselect 200 358 1
+vselect 200 358 -xor
 vmoveto 0 0
 vdump ${anImage1}
 
index 845286f..4d03d81 100644 (file)
@@ -20,7 +20,7 @@ vfit
 #select the first shape
 vselect 70 230
 #select the second shape
-vselect 200 358 1
+vselect 200 358 -xor
 vmoveto 0 0
 
 #enable 'highlight selected' mode
index 2e3b657..2788fb4 100644 (file)
@@ -39,8 +39,8 @@ vselect 0 0
 
 vselmode b3 4 1
 
-vselect 75 230 235 320 -allowoverlap 0 1
-vselect 350 150 380 170 1
+vselect 75 230 235 320 -allowoverlap 0 -xor
+vselect 350 150 380 170 -xor
 vnbselected
 set aNbSelected3 [vnbselected]
 if {$aNbSelected3 != 4} {
@@ -49,8 +49,8 @@ if {$aNbSelected3 != 4} {
 
 vselect 0 0
 
-vselect  75 230 235 320 -allowoverlap 1 1
-vselect 350 150 380 170 -allowOverlap 1 1
+vselect  75 230 235 320 -allowoverlap 1 -xor
+vselect 350 150 380 170 -allowOverlap 1 -xor
 vnbselected
 set aNbSelected4 [vnbselected]
 if {$aNbSelected4 != 13} {
index f907030..08550c4 100644 (file)
@@ -25,7 +25,7 @@ vselect 0 0
 vfit
 
 vselect 29 104
-vselect 204 2 1
+vselect 204 2 -xor
 vfit -selected
 checkcolor 29 104 0 0 0
 checkcolor 2 317 0.8 0.8 0.8
index 65c147d..d185319 100644 (file)
@@ -21,8 +21,8 @@ vaspects b1 b2 -setWidth 3
 
 vselmode 2 1
 # try to select b1 and b2
-vselect 305 322 1
-vselect 103 322 1
+vselect 305 322 -xor
+vselect 103 322 -xor
 # check that both boxes were not selected with default tolerance value
 set aNbSelected [vnbselected]
 if {$aNbSelected != "0"} {
@@ -43,7 +43,7 @@ if {$aNbSelected != "1"} {
   puts "ERROR: b1 was not selected"
 }
 # try to select b2
-vselect 103 322 1
+vselect 103 322 -xor
 # check that increase of tolerance for b1 doesn't influence
 # on b2
 set aNbSelected [vnbselected]
index 1d618bd..8c31cf2 100644 (file)
@@ -33,7 +33,7 @@ if {$aSize != 3 || [string compare $aItem1 "Locally selected sub-shapes within b
 vdisplay b2
 vfit
 
-vselect 350 120 1
+vselect 350 120 -xor
 set anInfo [split [vstate *] "\n"]
 set aItem1 [string trim [lindex $anInfo 1] ]
 set aItem2 [string trim [lindex $anInfo 2] ]
index 29ad296..cea74d4 100755 (executable)
@@ -21,14 +21,14 @@ set y2 120
 
 vselect 0 0
 vselect ${x1} ${y1}
-vselect ${x2} ${y2} 1
+vselect ${x2} ${y2} -xor
 
 set NbSelected1 [vnbselected]
 if { ${NbSelected1} != 2 } {
   puts "Error : (case 1)"
 }
 
-vselect ${x2} ${y2} 1
+vselect ${x2} ${y2} -xor
 
 set NbSelected1 [vnbselected]
 if { ${NbSelected1} != 1 } {
index b410983..b25291d 100644 (file)
@@ -25,9 +25,9 @@ if {$aColor != "CHOCOLATE3" && abs($aTrsp - 1.0) < 0.1} {
 
 vdump $imagedir/${casename}_dyn.png
 
-vselect 50 200 1
-vselect 200 200 1
-vselect 350 200 1
+vselect 50 200 -xor
+vselect 200 200 -xor
+vselect 350 200 -xor
 
 if {[vreadpixel 350 200 name rgba] != "RED2 1" || [vreadpixel 350 200 name rgba] == [vreadpixel 200 200 name rgba]} {
   puts "ERROR: selection highlight of 3rd box is displayed with wrong color!"
index fd42f01..2dc8b8a 100644 (file)
@@ -1,11 +1,11 @@
 vclear
 meshfromstl m [locate_data_file b.stl]
 vselmode m 8 1
-vselect 150 100 1
-vselect 200 200 1
-vselect 250 250 1
-vselect 200 100 1
-vselect 250 100 1
+vselect 150 100 -xor
+vselect 200 200 -xor
+vselect 250 250 -xor
+vselect 200 100 -xor
+vselect 250 100 -xor
 meshhidesel m
 vrotate -0.9 0 0
 vdump $::imagedir/${::casename}.png
index 4e6efcd..80d6a38 100644 (file)
@@ -1,10 +1,10 @@
 vclear
 meshfromstl m [locate_data_file b.stl]
 vselmode m 8 1
-vselect 150 100 1
-vselect 200 200 1
-vselect 250 250 1
-vselect 200 100 1
-vselect 250 100 1
+vselect 150 100 -xor
+vselect 200 200 -xor
+vselect 250 250 -xor
+vselect 200 100 -xor
+vselect 250 100 -xor
 meshshowsel m
 vdump $::imagedir/${::casename}.png
index 6aa006c..fe39a28 100644 (file)
@@ -3,7 +3,7 @@ mesh3delem m
 vrotate 1.5 0 0
 vrotate 0 0.5 0
 vselmode m 16 1
-vselect 200 200 1
-vselect 200 300 1
+vselect 200 200 -xor
+vselect 200 300 -xor
 meshhidesel m
 vdump $::imagedir/${::casename}.png
index 43037f6..abbab96 100644 (file)
@@ -3,7 +3,7 @@ mesh3delem m
 vrotate 1.5 0 0
 vrotate 0 0.5 0
 vselmode m 16 1
-vselect 200 200 1
-vselect 200 300 1
+vselect 200 200 -xor
+vselect 200 300 -xor
 meshshowsel m
 vdump $::imagedir/${::casename}.png